2022-08-03 20:57:56 -04:00
|
|
|
import * as tfrpc from '/tfrpc.js';
|
|
|
|
|
|
|
|
tfrpc.register(function delete_user(user) {
|
|
|
|
return core.deleteUser(user);
|
|
|
|
});
|
|
|
|
|
2022-08-16 20:29:57 -04:00
|
|
|
tfrpc.register(function global_settings_set(key, value) {
|
|
|
|
return core.globalSettingsSet(key, value);
|
|
|
|
});
|
|
|
|
|
2022-08-03 20:57:56 -04:00
|
|
|
async function main() {
|
2022-08-16 20:29:57 -04:00
|
|
|
let data = {
|
|
|
|
users: {},
|
|
|
|
granted: await core.allPermissionsGranted(),
|
2022-11-30 19:39:05 -05:00
|
|
|
settings: await core.globalSettingsDescriptions(),
|
2022-08-16 20:29:57 -04:00
|
|
|
};
|
2022-08-13 15:39:29 -04:00
|
|
|
for (let user of await core.users()) {
|
|
|
|
data.users[user] = await core.permissionsForUser(user);
|
|
|
|
}
|
2022-08-03 20:57:56 -04:00
|
|
|
await app.setDocument(utf8Decode(getFile('index.html')).replace('$data', JSON.stringify(data)));
|
|
|
|
}
|
|
|
|
main();
|