Downtime catalog
This commit is contained in:
@@ -13,7 +13,6 @@ function statusLabel(status: RecapMachineStatus, t: (key: string) => string) {
|
||||
if (status === "running") return t("recap.status.running");
|
||||
if (status === "mold-change") return t("recap.status.moldChange");
|
||||
if (status === "stopped") return t("recap.status.stopped");
|
||||
if (status === "data-loss") return t("recap.status.dataLoss");
|
||||
if (status === "idle") return t("recap.status.idle");
|
||||
return t("recap.status.offline");
|
||||
}
|
||||
@@ -112,7 +111,7 @@ export default function RecapGridClient({ initialData }: Props) {
|
||||
className="rounded-xl border border-white/10 bg-black/40 px-3 py-2 text-zinc-200"
|
||||
>
|
||||
<option value="all">{t("recap.filter.allStatuses")}</option>
|
||||
{(["running", "mold-change", "stopped", "data-loss", "idle", "offline"] as const).map((status) => (
|
||||
{(["running", "mold-change", "stopped", "idle", "offline"] as const).map((status) => (
|
||||
<option key={status} value={status}>
|
||||
{statusLabel(status, t)}
|
||||
</option>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { AlertsConfig } from "@/components/settings/AlertsConfig";
|
||||
import { FinancialCostConfig } from "@/components/settings/FinancialCostConfig";
|
||||
import { ReasonCatalogConfig } from "@/components/settings/ReasonCatalogConfig";
|
||||
import { useI18n } from "@/lib/i18n/useI18n";
|
||||
import { SHIFT_OVERRIDE_DAYS, type ShiftOverrideDay } from "@/lib/settings";
|
||||
import { useScreenlessMode } from "@/lib/ui/screenlessMode";
|
||||
@@ -122,6 +123,7 @@ const SETTINGS_TABS = [
|
||||
{ id: "thresholds", labelKey: "settings.tabs.thresholds" },
|
||||
{ id: "alerts", labelKey: "settings.tabs.alerts" },
|
||||
{ id: "financial", labelKey: "settings.tabs.financial" },
|
||||
{ id: "reasonCatalog", labelKey: "settings.tabs.reasonCatalog" },
|
||||
{ id: "team", labelKey: "settings.tabs.team" },
|
||||
] as const;
|
||||
|
||||
@@ -239,7 +241,6 @@ function normalizeSettings(raw: unknown, fallbackName: (index: number) => string
|
||||
const thresholds = asRecord(record.thresholds) ?? {};
|
||||
const alerts = asRecord(record.alerts) ?? {};
|
||||
const defaults = asRecord(record.defaults) ?? {};
|
||||
|
||||
return {
|
||||
orgId: String(record.orgId ?? ""),
|
||||
version: Number(record.version ?? 0),
|
||||
@@ -1276,6 +1277,18 @@ export default function SettingsPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === "reasonCatalog" && (
|
||||
<div className="space-y-6">
|
||||
<div className="rounded-2xl border border-white/10 bg-white/5 p-5">
|
||||
<div className="text-sm font-semibold text-white">{t("settings.reasonCatalog.title")}</div>
|
||||
<p className="mt-1 text-xs text-zinc-400">{t("settings.reasonCatalog.subtitle")}</p>
|
||||
<div className="mt-4">
|
||||
<ReasonCatalogConfig disabled={saving} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === "team" && (
|
||||
<div className="grid grid-cols-1 gap-4 xl:grid-cols-2">
|
||||
<div className="rounded-2xl border border-white/10 bg-white/5 p-5">
|
||||
|
||||
Reference in New Issue
Block a user