diff --git a/ui/web/src/lib/constants.ts b/ui/web/src/lib/constants.ts index 470a9c40..d70e3330 100644 --- a/ui/web/src/lib/constants.ts +++ b/ui/web/src/lib/constants.ts @@ -74,3 +74,27 @@ export const TIMEZONE_OPTIONS = [ { value: "Asia/Singapore", label: "Singapore (SGT)" }, { value: "Australia/Sydney", label: "Sydney (AEST)" }, ] as const; + +/** IANA timezones for server-side scheduling (cron, heartbeat). */ +export const IANA_TIMEZONES = [ + { value: "UTC", label: "UTC" }, + { value: "Asia/Ho_Chi_Minh", label: "Asia/Ho_Chi_Minh (UTC+7)" }, + { value: "Asia/Bangkok", label: "Asia/Bangkok (UTC+7)" }, + { value: "Asia/Shanghai", label: "Asia/Shanghai (UTC+8)" }, + { value: "Asia/Tokyo", label: "Asia/Tokyo (UTC+9)" }, + { value: "Asia/Seoul", label: "Asia/Seoul (UTC+9)" }, + { value: "Asia/Singapore", label: "Asia/Singapore (UTC+8)" }, + { value: "Asia/Kolkata", label: "Asia/Kolkata (UTC+5:30)" }, + { value: "Asia/Dubai", label: "Asia/Dubai (UTC+4)" }, + { value: "Europe/London", label: "Europe/London (UTC+0)" }, + { value: "Europe/Paris", label: "Europe/Paris (UTC+1)" }, + { value: "Europe/Berlin", label: "Europe/Berlin (UTC+1)" }, + { value: "Europe/Moscow", label: "Europe/Moscow (UTC+3)" }, + { value: "America/New_York", label: "America/New_York (UTC-5)" }, + { value: "America/Chicago", label: "America/Chicago (UTC-6)" }, + { value: "America/Denver", label: "America/Denver (UTC-7)" }, + { value: "America/Los_Angeles", label: "America/Los_Angeles (UTC-8)" }, + { value: "America/Sao_Paulo", label: "America/Sao_Paulo (UTC-3)" }, + { value: "Australia/Sydney", label: "Australia/Sydney (UTC+11)" }, + { value: "Pacific/Auckland", label: "Pacific/Auckland (UTC+13)" }, +] as const; diff --git a/ui/web/src/pages/agents/agent-detail/heartbeat-config-dialog.tsx b/ui/web/src/pages/agents/agent-detail/heartbeat-config-dialog.tsx index 1519a1b9..4a5e900d 100644 --- a/ui/web/src/pages/agents/agent-detail/heartbeat-config-dialog.tsx +++ b/ui/web/src/pages/agents/agent-detail/heartbeat-config-dialog.tsx @@ -18,6 +18,7 @@ import { useChannels } from "@/pages/channels/hooks/use-channels"; import { useProviders } from "@/pages/providers/hooks/use-providers"; import { useUiStore } from "@/stores/use-ui-store"; import { ProviderModelSelect } from "@/components/shared/provider-model-select"; +import { IANA_TIMEZONES } from "@/lib/constants"; import type { HeartbeatConfig, DeliveryTarget } from "@/pages/agents/hooks/use-agent-heartbeat"; interface HeartbeatConfigDialogProps { @@ -54,7 +55,7 @@ export function HeartbeatConfigDialog({ const [intervalMin, setIntervalMin] = useState(30); const [ackMaxChars, setAckMaxChars] = useState(300); const [maxRetries, setMaxRetries] = useState(2); - const [isolatedSession, setIsolatedSession] = useState(true); + const [isolatedSession, setIsolatedSession] = useState(false); const [lightContext, setLightContext] = useState(false); const [activeHoursStart, setActiveHoursStart] = useState(""); const [activeHoursEnd, setActiveHoursEnd] = useState(""); @@ -182,7 +183,7 @@ export function HeartbeatConfigDialog({ min={5} value={intervalMin} onChange={(e) => setIntervalMin(Math.max(5, Number(e.target.value) || 5))} - className="w-24 text-center text-base md:text-sm" + className="w-[4.5rem] text-center text-base md:text-sm" /> min @@ -298,8 +299,8 @@ export function HeartbeatConfigDialog({ {t("heartbeat.sectionSchedule")} -
-
+
+
-
+
-
- - setTimezone(e.target.value)} - className="text-base md:text-sm" - /> +
+ +

{t("heartbeat.scheduleHint")}

diff --git a/ui/web/src/pages/config/sections/cron-section.tsx b/ui/web/src/pages/config/sections/cron-section.tsx index fba9caf6..23a4fdaa 100644 --- a/ui/web/src/pages/config/sections/cron-section.tsx +++ b/ui/web/src/pages/config/sections/cron-section.tsx @@ -6,29 +6,7 @@ import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { InfoLabel } from "@/components/shared/info-label"; - -const TIMEZONES = [ - { value: "UTC", label: "UTC" }, - { value: "Asia/Ho_Chi_Minh", label: "Asia/Ho_Chi_Minh (UTC+7)" }, - { value: "Asia/Bangkok", label: "Asia/Bangkok (UTC+7)" }, - { value: "Asia/Shanghai", label: "Asia/Shanghai (UTC+8)" }, - { value: "Asia/Tokyo", label: "Asia/Tokyo (UTC+9)" }, - { value: "Asia/Seoul", label: "Asia/Seoul (UTC+9)" }, - { value: "Asia/Singapore", label: "Asia/Singapore (UTC+8)" }, - { value: "Asia/Kolkata", label: "Asia/Kolkata (UTC+5:30)" }, - { value: "Asia/Dubai", label: "Asia/Dubai (UTC+4)" }, - { value: "Europe/London", label: "Europe/London (UTC+0)" }, - { value: "Europe/Paris", label: "Europe/Paris (UTC+1)" }, - { value: "Europe/Berlin", label: "Europe/Berlin (UTC+1)" }, - { value: "Europe/Moscow", label: "Europe/Moscow (UTC+3)" }, - { value: "America/New_York", label: "America/New_York (UTC-5)" }, - { value: "America/Chicago", label: "America/Chicago (UTC-6)" }, - { value: "America/Denver", label: "America/Denver (UTC-7)" }, - { value: "America/Los_Angeles", label: "America/Los_Angeles (UTC-8)" }, - { value: "America/Sao_Paulo", label: "America/Sao_Paulo (UTC-3)" }, - { value: "Australia/Sydney", label: "Australia/Sydney (UTC+11)" }, - { value: "Pacific/Auckland", label: "Pacific/Auckland (UTC+13)" }, -]; +import { IANA_TIMEZONES } from "@/lib/constants"; interface CronData { max_retries?: number; @@ -80,7 +58,7 @@ export function CronSection({ data, onSave, saving }: Props) { {t("cron.defaultTimezonePlaceholder")} - {TIMEZONES.map((tz) => ( + {IANA_TIMEZONES.map((tz) => ( {tz.label} ))}