Mike0021 commited on
Commit
6d95389
·
verified ·
1 Parent(s): ab4ce46

Show served Space build in runtime panel

Browse files
Files changed (3) hide show
  1. app.js +8 -0
  2. index.html +1 -0
  3. styles.css +7 -0
app.js CHANGED
@@ -20,6 +20,7 @@ const elements = {
20
  runtimeStatus: $("runtimeStatus"),
21
  runtimeDeviceStatus: $("runtimeDeviceStatus"),
22
  runtimeDeviceDetail: $("runtimeDeviceDetail"),
 
23
  llmModelSelect: $("llmModelSelect"),
24
  asrModelSelect: $("asrModelSelect"),
25
  voiceSelect: $("voiceSelect"),
@@ -415,6 +416,13 @@ async function refreshHostMetadata() {
415
  fetchedAt: new Date().toISOString(),
416
  };
417
  }
 
 
 
 
 
 
 
418
  }
419
 
420
  function setLoadButton(mode) {
 
20
  runtimeStatus: $("runtimeStatus"),
21
  runtimeDeviceStatus: $("runtimeDeviceStatus"),
22
  runtimeDeviceDetail: $("runtimeDeviceDetail"),
23
+ runtimeBuildStatus: $("runtimeBuildStatus"),
24
  llmModelSelect: $("llmModelSelect"),
25
  asrModelSelect: $("asrModelSelect"),
26
  voiceSelect: $("voiceSelect"),
 
416
  fetchedAt: new Date().toISOString(),
417
  };
418
  }
419
+ updateBuildStatus();
420
+ }
421
+
422
+ function updateBuildStatus() {
423
+ const commit = state.hostMetadata.hfSpaceCommit;
424
+ const label = commit ? `Space build ${commit.slice(0, 8)}` : `${location.hostname || "local"} build`;
425
+ elements.runtimeBuildStatus.textContent = label;
426
  }
427
 
428
  function setLoadButton(mode) {
index.html CHANGED
@@ -84,6 +84,7 @@
84
  <span id="runtimeDeviceStatus">Checking runtime</span>
85
  <small id="runtimeDeviceDetail">Adapter probe pending.</small>
86
  </div>
 
87
  <label>
88
  LLM
89
  <select id="llmModelSelect">
 
84
  <span id="runtimeDeviceStatus">Checking runtime</span>
85
  <small id="runtimeDeviceDetail">Adapter probe pending.</small>
86
  </div>
87
+ <div class="build-status" id="runtimeBuildStatus">Build metadata pending.</div>
88
  <label>
89
  LLM
90
  <select id="llmModelSelect">
styles.css CHANGED
@@ -306,6 +306,13 @@ h2 {
306
  color: var(--red);
307
  }
308
 
 
 
 
 
 
 
 
309
  .range-label {
310
  display: flex;
311
  align-items: center;
 
306
  color: var(--red);
307
  }
308
 
309
+ .build-status {
310
+ min-height: 24px;
311
+ color: var(--muted);
312
+ font-size: 12px;
313
+ overflow-wrap: anywhere;
314
+ }
315
+
316
  .range-label {
317
  display: flex;
318
  align-items: center;