2021-12-28 17:48:21 +00:00
|
|
|
async function main() {
|
|
|
|
var apps = await core.apps();
|
2022-01-26 02:49:45 +00:00
|
|
|
var core_apps = await core.apps('core');
|
2021-12-28 17:48:21 +00:00
|
|
|
var doc = `<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<body style="background: #888">
|
|
|
|
<h1>Apps</h1>
|
|
|
|
<ul id="apps"></ul>
|
2022-01-26 02:49:45 +00:00
|
|
|
<h1>Core Apps</h1>
|
|
|
|
<ul id="core_apps"></ul>
|
2021-12-28 17:48:21 +00:00
|
|
|
</body>
|
|
|
|
<script>
|
2022-01-26 02:49:45 +00:00
|
|
|
function populate_apps(id, name, apps) {
|
|
|
|
var list = document.getElementById(id);
|
2022-05-26 00:03:46 +00:00
|
|
|
for (let app of Object.keys(apps).sort()) {
|
2022-01-26 02:49:45 +00:00
|
|
|
var li = list.appendChild(document.createElement('li'));
|
|
|
|
var a = document.createElement('a');
|
|
|
|
a.innerText = app;
|
|
|
|
a.href = '/~' + name + '/' + app + '/';
|
|
|
|
a.target = '_top';
|
|
|
|
li.appendChild(a);
|
|
|
|
}
|
2021-12-28 17:48:21 +00:00
|
|
|
}
|
2022-10-12 12:27:32 +00:00
|
|
|
populate_apps('apps', '${core.user.credentials?.session?.name}', ${JSON.stringify(apps)});
|
2022-01-26 02:49:45 +00:00
|
|
|
populate_apps('core_apps', 'core', ${JSON.stringify(core_apps)});
|
2021-12-28 17:48:21 +00:00
|
|
|
</script>
|
|
|
|
</html>`
|
|
|
|
app.setDocument(doc);
|
|
|
|
}
|
|
|
|
|
|
|
|
main();
|