Show a version number in the UI. Automate things so that the version number originates from the Makefile. Get ready for 0.0.8.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4330 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-06-28 23:00:34 +00:00
parent 6022001d66
commit 8f5201b2bc
6 changed files with 27 additions and 13 deletions

View File

@ -52,6 +52,8 @@ class TfNavigationElement extends LitElement {
show_permissions: {type: Boolean},
status: {type: Object},
spark_lines: {type: Object},
version: {type: Object},
show_version: {type: Boolean},
};
}
@ -128,7 +130,8 @@ class TfNavigationElement extends LitElement {
${k_global_style}
</style>
<div style="margin: 4px; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 3px">
<span>😎</span>
<span style="cursor: pointer" @click=${() => this.show_version = !this.show_version}>😎</span>
<span ?hidden=${!this.show_version} style="flex: 0 0; white-space: nowrap" title=${this.version?.name}>${this.version?.number}</span>
<a accesskey="h" data-tip="Open home app." href="/" style="color: #fff; white-space: nowrap">TF</a>
<a accesskey="a" data-tip="Open apps list." href="/~core/apps/">apps</a>
<a accesskey="e" data-tip="Toggle the app editor." href="#" @click=${this.toggle_edit}>edit</a>
@ -768,6 +771,7 @@ function _receive_websocket_message(message) {
if (window.location.hash) {
send({event: "hashChange", hash: window.location.hash});
}
document.getElementsByTagName('tf-navigation')[0].version = message.version;
send({action: 'enableStats', enabled: true});
} else if (message && message.action == "ping") {
send({action: "pong"});

View File

@ -456,7 +456,7 @@ async function getProcessBlob(blobId, key, options) {
}
broadcastEvent('onSessionBegin', [getUser(process, process)]);
if (process.app) {
process.app.send({action: "ready"});
process.app.send({action: "ready", version: version()});
process.sendPermissions();
}
await process.task.execute({name: appSourceName, source: appSource});