1
0
Fork 0

ui edition mechanism

This commit is contained in:
hkernbach 2016-10-17 11:55:34 +02:00
parent 282b5ac8b8
commit 5d554f9bf3
3 changed files with 9 additions and 9 deletions

View File

@ -48,10 +48,12 @@ module.exports = router;
router.get('/config.js', function (req, res) {
const scriptName = req.get('x-script-name');
const basePath = req.trustProxy && scriptName || '';
const isEnterprise = internal.isEnterprise();
res.send(
`var frontendConfig = ${JSON.stringify({
basePath: basePath,
db: req.database,
isEnterprise: isEnterprise,
authenticationEnabled: internal.authenticationEnabled(),
isCluster: cluster.isCluster()
})}`

View File

@ -138,15 +138,6 @@
var currentVersion =
window.versionHelper.fromString(data.version);
if (data.license) {
window.frontendConfig.license = data.license;
if (data.license !== 'community') {
$('#ArangoDBLogo').attr('src', 'img/arangodb_logo_alt.svg');
} else {
$('.enterprise-menu').show();
}
}
$('.navbar #currentVersion').html(
' ' + data.version.substr(0, 5) + '<i class="fa fa-exclamation-circle"></i>'
);

View File

@ -107,6 +107,13 @@
self.resize();
console.log(window.frontendConfig);
if (window.frontendConfig.isEnterprise === true) {
$('#ArangoDBLogo').attr('src', 'img/arangodb_logo_alt.svg');
} else {
$('.enterprise-menu').show();
}
return this;
},