mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 09:48:39 +00:00
UI: add version status pill next to health
This commit is contained in:
@@ -2,6 +2,7 @@ import type { TranslationMap } from "../lib/types.ts";
|
|||||||
|
|
||||||
export const en: TranslationMap = {
|
export const en: TranslationMap = {
|
||||||
common: {
|
common: {
|
||||||
|
version: "Version",
|
||||||
health: "Health",
|
health: "Health",
|
||||||
ok: "OK",
|
ok: "OK",
|
||||||
offline: "Offline",
|
offline: "Offline",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { TranslationMap } from "../lib/types.ts";
|
|||||||
|
|
||||||
export const pt_BR: TranslationMap = {
|
export const pt_BR: TranslationMap = {
|
||||||
common: {
|
common: {
|
||||||
|
version: "Versão",
|
||||||
health: "Saúde",
|
health: "Saúde",
|
||||||
ok: "OK",
|
ok: "OK",
|
||||||
offline: "Offline",
|
offline: "Offline",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { TranslationMap } from "../lib/types.ts";
|
|||||||
|
|
||||||
export const zh_CN: TranslationMap = {
|
export const zh_CN: TranslationMap = {
|
||||||
common: {
|
common: {
|
||||||
|
version: "版本",
|
||||||
health: "健康状况",
|
health: "健康状况",
|
||||||
ok: "正常",
|
ok: "正常",
|
||||||
offline: "离线",
|
offline: "离线",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { TranslationMap } from "../lib/types.ts";
|
|||||||
|
|
||||||
export const zh_TW: TranslationMap = {
|
export const zh_TW: TranslationMap = {
|
||||||
common: {
|
common: {
|
||||||
|
version: "版本",
|
||||||
health: "健康狀況",
|
health: "健康狀況",
|
||||||
ok: "正常",
|
ok: "正常",
|
||||||
offline: "離線",
|
offline: "離線",
|
||||||
|
|||||||
@@ -328,6 +328,12 @@
|
|||||||
animation: none;
|
animation: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.statusDot.warn {
|
||||||
|
background: var(--warn);
|
||||||
|
box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* ===========================================
|
/* ===========================================
|
||||||
Buttons - Tactile with personality
|
Buttons - Tactile with personality
|
||||||
=========================================== */
|
=========================================== */
|
||||||
|
|||||||
@@ -136,6 +136,11 @@ function resolveAssistantAvatarUrl(state: AppViewState): string | undefined {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function renderApp(state: AppViewState) {
|
export function renderApp(state: AppViewState) {
|
||||||
|
const openClawVersion =
|
||||||
|
(typeof state.hello?.server?.version === "string" && state.hello.server.version.trim()) ||
|
||||||
|
state.updateAvailable?.currentVersion ||
|
||||||
|
t("common.na");
|
||||||
|
const versionStatusClass = state.updateAvailable ? "warn" : "ok";
|
||||||
const presenceCount = state.presenceEntries.length;
|
const presenceCount = state.presenceEntries.length;
|
||||||
const sessionsCount = state.sessionsResult?.count ?? null;
|
const sessionsCount = state.sessionsResult?.count ?? null;
|
||||||
const cronNext = state.cronStatus?.nextWakeAtMs ?? null;
|
const cronNext = state.cronStatus?.nextWakeAtMs ?? null;
|
||||||
@@ -231,6 +236,11 @@ export function renderApp(state: AppViewState) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="topbar-status">
|
<div class="topbar-status">
|
||||||
|
<div class="pill">
|
||||||
|
<span class="statusDot ${versionStatusClass}"></span>
|
||||||
|
<span>${t("common.version")}</span>
|
||||||
|
<span class="mono">${openClawVersion}</span>
|
||||||
|
</div>
|
||||||
<div class="pill">
|
<div class="pill">
|
||||||
<span class="statusDot ${state.connected ? "ok" : ""}"></span>
|
<span class="statusDot ${state.connected ? "ok" : ""}"></span>
|
||||||
<span>${t("common.health")}</span>
|
<span>${t("common.health")}</span>
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ export function resolveGatewayErrorDetailCode(
|
|||||||
export type GatewayHelloOk = {
|
export type GatewayHelloOk = {
|
||||||
type: "hello-ok";
|
type: "hello-ok";
|
||||||
protocol: number;
|
protocol: number;
|
||||||
|
server?: {
|
||||||
|
version?: string;
|
||||||
|
connId?: string;
|
||||||
|
};
|
||||||
features?: { methods?: string[]; events?: string[] };
|
features?: { methods?: string[]; events?: string[] };
|
||||||
snapshot?: unknown;
|
snapshot?: unknown;
|
||||||
auth?: {
|
auth?: {
|
||||||
|
|||||||
Reference in New Issue
Block a user