update translation strings

This commit is contained in:
henrygd
2025-11-29 20:29:07 -05:00
parent 4d05bfdff0
commit 9804c8a31a
4 changed files with 40 additions and 40 deletions

View File

@@ -17,6 +17,9 @@
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true, "recommended": true,
"a11y": {
"useButtonType": "off"
},
"complexity": { "complexity": {
"noUselessStringConcat": "error", "noUselessStringConcat": "error",
"noUselessUndefinedInitialization": "error", "noUselessUndefinedInitialization": "error",
@@ -38,6 +41,9 @@
"useUniqueElementIds": "off", "useUniqueElementIds": "off",
"noUnusedVariables": "error" "noUnusedVariables": "error"
}, },
"security": {
"noDangerouslySetInnerHtml": "warn"
},
"style": { "style": {
"noParameterProperties": "error", "noParameterProperties": "error",
"noYodaExpression": "error", "noYodaExpression": "error",

View File

@@ -54,23 +54,27 @@ export default function ContainersTable({ systemId }: { systemId?: string }) {
fields: "id,name,image,cpu,memory,net,health,status,system,updated", fields: "id,name,image,cpu,memory,net,health,status,system,updated",
filter: systemId ? pb.filter("system={:system}", { system: systemId }) : undefined, filter: systemId ? pb.filter("system={:system}", { system: systemId }) : undefined,
}) })
.then(({ items }) => items.length && setData((curItems) => { .then(
const lastUpdated = Math.max(items[0].updated, items.at(-1)?.updated ?? 0) ({ items }) =>
const containerIds = new Set() items.length &&
const newItems = [] setData((curItems) => {
for (const item of items) { const lastUpdated = Math.max(items[0].updated, items.at(-1)?.updated ?? 0)
if (Math.abs(lastUpdated - item.updated) < 70_000) { const containerIds = new Set()
containerIds.add(item.id) const newItems = []
newItems.push(item) for (const item of items) {
} if (Math.abs(lastUpdated - item.updated) < 70_000) {
} containerIds.add(item.id)
for (const item of curItems) { newItems.push(item)
if (!containerIds.has(item.id) && lastUpdated - item.updated < 70_000) { }
newItems.push(item) }
} for (const item of curItems) {
} if (!containerIds.has(item.id) && lastUpdated - item.updated < 70_000) {
return newItems newItems.push(item)
})) }
}
return newItems
})
)
} }
// initial load // initial load
@@ -159,7 +163,7 @@ export default function ContainersTable({ systemId }: { systemId?: string }) {
type="button" type="button"
variant="ghost" variant="ghost"
size="icon" size="icon"
aria-label={t`Clear filter`} aria-label={t`Clear`}
className="absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 text-muted-foreground" className="absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 text-muted-foreground"
onClick={() => setGlobalFilter("")} onClick={() => setGlobalFilter("")}
> >
@@ -266,7 +270,7 @@ async function getInfoHtml(container: ContainerRecord): Promise<string> {
]) ])
try { try {
info = JSON.stringify(JSON.parse(info), null, 2) info = JSON.stringify(JSON.parse(info), null, 2)
} catch (_) { } } catch (_) {}
return info ? highlighter.codeToHtml(info, { lang: "json", theme: syntaxTheme }) : t`No results.` return info ? highlighter.codeToHtml(info, { lang: "json", theme: syntaxTheme }) : t`No results.`
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@@ -323,12 +327,12 @@ function ContainerSheet({
setLogsDisplay("") setLogsDisplay("")
setInfoDisplay("") setInfoDisplay("")
if (!container) return if (!container) return
; (async () => { ;(async () => {
const [logsHtml, infoHtml] = await Promise.all([getLogsHtml(container), getInfoHtml(container)]) const [logsHtml, infoHtml] = await Promise.all([getLogsHtml(container), getInfoHtml(container)])
setLogsDisplay(logsHtml) setLogsDisplay(logsHtml)
setInfoDisplay(infoHtml) setInfoDisplay(infoHtml)
setTimeout(scrollLogsToBottom, 20) setTimeout(scrollLogsToBottom, 20)
})() })()
}, [container]) }, [container])
return ( return (
@@ -505,9 +509,7 @@ function LogsFullscreenDialog({
</div> </div>
</div> </div>
<button <button
onClick={() => { onClick={onRefresh}
void onRefresh()
}}
className="absolute top-3 right-11 opacity-60 hover:opacity-100 p-1" className="absolute top-3 right-11 opacity-60 hover:opacity-100 p-1"
disabled={isRefreshing} disabled={isRefreshing}
title={t`Refresh`} title={t`Refresh`}

View File

@@ -365,16 +365,8 @@ function QuietHoursDialog({
if (editingRecord) { if (editingRecord) {
await pb.collection("quiet_hours").update(editingRecord.id, data) await pb.collection("quiet_hours").update(editingRecord.id, data)
toast({
title: t`Updated`,
description: t`Quiet hours have been updated.`,
})
} else { } else {
await pb.collection("quiet_hours").create(data) await pb.collection("quiet_hours").create(data)
toast({
title: t`Created`,
description: t`Quiet hours have been created.`,
})
} }
onClose() onClose()
@@ -382,7 +374,7 @@ function QuietHoursDialog({
toast({ toast({
variant: "destructive", variant: "destructive",
title: t`Error`, title: t`Error`,
description: t`Failed to save quiet hours.`, description: t`Failed to save settings`,
}) })
} }
} }
@@ -399,10 +391,10 @@ function QuietHoursDialog({
<Tabs value={isGlobal ? "global" : "system"} onValueChange={(value) => setIsGlobal(value === "global")}> <Tabs value={isGlobal ? "global" : "system"} onValueChange={(value) => setIsGlobal(value === "global")}>
<TabsList className="grid w-full grid-cols-2"> <TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="global"> <TabsTrigger value="global">
<Trans>All Systems</Trans> <Trans>Global</Trans>
</TabsTrigger> </TabsTrigger>
<TabsTrigger value="system"> <TabsTrigger value="system">
<Trans>Specific System</Trans> <Trans>System</Trans>
</TabsTrigger> </TabsTrigger>
</TabsList> </TabsList>

View File

@@ -158,7 +158,7 @@ export default function SystemsTable() {
type="button" type="button"
variant="ghost" variant="ghost"
size="icon" size="icon"
aria-label="Clear filter" aria-label={t`Clear`}
className="absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 text-muted-foreground" className="absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7 text-muted-foreground"
onClick={() => setFilter("")} onClick={() => setFilter("")}
> >