@7365admin1/layer-common 4.54.0 → 4.54.1
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.
- package/CHANGELOG.md +10 -4
- package/components/Robot/Detail.vue +1 -0
- package/package.json +1 -1
- package/utils/robot-display.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.54.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 401e0a2: Robot detail: when the robot cannot be read, show the API's plain reason (e.g. "Ounitech rejected the robot list (sign-in) ...") under the title instead of only "Reconnecting". `mergeLiveStates` carries the optional `reason` from `/robots/states`.
|
|
8
|
+
|
|
3
9
|
## 4.54.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -1569,11 +1575,11 @@
|
|
|
1569
1575
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
1570
1576
|
own rule from two endpoints the console already calls, unprojected:
|
|
1571
1577
|
|
|
1572
|
-
|
|
1573
|
-
|
|
1578
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
1579
|
+
GET /api/roles/id/:role that membership's role document
|
|
1574
1580
|
|
|
1575
|
-
|
|
1576
|
-
|
|
1581
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
1582
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
1577
1583
|
|
|
1578
1584
|
`role.default` is the marker because it is the only property of a platform
|
|
1579
1585
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
<div v-if="error" class="hero-notice" role="alert">{{ error }}</div>
|
|
23
|
+
<div v-else-if="live && !live.ok && live.reason" class="hero-notice" role="status">Can't read this robot right now: {{ live.reason }}</div>
|
|
23
24
|
|
|
24
25
|
<div v-if="fault" class="hero-faultbar" role="alert">
|
|
25
26
|
<span class="hero-faultbar__code">{{ fault.code }}</span>
|
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.54.
|
|
5
|
+
"version": "4.54.1",
|
|
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.",
|
package/utils/robot-display.ts
CHANGED
|
@@ -598,6 +598,8 @@ export type TLiveRobotState = {
|
|
|
598
598
|
ok: boolean;
|
|
599
599
|
/** false = its brand has no interface: nothing to show, ever. */
|
|
600
600
|
monitorable?: boolean;
|
|
601
|
+
/** When `ok` is false: why, in words (e.g. "Ounitech rejected the robot list (sign-in) (code X: ...)"). */
|
|
602
|
+
reason?: string;
|
|
601
603
|
online?: boolean;
|
|
602
604
|
mode?: string;
|
|
603
605
|
batteryPercent?: number | null;
|
|
@@ -654,7 +656,13 @@ export function mergeLiveStates(
|
|
|
654
656
|
next[item.id] =
|
|
655
657
|
item.monitorable !== false && p?.ok && recent(p.readAt)
|
|
656
658
|
? { ...p, stale: true }
|
|
657
|
-
: {
|
|
659
|
+
: {
|
|
660
|
+
id: item.id,
|
|
661
|
+
ok: false,
|
|
662
|
+
monitorable: item.monitorable !== false,
|
|
663
|
+
// The API's plain reason, so the detail screen says WHY instead of only "Reconnecting".
|
|
664
|
+
...(typeof item.reason === "string" && item.reason ? { reason: item.reason.slice(0, 300) } : {}),
|
|
665
|
+
};
|
|
658
666
|
continue;
|
|
659
667
|
}
|
|
660
668
|
const s = { ...item, ok: true, readAt: now, stale: false } as TLiveRobotState;
|