@7365admin1/layer-common 4.97.1-staging.620 → 4.97.1-staging.621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,18 +78,23 @@
|
|
|
78
78
|
</details>
|
|
79
79
|
|
|
80
80
|
<details class="hero-can hero-can--fold">
|
|
81
|
-
|
|
81
|
+
<!-- Power schedule and lifts only when the brand sends them (VIGGO has neither: no lift protocol). -->
|
|
82
|
+
<summary class="hero-can__title">{{ has.has("power") || has.has("lifts") ? "Parts wear, power schedule and lifts" : "Parts wear" }}</summary>
|
|
82
83
|
<div class="hero-sched__note">Parts wear (hours worked since last reset in {{ makerApp }})</div>
|
|
83
84
|
<div v-if="!parts.length" class="hero-sched__empty">No parts reported.</div>
|
|
84
85
|
<div v-for="p in parts" :key="p.key" class="hero-sched__row"><b>{{ p.part }}</b><span>{{ p.worked }}</span><span>{{ p.days }}</span></div>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
86
|
+
<template v-if="has.has('power')">
|
|
87
|
+
<div class="hero-sched__note mt-2">Timed switch on / off</div>
|
|
88
|
+
<div v-if="!power.length" class="hero-sched__empty">No timed switch on / off.</div>
|
|
89
|
+
<div v-for="p in power" :key="p.key" class="hero-sched__row">
|
|
90
|
+
<b>{{ p.days }}</b><span>{{ p.time }}</span><span>{{ p.action }}{{ p.enabled ? "" : " · off" }}</span>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
<template v-if="has.has('lifts')">
|
|
94
|
+
<div class="hero-sched__note mt-2">Lifts linked in {{ makerApp }}</div>
|
|
95
|
+
<div v-if="!lifts.length" class="hero-sched__empty">No lifts linked to this robot's building.</div>
|
|
96
|
+
<div v-for="l in lifts" :key="l.key" class="hero-sched__row"><b>{{ l.name }}</b><span>{{ l.state }}</span></div>
|
|
97
|
+
</template>
|
|
93
98
|
</details>
|
|
94
99
|
|
|
95
100
|
<details v-if="has.has('mapVersions') || has.has('mapHistory') || has.has('mapLayers') || has.has('obstacles')" class="hero-can hero-can--fold">
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
89
|
</div>
|
|
90
|
+
<div v-if="modelsNote" class="hero-dialog__note">{{ modelsNote }}</div>
|
|
90
91
|
<div class="hero-dialog__note">{{ credentialsNote(credentialsEncrypted) }} Capability: {{ note }}</div>
|
|
91
92
|
<div v-if="error" class="hero-notice hero-notice--error" role="alert">{{ error }}</div>
|
|
92
93
|
<div class="hero-dialog__actions">
|
|
@@ -111,6 +112,7 @@ import { credentialsNote } from "../../utils/robot-floorplan";
|
|
|
111
112
|
import {
|
|
112
113
|
credentialDiscoverable,
|
|
113
114
|
credentialLabels,
|
|
115
|
+
credentialModelsNote,
|
|
114
116
|
credentialTokenPlaceholder,
|
|
115
117
|
credentialMissingMessage,
|
|
116
118
|
credentialTokenDefault,
|
|
@@ -205,6 +207,7 @@ watch(
|
|
|
205
207
|
},
|
|
206
208
|
{ immediate: true },
|
|
207
209
|
);
|
|
210
|
+
const modelsNote = computed(() => credentialModelsNote(brand.value, brands.value));
|
|
208
211
|
const note = computed(() => capabilityNote(options.value.find((o) => o.value === brand.value)?.capabilities, type.value));
|
|
209
212
|
|
|
210
213
|
const siteOptions = computed(() => {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.97.1-staging.
|
|
5
|
+
"version": "4.97.1-staging.621",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
|
@@ -43,6 +43,17 @@ export function credentialTokenPlaceholder(brand: unknown, saved: unknown): stri
|
|
|
43
43
|
return brand === "viggo" && saved !== true ? "Type each robot's VIN, separated by commas" : null;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The models a brand's connection covers, under Add robot (VIGGO 30 Oct: this
|
|
48
|
+
* API is the SC50, SC80 and V50 only; S100N and Mix1 use other interfaces).
|
|
49
|
+
* null = no line (every other brand, unchanged).
|
|
50
|
+
*/
|
|
51
|
+
export function credentialModelsNote(brand: unknown, brands: Array<{ brand?: unknown; models?: Array<{ name?: unknown }> }> | null | undefined): string | null {
|
|
52
|
+
if (brand !== "viggo") return null;
|
|
53
|
+
const names = (brands ?? []).find((b) => b?.brand === brand)?.models?.map((m) => String(m?.name ?? "").replace(/^VIGGO\s+/i, "")).filter(Boolean) ?? [];
|
|
54
|
+
return names.length ? `Models: ${names.join(", ")} only (S100N and Mix1 use a different VIGGO connection).` : null;
|
|
55
|
+
}
|
|
56
|
+
|
|
46
57
|
/** Brands whose one company credential lists its robots, so Add robot picks the serial (Find robots). */
|
|
47
58
|
export function credentialDiscoverable(brand: unknown): boolean {
|
|
48
59
|
return brand === "ounitech" || brand === "padbot" || brand === "oneway" || brand === "viggo";
|
|
@@ -57,17 +68,19 @@ export function credentialMissingMessage(labels: { key: string; token: string },
|
|
|
57
68
|
|
|
58
69
|
/**
|
|
59
70
|
* Discovered robots as picker options: "Lobby Q3 · OT-SN-A", marking ones this
|
|
60
|
-
* client already added (disabled - one serial, one record)
|
|
71
|
+
* client already added (disabled - one serial, one record), a model this
|
|
72
|
+
* connection does not cover (disabled - VIGGO S100N / Mix1) and offline ones.
|
|
61
73
|
*/
|
|
62
74
|
export function discoveredRobotOptions(
|
|
63
|
-
items: Array<{ robotSn?: unknown; name?: unknown; online?: unknown; added?: unknown }> | null | undefined,
|
|
75
|
+
items: Array<{ robotSn?: unknown; name?: unknown; online?: unknown; added?: unknown; unsupported?: unknown }> | null | undefined,
|
|
64
76
|
): Array<{ value: string; label: string; disabled: boolean }> {
|
|
65
77
|
return (items ?? [])
|
|
66
78
|
.filter((r) => typeof r?.robotSn === "string" && r.robotSn)
|
|
67
79
|
.map((r) => {
|
|
68
80
|
const sn = String(r.robotSn);
|
|
69
81
|
const name = typeof r.name === "string" && r.name.trim() ? `${r.name.trim()} · ${sn}` : sn;
|
|
70
|
-
const
|
|
71
|
-
|
|
82
|
+
const unsupported = typeof r.unsupported === "string" && r.unsupported !== "";
|
|
83
|
+
const tags = [r.added === true ? "already added" : "", unsupported ? "model not supported" : r.online === false ? "offline" : ""].filter(Boolean);
|
|
84
|
+
return { value: sn, label: tags.length ? `${name} (${tags.join(", ")})` : name, disabled: r.added === true || unsupported };
|
|
72
85
|
});
|
|
73
86
|
}
|