diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3a4394f5..2631a058 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,6 +7,8 @@ by CI (`.github/workflows/ci.yml`) - suggestions that break them fail the build. ## General Guidelines - Finish the in-flight task before starting new workstreams. - When asked to "take notes" on a future idea, capture it in the notes file only - do not implement it, and do not expand on it at length in replies. +- Use a temp file for multi-line git commit messages instead of heredoc syntax: `git commit -F `. +- Avoid using `powershell.exe -File` for launching scripts, as it fails if the script file is missing or quarantined. ## Naming (LOCKED - the hook rejects violations) diff --git a/frontend/src/components/pluginAssetPanels.js b/frontend/src/components/pluginAssetPanels.js index 08018003..807a2303 100644 --- a/frontend/src/components/pluginAssetPanels.js +++ b/frontend/src/components/pluginAssetPanels.js @@ -19,6 +19,15 @@ export function formatValue(value, spec = {}) { const raw = String(value) return new Date(raw + (raw.length === 10 ? 'T00:00:00' : '')).toLocaleDateString() } + // Timestamps arrive as UTC ISO ("2026-09-04T16:13:29Z") because the wire + // format is UTC by contract. Render in the viewer's local zone: an operator + // comparing "last reported" against the clock on the wall cannot do the + // offset in their head, and the Z suffix invites reading it as local. + if (spec.format === 'datetime') { + const parsed = new Date(String(value)) + if (isNaN(parsed)) return value + return parsed.toLocaleString() + } if (typeof value === 'boolean') return value ? 'Yes' : 'No' return value } diff --git a/frontend/src/utils/siteSettings.js b/frontend/src/utils/siteSettings.js index 6be729ef..5dc9324c 100644 --- a/frontend/src/utils/siteSettings.js +++ b/frontend/src/utils/siteSettings.js @@ -8,6 +8,14 @@ let settingsCache = null let inFlight = null let retryAfter = 0 +// Whether the last resolved load actually produced settings. A caller cannot +// tell that from the value alone: a failed load and a site that simply has not +// configured a key both read as empty, and those want opposite handling - +// hide the feature vs try again. +export function settingsLoadFailed() { + return settingsCache === null +} + // A failed load is cached briefly, not for the page session. A transient blip // used to blank every settings-driven link until the operator reloaded, and // they have no reason to know that would fix it. A short window still bounds a @@ -151,10 +159,14 @@ export async function getServicenowUrls() { // setting instead of waiting for a release. // // Empty is the default and means "no link" - the id still renders as text. +// +// `loaded` distinguishes a real answer from a failed fetch. Both return empty +// strings, but only one of them means "this site has no portal links". export async function getEntraDeviceUrls() { const entraUrl = await getSetting('entra_device_url', '') const intuneUrl = await getSetting('intune_device_url', '') - return { entraUrl, intuneUrl } + const lapsUrl = await getSetting('laps_device_url', '') + return { entraUrl, intuneUrl, lapsUrl, loaded: !settingsLoadFailed() } } // Printer hostname template. {ip} is replaced with the dash-separated IP. diff --git a/plugins/computers/frontend/views/PCDetail.vue b/plugins/computers/frontend/views/PCDetail.vue index 52ff46a6..e8c5bce1 100644 --- a/plugins/computers/frontend/views/PCDetail.vue +++ b/plugins/computers/frontend/views/PCDetail.vue @@ -39,6 +39,7 @@ long for a narrow column and it wrapped into a tall ragged stack. Full width in the normal flow costs one short row. -->
+

{{ computer.assetnumber }}

@@ -70,6 +71,27 @@
+ +
+
+ Status + + {{ liveness.label }} + +
+
+ +
+
+
+ + - @@ -181,7 +212,7 @@ />
-
+
- -
-

Status

-
-
- Logged In User - {{ computer.computer?.loggedinuser || '-' }} -
-
- Last Reported - {{ computer.computer?.lastreporteddate ? formatDate(computer.computer.lastreporteddate) : 'Never' }} -
-
- Last Boot - {{ computer.computer?.lastboottime ? formatDate(computer.computer.lastboottime) : '-' }} -
-
-
+