mirror of https://gitee.com/bigwinds/arangodb
ui edition mechanism
This commit is contained in:
parent
282b5ac8b8
commit
5d554f9bf3
|
@ -48,10 +48,12 @@ module.exports = router;
|
||||||
router.get('/config.js', function (req, res) {
|
router.get('/config.js', function (req, res) {
|
||||||
const scriptName = req.get('x-script-name');
|
const scriptName = req.get('x-script-name');
|
||||||
const basePath = req.trustProxy && scriptName || '';
|
const basePath = req.trustProxy && scriptName || '';
|
||||||
|
const isEnterprise = internal.isEnterprise();
|
||||||
res.send(
|
res.send(
|
||||||
`var frontendConfig = ${JSON.stringify({
|
`var frontendConfig = ${JSON.stringify({
|
||||||
basePath: basePath,
|
basePath: basePath,
|
||||||
db: req.database,
|
db: req.database,
|
||||||
|
isEnterprise: isEnterprise,
|
||||||
authenticationEnabled: internal.authenticationEnabled(),
|
authenticationEnabled: internal.authenticationEnabled(),
|
||||||
isCluster: cluster.isCluster()
|
isCluster: cluster.isCluster()
|
||||||
})}`
|
})}`
|
||||||
|
|
|
@ -138,15 +138,6 @@
|
||||||
var currentVersion =
|
var currentVersion =
|
||||||
window.versionHelper.fromString(data.version);
|
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(
|
$('.navbar #currentVersion').html(
|
||||||
' ' + data.version.substr(0, 5) + '<i class="fa fa-exclamation-circle"></i>'
|
' ' + data.version.substr(0, 5) + '<i class="fa fa-exclamation-circle"></i>'
|
||||||
);
|
);
|
||||||
|
|
|
@ -107,6 +107,13 @@
|
||||||
|
|
||||||
self.resize();
|
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;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue