Skip to content
Snippets Groups Projects
Commit bb51226f authored by Xiao Gui's avatar Xiao Gui
Browse files

feat: add ebrain logo (toggle with USE_LOGO=ebrains)

feat: allow subpath to be set (HOST_PATHNAME=/viewer)
parent b592b5d9
No related branches found
No related tags found
No related merge requests found
const path = require('path')
const express = require('express')
const app = express()
const app = express.Router()
const session = require('express-session')
const MemoryStore = require('memorystore')(session)
const crypto = require('crypto')
app.disable('x-powered-by')
if (process.env.NODE_ENV !== 'production') {
app.use(require('cors')())
}
......@@ -102,7 +100,12 @@ const datasetRouter = require('./datasets')
const pluginRouter = require('./plugins')
const previewRouter = require('./preview')
app.use('/templates', jsonMiddleware, templateRouter)
const setResLocalMiddleWare = routePathname => (req, res, next) => {
res.locals.routePathname = routePathname
next()
}
app.use('/templates', setResLocalMiddleWare('templates'), jsonMiddleware, templateRouter)
app.use('/nehubaConfig', jsonMiddleware, nehubaConfigRouter)
app.use('/datasets', jsonMiddleware, datasetRouter)
app.use('/plugins', jsonMiddleware, pluginRouter)
......@@ -111,4 +114,4 @@ app.use('/preview', jsonMiddleware, previewRouter)
const catchError = require('./catchError')
app.use(catchError)
module.exports = app
module.exports = app
\ No newline at end of file
......@@ -56,7 +56,16 @@ if (process.env.FLUENT_HOST) {
}
}
const server = require('express')()
const app = require('./app')
const PORT = process.env.PORT || 3000
app.listen(PORT, () => console.log(`listening on port ${PORT}`))
\ No newline at end of file
// e.g. HOST_PATHNAME=/viewer
// n.b. leading slash is important
const HOST_PATHNAME = process.env.HOST_PATHNAME || ''
server.disable('x-powered-by')
server.use(HOST_PATHNAME, app)
server.listen(PORT, () => console.log(`listening on port ${PORT}`))
\ No newline at end of file
......@@ -2,16 +2,19 @@ const router = require('express').Router()
const query = require('./query')
const path = require('path')
const { detEncoding } = require('nomiseco')
const url = require('url')
/**
* root path fetches all templates
*/
router.get('/', (req, res, next) => {
const baseUrl = req.baseUrl
query.getAllTemplates()
.then(templates => {
const templatesRes = templates.map(v => path.join(baseUrl.slice(1), v))
res.status(200).send(JSON.stringify(templatesRes))
const templatesRes = templates.map(v => {
return url.resolve(`${res.locals.routePathname}/`, v)
})
res.status(200).json(templatesRes)
})
.catch(error => next({
code: 500,
......
......@@ -11,7 +11,7 @@
"build-min": "webpack --config webpack.prod.js",
"build": "webpack --config webpack.dev.js",
"plugin-server": "node ./src/plugin_examples/server.js",
"dev-server": "webpack-dev-server --config webpack.dev.js --mode development",
"dev-server": "BACKEND_URL=http://localhost:3000/viewer/ webpack-dev-server --config webpack.dev.js --mode development",
"dev": "npm run dev-server & (cd deploy; node server.js)",
"dev-server-aot": "PRODUCTION=true GIT_HASH=`git log --pretty=format:'%h' --invert-grep --grep=^.ignore -1` webpack-dev-server --config webpack.aot.js",
"dev-server-all-interfaces": "webpack-dev-server --config webpack.dev.js --mode development --hot --host 0.0.0.0",
......
/*@import "~@angular/material/prebuilt-themes/indigo-pink.css";*/
:host-context([darktheme="true"]) ul
{
background-color:rgba(30,30,30);
......
......@@ -8,7 +8,7 @@ import { enableProdMode } from '@angular/core';
const requireAll = (r:any) => {r.keys().forEach(r)}
requireAll(require.context('./res/ext', false, /\.json$/))
requireAll(require.context('./res/images', true, /\.jpg|\.png/))
requireAll(require.context('./res/images', true, /\.jpg$|\.png$|\.svg$/))
requireAll(require.context(`./plugin_examples`, true))
/* aot === production mode */
......
......@@ -8,7 +8,7 @@ import { MainModule } from './main.module';
const requireAll = (r:any) => {r.keys().forEach(r)}
requireAll(require.context('./res/ext',false, /\.json$/))
requireAll(require.context('./res/images',true,/\.jpg|\.png/))
requireAll(require.context('./res/images',true,/\.jpg$|\.png$|\.svg$/))
requireAll(require.context(`./plugin_examples`, true))
platformBrowserDynamic().bootstrapModule(MainModule)
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="195.36511mm"
height="72.386971mm"
viewBox="0 0 195.36511 72.386971"
version="1.1"
id="svg10463"
inkscape:version="0.92.4 (f8dce91, 2019-08-02)"
sodipodi:docname="ebrains-logo-light.svg">
<defs
id="defs10457" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="360.62249"
inkscape:cy="-188.92002"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1853"
inkscape:window-height="1025"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata10460">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-10.418633,-26.461277)">
<path
inkscape:connector-curvature="0"
id="path9759"
d="m 100.86129,53.406057 h 11.58381 v 2.399165 h -8.79602 v 5.630664 h 8.19242 v 2.389516 h -8.19242 v 5.656851 h 8.90489 v 2.400543 h -11.69268 z m 0,0"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9761"
d="m 122.98846,69.491897 c 2.68027,0 3.73585,-1.164442 3.73585,-2.716109 0,-1.759761 -1.39869,-3.202566 -3.63665,-3.202566 h -4.12309 v 5.918675 z m -0.288,-8.093216 c 1.87688,0 3.33759,-1.136883 3.33759,-2.922821 0,-1.533755 -1.05558,-2.696821 -3.26594,-2.696821 h -3.80754 v 5.619642 z m -6.52364,-7.992624 h 6.76755 c 3.9329,0 5.82771,2.119424 5.82771,4.853451 0,2.309593 -1.41662,3.464388 -3.11298,3.897093 v 0.18052 c 1.83141,0.09922 3.83508,1.714283 3.83508,4.573713 0,2.833245 -1.94028,4.971962 -6.23425,4.971962 h -7.08311 z m 0,0"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9763"
d="m 139.11563,62.491463 c 2.71614,0 3.853,-1.209916 3.853,-3.29351 0,-2.093243 -1.13686,-3.402375 -3.88881,-3.402375 h -3.50022 v 6.695885 z m -6.32379,-9.085406 h 6.58562 c 4.28572,0 6.39685,2.389521 6.39685,5.791896 0,2.480469 -1.12723,4.367001 -3.39273,5.204849 l 4.09691,7.479994 h -3.17638 l -3.75239,-6.992166 h -3.97012 v 6.992166 h -2.78776 z m 0,0"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9765"
d="m 158.834,64.646716 -2.7244,-7.885133 h -0.14467 l -2.7244,7.885133 z m -11.06015,7.23608 6.64905,-18.476739 h 3.22048 l 6.64901,18.476739 h -2.95864 l -1.68811,-4.890659 h -7.21678 l -1.69637,4.890659 z m 0,0"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9767"
d="m 169.7384,71.882796 h -2.78776 V 53.406057 h 2.78776 z m 0,0"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9769"
d="m 188.70987,71.882796 h -2.56318 l -9.39133,-13.551628 h -0.17085 v 13.551628 h -2.78779 V 53.406057 h 2.57969 l 9.40099,13.568168 h 0.17085 V 53.406057 h 2.76162 z m 0,0"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9771"
d="m 199.01758,55.562687 c -2.27376,0 -3.7083,1.163063 -3.7083,2.732648 -0.008,1.768025 1.91273,2.444642 3.35689,2.815333 l 1.80386,0.468535 c 2.34541,0.577398 5.31372,1.867242 5.31372,5.196585 0,3.130901 -2.49838,5.412933 -6.83782,5.412933 -4.14101,0 -6.73033,-2.065679 -6.91088,-5.412933 h 2.79604 c 0.16263,2.011934 1.94857,2.968291 4.09554,2.968291 2.37299,0 4.09554,-1.190625 4.09554,-2.994475 0,-1.642624 -1.52411,-2.291681 -3.49885,-2.815334 l -2.18419,-0.595312 c -2.96831,-0.8034 -4.80797,-2.309593 -4.80797,-4.881013 0,-3.184644 2.84152,-5.30407 6.54981,-5.30407 3.75239,0 6.3693,2.146985 6.45061,5.105633 h -2.68855 c -0.19844,-1.704634 -1.70603,-2.696821 -3.82545,-2.696821"
style="fill:#0f0f0f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9773"
d="m 46.260668,26.461277 -17.89384,4.890657 -13.0514,13.183693 -4.71149,17.94068 4.89204,17.893823 13.02519,12.960449 17.91864,5.517666 18.07436,-5.607238 12.95908,-13.026593 4.80243,-18.097779 -4.892,-17.893823 -13.18094,-13.050022 z m 0,0"
style="fill:#191919;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path9775"
d="m 76.643658,81.048127 c -2.08637,-0.618741 -4.15618,-1.295358 -6.19979,-2.065679 -5.97105,-2.254472 -10.86996,-6.299012 -16.86168,-8.429458 -5.49561,-1.952683 -11.2696,-3.166735 -17.01603,-4.107932 -1.29811,-0.213599 -2.64996,-0.508498 -3.9715,-0.498854 -3.67936,0.02617 -6.44094,2.30684 -8.37018,5.222768 -2.01196,3.037197 -4.95681,7.240211 -8.55486,9.373412"
style="fill:none;stroke:#ffffff;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9777"
d="m 77.582118,79.803757 c -2.3482,-0.666969 -4.67985,-1.397328 -6.97703,-2.244823 -5.84288,-2.156629 -10.77351,-5.921428 -16.51441,-8.335751 -4.7432,-1.9954 -9.6435,-3.875046 -14.59205,-5.304071 -5.2958,-1.529625 -9.61732,0.846116 -13.37797,4.289834 -2.32477,2.129067 -4.73357,4.186478 -7.28158,6.046829 -1.22506,0.89435 -2.69268,2.024338 -4.24984,2.849785"
style="fill:none;stroke:#ffffff;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9779"
d="m 77.954158,78.406429 c -2.5218,-0.68902 -5.02292,-1.446943 -7.48411,-2.341287 -5.60448,-2.036742 -10.47585,-5.849771 -15.65452,-8.771213 -4.12859,-2.330263 -9.14191,-6.163967 -14.01191,-6.688998 -5.67337,-0.611852 -9.70138,2.881476 -14.19651,5.670626 -3.0014,1.861729 -6.03169,3.687629 -9.14192,5.363325 -1.10243,0.593937 -2.42948,1.429025 -3.79512,2.051899"
style="fill:none;stroke:#ffffff;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9781"
d="m 78.298678,77.10556 c -2.70235,-0.680752 -5.38124,-1.446943 -7.99677,-2.428105 -5.86076,-2.19797 -10.78727,-7.249858 -15.57182,-11.142814 -4.82314,-3.924655 -9.66692,-8.320596 -16.40279,-5.323364 -4.04865,1.801095 -7.98572,3.890203 -11.99307,5.782249 -3.40236,1.605415 -6.81302,3.197049 -10.26498,4.689466 -0.97289,0.420298 -2.15251,1.070734 -3.34451,1.553048"
style="fill:none;stroke:#ffffff;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9783"
d="m 78.648698,75.788155 c -3.04546,-0.704176 -6.05648,-1.528244 -8.94072,-2.718869 -7.09687,-2.928332 -10.5089,-10.322887 -14.92967,-16.038987 -3.6697,-4.745964 -9.72481,-3.097829 -14.37569,-1.293977 -5.5893,2.167652 -11.18415,4.325662 -16.78862,6.453352 -3.11852,1.185111 -6.23838,2.366092 -9.37479,3.50435 -0.71797,0.260448 -1.59441,0.694533 -2.47361,1.029397"
style="fill:none;stroke:#ffffff;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9785"
d="m 79.191668,73.739012 c -3.70279,-0.723468 -7.36565,-1.666049 -10.62193,-3.436826 -5.4846,-2.980698 -7.61369,-9.526382 -10.92235,-14.495585 -2.26134,-3.394109 -6.32379,-5.470813 -10.35869,-4.362869 -1.66193,0.456131 -3.29766,1.054199 -4.93889,1.577851 -6.76067,2.160765 -13.52133,4.320151 -20.28059,6.480916 -3.76481,1.20165 -7.52824,2.404674 -11.29302,3.607702"
style="fill:none;stroke:#ffffff;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9787"
d="m 79.784188,71.50659 c -4.20712,-1.278821 -8.29578,-2.790526 -11.90346,-5.503884 -4.68397,-3.525023 -8.25997,-8.695423 -12.16258,-13.021085 -4.06661,-4.507562 -9.16259,-4.252623 -14.34401,-2.473579 -6.10472,2.095997 -12.19976,4.227822 -18.26588,6.432685 -3.50573,1.276064 -7.01146,2.563148 -10.47034,3.964614 -0.45752,0.186034 -1.10243,0.38585 -1.78456,0.621496"
style="fill:none;stroke:#ffffff;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9789"
d="m 80.859068,67.457915 c -3.86126,-1.473124 -7.69221,-3.006882 -11.26959,-5.112523 -5.65961,-3.333475 -10.24019,-8.060145 -15.21217,-12.300371 -4.69498,-4.005954 -9.85985,-3.999064 -15.40922,-1.933384 -5.43222,2.022958 -10.83963,4.118955 -16.18919,6.349999 -3.1805,1.325671 -6.35412,2.685796 -9.44231,4.219552 -0.58705,0.290766 -1.28019,0.598069 -1.983,0.941199"
style="fill:none;stroke:#ffffff;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9791"
d="m 82.064858,62.90901 c -9.00687,-4.499296 -17.77393,-9.321052 -26.47762,-14.410147 -5.3013,-3.097829 -10.43725,-5.827723 -16.81209,-3.595299 -4.1589,1.455208 -8.24477,3.210828 -12.27966,4.970582 -3.52228,1.536513 -7.02388,3.147437 -10.39044,5.000899 -1.30774,0.719336 -2.80843,1.496552 -4.14514,2.437752"
style="fill:none;stroke:#ffffff;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9793"
d="m 81.552238,59.473562 c -4.14792,-2.541106 -8.29719,-5.038109 -12.68899,-7.167179 -4.34495,-2.108397 -8.847,-3.927408 -13.27464,-5.852527 -4.7184,-2.049145 -9.21081,-4.595759 -14.50661,-4.429015 -4.88513,0.152961 -9.39133,2.611381 -13.69907,4.705999 -4.78454,2.326128 -10.67844,4.967827 -14.94483,8.761568"
style="fill:none;stroke:#ffffff;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path9795"
d="m 80.430508,55.367006 c -3.70416,-2.831868 -7.37802,-5.519043 -11.72435,-7.442782 -4.03077,-1.781807 -8.43361,-2.824981 -12.64627,-4.081752 -3.89982,-1.165818 -7.78867,-2.479089 -11.72849,-3.501595 -5.63478,-1.464853 -11.00226,0.294901 -15.9687,2.841516 -5.32197,2.729893 -11.00638,5.988953 -15.42573,10.28981"
style="fill:none;stroke:#ffffff;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="195.36647mm"
height="72.386963mm"
viewBox="0 0 195.36647 72.386963"
version="1.1"
id="svg10559"
inkscape:version="0.92.4 (f8dce91, 2019-08-02)"
sodipodi:docname="ebrains-logo-dark.svg">
<defs
id="defs10553" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="352.05365"
inkscape:cy="-37.491452"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1853"
inkscape:window-height="1025"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1" />
<metadata
id="metadata10556">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-12.685806,-66.526755)">
<path
inkscape:connector-curvature="0"
id="path10007"
d="m 103.12986,93.471535 h 11.58378 V 95.8707 h -8.79602 v 5.63066 h 8.19107 v 2.38952 h -8.19107 v 5.65685 h 8.90351 v 2.40054 h -11.69127 z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10009"
d="m 125.257,109.55737 c 2.67892,0 3.73451,-1.16444 3.73451,-2.71611 0,-1.75976 -1.39873,-3.20256 -3.63527,-3.20256 h -4.1231 v 5.91867 z m -0.28938,-8.09321 c 1.87688,0 3.339,-1.13689 3.339,-2.922819 0,-1.53376 -1.05558,-2.696824 -3.26594,-2.696824 h -3.80754 v 5.619643 z m -6.52227,-7.992625 h 6.76618 c 3.93294,0 5.82774,2.119424 5.82774,4.853446 0,2.309599 -1.41527,3.464389 -3.11164,3.897099 v 0.18052 c 1.83145,0.0992 3.83371,1.71428 3.83371,4.57371 0,2.83324 -1.9389,4.97196 -6.23422,4.97196 h -7.08177 z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10011"
d="m 141.3842,102.55694 c 2.71473,0 3.85159,-1.20992 3.85159,-3.293512 0,-2.093237 -1.13686,-3.402372 -3.88743,-3.402372 h -3.5016 v 6.695884 z m -6.3252,-9.085405 h 6.58703 c 4.28431,0 6.39548,2.389521 6.39548,5.791893 0,2.480472 -1.12724,4.367002 -3.39136,5.204852 l 4.09553,7.47999 h -3.175 l -3.7538,-6.99216 h -3.97012 v 6.99216 H 135.059 Z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10013"
d="m 161.10254,104.71219 -2.72578,-7.885129 h -0.1433 l -2.72439,7.885129 z m -11.06153,7.23608 6.64905,-18.476735 h 3.22048 l 6.64904,18.476735 h -2.95867 l -1.6867,-4.89066 h -7.21815 l -1.69499,4.89066 z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10015"
d="M 172.00559,111.94827 H 169.2178 V 93.471535 h 2.78779 z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10017"
d="m 190.97703,111.94827 h -2.56177 l -9.39133,-13.551629 h -0.17226 v 13.551629 h -2.78776 V 93.471535 h 2.58107 l 9.39958,13.568165 h 0.17227 V 93.471535 h 2.7602 z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10019"
d="m 201.28477,95.628165 c -2.27242,0 -3.70695,1.163063 -3.70695,2.732646 -0.01,1.768029 1.91272,2.444639 3.35555,2.815329 l 1.80382,0.46854 c 2.34682,0.5774 5.31509,1.86724 5.31509,5.19658 0,3.1309 -2.49975,5.41294 -6.83919,5.41294 -4.14101,0 -6.73033,-2.06568 -6.91085,-5.41294 h 2.79742 c 0.1626,2.01194 1.94854,2.96829 4.0955,2.96829 2.373,0 4.09554,-1.19062 4.09554,-2.99447 0,-1.64262 -1.5241,-2.29168 -3.50022,-2.81533 l -2.18282,-0.59532 c -2.96827,-0.8034 -4.80934,-2.30959 -4.80934,-4.881009 0,-3.184642 2.84152,-5.304068 6.54981,-5.304068 3.7538,0 6.3693,2.146985 6.45061,5.105628 h -2.68855 c -0.19844,-1.704629 -1.70462,-2.696816 -3.82542,-2.696816"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10021"
d="m 48.527842,66.526755 -17.89243,4.890657 -13.051401,13.183693 -4.7129,17.940675 4.89204,17.89383 13.025225,12.96045 17.918608,5.51766 18.074357,-5.60724 12.960455,-13.02659 4.801093,-18.09778 -4.89204,-17.89382 -13.180942,-13.050022 z m 0,0"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775" />
<path
inkscape:connector-curvature="0"
id="path10023"
d="m 78.910827,121.1136 c -2.086326,-0.61874 -4.156146,-1.29536 -6.198412,-2.06568 -5.972421,-2.25447 -10.869964,-6.29901 -16.86306,-8.42945 -5.494229,-1.95269 -11.269591,-3.16674 -17.015987,-4.10794 -1.296741,-0.21359 -2.648585,-0.50849 -3.971502,-0.49885 -3.679366,0.0262 -6.439605,2.30684 -8.370217,5.22277 -2.010551,3.03719 -4.95681,7.24021 -8.554861,9.37341"
style="fill:none;stroke:#191919;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10025"
d="m 79.850662,119.86923 c -2.349569,-0.66697 -4.681183,-1.39733 -6.978401,-2.24482 -5.842884,-2.15663 -10.772106,-5.92143 -16.514411,-8.33575 -4.743204,-1.9954 -9.64212,-3.87505 -14.592017,-5.30407 -5.294418,-1.52963 -9.617357,0.84611 -13.376628,4.28983 -2.326146,2.12907 -4.734947,4.18648 -7.28292,6.04683 -1.223716,0.89435 -2.691307,2.02434 -4.249874,2.84979"
style="fill:none;stroke:#191919;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10027"
d="m 80.221362,118.4719 c -2.521831,-0.68902 -5.022956,-1.44694 -7.484145,-2.34128 -5.6031,-2.03674 -10.475843,-5.84977 -15.653139,-8.77122 -4.128592,-2.33026 -9.143259,-6.16396 -14.013248,-6.68899 -5.671998,-0.61185 -9.700014,2.88147 -14.195179,5.67062 -3.001363,1.86173 -6.031689,3.68763 -9.143294,5.36333 -1.102431,0.59393 -2.429476,1.42902 -3.795116,2.0519"
style="fill:none;stroke:#191919;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10029"
d="m 80.565849,117.17104 c -2.702314,-0.68076 -5.37986,-1.44695 -7.995356,-2.42811 -5.862177,-2.19797 -10.788685,-7.24986 -15.571822,-11.14281 -4.824519,-3.924662 -9.666957,-8.320597 -16.404167,-5.323369 -4.047313,1.801099 -7.985759,3.890209 -11.993068,5.782249 -3.401024,1.60542 -6.811644,3.19705 -10.265021,4.68947 -0.972894,0.4203 -2.152504,1.07073 -3.343134,1.55305"
style="fill:none;stroke:#191919;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10031"
d="m 80.915874,115.85363 c -3.04546,-0.70418 -6.055077,-1.52824 -8.940694,-2.71887 C 64.879656,110.20643 61.466248,102.81188 57.046896,97.095781 53.37716,92.349813 47.320707,93.997948 42.671203,95.8018 c -5.590717,2.167651 -11.184186,4.32566 -16.790036,6.45335 -3.118485,1.18511 -6.238381,2.36609 -9.373406,3.50435 -0.71794,0.26045 -1.59576,0.69453 -2.47495,1.0294"
style="fill:none;stroke:#191919;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10033"
d="m 81.458836,113.80449 c -3.70279,-0.72347 -7.365613,-1.66605 -10.621928,-3.43683 -5.483225,-2.9807 -7.612274,-9.52638 -10.922317,-14.495581 -2.26,-3.394109 -6.323825,-5.470813 -10.357342,-4.362869 -1.663277,0.456131 -3.297661,1.054199 -4.940266,1.577851 -6.759293,2.160765 -13.519926,4.32015 -20.280594,6.480917 -3.763434,1.201652 -7.528208,2.404672 -11.293018,3.607702"
style="fill:none;stroke:#191919;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10035"
d="M 82.051397,111.57207 C 77.844239,110.29324 73.75699,108.78154 70.149275,106.06818 65.463927,102.54316 61.889301,97.372761 57.986696,93.047099 53.920119,88.539537 48.824141,88.794476 43.64134,90.57352 c -6.104713,2.095997 -12.19842,4.227822 -18.265915,6.432681 -3.505729,1.27607 -7.011458,2.563147 -10.468964,3.964619 -0.45886,0.18603 -1.1038,0.38585 -1.78594,0.62149"
style="fill:none;stroke:#191919;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10037"
d="M 83.126275,107.52339 C 79.26498,106.05027 75.435438,104.51651 71.858023,102.41087 66.197069,99.077391 61.616462,94.350725 56.645894,90.110499 51.950916,86.104545 46.784627,86.111435 41.235291,88.177115 c -5.432249,2.022958 -10.838286,4.118955 -16.189219,6.349999 -3.180504,1.325671 -6.354128,2.685797 -9.440931,4.219547 -0.58702,0.29077 -1.28157,0.598067 -1.98438,0.941197"
style="fill:none;stroke:#191919;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10039"
d="M 84.33341,102.97449 C 75.32657,98.475191 66.558101,93.653436 57.855781,88.564341 52.554483,85.466512 47.418532,82.736618 41.042356,84.969042 c -4.158932,1.455208 -8.244804,3.210828 -12.2797,4.970582 -3.520898,1.536513 -7.023876,3.147437 -10.390399,5.000899 -1.306406,0.719336 -2.807086,1.496552 -4.145136,2.437748"
style="fill:none;stroke:#191919;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10041"
d="M 83.820788,99.539038 C 79.672899,96.997931 75.522256,94.500931 71.130419,92.371861 66.785468,90.263464 62.283424,88.444453 57.855781,86.519334 53.138752,84.470189 48.645,81.923575 43.349171,82.090319 38.46542,82.24328 33.957873,84.7017 29.650104,86.796318 24.866931,89.122446 18.971697,91.764145 14.705271,95.557886"
style="fill:none;stroke:#191919;stroke-width:0.35277775;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path10043"
d="M 82.697684,95.432484 C 78.993518,92.600616 75.321067,89.913441 70.973327,87.989702 66.943969,86.207895 62.539752,85.164721 58.328467,83.90795 54.427238,82.742132 50.539803,81.428861 46.598606,80.406355 40.963794,78.941502 35.596349,80.701256 30.631285,83.247871 25.309279,85.977764 19.623489,89.236824 15.205511,93.537681"
style="fill:none;stroke:#191919;stroke-width:0.7055555;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1" />
</g>
</svg>
import { Component } from "@angular/core";
import { Component, HostBinding } from "@angular/core";
@Component({
selector : 'logo-container',
......@@ -9,5 +9,12 @@ import { Component } from "@angular/core";
})
export class LogoContainer{
// only used to define size
public imgSrc = USE_LOGO === 'hbp'
? 'res/image/HBP_Primary_RGB_WhiteText.png'
: USE_LOGO === 'ebrains'
? `res/image/ebrains-logo-light.svg`
: null
public useLogo = USE_LOGO
}
\ No newline at end of file
:host-context([darktheme="true"]) [uselogo="ebrains"][hbpLogoContainer]
{
background-image:url('res/image/ebrains-logo-light.svg')
}
:host-context([darktheme="false"]) [uselogo="ebrains"][hbpLogoContainer]
{
background-image:url('res/image/ebrains-logo-dark.svg')
}
:host-context([darktheme="true"]) [hbpLogoContainer]
:host-context([darktheme="true"]) [uselogo="hbp"][hbpLogoContainer]
{
background-image:url('res/image/HBP_Primary_RGB_WhiteText.png')
}
:host-context([darktheme="false"]) [hbpLogoContainer]
:host-context([darktheme="false"]) [uselogo="hbp"][hbpLogoContainer]
{
background-image:url('res/image/HBP_Primary_RGB_BlackText.png')
}
......
<span hbpLogoContainer>
<img src = "res/image/HBP_Primary_RGB_WhiteText.png" />
<span [attr.uselogo]="useLogo" hbpLogoContainer>
<img [src]="imgSrc" />
</span>
\ No newline at end of file
......@@ -12,4 +12,5 @@ declare var PLUGINDEV : string
declare var BUNDLEDPLUGINS : string[]
declare var VERSION : string
declare var PRODUCTION: boolean
declare var BACKEND_URL: string
\ No newline at end of file
declare var BACKEND_URL: string
declare var USE_LOGO: string
\ No newline at end of file
......@@ -15,7 +15,7 @@ module.exports = {
]
},
{
test : /jpg|png/,
test : /\.jpg$|\.png$|\.svg$/,
exclude : /export\_nehuba|index/,
use : {
loader : 'file-loader',
......@@ -47,15 +47,6 @@ module.exports = {
context : 'src'
}
}]
},
{
test: /indigo-pink\.css/,
use: {
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
}
}
]
},
......@@ -78,9 +69,9 @@ module.exports = {
PRODUCTION: process.env.PRODUCTION
? true
: false,
BACKEND_URL: JSON.stringify(process.env.BACKEND_URL || 'http://localhost:3000/')
BACKEND_URL: JSON.stringify(process.env.BACKEND_URL || ''),
USE_LOGO: JSON.stringify(process.env.USE_LOGO || 'ebrains' || 'hbp')
})
// ...ignoreArr.map(dirname => new webpack.IgnorePlugin(/\.\/plugin_examples/))
],
resolve: {
extensions: [
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment