feat(ui): show background process notify state
This commit is contained in:
@@ -391,6 +391,7 @@ export interface BackgroundProcess {
|
||||
exitCode?: number
|
||||
outputSizeBytes?: number
|
||||
terminalReason?: BackgroundProcessTerminalReason
|
||||
notifyEnabled?: boolean
|
||||
}
|
||||
|
||||
export interface BackgroundProcessListResponse {
|
||||
|
||||
@@ -582,6 +582,7 @@ export class BackgroundProcessManager {
|
||||
exitCode: record.exitCode,
|
||||
outputSizeBytes: record.outputSizeBytes,
|
||||
terminalReason: record.terminalReason,
|
||||
notifyEnabled: Boolean(record.notify),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Accordion } from "@kobalte/core"
|
||||
import { Tooltip } from "@kobalte/core/tooltip"
|
||||
import Switch from "@suid/material/Switch"
|
||||
|
||||
import { ChevronDown, Info, TerminalSquare, Trash2, XOctagon } from "lucide-solid"
|
||||
import { BellRing, ChevronDown, Info, TerminalSquare, Trash2, XOctagon } from "lucide-solid"
|
||||
|
||||
import type { Instance } from "../../../../../types/instance"
|
||||
import type { BackgroundProcess } from "../../../../../../../server/src/api-types"
|
||||
@@ -187,6 +187,24 @@ const StatusTab: Component<StatusTabProps> = (props) => {
|
||||
<div class="status-process-header">
|
||||
<span class="status-process-title">{process.title}</span>
|
||||
<div class="status-process-meta">
|
||||
<span
|
||||
classList={{
|
||||
"text-success": Boolean(process.notifyEnabled),
|
||||
"text-tertiary": !process.notifyEnabled,
|
||||
}}
|
||||
aria-label={props.t(
|
||||
process.notifyEnabled
|
||||
? "instanceShell.backgroundProcesses.notify.enabled"
|
||||
: "instanceShell.backgroundProcesses.notify.disabled",
|
||||
)}
|
||||
title={props.t(
|
||||
process.notifyEnabled
|
||||
? "instanceShell.backgroundProcesses.notify.enabled"
|
||||
: "instanceShell.backgroundProcesses.notify.disabled",
|
||||
)}
|
||||
>
|
||||
<BellRing class="h-3.5 w-3.5" />
|
||||
</span>
|
||||
<span>{props.t("instanceShell.backgroundProcesses.status", { status: process.status })}</span>
|
||||
<Show when={typeof process.outputSizeBytes === "number"}>
|
||||
<span>
|
||||
|
||||
@@ -160,6 +160,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "No background processes.",
|
||||
"instanceShell.backgroundProcesses.status": "Status: {status}",
|
||||
"instanceShell.backgroundProcesses.output": "Output: {sizeKb}KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "Completion notification enabled",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "Completion notification disabled",
|
||||
"instanceShell.backgroundProcesses.actions.output": "Output",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "Stop",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "Terminate",
|
||||
|
||||
@@ -150,6 +150,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "No hay procesos en segundo plano.",
|
||||
"instanceShell.backgroundProcesses.status": "Estado: {status}",
|
||||
"instanceShell.backgroundProcesses.output": "Salida: {sizeKb} KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "Notificacion de finalizacion activada",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "Notificacion de finalizacion desactivada",
|
||||
"instanceShell.backgroundProcesses.actions.output": "Salida",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "Detener",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "Terminar",
|
||||
|
||||
@@ -150,6 +150,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "Aucun processus en arrière-plan.",
|
||||
"instanceShell.backgroundProcesses.status": "Statut : {status}",
|
||||
"instanceShell.backgroundProcesses.output": "Sortie : {sizeKb}KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "Notification de fin activee",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "Notification de fin desactivee",
|
||||
"instanceShell.backgroundProcesses.actions.output": "Sortie",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "Arrêter",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "Terminer",
|
||||
|
||||
@@ -158,6 +158,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "אין תהליכי רקע.",
|
||||
"instanceShell.backgroundProcesses.status": "סטטוס: {status}",
|
||||
"instanceShell.backgroundProcesses.output": "פלט: {sizeKb}KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "התראת סיום פעילה",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "התראת סיום כבויה",
|
||||
"instanceShell.backgroundProcesses.actions.output": "פלט",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "עצור",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "סיים",
|
||||
|
||||
@@ -150,6 +150,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "バックグラウンドプロセスはありません。",
|
||||
"instanceShell.backgroundProcesses.status": "状態: {status}",
|
||||
"instanceShell.backgroundProcesses.output": "出力: {sizeKb}KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "完了通知が有効",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "完了通知が無効",
|
||||
"instanceShell.backgroundProcesses.actions.output": "出力",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "停止",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "終了",
|
||||
|
||||
@@ -150,6 +150,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "Нет фоновых процессов.",
|
||||
"instanceShell.backgroundProcesses.status": "Статус: {status}",
|
||||
"instanceShell.backgroundProcesses.output": "Вывод: {sizeKb}KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "Уведомление о завершении включено",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "Уведомление о завершении выключено",
|
||||
"instanceShell.backgroundProcesses.actions.output": "Вывод",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "Остановить",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "Завершить",
|
||||
|
||||
@@ -150,6 +150,8 @@ export const instanceMessages = {
|
||||
"instanceShell.backgroundProcesses.empty": "没有后台进程。",
|
||||
"instanceShell.backgroundProcesses.status": "状态:{status}",
|
||||
"instanceShell.backgroundProcesses.output": "输出:{sizeKb}KB",
|
||||
"instanceShell.backgroundProcesses.notify.enabled": "已启用完成通知",
|
||||
"instanceShell.backgroundProcesses.notify.disabled": "已禁用完成通知",
|
||||
"instanceShell.backgroundProcesses.actions.output": "输出",
|
||||
"instanceShell.backgroundProcesses.actions.stop": "停止",
|
||||
"instanceShell.backgroundProcesses.actions.terminate": "终止",
|
||||
|
||||
Reference in New Issue
Block a user