forked from cory/tildefriends
A slightly dynamic administration page. As always, uncertain if this is a good direction.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4062 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
22
core/core.js
22
core/core.js
@ -6,6 +6,19 @@ var gProcessIndex = 0;
|
||||
var gProcesses = {};
|
||||
var gStatsTimer = false;
|
||||
|
||||
const k_global_settings = {
|
||||
index: {
|
||||
type: 'string',
|
||||
default_value: '/~core/apps/',
|
||||
description: 'Default path.',
|
||||
},
|
||||
room: {
|
||||
type: 'boolean',
|
||||
default_value: true,
|
||||
description: 'Whether this instance should behave as a room.',
|
||||
},
|
||||
};
|
||||
|
||||
var gGlobalSettings = {
|
||||
index: "/~core/apps/",
|
||||
};
|
||||
@ -240,6 +253,15 @@ async function getProcessBlob(blobId, key, options) {
|
||||
}
|
||||
};
|
||||
if (process.credentials?.permissions?.administration) {
|
||||
imports.core.globalSettingsDescriptions = function() {
|
||||
let settings = Object.assign({}, k_global_settings);
|
||||
for (let [key, value] of Object.entries(gGlobalSettings)) {
|
||||
if (settings[key]) {
|
||||
settings[key].value = value;
|
||||
}
|
||||
}
|
||||
return settings;
|
||||
};
|
||||
imports.core.globalSettingsGet = function(key) {
|
||||
return gGlobalSettings[key];
|
||||
};
|
||||
|
Reference in New Issue
Block a user