feat(i18n): localize frontend components and add missing translations
- Replaced hardcoded UI strings with translation keys across frontend files - Added and updated English(en) and Khmer(km) translation files for settings, notifications, and server components - Improved localization and multi-language support throughout the frontend
This commit is contained in:
@@ -4,6 +4,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Table, TableBody } from "@/components/ui/table";
|
||||
import { DockerContainer } from "@/types/docker.types";
|
||||
import { DockerMetricsDialog } from "./DockerMetricsDialog";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
import {
|
||||
DockerTableSearch,
|
||||
DockerTableHeader,
|
||||
@@ -18,6 +19,7 @@ interface DockerContainersTableProps {
|
||||
}
|
||||
|
||||
export const DockerContainersTable = ({ containers, isLoading, onRefresh }: DockerContainersTableProps) => {
|
||||
const { t } = useLanguage();
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [selectedContainer, setSelectedContainer] = useState<DockerContainer | null>(null);
|
||||
const [metricsDialogOpen, setMetricsDialogOpen] = useState(false);
|
||||
@@ -49,7 +51,7 @@ export const DockerContainersTable = ({ containers, isLoading, onRefresh }: Dock
|
||||
<CardHeader className="pb-4 px-0">
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<CardTitle className="text-lg sm:text-xl font-semibold">Docker Containers</CardTitle>
|
||||
<CardTitle className="text-lg sm:text-xl font-semibold">{t('dockerContainers', 'docker')}</CardTitle>
|
||||
<DockerTableSearch
|
||||
searchTerm={searchTerm}
|
||||
onSearchChange={setSearchTerm}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { DockerContainer, DockerMetrics } from "@/types/docker.types";
|
||||
import { dockerService } from "@/services/dockerService";
|
||||
import { Loader2, Cpu, HardDrive, Network, MemoryStick } from "lucide-react";
|
||||
import { useTheme } from "@/contexts/ThemeContext";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerMetricsDialogProps {
|
||||
container: DockerContainer | null;
|
||||
@@ -20,16 +21,17 @@ interface DockerMetricsDialogProps {
|
||||
type TimeRange = '60m' | '1d' | '7d' | '1m' | '3m';
|
||||
|
||||
const timeRangeOptions = [
|
||||
{ value: '60m' as TimeRange, label: '60 minutes', hours: 1 },
|
||||
{ value: '1d' as TimeRange, label: '1 day', hours: 24 },
|
||||
{ value: '7d' as TimeRange, label: '7 days', hours: 24 * 7 },
|
||||
{ value: '1m' as TimeRange, label: '1 month', hours: 24 * 30 },
|
||||
{ value: '3m' as TimeRange, label: '3 months', hours: 24 * 90 },
|
||||
{ value: '60m' as TimeRange, label: 'minutes60', hours: 1 },
|
||||
{ value: '1d' as TimeRange, label: 'day1', hours: 24 },
|
||||
{ value: '7d' as TimeRange, label: 'days7', hours: 24 * 7 },
|
||||
{ value: '1m' as TimeRange, label: 'month1', hours: 24 * 30 },
|
||||
{ value: '3m' as TimeRange, label: 'months3', hours: 24 * 90 },
|
||||
];
|
||||
|
||||
export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMetricsDialogProps) => {
|
||||
const [timeRange, setTimeRange] = useState<TimeRange>("1d");
|
||||
const { theme } = useTheme();
|
||||
const { t } = useLanguage();
|
||||
|
||||
const {
|
||||
data: metrics = [],
|
||||
@@ -232,11 +234,11 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<DialogContent className="max-w-7xl max-h-[95vh] overflow-y-auto bg-background text-foreground">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="h-8 w-8 rounded bg-primary/10 flex items-center justify-center">
|
||||
<Cpu className="h-4 w-4 text-primary" />
|
||||
</div>
|
||||
Container Metrics: {container.name}
|
||||
{t('containerMetricsTitle', 'docker', { name: container.name })}
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Select value={timeRange} onValueChange={(value: TimeRange) => setTimeRange(value)}>
|
||||
@@ -246,7 +248,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<SelectContent>
|
||||
{timeRangeOptions.map((option) => (
|
||||
<SelectItem key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
{t(option.label, 'docker')}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
@@ -254,22 +256,22 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
</div>
|
||||
</DialogTitle>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Docker ID: {container.docker_id} • {container.hostname}
|
||||
{t('dockerId', 'docker')}: {container.docker_id} • {container.hostname}
|
||||
</p>
|
||||
</DialogHeader>
|
||||
|
||||
{isLoading ? (
|
||||
<div className="flex items-center justify-center h-96">
|
||||
<Loader2 className="h-8 w-8 animate-spin" />
|
||||
<span className="ml-2">Loading metrics...</span>
|
||||
<span className="ml-2">{t('loadingMetrics', 'docker')}</span>
|
||||
</div>
|
||||
) : error ? (
|
||||
<div className="flex items-center justify-center h-96 text-muted-foreground">
|
||||
<p>Error loading metrics: {error.message}</p>
|
||||
<p>{t('errorLoadingMetrics', 'docker')}: {String((error as any)?.message ?? '')}</p>
|
||||
</div>
|
||||
) : chartData.length === 0 ? (
|
||||
<div className="flex items-center justify-center h-96 text-muted-foreground">
|
||||
<p>No metrics data available for this container</p>
|
||||
<p>{t('noMetricsAvailable', 'docker')}</p>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
@@ -277,7 +279,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
{latestMetric && (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||
<MetricCard
|
||||
title="CPU"
|
||||
title={t('cpu', 'docker')}
|
||||
used={`${latestMetric.cpuUsage}%`}
|
||||
total={`${latestMetric.cpuCores} cores`}
|
||||
free={`${(100 - latestMetric.cpuUsage).toFixed(1)}%`}
|
||||
@@ -286,7 +288,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
color={chartConfig.cpuUsage.color}
|
||||
/>
|
||||
<MetricCard
|
||||
title="Memory"
|
||||
title={t('memoryTitle', 'docker')}
|
||||
used={latestMetric.ramUsed}
|
||||
total={latestMetric.ramTotal}
|
||||
free={latestMetric.ramFree}
|
||||
@@ -295,7 +297,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
color={chartConfig.ramUsagePercent.color}
|
||||
/>
|
||||
<MetricCard
|
||||
title="Disk"
|
||||
title={t('diskTitle', 'docker')}
|
||||
used={latestMetric.diskUsed}
|
||||
total={latestMetric.diskTotal}
|
||||
free={latestMetric.diskFree}
|
||||
@@ -304,10 +306,10 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
color={chartConfig.diskUsagePercent.color}
|
||||
/>
|
||||
<MetricCard
|
||||
title="Network"
|
||||
title={t('network', 'docker')}
|
||||
used={`RX: ${latestMetric.networkRx}`}
|
||||
total={`TX: ${latestMetric.networkTx}`}
|
||||
free={`Speed: ${latestMetric.networkRxSpeed} KB/s`}
|
||||
free={`${t('networkSpeedKbs', 'docker').replace('(KB/s)', '')}: ${latestMetric.networkRxSpeed} KB/s`}
|
||||
percentage={0}
|
||||
icon={Network}
|
||||
color={chartConfig.networkRx.color}
|
||||
@@ -319,19 +321,19 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<TabsList className="grid w-full grid-cols-4 bg-muted">
|
||||
<TabsTrigger value="cpu" className="flex items-center gap-2 data-[state=active]:bg-background">
|
||||
<Cpu className="h-4 w-4" />
|
||||
CPU
|
||||
{t('cpu', 'docker')}
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="memory" className="flex items-center gap-2 data-[state=active]:bg-background">
|
||||
<MemoryStick className="h-4 w-4" />
|
||||
Memory
|
||||
{t('memoryTitle', 'docker')}
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="disk" className="flex items-center gap-2 data-[state=active]:bg-background">
|
||||
<HardDrive className="h-4 w-4" />
|
||||
Disk
|
||||
{t('diskTitle', 'docker')}
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="network" className="flex items-center gap-2 data-[state=active]:bg-background">
|
||||
<Network className="h-4 w-4" />
|
||||
Network
|
||||
{t('network', 'docker')}
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
@@ -339,7 +341,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">CPU Usage (%)</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('cpuUsagePct', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-80">
|
||||
@@ -365,7 +367,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={chartConfig.cpuUsage.color}
|
||||
strokeWidth={2}
|
||||
dot={{ r: 3, fill: chartConfig.cpuUsage.color }}
|
||||
name="CPU Usage (%)"
|
||||
name={t('cpuUsagePct', 'docker')}
|
||||
/>
|
||||
</LineChart>
|
||||
</ChartContainer>
|
||||
@@ -374,7 +376,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">CPU Usage vs Available</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('cpuUsageVsAvailable', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-80">
|
||||
@@ -401,7 +403,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={theme === 'dark' ? "#6b7280" : "#9ca3af"}
|
||||
fill={theme === 'dark' ? "#6b7280" : "#9ca3af"}
|
||||
fillOpacity={0.3}
|
||||
name="CPU Available (%)"
|
||||
name={t('cpuAvailablePct', 'docker')}
|
||||
/>
|
||||
<Area
|
||||
type="monotone"
|
||||
@@ -410,7 +412,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={chartConfig.cpuUsage.color}
|
||||
fill={chartConfig.cpuUsage.color}
|
||||
fillOpacity={0.6}
|
||||
name="CPU Usage (%)"
|
||||
name={t('cpuUsagePct', 'docker')}
|
||||
/>
|
||||
</AreaChart>
|
||||
</ChartContainer>
|
||||
@@ -423,7 +425,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">Memory Usage (%)</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('ramUsagePct', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-80">
|
||||
@@ -459,7 +461,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">Memory Usage (Bytes)</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('memoryUsageBytes', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-80">
|
||||
@@ -479,8 +481,8 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
content={<ChartTooltipContent className="bg-popover border-border" />}
|
||||
cursor={{ stroke: getGridColor() }}
|
||||
formatter={(value, name) => [
|
||||
name === 'Used Memory' ? formatBytes(Number(value)) :
|
||||
name === 'Total Memory' ? formatBytes(Number(value)) : value,
|
||||
name === t('usedMemory', 'docker') ? formatBytes(Number(value)) :
|
||||
name === t('totalMemory', 'docker') ? formatBytes(Number(value)) : value,
|
||||
name
|
||||
]}
|
||||
/>
|
||||
@@ -491,7 +493,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={theme === 'dark' ? "#6b7280" : "#9ca3af"}
|
||||
fill={theme === 'dark' ? "#6b7280" : "#9ca3af"}
|
||||
fillOpacity={0.3}
|
||||
name="Total Memory"
|
||||
name={t('totalMemory', 'docker')}
|
||||
/>
|
||||
<Area
|
||||
type="monotone"
|
||||
@@ -500,7 +502,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={chartConfig.ramUsagePercent.color}
|
||||
fill={chartConfig.ramUsagePercent.color}
|
||||
fillOpacity={0.6}
|
||||
name="Used Memory"
|
||||
name={t('usedMemory', 'docker')}
|
||||
/>
|
||||
</AreaChart>
|
||||
</ChartContainer>
|
||||
@@ -513,7 +515,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">Disk Usage (%)</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('diskUsagePct', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-80">
|
||||
@@ -540,7 +542,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={chartConfig.diskUsagePercent.color}
|
||||
fill={chartConfig.diskUsagePercent.color}
|
||||
fillOpacity={0.6}
|
||||
name="Disk Usage (%)"
|
||||
name={t('diskUsagePct', 'docker')}
|
||||
/>
|
||||
</AreaChart>
|
||||
</ChartContainer>
|
||||
@@ -549,7 +551,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">Disk Usage (Bytes)</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('diskUsageBytes', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-80">
|
||||
@@ -569,8 +571,8 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
content={<ChartTooltipContent className="bg-popover border-border" />}
|
||||
cursor={{ stroke: getGridColor() }}
|
||||
formatter={(value, name) => [
|
||||
name === 'Used Disk' ? formatBytes(Number(value)) :
|
||||
name === 'Total Disk' ? formatBytes(Number(value)) : value,
|
||||
name === t('usedDisk', 'docker') ? formatBytes(Number(value)) :
|
||||
name === t('totalDisk', 'docker') ? formatBytes(Number(value)) : value,
|
||||
name
|
||||
]}
|
||||
/>
|
||||
@@ -581,7 +583,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={theme === 'dark' ? "#6b7280" : "#9ca3af"}
|
||||
fill={theme === 'dark' ? "#6b7280" : "#9ca3af"}
|
||||
fillOpacity={0.3}
|
||||
name="Total Disk"
|
||||
name={t('totalDisk', 'docker')}
|
||||
/>
|
||||
<Area
|
||||
type="monotone"
|
||||
@@ -590,7 +592,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
stroke={chartConfig.diskUsagePercent.color}
|
||||
fill={chartConfig.diskUsagePercent.color}
|
||||
fillOpacity={0.6}
|
||||
name="Used Disk"
|
||||
name={t('usedDisk', 'docker')}
|
||||
/>
|
||||
</AreaChart>
|
||||
</ChartContainer>
|
||||
@@ -603,7 +605,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">Network Traffic</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('networkTraffic', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-64">
|
||||
@@ -627,7 +629,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
dataKey="networkRxBytes"
|
||||
stroke={chartConfig.networkRx.color}
|
||||
strokeWidth={2}
|
||||
name="RX Bytes"
|
||||
name={t('rxBytes', 'docker')}
|
||||
dot={{ r: 2 }}
|
||||
/>
|
||||
<Line
|
||||
@@ -635,7 +637,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
dataKey="networkTxBytes"
|
||||
stroke={chartConfig.networkTx.color}
|
||||
strokeWidth={2}
|
||||
name="TX Bytes"
|
||||
name={t('txBytes', 'docker')}
|
||||
dot={{ r: 2 }}
|
||||
/>
|
||||
</LineChart>
|
||||
@@ -645,7 +647,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
|
||||
<Card className="bg-card border-border">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-foreground">Network Speed (KB/s)</CardTitle>
|
||||
<CardTitle className="text-foreground">{t('networkSpeedKbs', 'docker')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ChartContainer config={chartConfig} className="h-64">
|
||||
@@ -669,7 +671,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
dataKey="networkRxSpeed"
|
||||
stroke={chartConfig.networkRx.color}
|
||||
strokeWidth={2}
|
||||
name="RX Speed (KB/s)"
|
||||
name={t('rxSpeedKbs', 'docker')}
|
||||
dot={{ r: 2 }}
|
||||
/>
|
||||
<Line
|
||||
@@ -677,7 +679,7 @@ export const DockerMetricsDialog = ({ container, open, onOpenChange }: DockerMet
|
||||
dataKey="networkTxSpeed"
|
||||
stroke={chartConfig.networkTx.color}
|
||||
strokeWidth={2}
|
||||
name="TX Speed (KB/s)"
|
||||
name={t('txSpeedKbs', 'docker')}
|
||||
dot={{ r: 2 }}
|
||||
/>
|
||||
</LineChart>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Badge } from "@/components/ui/badge";
|
||||
import { Container, Play, Square, AlertTriangle } from "lucide-react";
|
||||
import { DockerStats } from "@/types/docker.types";
|
||||
import { useTheme } from "@/contexts/ThemeContext";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerStatsCardsProps {
|
||||
stats: DockerStats;
|
||||
@@ -11,10 +12,11 @@ interface DockerStatsCardsProps {
|
||||
|
||||
export const DockerStatsCards = ({ stats }: DockerStatsCardsProps) => {
|
||||
const { theme } = useTheme();
|
||||
const { t } = useLanguage();
|
||||
|
||||
const cards = [
|
||||
{
|
||||
title: "Total Containers",
|
||||
title: t('totalContainers', 'docker'),
|
||||
value: stats.total,
|
||||
icon: Container,
|
||||
color: "text-blue-600",
|
||||
@@ -23,7 +25,7 @@ export const DockerStatsCards = ({ stats }: DockerStatsCardsProps) => {
|
||||
: "linear-gradient(135deg, rgba(65, 59, 55, 0.8) 0%, #3b82f6 100%)"
|
||||
},
|
||||
{
|
||||
title: "Running",
|
||||
title: t('running', 'docker'),
|
||||
value: stats.running,
|
||||
icon: Play,
|
||||
color: "text-green-600",
|
||||
@@ -32,7 +34,7 @@ export const DockerStatsCards = ({ stats }: DockerStatsCardsProps) => {
|
||||
: "linear-gradient(135deg, rgba(65, 59, 55, 0.8) 0%, #10b981 100%)"
|
||||
},
|
||||
{
|
||||
title: "Stopped",
|
||||
title: t('stopped', 'docker'),
|
||||
value: stats.stopped,
|
||||
icon: Square,
|
||||
color: "text-gray-600",
|
||||
@@ -41,7 +43,7 @@ export const DockerStatsCards = ({ stats }: DockerStatsCardsProps) => {
|
||||
: "linear-gradient(135deg, rgba(65, 59, 55, 0.8) 0%, #6b7280 100%)"
|
||||
},
|
||||
{
|
||||
title: "Warning",
|
||||
title: t('warning', 'docker'),
|
||||
value: stats.warning,
|
||||
icon: AlertTriangle,
|
||||
color: "text-amber-600",
|
||||
@@ -90,7 +92,7 @@ export const DockerStatsCards = ({ stats }: DockerStatsCardsProps) => {
|
||||
variant="outline"
|
||||
className="text-xs font-mono font-bold px-2 py-1 rounded-md bg-white/20 backdrop-blur-sm text-white border border-white/30"
|
||||
>
|
||||
Containers
|
||||
{t('containersLabel', 'docker')}
|
||||
</Badge>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -1,36 +1,38 @@
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerStatusBadgeProps {
|
||||
status: 'running' | 'stopped' | 'warning';
|
||||
}
|
||||
|
||||
export const DockerStatusBadge = ({ status }: DockerStatusBadgeProps) => {
|
||||
const { t } = useLanguage();
|
||||
const getStatusConfig = (status: string) => {
|
||||
switch (status) {
|
||||
case 'running':
|
||||
return {
|
||||
variant: 'default' as const,
|
||||
className: 'bg-emerald-100 text-emerald-800 border-emerald-200 hover:bg-emerald-200',
|
||||
label: 'Running'
|
||||
label: t('running', 'docker')
|
||||
};
|
||||
case 'stopped':
|
||||
return {
|
||||
variant: 'secondary' as const,
|
||||
className: 'bg-gray-100 text-gray-800 border-gray-200 hover:bg-gray-200',
|
||||
label: 'Stopped'
|
||||
label: t('stopped', 'docker')
|
||||
};
|
||||
case 'warning':
|
||||
return {
|
||||
variant: 'destructive' as const,
|
||||
className: 'bg-amber-100 text-amber-800 border-amber-200 hover:bg-amber-200',
|
||||
label: 'Warning'
|
||||
label: t('warning', 'docker')
|
||||
};
|
||||
default:
|
||||
return {
|
||||
variant: 'outline' as const,
|
||||
className: 'bg-gray-100 text-gray-600 border-gray-200',
|
||||
label: 'Unknown'
|
||||
label: t('unknown', 'docker')
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
|
||||
import { TableCell, TableRow } from "@/components/ui/table";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerEmptyStateProps {
|
||||
searchTerm: string;
|
||||
}
|
||||
|
||||
export const DockerEmptyState = ({ searchTerm }: DockerEmptyStateProps) => {
|
||||
const { t } = useLanguage();
|
||||
return (
|
||||
<TableRow>
|
||||
<TableCell colSpan={8} className="text-center py-12 text-muted-foreground">
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<div className="text-lg font-medium">
|
||||
{searchTerm ? "No containers found" : "No containers running"}
|
||||
{searchTerm ? t('noContainersFound', 'docker') : t('noContainersRunning', 'docker')}
|
||||
</div>
|
||||
<div className="text-sm">
|
||||
{searchTerm ? "Try adjusting your search terms." : "Start some containers to see them here."}
|
||||
{searchTerm ? t('tryAdjustSearch', 'docker') : t('startSomeContainers', 'docker')}
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownMenuSeparator } from "@/components/ui/dropdown-menu";
|
||||
import { MoreHorizontal, Eye, Play, Pause, Square, Trash2, BarChart3, RefreshCw } from "lucide-react";
|
||||
import { DockerContainer } from "@/types/docker.types";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerRowActionsProps {
|
||||
container: DockerContainer;
|
||||
@@ -12,11 +13,12 @@ interface DockerRowActionsProps {
|
||||
}
|
||||
|
||||
export const DockerRowActions = ({ container, containerStatus, onContainerAction, onViewMetrics }: DockerRowActionsProps) => {
|
||||
const { t } = useLanguage();
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" className="h-8 w-8 p-0 hover:bg-muted">
|
||||
<span className="sr-only">Open menu</span>
|
||||
<span className="sr-only">{t('openMenu', 'docker')}</span>
|
||||
<MoreHorizontal className="h-4 w-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
@@ -26,14 +28,14 @@ export const DockerRowActions = ({ container, containerStatus, onContainerAction
|
||||
className="cursor-pointer hover:bg-muted"
|
||||
>
|
||||
<BarChart3 className="mr-2 h-4 w-4" />
|
||||
View Metrics
|
||||
{t('viewMetrics', 'docker')}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onClick={() => onContainerAction('view-detail', container.id, container.name)}
|
||||
className="cursor-pointer hover:bg-muted"
|
||||
>
|
||||
<Eye className="mr-2 h-4 w-4" />
|
||||
View Details
|
||||
{t('viewDetails', 'docker')}
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
|
||||
import { TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
export const DockerTableHeader = () => {
|
||||
const { t } = useLanguage();
|
||||
return (
|
||||
<TableHeader>
|
||||
<TableRow className="border-border bg-muted/30">
|
||||
<TableHead className="min-w-[200px] font-semibold">Container</TableHead>
|
||||
<TableHead className="min-w-[100px] font-semibold">Status</TableHead>
|
||||
<TableHead className="min-w-[140px] font-semibold">CPU Usage</TableHead>
|
||||
<TableHead className="min-w-[160px] font-semibold">Memory</TableHead>
|
||||
<TableHead className="min-w-[160px] font-semibold">Disk</TableHead>
|
||||
<TableHead className="min-w-[100px] font-semibold">Uptime</TableHead>
|
||||
<TableHead className="min-w-[160px] font-semibold">Last Checked</TableHead>
|
||||
<TableHead className="min-w-[80px] text-center font-semibold">Actions</TableHead>
|
||||
<TableHead className="min-w-[200px] font-semibold">{t('container', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[100px] font-semibold">{t('status', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[140px] font-semibold">{t('cpuUsage', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[160px] font-semibold">{t('memory', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[160px] font-semibold">{t('disk', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[100px] font-semibold">{t('uptime', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[160px] font-semibold">{t('lastChecked', 'docker')}</TableHead>
|
||||
<TableHead className="min-w-[80px] text-center font-semibold">{t('actions', 'docker')}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Search, RefreshCw } from "lucide-react";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerTableSearchProps {
|
||||
searchTerm: string;
|
||||
@@ -11,12 +12,13 @@ interface DockerTableSearchProps {
|
||||
}
|
||||
|
||||
export const DockerTableSearch = ({ searchTerm, onSearchChange, onRefresh, isLoading }: DockerTableSearchProps) => {
|
||||
const { t } = useLanguage();
|
||||
return (
|
||||
<div className="flex flex-col sm:flex-row gap-3 w-full sm:w-auto">
|
||||
<div className="relative flex-1 sm:flex-initial">
|
||||
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4" />
|
||||
<Input
|
||||
placeholder="Search containers..."
|
||||
placeholder={t('searchContainersPlaceholder', 'docker')}
|
||||
value={searchTerm}
|
||||
onChange={(e) => onSearchChange(e.target.value)}
|
||||
className="pl-10 sm:w-64 bg-background border-border"
|
||||
@@ -30,7 +32,7 @@ export const DockerTableSearch = ({ searchTerm, onSearchChange, onRefresh, isLoa
|
||||
className="w-full sm:w-auto bg-background border-border hover:bg-muted"
|
||||
>
|
||||
<RefreshCw className={`h-4 w-4 mr-2 ${isLoading ? 'animate-spin' : ''}`} />
|
||||
<span className="sm:inline">Refresh</span>
|
||||
<span className="sm:inline">{t('refresh', 'docker')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ import { Plus, X, Server } from 'lucide-react';
|
||||
import { StatusPageComponentRecord } from '@/types/statusPageComponents.types';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { serviceService } from '@/services/serviceService';
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface ComponentsSelectorProps {
|
||||
selectedComponents: Partial<StatusPageComponentRecord>[];
|
||||
@@ -19,6 +20,7 @@ interface ComponentsSelectorProps {
|
||||
}
|
||||
|
||||
export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onComponentDelete }: ComponentsSelectorProps) => {
|
||||
const { t } = useLanguage();
|
||||
const [showAddForm, setShowAddForm] = useState(false);
|
||||
const [newComponent, setNewComponent] = useState({
|
||||
name: '',
|
||||
@@ -71,16 +73,16 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Server className="h-5 w-5" />
|
||||
Status Page Components
|
||||
{t('statusPageComponents')}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Add monitoring components like uptime services, SSL certificates, and incident tracking
|
||||
{t('addMonitoringComponentsDesc')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
{selectedComponents.length > 0 && (
|
||||
<div className="space-y-2">
|
||||
<Label>Selected Components</Label>
|
||||
<Label>{t('selectedComponents')}</Label>
|
||||
<div className="space-y-2">
|
||||
{selectedComponents.map((component, index) => (
|
||||
<div key={component.id || index} className="flex items-center justify-between p-3 border rounded-lg">
|
||||
@@ -92,12 +94,12 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
<div className="flex gap-2 mt-1">
|
||||
{component.service_id && (
|
||||
<Badge variant="secondary" className="text-xs">
|
||||
Service: {services.find(s => s.id === component.service_id)?.name || component.service_id}
|
||||
{t('service')}: {services.find(s => s.id === component.service_id)?.name || component.service_id}
|
||||
</Badge>
|
||||
)}
|
||||
{component.server_id && (
|
||||
<Badge variant="secondary" className="text-xs">
|
||||
Server: {component.server_id}
|
||||
{t('server')}: {component.server_id}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
@@ -122,22 +124,22 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
className="w-full"
|
||||
>
|
||||
<Plus className="h-4 w-4 mr-2" />
|
||||
Add Component
|
||||
{t('addComponent')}
|
||||
</Button>
|
||||
) : (
|
||||
<div className="border rounded-lg p-4 space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<Label htmlFor="component-name">Component Name</Label>
|
||||
<Label htmlFor="component-name">{t('componentName')}</Label>
|
||||
<Input
|
||||
id="component-name"
|
||||
placeholder="e.g., Main Website"
|
||||
placeholder={t('componentNamePlaceholder')}
|
||||
value={newComponent.name}
|
||||
onChange={(e) => setNewComponent({ ...newComponent, name: e.target.value })}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="display-order">Display Order</Label>
|
||||
<Label htmlFor="display-order">{t('displayOrder')}</Label>
|
||||
<Input
|
||||
id="display-order"
|
||||
type="number"
|
||||
@@ -148,10 +150,10 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="component-description">Description (Optional)</Label>
|
||||
<Label htmlFor="component-description">{t('descriptionOptional')}</Label>
|
||||
<Textarea
|
||||
id="component-description"
|
||||
placeholder="Brief description of this component"
|
||||
placeholder={t('descriptionPlaceholder')}
|
||||
value={newComponent.description}
|
||||
onChange={(e) => setNewComponent({ ...newComponent, description: e.target.value })}
|
||||
/>
|
||||
@@ -159,10 +161,10 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<Label htmlFor="service-id">Uptime Service (Optional)</Label>
|
||||
<Label htmlFor="service-id">{t('uptimeServiceOptional')}</Label>
|
||||
<Select onValueChange={(value) => setNewComponent({ ...newComponent, service_id: value })}>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select an uptime service" />
|
||||
<SelectValue placeholder={t('selectUptimeService')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{services.map((service) => (
|
||||
@@ -181,10 +183,10 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
</Select>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="server-id">Server ID (Optional)</Label>
|
||||
<Label htmlFor="server-id">{t('serverIdOptional')}</Label>
|
||||
<Input
|
||||
id="server-id"
|
||||
placeholder="server_456"
|
||||
placeholder={t('serverIdPlaceholder')}
|
||||
value={newComponent.server_id}
|
||||
onChange={(e) => setNewComponent({ ...newComponent, server_id: e.target.value })}
|
||||
/>
|
||||
@@ -193,10 +195,10 @@ export const ComponentsSelector = ({ selectedComponents, onComponentsChange, onC
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={addComponent} disabled={!newComponent.name.trim()}>
|
||||
Add Component
|
||||
{t('addComponent')}
|
||||
</Button>
|
||||
<Button variant="outline" onClick={() => setShowAddForm(false)}>
|
||||
Cancel
|
||||
{t('cancel')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@ import { useCreateStatusPageComponent } from '@/hooks/useStatusPageComponents';
|
||||
import { ComponentsSelector } from './ComponentsSelector';
|
||||
import { Plus } from 'lucide-react';
|
||||
import { StatusPageComponentRecord } from '@/types/statusPageComponents.types';
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
const formSchema = z.object({
|
||||
title: z.string().min(1, 'Title is required'),
|
||||
@@ -31,6 +32,7 @@ const formSchema = z.object({
|
||||
type FormData = z.infer<typeof formSchema>;
|
||||
|
||||
export const CreateOperationalPageDialog = () => {
|
||||
const { t } = useLanguage();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [selectedComponents, setSelectedComponents] = useState<Partial<StatusPageComponentRecord>[]>([]);
|
||||
const createMutation = useCreateOperationalPage();
|
||||
@@ -102,14 +104,14 @@ export const CreateOperationalPageDialog = () => {
|
||||
<DialogTrigger asChild>
|
||||
<Button className="gap-2">
|
||||
<Plus className="h-4 w-4" />
|
||||
Create Page
|
||||
{t('createPage')}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[800px] max-h-[90vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Create Operational Page</DialogTitle>
|
||||
<DialogTitle>{t('createOperationalPage')}</DialogTitle>
|
||||
<DialogDescription>
|
||||
Create a new operational status page to monitor your services and components.
|
||||
{t('createOperationalPageDesc')}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -121,9 +123,9 @@ export const CreateOperationalPageDialog = () => {
|
||||
name="title"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Title</FormLabel>
|
||||
<FormLabel>{t('title')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="My Service Status" {...field} />
|
||||
<Input placeholder={t('myServiceStatusPlaceholder')} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -135,9 +137,9 @@ export const CreateOperationalPageDialog = () => {
|
||||
name="slug"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Slug</FormLabel>
|
||||
<FormLabel>{t('slug')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="my-service-status" {...field} />
|
||||
<Input placeholder={t('myServiceStatusSlugPlaceholder')} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -150,10 +152,10 @@ export const CreateOperationalPageDialog = () => {
|
||||
name="description"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Description</FormLabel>
|
||||
<FormLabel>{t('description')}</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea
|
||||
placeholder="A brief description of your operational page"
|
||||
placeholder={t('operationalPageDescriptionPlaceholder')}
|
||||
className="min-h-[80px]"
|
||||
{...field}
|
||||
/>
|
||||
@@ -169,17 +171,17 @@ export const CreateOperationalPageDialog = () => {
|
||||
name="theme"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Theme</FormLabel>
|
||||
<FormLabel>{t('theme')}</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select theme" />
|
||||
<SelectValue placeholder={t('selectTheme')} />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="default">Default</SelectItem>
|
||||
<SelectItem value="dark">Dark</SelectItem>
|
||||
<SelectItem value="light">Light</SelectItem>
|
||||
<SelectItem value="default">{t('themeDefault')}</SelectItem>
|
||||
<SelectItem value="dark">{t('themeDark')}</SelectItem>
|
||||
<SelectItem value="light">{t('themeLight')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
@@ -192,18 +194,18 @@ export const CreateOperationalPageDialog = () => {
|
||||
name="status"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Initial Status</FormLabel>
|
||||
<FormLabel>{t('initialStatus')}</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select status" />
|
||||
<SelectValue placeholder={t('selectStatus')} />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="operational">Operational</SelectItem>
|
||||
<SelectItem value="degraded">Degraded Performance</SelectItem>
|
||||
<SelectItem value="maintenance">Under Maintenance</SelectItem>
|
||||
<SelectItem value="major_outage">Major Outage</SelectItem>
|
||||
<SelectItem value="operational">{t('statusOperational')}</SelectItem>
|
||||
<SelectItem value="degraded">{t('statusDegraded')}</SelectItem>
|
||||
<SelectItem value="maintenance">{t('statusMaintenance')}</SelectItem>
|
||||
<SelectItem value="major_outage">{t('statusMajorOutage')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
@@ -218,9 +220,9 @@ export const CreateOperationalPageDialog = () => {
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm">
|
||||
<div className="space-y-0.5">
|
||||
<FormLabel>Public Page</FormLabel>
|
||||
<FormLabel>{t('publicPage')}</FormLabel>
|
||||
<FormDescription>
|
||||
Make this page publicly accessible
|
||||
{t('makePagePublic')}
|
||||
</FormDescription>
|
||||
</div>
|
||||
<FormControl>
|
||||
@@ -238,12 +240,12 @@ export const CreateOperationalPageDialog = () => {
|
||||
name="custom_domain"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Custom Domain (Optional)</FormLabel>
|
||||
<FormLabel>{t('customDomainOptional')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="status.yourdomain.com" {...field} />
|
||||
<Input placeholder={t('customDomainPlaceholder')} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Custom domain for your status page
|
||||
{t('customDomainDescription')}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -261,13 +263,13 @@ export const CreateOperationalPageDialog = () => {
|
||||
variant="outline"
|
||||
onClick={() => setOpen(false)}
|
||||
>
|
||||
Cancel
|
||||
{t('cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={createMutation.isPending || createComponentMutation.isPending}
|
||||
>
|
||||
{createMutation.isPending || createComponentMutation.isPending ? 'Creating...' : 'Create Page'}
|
||||
{createMutation.isPending || createComponentMutation.isPending ? t('creating') : t('createPage')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -14,6 +14,7 @@ import { useCreateStatusPageComponent, useStatusPageComponentsByOperationalId, u
|
||||
import { ComponentsSelector } from './ComponentsSelector';
|
||||
import { OperationalPageRecord } from '@/types/operational.types';
|
||||
import { StatusPageComponentRecord } from '@/types/statusPageComponents.types';
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
const formSchema = z.object({
|
||||
title: z.string().min(1, 'Title is required'),
|
||||
@@ -37,6 +38,7 @@ interface EditOperationalPageDialogProps {
|
||||
}
|
||||
|
||||
export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOperationalPageDialogProps) => {
|
||||
const { t } = useLanguage();
|
||||
const [selectedComponents, setSelectedComponents] = useState<Partial<StatusPageComponentRecord>[]>([]);
|
||||
const [isFormSubmitting, setIsFormSubmitting] = useState(false);
|
||||
const [componentsLoaded, setComponentsLoaded] = useState(false);
|
||||
@@ -195,9 +197,9 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-[800px] max-h-[90vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Edit Operational Page</DialogTitle>
|
||||
<DialogTitle>{t('editOperationalPage')}</DialogTitle>
|
||||
<DialogDescription>
|
||||
Update your operational status page settings and manage components.
|
||||
{t('updateYourOperationalPage')}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -209,9 +211,9 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
name="title"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Title</FormLabel>
|
||||
<FormLabel>{t('title')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="My Service Status" {...field} />
|
||||
<Input placeholder={t('myServiceStatusPlaceholder')} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -223,9 +225,9 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
name="slug"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Slug</FormLabel>
|
||||
<FormLabel>{t('slug')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="my-service-status" {...field} />
|
||||
<Input placeholder={t('myServiceStatusSlugPlaceholder')} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -238,10 +240,10 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
name="description"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Description</FormLabel>
|
||||
<FormLabel>{t('description')}</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea
|
||||
placeholder="A brief description of your operational page"
|
||||
placeholder={t('operationalPageDescriptionPlaceholder')}
|
||||
className="min-h-[80px]"
|
||||
{...field}
|
||||
/>
|
||||
@@ -257,17 +259,17 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
name="theme"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Theme</FormLabel>
|
||||
<FormLabel>{t('theme')}</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select theme" />
|
||||
<SelectValue placeholder={t('selectTheme')} />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="default">Default</SelectItem>
|
||||
<SelectItem value="dark">Dark</SelectItem>
|
||||
<SelectItem value="light">Light</SelectItem>
|
||||
<SelectItem value="default">{t('themeDefault')}</SelectItem>
|
||||
<SelectItem value="dark">{t('themeDark')}</SelectItem>
|
||||
<SelectItem value="light">{t('themeLight')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
@@ -280,18 +282,18 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
name="status"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Status</FormLabel>
|
||||
<FormLabel>{t('status')}</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select status" />
|
||||
<SelectValue placeholder={t('selectStatus')} />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="operational">Operational</SelectItem>
|
||||
<SelectItem value="degraded">Degraded Performance</SelectItem>
|
||||
<SelectItem value="maintenance">Under Maintenance</SelectItem>
|
||||
<SelectItem value="major_outage">Major Outage</SelectItem>
|
||||
<SelectItem value="operational">{t('statusOperational')}</SelectItem>
|
||||
<SelectItem value="degraded">{t('statusDegraded')}</SelectItem>
|
||||
<SelectItem value="maintenance">{t('statusMaintenance')}</SelectItem>
|
||||
<SelectItem value="major_outage">{t('statusMajorOutage')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
@@ -306,9 +308,9 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm">
|
||||
<div className="space-y-0.5">
|
||||
<FormLabel>Public Page</FormLabel>
|
||||
<FormLabel>{t('publicPage')}</FormLabel>
|
||||
<FormDescription>
|
||||
Make this page publicly accessible
|
||||
{t('makePagePublic')}
|
||||
</FormDescription>
|
||||
</div>
|
||||
<FormControl>
|
||||
@@ -326,12 +328,12 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
name="custom_domain"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Custom Domain (Optional)</FormLabel>
|
||||
<FormLabel>{t('customDomainOptional')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="status.yourdomain.com" {...field} />
|
||||
<Input placeholder={t('customDomainPlaceholder')} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Custom domain for your status page
|
||||
{t('customDomainDescription')}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -350,13 +352,13 @@ export const EditOperationalPageDialog = ({ page, open, onOpenChange }: EditOper
|
||||
variant="outline"
|
||||
onClick={() => onOpenChange(false)}
|
||||
>
|
||||
Cancel
|
||||
{t('cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={isFormSubmitting || updateMutation.isPending || createComponentMutation.isPending}
|
||||
>
|
||||
{isFormSubmitting || updateMutation.isPending || createComponentMutation.isPending ? 'Updating...' : 'Update Page'}
|
||||
{isFormSubmitting || updateMutation.isPending || createComponentMutation.isPending ? t('updating') : t('updatePage')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { OperationalPageRecord } from '@/types/operational.types';
|
||||
import { StatusBadge } from './StatusBadge';
|
||||
import { Globe, ExternalLink, Eye, Settings, Trash2 } from 'lucide-react';
|
||||
import { format } from 'date-fns';
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface OperationalPageCardProps {
|
||||
page: OperationalPageRecord;
|
||||
@@ -15,6 +16,8 @@ interface OperationalPageCardProps {
|
||||
}
|
||||
|
||||
export const OperationalPageCard = ({ page, onEdit, onView, onDelete }: OperationalPageCardProps) => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
return (
|
||||
<Card className="hover:shadow-lg transition-shadow duration-200">
|
||||
<CardHeader className="pb-3">
|
||||
@@ -32,23 +35,23 @@ export const OperationalPageCard = ({ page, onEdit, onView, onDelete }: Operatio
|
||||
<CardContent className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4 text-sm">
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Slug:</span>
|
||||
<span className="font-medium text-muted-foreground">{t('slug')}:</span>
|
||||
<p className="mt-1">{page.slug}</p>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Theme:</span>
|
||||
<span className="font-medium text-muted-foreground">{t('theme')}:</span>
|
||||
<p className="mt-1 capitalize">{page.theme}</p>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Public:</span>
|
||||
<span className="font-medium text-muted-foreground">{t('public')}:</span>
|
||||
<div className="mt-1">
|
||||
<Badge variant={page.is_public === 'true' ? 'default' : 'secondary'}>
|
||||
{page.is_public === 'true' ? 'Yes' : 'No'}
|
||||
{page.is_public === 'true' ? t('yes') : t('no')}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium text-muted-foreground">Updated:</span>
|
||||
<span className="font-medium text-muted-foreground">{t('updated')}:</span>
|
||||
<p className="mt-1">{format(new Date(page.updated), 'MMM dd, yyyy')}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,7 +73,7 @@ export const OperationalPageCard = ({ page, onEdit, onView, onDelete }: Operatio
|
||||
className="flex-1"
|
||||
>
|
||||
<Eye className="h-4 w-4 mr-2" />
|
||||
View
|
||||
{t('view')}
|
||||
</Button>
|
||||
)}
|
||||
{onEdit && (
|
||||
@@ -81,7 +84,7 @@ export const OperationalPageCard = ({ page, onEdit, onView, onDelete }: Operatio
|
||||
className="flex-1"
|
||||
>
|
||||
<Settings className="h-4 w-4 mr-2" />
|
||||
Edit
|
||||
{t('edit')}
|
||||
</Button>
|
||||
)}
|
||||
{onDelete && (
|
||||
|
||||
@@ -9,6 +9,8 @@ import { Button } from '@/components/ui/button';
|
||||
import { OperationalPageRecord } from '@/types/operational.types';
|
||||
import { Activity, Plus, RefreshCw } from 'lucide-react';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -21,6 +23,7 @@ import {
|
||||
} from '@/components/ui/alert-dialog';
|
||||
|
||||
export const OperationalPageContent = () => {
|
||||
const { t } = useLanguage();
|
||||
const navigate = useNavigate();
|
||||
const { data: pages, isLoading, error, refetch, isRefetching } = useOperationalPages();
|
||||
const deleteMutation = useDeleteOperationalPage();
|
||||
@@ -68,13 +71,13 @@ export const OperationalPageContent = () => {
|
||||
<div className="mb-4">
|
||||
<Activity className="h-12 w-12 text-muted-foreground mx-auto" />
|
||||
</div>
|
||||
<h3 className="text-lg font-semibold mb-2">Failed to load operational pages</h3>
|
||||
<h3 className="text-lg font-semibold mb-2">{t('failedToLoadOperationalPages')}</h3>
|
||||
<p className="text-muted-foreground mb-4">
|
||||
There was an error loading your operational pages. Please try again.
|
||||
{t('loadingoperationalPages')}
|
||||
</p>
|
||||
<Button onClick={() => refetch()} variant="outline">
|
||||
<RefreshCw className="h-4 w-4 mr-2" />
|
||||
Try Again
|
||||
{t('tryagain')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,9 +89,9 @@ export const OperationalPageContent = () => {
|
||||
{/* Header */}
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between mb-8">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight mb-2">Operational Pages</h1>
|
||||
<h1 className="text-3xl font-bold tracking-tight mb-2"> {t('operationalPages')}</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Manage your public status pages and monitor service health
|
||||
{t('describeOperation')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -100,7 +103,7 @@ export const OperationalPageContent = () => {
|
||||
disabled={isRefetching}
|
||||
>
|
||||
<RefreshCw className={`h-4 w-4 mr-2 ${isRefetching ? 'animate-spin' : ''}`} />
|
||||
Refresh
|
||||
{t('refresh')}
|
||||
</Button>
|
||||
<CreateOperationalPageDialog />
|
||||
</div>
|
||||
@@ -135,9 +138,9 @@ export const OperationalPageContent = () => {
|
||||
<div className="mb-4">
|
||||
<Activity className="h-12 w-12 text-muted-foreground mx-auto" />
|
||||
</div>
|
||||
<h3 className="text-lg font-semibold mb-2">No operational pages found</h3>
|
||||
<h3 className="text-lg font-semibold mb-2">{t('noOperationalPagesFound')}</h3>
|
||||
<p className="text-muted-foreground mb-6">
|
||||
Create your first operational page to start monitoring your services and communicate status to your users.
|
||||
{t('createYourFirstOperationalPage')}
|
||||
</p>
|
||||
<CreateOperationalPageDialog />
|
||||
</CardContent>
|
||||
@@ -164,14 +167,14 @@ export const OperationalPageContent = () => {
|
||||
<div className="mt-8 pt-6 border-t">
|
||||
<div className="flex flex-wrap gap-6 text-sm text-muted-foreground">
|
||||
<div>
|
||||
<span className="font-medium">Total Pages:</span> {pages.length}
|
||||
<span className="font-medium">{t('totalPages')}:</span> {pages.length}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Public Pages:</span>{' '}
|
||||
<span className="font-medium">{t('totalPages')}:</span>{' '}
|
||||
{pages.filter(p => p.is_public === 'true').length}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Operational:</span>{' '}
|
||||
<span className="font-medium">{t('operational')}:</span>{' '}
|
||||
{pages.filter(p => p.status === 'operational').length}
|
||||
</div>
|
||||
</div>
|
||||
@@ -189,19 +192,19 @@ export const OperationalPageContent = () => {
|
||||
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Operational Page</AlertDialogTitle>
|
||||
<AlertDialogTitle>{t('deleteOperationalPage')}</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete "{pageToDelete?.title}"? This action cannot be undone and will permanently remove the operational page and all its components.
|
||||
{t('deleteOperationalPageConfirm').replace('{title}', pageToDelete?.title ?? '')}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogCancel>{t('cancel')}</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={confirmDelete}
|
||||
className="bg-red-600 hover:bg-red-700"
|
||||
disabled={deleteMutation.isPending}
|
||||
>
|
||||
{deleteMutation.isPending ? 'Deleting...' : 'Delete'}
|
||||
{deleteMutation.isPending ? t('deleting') : t('delete')}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { format } from 'date-fns';
|
||||
import { OperationalPageRecord } from '@/types/operational.types';
|
||||
import { StatusPageComponentRecord } from '@/types/statusPageComponents.types';
|
||||
import { Service } from '@/types/service.types';
|
||||
import { useLanguage } from '@/contexts/LanguageContext';
|
||||
|
||||
interface CurrentStatusSectionProps {
|
||||
page: OperationalPageRecord;
|
||||
@@ -45,18 +46,18 @@ const getActualStatus = (components: StatusPageComponentRecord[], services: Serv
|
||||
return 'operational';
|
||||
};
|
||||
|
||||
const getStatusMessage = (status: OperationalPageRecord['status']) => {
|
||||
const getStatusMessage = (status: OperationalPageRecord['status'], t: (k: string, m?: string) => string) => {
|
||||
switch (status) {
|
||||
case 'operational':
|
||||
return 'All systems are operational';
|
||||
return t('allOperational', 'public');
|
||||
case 'degraded':
|
||||
return 'Some systems are experiencing degraded performance';
|
||||
return t('degradedPerformance', 'public');
|
||||
case 'maintenance':
|
||||
return 'Systems are currently under maintenance';
|
||||
return t('underMaintenance', 'public');
|
||||
case 'major_outage':
|
||||
return 'We are experiencing a major service outage';
|
||||
return t('majorOutage', 'public');
|
||||
default:
|
||||
return 'Status unknown';
|
||||
return t('statusUnknown', 'public');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -106,6 +107,7 @@ const getStatusBackground = (status: OperationalPageRecord['status']) => {
|
||||
};
|
||||
|
||||
export const CurrentStatusSection = ({ page, components, services }: CurrentStatusSectionProps) => {
|
||||
const { t } = useLanguage();
|
||||
const actualStatus = getActualStatus(components, services);
|
||||
const displayStatus = actualStatus; // Use actual status for real-time accuracy
|
||||
|
||||
@@ -114,7 +116,7 @@ export const CurrentStatusSection = ({ page, components, services }: CurrentStat
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-3 text-card-foreground text-xl">
|
||||
<Shield className="h-6 w-6" />
|
||||
System Status
|
||||
{t('systemStatus', 'public')}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6">
|
||||
@@ -123,10 +125,10 @@ export const CurrentStatusSection = ({ page, components, services }: CurrentStat
|
||||
{getStatusIcon(displayStatus)}
|
||||
<div>
|
||||
<h3 className={`text-2xl font-bold ${getStatusColor(displayStatus)}`}>
|
||||
{getStatusMessage(displayStatus)}
|
||||
{getStatusMessage(displayStatus, t)}
|
||||
</h3>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Status automatically updated based on component health
|
||||
{t('autoUpdatedByHealth', 'public')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -136,20 +138,20 @@ export const CurrentStatusSection = ({ page, components, services }: CurrentStat
|
||||
displayStatus === 'maintenance' ? 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200' :
|
||||
'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200'
|
||||
}`}>
|
||||
{displayStatus === 'operational' ? 'All Systems Operational' :
|
||||
displayStatus === 'degraded' ? 'Degraded Performance' :
|
||||
displayStatus === 'maintenance' ? 'Under Maintenance' : 'Major Outage'}
|
||||
{displayStatus === 'operational' ? t('allOperational', 'public') :
|
||||
displayStatus === 'degraded' ? t('degradedPerformance', 'public') :
|
||||
displayStatus === 'maintenance' ? t('underMaintenance', 'public') : t('majorOutage', 'public')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between text-sm text-muted-foreground border-t pt-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<Clock className="h-4 w-4" />
|
||||
<span>Last updated: {format(new Date(), 'MMM dd, yyyy HH:mm')} UTC</span>
|
||||
<span>{t('lastUpdatedAt', 'public', { time: format(new Date(), 'MMM dd, yyyy HH:mm') })}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="h-2 w-2 bg-green-500 rounded-full animate-pulse"></div>
|
||||
<span>Live status monitoring</span>
|
||||
<span>{t('liveStatusMonitoring', 'public')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -9,8 +9,10 @@ import { CurrentStatusSection } from './CurrentStatusSection';
|
||||
import { ComponentsStatusSection } from './ComponentsStatusSection';
|
||||
import { OverallUptimeSection } from './OverallUptimeSection';
|
||||
import { PublicStatusPageFooter } from './PublicStatusPageFooter';
|
||||
import { useLanguage } from '@/contexts/LanguageContext';
|
||||
|
||||
export const PublicStatusPage = () => {
|
||||
const { t } = useLanguage();
|
||||
const { slug } = useParams<{ slug: string }>();
|
||||
// console.log('PublicStatusPage - slug from params:', slug);
|
||||
|
||||
@@ -59,9 +61,9 @@ export const PublicStatusPage = () => {
|
||||
<div className="text-center space-y-4">
|
||||
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"></div>
|
||||
<div className="space-y-2">
|
||||
<p className="text-lg font-medium text-foreground">Loading Status Page</p>
|
||||
<p className="text-sm text-muted-foreground">Fetching real-time system status...</p>
|
||||
<p className="text-xs text-muted-foreground">Slug: {slug || 'No slug provided'}</p>
|
||||
<p className="text-lg font-medium text-foreground">{t('loadingStatusPage', 'public')}</p>
|
||||
<p className="text-sm text-muted-foreground">{t('fetchingRealtimeStatus', 'public')}</p>
|
||||
<p className="text-xs text-muted-foreground">{t('slugLabel', 'public')}: {slug || 'No slug provided'}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,19 +78,19 @@ export const PublicStatusPage = () => {
|
||||
<AlertCircle className="h-8 w-8 text-red-600 dark:text-red-400" />
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<h1 className="text-2xl font-bold text-foreground">Status Page Not Found</h1>
|
||||
<h1 className="text-2xl font-bold text-foreground">{t('statusPageNotFound', 'public')}</h1>
|
||||
<p className="text-muted-foreground">
|
||||
{error || 'The requested status page could not be found or is not publicly accessible.'}
|
||||
{error || t('notFoundDescription', 'public')}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">Slug: {slug || 'No slug provided'}</p>
|
||||
<p className="text-xs text-muted-foreground">{t('slugLabel', 'public')}: {slug || 'No slug provided'}</p>
|
||||
</div>
|
||||
<div className="flex gap-3 justify-center">
|
||||
<Button onClick={() => window.history.back()} variant="outline">
|
||||
Go Back
|
||||
{t('goBack', 'public')}
|
||||
</Button>
|
||||
<Button onClick={() => window.location.reload()} className="gap-2">
|
||||
<RefreshCw className="h-4 w-4" />
|
||||
Retry
|
||||
{t('retry', 'public')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Copy, Download, Terminal, CheckCircle, Zap, Play } from "lucide-react";
|
||||
import { regionalService } from "@/services/regionalService";
|
||||
import { InstallCommand } from "@/types/regional.types";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface AddRegionalAgentDialogProps {
|
||||
open: boolean;
|
||||
@@ -22,6 +23,7 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
onOpenChange,
|
||||
onAgentAdded
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
const [step, setStep] = useState(1);
|
||||
const [regionName, setRegionName] = useState("");
|
||||
const [agentIp, setAgentIp] = useState("");
|
||||
@@ -44,8 +46,8 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
setStep(2);
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to create regional agent configuration.",
|
||||
title: t('error'),
|
||||
description: t('failedToCreateAgent'),
|
||||
variant: "destructive",
|
||||
});
|
||||
} finally {
|
||||
@@ -59,7 +61,7 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
await navigator.clipboard.writeText(text);
|
||||
toast({
|
||||
title: "Copied!",
|
||||
title: t('copied'),
|
||||
description: `${description} copied to clipboard.`,
|
||||
});
|
||||
return;
|
||||
@@ -80,8 +82,9 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
|
||||
if (successful) {
|
||||
toast({
|
||||
title: "Copied!",
|
||||
title: t('copied'),
|
||||
description: `${description} copied to clipboard.`,
|
||||
//description: t('copiedDescription', { description }),
|
||||
});
|
||||
} else {
|
||||
throw new Error('execCommand failed');
|
||||
@@ -93,15 +96,15 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
const isLocalhost = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
|
||||
|
||||
let errorMessage = "Failed to copy to clipboard.";
|
||||
let errorMessage = t('copyFailedDescription');
|
||||
if (isLocalhost) {
|
||||
errorMessage += " This is common in local development. Please manually copy the text.";
|
||||
errorMessage += " " + t('copyFailedLocalhost');
|
||||
} else if (userAgent.includes('chrome')) {
|
||||
errorMessage += " Try using HTTPS or enable clipboard permissions.";
|
||||
errorMessage += " " + t('copyFailedChrome');
|
||||
}
|
||||
|
||||
toast({
|
||||
title: "Copy failed",
|
||||
title: t('copyFailed'),
|
||||
description: errorMessage,
|
||||
variant: "destructive",
|
||||
});
|
||||
@@ -133,8 +136,8 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
toast({
|
||||
title: "Downloaded!",
|
||||
description: "Installation script downloaded successfully.",
|
||||
title: t('downloaded'),
|
||||
description: t('downloadedDescription'),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -158,9 +161,9 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-[900px] max-h-[90vh] overflow-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Add Regional Monitoring Agent</DialogTitle>
|
||||
<DialogTitle>{t('addRegionalMonitoringAgent')}</DialogTitle>
|
||||
<DialogDescription>
|
||||
Deploy a regional monitoring agent with automatic one-click installation.
|
||||
{t('deployRegionalMonitoringAgent')}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -168,10 +171,10 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
<form onSubmit={handleCreateAgent} className="space-y-6">
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<Label htmlFor="regionName">Region Name</Label>
|
||||
<Label htmlFor="regionName">{t('regionName')}</Label>
|
||||
<Input
|
||||
id="regionName"
|
||||
placeholder="e.g., us-east-1, europe-west-1, asia-pacific-1"
|
||||
placeholder={t('regionNamePlaceholder')}
|
||||
value={regionName}
|
||||
onChange={(e) => setRegionName(e.target.value)}
|
||||
required
|
||||
@@ -179,10 +182,10 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="agentIp">Agent Server IP Address</Label>
|
||||
<Label htmlFor="agentIp">{t('agentServerIpAddress')}</Label>
|
||||
<Input
|
||||
id="agentIp"
|
||||
placeholder="e.g., 192.168.1.100 or your-server.example.com"
|
||||
placeholder={t('agentIpPlaceholder')}
|
||||
value={agentIp}
|
||||
onChange={(e) => setAgentIp(e.target.value)}
|
||||
required
|
||||
@@ -192,10 +195,10 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
|
||||
<div className="flex justify-end space-x-2">
|
||||
<Button type="button" variant="outline" onClick={() => onOpenChange(false)}>
|
||||
Cancel
|
||||
{t('cancel')}
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{isSubmitting ? "Generating..." : "Generate Installation"}
|
||||
{isSubmitting ? t('generating') : t('generateInstallation')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -205,17 +208,17 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
<div className="space-y-6">
|
||||
<div className="text-center space-y-2">
|
||||
<CheckCircle className="h-12 w-12 text-green-600 mx-auto" />
|
||||
<h3 className="text-lg font-semibold">Agent Configuration Ready!</h3>
|
||||
<h3 className="text-lg font-semibold">{t('agentConfigurationReady')}</h3>
|
||||
<p className="text-muted-foreground">
|
||||
One-click installation script generated with automatic configuration.
|
||||
{t('oneClickInstallScriptGenerated')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Tabs defaultValue="oneclicK" className="w-full">
|
||||
<TabsList className="grid w-full grid-cols-3">
|
||||
<TabsTrigger value="oneclicK">One-Click Install</TabsTrigger>
|
||||
<TabsTrigger value="details">Agent Details</TabsTrigger>
|
||||
<TabsTrigger value="manual">Manual Install</TabsTrigger>
|
||||
<TabsTrigger value="oneclicK">{t('oneClickInstallTab')}</TabsTrigger>
|
||||
<TabsTrigger value="details">{t('agentDetailsTab')}</TabsTrigger>
|
||||
<TabsTrigger value="manual">{t('manualInstallTab')}</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="oneclicK" className="space-y-4">
|
||||
@@ -223,29 +226,29 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Zap className="h-5 w-5 text-yellow-500" />
|
||||
One-Click Automatic Installation
|
||||
{t('oneClickAutomaticInstallation')}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Complete installation, configuration, and service startup in one command
|
||||
{t('completeInstallationDescription')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="bg-green-50 border border-green-200 rounded-lg p-4">
|
||||
<div className="flex items-center gap-2 text-green-800 font-medium mb-2">
|
||||
<Play className="h-4 w-4" />
|
||||
What this script does automatically:
|
||||
{t('whatThisScriptDoes')}
|
||||
</div>
|
||||
<ul className="text-sm text-green-700 space-y-1 ml-6">
|
||||
<li>• Downloads the latest .deb package</li>
|
||||
<li>• Installs the regional monitoring agent</li>
|
||||
<li>• Creates configuration file with your settings</li>
|
||||
<li>• Starts and enables the service</li>
|
||||
<li>• Runs health checks</li>
|
||||
<li>• {t('scriptActionDownload')}</li>
|
||||
<li>• {t('scriptActionInstall')}</li>
|
||||
<li>• {t('scriptActionConfigure')}</li>
|
||||
<li>• {t('scriptActionStart')}</li>
|
||||
<li>• {t('scriptActionHealthChecks')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Run this command on your target server:</Label>
|
||||
<Label>{t('runCommandOnServer')}</Label>
|
||||
<div className="relative">
|
||||
<Textarea
|
||||
readOnly
|
||||
@@ -272,7 +275,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={downloadScript} variant="outline" className="flex-1">
|
||||
<Download className="mr-2 h-4 w-4" />
|
||||
Download Complete Script
|
||||
{t('downloadCompleteScript')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => copyToClipboard(installCommand.bash_script, "Installation script")}
|
||||
@@ -280,17 +283,14 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
className="flex-1"
|
||||
>
|
||||
<Copy className="mr-2 h-4 w-4" />
|
||||
Copy Full Script
|
||||
{t('copyFullScript')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Local development notice */}
|
||||
{(window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') && (
|
||||
<div className="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
||||
<p className="text-sm text-yellow-800">
|
||||
<strong>Local Development Notice:</strong> If clipboard copying fails, this is normal in local development.
|
||||
You can use the "Download Complete Script" button instead or manually copy the text.
|
||||
</p>
|
||||
<p className="text-sm text-yellow-800" dangerouslySetInnerHTML={{ __html: t('localDevelopmentNotice') }} />
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
@@ -300,15 +300,15 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
<TabsContent value="details" className="space-y-4">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Generated Agent Configuration</CardTitle>
|
||||
<CardTitle>{t('generatedAgentConfiguration')}</CardTitle>
|
||||
<CardDescription>
|
||||
These values will be automatically configured during installation
|
||||
{t('autoConfiguredDuringInstallation')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<Label className="text-sm font-medium text-foreground">Agent ID</Label>
|
||||
<Label className="text-sm font-medium text-foreground">{t('agentId')}</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
value={installCommand.agent_id}
|
||||
@@ -319,14 +319,14 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0 hover:bg-muted"
|
||||
onClick={() => copyToClipboard(installCommand.agent_id, "Agent ID")}
|
||||
onClick={() => copyToClipboard(installCommand.agent_id, t('agentId'))}
|
||||
>
|
||||
<Copy className="h-3 w-3" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-sm font-medium text-foreground">Region Name</Label>
|
||||
<Label className="text-sm font-medium text-foreground">{t('regionNameDetail')}</Label>
|
||||
<Input
|
||||
value={regionName}
|
||||
readOnly
|
||||
@@ -334,7 +334,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-sm font-medium text-foreground">Server IP</Label>
|
||||
<Label className="text-sm font-medium text-foreground">{t('serverIp')}</Label>
|
||||
<Input
|
||||
value={agentIp}
|
||||
readOnly
|
||||
@@ -342,7 +342,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-sm font-medium text-foreground">API Endpoint</Label>
|
||||
<Label className="text-sm font-medium text-foreground">{t('apiEndpoint')}</Label>
|
||||
<Input
|
||||
value={installCommand.api_endpoint}
|
||||
readOnly
|
||||
@@ -352,7 +352,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label className="text-sm font-medium text-foreground">Authentication Token</Label>
|
||||
<Label className="text-sm font-medium text-foreground">{t('authenticationToken')}</Label>
|
||||
<div className="relative">
|
||||
<Input
|
||||
value={installCommand.token}
|
||||
@@ -363,7 +363,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
className="absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8 p-0 hover:bg-muted"
|
||||
onClick={() => copyToClipboard(installCommand.token, "Authentication token")}
|
||||
onClick={() => copyToClipboard(installCommand.token, t('authenticationToken'))}
|
||||
>
|
||||
<Copy className="h-3 w-3" />
|
||||
</Button>
|
||||
@@ -371,9 +371,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
</div>
|
||||
|
||||
<div className="mt-4 p-3 bg-blue-50 border border-blue-200 rounded-lg">
|
||||
<p className="text-sm text-blue-800">
|
||||
<strong>Configuration file location:</strong> /etc/regional-check-agent/regional-check-agent.env
|
||||
</p>
|
||||
<p className="text-sm text-blue-800" dangerouslySetInnerHTML={{ __html: t('configurationFileLocation') }} />
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -384,28 +382,30 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Terminal className="h-5 w-5" />
|
||||
Manual Installation Steps
|
||||
{t('manualInstallationSteps')}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Step-by-step manual installation process
|
||||
{t('stepByStepManualInstallation')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="text-sm space-y-4">
|
||||
<div className="border-l-4 border-blue-500 pl-4">
|
||||
<p className="font-medium">Step 1: Download Package</p>
|
||||
<p className="font-medium">{t('step1DownloadPackage')}</p>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
<p className="text-xs text-muted-foreground mt-1">✅ If you’re using the amd64 architecture, please download this package. </p> <br/>
|
||||
<p className="text-xs text-muted-foreground mt-1">{t('downloadAmd64Notice')}</p>
|
||||
<br/>
|
||||
wget https://github.com/operacle/Distributed-Regional-Monitoring/releases/download/V1.0.0/distributed-regional-check-agent_1.0.0_amd64.deb
|
||||
</code>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
<p className="text-xs text-muted-foreground mt-1">✅ If you’re using the arm64 architecture, please download this package. </p> <br/>
|
||||
<p className="text-xs text-muted-foreground mt-1">{t('downloadArm64Notice')}</p>
|
||||
<br/>
|
||||
wget https://github.com/operacle/Distributed-Regional-Monitoring/releases/download/V1.0.0/distributed-regional-check-agent_1.0.0_arm64.deb
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<div className="border-l-4 border-blue-500 pl-4">
|
||||
<p className="font-medium">Step 2: Install Package</p>
|
||||
<p className="font-medium">{t('step2InstallPackage')}</p>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
sudo dpkg -i distributed-regional-check-agent_1.0.0_amd64.deb<br/>
|
||||
sudo apt-get install -f
|
||||
@@ -413,18 +413,18 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
</div>
|
||||
|
||||
<div className="border-l-4 border-blue-500 pl-4">
|
||||
<p className="font-medium">Step 3: Configure Agent</p>
|
||||
<p className="font-medium">{t('step3ConfigureAgent')}</p>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
sudo nano /etc/regional-check-agent/regional-check-agent.env
|
||||
</code>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
Copy sample configuration from https://github.com/operacle/Distributed-Regional-Monitoring/blob/main/packaging/regional-check-agent.conf
|
||||
{t('copySampleConfiguration')}
|
||||
</code>
|
||||
<p className="text-xs text-muted-foreground mt-1">Add the configuration values shown in the Agent Details tab</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">{t('addConfigurationValues')}</p>
|
||||
</div>
|
||||
|
||||
<div className="border-l-4 border-blue-500 pl-4">
|
||||
<p className="font-medium">Step 4: Start Service</p>
|
||||
<p className="font-medium">{t('step4StartService')}</p>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
sudo systemctl enable regional-check-agent<br/>
|
||||
sudo systemctl start regional-check-agent
|
||||
@@ -432,7 +432,7 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
</div>
|
||||
|
||||
<div className="border-l-4 border-green-500 pl-4">
|
||||
<p className="font-medium">Step 5: Verify Installation</p>
|
||||
<p className="font-medium">{t('step5VerifyInstallation')}</p>
|
||||
<code className="text-xs bg-muted p-2 rounded block mt-1">
|
||||
sudo systemctl status regional-check-agent<br/>
|
||||
curl http://localhost:8091/health
|
||||
@@ -446,10 +446,10 @@ curl -fsSL https://raw.githubusercontent.com/operacle/checkcle/refs/heads/main/s
|
||||
|
||||
<div className="flex justify-end space-x-2">
|
||||
<Button variant="outline" onClick={resetDialog}>
|
||||
Add Another Agent
|
||||
{t('addAnotherAgent')}
|
||||
</Button>
|
||||
<Button onClick={handleComplete}>
|
||||
Complete Setup
|
||||
{t('completeSetup')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { MapPin, Wifi, WifiOff, MoreVertical, Trash2, Terminal, Copy } from "luc
|
||||
import { RegionalService } from "@/types/regional.types";
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface RegionalAgentCardProps {
|
||||
agent: RegionalService;
|
||||
@@ -16,6 +17,7 @@ interface RegionalAgentCardProps {
|
||||
|
||||
export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onDelete }) => {
|
||||
const { toast } = useToast();
|
||||
const { t } = useLanguage();
|
||||
|
||||
// Check if this is the default agent that cannot be removed
|
||||
const isDefaultAgent = agent.agent_id === "1" || agent.region_name === "Default";
|
||||
@@ -24,13 +26,13 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
try {
|
||||
await navigator.clipboard.writeText(agent.agent_id);
|
||||
toast({
|
||||
title: "Copied!",
|
||||
description: "Agent ID copied to clipboard.",
|
||||
title: t('copied'),
|
||||
description: t('copiedDescription'),
|
||||
});
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: "Copy failed",
|
||||
description: "Failed to copy agent ID.",
|
||||
title: t('copyFailed'),
|
||||
description: t('copyFailedDescription'),
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
@@ -40,14 +42,14 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
if (agent.connection === 'online') {
|
||||
return {
|
||||
icon: <Wifi className="h-4 w-4" />,
|
||||
label: 'Online',
|
||||
label: t('online'),
|
||||
variant: 'default' as const,
|
||||
className: 'bg-green-100 text-green-800 hover:bg-green-100'
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
icon: <WifiOff className="h-4 w-4" />,
|
||||
label: 'Offline',
|
||||
label: t('offline'),
|
||||
variant: 'secondary' as const,
|
||||
className: 'bg-red-100 text-red-800 hover:bg-red-100'
|
||||
};
|
||||
@@ -67,7 +69,7 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
{agent.region_name}
|
||||
{isDefaultAgent && (
|
||||
<Badge variant="outline" className="text-xs bg-blue-50 text-blue-700 border-blue-200">
|
||||
Default
|
||||
{t('defaultBadge')}
|
||||
</Badge>
|
||||
)}
|
||||
</CardTitle>
|
||||
@@ -86,12 +88,12 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem onClick={copyAgentId}>
|
||||
<Copy className="mr-2 h-4 w-4" />
|
||||
Copy Agent ID
|
||||
{t('copyAgentId')}
|
||||
</DropdownMenuItem>
|
||||
{!isDefaultAgent && (
|
||||
<DropdownMenuItem onClick={onDelete} className="text-red-600">
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
Remove Agent
|
||||
{t('removeAgent')}
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
</DropdownMenuContent>
|
||||
@@ -116,12 +118,12 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-muted-foreground">Agent ID:</span>
|
||||
<span className="text-muted-foreground">{t('agentId')}</span>
|
||||
<span className="font-mono text-xs">{agent.agent_id.substring(0, 12)}...</span>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-between text-sm">
|
||||
<span className="text-muted-foreground">Last Updated:</span>
|
||||
<span className="text-muted-foreground">{t('lastUpdated')}</span>
|
||||
<span className="text-xs">
|
||||
{formatDistanceToNow(new Date(agent.updated), { addSuffix: true })}
|
||||
</span>
|
||||
@@ -132,7 +134,7 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
<div className="pt-2 border-t">
|
||||
<div className="flex items-center text-xs text-green-600">
|
||||
<div className="w-2 h-2 bg-green-600 rounded-full mr-2 animate-pulse"></div>
|
||||
Active monitoring
|
||||
{t('activeMonitoring')}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -141,7 +143,7 @@ export const RegionalAgentCard: React.FC<RegionalAgentCardProps> = ({ agent, onD
|
||||
<div className="pt-2 border-t">
|
||||
<div className="flex items-center text-xs text-red-600">
|
||||
<div className="w-2 h-2 bg-red-600 rounded-full mr-2"></div>
|
||||
Connection lost
|
||||
{t('connectionLost')}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -9,8 +9,10 @@ import { RegionalService } from "@/types/regional.types";
|
||||
import { AddRegionalAgentDialog } from "./AddRegionalAgentDialog";
|
||||
import { RegionalAgentCard } from "./RegionalAgentCard";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
export const RegionalMonitoringContent = () => {
|
||||
const { t } = useLanguage();
|
||||
const [addDialogOpen, setAddDialogOpen] = useState(false);
|
||||
const { toast } = useToast();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -24,8 +26,8 @@ export const RegionalMonitoringContent = () => {
|
||||
const handleAgentAdded = () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['regional-services'] });
|
||||
toast({
|
||||
title: "Regional Agent Added",
|
||||
description: "The regional monitoring agent has been successfully configured.",
|
||||
title: t('regionalAgentAdded'),
|
||||
description: t('regionalAgentAddedDesc'),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -34,13 +36,13 @@ export const RegionalMonitoringContent = () => {
|
||||
await regionalService.deleteRegionalService(id);
|
||||
queryClient.invalidateQueries({ queryKey: ['regional-services'] });
|
||||
toast({
|
||||
title: "Agent Removed",
|
||||
description: "The regional monitoring agent has been removed.",
|
||||
title: t('agentRemoved'),
|
||||
description: t('agentRemovedDesc'),
|
||||
});
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to remove the regional monitoring agent.",
|
||||
title: t('error'),
|
||||
description: t('failedToRemoveAgent'),
|
||||
variant: "destructive",
|
||||
});
|
||||
}
|
||||
@@ -53,14 +55,14 @@ export const RegionalMonitoringContent = () => {
|
||||
<div className="p-6 space-y-6">
|
||||
<div className="flex justify-between items-center">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight">Regional Monitoring</h1>
|
||||
<h1 className="text-3xl font-bold tracking-tight">{t('regionalmonitoring')}</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Manage distributed monitoring agents across different regions
|
||||
{t('descriptRegionPage')}
|
||||
</p>
|
||||
</div>
|
||||
<Button onClick={() => setAddDialogOpen(true)}>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
Add Regional Agent
|
||||
{t('addRegionalAgent')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -68,39 +70,39 @@ export const RegionalMonitoringContent = () => {
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Total Agents</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('totalAgents')}</CardTitle>
|
||||
<MapPin className="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold">{totalAgents}</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Regional monitoring agents
|
||||
{t('regionalMonitoringAgents')}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Online Agents</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('onlineAgents')}</CardTitle>
|
||||
<Wifi className="h-4 w-4 text-green-600" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold text-green-600">{onlineAgents}</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Currently connected
|
||||
{t('currentlyConnected')}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium">Offline Agents</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t('offlineAgents')}</CardTitle>
|
||||
<WifiOff className="h-4 w-4 text-red-600" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-2xl font-bold text-red-600">{totalAgents - onlineAgents}</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Disconnected agents
|
||||
{t('disconnectedAgents')}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -108,7 +110,7 @@ export const RegionalMonitoringContent = () => {
|
||||
|
||||
{/* Agents List */}
|
||||
<div className="space-y-4">
|
||||
<h2 className="text-xl font-semibold">Regional Agents</h2>
|
||||
<h2 className="text-xl font-semibold">{t('regionalAgents')}</h2>
|
||||
|
||||
{isLoading ? (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
@@ -131,13 +133,13 @@ export const RegionalMonitoringContent = () => {
|
||||
<Card>
|
||||
<CardContent className="flex flex-col items-center justify-center py-12">
|
||||
<MapPin className="h-12 w-12 text-muted-foreground mb-4" />
|
||||
<h3 className="text-lg font-semibold mb-2">No Regional Agents</h3>
|
||||
<h3 className="text-lg font-semibold mb-2">{t('noRegionalAgents')}</h3>
|
||||
<p className="text-muted-foreground text-center mb-4">
|
||||
Get started by adding your first regional monitoring agent to extend your monitoring coverage.
|
||||
{t('getStartedAddAgent')}
|
||||
</p>
|
||||
<Button onClick={() => setAddDialogOpen(true)}>
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
Add First Agent
|
||||
{t('addFirstAgent')}
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -16,6 +16,7 @@ import { ServerAgentConfigForm } from "./ServerAgentConfigForm";
|
||||
import { OneClickInstallTab } from "./OneClickInstallTab";
|
||||
import { DockerOneClickTab } from "./DockerOneClickTab";
|
||||
import { ManualInstallTab } from "./ManualInstallTab";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface AddServerAgentDialogProps {
|
||||
open: boolean;
|
||||
@@ -28,6 +29,7 @@ export const AddServerAgentDialog: React.FC<AddServerAgentDialogProps> = ({
|
||||
onOpenChange,
|
||||
onAgentAdded,
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
const { toast } = useToast();
|
||||
const queryClient = useQueryClient();
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
@@ -62,8 +64,8 @@ export const AddServerAgentDialog: React.FC<AddServerAgentDialogProps> = ({
|
||||
|
||||
if (!formData.serverName || !formData.osType) {
|
||||
toast({
|
||||
title: "Validation Error",
|
||||
description: "Please fill in all required fields.",
|
||||
title: t('validationError'),
|
||||
description: t('fillRequiredFields'),
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
@@ -77,8 +79,8 @@ export const AddServerAgentDialog: React.FC<AddServerAgentDialogProps> = ({
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
|
||||
toast({
|
||||
title: "Server Agent Created",
|
||||
description: `${formData.serverName} monitoring agent has been configured successfully.`,
|
||||
title: t('serverAgentCreated'),
|
||||
description: t('serverAgentCreatedDesc').replace('{name}', formData.serverName),
|
||||
});
|
||||
|
||||
// Switch to one-click install tab after successful creation
|
||||
@@ -86,8 +88,8 @@ export const AddServerAgentDialog: React.FC<AddServerAgentDialogProps> = ({
|
||||
onAgentAdded();
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to create server monitoring agent.",
|
||||
title: t('error'),
|
||||
description: t('failedToCreateAgent'),
|
||||
variant: "destructive",
|
||||
});
|
||||
} finally {
|
||||
@@ -116,19 +118,19 @@ export const AddServerAgentDialog: React.FC<AddServerAgentDialogProps> = ({
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<Server className="h-5 w-5" />
|
||||
Add Server Monitoring Agent
|
||||
{t('addServerMonitoringAgent')}
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
Configure a new server monitoring agent to track system metrics and performance.
|
||||
{t('configureAgentDesc')}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="w-full">
|
||||
<TabsList className="grid w-full grid-cols-4">
|
||||
<TabsTrigger value="configure">Configure Agent</TabsTrigger>
|
||||
<TabsTrigger value="one-click">One-Click Install</TabsTrigger>
|
||||
<TabsTrigger value="docker-one-click">Docker One-Click</TabsTrigger>
|
||||
<TabsTrigger value="manual">Manual Installation</TabsTrigger>
|
||||
<TabsTrigger value="configure">{t('configureAgent')}</TabsTrigger>
|
||||
<TabsTrigger value="one-click">{t('oneClickInstall')}</TabsTrigger>
|
||||
<TabsTrigger value="docker-one-click">{t('dockerOneClick')}</TabsTrigger>
|
||||
<TabsTrigger value="manual">{t('manualInstallation')}</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="configure" className="space-y-6">
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Label } from "@/components/ui/label";
|
||||
import { Copy, Download, Container } from "lucide-react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { copyToClipboard } from "@/utils/copyUtils";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface DockerOneClickTabProps {
|
||||
serverToken: string;
|
||||
@@ -26,6 +27,7 @@ export const DockerOneClickTab: React.FC<DockerOneClickTabProps> = ({
|
||||
serverId,
|
||||
onDialogClose,
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
const getDockerOneClickCommand = () => {
|
||||
const scriptUrl = "https://cdn.checkcle.io/scripts/server-docker-agent.sh";
|
||||
|
||||
@@ -86,15 +88,15 @@ sudo -E bash ./server-docker-agent.sh`;
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2 text-blue-700 dark:text-blue-400">
|
||||
<Container className="h-5 w-5" />
|
||||
Docker One-Click Install
|
||||
{t('dockerOneClickTitle')}
|
||||
</CardTitle>
|
||||
<CardDescription className="text-blue-600 dark:text-blue-300">
|
||||
Automated Docker container installation with system monitoring capabilities
|
||||
{t('dockerOneClickDesc')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label className="text-blue-700 dark:text-blue-400">Docker One-Click Command</Label>
|
||||
<Label className="text-blue-700 dark:text-blue-400">{t('dockerOneClickCommand')}</Label>
|
||||
<div className="relative">
|
||||
<pre className="bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 p-4 rounded-md text-sm overflow-x-auto whitespace-pre-wrap break-all text-blue-800 dark:text-blue-200">
|
||||
<code>{getDockerOneClickCommand()}</code>
|
||||
@@ -107,18 +109,18 @@ sudo -E bash ./server-docker-agent.sh`;
|
||||
onClick={handleCopyOneClickCommand}
|
||||
>
|
||||
<Copy className="h-4 w-4 mr-1" />
|
||||
Copy
|
||||
{t('copy')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-sm text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 p-3 rounded-md">
|
||||
<p className="font-medium mb-1">This script will automatically:</p>
|
||||
<p className="font-medium mb-1">{t('dockerScriptWill')}</p>
|
||||
<ol className="list-decimal list-inside space-y-1 text-xs">
|
||||
<li>Download and setup the Docker monitoring agent</li>
|
||||
<li>Configure all required environment variables</li>
|
||||
<li>Start the container with proper system access</li>
|
||||
<li>Setup monitoring data persistence</li>
|
||||
<li>{t('dockerScriptStep1')}</li>
|
||||
<li>{t('dockerScriptStep2')}</li>
|
||||
<li>{t('dockerScriptStep3')}</li>
|
||||
<li>{t('dockerScriptStep4')}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</CardContent>
|
||||
@@ -129,15 +131,15 @@ sudo -E bash ./server-docker-agent.sh`;
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Container className="h-5 w-5" />
|
||||
Direct Docker Run Command
|
||||
{t('directDockerTitle')}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
If you prefer to run the Docker container directly without the script
|
||||
{t('directDockerDesc')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label>Docker Run Command</Label>
|
||||
<Label>{t('dockerRunCommand')}</Label>
|
||||
<div className="relative">
|
||||
<pre className="bg-muted border p-4 rounded-md text-sm overflow-x-auto whitespace-pre-wrap break-all">
|
||||
<code>{getDirectDockerCommand()}</code>
|
||||
@@ -150,17 +152,17 @@ sudo -E bash ./server-docker-agent.sh`;
|
||||
onClick={handleCopyDockerCommand}
|
||||
>
|
||||
<Copy className="h-4 w-4 mr-1" />
|
||||
Copy
|
||||
{t('copy')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-sm text-muted-foreground bg-muted/50 border p-3 rounded-md">
|
||||
<p className="font-medium mb-1">Prerequisites for direct Docker run:</p>
|
||||
<p className="font-medium mb-1">{t('dockerPrerequisites')}</p>
|
||||
<ol className="list-decimal list-inside space-y-1 text-xs">
|
||||
<li>Docker must be installed and running</li>
|
||||
<li>The operacle/checkcle-server-agent image must be available</li>
|
||||
<li>Run as root or with sudo privileges</li>
|
||||
<li>{t('dockerPrereqStep1')}</li>
|
||||
<li>{t('dockerPrereqStep2')}</li>
|
||||
<li>{t('dockerPrereqStep3')}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</CardContent>
|
||||
@@ -168,7 +170,7 @@ sudo -E bash ./server-docker-agent.sh`;
|
||||
|
||||
<div className="flex justify-end pt-4">
|
||||
<Button onClick={onDialogClose}>
|
||||
Done
|
||||
{t('done')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@ import { RefreshCw, X } from "lucide-react";
|
||||
import { alertConfigService, AlertConfiguration } from "@/services/alertConfigService";
|
||||
import { templateService, ServerNotificationTemplate } from "@/services/templateService";
|
||||
import { serverThresholdService, ServerThreshold } from "@/services/serverThresholdService";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface EditServerDialogProps {
|
||||
server: Server | null;
|
||||
@@ -46,6 +47,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
onOpenChange,
|
||||
onServerUpdated,
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
const [formData, setFormData] = useState<ServerFormData>({
|
||||
name: "",
|
||||
check_interval: 60,
|
||||
@@ -114,7 +116,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
// Handle the API response format with proper field names and type conversion
|
||||
setThresholdFormData({
|
||||
cpu_threshold: parseInt(String(existingThreshold.cpu_threshold)) || 80,
|
||||
ram_threshold: parseInt(String((existingThreshold as any).ram_threshold_message || existingThreshold.ram_threshold)) || 80,
|
||||
ram_threshold: parseInt(String((existingThreshold.ram_threshold_message ?? existingThreshold.ram_threshold))) || 80,
|
||||
disk_threshold: parseInt(String(existingThreshold.disk_threshold)) || 80,
|
||||
network_threshold: parseInt(String(existingThreshold.network_threshold)) || 80,
|
||||
});
|
||||
@@ -141,7 +143,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
// Handle the API response format with proper field names and type conversion
|
||||
setThresholdFormData({
|
||||
cpu_threshold: parseInt(String(threshold.cpu_threshold)) || 80,
|
||||
ram_threshold: parseInt(String((threshold as any).ram_threshold_message || threshold.ram_threshold)) || 80,
|
||||
ram_threshold: parseInt(String((threshold.ram_threshold_message ?? threshold.ram_threshold))) || 80,
|
||||
disk_threshold: parseInt(String(threshold.disk_threshold)) || 80,
|
||||
network_threshold: parseInt(String(threshold.network_threshold)) || 80,
|
||||
});
|
||||
@@ -165,8 +167,8 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error",
|
||||
description: "Failed to load notification channels",
|
||||
title: t('error', 'instance'),
|
||||
description: t('failedToLoadChannels', 'instance'),
|
||||
});
|
||||
} finally {
|
||||
setLoadingAlertConfigs(false);
|
||||
@@ -182,8 +184,8 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error",
|
||||
description: "Failed to load templates",
|
||||
title: t('error', 'instance'),
|
||||
description: t('failedToLoadTemplates', 'instance'),
|
||||
});
|
||||
} finally {
|
||||
setLoadingTemplates(false);
|
||||
@@ -198,8 +200,8 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error",
|
||||
description: "Failed to load server thresholds",
|
||||
title: t('error', 'instance'),
|
||||
description: t('failedToLoadThresholds', 'instance'),
|
||||
});
|
||||
} finally {
|
||||
setLoadingThresholds(false);
|
||||
@@ -274,15 +276,15 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Warning",
|
||||
description: "Server updated but failed to update threshold values.",
|
||||
title: t('warning', 'instance'),
|
||||
description: t('serverUpdatedButThresholdFailed', 'instance'),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
toast({
|
||||
title: "Server updated",
|
||||
description: `${formData.name} has been updated successfully.`,
|
||||
title: t('serverUpdated', 'instance'),
|
||||
description: t('serverUpdatedDesc', 'instance', { name: formData.name }),
|
||||
});
|
||||
|
||||
onServerUpdated();
|
||||
@@ -291,8 +293,8 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error",
|
||||
description: "Failed to update server. Please try again.",
|
||||
title: t('error', 'instance'),
|
||||
description: t('failedToUpdateServer', 'instance'),
|
||||
});
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
@@ -323,62 +325,62 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-[700px] max-h-[80vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Edit Server Configuration</DialogTitle>
|
||||
<DialogTitle>{t('editServerConfiguration', 'instance')}</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="serverName">Server Name *</Label>
|
||||
<Label htmlFor="serverName">{t('serverNameLabel', 'instance')}</Label>
|
||||
<Input
|
||||
id="serverName"
|
||||
value={formData.name}
|
||||
onChange={(e) => setFormData(prev => ({ ...prev, name: e.target.value }))}
|
||||
placeholder="Enter server name"
|
||||
placeholder={t('serverNamePlaceholder', 'instance')}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="checkInterval">Check Interval</Label>
|
||||
<Label htmlFor="checkInterval">{t('checkIntervalLabel', 'instance')}</Label>
|
||||
<Select
|
||||
value={formData.check_interval.toString()}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, check_interval: parseInt(value) }))}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select interval" />
|
||||
<SelectValue placeholder={t('selectInterval', 'instance')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="30">30 seconds</SelectItem>
|
||||
<SelectItem value="60">1 minute</SelectItem>
|
||||
<SelectItem value="120">2 minutes</SelectItem>
|
||||
<SelectItem value="300">5 minutes</SelectItem>
|
||||
<SelectItem value="600">10 minutes</SelectItem>
|
||||
<SelectItem value="30">{t('interval30s', 'instance')}</SelectItem>
|
||||
<SelectItem value="60">{t('interval1m', 'instance')}</SelectItem>
|
||||
<SelectItem value="120">{t('interval2m', 'instance')}</SelectItem>
|
||||
<SelectItem value="300">{t('interval5m', 'instance')}</SelectItem>
|
||||
<SelectItem value="600">{t('interval10m', 'instance')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="maxRetries">Max Retries</Label>
|
||||
<Label htmlFor="maxRetries">{t('maxRetriesLabel', 'instance')}</Label>
|
||||
<Select
|
||||
value={formData.max_retries.toString()}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, max_retries: parseInt(value) }))}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select max retries" />
|
||||
<SelectValue placeholder={t('selectMaxRetries', 'instance')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="1">1 retry</SelectItem>
|
||||
<SelectItem value="2">2 retries</SelectItem>
|
||||
<SelectItem value="3">3 retries</SelectItem>
|
||||
<SelectItem value="5">5 retries</SelectItem>
|
||||
<SelectItem value="10">10 retries</SelectItem>
|
||||
<SelectItem value="1">{t('retry1', 'instance')}</SelectItem>
|
||||
<SelectItem value="2">{t('retry2', 'instance')}</SelectItem>
|
||||
<SelectItem value="3">{t('retry3', 'instance')}</SelectItem>
|
||||
<SelectItem value="5">{t('retry5', 'instance')}</SelectItem>
|
||||
<SelectItem value="10">{t('retry10', 'instance')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="dockerMonitoring">Docker Monitoring</Label>
|
||||
<Label htmlFor="dockerMonitoring">{t('dockerMonitoring', 'instance')}</Label>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch
|
||||
id="dockerMonitoring"
|
||||
@@ -389,7 +391,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
}))}
|
||||
/>
|
||||
<Label htmlFor="dockerMonitoring" className="text-sm text-muted-foreground">
|
||||
{formData.docker_monitoring ? "Enabled" : "Disabled"}
|
||||
{formData.docker_monitoring ? t('enabled', 'instance') : t('disabled', 'instance')}
|
||||
</Label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -407,22 +409,22 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
// Remove the automatic clearing of notification_channels, threshold_id, and template_id
|
||||
}))}
|
||||
/>
|
||||
<Label htmlFor="notificationEnabled">Enable Notifications</Label>
|
||||
<Label htmlFor="notificationEnabled">{t('enableNotifications', 'instance')}</Label>
|
||||
</div>
|
||||
|
||||
{/* Expanded Notification Settings */}
|
||||
{formData.notification_enabled && (
|
||||
<Card className="border-l-4 border-l-blue-500">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">Notification Settings</CardTitle>
|
||||
<CardTitle className="text-lg">{t('notificationSettings', 'instance')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
{/* Multiple Notification Channels Selection */}
|
||||
<div className="space-y-2">
|
||||
<Label>Notification Channels</Label>
|
||||
<Label>{t('notificationChannels', 'instance')}</Label>
|
||||
<div className="space-y-2 max-h-40 overflow-y-auto border rounded-md p-3">
|
||||
{loadingAlertConfigs ? (
|
||||
<div className="text-sm text-muted-foreground">Loading channels...</div>
|
||||
<div className="text-sm text-muted-foreground">{t('loadingChannels', 'instance')}</div>
|
||||
) : alertConfigs.length > 0 ? (
|
||||
alertConfigs.map((config) => (
|
||||
<div key={config.id} className="flex items-center space-x-2">
|
||||
@@ -442,14 +444,14 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div className="text-sm text-muted-foreground">No notification channels available</div>
|
||||
<div className="text-sm text-muted-foreground">{t('noChannelsAvailable', 'instance')}</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Selected Channels Display */}
|
||||
{formData.notification_channels.length > 0 && (
|
||||
<div className="space-y-2">
|
||||
<Label className="text-sm font-medium">Selected Channels:</Label>
|
||||
<Label className="text-sm font-medium">{t('selectedChannels', 'instance')}</Label>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{formData.notification_channels.map((channelId) => {
|
||||
const channel = alertConfigs.find(c => c.id === channelId);
|
||||
@@ -478,17 +480,17 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
|
||||
{/* Server Set Threshold Selection */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="thresholdId">Server Set Threshold</Label>
|
||||
<Label htmlFor="thresholdId">{t('serverSetThreshold', 'instance')}</Label>
|
||||
<Select
|
||||
value={formData.threshold_id}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, threshold_id: value }))}
|
||||
disabled={loadingThresholds}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={loadingThresholds ? "Loading thresholds..." : "Select server threshold"} />
|
||||
<SelectValue placeholder={loadingThresholds ? t('loadingThresholds', 'instance') : t('selectServerThreshold', 'instance')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="none">No threshold (use default)</SelectItem>
|
||||
<SelectItem value="none">{t('noThreshold', 'instance')}</SelectItem>
|
||||
{thresholds.map((threshold) => (
|
||||
<SelectItem key={threshold.id} value={threshold.id}>
|
||||
{threshold.name}
|
||||
@@ -502,12 +504,12 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
{selectedThreshold && (
|
||||
<Card className="bg-muted/50">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base">Threshold Details: {selectedThreshold.name}</CardTitle>
|
||||
<CardTitle className="text-base">{t('thresholdDetails', 'instance')}: {selectedThreshold.name}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
<div className="grid grid-cols-2 gap-3 text-sm">
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">CPU Threshold (%)</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('cpuThresholdPct', 'instance')}</Label>
|
||||
<Input
|
||||
type="number"
|
||||
min="0"
|
||||
@@ -521,7 +523,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">RAM Threshold (%)</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('ramThresholdPct', 'instance')}</Label>
|
||||
<Input
|
||||
type="number"
|
||||
min="0"
|
||||
@@ -535,7 +537,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">Disk Threshold (%)</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('diskThresholdPct', 'instance')}</Label>
|
||||
<Input
|
||||
type="number"
|
||||
min="0"
|
||||
@@ -549,7 +551,7 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">Network Threshold (%)</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('networkThresholdPct', 'instance')}</Label>
|
||||
<Input
|
||||
type="number"
|
||||
min="0"
|
||||
@@ -569,17 +571,17 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
|
||||
{/* Server Template Selection */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="templateId">Server Template</Label>
|
||||
<Label htmlFor="templateId">{t('serverTemplate', 'instance')}</Label>
|
||||
<Select
|
||||
value={formData.template_id}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, template_id: value }))}
|
||||
disabled={loadingTemplates}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder={loadingTemplates ? "Loading templates..." : "Select server template"} />
|
||||
<SelectValue placeholder={loadingTemplates ? t('loadingTemplates', 'instance') : t('selectServerTemplate', 'instance')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="none">No template (use default)</SelectItem>
|
||||
<SelectItem value="none">{t('noTemplate', 'instance')}</SelectItem>
|
||||
{templates.map((template) => (
|
||||
<SelectItem key={template.id} value={template.id}>
|
||||
{template.name}
|
||||
@@ -593,44 +595,44 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
{selectedTemplate && (
|
||||
<Card className="bg-muted/50">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base">Template Details: {selectedTemplate.name}</CardTitle>
|
||||
<CardTitle className="text-base">{t('templateDetails', 'instance')}: {selectedTemplate.name}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
<div className="grid grid-cols-1 gap-3 text-sm">
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">RAM Message</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('ramMessage', 'instance')}</Label>
|
||||
<p className="text-sm bg-background p-2 rounded border">
|
||||
{selectedTemplate.ram_message || "No RAM message defined"}
|
||||
{selectedTemplate.ram_message || t('noMessageDefined', 'instance', { name: 'RAM' })}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">CPU Message</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('cpuMessage', 'instance')}</Label>
|
||||
<p className="text-sm bg-background p-2 rounded border">
|
||||
{selectedTemplate.cpu_message || "No CPU message defined"}
|
||||
{selectedTemplate.cpu_message || t('noMessageDefined', 'instance', { name: 'CPU' })}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">Disk Message</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('diskMessage', 'instance')}</Label>
|
||||
<p className="text-sm bg-background p-2 rounded border">
|
||||
{selectedTemplate.disk_message || "No disk message defined"}
|
||||
{selectedTemplate.disk_message || t('noMessageDefined', 'instance', { name: 'disk' })}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">Network Message</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('networkMessage', 'instance')}</Label>
|
||||
<p className="text-sm bg-background p-2 rounded border">
|
||||
{selectedTemplate.network_message || "No network message defined"}
|
||||
{selectedTemplate.network_message || t('noMessageDefined', 'instance', { name: 'network' })}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">Up Message</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('upMessage', 'instance')}</Label>
|
||||
<p className="text-sm bg-background p-2 rounded border">
|
||||
{selectedTemplate.up_message || "No up message defined"}
|
||||
{selectedTemplate.up_message || t('noMessageDefined', 'instance', { name: 'up' })}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<Label className="text-xs font-medium text-muted-foreground">Down Message</Label>
|
||||
<Label className="text-xs font-medium text-muted-foreground">{t('downMessage', 'instance')}</Label>
|
||||
<p className="text-sm bg-background p-2 rounded border">
|
||||
{selectedTemplate.down_message || "No down message defined"}
|
||||
{selectedTemplate.down_message || t('noMessageDefined', 'instance', { name: 'down' })}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -649,16 +651,16 @@ export const EditServerDialog: React.FC<EditServerDialogProps> = ({
|
||||
onClick={handleCancel}
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
Cancel
|
||||
{t('cancel', 'instance')}
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{isSubmitting ? (
|
||||
<>
|
||||
<RefreshCw className="mr-2 h-4 w-4 animate-spin" />
|
||||
Updating...
|
||||
{t('updating', 'instance')}
|
||||
</>
|
||||
) : (
|
||||
"Update Server"
|
||||
t('updateServer', 'instance')
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Copy, Terminal } from "lucide-react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { copyToClipboard } from "@/utils/copyUtils";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface ManualInstallTabProps {
|
||||
serverToken: string;
|
||||
@@ -24,20 +25,22 @@ export const ManualInstallTab: React.FC<ManualInstallTabProps> = ({
|
||||
serverId,
|
||||
onDialogClose,
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
const getManualInstallSteps = () => {
|
||||
const scriptUrl = "https://cdn.checkcle.io/scripts/server-agent.sh";
|
||||
|
||||
return [
|
||||
{
|
||||
title: "Download the installation script",
|
||||
title: t('downloadScript'),
|
||||
command: `curl -L -o server-agent.sh "${scriptUrl}"`
|
||||
},
|
||||
{
|
||||
title: "Make the script executable",
|
||||
title: t('makeExecutable'),
|
||||
command: `chmod +x server-agent.sh`
|
||||
},
|
||||
{
|
||||
title: "Run the installation with your configuration",
|
||||
title: t('runInstall'),
|
||||
command: `SERVER_TOKEN="${serverToken}" POCKETBASE_URL="${currentPocketBaseUrl}" SERVER_NAME="${formData.serverName}" AGENT_ID="${serverId}" sudo bash server-agent.sh`
|
||||
}
|
||||
];
|
||||
@@ -48,26 +51,26 @@ export const ManualInstallTab: React.FC<ManualInstallTabProps> = ({
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Terminal className="h-5 w-5" />
|
||||
Manual Installation Steps
|
||||
{t('manualInstallTitle')}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Step-by-step installation process
|
||||
{t('manualInstallDesc')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<div className="grid grid-cols-2 gap-4 text-sm">
|
||||
<div>
|
||||
<span className="font-medium">Server Name:</span> {formData.serverName}
|
||||
<span className="font-medium">{t('serverName')}:</span> {formData.serverName}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Agent ID:</span> {serverId}
|
||||
<span className="font-medium">{t('agentId')}:</span> {serverId}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">OS Type:</span> {formData.osType}
|
||||
<span className="font-medium">{t('osType')}:</span> {formData.osType}
|
||||
</div>
|
||||
<div>
|
||||
<span className="font-medium">Check Interval:</span> {formData.checkInterval}s
|
||||
<span className="font-medium">{t('checkInterval')}:</span> {formData.checkInterval}s
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,7 +96,7 @@ export const ManualInstallTab: React.FC<ManualInstallTabProps> = ({
|
||||
onClick={() => copyToClipboard(step.command)}
|
||||
>
|
||||
<Copy className="h-4 w-4 mr-1" />
|
||||
Copy
|
||||
{t('copy')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,22 +104,22 @@ export const ManualInstallTab: React.FC<ManualInstallTabProps> = ({
|
||||
</div>
|
||||
|
||||
<div className="bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-md p-4">
|
||||
<h4 className="font-medium text-blue-900 dark:text-blue-100 mb-2">Prerequisites:</h4>
|
||||
<h4 className="font-medium text-blue-900 dark:text-blue-100 mb-2">{t('prerequisites')}</h4>
|
||||
<ul className="text-sm text-blue-800 dark:text-blue-200 space-y-1 list-disc list-inside mb-3">
|
||||
<li>Ensure you have root/sudo access on the target server</li>
|
||||
<li>Make sure curl is installed for downloading files</li>
|
||||
<li>Internet connection required for downloading script</li>
|
||||
<li>{t('prereqRoot')}</li>
|
||||
<li>{t('prereqCurl')}</li>
|
||||
<li>{t('prereqInternet')}</li>
|
||||
</ul>
|
||||
|
||||
<h4 className="font-medium text-blue-900 dark:text-blue-100 mb-2">After Installation:</h4>
|
||||
<h4 className="font-medium text-blue-900 dark:text-blue-100 mb-2">{t('afterInstall')}</h4>
|
||||
<p className="text-sm text-blue-800 dark:text-blue-200">
|
||||
The agent will start automatically and appear in your dashboard within a few minutes.
|
||||
{t('agentWillStart')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end pt-4">
|
||||
<Button onClick={onDialogClose}>
|
||||
Done
|
||||
{t('done')}
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Label } from "@/components/ui/label";
|
||||
import { Copy, Download } from "lucide-react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { copyToClipboard } from "@/utils/copyUtils";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface OneClickInstallTabProps {
|
||||
serverToken: string;
|
||||
@@ -26,6 +27,8 @@ export const OneClickInstallTab: React.FC<OneClickInstallTabProps> = ({
|
||||
serverId,
|
||||
onDialogClose,
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
const getOneClickInstallCommand = () => {
|
||||
const scriptUrl = "https://cdn.checkcle.io/scripts/server-agent.sh";
|
||||
|
||||
@@ -55,15 +58,15 @@ sudo -E bash ./server-agent.sh`;
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2 text-green-700 dark:text-green-400">
|
||||
<Download className="h-5 w-5" />
|
||||
One-Click Install (Recommended)
|
||||
{t('oneClickInstallTitle')}
|
||||
</CardTitle>
|
||||
<CardDescription className="text-green-600 dark:text-green-300">
|
||||
Copy and paste this single command to install the monitoring agent instantly
|
||||
{t('oneClickInstallDesc')}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label className="text-green-700 dark:text-green-400">Quick Install Command</Label>
|
||||
<Label className="text-green-700 dark:text-green-400">{t('quickInstallCommand')}</Label>
|
||||
<div className="relative">
|
||||
<pre className="bg-black-50 dark:bg-green-100/950 border border-green-200 dark:border-green-800 p-4 rounded-md text-sm overflow-x-auto whitespace-pre-wrap break-all text-green-800 dark:text-green-200">
|
||||
<code>{getOneClickInstallCommand()}</code>
|
||||
@@ -76,23 +79,23 @@ sudo -E bash ./server-agent.sh`;
|
||||
onClick={handleCopyCommand}
|
||||
>
|
||||
<Copy className="h-4 w-4 mr-1" />
|
||||
Copy
|
||||
{t('copy')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-sm text-green-700 dark:text-green-300 bg-green-50 dark:bg-green-950/50 border border-green-200 dark:border-green-800 p-3 rounded-md">
|
||||
<p className="font-medium mb-1">Simply run this command on your server:</p>
|
||||
<p className="font-medium mb-1">{t('runCommandOnServer')}</p>
|
||||
<ol className="list-decimal list-inside space-y-1 text-xs">
|
||||
<li>SSH into your target server</li>
|
||||
<li>Paste and run the command above</li>
|
||||
<li>The agent will be installed and started automatically</li>
|
||||
<li>{t('sshIntoServer')}</li>
|
||||
<li>{t('pasteAndRun')}</li>
|
||||
<li>{t('agentInstalled')}</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end pt-4">
|
||||
<Button onClick={onDialogClose}>
|
||||
Done
|
||||
{t('done')}
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
|
||||
import { Copy } from "lucide-react";
|
||||
import { copyToClipboard } from "@/utils/copyUtils";
|
||||
import { OSSelector } from "./OSSelector";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface ServerAgentConfigFormProps {
|
||||
formData: {
|
||||
@@ -43,23 +44,25 @@ export const ServerAgentConfigForm: React.FC<ServerAgentConfigFormProps> = ({
|
||||
isSubmitting,
|
||||
onSubmit,
|
||||
}) => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
return (
|
||||
<form onSubmit={onSubmit} className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="serverName">Server Name *</Label>
|
||||
<Label htmlFor="serverName">{t('serverName')} *</Label>
|
||||
<Input
|
||||
id="serverName"
|
||||
placeholder="e.g., web-server-01"
|
||||
placeholder={t('serverNamePlaceholder')}
|
||||
value={formData.serverName}
|
||||
onChange={(e) => setFormData(prev => ({ ...prev, serverName: e.target.value }))}
|
||||
required
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">What is the name or label used as the identifier</p>
|
||||
<p className="text-xs text-muted-foreground">{t('serverNameDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="serverId">Server Agent ID</Label>
|
||||
<Label htmlFor="serverId">{t('serverAgentId')}</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
id="serverId"
|
||||
@@ -76,13 +79,13 @@ export const ServerAgentConfigForm: React.FC<ServerAgentConfigFormProps> = ({
|
||||
<Copy className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">Auto-generated unique identifier</p>
|
||||
<p className="text-xs text-muted-foreground">{t('serverAgentIdDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label>Operating System *</Label>
|
||||
<Label>{t('operatingSystem')} *</Label>
|
||||
<OSSelector
|
||||
value={formData.osType}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, osType: value }))}
|
||||
@@ -91,45 +94,45 @@ export const ServerAgentConfigForm: React.FC<ServerAgentConfigFormProps> = ({
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="checkInterval">Check Interval</Label>
|
||||
<Label htmlFor="checkInterval">{t('checkInterval')}</Label>
|
||||
<Select
|
||||
value={formData.checkInterval}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, checkInterval: value }))}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select interval" />
|
||||
<SelectValue placeholder={t('selectInterval')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="30">30 seconds</SelectItem>
|
||||
<SelectItem value="60">1 minute</SelectItem>
|
||||
<SelectItem value="120">2 minutes</SelectItem>
|
||||
<SelectItem value="300">5 minutes</SelectItem>
|
||||
<SelectItem value="30">{t('interval30s')}</SelectItem>
|
||||
<SelectItem value="60">{t('interval1m')}</SelectItem>
|
||||
<SelectItem value="120">{t('interval2m')}</SelectItem>
|
||||
<SelectItem value="300">{t('interval5m')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-xs text-muted-foreground">How often to check the server and metric status</p>
|
||||
<p className="text-xs text-muted-foreground">{t('checkIntervalDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="retryAttempt">Retry Attempts</Label>
|
||||
<Label htmlFor="retryAttempt">{t('retryAttempts')}</Label>
|
||||
<Select
|
||||
value={formData.retryAttempt}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, retryAttempt: value }))}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select retry attempts" />
|
||||
<SelectValue placeholder={t('selectRetryAttempts')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="1">1 attempt</SelectItem>
|
||||
<SelectItem value="2">2 attempts</SelectItem>
|
||||
<SelectItem value="3">3 attempts</SelectItem>
|
||||
<SelectItem value="5">5 attempts</SelectItem>
|
||||
<SelectItem value="1">{t('attempt1')}</SelectItem>
|
||||
<SelectItem value="2">{t('attempt2')}</SelectItem>
|
||||
<SelectItem value="3">{t('attempt3')}</SelectItem>
|
||||
<SelectItem value="5">{t('attempt5')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-xs text-muted-foreground">Number of retry attempts before marking as down</p>
|
||||
<p className="text-xs text-muted-foreground">{t('retryAttemptsDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Server Token</Label>
|
||||
<Label>{t('serverToken')}</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input value={serverToken} readOnly className="font-mono text-sm bg-muted" />
|
||||
<Button
|
||||
@@ -141,11 +144,11 @@ export const ServerAgentConfigForm: React.FC<ServerAgentConfigFormProps> = ({
|
||||
<Copy className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">Auto-generated authentication token</p>
|
||||
<p className="text-xs text-muted-foreground">{t('serverTokenDesc')}</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>System URL</Label>
|
||||
<Label>{t('systemUrl')}</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input value={currentPocketBaseUrl} readOnly className="font-mono text-sm bg-muted" />
|
||||
<Button
|
||||
@@ -157,14 +160,14 @@ export const ServerAgentConfigForm: React.FC<ServerAgentConfigFormProps> = ({
|
||||
<Copy className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">Current system API URL</p>
|
||||
<p className="text-xs text-muted-foreground">{t('systemUrlDesc')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="pt-4">
|
||||
<Button type="submit" disabled={isSubmitting} className="w-full">
|
||||
{isSubmitting ? "Creating Agent..." : "Create Server Agent"}
|
||||
{isSubmitting ? t('creatingAgent') : t('createServerAgent')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -8,12 +8,14 @@ import { CPUChart } from "./charts/CPUChart";
|
||||
import { MemoryChart } from "./charts/MemoryChart";
|
||||
import { DiskChart } from "./charts/DiskChart";
|
||||
import { NetworkChart } from "./charts/NetworkChart";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface ServerHistoryChartsProps {
|
||||
serverId: string;
|
||||
}
|
||||
|
||||
export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
const { t } = useLanguage();
|
||||
const {
|
||||
timeRange,
|
||||
setTimeRange,
|
||||
@@ -33,15 +35,15 @@ export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
|
||||
// Show skeleton loading state for better UX
|
||||
if (isLoading) {
|
||||
return (
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<TrendingUp className="h-5 w-5" />
|
||||
<h2 className="text-lg font-medium">Historical Performance</h2>
|
||||
<h2 className="text-lg font-medium">{t("historicalPerformance")}</h2>
|
||||
<div className="flex items-center gap-2 ml-2">
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
<span className="text-xs text-muted-foreground">Loading...</span>
|
||||
<span className="text-xs text-muted-foreground">{t("loading")}</span>
|
||||
</div>
|
||||
</div>
|
||||
<TimeRangeSelector value={timeRange} onChange={setTimeRange} />
|
||||
@@ -77,7 +79,7 @@ export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<TrendingUp className="h-5 w-5" />
|
||||
<h2 className="text-lg font-medium">Historical Performance</h2>
|
||||
<h2 className="text-lg font-medium">{t("historicalPerformance")}</h2>
|
||||
{isFetching && <Loader2 className="h-4 w-4 animate-spin ml-2" />}
|
||||
</div>
|
||||
<TimeRangeSelector value={timeRange} onChange={setTimeRange} />
|
||||
@@ -85,9 +87,9 @@ export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
<Card>
|
||||
<CardContent className="flex items-center justify-center py-12">
|
||||
<div className="text-center">
|
||||
<p className="text-muted-foreground">Error loading chart data</p>
|
||||
<p className="text-muted-foreground">{t("errorLoadingChartData")}</p>
|
||||
<p className="text-xs mt-2 font-mono text-red-500">{error?.message}</p>
|
||||
<p className="text-xs mt-1 text-muted-foreground">Server ID: {serverId} • Time Range: {timeRange}</p>
|
||||
<p className="text-xs mt-1 text-muted-foreground">{t("serverIdTimeRange", { serverId, timeRange })}</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -101,7 +103,7 @@ export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<TrendingUp className="h-5 w-5" />
|
||||
<h2 className="text-lg font-medium">Historical Performance</h2>
|
||||
<h2 className="text-lg font-medium">{t("historicalPerformance")}</h2>
|
||||
{isFetching && <Loader2 className="h-4 w-4 animate-spin ml-2" />}
|
||||
</div>
|
||||
<TimeRangeSelector value={timeRange} onChange={setTimeRange} />
|
||||
@@ -109,11 +111,13 @@ export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
<Card>
|
||||
<CardContent className="flex items-center justify-center py-12">
|
||||
<div className="text-center">
|
||||
<p className="text-muted-foreground">No historical data available for {timeRange}</p>
|
||||
<p className="text-xs mt-2">Raw metrics count: {metrics.length}</p>
|
||||
<p className="text-xs mt-1">Server ID: {serverId} • Time Range: {timeRange}</p>
|
||||
<p className="text-muted-foreground">{t("noHistoricalData", { timeRange })}</p>
|
||||
<p className="text-xs mt-2">{t("rawMetricsCount", { count: metrics.length })}</p>
|
||||
<p className="text-xs mt-1">{t("serverIdTimeRange", { serverId, timeRange })}</p>
|
||||
<p className="text-xs mt-1 text-muted-foreground">
|
||||
{metrics.length > 0 ? 'Data exists but may be outside selected time range' : 'No metrics data found'}
|
||||
{metrics.length > 0
|
||||
? t("dataExistsOutsideRange")
|
||||
: t("noMetricsDataFound")}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
@@ -129,13 +133,13 @@ export const ServerHistoryCharts = ({ serverId }: ServerHistoryChartsProps) => {
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<TrendingUp className="h-5 w-5" />
|
||||
<h2 className="text-lg font-medium">Historical Performance</h2>
|
||||
<h2 className="text-lg font-medium">{t("historicalPerformance")}</h2>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
({chartData.length} data points • {timeRange})
|
||||
{isFetching && (
|
||||
<span className="inline-flex items-center gap-1 ml-2">
|
||||
<Loader2 className="h-3 w-3 animate-spin" />
|
||||
<span className="text-blue-500">Updating...</span>
|
||||
<span className="text-blue-500">{t("updating")}</span>
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
|
||||
@@ -3,17 +3,19 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Server, Activity, AlertTriangle, Power } from "lucide-react";
|
||||
import { ServerStats } from "@/types/server.types";
|
||||
import { useTheme } from "@/contexts/ThemeContext";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface ServerStatsCardsProps {
|
||||
stats: ServerStats;
|
||||
}
|
||||
|
||||
export const ServerStatsCards = ({ stats }: ServerStatsCardsProps) => {
|
||||
const { t } = useLanguage();
|
||||
const { theme } = useTheme();
|
||||
|
||||
const cards = [
|
||||
{
|
||||
title: "TOTAL SERVERS",
|
||||
title: t('totalServers', 'instance'),
|
||||
value: stats.total,
|
||||
icon: Server,
|
||||
gradient: theme === 'dark'
|
||||
@@ -21,7 +23,7 @@ export const ServerStatsCards = ({ stats }: ServerStatsCardsProps) => {
|
||||
: "linear-gradient(135deg, rgba(65, 59, 55, 0.8) 0%, #a0522d 100%)"
|
||||
},
|
||||
{
|
||||
title: "ONLINE SERVERS",
|
||||
title: t('onlineServers', 'instance'),
|
||||
value: stats.online,
|
||||
icon: Activity,
|
||||
gradient: theme === 'dark'
|
||||
@@ -29,7 +31,7 @@ export const ServerStatsCards = ({ stats }: ServerStatsCardsProps) => {
|
||||
: "linear-gradient(135deg, rgba(65, 59, 55, 0.8) 0%, #66bb6a 100%)"
|
||||
},
|
||||
{
|
||||
title: "OFFLINE SERVERS",
|
||||
title: t('offlineServers', 'instance'),
|
||||
value: stats.offline,
|
||||
icon: Power,
|
||||
gradient: theme === 'dark'
|
||||
@@ -37,7 +39,7 @@ export const ServerStatsCards = ({ stats }: ServerStatsCardsProps) => {
|
||||
: "linear-gradient(135deg, rgba(65, 59, 55, 0.8) 0%, #ef5350 100%)"
|
||||
},
|
||||
{
|
||||
title: "WARNING SERVERS",
|
||||
title: t('warningServers', 'instance'),
|
||||
value: stats.warning,
|
||||
icon: AlertTriangle,
|
||||
gradient: theme === 'dark'
|
||||
|
||||
@@ -16,6 +16,7 @@ import { serverService } from "@/services/serverService";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { pb } from "@/lib/pocketbase";
|
||||
import { useTheme } from "@/contexts/ThemeContext";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface ServerTableProps {
|
||||
servers: Server[];
|
||||
@@ -24,6 +25,7 @@ interface ServerTableProps {
|
||||
}
|
||||
|
||||
export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps) => {
|
||||
const { t } = useLanguage();
|
||||
const { theme } = useTheme();
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
@@ -68,8 +70,8 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
await pb.collection('servers').update(serverId, updateData);
|
||||
|
||||
toast({
|
||||
title: isPaused ? "Server resumed" : "Server paused",
|
||||
description: `Monitoring ${isPaused ? 'resumed' : 'paused'} for ${server.name}`,
|
||||
title: isPaused ? t('serverResumed') : t('serverPaused'),
|
||||
description: isPaused ? t('monitoringResumed', { name: server.name }) : t('monitoringPaused', { name: server.name }),
|
||||
});
|
||||
|
||||
// console.log(`${isPaused ? 'Resume' : 'Pause'} server monitoring: ${serverId}`);
|
||||
@@ -81,8 +83,8 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
// console.error('Error updating server status:', error);
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Error",
|
||||
description: `Failed to ${isPaused ? 'resume' : 'pause'} server monitoring. Please try again.`,
|
||||
title: t('error'),
|
||||
description: isPaused ? t('resumeServerError') : t('pauseServerError'),
|
||||
});
|
||||
} finally {
|
||||
setPausingServers(prev => {
|
||||
@@ -204,12 +206,12 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
return (
|
||||
<Card className="flex-1 flex flex-col">
|
||||
<CardHeader className="flex-shrink-0">
|
||||
<CardTitle>Servers</CardTitle>
|
||||
<CardTitle>{t('servers')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex-1 flex items-center justify-center">
|
||||
<div className="flex items-center justify-center h-32">
|
||||
<RefreshCw className="h-6 w-6 animate-spin" />
|
||||
<span className="ml-2">Loading servers...</span>
|
||||
<span className="ml-2">{t('loadingServers')}</span>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -221,12 +223,12 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
<Card className="bg-transparent border-0 shadow-none">
|
||||
<CardHeader className="pb-4 px-0">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<CardTitle className="text-xl font-semibold">Servers</CardTitle>
|
||||
<CardTitle className="text-xl font-semibold">{t('servers')}</CardTitle>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="relative flex-1 sm:w-64">
|
||||
<Search className="absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
|
||||
<Input
|
||||
placeholder="Search servers..."
|
||||
placeholder={t('searchServersPlaceholder')}
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
className="pl-8"
|
||||
@@ -241,23 +243,23 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
<CardContent className="p-0">
|
||||
{filteredServers.length === 0 ? (
|
||||
<div className="flex items-center justify-center p-8">
|
||||
<p className="text-muted-foreground">No servers found</p>
|
||||
<p className="text-muted-foreground">{t('noServersFound')}</p>
|
||||
</div>
|
||||
) : (
|
||||
<div className={`${theme === 'dark' ? 'bg-gray-900' : 'bg-white'} rounded-lg border border-border shadow-sm`}>
|
||||
<Table>
|
||||
<TableHeader className={`${theme === 'dark' ? 'bg-gray-800' : 'bg-gray-50'}`}>
|
||||
<TableRow className={`${theme === 'dark' ? 'border-gray-700 hover:bg-gray-800' : 'border-gray-200 hover:bg-gray-100'}`}>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>Name</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>Status</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>OS</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>IP Address</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>CPU</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>Memory</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>Disk</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>Uptime</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>Last Checked</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4 text-right`}>Actions</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('name')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('status')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('OS')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('IPAddress')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('CPU')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('memory')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('disk')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('uptime')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4`}>{t('lastChecked')}</TableHead>
|
||||
<TableHead className={`${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'} font-medium text-base py-4 text-right`}>{t('actions')}</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@@ -333,7 +335,7 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" className="h-8 w-8 p-0" disabled={isProcessing}>
|
||||
<span className="sr-only">Open menu</span>
|
||||
<span className="sr-only">{t('openMenu')}</span>
|
||||
{isProcessing ? (
|
||||
<RefreshCw className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
@@ -344,12 +346,12 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
<DropdownMenuContent align="end" className="w-[200px]">
|
||||
<DropdownMenuItem onClick={(e) => { e.stopPropagation(); handleViewDetails(server.id); }}>
|
||||
<Eye className="mr-2 h-4 w-4" />
|
||||
View Server Detail
|
||||
{t('viewServerDetail')}
|
||||
</DropdownMenuItem>
|
||||
{server.docker === 'true' && (
|
||||
<DropdownMenuItem onClick={(e) => { e.stopPropagation(); handleViewContainers(server.id); }}>
|
||||
<Activity className="mr-2 h-4 w-4" />
|
||||
Container Monitoring
|
||||
{t('containerMonitoring')}
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
<DropdownMenuSeparator />
|
||||
@@ -360,26 +362,26 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
{isPaused ? (
|
||||
<>
|
||||
<Play className="mr-2 h-4 w-4" />
|
||||
Resume Monitoring
|
||||
{t('resumeMonitoring')}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Pause className="mr-2 h-4 w-4" />
|
||||
Pause Monitoring
|
||||
{t('pauseMonitoring')}
|
||||
</>
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem onClick={(e) => { e.stopPropagation(); handleEdit(server); }}>
|
||||
<Edit className="mr-2 h-4 w-4" />
|
||||
Edit Server
|
||||
{t('editServer')}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onClick={(e) => { e.stopPropagation(); handleDelete(server); }}
|
||||
className="text-red-600 focus:text-red-600"
|
||||
>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
Delete Server
|
||||
{t('deleteServer')}
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
@@ -406,25 +408,21 @@ export const ServerTable = ({ servers, isLoading, onRefresh }: ServerTableProps)
|
||||
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Are you sure you want to delete this server?</AlertDialogTitle>
|
||||
<AlertDialogTitle>{t('deleteServerConfirmTitle')}</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
This action cannot be undone. This will permanently delete{' '}
|
||||
<span className="font-semibold text-foreground">
|
||||
{selectedServer?.name}
|
||||
</span>{' '}
|
||||
and all of its monitoring data.
|
||||
{t('deleteServerConfirmDesc').replace('{name}', selectedServer?.name ?? '')}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel disabled={isDeleting}>
|
||||
Cancel
|
||||
{t('cancel')}
|
||||
</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
onClick={confirmDelete}
|
||||
disabled={isDeleting}
|
||||
className="bg-red-600 text-white hover:bg-red-700"
|
||||
>
|
||||
{isDeleting ? "Deleting..." : "Delete"}
|
||||
{isDeleting ? t('deleting') : t('delete')}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
|
||||
@@ -158,14 +158,14 @@ const DataRetentionSettings = () => {
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Database className="h-5 w-5" />
|
||||
{t("dataRetention", "settings")}
|
||||
{t("dataRetention")}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<Alert className="border-blue-200 bg-blue-50 dark:bg-blue-950 dark:border-blue-800">
|
||||
<AlertTriangle className="h-5 w-5 text-blue-600 dark:text-blue-400" />
|
||||
<AlertDescription className="text-blue-700 dark:text-blue-300">
|
||||
<span className="font-medium">Permission Notice:</span> As an admin user, you do not have access to data retention settings. These settings can only be accessed and modified by Super Admins.
|
||||
<span className="font-medium">{t("permissionNotice")}</span> {t("permissionNoticeDataRetention")}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
</CardContent>
|
||||
@@ -178,7 +178,7 @@ const DataRetentionSettings = () => {
|
||||
return (
|
||||
<div className="p-4 flex items-center justify-center">
|
||||
<Loader2 className="h-6 w-6 animate-spin mr-2" />
|
||||
Loading retention settings...
|
||||
{t("loadingRetentionSettings")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -189,16 +189,16 @@ const DataRetentionSettings = () => {
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Database className="h-5 w-5" />
|
||||
Data Retention Settings
|
||||
{t("dataRetention")}
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Configure how long monitoring data is kept in the system
|
||||
{t("dataRetentionDescription")}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6">
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<Label htmlFor="uptimeRetention">Uptime Monitoring Retention (days)</Label>
|
||||
<Label htmlFor="uptimeRetention">{t("uptimeRetentionLabel")}</Label>
|
||||
<Input
|
||||
id="uptimeRetention"
|
||||
type="number"
|
||||
@@ -218,12 +218,12 @@ const DataRetentionSettings = () => {
|
||||
className="mt-1"
|
||||
/>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Service uptime and incident data older than this will be automatically deleted
|
||||
{t("uptimeRetentionHelp")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="serverRetention">Server Monitoring Retention (days)</Label>
|
||||
<Label htmlFor="serverRetention">{t("serverRetentionLabel")}</Label>
|
||||
<Input
|
||||
id="serverRetention"
|
||||
type="number"
|
||||
@@ -243,7 +243,7 @@ const DataRetentionSettings = () => {
|
||||
className="mt-1"
|
||||
/>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Server metrics and process data older than this will be automatically deleted
|
||||
{t("serverRetentionHelp")}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -252,7 +252,7 @@ const DataRetentionSettings = () => {
|
||||
<Alert>
|
||||
<Database className="h-4 w-4" />
|
||||
<AlertDescription>
|
||||
Last automatic cleanup: {new Date(lastCleanup).toLocaleString()}
|
||||
{t("lastCleanup")}: {new Date(lastCleanup).toLocaleString()}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
@@ -266,7 +266,7 @@ const DataRetentionSettings = () => {
|
||||
{isSaving ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : null}
|
||||
Save Changes
|
||||
{t("save")}
|
||||
</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
|
||||
+88
-88
@@ -247,6 +247,7 @@ export const NotificationChannelDialog = ({
|
||||
onClose,
|
||||
editingConfig
|
||||
}: NotificationChannelDialogProps) => {
|
||||
const { t } = useLanguage();
|
||||
const isEditing = !!editingConfig;
|
||||
const form = useForm<FormValues>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@@ -325,7 +326,7 @@ export const NotificationChannelDialog = ({
|
||||
<DialogContent className="sm:max-w-[700px] max-h-[90vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle>
|
||||
{isEditing ? "Edit Notification Channel" : "Add Notification Channel"}
|
||||
{isEditing ? t("editChannel") : t("addChannelDialog")}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
@@ -336,28 +337,28 @@ export const NotificationChannelDialog = ({
|
||||
name="notify_name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Channel Name</FormLabel>
|
||||
<FormLabel>{t("channelName")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="My Notification Channel" {...field} />
|
||||
<Input placeholder={t("channelNamePlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
A name to identify this notification channel
|
||||
{t("channelNameDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="notification_type"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Channel Type</FormLabel>
|
||||
<FormLabel>{t("channelType")}</FormLabel>
|
||||
<Select onValueChange={field.onChange} value={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select notification type" />
|
||||
<SelectValue placeholder={t("selectType")} />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
@@ -370,8 +371,8 @@ export const NotificationChannelDialog = ({
|
||||
className="w-5 h-5 object-contain"
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium">{option.label}</span>
|
||||
<span className="text-xs text-muted-foreground">{option.description}</span>
|
||||
<span className="font-medium">{t(option.value)}</span>
|
||||
<span className="text-xs text-muted-foreground">{t(option.description)}</span>
|
||||
</div>
|
||||
</div>
|
||||
</SelectItem>
|
||||
@@ -382,7 +383,7 @@ export const NotificationChannelDialog = ({
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
{notificationType === "telegram" && (
|
||||
<>
|
||||
<FormField
|
||||
@@ -390,12 +391,12 @@ export const NotificationChannelDialog = ({
|
||||
name="telegram_chat_id"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Chat ID</FormLabel>
|
||||
<FormLabel>{t("telegramChatId")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Telegram Chat ID" {...field} />
|
||||
<Input placeholder={t("telegramChatIdPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
The Telegram chat ID to send notifications to
|
||||
{t("telegramChatIdDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -406,12 +407,12 @@ export const NotificationChannelDialog = ({
|
||||
name="bot_token"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Bot Token</FormLabel>
|
||||
<FormLabel>{t("botToken")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Telegram Bot Token" {...field} type="password" />
|
||||
<Input placeholder={t("botTokenPlaceholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Your Telegram bot token from @BotFather
|
||||
{t("botTokenDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -419,38 +420,38 @@ export const NotificationChannelDialog = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
{notificationType === "discord" && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="discord_webhook_url"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Webhook URL</FormLabel>
|
||||
<FormLabel>{t("discordWebhookUrl")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://discord.com/api/webhooks/..." {...field} />
|
||||
<Input placeholder={t("discordWebhookUrlPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Discord webhook URL from your server settings
|
||||
{t("discordWebhookUrlDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
{notificationType === "slack" && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="slack_webhook_url"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Webhook URL</FormLabel>
|
||||
<FormLabel>{t("slackWebhookUrl")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://hooks.slack.com/services/..." {...field} />
|
||||
<Input placeholder={t("slackWebhookUrlPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Slack incoming webhook URL
|
||||
{t("slackWebhookUrlDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -465,12 +466,12 @@ export const NotificationChannelDialog = ({
|
||||
name="signal_number"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Signal Number</FormLabel>
|
||||
<FormLabel>{t("signalNumber")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="+1234567890" {...field} />
|
||||
<Input placeholder={t("signalNumberPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Signal phone number to send notifications to
|
||||
{t("signalNumberDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -481,12 +482,12 @@ export const NotificationChannelDialog = ({
|
||||
name="signal_api_endpoint"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Signal API Endpoint</FormLabel>
|
||||
<FormLabel>{t("signalApiEndpoint")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://your-signal-api.com/v2/send" {...field} />
|
||||
<Input placeholder={t("signalApiEndpointPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
The Rest API endpoint for your Signal service
|
||||
{t("signalApiEndpointDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -501,12 +502,12 @@ export const NotificationChannelDialog = ({
|
||||
name="google_chat_webhook_url"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Google Chat Webhook URL</FormLabel>
|
||||
<FormLabel>{t("googleChatWebhookUrl")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://chat.googleapis.com/v1/spaces/..." {...field} />
|
||||
<Input placeholder={t("googleChatWebhookUrlPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Google Chat webhook URL from your Google Chat space
|
||||
{t("googleChatWebhookUrlDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -521,12 +522,12 @@ export const NotificationChannelDialog = ({
|
||||
name="email_address"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Email Address</FormLabel>
|
||||
<FormLabel>{t("emailAddress")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="notifications@example.com" {...field} type="email" />
|
||||
<Input placeholder={t("emailAddressPlaceholder")} {...field} type="email" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Email address to send notifications to
|
||||
{t("emailAddressDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -537,12 +538,12 @@ export const NotificationChannelDialog = ({
|
||||
name="email_sender_name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Sender Name</FormLabel>
|
||||
<FormLabel>{t("emailSenderName")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Alert System" {...field} />
|
||||
<Input placeholder={t("emailSenderNamePlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Display name for outgoing emails
|
||||
{t("emailSenderNameDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -554,9 +555,9 @@ export const NotificationChannelDialog = ({
|
||||
name="smtp_server"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>SMTP Server</FormLabel>
|
||||
<FormLabel>{t("smtpServer")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="smtp.gmail.com" {...field} />
|
||||
<Input placeholder={t("smtpServerPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -567,9 +568,9 @@ export const NotificationChannelDialog = ({
|
||||
name="smtp_port"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>SMTP Port</FormLabel>
|
||||
<FormLabel>{t("smtpPort")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="587" {...field} />
|
||||
<Input placeholder={t("smtpPortPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -581,12 +582,12 @@ export const NotificationChannelDialog = ({
|
||||
name="smtp_password"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>SMTP Password</FormLabel>
|
||||
<FormLabel>{t("smtpPassword")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Enter your SMTP password" {...field} type="password" />
|
||||
<Input placeholder={t("smtpPasswordPlaceholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Password for authenticating with the SMTP server
|
||||
{t("smtpPasswordDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -602,12 +603,12 @@ export const NotificationChannelDialog = ({
|
||||
name="ntfy_endpoint"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>NTFY Endpoint</FormLabel>
|
||||
<FormLabel>{t("ntfyEndpoint")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://ntfy.sh/your-topic" {...field} />
|
||||
<Input placeholder={t("ntfyEndpointPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
The NTFY endpoint URL including your topic (e.g., https://ntfy.sh/checkcle)
|
||||
{t("ntfyEndpointDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -618,12 +619,12 @@ export const NotificationChannelDialog = ({
|
||||
name="api_token"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>API Token (Optional)</FormLabel>
|
||||
<FormLabel>{t("apiTokenOptional")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Enter NTFY API token" {...field} type="password" />
|
||||
<Input placeholder={t("apiTokenPlaceholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Optional API token for authentication with NTFY server
|
||||
{t("apiTokenDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -632,19 +633,19 @@ export const NotificationChannelDialog = ({
|
||||
</>
|
||||
)}
|
||||
|
||||
{notificationType === "pushover" && (
|
||||
{notificationType === "pushover" && (
|
||||
<>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="api_token"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>API Token</FormLabel>
|
||||
<FormLabel>{t("apiToken")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Your Pushover API token" {...field} type="password" />
|
||||
<Input placeholder={t("apiTokenPlaceholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Your Pushover application API token
|
||||
{t("apiTokenDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -655,12 +656,12 @@ export const NotificationChannelDialog = ({
|
||||
name="user_key"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>User Key</FormLabel>
|
||||
<FormLabel>{t("pushoverUserKey")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Your Pushover user key" {...field} />
|
||||
<Input placeholder={t("pushoverUserKeyPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Your Pushover user key (or group key)
|
||||
{t("pushoverUserKeyDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -676,12 +677,12 @@ export const NotificationChannelDialog = ({
|
||||
name="api_token"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>API Token</FormLabel>
|
||||
<FormLabel>{t("apiToken")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Your Notifiarr API token" {...field} type="password" />
|
||||
<Input placeholder={t("apiTokenPlaceholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Your Notifiarr API token for sending notifications
|
||||
{t("apiTokenDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -692,12 +693,12 @@ export const NotificationChannelDialog = ({
|
||||
name="channel_id"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Channel ID</FormLabel>
|
||||
<FormLabel>{t("notifiarrChannelId")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Discord Channel ID" {...field} />
|
||||
<Input placeholder={t("notifiarrChannelIdPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
The Discord channel ID where notifications will be sent
|
||||
{t("notifiarrChannelIdDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -713,12 +714,12 @@ export const NotificationChannelDialog = ({
|
||||
name="api_token"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>API Token</FormLabel>
|
||||
<FormLabel>{t("apiToken")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="Your Gotify API token" {...field} type="password" />
|
||||
<Input placeholder={t("apiTokenPlaceholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Your Gotify application API token
|
||||
{t("apiTokenDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -729,12 +730,12 @@ export const NotificationChannelDialog = ({
|
||||
name="server_url"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Server URL</FormLabel>
|
||||
<FormLabel>{t("gotifyServerUrl")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://your-gotify-server.com" {...field} />
|
||||
<Input placeholder={t("gotifyServerUrlPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
The URL of your Gotify server
|
||||
{t("gotifyServerUrlDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -742,7 +743,7 @@ export const NotificationChannelDialog = ({
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
{notificationType === "webhook" && (
|
||||
<>
|
||||
<FormField
|
||||
@@ -750,12 +751,12 @@ export const NotificationChannelDialog = ({
|
||||
name="webhook_url"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Webhook URL</FormLabel>
|
||||
<FormLabel>{t("webhookUrl")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://api.example.com/webhook" {...field} />
|
||||
<Input placeholder={t("webhookUrlPlaceholder")} {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
The URL where webhook notifications will be sent
|
||||
{t("webhookUrlDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -768,10 +769,9 @@ export const NotificationChannelDialog = ({
|
||||
name="webhook_payload_template"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Payload Template (Optional)</FormLabel>
|
||||
|
||||
<FormLabel>{t("payloadTemplate")}</FormLabel>
|
||||
<FormDescription>
|
||||
JSON template for the webhook payload. Leave empty to use default template.
|
||||
{t("payloadTemplateDesc")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
@@ -780,15 +780,15 @@ export const NotificationChannelDialog = ({
|
||||
|
||||
<Card>
|
||||
<CardHeader className="pb-3">
|
||||
<CardTitle className="text-sm font-medium">Payload Templates</CardTitle>
|
||||
<CardTitle className="text-sm font-medium">{t("payloadTemplates")}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
<div className="mt-4">
|
||||
<h4 className="text-sm font-medium mb-2">Available Placeholders:</h4>
|
||||
<h4 className="text-sm font-medium mb-2">{t("availablePlaceholders")}</h4>
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-2 text-xs">
|
||||
<div className="space-y-1">
|
||||
<p className="font-medium text-muted-foreground">Server:</p>
|
||||
<p className="font-medium text-muted-foreground">{t("server")}</p>
|
||||
<div className="space-y-0.5">
|
||||
<code className="bg-muted px-1 rounded">${'{server_name}'}</code><br/>
|
||||
<code className="bg-muted px-1 rounded">${'{cpu_usage}'}</code><br/>
|
||||
@@ -797,7 +797,7 @@ export const NotificationChannelDialog = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<p className="font-medium text-muted-foreground">Service:</p>
|
||||
<p className="font-medium text-muted-foreground">{t("service")}</p>
|
||||
<div className="space-y-0.5">
|
||||
<code className="bg-muted px-1 rounded">${'{service_name}'}</code><br/>
|
||||
<code className="bg-muted px-1 rounded">${'{response_time}'}</code><br/>
|
||||
@@ -806,7 +806,7 @@ export const NotificationChannelDialog = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<p className="font-medium text-muted-foreground">SSL:</p>
|
||||
<p className="font-medium text-muted-foreground">{t("ssl")}</p>
|
||||
<div className="space-y-0.5">
|
||||
<code className="bg-muted px-1 rounded">${'{domain}'}</code><br/>
|
||||
<code className="bg-muted px-1 rounded">${'{expiry_date}'}</code><br/>
|
||||
@@ -815,7 +815,7 @@ export const NotificationChannelDialog = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<p className="font-medium text-muted-foreground">Common:</p>
|
||||
<p className="font-medium text-muted-foreground">{t("common")}</p>
|
||||
<div className="space-y-0.5">
|
||||
<code className="bg-muted px-1 rounded">${'{status}'}</code><br/>
|
||||
<code className="bg-muted px-1 rounded">${'{time}'}</code><br/>
|
||||
@@ -838,9 +838,9 @@ export const NotificationChannelDialog = ({
|
||||
render={({ field }) => (
|
||||
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-3">
|
||||
<div className="space-y-0.5">
|
||||
<FormLabel>Enabled</FormLabel>
|
||||
<FormLabel>{t("enabled")}</FormLabel>
|
||||
<FormDescription>
|
||||
Enable or disable this notification channel
|
||||
{t("enabledDesc")}
|
||||
</FormDescription>
|
||||
</div>
|
||||
<FormControl>
|
||||
@@ -855,11 +855,11 @@ export const NotificationChannelDialog = ({
|
||||
|
||||
<DialogFooter>
|
||||
<Button variant="outline" type="button" onClick={handleClose}>
|
||||
Cancel
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{isSubmitting && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
||||
{isEditing ? "Update Channel" : "Create Channel"}
|
||||
{isEditing ? t("updateChannel") : t("createChannel")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
|
||||
+13
-11
@@ -9,6 +9,7 @@ import { WebhookConfiguration, webhookService } from "@/services/webhookService"
|
||||
import { NotificationChannelDialog } from "./NotificationChannelDialog";
|
||||
import { NotificationChannelList } from "./NotificationChannelList";
|
||||
import { pb } from "@/lib/pocketbase";
|
||||
import { useLanguage } from "@/contexts/LanguageContext";
|
||||
|
||||
interface CombinedChannel extends Partial<AlertConfiguration> {
|
||||
isWebhook?: boolean;
|
||||
@@ -18,6 +19,7 @@ interface CombinedChannel extends Partial<AlertConfiguration> {
|
||||
}
|
||||
|
||||
const NotificationSettings = () => {
|
||||
const { t } = useLanguage();
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [alertConfigs, setAlertConfigs] = useState<AlertConfiguration[]>([]);
|
||||
const [webhookConfigs, setWebhookConfigs] = useState<WebhookConfiguration[]>([]);
|
||||
@@ -126,13 +128,13 @@ const NotificationSettings = () => {
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<CardTitle>Notification Settings</CardTitle>
|
||||
<CardTitle>{t("titleNotification")}</CardTitle>
|
||||
<CardDescription>
|
||||
Configure notification channels for your services
|
||||
{t("descriptionChannelsServices")}
|
||||
</CardDescription>
|
||||
</div>
|
||||
<Button onClick={handleAddNew}>
|
||||
<Plus className="mr-2 h-4 w-4" /> Add Channel
|
||||
<Plus className="mr-2 h-4 w-4" /> {t("addChannel")}
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
@@ -144,14 +146,14 @@ const NotificationSettings = () => {
|
||||
className="w-full"
|
||||
>
|
||||
<TabsList className="mb-4">
|
||||
<TabsTrigger value="all">All Channels</TabsTrigger>
|
||||
<TabsTrigger value="telegram">Telegram</TabsTrigger>
|
||||
<TabsTrigger value="discord">Discord</TabsTrigger>
|
||||
<TabsTrigger value="slack">Slack</TabsTrigger>
|
||||
<TabsTrigger value="signal">Signal</TabsTrigger>
|
||||
<TabsTrigger value="google_chat">Google Chat</TabsTrigger>
|
||||
<TabsTrigger value="email">Email</TabsTrigger>
|
||||
<TabsTrigger value="webhook">Webhook</TabsTrigger>
|
||||
<TabsTrigger value="all">{t("all")}</TabsTrigger>
|
||||
<TabsTrigger value="telegram">{t("telegram")}</TabsTrigger>
|
||||
<TabsTrigger value="discord">{t("discord")}</TabsTrigger>
|
||||
<TabsTrigger value="slack">{t("slack")}</TabsTrigger>
|
||||
<TabsTrigger value="signal">{t("signal")}</TabsTrigger>
|
||||
<TabsTrigger value="google_chat">{t("googleChat")}</TabsTrigger>
|
||||
<TabsTrigger value="email">{t("email")}</TabsTrigger>
|
||||
<TabsTrigger value="webhook">{t("webhook")}</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value={currentTab} className="mt-0">
|
||||
|
||||
@@ -85,19 +85,19 @@ const ContainerMonitoring = () => {
|
||||
/>
|
||||
<main className="flex-1 flex flex-col items-center justify-center p-4 sm:p-6">
|
||||
<div className="text-center max-w-md w-full">
|
||||
<h2 className="text-xl sm:text-2xl font-bold mb-4">Error loading containers</h2>
|
||||
<h2 className="text-xl sm:text-2xl font-bold mb-4">{t('errorLoadingContainers')}</h2>
|
||||
<p className="text-muted-foreground mb-4 text-sm sm:text-base">
|
||||
Unable to fetch container data. Please check your connection and try again.
|
||||
{t('unableToFetchContainerData')}
|
||||
</p>
|
||||
<div className="text-xs text-muted-foreground mb-4 font-mono">
|
||||
Error: {error?.message || 'Unknown error'}
|
||||
{t('errorUnknown')}: {error?.message || t('errorUnknown')}
|
||||
</div>
|
||||
<div className="flex gap-2 justify-center">
|
||||
<Button onClick={handleRefresh} className="text-sm sm:text-base">
|
||||
Retry
|
||||
{t('retry')}
|
||||
</Button>
|
||||
<Button onClick={handleBackToServers} variant="outline" className="text-sm sm:text-base">
|
||||
Back to Servers
|
||||
{t('backToServers')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,17 +131,17 @@ const ContainerMonitoring = () => {
|
||||
className="flex items-center gap-2"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
Back to Servers
|
||||
{t('backToServers')}
|
||||
</Button>
|
||||
</div>
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
Container Monitoring
|
||||
{t('containerMonitoring')}
|
||||
</h1>
|
||||
<p className={`text-muted-foreground mt-1 sm:mt-2 transition-all duration-300 ${sidebarCollapsed ? 'text-base sm:text-lg' : 'text-sm sm:text-base'}`}>
|
||||
Monitor and manage your Docker containers in real-time
|
||||
{t('monitorAndManageContainers')}
|
||||
{serverId && (
|
||||
<span className="block text-xs text-muted-foreground/70 mt-1">
|
||||
Server ID: {serverId}
|
||||
{t('serverIdLabel')}: {serverId}
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
|
||||
@@ -70,15 +70,15 @@ const InstanceMonitoring = () => {
|
||||
/>
|
||||
<main className="flex-1 flex flex-col items-center justify-center p-4 sm:p-6">
|
||||
<div className="text-center max-w-md w-full">
|
||||
<h2 className="text-xl sm:text-2xl font-bold mb-4">Error loading servers</h2>
|
||||
<h2 className="text-xl sm:text-2xl font-bold mb-4">{t('errorLoadingServers')}</h2>
|
||||
<p className="text-muted-foreground mb-4 text-sm sm:text-base">
|
||||
Unable to fetch server data. Please check your connection and try again.
|
||||
{t('unableToFetchServerData')}
|
||||
</p>
|
||||
<button
|
||||
onClick={handleRefresh}
|
||||
className="px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 text-sm sm:text-base"
|
||||
>
|
||||
Retry
|
||||
{t('retry')}
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
@@ -104,15 +104,15 @@ const InstanceMonitoring = () => {
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h1 className="text-2xl lg:text-2xl font-bold text-foreground">
|
||||
Instance Monitoring
|
||||
{t('instanceMonitoring')}
|
||||
</h1>
|
||||
<p className="text-muted-foreground mt-1 text-xs sm:text-sm">
|
||||
Monitor and manage your server instances in real-time
|
||||
{t('describeMonitorInstance')}
|
||||
</p>
|
||||
</div>
|
||||
<Button onClick={() => setAddDialogOpen(true)} className="flex-shrink-0">
|
||||
<Plus className="mr-2 h-4 w-4" />
|
||||
Add Server Agent
|
||||
{t('addServerAgent')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,15 +120,15 @@ const ServerDetail = () => {
|
||||
/>
|
||||
<main className="flex-1 flex flex-col items-center justify-center p-4 sm:p-6">
|
||||
<div className="text-center max-w-md w-full">
|
||||
<h2 className="text-xl sm:text-2xl font-bold mb-4">Error loading server</h2>
|
||||
<h2 className="text-xl sm:text-2xl font-bold mb-4">{t('errorLoadingServer')}</h2>
|
||||
<p className="text-muted-foreground mb-4 text-sm sm:text-base">
|
||||
Unable to fetch server data. Please check your connection and try again.
|
||||
{t('unableToFetchServerData')}
|
||||
</p>
|
||||
<div className="text-xs text-muted-foreground mb-4 font-mono">
|
||||
Error: {serverError?.message || 'Unknown error'}
|
||||
</div>
|
||||
<Button onClick={handleBackToServers} variant="outline" className="text-sm sm:text-base">
|
||||
Back to Servers
|
||||
{t('backToServers')}
|
||||
</Button>
|
||||
</div>
|
||||
</main>
|
||||
@@ -151,7 +151,7 @@ const ServerDetail = () => {
|
||||
<main className="flex-1 flex flex-col items-center justify-center p-4 sm:p-6">
|
||||
<div className="text-center">
|
||||
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"></div>
|
||||
<p className="text-muted-foreground">Loading server details...</p>
|
||||
<p className="text-muted-foreground">{t('loadingServerDetails')}</p>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
@@ -183,7 +183,7 @@ const ServerDetail = () => {
|
||||
className="flex items-center gap-2"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
Back to Servers
|
||||
{t('backToServers')}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 mb-2">
|
||||
@@ -199,14 +199,17 @@ const ServerDetail = () => {
|
||||
)}
|
||||
</div>
|
||||
<h1 className="text-2xl font-bold text-foreground">
|
||||
{server?.name || 'Server Detail'}
|
||||
{server?.name || t('serverDetail')}
|
||||
</h1>
|
||||
</div>
|
||||
<p className="text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base">
|
||||
Monitor server performance metrics and system health
|
||||
{t('monitorServerMetrics')}
|
||||
{server && (
|
||||
<span className="block text-xs text-muted-foreground/70 mt-1">
|
||||
{server.hostname} • {server.ip_address} • {server.os_type}
|
||||
{t('serverHostnameIpOs')
|
||||
.replace('{hostname}', server.hostname)
|
||||
.replace('{ip_address}', server.ip_address)
|
||||
.replace('{os_type}', server.os_type)}
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
|
||||
@@ -6,6 +6,8 @@ export interface ServerThreshold {
|
||||
name: string;
|
||||
cpu_threshold: number;
|
||||
ram_threshold: number;
|
||||
// Some API responses may use a different field name; include it as optional
|
||||
ram_threshold_message?: number;
|
||||
disk_threshold: number;
|
||||
network_threshold: number;
|
||||
created: string;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import { DockerTranslations } from '../types/docker';
|
||||
|
||||
export const dockerTranslations: DockerTranslations = {
|
||||
dockerContainers: "Docker Containers",
|
||||
container: "Container",
|
||||
status: "Status",
|
||||
cpuUsage: "CPU Usage",
|
||||
memory: "Memory",
|
||||
disk: "Disk",
|
||||
uptime: "Uptime",
|
||||
lastChecked: "Last Checked",
|
||||
actions: "Actions",
|
||||
searchContainersPlaceholder: "Search containers...",
|
||||
refresh: "Refresh",
|
||||
openMenu: "Open menu",
|
||||
viewMetrics: "View Metrics",
|
||||
viewDetails: "View Details",
|
||||
|
||||
running: "Running",
|
||||
stopped: "Stopped",
|
||||
warning: "Warning",
|
||||
unknown: "Unknown",
|
||||
totalContainers: "Total Containers",
|
||||
containersLabel: "Containers",
|
||||
|
||||
noContainersFound: "No containers found",
|
||||
noContainersRunning: "No containers running",
|
||||
tryAdjustSearch: "Try adjusting your search terms.",
|
||||
startSomeContainers: "Start some containers to see them here.",
|
||||
|
||||
containerMetricsTitle: "Container Metrics: {name}",
|
||||
dockerId: "Docker ID",
|
||||
loadingMetrics: "Loading metrics...",
|
||||
errorLoadingMetrics: "Error loading metrics",
|
||||
noMetricsAvailable: "No metrics data available for this container",
|
||||
|
||||
minutes60: "60 minutes",
|
||||
day1: "1 day",
|
||||
days7: "7 days",
|
||||
month1: "1 month",
|
||||
months3: "3 months",
|
||||
|
||||
used: "Used:",
|
||||
free: "Free:",
|
||||
total: "Total:",
|
||||
usage: "Usage:",
|
||||
cpu: "CPU",
|
||||
memoryTitle: "Memory",
|
||||
diskTitle: "Disk",
|
||||
network: "Network",
|
||||
|
||||
cpuUsagePct: "CPU Usage (%)",
|
||||
cpuUsageVsAvailable: "CPU Usage vs Available",
|
||||
cpuAvailablePct: "CPU Available (%)",
|
||||
ramUsagePct: "RAM Usage (%)",
|
||||
memoryUsageBytes: "Memory Usage (Bytes)",
|
||||
usedMemory: "Used Memory",
|
||||
totalMemory: "Total Memory",
|
||||
diskUsagePct: "Disk Usage (%)",
|
||||
diskUsageBytes: "Disk Usage (Bytes)",
|
||||
usedDisk: "Used Disk",
|
||||
totalDisk: "Total Disk",
|
||||
networkTraffic: "Network Traffic",
|
||||
networkSpeedKbs: "Network Speed (KB/s)",
|
||||
rxBytes: "RX Bytes",
|
||||
txBytes: "TX Bytes",
|
||||
rxSpeedKbs: "RX Speed (KB/s)",
|
||||
txSpeedKbs: "TX Speed (KB/s)",
|
||||
};
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@ import { maintenanceTranslations } from './maintenance';
|
||||
import { incidentTranslations } from './incident';
|
||||
import { sslTranslations } from './ssl';
|
||||
import { settingsTranslations } from './settings';
|
||||
import { instanceTranslations } from './instance';
|
||||
import { operationTranslations } from './operation';
|
||||
import { regionTranslations } from './region';
|
||||
import { dockerTranslations } from './docker';
|
||||
import { publicTranslations } from './public';
|
||||
|
||||
const enTranslations: Translations = {
|
||||
common: commonTranslations,
|
||||
@@ -19,7 +24,12 @@ const enTranslations: Translations = {
|
||||
maintenance: maintenanceTranslations,
|
||||
incident: incidentTranslations,
|
||||
ssl: sslTranslations,
|
||||
settings: settingsTranslations
|
||||
settings: settingsTranslations,
|
||||
instance: instanceTranslations,
|
||||
operation: operationTranslations,
|
||||
region: regionTranslations,
|
||||
docker: dockerTranslations,
|
||||
public: publicTranslations
|
||||
};
|
||||
|
||||
export default enTranslations;
|
||||
@@ -0,0 +1,169 @@
|
||||
|
||||
import { InstanceTranslations } from '../types/instance';
|
||||
|
||||
export const instanceTranslations: InstanceTranslations = {
|
||||
|
||||
// InstanceMonitoring.tsx
|
||||
instanceMonitoring: "Instance Monitoring",
|
||||
describeMonitorInstance: "Monitor and manage your server instances in real-time",
|
||||
addServerAgent: "Add Server Agent",
|
||||
errorLoadingServers: "Error loading servers",
|
||||
unableToFetchServerData: "Unable to fetch server data. Please check your connection and try again.",
|
||||
retry: "Retry",
|
||||
|
||||
|
||||
|
||||
// ServerTable.tsx
|
||||
servers: "Servers",
|
||||
loadingServers: "Loading servers...",
|
||||
searchServersPlaceholder: "Search servers...",
|
||||
noServersFound: "No servers found",
|
||||
name: "Name",
|
||||
status: "Status",
|
||||
OS: "OS",
|
||||
IPAddress: "IP Address",
|
||||
CPU: "CPU",
|
||||
memory: "Memory",
|
||||
disk: "Disk",
|
||||
uptime: "Uptime",
|
||||
lastChecked: "Last Checked",
|
||||
actions: "Actions",
|
||||
viewServerDetail: "View Server Detail",
|
||||
containerMonitoring: "Container Monitoring",
|
||||
resumeMonitoring: "Resume Monitoring",
|
||||
pauseMonitoring: "Pause Monitoring",
|
||||
editServer: "Edit Server",
|
||||
deleteServer: "Delete Server",
|
||||
deleteServerConfirmTitle: "Are you sure you want to delete this server?",
|
||||
deleteServerConfirmDesc: "This action cannot be undone. This will permanently delete {name} and all of its monitoring data.",
|
||||
cancel: "Cancel",
|
||||
deleting: "Deleting...",
|
||||
delete: "Delete",
|
||||
serverDeleted: "Server deleted",
|
||||
serverDeletedDesc: "{name} has been deleted successfully.",
|
||||
error: "Error",
|
||||
deleteServerError: "Failed to delete server. Please try again.",
|
||||
serverPaused: "Server paused",
|
||||
serverResumed: "Server resumed",
|
||||
monitoringPaused: "Monitoring paused for {name}",
|
||||
monitoringResumed: "Monitoring resumed for {name}",
|
||||
pauseServerError: "Failed to pause server monitoring. Please try again.",
|
||||
resumeServerError: "Failed to resume server monitoring. Please try again.",
|
||||
|
||||
// server cards
|
||||
totalServers: "TOTAL SERVERS",
|
||||
onlineServers: "ONLINE SERVERS",
|
||||
offlineServers: "OFFLINE SERVERS",
|
||||
warningServers: "WARNING SERVERS",
|
||||
|
||||
// AddServerAgentDialog.tsx
|
||||
addServerMonitoringAgent: "Add Server Monitoring Agent",
|
||||
configureAgentDesc: "Configure a new server monitoring agent to track system metrics and performance.",
|
||||
configureAgent: "Configure Agent",
|
||||
oneClickInstall: "One-Click Install",
|
||||
dockerOneClick: "Docker One-Click",
|
||||
manualInstallation: "Manual Installation",
|
||||
validationError: "Validation Error",
|
||||
fillRequiredFields: "Please fill in all required fields.",
|
||||
serverAgentCreated: "Server Agent Created",
|
||||
serverAgentCreatedDesc: "{name} monitoring agent has been configured successfully.",
|
||||
failedToCreateAgent: "Failed to create server monitoring agent.",
|
||||
|
||||
// ServerAgentConfigForm.tsx
|
||||
serverName: "Server Name",
|
||||
serverNamePlaceholder: "e.g., web-server-01",
|
||||
serverNameDesc: "What is the name or label used as the identifier",
|
||||
serverAgentId: "Server Agent ID",
|
||||
serverAgentIdDesc: "Auto-generated unique identifier",
|
||||
operatingSystem: "Operating System",
|
||||
checkInterval: "Check Interval",
|
||||
selectInterval: "Select interval",
|
||||
interval30s: "30 seconds",
|
||||
interval1m: "1 minute",
|
||||
interval2m: "2 minutes",
|
||||
interval5m: "5 minutes",
|
||||
checkIntervalDesc: "How often to check the server and metric status",
|
||||
retryAttempts: "Retry Attempts",
|
||||
selectRetryAttempts: "Select retry attempts",
|
||||
attempt1: "1 attempt",
|
||||
attempt2: "2 attempts",
|
||||
attempt3: "3 attempts",
|
||||
attempt5: "5 attempts",
|
||||
retryAttemptsDesc: "Number of retry attempts before marking as down",
|
||||
serverToken: "Server Token",
|
||||
serverTokenDesc: "Auto-generated authentication token",
|
||||
systemUrl: "System URL",
|
||||
systemUrlDesc: "Current system API URL",
|
||||
creatingAgent: "Creating Agent...",
|
||||
createServerAgent: "Create Server Agent"
|
||||
|
||||
|
||||
,
|
||||
|
||||
// EditServerDialog.tsx
|
||||
editServerConfiguration: "Edit Server Configuration",
|
||||
serverNameLabel: "Server Name *",
|
||||
enterServerNamePlaceholder: "Enter server name",
|
||||
checkIntervalLabel: "Check Interval",
|
||||
interval10m: "10 minutes",
|
||||
maxRetriesLabel: "Max Retries",
|
||||
selectMaxRetries: "Select max retries",
|
||||
retry1: "1 retry",
|
||||
retry2: "2 retries",
|
||||
retry3: "3 retries",
|
||||
retry5: "5 retries",
|
||||
retry10: "10 retries",
|
||||
dockerMonitoring: "Docker Monitoring",
|
||||
enabled: "Enabled",
|
||||
disabled: "Disabled",
|
||||
enableNotifications: "Enable Notifications",
|
||||
notificationSettings: "Notification Settings",
|
||||
notificationChannels: "Notification Channels",
|
||||
loadingChannels: "Loading channels...",
|
||||
noChannelsAvailable: "No notification channels available",
|
||||
selectedChannels: "Selected Channels:",
|
||||
serverSetThreshold: "Server Set Threshold",
|
||||
loadingThresholds: "Loading thresholds...",
|
||||
selectServerThreshold: "Select server threshold",
|
||||
noThreshold: "No threshold (use default)",
|
||||
thresholdDetails: "Threshold Details",
|
||||
cpuThresholdPct: "CPU Threshold (%)",
|
||||
ramThresholdPct: "RAM Threshold (%)",
|
||||
diskThresholdPct: "Disk Threshold (%)",
|
||||
networkThresholdPct: "Network Threshold (%)",
|
||||
serverTemplate: "Server Template",
|
||||
loadingTemplates: "Loading templates...",
|
||||
selectServerTemplate: "Select server template",
|
||||
noTemplate: "No template (use default)",
|
||||
templateDetails: "Template Details",
|
||||
ramMessage: "RAM Message",
|
||||
cpuMessage: "CPU Message",
|
||||
diskMessage: "Disk Message",
|
||||
networkMessage: "Network Message",
|
||||
upMessage: "Up Message",
|
||||
downMessage: "Down Message",
|
||||
noMessageDefined: "No {name} message defined",
|
||||
serverUpdated: "Server updated",
|
||||
serverUpdatedDesc: "{name} has been updated successfully.",
|
||||
updating: "Updating...",
|
||||
updateServer: "Update Server",
|
||||
failedToLoadChannels: "Failed to load notification channels",
|
||||
failedToLoadTemplates: "Failed to load templates",
|
||||
failedToLoadThresholds: "Failed to load server thresholds",
|
||||
warning: "Warning",
|
||||
serverUpdatedButThresholdFailed: "Server updated but failed to update threshold values.",
|
||||
failedToUpdateServer: "Failed to update server. Please try again.",
|
||||
|
||||
// ServerHistoryCharts.tsx
|
||||
historicalPerformance: "Historical Performance",
|
||||
loading: "Loading...",
|
||||
errorLoadingChartData: "Error loading chart data",
|
||||
noHistoricalData: "No historical data available for {{timeRange}}",
|
||||
rawMetricsCount: "Raw metrics count: {{count}}",
|
||||
serverIdTimeRange: "Server ID: {{serverId}} • Time Range: {{timeRange}}",
|
||||
dataExistsOutsideRange: "Data exists but may be outside selected time range",
|
||||
noMetricsDataFound: "No metrics data found",
|
||||
dataPointsTimeRange: "{{count}} data points • {{timeRange}}",
|
||||
// updating: "Updating...",
|
||||
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
import { OperationTranslations } from '../types/operation';
|
||||
|
||||
export const operationTranslations: OperationTranslations = {
|
||||
|
||||
// OperationalPageContent.tsx
|
||||
failedToLoadOperationalPages: "Failed to load operational pages",
|
||||
loadingoperationalPages: "There was an error loading your operational pages. Please try again.",
|
||||
tryagain: "Try Again",
|
||||
operationalPages: "Operational Pages",
|
||||
describeOperation: "Manage your public status pages and monitor service health",
|
||||
refresh: "Refresh",
|
||||
noOperationalPagesFound: "No operational pages found",
|
||||
createYourFirstOperationalPage: "Create your first operational page to start monitoring your services and communicate status to your users.",
|
||||
totalPages: "Total Pages",
|
||||
publicPages: "Public Pages",
|
||||
operational: "Operational",
|
||||
deleteOperationalPage: "Delete Operational Page",
|
||||
deleteOperationalPageConfirm: 'Are you sure you want to delete "{title}"? This action cannot be undone and will permanently remove the operational page and all its components.',
|
||||
cancel: "Cancel",
|
||||
delete: "Delete",
|
||||
deleting: "Deleting...",
|
||||
|
||||
// EditOperationalPageDialog.tsx
|
||||
editOperationalPage: "Edit Operational Page",
|
||||
updateYourOperationalPage: "Update your operational status page settings and manage components.",
|
||||
title: "Title",
|
||||
myServiceStatusPlaceholder: "My Service Status",
|
||||
slug: "Slug",
|
||||
myServiceStatusSlugPlaceholder: "my-service-status",
|
||||
description: "Description",
|
||||
operationalPageDescriptionPlaceholder: "A brief description of your operational page",
|
||||
theme: "Theme",
|
||||
selectTheme: "Select theme",
|
||||
themeDefault: "Default",
|
||||
themeDark: "Dark",
|
||||
themeLight: "Light",
|
||||
status: "Status",
|
||||
selectStatus: "Select status",
|
||||
statusOperational: "Operational",
|
||||
statusDegraded: "Degraded Performance",
|
||||
statusMaintenance: "Under Maintenance",
|
||||
statusMajorOutage: "Major Outage",
|
||||
publicPage: "Public Page",
|
||||
makePagePublic: "Make this page publicly accessible",
|
||||
customDomainOptional: "Custom Domain (Optional)",
|
||||
customDomainPlaceholder: "status.yourdomain.com",
|
||||
customDomainDescription: "Custom domain for your status page",
|
||||
cancelUpdate: "Cancel",
|
||||
updating: "Updating...",
|
||||
updatePage: "Update Page",
|
||||
|
||||
// ComponentsSelector.tsx
|
||||
statusPageComponents: "Status Page Components",
|
||||
addMonitoringComponentsDesc: "Add monitoring components like uptime services, SSL certificates, and incident tracking",
|
||||
selectedComponents: "Selected Components",
|
||||
service: "Service",
|
||||
server: "Server",
|
||||
addComponent: "Add Component",
|
||||
componentName: "Component Name",
|
||||
componentNamePlaceholder: "e.g., Main Website",
|
||||
displayOrder: "Display Order",
|
||||
descriptionOptional: "Description (Optional)",
|
||||
descriptionPlaceholder: "Brief description of this component",
|
||||
uptimeServiceOptional: "Uptime Service (Optional)",
|
||||
selectUptimeService: "Select an uptime service",
|
||||
serverIdOptional: "Server ID (Optional)",
|
||||
serverIdPlaceholder: "server_456",
|
||||
cancelComponent: "Cancel",
|
||||
|
||||
// OperationalPageCard.tsx
|
||||
public: "Public",
|
||||
yes: "Yes",
|
||||
no: "No",
|
||||
updated: "Updated",
|
||||
view: "View",
|
||||
edit: "Edit",
|
||||
|
||||
// CreateOperationalPageDialog.tsx
|
||||
createOperationalPage: "Create Operational Page",
|
||||
createOperationalPageDesc: "Create a new operational status page to monitor your services and components.",
|
||||
createPage: "Create Page",
|
||||
creating: "Creating...",
|
||||
initialStatus: "Initial Status",
|
||||
|
||||
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
import { PublicTranslations } from '../types/public';
|
||||
|
||||
export const publicTranslations: PublicTranslations = {
|
||||
systemStatus: "System Status",
|
||||
allOperational: "All systems are operational",
|
||||
degradedPerformance: "Some systems are experiencing degraded performance",
|
||||
underMaintenance: "Systems are currently under maintenance",
|
||||
majorOutage: "We are experiencing a major service outage",
|
||||
statusUnknown: "Status unknown",
|
||||
autoUpdatedByHealth: "Status automatically updated based on component health",
|
||||
lastUpdatedAt: "Last updated: {time} UTC",
|
||||
liveStatusMonitoring: "Live status monitoring",
|
||||
|
||||
loadingStatusPage: "Loading Status Page",
|
||||
fetchingRealtimeStatus: "Fetching real-time system status...",
|
||||
slugLabel: "Slug",
|
||||
statusPageNotFound: "Status Page Not Found",
|
||||
notFoundDescription: "The requested status page could not be found or is not publicly accessible.",
|
||||
goBack: "Go Back",
|
||||
retry: "Retry",
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
|
||||
import { RegionTranslations } from '../types/region';
|
||||
|
||||
export const regionTranslations: RegionTranslations = {
|
||||
|
||||
//RegionalMonitoringContent.tsx
|
||||
regionalmonitoring: "Regional Monitoring",
|
||||
descriptRegionPage: "Monitor your infrastructure from multiple regions for better reliability.",
|
||||
addRegionalAgent: "Add Regional Agent",
|
||||
totalAgents: "Total Agents",
|
||||
regionalMonitoringAgents: "Regional monitoring agents",
|
||||
onlineAgents: "Online Agents",
|
||||
currentlyConnected: "Currently connected",
|
||||
offlineAgents: "Offline Agents",
|
||||
disconnectedAgents: "Disconnected agents",
|
||||
regionalAgents: "Regional Agents",
|
||||
noRegionalAgents: "No Regional Agents",
|
||||
getStartedAddAgent: "Get started by adding your first regional monitoring agent to extend your monitoring coverage.",
|
||||
addFirstAgent: "Add First Agent",
|
||||
agentRemoved: "Agent Removed",
|
||||
agentRemovedDesc: "The regional monitoring agent has been removed.",
|
||||
regionalAgentAdded: "Regional Agent Added",
|
||||
regionalAgentAddedDesc: "The regional monitoring agent has been successfully configured.",
|
||||
error: "Error",
|
||||
failedToRemoveAgent: "Failed to remove the regional monitoring agent.",
|
||||
|
||||
//AddRegionalAgentDialog.tsx
|
||||
addRegionalMonitoringAgent: "Add Regional Monitoring Agent",
|
||||
deployRegionalMonitoringAgent: "Deploy a regional monitoring agent with automatic one-click installation.",
|
||||
regionName: "Region Name",
|
||||
regionNamePlaceholder: "e.g., us-east-1, europe-west-1, asia-pacific-1",
|
||||
agentServerIpAddress: "Agent Server IP Address",
|
||||
agentIpPlaceholder: "e.g., 192.168.1.100 or your-server.example.com",
|
||||
cancel: "Cancel",
|
||||
generateInstallation: "Generate Installation",
|
||||
generating: "Generating...",
|
||||
agentConfigurationReady: "Agent Configuration Ready!",
|
||||
oneClickInstallScriptGenerated: "One-click installation script generated with automatic configuration.",
|
||||
oneClickInstallTab: "One-Click Install",
|
||||
agentDetailsTab: "Agent Details",
|
||||
manualInstallTab: "Manual Install",
|
||||
oneClickAutomaticInstallation: "One-Click Automatic Installation",
|
||||
completeInstallationDescription: "Complete installation, configuration, and service startup in one command",
|
||||
whatThisScriptDoes: "What this script does automatically:",
|
||||
scriptActionDownload: "Downloads the latest .deb package",
|
||||
scriptActionInstall: "Installs the regional monitoring agent",
|
||||
scriptActionConfigure: "Creates configuration file with your settings",
|
||||
scriptActionStart: "Starts and enables the service",
|
||||
scriptActionHealthChecks: "Runs health checks",
|
||||
runCommandOnServer: "Run this command on your target server:",
|
||||
downloadCompleteScript: "Download Complete Script",
|
||||
copyFullScript: "Copy Full Script",
|
||||
localDevelopmentNotice: "<strong>Local Development Notice:</strong> If clipboard copying fails, this is normal in local development. You can use the 'Download Complete Script' button instead or manually copy the text.",
|
||||
generatedAgentConfiguration: "Generated Agent Configuration",
|
||||
autoConfiguredDuringInstallation: "These values will be automatically configured during installation",
|
||||
agentId: "Agent ID",
|
||||
regionNameDetail: "Region Name",
|
||||
serverIp: "Server IP",
|
||||
apiEndpoint: "API Endpoint",
|
||||
authenticationToken: "Authentication Token",
|
||||
configurationFileLocation: "<strong>Configuration file location:</strong> /etc/regional-check-agent/regional-check-agent.env",
|
||||
manualInstallationSteps: "Manual Installation Steps",
|
||||
stepByStepManualInstallation: "Step-by-step manual installation process",
|
||||
step1DownloadPackage: "Step 1: Download Package",
|
||||
downloadAmd64Notice: "✅ If you’re using the amd64 architecture, please download this package.",
|
||||
downloadArm64Notice: "✅ If you’re using the arm64 architecture, please download this package.",
|
||||
step2InstallPackage: "Step 2: Install Package",
|
||||
step3ConfigureAgent: "Step 3: Configure Agent",
|
||||
copySampleConfiguration: "Copy sample configuration from https://github.com/operacle/Distributed-Regional-Monitoring/blob/main/packaging/regional-check-agent.conf",
|
||||
addConfigurationValues: "Add the configuration values shown in the Agent Details tab",
|
||||
step4StartService: "Step 4: Start Service",
|
||||
step5VerifyInstallation: "Step 5: Verify Installation",
|
||||
addAnotherAgent: "Add Another Agent",
|
||||
completeSetup: "Complete Setup",
|
||||
copied: "Copied!",
|
||||
copiedDescription: "{description} copied to clipboard.",
|
||||
copyFailed: "Copy failed",
|
||||
copyFailedDescription: "Failed to copy to clipboard.",
|
||||
copyFailedLocalhost: "This is common in local development. Please manually copy the text.",
|
||||
copyFailedChrome: "Try using HTTPS or enable clipboard permissions.",
|
||||
downloaded: "Downloaded!",
|
||||
downloadedDescription: "Installation script downloaded successfully.",
|
||||
failedToCreateAgent: "Failed to create regional agent configuration.",
|
||||
|
||||
//RegionalAgentCard.tsx
|
||||
defaultBadge: "Default",
|
||||
copyAgentId: "Copy Agent ID",
|
||||
removeAgent: "Remove Agent",
|
||||
online: "Online",
|
||||
offline: "Offline",
|
||||
lastUpdated: "Last Updated:",
|
||||
activeMonitoring: "Active monitoring",
|
||||
connectionLost: "Connection lost",
|
||||
};
|
||||
@@ -136,4 +136,65 @@ export const servicesTranslations: ServicesTranslations = {
|
||||
processing: "Processing",
|
||||
back: "Back",
|
||||
last20Checks: "Last 20 checks",
|
||||
|
||||
//OneClickInstallTab.tsx
|
||||
oneClickInstallTitle: "One-Click Install (Recommended)",
|
||||
oneClickInstallDesc: "Copy and paste this single command to install the monitoring agent instantly",
|
||||
quickInstallCommand: "Quick Install Command",
|
||||
copy: "Copy",
|
||||
runCommandOnServer: "Simply run this command on your server:",
|
||||
sshIntoServer: "SSH into your target server",
|
||||
pasteAndRun: "Paste and run the command above",
|
||||
agentInstalled: "The agent will be installed and started automatically",
|
||||
done: "Done",
|
||||
|
||||
// DockerOneClickTab.tsx
|
||||
dockerOneClickTitle: "Docker One-Click Install",
|
||||
dockerOneClickDesc: "Automated Docker container installation with system monitoring capabilities",
|
||||
dockerOneClickCommand: "Docker One-Click Command",
|
||||
dockerScriptWill: "This script will automatically:",
|
||||
dockerScriptStep1: "Download and setup the Docker monitoring agent",
|
||||
dockerScriptStep2: "Configure all required environment variables",
|
||||
dockerScriptStep3: "Start the container with proper system access",
|
||||
dockerScriptStep4: "Setup monitoring data persistence",
|
||||
directDockerTitle: "Direct Docker Run Command",
|
||||
directDockerDesc: "If you prefer to run the Docker container directly without the script",
|
||||
dockerRunCommand: "Docker Run Command",
|
||||
dockerPrerequisites: "Prerequisites for direct Docker run:",
|
||||
dockerPrereqStep1: "Docker must be installed and running",
|
||||
dockerPrereqStep2: "The operacle/checkcle-server-agent image must be available",
|
||||
dockerPrereqStep3: "Run as root or with sudo privileges",
|
||||
|
||||
// ManualInstallTab.tsx
|
||||
manualInstallTitle: "Manual Installation Steps",
|
||||
manualInstallDesc: "Step-by-step installation process",
|
||||
serverName: "Server Name",
|
||||
agentId: "Agent ID",
|
||||
osType: "OS Type",
|
||||
downloadScript: "Download the installation script",
|
||||
makeExecutable: "Make the script executable",
|
||||
runInstall: "Run the installation with your configuration",
|
||||
prerequisites: "Prerequisites:",
|
||||
prereqRoot: "Ensure you have root/sudo access on the target server",
|
||||
prereqCurl: "Make sure curl is installed for downloading files",
|
||||
prereqInternet: "Internet connection required for downloading script",
|
||||
afterInstall: "After Installation:",
|
||||
agentWillStart: "The agent will start automatically and appear in your dashboard within a few minutes.",
|
||||
|
||||
// ServerDetail.tsx
|
||||
errorLoadingServer: "Error loading server",
|
||||
unableToFetchServerData: "Unable to fetch server data. Please check your connection and try again.",
|
||||
backToServers: "Back to Servers",
|
||||
loadingServerDetails: "Loading server details...",
|
||||
serverDetail: "Server Detail",
|
||||
monitorServerMetrics: "Monitor server performance metrics and system health",
|
||||
serverHostnameIpOs: "{hostname} • {ip_address} • {os_type}",
|
||||
|
||||
// ContainerMonitoring.tsx
|
||||
errorLoadingContainers: "Error loading containers",
|
||||
unableToFetchContainerData: "Unable to fetch container data. Please check your connection and try again.",
|
||||
errorUnknown: "Unknown error",
|
||||
containerMonitoring: "Container Monitoring",
|
||||
monitorAndManageContainers: "Monitor and manage your Docker containers in real-time",
|
||||
serverIdLabel: "Server ID",
|
||||
};
|
||||
@@ -60,4 +60,108 @@ export const settingsTranslations: SettingsTranslations = {
|
||||
permissionNoticeAddUser: "As an admin user, you do not have access to view or modify system and mail settings. These settings can only be accessed and modified by Super Admins. Contact your Super Admin if you need to make changes to system configuration or mail settings.",
|
||||
loadingSettings: "Loading settings...",
|
||||
loadingSettingsError: "Error loading settings",
|
||||
|
||||
//NotificationSettings.ts
|
||||
titleNotification: "Notification Settings",
|
||||
descriptionChannelsServices: "Configure notification channels for your services",
|
||||
addChannel: "Add Channel",
|
||||
all: "All Channels",
|
||||
telegram: "Telegram",
|
||||
discord: "Discord",
|
||||
slack: "Slack",
|
||||
signal: "Signal",
|
||||
googleChat: "Google Chat",
|
||||
email: "Email",
|
||||
webhook: "Webhook",
|
||||
|
||||
// NotificationChannelDialog.tsx
|
||||
editChannel: "Edit Notification Channel",
|
||||
addChannelDialog: "Add Notification Channel",
|
||||
channelName: "Channel Name",
|
||||
channelNameDesc: "A name to identify this notification channel",
|
||||
channelType: "Channel Type",
|
||||
selectType: "Select notification type",
|
||||
enabled: "Enabled",
|
||||
enabledDesc: "Enable or disable this notification channel",
|
||||
cancel: "Cancel",
|
||||
updateChannel: "Update Channel",
|
||||
createChannel: "Create Channel",
|
||||
payloadTemplates: "Payload Templates",
|
||||
availablePlaceholders: "Available Placeholders:",
|
||||
server: "Server",
|
||||
service: "Service",
|
||||
ssl: "SSL",
|
||||
common: "Common",
|
||||
webhookUrl: "Webhook URL",
|
||||
webhookUrlDesc: "The URL where webhook notifications will be sent",
|
||||
payloadTemplate: "Payload Template (Optional)",
|
||||
payloadTemplateDesc: "JSON template for the webhook payload. Leave empty to use default template.",
|
||||
telegramChatId: "Chat ID",
|
||||
telegramChatIdDesc: "The Telegram chat ID to send notifications to",
|
||||
botToken: "Bot Token",
|
||||
botTokenDesc: "Your Telegram bot token from @BotFather",
|
||||
discordWebhookUrl: "Webhook URL",
|
||||
discordWebhookUrlDesc: "Discord webhook URL from your server settings",
|
||||
slackWebhookUrl: "Webhook URL",
|
||||
slackWebhookUrlDesc: "Slack incoming webhook URL",
|
||||
signalNumber: "Signal Number",
|
||||
signalNumberDesc: "Signal phone number to send notifications to",
|
||||
signalApiEndpoint: "Signal API Endpoint",
|
||||
signalApiEndpointDesc: "The Rest API endpoint for your Signal service",
|
||||
googleChatWebhookUrl: "Google Chat Webhook URL",
|
||||
googleChatWebhookUrlDesc: "Google Chat webhook URL from your Google Chat space",
|
||||
emailAddress: "Email Address",
|
||||
emailAddressDesc: "Email address to send notifications to",
|
||||
emailSenderName: "Sender Name",
|
||||
emailSenderNameDesc: "Display name for outgoing emails",
|
||||
smtpServer: "SMTP Server",
|
||||
// smtpPort: "SMTP Port",
|
||||
// smtpPassword: "SMTP Password",
|
||||
smtpPasswordDesc: "Password for authenticating with the SMTP server",
|
||||
ntfyEndpoint: "NTFY Endpoint",
|
||||
ntfyEndpointDesc: "The NTFY endpoint URL including your topic (e.g., https://ntfy.sh/checkcle)",
|
||||
apiToken: "API Token",
|
||||
apiTokenOptional: "API Token (Optional)",
|
||||
apiTokenDesc: "Optional API token for authentication with NTFY server",
|
||||
pushoverUserKey: "User Key",
|
||||
pushoverUserKeyDesc: "Your Pushover user key (or group key)",
|
||||
notifiarrChannelId: "Channel ID",
|
||||
notifiarrChannelIdDesc: "The Discord channel ID where notifications will be sent",
|
||||
gotifyServerUrl: "Server URL",
|
||||
gotifyServerUrlDesc: "The URL of your Gotify server",
|
||||
errorSaveChannel: "Failed to save notification channel",
|
||||
|
||||
channelNamePlaceholder: "My Notification Channel",
|
||||
telegramChatIdPlaceholder: "Telegram Chat ID",
|
||||
botTokenPlaceholder: "Telegram Bot Token",
|
||||
discordWebhookUrlPlaceholder: "https://discord.com/api/webhooks/...",
|
||||
slackWebhookUrlPlaceholder: "https://hooks.slack.com/services/...",
|
||||
signalNumberPlaceholder: "+1234567890",
|
||||
signalApiEndpointPlaceholder: "https://your-signal-api.com/v2/send",
|
||||
googleChatWebhookUrlPlaceholder: "https://chat.googleapis.com/v1/spaces/...",
|
||||
emailAddressPlaceholder: "notifications@example.com",
|
||||
emailSenderNamePlaceholder: "Alert System",
|
||||
smtpServerPlaceholder: "smtp.gmail.com",
|
||||
smtpPortPlaceholder: "587",
|
||||
smtpPasswordPlaceholder: "Enter your SMTP password",
|
||||
ntfyEndpointPlaceholder: "https://ntfy.sh/your-topic",
|
||||
apiTokenPlaceholder: "Enter API token",
|
||||
pushoverUserKeyPlaceholder: "Your Pushover user key",
|
||||
notifiarrChannelIdPlaceholder: "Discord Channel ID",
|
||||
gotifyServerUrlPlaceholder: "https://your-gotify-server.com",
|
||||
webhookUrlPlaceholder: "https://api.example.com/webhook",
|
||||
|
||||
// DataRetentionSettings.tsx
|
||||
// permissionNotice: "Permission Notice:",
|
||||
permissionNoticeDataRetention: "As an admin user, you do not have access to data retention settings. These settings can only be accessed and modified by Super Admins.",
|
||||
loadingRetentionSettings: "Loading retention settings...",
|
||||
dataRetention: "Data Retention Settings",
|
||||
dataRetentionDescription: "Configure how long monitoring data is kept in the system",
|
||||
uptimeRetentionLabel: "Uptime Monitoring Retention (days)",
|
||||
uptimeRetentionHelp: "Service uptime and incident data older than this will be automatically deleted",
|
||||
serverRetentionLabel: "Server Monitoring Retention (days)",
|
||||
serverRetentionHelp: "Server metrics and process data older than this will be automatically deleted",
|
||||
lastCleanup: "Last automatic cleanup",
|
||||
// save: "Save Changes"
|
||||
|
||||
};
|
||||
@@ -16,4 +16,19 @@ export const aboutTranslations: AboutTranslations = {
|
||||
quickActionsDescription: "ចូលប្រើប្រតិបត្តិការត្រួតពិនិត្យ និងមុខងារទូទៅយ៉ាងរហ័ស។ ជ្រើសរើសសកម្មភាពខាងក្រោមដើម្បីចាប់ផ្តើម។",
|
||||
quickTips: "គន្លឹះរហ័ស",
|
||||
releasedOn: "បានចេញផ្សាយនៅថ្ងៃទី",
|
||||
updateSchema: "ធ្វើបច្ចុប្បន្នភាព Schema",
|
||||
updateSchemaDesc: "បញ្ចូល Schema នៃការប្រមូលដោយស្វ័យប្រវត្តិ",
|
||||
mergeFieldsLabel: "បញ្ចូល fields ជាមួយនឹងការប្រមូលដែលមានស្រាប់ (សុវត្ថិភាព - រក្សាទិន្នន័យ)",
|
||||
importing: "កំពុងបញ្ចូល...",
|
||||
clickToUpdateSchema: "ចុចដើម្បីធ្វើបច្ចុប្បន្នភាព Schema",
|
||||
importSuccessful: "បញ្ចូលជោគជ័យ",
|
||||
importFailed: "បញ្ចូលបរាជ័យ",
|
||||
instructions: "ការណែនាំ",
|
||||
mergeFields: "បញ្ចូល fields",
|
||||
instructionsMergeFields: "បន្ថែម fields ថ្មីទៅក្នុងការប្រមូលដែលមានស្រាប់ដោយសុវត្ថិភាព រក្សាទុកទិន្នន័យទាំងអស់",
|
||||
instructionsCollections: "ការប្រមូលប្រព័ន្ធ (ចាប់ផ្តើមដោយ _) និងការប្រមូលអ្នកប្រើប្រាស់នឹងត្រូវរំលងដោយស្វ័យប្រវត្តិ",
|
||||
instructionsImportAuth: "មានតែអ្នកគ្រប់គ្រងដែលបានផ្ទៀងផ្ទាត់អត្តសញ្ញាណប៉ុណ្ណោះអាចធ្វើការបញ្ចូល Schema",
|
||||
collectionsUpdatedCount: "ការប្រមូលចំនួន {count} ត្រូវបានធ្វើបច្ចុប្បន្នភាព",
|
||||
collectionsCreatedCount: "ការប្រមូលចំនួន {count} ត្រូវបានបង្កើត",
|
||||
collectionsSkippedCount: "ការប្រមូលចំនួន {count} ត្រូវបានរំលង"
|
||||
};
|
||||
@@ -0,0 +1,71 @@
|
||||
import { DockerTranslations } from '../types/docker';
|
||||
|
||||
export const dockerTranslations: DockerTranslations = {
|
||||
dockerContainers: "Containers Docker",
|
||||
container: "Containers",
|
||||
status: "ស្ថានភាព",
|
||||
cpuUsage: "ការប្រើប្រាស់ CPU",
|
||||
memory: "អង្គចងចាំ",
|
||||
disk: "ថាស",
|
||||
uptime: "ពេលដំណើរការ",
|
||||
lastChecked: "បានពិនិត្យចុងក្រោយ",
|
||||
actions: "សកម្មភាព",
|
||||
searchContainersPlaceholder: "ស្វែងរកContainers...",
|
||||
refresh: "ធ្វើបច្ចុប្បន្នភាព",
|
||||
openMenu: "បើកម៉ឺនុយ",
|
||||
viewMetrics: "មើលមេត្រីក",
|
||||
viewDetails: "មើលព័ត៌មានលម្អិត",
|
||||
|
||||
running: "ដំណើរការ",
|
||||
stopped: "បានបញ្ឈប់",
|
||||
warning: "ការព្រមាន",
|
||||
unknown: "មិនស្គាល់",
|
||||
totalContainers: "Containers សរុប",
|
||||
containersLabel: "Containers",
|
||||
|
||||
noContainersFound: "រកមិនឃើញContainers",
|
||||
noContainersRunning: "គ្មានContainersកំពុងដំណើរការ",
|
||||
tryAdjustSearch: "សូមព្យាយាមកែសម្រួលពាក្យស្វែងរករបស់អ្នក។",
|
||||
startSomeContainers: "ចាប់ផ្តើមContainersខ្លះៗ ដើម្បីមើលពួកវានៅទីនេះ។",
|
||||
|
||||
containerMetricsTitle: "មេត្រីកContainers: {name}",
|
||||
dockerId: "Docker ID",
|
||||
loadingMetrics: "កំពុងផ្ទុកមេត្រីក...",
|
||||
errorLoadingMetrics: "កំហុសក្នុងការផ្ទុកមេត្រីក",
|
||||
noMetricsAvailable: "គ្មានទិន្នន័យមេត្រីកសម្រាប់Containersនេះ",
|
||||
|
||||
minutes60: "៦០ នាទី",
|
||||
day1: "១ ថ្ងៃ",
|
||||
days7: "៧ ថ្ងៃ",
|
||||
month1: "១ ខែ",
|
||||
months3: "៣ ខែ",
|
||||
|
||||
used: "បានប្រើ:",
|
||||
free: "ទំនេរ:",
|
||||
total: "សរុប:",
|
||||
usage: "ការប្រើប្រាស់:",
|
||||
cpu: "CPU",
|
||||
memoryTitle: "អង្គចងចាំ",
|
||||
diskTitle: "ថាស",
|
||||
network: "បណ្តាញ",
|
||||
|
||||
cpuUsagePct: "ការប្រើប្រាស់ CPU (%)",
|
||||
cpuUsageVsAvailable: "ការប្រើប្រាស់ CPU នឹង អាចប្រើបាន",
|
||||
cpuAvailablePct: "CPU អាចប្រើបាន (%)",
|
||||
ramUsagePct: "ការប្រើប្រាស់ RAM (%)",
|
||||
memoryUsageBytes: "ការប្រើប្រាស់អង្គចងចាំ (បៃ)",
|
||||
usedMemory: "អង្គចងចាំបានប្រើ",
|
||||
totalMemory: "អង្គចងចាំសរុប",
|
||||
diskUsagePct: "ការប្រើប្រាស់ថាស (%)",
|
||||
diskUsageBytes: "ការប្រើប្រាស់ថាស (បៃ)",
|
||||
usedDisk: "ថាសបានប្រើ",
|
||||
totalDisk: "ថាសសរុប",
|
||||
networkTraffic: "ចរាចរបណ្តាញ",
|
||||
networkSpeedKbs: "ល្បឿនបណ្តាញ (KB/s)",
|
||||
rxBytes: "RX បៃ",
|
||||
txBytes: "TX បៃ",
|
||||
rxSpeedKbs: "ល្បឿន RX (KB/s)",
|
||||
txSpeedKbs: "ល្បឿន TX (KB/s)",
|
||||
};
|
||||
|
||||
|
||||
@@ -53,4 +53,13 @@ export const incidentTranslations: IncidentTranslations = {
|
||||
failedToUpdateStatus: "បរាជ័យក្នុងការធ្វើបច្ចុប្បន្នភាពស្ថានភាព",
|
||||
inProgress: "កំពុងដំណើរការ",
|
||||
enterRootCause: 'បញ្ចូលហេតុផលដើម',
|
||||
enterIncidentTitle: "បញ្ចូលចំណងជើងឧបទ្ទវហេតុ",
|
||||
enterIncidentDescription: "បញ្ចូលការពិពណ៌នាអំពីឧបទ្ទវហេតុ",
|
||||
enterServiceId: "បញ្ចូលលេខសម្គាល់សេវាកម្ម ដោយបំបែកដោយសញ្ញាក្បៀស",
|
||||
selectAssignedUser: "ជ្រើសរើសអ្នកប្រើប្រាស់ដែលត្រូវបានចាត់តាំង",
|
||||
noAssignedUser: "ឧបទ្ទវហេតុបច្ចុប្បន្នមិនត្រូវបានចាត់តាំងទៅអ្នកប្រើប្រាស់ណាមួយទេ",
|
||||
affectedSystems: "ប្រព័ន្ធដែលរងផលប៉ះពាល់",
|
||||
enterAffectedSystems: "បញ្ចូលប្រព័ន្ធដែលរងផលប៉ះពាល់",
|
||||
separateSystemsWithComma: "បញ្ចូលប្រព័ន្ធដែលរងផលប៉ះពាល់ ដោយបំបែកដោយសញ្ញាក្បៀស",
|
||||
createIncidentDesc: "បង្កើតឧបទ្ទវហេតុថ្មី"
|
||||
};
|
||||
|
||||
@@ -9,6 +9,11 @@ import { maintenanceTranslations } from './maintenance';
|
||||
import { incidentTranslations } from './incident';
|
||||
import { sslTranslations } from './ssl';
|
||||
import { settingsTranslations } from './settings';
|
||||
import { instanceTranslations } from './instance';
|
||||
import { operationTranslations } from './operation';
|
||||
import { regionTranslations } from './region';
|
||||
import { dockerTranslations } from './docker';
|
||||
import { publicTranslations } from './public';
|
||||
|
||||
const enTranslations: Translations = {
|
||||
common: commonTranslations,
|
||||
@@ -19,7 +24,13 @@ const enTranslations: Translations = {
|
||||
maintenance: maintenanceTranslations,
|
||||
incident: incidentTranslations,
|
||||
ssl: sslTranslations,
|
||||
settings: settingsTranslations
|
||||
settings: settingsTranslations,
|
||||
instance: instanceTranslations,
|
||||
operation: operationTranslations,
|
||||
region: regionTranslations,
|
||||
docker: dockerTranslations,
|
||||
public: publicTranslations
|
||||
|
||||
};
|
||||
|
||||
export default enTranslations;
|
||||
@@ -0,0 +1,165 @@
|
||||
|
||||
import { InstanceTranslations } from '../types/instance';
|
||||
|
||||
export const instanceTranslations: InstanceTranslations = {
|
||||
|
||||
// InstanceMonitoring.tsx
|
||||
instanceMonitoring: "ការត្រួតពិនិត្យឧទាហរណ៍",
|
||||
describeMonitorInstance: "ត្រួតពិនិត្យនិងគ្រប់គ្រងឧទាហរណ៍ម៉ាស៊ីនមេរបស់អ្នកក្នុងពេលជាក់ស្តែង",
|
||||
addServerAgent: "បន្ថែមភ្នាក់ងារម៉ាស៊ីនមេ",
|
||||
errorLoadingServers: "កំហុសក្នុងការផ្ទុកម៉ាស៊ីនមេ",
|
||||
unableToFetchServerData: "មិនអាចទាញយកទិន្នន័យម៉ាស៊ីនមេបានទេ។ សូមពិនិត្យការតភ្ជាប់របស់អ្នក ហើយព្យាយាមម្តងទៀត។",
|
||||
retry: "ព្យាយាមម្តងទៀត",
|
||||
|
||||
// ServerTable.tsx
|
||||
servers: "ម៉ាស៊ីនមេ",
|
||||
loadingServers: "កំពុងផ្ទុកម៉ាស៊ីនមេ...",
|
||||
searchServersPlaceholder: "ស្វែងរកម៉ាស៊ីនមេ...",
|
||||
noServersFound: "រកមិនឃើញម៉ាស៊ីនមេ",
|
||||
name: "ឈ្មោះ",
|
||||
status: "ស្ថានភាព",
|
||||
OS: "ប្រព័ន្ធប្រតិបត្តិការ",
|
||||
IPAddress: "អាសយដ្ឋាន IP",
|
||||
CPU: "ស៊ីភីយូ",
|
||||
memory: "អង្គចងចាំ",
|
||||
disk: "ថាស",
|
||||
uptime: "ពេលវេលាដំណើរការ",
|
||||
lastChecked: "បានពិនិត្យចុងក្រោយ",
|
||||
actions: "សកម្មភាព",
|
||||
viewServerDetail: "មើលព័ត៌មានលម្អិតម៉ាស៊ីនមេ",
|
||||
containerMonitoring: "ការត្រួតពិនិត្យ Container",
|
||||
resumeMonitoring: "បន្តការត្រួតពិនិត្យ",
|
||||
pauseMonitoring: "ផ្អាកការត្រួតពិនិត្យ",
|
||||
editServer: "កែសម្រួលម៉ាស៊ីនមេ",
|
||||
deleteServer: "លុបម៉ាស៊ីនមេ",
|
||||
deleteServerConfirmTitle: "តើអ្នកប្រាកដថាចង់លុបម៉ាស៊ីនមេនេះទេ?",
|
||||
deleteServerConfirmDesc: "សកម្មភាពនេះមិនអាចត្រឡប់វិញបានទេ។ វានឹងលុប {name} និងទិន្នន័យត្រួតពិនិត្យទាំងអស់របស់វាជាអចិន្ត្រៃយ៍។",
|
||||
cancel: "បោះបង់",
|
||||
deleting: "កំពុងលុប...",
|
||||
delete: "លុប",
|
||||
serverDeleted: "ម៉ាស៊ីនមេត្រូវបានលុប",
|
||||
serverDeletedDesc: "{name} ត្រូវបានលុបដោយជោគជ័យ។",
|
||||
error: "កំហុស",
|
||||
deleteServerError: "បរាជ័យក្នុងការលុបម៉ាស៊ីនមេ។ សូមព្យាយាមម្តងទៀត។",
|
||||
serverPaused: "ម៉ាស៊ីនមេត្រូវបានផ្អាក",
|
||||
serverResumed: "ម៉ាស៊ីនមេត្រូវបានបន្ត",
|
||||
monitoringPaused: "ការត្រួតពិនិត្យត្រូវបានផ្អាកសម្រាប់ {name}",
|
||||
monitoringResumed: "ការត្រួតពិនិត្យត្រូវបានបន្តសម្រាប់ {name}",
|
||||
pauseServerError: "បរាជ័យក្នុងការផ្អាកការត្រួតពិនិត្យម៉ាស៊ីនមេ។ សូមព្យាយាមម្តងទៀត។",
|
||||
resumeServerError: "បរាជ័យក្នុងការបន្តការត្រួតពិនិត្យម៉ាស៊ីនមេ�। សូមព្យាយាមម្តងទៀត។",
|
||||
|
||||
// ServerStatsCards.tsx
|
||||
totalServers: "ម៉ាស៊ីនមេសរុប",
|
||||
onlineServers: "ម៉ាស៊ីនមេដំណើរការ",
|
||||
offlineServers: "ម៉ាស៊ីនមេផ្អាកដំណើរការ",
|
||||
warningServers: "ម៉ាស៊ីនមេដែលមានការព្រមាន",
|
||||
|
||||
// AddServerAgentDialog.tsx
|
||||
addServerMonitoringAgent: "បន្ថែមភ្នាក់ងារត្រួតពិនិត្យម៉ាស៊ីនមេ",
|
||||
configureAgentDesc: "កំណត់រចនាសម្ព័ន្ធភ្នាក់ងារត្រួតពិនិត្យម៉ាស៊ីនមេថ្មីដើម្បីតាមដានម៉ែត្រប្រព័ន្ធ និងប្រសិទ្ធភាព។",
|
||||
configureAgent: "កំណត់រចនាសម្ព័ន្ធភ្នាក់ងារ",
|
||||
oneClickInstall: "ការដំឡើងតែមួយចុច",
|
||||
dockerOneClick: "Docker ការដំឡើងតែមួយចុច",
|
||||
manualInstallation: "ការដំឡើងដោយដៃ",
|
||||
validationError: "កំហុសក្នុងការផ្ទៀងផ្ទាត់",
|
||||
fillRequiredFields: "សូមបំពេញចន្លោះទាំងអស់ដែលតម្រូវឱ្យមាន។",
|
||||
serverAgentCreated: "ភ្នាក់ងារម៉ាស៊ីនមេត្រូវបានបង្កើត",
|
||||
serverAgentCreatedDesc: "ភ្នាក់ងារត្រួតពិនិត្យ {name} ត្រូវបានកំណត់រចនាសម្ព័ន្ធដោយជោគជ័យ។",
|
||||
failedToCreateAgent: "បរាជ័យក្នុងការបង្កើតភ្នាក់ងារត្រួតពិនិត្យម៉ាស៊ីនមេ។",
|
||||
|
||||
// ServerAgentConfigForm.tsx
|
||||
serverName: "ឈ្មោះម៉ាស៊ីនមេ",
|
||||
serverNamePlaceholder: "ឧ. web-server-01",
|
||||
serverNameDesc: "ឈ្មោះ ឬស្លាកដែលប្រើជាអត្តសញ្ញាណ",
|
||||
serverAgentId: "លេខសម្គាល់ភ្នាក់ងារម៉ាស៊ីនមេ",
|
||||
serverAgentIdDesc: "លេខសម្គាល់តែមួយគត់ដែលបង្កើតដោយស្វ័យប្រវត្តិ",
|
||||
operatingSystem: "ប្រព័ន្ធប្រតិបត្តិការ",
|
||||
checkInterval: "ចន្លោះពេលពិនិត្យ",
|
||||
selectInterval: "ជ្រើសរើសចន្លោះពេល",
|
||||
interval30s: "៣០ វិនាទី",
|
||||
interval1m: "១ នាទី",
|
||||
interval2m: "២ នាទី",
|
||||
interval5m: "៥ នាទី",
|
||||
checkIntervalDesc: "ភាពញឹកញាប់នៃការពិនិត្យស្ថានភាពម៉ាស៊ីនមេ និងម៉ែត្រ",
|
||||
retryAttempts: "ការព្យាយាមឡើងវិញ",
|
||||
selectRetryAttempts: "ជ្រើសរើសចំនួនការព្យាយាមឡើងវិញ",
|
||||
attempt1: "១ ការព្យាយាម",
|
||||
attempt2: "២ ការព្យាយាម",
|
||||
attempt3: "៣ ការព្យាយាម",
|
||||
attempt5: "៥ ការព្យាយាម",
|
||||
retryAttemptsDesc: "ចំនួនការព្យាយាមឡើងវិញមុនពេលសម្គាល់ថាដាច់",
|
||||
serverToken: "សញ្ញាសម្ងាត់ម៉ាស៊ីនមេ",
|
||||
serverTokenDesc: "សញ្ញាសម្ងាត់ផ្ទៀងផ្ទាត់ដែលបង្កើតដោយស្វ័យប្រវត្តិ",
|
||||
systemUrl: "URL ប្រព័ន្ធ",
|
||||
systemUrlDesc: "URL API ប្រព័ន្ធបច្ចុប្បន្ន",
|
||||
creatingAgent: "កំពុងបង្កើតភ្នាក់ងារ...",
|
||||
createServerAgent: "បង្កើតភ្នាក់ងារម៉ាស៊ីនមេ",
|
||||
|
||||
// EditServerDialog.tsx
|
||||
editServerConfiguration: "កែសម្រួលការកំណត់រចនាសម្ព័ន្ធម៉ាស៊ីនមេ",
|
||||
serverNameLabel: "ឈ្មោះម៉ាស៊ីនមេ *",
|
||||
enterServerNamePlaceholder: "បញ្ចូលឈ្មោះម៉ាស៊ីនមេ",
|
||||
checkIntervalLabel: "ចន្លោះពេលពិនិត្យ",
|
||||
// selectInterval: "ជ្រើសរើសចន្លោះពេល",
|
||||
interval10m: "១០ នាទី",
|
||||
maxRetriesLabel: "ការព្យាយាមឡើងវិញអតិបរិមា",
|
||||
selectMaxRetries: "ជ្រើសរើសការព្យាយាមអតិបរិមា",
|
||||
retry1: "១ ដង",
|
||||
retry2: "២ ដង",
|
||||
retry3: "៣ ដង",
|
||||
retry5: "៥ ដង",
|
||||
retry10: "១០ ដង",
|
||||
dockerMonitoring: "ការត្រួតពិនិត្យ Docker",
|
||||
enabled: "បានបើក",
|
||||
disabled: "បានបិទ",
|
||||
enableNotifications: "បើកការជូនដំណឹង",
|
||||
notificationSettings: "ការកំណត់ការជូនដំណឹង",
|
||||
notificationChannels: "ឆានែលការជូនដំណឹង",
|
||||
loadingChannels: "កំពុងផ្ទុកឆានែល...",
|
||||
noChannelsAvailable: "មិនមានឆានែលការជូនដំណឹង",
|
||||
selectedChannels: "ឆានែលដែលបានជ្រើស:",
|
||||
serverSetThreshold: "កំណត់កម្រិតម៉ាស៊ីនមេ",
|
||||
loadingThresholds: "កំពុងផ្ទុកកម្រិត...",
|
||||
selectServerThreshold: "ជ្រើសរើសកម្រិតម៉ាស៊ីនមេ",
|
||||
noThreshold: "គ្មានកម្រិត (ប្រើលំនាំដើម)",
|
||||
thresholdDetails: "ព័ត៌មានលម្អិតអំពីកម្រិត",
|
||||
cpuThresholdPct: "កម្រិត CPU (%)",
|
||||
ramThresholdPct: "កម្រិត RAM (%)",
|
||||
diskThresholdPct: "កម្រិតថាស (%)",
|
||||
networkThresholdPct: "កម្រិតបណ្តាញ (%)",
|
||||
serverTemplate: "គម្រូម៉ាស៊ីនមេ",
|
||||
loadingTemplates: "កំពុងផ្ទុកគម្រូ...",
|
||||
selectServerTemplate: "ជ្រើសរើសគម្រូម៉ាស៊ីនមេ",
|
||||
noTemplate: "គ្មានគម្រូ (ប្រើលំនាំដើម)",
|
||||
templateDetails: "ព័ត៌មានលម្អិតអំពីគម្រូ",
|
||||
ramMessage: "សារ RAM",
|
||||
cpuMessage: "សារ CPU",
|
||||
diskMessage: "សារ ថាស",
|
||||
networkMessage: "សារ បណ្តាញ",
|
||||
upMessage: "សារដំណើរការ",
|
||||
downMessage: "សារផ្អាក",
|
||||
noMessageDefined: "គ្មានសារសម្រាប់ {name}",
|
||||
serverUpdated: "បានធ្វើបច្ចុប្បន្នភាពម៉ាស៊ីនមេ",
|
||||
serverUpdatedDesc: "{name} ត្រូវបានធ្វើបច្ចុប្បន្នភាពដោយជោគជ័យ។",
|
||||
updating: "កំពុងធ្វើបច្ចុប្បន្នភាព...",
|
||||
updateServer: "ធ្វើបច្ចុប្បន្នភាពម៉ាស៊ីនមេ",
|
||||
failedToLoadChannels: "បានបរាជ័យក្នុងការផ្ទុកឆានែលការជូនដំណឹង",
|
||||
failedToLoadTemplates: "បានបរាជ័យក្នុងការផ្ទុកគម្រូ",
|
||||
failedToLoadThresholds: "បានបរាជ័យក្នុងការផ្ទុកកម្រិតម៉ាស៊ីនមេ",
|
||||
warning: "ការព្រមាន",
|
||||
serverUpdatedButThresholdFailed: "ម៉ាស៊ីនមេត្រូវបានធ្វើបច្ចុប្បន្នភាព ប៉ុន្តែបរាជ័យក្នុងការធ្វើបច្ចុប្បន្នភាពតម្លៃកម្រិត។",
|
||||
failedToUpdateServer: "បរាជ័យក្នុងការធ្វើបច្ចុប្បន្នភាពម៉ាស៊ីនមេ។ សូមព្យាយាមម្តងទៀត।",
|
||||
|
||||
// ServerDetail.tsx
|
||||
historicalPerformance: "សម្ដែងប្រវត្តិប្រតិបត្តិការ",
|
||||
loading: "កំពុងផ្ទុក...",
|
||||
errorLoadingChartData: "មានបញ្ហាក្នុងការផ្ទុកទិន្នន័យតារាង",
|
||||
noHistoricalData: "មិនមានទិន្នន័យចាស់សម្រាប់ {{timeRange}}",
|
||||
rawMetricsCount: "ចំនួនមេត្រដើម៖ {{count}}",
|
||||
serverIdTimeRange: "លេខសម្គាល់ម៉ាស៊ីនបម្រើ៖ {{serverId}} • ជួរពេលវេលា៖ {{timeRange}}",
|
||||
dataExistsOutsideRange: "ទិន្នន័យមាន ប៉ុន្តែអាចនៅខាងក្រៅជួរពេលវេលាដែលបានជ្រើស",
|
||||
noMetricsDataFound: "រកមិនឃើញទិន្នន័យមេត្រទេ",
|
||||
dataPointsTimeRange: "{{count}} ចំណុចទិន្នន័យ • {{timeRange}}",
|
||||
// updating: "កំពុងធ្វើបច្ចុប្បន្នភាព...",
|
||||
|
||||
};
|
||||
@@ -65,4 +65,25 @@ export const maintenanceTranslations: MaintenanceTranslations = {
|
||||
noScheduledMaintenance: "មិនមានកាលវិភាគថែទាំទេ",
|
||||
noMaintenanceWindows: "មិនមានកាលវិភាគថែទាំសម្រាប់រយៈពេលនេះទេ។ បង្កើតមួយដោយចុចប៊ូតុង \"បង្កើតកាលវិភាគថែទាំ\"។",
|
||||
maintenanceCreatedSuccess: "កាលវិភាគថែទាំត្រូវបានបង្កើតដោយជោគជ័យ",
|
||||
editMaintenanceWindow: "កែសម្រួលការថែទាំ",
|
||||
editMaintenanceDesc: "កែសម្រួលព័ត៌មានលម្អិតនៃការថែទាំ",
|
||||
priorityDescription: "ជ្រើសរើសអាទិភាពនៃការថែទាំ",
|
||||
statusDescription: "ជ្រើសរើសស្ថានភាពនៃការថែទាំ",
|
||||
impactLevel: "កម្រិតផលប៉ះពាល់",
|
||||
impactLevelDescription: "ជ្រើសរើសកម្រិតផលប៉ះពាល់",
|
||||
selectAssignedUsers: "ជ្រើសរើសអ្នកប្រើប្រាស់ដែលត្រូវបានចាត់តាំង",
|
||||
assignedPersonnelDescription: "អ្នកប្រើប្រាស់ដែលត្រូវបានចាត់តាំងបច្ចុប្បន្ន",
|
||||
mutedNotifications: "ការជូនដំណឹងត្រូវបានបិទ",
|
||||
notificationsAreMuted: "ការជូនដំណឹងបច្ចុប្បន្នត្រូវបានបិទសម្រាប់ការថែទាំនេះ",
|
||||
selectNotificationChannel: "បន្ថែមបណ្តាញជូនដំណឹង",
|
||||
enableNotificationsFirst: "សូមបើកការជូនដំណឹងជាមុនសិន ដើម្បីជ្រើសរើសបណ្តាញ",
|
||||
updateMaintenance: "ធ្វើបច្ចុប្បន្នភាពការថែទាំ",
|
||||
loginToViewProfile: "សូមចូលគណនីដើម្បីមើលប្រវត្តិរូបរបស់អ្នក",
|
||||
goToLogin: "ចូលគណនី",
|
||||
loadingUserData: "កំពុងផ្ទុកទិន្នន័យអ្នកប្រើប្រាស់...",
|
||||
retry: "ព្យាយាមម្តងទៀត",
|
||||
loadingServerData: "កំពុងផ្ទុកទិន្នន័យម៉ាស៊ីនមេ...",
|
||||
retrievingYourInformation: "សូមរង់ចាំខណៈពេលយើងទាញយកព័ត៌មានរបស់អ្នក...",
|
||||
servicesPagination: "សេវាកម្ម {startItem}-{endItem} នៃ {totalItems} សេវាកម្ម",
|
||||
servicesPaginationNoService: "គ្មានសេវាកម្ម",
|
||||
};
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import { MenuTranslations } from '../types/menu';
|
||||
|
||||
export const menuTranslations: MenuTranslations = {
|
||||
uptimeMonitoring: "ការត្រួតពិនិត្យ Uptime",
|
||||
instanceMonitoring: "ការត្រួតពិនិត្យឧបករណ៍",
|
||||
sslDomain: "SSL និងដមែន",
|
||||
uptimeMonitoring: "ត្រួតពិនិត្យ Uptime",
|
||||
instanceMonitoring: "ត្រួតពិនិត្យម៉ាស៊ីនមេ",
|
||||
sslDomain: "SSL និងដូមែន",
|
||||
scheduleIncident: "កាលវិភាគនិងឧបទ្ទវហេតុ",
|
||||
operationalPage: "ទំព័រប្រតិបត្តិការ",
|
||||
reports: "របាយការណ៍",
|
||||
regionalMonitoring: "ការត្រួតពិនិត្យតំបន់",
|
||||
regionalMonitoring: "ត្រួតពិនិត្យតំបន់",
|
||||
settingPanel: "ផ្ទាំងការកំណត់",
|
||||
generalSettings: "ការកំណត់ទូទៅ",
|
||||
userManagement: "ការគ្រប់គ្រងអ្នកប្រើប្រាស់",
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
|
||||
import { OperationTranslations } from '../types/operation';
|
||||
|
||||
export const operationTranslations: OperationTranslations = {
|
||||
// OperationalPageContent.tsx
|
||||
failedToLoadOperationalPages: "បរាជ័យក្នុងការផ្ទុកទំព័រប្រតិបត្តិការ",
|
||||
loadingoperationalPages: "មានបញ្ហាក្នុងការផ្ទុកទំព័រប្រតិបត្តិការរបស់អ្នក។ សូមព្យាយាមម្តងទៀត។",
|
||||
tryagain: "ព្យាយាមម្តងទៀត",
|
||||
operationalPages: "ទំព័រប្រតិបត្តិការ",
|
||||
describeOperation: "គ្រប់គ្រងទំព័រស្ថានភាពសាធារណៈរបស់អ្នក និងត្រួតពិនិត្យសុខភាពសេវាកម្ម",
|
||||
refresh: "ធ្វើបច្ចុប្បន្នភាព",
|
||||
noOperationalPagesFound: "រកមិនឃើញទំព័រប្រតិបត្តិការទេ",
|
||||
createYourFirstOperationalPage: "បង្កើតទំព័រប្រតិបត្តិការដំបូងរបស់អ្នក ដើម្បីចាប់ផ្តើមត្រួតពិនិត្យសេវាកម្មរបស់អ្នក និងប្រាស្រ័យទាក់ទងស្ថានភាពទៅកាន់អ្នកប្រើប្រាស់។",
|
||||
totalPages: "ទំព័រសរុប",
|
||||
publicPages: "ទំព័រសាធារណៈ",
|
||||
operational: "ប្រតិបត្តិការ",
|
||||
deleteOperationalPage: "លុបទំព័រប្រតិបត្តិការ",
|
||||
deleteOperationalPageConfirm: 'តើអ្នកប្រាកដថាចង់លុប "{title}" ឬ? សកម្មភាពនេះមិនអាចត្រឡប់វិញបានទេ ហើយនឹងលុបទំព័រប្រតិបត្តិការ និងសមាសធាតុទាំងអស់របស់វាជាអចិន្ត្រៃយ៍។',
|
||||
cancel: "បោះបង់",
|
||||
delete: "លុប",
|
||||
deleting: "កំពុងលុប...",
|
||||
|
||||
// EditOperationalPageDialog.tsx
|
||||
editOperationalPage: "កែសម្រួលទំព័រប្រតិបត្តិការ",
|
||||
updateYourOperationalPage: "ធ្វើបច្ចុប្បន្នភាពការកំណត់ទំព័រស្ថានភាពប្រតិបត្តិការរបស់អ្នក និងគ្រប់គ្រងសមាសធាតុ។",
|
||||
title: "ចំណងជើង",
|
||||
myServiceStatusPlaceholder: "ស្ថានភាពសេវាកម្មរបស់ខ្ញុំ",
|
||||
slug: "ចំនងជើង URL",
|
||||
myServiceStatusSlugPlaceholder: "ស្ថានភាពសេវាកម្មរបស់ខ្ញុំ",
|
||||
description: "ការពិពណ៌នា",
|
||||
operationalPageDescriptionPlaceholder: "ការពិពណ៌នាខ្លីអំពីទំព័រប្រតិបត្តិការរបស់អ្នក",
|
||||
theme: "ផ្ទៃខាងក្រោយ",
|
||||
selectTheme: "ជ្រើសរើសផ្ទៃខាងក្រោយ",
|
||||
themeDefault: "លំនាំដើម",
|
||||
themeDark: "ងងឹត",
|
||||
themeLight: "ភ្លឺ",
|
||||
status: "ស្ថានភាព",
|
||||
selectStatus: "ជ្រើសរើសស្ថានភាព",
|
||||
statusOperational: "ប្រតិបត្តិការ",
|
||||
statusDegraded: "ការសមត្ថភាពធ្លាក់ចុះ",
|
||||
statusMaintenance: "នៅក្រោមការថែទាំ",
|
||||
statusMajorOutage: "ការបាត់បង់ធំ",
|
||||
publicPage: "ទំព័រសាធារណៈ",
|
||||
makePagePublic: "ធ្វើឱ្យទំព័រនេះអាចចូលដំណើរការបានសាធារណៈ",
|
||||
customDomainOptional: "ដែនកំណត់ផ្ទាល់ខ្លួន (ជាជម្រើស)",
|
||||
customDomainPlaceholder: "status.yourdomain.com",
|
||||
customDomainDescription: "ដែនកំណត់ផ្ទាល់ខ្លួនសម្រាប់ទំព័រស្ថានភាពរបស់អ្នក",
|
||||
cancelUpdate: "បោះបង់",
|
||||
updating: "កំពុងធ្វើបច្ចុប្បន្នភាព...",
|
||||
updatePage: "ធ្វើបច្ចុប្បន្នភាពទំព័រ",
|
||||
|
||||
// ComponentsSelector.tsx
|
||||
statusPageComponents: "សមាសធាតុទំព័រស្ថានភាព",
|
||||
addMonitoringComponentsDesc: "បន្ថែមសមាសធាតុត្រួតពិនិត្យដូចជាសេវាកម្មពេលវេលាដំណើរការ, វិញ្ញាបនបត្រ SSL, និងការតាមដានឧប្បត្តិហេតុ",
|
||||
selectedComponents: "សមាសធាតុដែលបានជ្រើសរើស",
|
||||
service: "សេវាកម្ម",
|
||||
server: "ម៉ាស៊ីនមេ",
|
||||
addComponent: "បន្ថែមសមាសធាតុ",
|
||||
componentName: "ឈ្មោះសមាសធាតុ",
|
||||
componentNamePlaceholder: "ឧ. គេហទំព័រមេ",
|
||||
displayOrder: "លំដាប់បង្ហាញ",
|
||||
descriptionOptional: "ការពិពណ៌នា (ស្រេចចិត្ត)",
|
||||
descriptionPlaceholder: "ការពិពណ៌នាសង្ខេបអំពីសមាសធាតុនេះ",
|
||||
uptimeServiceOptional: "សេវាកម្មពេលវេលាដំណើរការ (ស្រេចចិត្ត)",
|
||||
selectUptimeService: "ជ្រើសរើសសេវាកម្មពេលវេលាដំណើរការ",
|
||||
serverIdOptional: "លេខសម្គាល់ម៉ាស៊ីនមេ (ស្រេចចិត្ត)",
|
||||
serverIdPlaceholder: "server_456",
|
||||
cancelComponent: "បោះបង់",
|
||||
|
||||
// OperationalPageCard.tsx
|
||||
public: "សាធារណៈ",
|
||||
yes: "បាទ/ចាស",
|
||||
no: "ទេ",
|
||||
updated: "បានធ្វើបច្ចុប្បន្នភាព",
|
||||
view: "មើល",
|
||||
edit: "កែសម្រួល",
|
||||
|
||||
// CreateOperationalPageDialog.tsx
|
||||
createOperationalPage: "បង្កើតទំព័រប្រតិបត្តិការ",
|
||||
createOperationalPageDesc: "បង្កើតទំព័រស្ថានភាពប្រតិបត្តិការថ្មីដើម្បីត្រួតពិនិត្យសេវាកម្ម និងសមាសធាតុរបស់អ្នក។",
|
||||
createPage: "បង្កើតទំព័រ",
|
||||
creating: "កំពុងបង្កើត...",
|
||||
initialStatus: "ស្ថានភាពដំបូង",
|
||||
|
||||
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
import { PublicTranslations } from '../types/public';
|
||||
|
||||
export const publicTranslations: PublicTranslations = {
|
||||
systemStatus: "ស្ថានភាពប្រព័ន្ធ",
|
||||
allOperational: "ប្រព័ន្ធទាំងអស់ដំណើរការធម្មតា",
|
||||
degradedPerformance: "ខ្លះៗកំពុងមានប្រសិទ្ធភាពធ្លាក់ចុះ",
|
||||
underMaintenance: "ប្រព័ន្ធកំពុងថែទាំ",
|
||||
majorOutage: "យើងកំពុងជួបការរាំងស្ទះធ្ងន់ធ្ងរ",
|
||||
statusUnknown: "មិនស្គាល់ស្ថានភាព",
|
||||
autoUpdatedByHealth: "ស្ថានភាពត្រូវបានធ្វើបច្ចុប្បន្នភាពដោយស្វ័យប្រវត្តិតាមសុខភាពសមាសភាគ",
|
||||
lastUpdatedAt: "បានធ្វើបច្ចុប្បន្នភាពចុងក្រោយ: {time} UTC",
|
||||
liveStatusMonitoring: "ការត្រួតពិនិត្យស្ថានភាពផ្ទាល់",
|
||||
|
||||
loadingStatusPage: "កំពុងផ្ទុកទំព័រស្ថានភាព",
|
||||
fetchingRealtimeStatus: "កំពុងទាញយកស្ថានភាពប្រព័ន្ធពេលជាក់ស្តែង...",
|
||||
slugLabel: "Slug",
|
||||
statusPageNotFound: "រកមិនឃើញទំព័រស្ថានភាព",
|
||||
notFoundDescription: "ទំព័រស្ថានភាពដែលបានស្នើរសុំមិនអាចរកឃើញ ឬមិនអាចចូលមើលជាសាធារណៈបាន។",
|
||||
goBack: "ត្រឡប់ក្រោយ",
|
||||
retry: "ព្យាយាមម្តងទៀត",
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
|
||||
import { RegionTranslations } from '../types/region';
|
||||
|
||||
export const regionTranslations: RegionTranslations = {
|
||||
|
||||
//RegionalMonitoringContent.tsx
|
||||
regionalmonitoring: "ត្រួតពិនិត្យតំបន់",
|
||||
descriptRegionPage: "ត្រួតពិនិត្យហេដ្ឋារចនាសម្ព័ន្ធរបស់អ្នកពីតំបន់ជាច្រើនសម្រាប់ភាពជឿជាក់កាន់តែប្រសើរ។",
|
||||
addRegionalAgent: "បន្ថែមភ្នាក់ងារតំបន់",
|
||||
totalAgents: "ភ្នាក់ងារសរុប",
|
||||
regionalMonitoringAgents: "ភ្នាក់ងារត្រួតពិនិត្យតំបន់",
|
||||
onlineAgents: "ភ្នាក់ងារដំណើរការ",
|
||||
currentlyConnected: "បច្ចុប្បន្នកំពុងភ្ជាប់",
|
||||
offlineAgents: "ភ្នាក់ងារមិនដំណើរការ",
|
||||
disconnectedAgents: "ភ្នាក់ងារដែលបានផ្តាច់",
|
||||
regionalAgents: "ភ្នាក់ងារតំបន់",
|
||||
noRegionalAgents: "គ្មានភ្នាក់ងារតំបន់",
|
||||
getStartedAddAgent: "ចាប់ផ្តើមដោយបន្ថែមភ្នាក់ងារត្រួតពិនិត្យតំបន់ដំបូងរបស់អ្នក ដើម្បីពង្រីកការគ្របដណ្តប់ត្រួតពិនិត្យ។",
|
||||
addFirstAgent: "បន្ថែមភ្នាក់ងារដំបូង",
|
||||
agentRemoved: "ភ្នាក់ងារត្រូវបានដកចេញ",
|
||||
agentRemovedDesc: "ភ្នាក់ងារត្រួតពិនិត្យតំបន់ត្រូវបានដកចេញ។",
|
||||
regionalAgentAdded: "ភ្នាក់ងារតំបន់ត្រូវបានបន្ថែម",
|
||||
regionalAgentAddedDesc: "ភ្នាក់ងារត្រួតពិនិត្យតំបន់ត្រូវបានកំណត់រចនាសម្ព័ន្ធដោយជោគជ័យ។",
|
||||
error: "កំហុស",
|
||||
failedToRemoveAgent: "បរាជ័យក្នុងការដកភ្នាក់ងារត្រួតពិនិត្យតំបន់។",
|
||||
|
||||
//AddRegionalAgentDialog.tsx
|
||||
addRegionalMonitoringAgent: "បន្ថែមភ្នាក់ងារត្រួតពិនិត្យតំបន់",
|
||||
deployRegionalMonitoringAgent: "ដាក់ពង្រាយភ្នាក់ងារត្រួតពិនិត្យតំបន់ជាមួយនឹងការដំឡើងតែមួយចុចដោយស្វ័យប្រវត្តិ",
|
||||
regionName: "ឈ្មោះតំបន់",
|
||||
regionNamePlaceholder: "ឧ. us-east-1, europe-west-1, asia-pacific-1",
|
||||
agentServerIpAddress: "អាសយដ្ឋាន IP របស់ម៉ាស៊ីនមេភ្នាក់ងារ",
|
||||
agentIpPlaceholder: "ឧ. 192.168.1.100 ឬ your-server.example.com",
|
||||
cancel: "បោះបង់",
|
||||
generateInstallation: "បង្កើតការដំឡើង",
|
||||
generating: "កំពុងបង្កើត...",
|
||||
agentConfigurationReady: "ការកំណត់រចនាសម្ព័ន្ធភ្នាក់ងាររួចរាល់!",
|
||||
oneClickInstallScriptGenerated: "ស្គ្រីបដំឡើងតែមួយចុចត្រូវបានបង្កើតជាមួយនឹងការកំណត់រចនាសម្ព័ន្ធដោយស្វ័យប្រវត្តិ",
|
||||
oneClickInstallTab: "ការដំឡើងតែមួយចុច",
|
||||
agentDetailsTab: "ព័ត៌មានលម្អិតភ្នាក់ងារ",
|
||||
manualInstallTab: "ការដំឡើងដោយដៃ",
|
||||
oneClickAutomaticInstallation: "ការដំឡើងដោយស្វ័យប្រវត្តិតែមួយចុច",
|
||||
completeInstallationDescription: "បញ្ចប់ការដំឡើង ការកំណត់រចនាសម្ព័ន្ធ និងការចាប់ផ្តើមសេវាកម្មក្នុងពាក្យបញ្ជាតែមួយ",
|
||||
whatThisScriptDoes: "អ្វីដែលស្គ្រីបនេះធ្វើដោយស្វ័យប្រវត្តិ:",
|
||||
scriptActionDownload: "ទាញយកកញ្ចប់ .deb ចុងក្រោយ",
|
||||
scriptActionInstall: "ដំឡើងភ្នាក់ងារត្រួតពិនិត្យតំបន់",
|
||||
scriptActionConfigure: "បង្កើតឯកសារកំណត់រចនាសម្ព័ន្ធជាមួយនឹងការកំណត់របស់អ្នក",
|
||||
scriptActionStart: "ចាប់ផ្តើម និងបើកដំណើរការសេវាកម្ម",
|
||||
scriptActionHealthChecks: "ដំណើរការការត្រួតពិនិត្យសុខភាព",
|
||||
runCommandOnServer: "ដំណើរការពាក្យបញ្ជានេះនៅលើម៉ាស៊ីនមេគោលដៅរបស់អ្នក:",
|
||||
downloadCompleteScript: "ទាញយកស្គ្រីបពេញលេញ",
|
||||
copyFullScript: "ចម្លងស្គ្រីបពេញលេញ",
|
||||
localDevelopmentNotice: "<strong>សេចក្តីជូនដំណឹងអំពីការអភិវឌ្ឍន៍មូលដ្ឋាន:</strong> ប្រសិនបើការចម្លងទៅក្តារកៅស៊ូបរាជ័យ នេះជារឿងធម្មតានៅក្នុងការអភិវឌ្ឍន៍មូលដ្ឋាន។ អ្នកអាចប្រើប៊ូតុង 'ទាញយកស្គ្រីបពេញលេញ' ជំនួស ឬចម្លងអត្ថបទដោយដៃ។",
|
||||
generatedAgentConfiguration: "ការកំណត់រចនាសម្ព័ន្ធភ្នាក់ងារដែលបានបង្កើត",
|
||||
autoConfiguredDuringInstallation: "តម្លៃទាំងនេះនឹងត្រូវបានកំណត់រចនាសម្ព័ន្ធដោយស្វ័យប្រវត្តិក្នុងអំឡុងពេលដំឡើង",
|
||||
agentId: "លេខសម្គាល់ភ្នាក់ងារ",
|
||||
regionNameDetail: "ឈ្មោះតំបន់",
|
||||
serverIp: "អាសយដ្ឋាន IP ម៉ាស៊ីនមេ",
|
||||
apiEndpoint: "ចំណុចបញ្ចប់ API",
|
||||
authenticationToken: "សញ្ញាសម្ងាត់ផ្ទៀងផ្ទាត់",
|
||||
configurationFileLocation: "<strong>ទីតាំងឯកសារកំណត់រចនាសម្ព័ន្ធ:</strong> /etc/regional-check-agent/regional-check-agent.env",
|
||||
manualInstallationSteps: "ជំហានការដំឡើងដោយដៃ",
|
||||
stepByStepManualInstallation: "ដំណើរការដំឡើងដោយដៃជាជំហានៗ",
|
||||
step1DownloadPackage: "ជំហានទី១: ទាញយកកញ្ចប់",
|
||||
downloadAmd64Notice: "✅ ប្រសិនបើអ្នកកំពុងប្រើស្ថាបត្យកម្ម amd64 សូមទាញយកកញ្ចប់នេះ។",
|
||||
downloadArm64Notice: "✅ ប្រសិនបើអ្នកកំពុងប្រើស្ថាបត្យកម្ម arm64 សូមទាញយកកញ្ចប់នេះ�।",
|
||||
step2InstallPackage: "ជំហានទី២: ដំឡើងកញ្ចប់",
|
||||
step3ConfigureAgent: "ជំហានទី៣: កំណត់រចនាសម្ព័ន្ធភ្នាក់ងារ",
|
||||
copySampleConfiguration: "ចម្លងការកំណត់រចនាសម្ព័ន្ធគំរូពី https://github.com/operacle/Distributed-Regional-Monitoring/blob/main/packaging/regional-check-agent.conf",
|
||||
addConfigurationValues: "បន្ថែមតម្លៃកំណត់រចនាសម្ព័ន្ធដែលបង្ហាញនៅក្នុងផ្ទាំងព័ត៌មានលម្អិតភ្នាក់ងារ",
|
||||
step4StartService: "ជំហានទី៤: ចាប់ផ្តើមសេវាកម្ម",
|
||||
step5VerifyInstallation: "ជំហានទី៥: ផ្ទៀងផ្ទាត់ការដំឡើង",
|
||||
addAnotherAgent: "បន្ថែមភ្នាក់ងារមួយទៀត",
|
||||
completeSetup: "បញ្ចប់ការរៀបចំ",
|
||||
copied: "បានចម្លង!",
|
||||
copiedDescription: "{description} បានចម្លងទៅក្តារកៅស៊ូ។",
|
||||
copyFailed: "ការចម្លងបរាជ័យ",
|
||||
copyFailedDescription: "បរាជ័យក្នុងការចម្លងទៅក្តារកៅស៊ូ។",
|
||||
copyFailedLocalhost: "នេះជារឿងធម្មតានៅក្នុងការអភិវឌ្ឍន៍មូលដ្ឋាន។ សូមចម្លងអត្ថបទដោយដៃ។",
|
||||
copyFailedChrome: "សូមសាកល្បងប្រើ HTTPS ឬបើកសិទ្ធិចម្លងក្តារកៅស៊ូ។",
|
||||
downloaded: "បានទាញយក!",
|
||||
downloadedDescription: "ស្គ្រីបដំឡើងបានទាញយកដោយជោគជ័យ។",
|
||||
failedToCreateAgent: "បរាជ័យក្នុងការបង្កើតការកំណត់រចនាសម្ព័ន្ធភ្នាក់ងារតំបន់។",
|
||||
|
||||
//RegionalAgentCard.tsx
|
||||
defaultBadge: "លំនាំដើម",
|
||||
copyAgentId: "ចម្លងលេខសម្គាល់ភ្នាក់ងារ",
|
||||
removeAgent: "លុបភ្នាក់ងារ",
|
||||
online: "ដំណើរការ",
|
||||
offline: "មិនដំណើរការ",
|
||||
lastUpdated: "ធ្វើបច្ចុប្បន្នភាពចុងក្រោយ:",
|
||||
activeMonitoring: "ការត្រួតពិនិត្យសកម្ម",
|
||||
connectionLost: "បាត់បង់ការតភ្ជាប់",
|
||||
|
||||
};
|
||||
@@ -2,21 +2,199 @@
|
||||
import { ServicesTranslations } from '../types/services';
|
||||
|
||||
export const servicesTranslations: ServicesTranslations = {
|
||||
serviceName: "ឈ្មោះសេវាកម្ម",
|
||||
serviceNameDesc: "បញ្ចូលឈ្មោះពិពណ៌នាសម្រាប់សេវាកម្មរបស់អ្នក",
|
||||
serviceType: "ប្រភេទសេវាកម្ម",
|
||||
serviceStatus: "ស្ថានភាពសេវាកម្ម",
|
||||
responseTime: "ពេលវេលាឆ្លើយតប",
|
||||
uptime: "ពេលវេលាដំណើរការ",
|
||||
lastChecked: "ពិនិត្យចុងក្រោយ",
|
||||
noServices: "មិនមានសេវាកម្មដែលត្រូវនឹងលក្ខណៈវិនិច្ឆ័យរបស់អ្នក។",
|
||||
currentlyMonitoring: "កំពុងតាមដានពេលនេះ",
|
||||
retry: "សាកល្បងម្ដងទៀត",
|
||||
serviceStatus: "ស្ថានភាព",
|
||||
uptime: "រយៈពេលដំណើរការ",
|
||||
lastChecked: "បានពិនិត្យចុងក្រោយ",
|
||||
noServices: "គ្មានសេវាកម្មណាមួយត្រូវនឹងលក្ខណៈវិនិច្ឆ័យតម្រងរបស់អ្នកទេ។",
|
||||
currentlyMonitoring: "កំពុងត្រួតពិនិត្យ",
|
||||
retry: "សាកល្បងម្តងទៀត",
|
||||
overview: "ទិដ្ឋភាពទូទៅ",
|
||||
newService: "សេវាកម្មថ្មី",
|
||||
rowsPerPage: "ចំនួនជួរដេកក្នុងមួយទំព័រ",
|
||||
rowsPerPage: "ជួរដេកក្នុងមួយទំព័រ",
|
||||
search: "ស្វែងរក",
|
||||
allTypes: "គ្រប់ប្រភេទ",
|
||||
createNewService: "បង្កើតសេវាកម្មថ្មី",
|
||||
createNewServiceDesc: "បញ្ចូលព័ត៌មានលម្អិតដើម្បីបង្កើតសេវាកម្មថ្មីដែលត្រូវតាមដាន។",
|
||||
createNewServiceDesc: "បំពេញព័ត៌មានលម្អិតដើម្បីបង្កើតសេវាកម្មថ្មីសម្រាប់ត្រួតពិនិត្យ។",
|
||||
|
||||
// ServiceBasicFields.tsx
|
||||
serviceName: "ឈ្មោះសេវាកម្ម",
|
||||
serviceNameDesc: "បញ្ចូលឈ្មោះដែលពិពណ៌នាអំពីសេវាកម្មរបស់អ្នក",
|
||||
|
||||
// ServiceConfigFields.tsx
|
||||
checkInterval: "ចន្លោះពេលពិនិត្យ",
|
||||
seconds: "វិនាទី",
|
||||
minute: "នាទី",
|
||||
minutes: "នាទី",
|
||||
hour: "ម៉ោង",
|
||||
hours: "ម៉ោង",
|
||||
custom: "ផ្ទាល់ខ្លួន",
|
||||
checkIntervalPlaceholder: "បញ្ចូលចន្លោះពេលជាវិនាទី",
|
||||
backToPresets: "ត្រឡប់ទៅការកំណត់ជាមុន",
|
||||
checkIntervalDesc: "ភាពញឹកញាប់នៃការពិនិត្យស្ថានភាពសេវាកម្ម",
|
||||
checkIntervalDescCustom: "បញ្ចូលចន្លោះពេលផ្ទាល់ខ្លួនជាវិនាទី (អប្បបរមា ១០ វិនាទី)",
|
||||
retryAttempts: "ការព្យាយាមឡើងវិញ",
|
||||
attempt: "ការព្យាយាម",
|
||||
attempts: "ការព្យាយាម",
|
||||
retryAttemptsDesc: "ចំនួនការព្យាយាមឡើងវិញមុននឹងចាត់ទុកថាមិនដំណើរការ",
|
||||
|
||||
// ServiceForm.tsx
|
||||
updateService: "ធ្វើបច្ចុប្បន្នភាពសេវាកម្ម",
|
||||
createService: "បង្កើតសេវាកម្ម",
|
||||
|
||||
// ServiceNotificationFields.tsx
|
||||
enableNotifications: "បើកការជូនដំណឹង",
|
||||
enableNotificationsDesc: "បើក ឬបិទការជូនដំណឹងសម្រាប់សេវាកម្មនេះ",
|
||||
notificationChannels: "បណ្តាញជូនដំណឹង",
|
||||
notificationChannelsEnabledDesc: "ជ្រើសរើសបណ្តាញជូនដំណឹងសម្រាប់សេវាកម្មនេះ",
|
||||
notificationChannelsDesc: "បើកការជូនដំណឹងជាមុនដើម្បីជ្រើសរើសបណ្តាញ",
|
||||
notificationChannelsPlaceholder: "បន្ថែមបណ្តាញជូនដំណឹង",
|
||||
alertTemplate: "ទម្រង់ជូនដំណឹង",
|
||||
alertTemplateLoading: "កំពុងផ្ទុកទម្រង់...",
|
||||
alertTemplatePlaceholder: "ជ្រើសរើសទម onderwerpជូនដំណឹង",
|
||||
alertTemplateEnabledDesc: "ជ្រើសរើសទម្រង់សម្រាប់សារជូនដំណឹង",
|
||||
alertTemplateDesc: "បើកការជូនដំណឹងជាមុនដើម្បីជ្រើសរើសទម្រង់",
|
||||
|
||||
// ServiceTypeField.tsx
|
||||
serviceType: "ប្រភេទ",
|
||||
serviceTypeHTTPDesc: "ត្រួតពិនិត្យគេហទំព័រ និង REST APIs ជាមួយពិធីការ HTTP/HTTPS",
|
||||
serviceTypePINGDesc: "ត្រួតពិនិត្យភាពអាចប្រើបានរបស់ម៉ាស៊ីនជាមួយពិធីការ PING",
|
||||
serviceTypeTCPDesc: "ត្រួតពិនិត្យការតភ្ជាប់ច្រក TCP ជាមួយពិធីការ TCP",
|
||||
serviceTypeDNSDesc: "ត្រួតពិនិត្យការដោះស្រាយ DNS",
|
||||
|
||||
// ServiceRegionalFields.tsx
|
||||
regionalMonitoring: "ការត្រួតពិនិត្យតាមតំបន់",
|
||||
regionalMonitoringDesc: "ចាត់តាំងសេវាកម្មនេះទៅភ្នាក់ងារត្រួតពិនិត្យតាមតំបន់សម្រាប់ការត្រួតពិនិត្យចែកចាយ",
|
||||
regionalAgents: "ភ្នាក់ងារតាមតំបន់",
|
||||
regionalAgentsLoading: "កំពុងផ្ទុកភ្នាក់ងារ...",
|
||||
regionalAgentsAvailablePlaceholder: "ជ្រើសរើសភ្នាក់ងារតាមតំបន់បន្ថែម...",
|
||||
regionalAgentsAllSelected: "បានជ្រើសរើសភ្នាក់ងារទាំងអស់ដែលមាន",
|
||||
regionalAgentsNoAvailable: "គ្មានភ្នាក់ងារតាមតំបន់ដែលអាចប្រើបាន",
|
||||
regionalAgentsNoOnlineAvailable: "គ្មានភ្នាក់ងារតាមតំបន់អនឡាញដែលអាចប្រើបាន",
|
||||
regionalAgentsNotFoundMessage: "រកមិនឃើញភ្នាក់ងារតាមតំបន់អនឡាញទេ។ សេវាកម្មនឹងប្រើការត្រួតពិនិត្យលំនាំដើម។",
|
||||
regionalAgentsNotSelectedMessage: "មិនបានជ្រើសរើសភ្នាក់ងារតាមតំបន់ទេ។ សេវាកម្មនឹងប្រើការត្រួតពិនិត្យលំនាំដើម។",
|
||||
|
||||
// ServiceUrlField.tsx
|
||||
targetDefault: "URL/ម៉ាស៊ីនគោលដៅ",
|
||||
targetDNS: "ឈ្មោះដែន",
|
||||
targetHTTPDesc: "បញ្ចូល URL ពេញលេញរួមទាំងពិធីការ (http:// ឬ https://)",
|
||||
targetPINGDesc: "បញ្ចូលឈ្មោះម៉ាស៊ីន ឬអាសយដ្ឋាន IP ដើម្បី ping",
|
||||
targetTCPDesc: "បញ្ចូលឈ្មោះម៉ាស៊ីន ឬអាសយដ្ឋាន IP សម្រាប់ការធ្វើតេស្តការតភ្ជាប់ TCP",
|
||||
targetTCPPortDesc: "បញ្ចូលលេខច្រកសម្រាប់ការធ្វើតេស្តការតភ្ជាប់ TCP",
|
||||
targetDNSDesc: "បញ្ចូលឈ្មោះដែនសម្រាប់ការត្រួតពិនិត្យកំណត់ត្រា DNS (A, AAAA, MX, ជាដើម)",
|
||||
targetDefaultDesc: "បញ្ចូល URL ឬឈ្មោះម៉ាស៊ីនគោលដៅសម្រាប់ការត្រួតពិនិត្យ",
|
||||
targetDefaultPlaceholder: "បញ្ចូល URL ឬឈ្មោះម៉ាស៊ីន",
|
||||
|
||||
// types.ts
|
||||
serviceNameRequired: "តម្រូវឱ្យមានឈ្មោះសេវាកម្ម",
|
||||
urlDomainHostRequired: "តម្រូវឱ្យមាន URL/ដែន/ម៉ាស៊ីន",
|
||||
enterValidUrlHostnameDomain: "សូមបញ្ចូល URL, ឈ្មោះម៉ាស៊ីន ឬដែនដែលត្រឹមត្រូវ",
|
||||
|
||||
// Dashboard
|
||||
upServices: "សេវាកម្មដំណើរការ",
|
||||
downServices: "សេវាកម្មមិនដំណើរការ",
|
||||
pausedServices: "សេវាកម្មផ្អាក",
|
||||
warningServices: "សេវាកម្មព្រមាន",
|
||||
|
||||
// ServiceRowActions.tsx
|
||||
viewDetail: "មើលលម្អិត",
|
||||
resumeMonitoring: "បន្តការត្រួតពិនិត្យ",
|
||||
pauseMonitoring: "ផ្អាកការត្រួតពិនិត្យ",
|
||||
|
||||
// IncidentTable.tsx
|
||||
responseTime: "ពេលវេលាឆ្លើយតប",
|
||||
errorMessage: "សារកំហុស",
|
||||
details: "លម្អិត",
|
||||
unmuteAlerts: "បើកសំឡេងការជូនដំណឹង",
|
||||
muteAlerts: "បិទសំឡេងការជូនដំណឹង",
|
||||
|
||||
// LastCheckedTime.tsx
|
||||
pausedAt: "ផ្អាកនៅ",
|
||||
lastCheckDetails: "លម្អិតការពិនិត្យចុងក្រោយ",
|
||||
checkedAt: "បានពិនិត្យនៅ",
|
||||
monitoringPaused: "ការត្រួតពិនិត្យត្រូវបានផ្អាក",
|
||||
noAutomaticChecks: "គ្មានការពិនិត្យដោយស្វ័យប្រវត្តិ",
|
||||
|
||||
// ServiveEditDialog.tsx
|
||||
editService: "កែសម្រួលសេវាកម្ម",
|
||||
editServiceDesc: "ធ្វើបច្ចុប្បន្នភាពលម្អិតនៃសេវាកម្មដែលត្រូវបានត្រួតពិនិត្យរបស់អ្នក។",
|
||||
|
||||
// ServiceStatsCards.tsx
|
||||
lastCheckedAt: "បានពិនិត្យចុងក្រោយនៅ {datetime}",
|
||||
avg: "មធ្យម",
|
||||
lastUpChecksCount: "ការពិនិត្យដំណើរការចុងក្រោយ {count} ដង",
|
||||
basedOnlastChecksCount: "ផ្អែកលើការពិនិត្យចុងក្រោយ {count} ដង",
|
||||
totalUptime: "រយៈពេលដំណើរការសរុប",
|
||||
totalDowntime: "រយៈពេលមិនដំណើរការសរុប",
|
||||
monitoringSettings: "ការកំណត់ការត្រួតពិនិត្យ",
|
||||
monitoringSettingsInterval: "បានពិនិត្យរៀងរាល់ {interval} វិនាទី",
|
||||
monitoringSettingsType: "ការត្រួតពិនិត្យ",
|
||||
upStatusDuration: "ដំណើរការអស់រយៈពេល {duration}",
|
||||
downStatusDuration: "មិនដំណើរការអស់រយៈពេល {duration}",
|
||||
|
||||
incidentHistory: "ប្រវត្តិឧប្បត្តិហេតុ",
|
||||
processing: "កំពុងដំណើរការ",
|
||||
back: "ត្រឡប់ក្រោយ",
|
||||
last20Checks: "ការពិនិត្យ ២០ ចុងក្រោយ",
|
||||
|
||||
//OneClickInstallTab.tsx
|
||||
oneClickInstallTitle: "ការដំឡើងតែមួយចុច (ណែនាំ)",
|
||||
oneClickInstallDesc: "ចម្លង និងបិទភ្ជាប់ពាក្យបញ្ជាតែមួយនេះដើម្បីដំឡើងភ្នាក់ងារត្រួតពិនិត្យភ្លាមៗ",
|
||||
quickInstallCommand: "ពាក្យបញ្ជាដំឡើងរហ័ស",
|
||||
copy: "ចម្លង",
|
||||
runCommandOnServer: "គ្រាន់តែដំណើរការពាក្យបញ្ជានេះនៅលើម៉ាស៊ីនមេរបស់អ្នក:",
|
||||
sshIntoServer: "ចូលទៅក្នុងម៉ាស៊ីនមេគោលដៅរបស់អ្នកតាម SSH",
|
||||
pasteAndRun: "បិទភ្ជាប់ និងដំណើរការពាក្យបញ្ជាខាងលើ",
|
||||
agentInstalled: "ភ្នាក់ងារនឹងត្រូវបានដំឡើង និងចាប់ផ្តើមដោយស្វ័យប្រវត្តិ",
|
||||
done: "រួចរាល់",
|
||||
|
||||
// DockerOneClickTab.tsx
|
||||
dockerOneClickTitle: "ការដំឡើង Docker តែមួយចុច",
|
||||
dockerOneClickDesc: "ការដំឡើង Docker Container ដោយស្វ័យប្រវត្តិជាមួយនឹងសមត្ថភាពត្រួតពិនិត្យប្រព័ន្ធ",
|
||||
dockerOneClickCommand: "ពាក្យបញ្ជា Docker តែមួយចុច",
|
||||
dockerScriptWill: "ស្គ្រីបនេះនឹងធ្វើដោយស្វ័យប្រវត្តិ:",
|
||||
dockerScriptStep1: "ទាញយក និងរៀបចំភ្នាក់ងារត្រួតពិនិត្យ Docker",
|
||||
dockerScriptStep2: "កំណត់រចនាសម្ព័ន្ធអថេរបរិស្ថានដែលតម្រូវទាំងអស់",
|
||||
dockerScriptStep3: "ចាប់ផ្តើម Container ជាមួយនឹងការចូលប្រើប្រព័ន្ធត្រឹមត្រូវ",
|
||||
dockerScriptStep4: "រៀបចំការរក្សាទុកទិន្នន័យត្រួតពិនិត្យ",
|
||||
directDockerTitle: "ពាក្យបញ្ជា Docker Run ដោយផ្ទាល់",
|
||||
directDockerDesc: "ប្រសិនបើអ្នកចូលចិត្តដំណើរការ Docker Container ដោយផ្ទាល់ដោយគ្មានស្គ្រីប",
|
||||
dockerRunCommand: "ពាក្យបញ្ជា Docker Run",
|
||||
dockerPrerequisites: "តម្រូវការជាមុនសម្រាប់ការដំណើរការ Docker ដោយផ្ទាល់:",
|
||||
dockerPrereqStep1: "Docker ត្រូវតែត្រូវបានដំឡើង និងដំណើរការ",
|
||||
dockerPrereqStep2: "រូបភាព operacle/checkcle-server-agent ត្រូវតែមាន",
|
||||
dockerPrereqStep3: "ដំណើរការជា root ឬជាមួយសិទ្ធិ sudo",
|
||||
|
||||
// ManualInstallTab.tsx
|
||||
manualInstallTitle: "ជំហានការដំឡើងដោយដៃ",
|
||||
manualInstallDesc: "ដំណើរការដំឡើងជាជំហានៗ",
|
||||
serverName: "ឈ្មោះម៉ាស៊ីនមេ",
|
||||
agentId: "លេខសម្គាល់ភ្នាក់ងារ",
|
||||
osType: "ប្រភេទប្រព័ន្ធប្រតិបត្តិការ",
|
||||
downloadScript: "ទាញយកស្គ្រីបដំឡើង",
|
||||
makeExecutable: "ធ្វើឱ្យស្គ្រីបអាចប្រតិបត្តិបាន",
|
||||
runInstall: "ដំណើរការការដំឡើងជាមួយនឹងការកំណត់រចនាសម្ព័ន្ធរបស់អ្នក",
|
||||
prerequisites: "តម្រូវការជាមុន:",
|
||||
prereqRoot: "ត្រូវប្រាកដថាអ្នកមានសិទ្ធិ root/sudo នៅលើម៉ាស៊ីនមេគោលដៅ",
|
||||
prereqCurl: "ត្រូវប្រាកដថា curl ត្រូវបានដំឡើងសម្រាប់ទាញយកឯកសារ",
|
||||
prereqInternet: "តម្រូវឱ្យមានការតភ្ជាប់អ៊ីនធឺណិតសម្រាប់ទាញយកស្គ្រីប",
|
||||
afterInstall: "បន្ទាប់ពីការដំឡើង:",
|
||||
agentWillStart: "ភ្នាក់ងារនឹងចាប់ផ្តើមដោយស្វ័យប្រវត្តិ និងនឹងបង្ហាញនៅក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នកក្នុងរយៈពេលប៉ុន្មាននាទី។",
|
||||
|
||||
// ServerDetail.tsx
|
||||
errorLoadingServer: "កំហុសក្នុងការផ្ទុកម៉ាស៊ីនមេ",
|
||||
unableToFetchServerData: "មិនអាចទាញយកទិន្នន័យម៉ាីនមេបានទេ។ សូមពិនិត្យការតភ្ជាប់របស់អ្នក ហើយព្យាយាមម្តងទៀត។",
|
||||
backToServers: "ត្រឡប់ទៅម៉ាស៊ីនមេ",
|
||||
loadingServerDetails: "កំពុងផ្ទុកព័ត៌មានលម្អិតម៉ាស៊ីនមេ...",
|
||||
serverDetail: "ព័ត៌មានលម្អិតម៉ាស៊ីនមេ",
|
||||
monitorServerMetrics: "ត្រួតពិនិត្យMetricsប្រសិទ្ធភាពម៉ាស៊ីនមេ និងសុខភាពប្រព័ន្ធ",
|
||||
serverHostnameIpOs: "{hostname} • {ip_address} • {os_type}",
|
||||
|
||||
// ContainerMonitoring.tsx
|
||||
errorLoadingContainers: "កំហុសក្នុងការផ្ទុក Container",
|
||||
unableToFetchContainerData: "មិនអាចទាញយកទិន្នន័យ Container បានទេ?। សូមពិនិត្យការតភ្ជាប់របស់អ្នក ហើយព្យាយាមម្តងទៀត។",
|
||||
errorUnknown: "កំហុសមិនស្គាល់",
|
||||
containerMonitoring: "ការត្រួតពិនិត្យ Container",
|
||||
monitorAndManageContainers: "ត្រួតពិនិត្យ និងគ្រប់គ្រង Docker Container របស់អ្នកក្នុងពេលជាក់ស្តែង",
|
||||
serverIdLabel: "លេខសម្គាល់ម៉ាស៊ីនមេ",
|
||||
|
||||
};
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
import { SettingsTranslations } from '../types/settings';
|
||||
|
||||
export const settingsTranslations: SettingsTranslations = {
|
||||
// Tabs
|
||||
// General Settings - Tabs
|
||||
systemSettings: "ការកំណត់ប្រព័ន្ធ",
|
||||
mailSettings: "ការកំណត់សំបុត្រ",
|
||||
|
||||
// System Settings
|
||||
|
||||
// General Settings - System Settings
|
||||
appName: "ឈ្មោះកម្មវិធី",
|
||||
appURL: "URL កម្មវិធី",
|
||||
senderName: "ឈ្មោះអ្នកផ្ញើ",
|
||||
senderEmail: "អាសយដ្ឋានអ៊ីមែលអ្នកផ្ញើ",
|
||||
hideControls: "លាក់ការគ្រប់គ្រង",
|
||||
|
||||
// Mail Settings
|
||||
|
||||
// General Settings - Mail Settings
|
||||
smtpSettings: "ការកំណត់រចនាសម្ព័ន្ធ SMTP",
|
||||
smtpEnabled: "បើក SMTP",
|
||||
smtpHost: "ម៉ាស៊ីន SMTP",
|
||||
@@ -23,8 +23,8 @@ export const settingsTranslations: SettingsTranslations = {
|
||||
smtpAuthMethod: "វិធីសាស្ត្រផ្ទៀងផ្ទាត់",
|
||||
enableTLS: "បើក TLS",
|
||||
localName: "ឈ្មោះមូលដ្ឋាន",
|
||||
|
||||
// Test Email
|
||||
|
||||
// General Settings - Test Email
|
||||
testEmail: "សាកល្បងអ៊ីមែល",
|
||||
sendTestEmail: "ផ្ញើអ៊ីមែលសាកល្បង",
|
||||
emailTemplate: "គំរូអ៊ីមែល",
|
||||
@@ -37,10 +37,14 @@ export const settingsTranslations: SettingsTranslations = {
|
||||
selectCollection: "ជ្រើសរើសបណ្តុំ",
|
||||
toEmailAddress: "ទៅអាសយដ្ឋានអ៊ីមែល",
|
||||
enterEmailAddress: "បញ្ចូលអាសយដ្ឋានអ៊ីមែល",
|
||||
send: "ផ្ញើ",
|
||||
sending: "កំពុងផ្ញើ...",
|
||||
|
||||
// Actions and status
|
||||
save: "រក្សាទុកការផ្លាស់ប្ដូរ",
|
||||
testEmailSettings: "សាកល្បងការកំណត់អ៊ីមែល",
|
||||
testEmailDescription: "សាកល្បងថាតើការកំណត់អ៊ីមែលបច្ចុប្បន្នអាចប្រើបានឬអត់",
|
||||
testEmailAlert: "នេះនឹងផ្ញើអ៊ីមែលសាកល្បងដោយប្រើការកំណត់ SMTP របស់អ្នក។ សូមប្រាកដថា SMTP ត្រូវបានកំណត់យ៉ាងត្រឹមត្រូវជាមុន។",
|
||||
|
||||
// General Settings - Actions and status
|
||||
save: "រក្សាទុកការផ្លាស់ប្តូរ",
|
||||
saving: "កំពុងរក្សាទុក...",
|
||||
settingsUpdated: "បានធ្វើបច្ចុប្បន្នភាពការកំណត់ដោយជោគជ័យ",
|
||||
errorSavingSettings: "មានបញ្ហាក្នុងការរក្សាទុកការកំណត់",
|
||||
@@ -48,5 +52,114 @@ export const settingsTranslations: SettingsTranslations = {
|
||||
testConnection: "សាកល្បងការតភ្ជាប់",
|
||||
testingConnection: "កំពុងសាកល្បងការតភ្ជាប់...",
|
||||
connectionSuccess: "ការតភ្ជាប់ជោគជ័យ",
|
||||
connectionFailed: "ការតភ្ជាប់បរាជ័យ"
|
||||
connectionFailed: "ការតភ្ជាប់បរាជ័យ",
|
||||
|
||||
// User Management
|
||||
addUser: "បន្ថែមអ្នកប្រើប្រាស់",
|
||||
permissionNotice: "សេចក្តីជូនដំណឹងអំពីការអនុញ្ញាត:",
|
||||
permissionNoticeAddUser: "ក្នុងនាមជាអ្នកប្រើប្រាស់ជាអ្នកគ្រប់គ្រង អ្នកមិនមានសិទ្ធិចូលមើល ឬកែប្រែការកំណត់ប្រព័ន្ធ និងអ៊ីមែលទេ។ ការកំណត់ទាំងនេះអាចចូលប្រើ និងកែប្រែបានដោយអ្នកគ្រប់គ្រងជាន់ខ្ពស់តែប៉ុណ្ណោះ។ សូមទាក់ទងអ្នកគ្រប់គ្រងជាន់ខ្ពស់របស់អ្នក ប្រសិនបើអ្នកត្រូវការធ្វើការផ្លាស់ប្តូរលើការកំណត់ប្រព័ន្ធ ឬការកំណត់អ៊ីមែល។",
|
||||
loadingSettings: "កំពុងផ្ទុកការកំណត់...",
|
||||
loadingSettingsError: "កំហុសក្នុងការផ្ទុកការកំណត់",
|
||||
|
||||
//NotificationSettings.ts
|
||||
titleNotification: "ការកំណត់ការជូនដំណឹង",
|
||||
descriptionChannelsServices: "កំណត់រចនាសម្ព័ន្ធបណ្តាញជូនដំណឹងសម្រាប់សេវាកម្មរបស់អ្នក",
|
||||
addChannel: "បន្ថែមបណ្តាញ",
|
||||
all: "បណ្តាញទាំងអស់",
|
||||
telegram: "តេឡេក្រាម",
|
||||
discord: "Discord",
|
||||
slack: "Slack",
|
||||
signal: "Signal",
|
||||
googleChat: "Google Chat",
|
||||
email: "អ៊ីមែល",
|
||||
webhook: "Webhook",
|
||||
|
||||
// NotificationChannelDialog.tsx
|
||||
editChannel: "កែសម្រួលបណ្តាញជូនដំណឹង",
|
||||
addChannelDialog: "បន្ថែមបណ្តាញជូនដំណឹង",
|
||||
channelName: "ឈ្មោះបណ្តាញ",
|
||||
channelNameDesc: "ឈ្មោះសម្រាប់កំណត់អត្តសញ្ញាណបណ្តាញជូនដំណឹងនេះ",
|
||||
channelType: "ប្រភេទបណ្តាញ",
|
||||
selectType: "ជ្រើសរើសប្រភេទជូនដំណឹង",
|
||||
enabled: "បើក",
|
||||
enabledDesc: "បើក ឬបិទបណ្តាញជូនដំណឹងនេះ",
|
||||
cancel: "បោះបង់",
|
||||
updateChannel: "ធ្វើបច្ចុប្បន្នភាពបណ្តាញ",
|
||||
createChannel: "បង្កើតបណ្តាញ",
|
||||
payloadTemplates: "ទម្រង់បន្ទុក",
|
||||
availablePlaceholders: "កន្លែងទុកជាមុនដែលអាចប្រើបាន៖",
|
||||
server: "ម៉ាស៊ីនបម្រើ",
|
||||
service: "សេវាកម្ម",
|
||||
ssl: "SSL",
|
||||
common: "ទូទៅ",
|
||||
webhookUrl: "URL នៃ Webhook",
|
||||
webhookUrlDesc: "URL ដែលការជូនដំណឹង webhook នឹងត្រូវបានផ្ញើទៅ",
|
||||
payloadTemplate: "ទម្រង់បន្ទុក (ជាជម្រើស)",
|
||||
payloadTemplateDesc: "ទម្រង់ JSON សម្រាប់បន្ទុក webhook។ ទុកចោលទទេដើម្បីប្រើទម្រង់លំនាំដើម។",
|
||||
telegramChatId: "លេខសម្គាល់ជជែក",
|
||||
telegramChatIdDesc: "លេខសម្គាល់ជជែក Telegram ដើម្បីផ្ញើការជូនដំណឹងទៅ",
|
||||
botToken: "លេខសម្គាល់បុត",
|
||||
botTokenDesc: "លេខសម្គាល់បុត Telegram របស់អ្នកពី @BotFather",
|
||||
discordWebhookUrl: "URL នៃ Webhook",
|
||||
discordWebhookUrlDesc: "URL នៃ webhook របស់ Discord ពីការកំណត់ម៉ាស៊ីនបម្រើរបស់អ្នក",
|
||||
slackWebhookUrl: "URL នៃ Webhook",
|
||||
slackWebhookUrlDesc: "URL នៃ webhook ចូលរបស់ Slack",
|
||||
signalNumber: "លេខ Signal",
|
||||
signalNumberDesc: "លេខទូរស័ព្ទ Signal ដើម្បីផ្ញើការជូនដំណឹងទៅ",
|
||||
signalApiEndpoint: "ចំណុចបញ្ចប់ API របស់ Signal",
|
||||
signalApiEndpointDesc: "ចំណុចបញ្ចប់ API សម្រាប់សេវាកម្ម Signal របស់អ្នក",
|
||||
googleChatWebhookUrl: "URL នៃ Webhook របស់ Google Chat",
|
||||
googleChatWebhookUrlDesc: "URL នៃ webhook របស់ Google Chat ពីកន្លែង Google Chat របស់អ្នក",
|
||||
emailAddress: "អាសយដ្ឋានអ៊ីមែល",
|
||||
emailAddressDesc: "អាសយដ្ឋានអ៊ីមែលដើម្បីផ្ញើការជូនដំណឹងទៅ",
|
||||
emailSenderName: "ឈ្មោះអ្នកផ្ញើ",
|
||||
emailSenderNameDesc: "ឈ្មោះបង្ហាញសម្រាប់អ៊ីមែលដែលផ្ញើចេញ",
|
||||
smtpServer: "ម៉ាស៊ីនបម្រើ SMTP",
|
||||
// smtpPort: "ច្រក SMTP",
|
||||
// smtpPassword: "លេខសម្ងាត់ SMTP",
|
||||
smtpPasswordDesc: "លេខសម្ងាត់សម្រាប់ការផ្ទៀងផ្ទាត់ជាមួយម៉ាស៊ីនបម្រើ SMTP",
|
||||
ntfyEndpoint: "ចំណុចបញ្ចប់ NTFY",
|
||||
ntfyEndpointDesc: "URL នៃចំណុចបញ្ចប់ NTFY រួមទាំងប្រធានបទរបស់អ្នក (ឧ. https://ntfy.sh/checkcle)",
|
||||
apiToken: "លេខសម្គាល់ API",
|
||||
apiTokenOptional: "លេខសម្គាល់ API (ជាជម្រើស)",
|
||||
apiTokenDesc: "លេខសម្គាល់ API ជាជម្រើសសម្រាប់ការផ្ទៀងផ្ទាត់ជាមួយម៉ាស៊ីនបម្រើ NTFY",
|
||||
pushoverUserKey: "លេខសម្គាល់អ្នកប្រើប្រាស់",
|
||||
pushoverUserKeyDesc: "លេខសម្គាល់អ្នកប្រើប្រាស់ Pushover របស់អ្នក (ឬលេខសម្គាល់ក្រុម)",
|
||||
notifiarrChannelId: "លេខសម្គាល់បណ្តាញ",
|
||||
notifiarrChannelIdDesc: "លេខសម្គាល់បណ្តាញ Discord ដែលការជូនដំណឹងនឹងត្រូវបានផ្ញើទៅ",
|
||||
gotifyServerUrl: "URL នៃម៉ាស៊ីនបម្រើ",
|
||||
gotifyServerUrlDesc: "URL នៃម៉ាស៊ីនបម្រើ Gotify របស់អ្នក",
|
||||
errorSaveChannel: "បរាជ័យក្នុងការរក្សាទុកបណ្តាញជូនដំណឹង",
|
||||
|
||||
channelNamePlaceholder: "ប៉ុស្តិ៍ផ្ទាល់សារជូនដំណឹងរបស់ខ្ញុំ",
|
||||
telegramChatIdPlaceholder: "ID កុំព្យូទ័រនិមិត្តសារ Telegram",
|
||||
botTokenPlaceholder: "Token Bot Telegram",
|
||||
discordWebhookUrlPlaceholder: "https://discord.com/api/webhooks/...",
|
||||
slackWebhookUrlPlaceholder: "https://hooks.slack.com/services/...",
|
||||
signalNumberPlaceholder: "+1234567890",
|
||||
signalApiEndpointPlaceholder: "https://your-signal-api.com/v2/send",
|
||||
googleChatWebhookUrlPlaceholder: "https://chat.googleapis.com/v1/spaces/...",
|
||||
emailAddressPlaceholder: "notifications@example.com",
|
||||
emailSenderNamePlaceholder: "ប្រព័ន្ធជូនដំណឹងព្រមាន",
|
||||
smtpServerPlaceholder: "smtp.gmail.com",
|
||||
smtpPortPlaceholder: "587",
|
||||
smtpPasswordPlaceholder: "បញ្ចូលពាក្យសម្ងាត់ SMTP របស់អ្នក",
|
||||
ntfyEndpointPlaceholder: "https://ntfy.sh/your-topic",
|
||||
apiTokenPlaceholder: "បញ្ចូល token API",
|
||||
pushoverUserKeyPlaceholder: "កូនសោអ្នកប្រើ Pushover របស់អ្នក",
|
||||
notifiarrChannelIdPlaceholder: "ID ប៉ុស្តិ៍ផ្ទាល់សារ Discord",
|
||||
gotifyServerUrlPlaceholder: "https://your-gotify-server.com",
|
||||
webhookUrlPlaceholder: "https://api.example.com/webhook",
|
||||
|
||||
// DataRetentionSettings.tsx
|
||||
permissionNoticeDataRetention: "ជាអ្នកប្រើប្រាស់អ្នកគ្រប់គ្រង អ្នកមិនមានសិទ្ធចូលដំណើរការការកំណត់រក្សាទុកទិន្នន័យទេ។ ការកំណត់ទាំងនេះអាចត្រូវបានចូលដំណើរការនិងកែប្រែដោយតែអ្នកគ្រប់គ្រងដ៏ខ្ពស់ប៉ុណ្ណោះ។",
|
||||
loadingRetentionSettings: "កំពុងផ្ទុកការកំណត់រក្សាទុក...",
|
||||
dataRetention: "ការកំណត់រក្សាទុកទិន្នន័យ",
|
||||
dataRetentionDescription: "កំណត់រចនាសម្ព័ន្ធពេលវេលាដែលទិន្នន័យត្រួតពិនិត្យត្រូវបានរក្សាទុកនៅក្នុងប្រព័ន្ធ",
|
||||
uptimeRetentionLabel: "ការរក្សាទុកការតាមដានពេលដំណើរការ (ចំនួនថ្ងៃ)",
|
||||
uptimeRetentionHelp: "ទិន្នន័យពេលដំណើរការសេវាកម្ម និងឧប្បត្តិហេតុយូរជាងនេះនឹងត្រូវលុបដោយស្វ័យប្រវត្តិ។",
|
||||
serverRetentionLabel: "ការរក្សាទុកការតាមដានម៉ាស៊ីនមេ (ចំនួនថ្ងៃ)",
|
||||
serverRetentionHelp: "រង្វាស់ម៉ាស៊ីនមេ និងទិន្នន័យដំណើរការដែលយូរជាងនេះនឹងត្រូវលុបដោយស្វ័យប្រវត្តិ។",
|
||||
lastCleanup: "ការសម្អាតស្វ័យប្រវត្តិចុងក្រោយ",
|
||||
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
export interface DockerTranslations {
|
||||
// Tables and headers
|
||||
dockerContainers: string;
|
||||
container: string;
|
||||
status: string;
|
||||
cpuUsage: string;
|
||||
memory: string;
|
||||
disk: string;
|
||||
uptime: string;
|
||||
lastChecked: string;
|
||||
actions: string;
|
||||
searchContainersPlaceholder: string;
|
||||
refresh: string;
|
||||
openMenu: string;
|
||||
viewMetrics: string;
|
||||
viewDetails: string;
|
||||
|
||||
// Status badges and stats
|
||||
running: string;
|
||||
stopped: string;
|
||||
warning: string;
|
||||
unknown: string;
|
||||
totalContainers: string;
|
||||
containersLabel: string;
|
||||
|
||||
// Empty states
|
||||
noContainersFound: string;
|
||||
noContainersRunning: string;
|
||||
tryAdjustSearch: string;
|
||||
startSomeContainers: string;
|
||||
|
||||
// Metrics dialog
|
||||
containerMetricsTitle: string; // e.g., Container Metrics: {name}
|
||||
dockerId: string; // Docker ID
|
||||
loadingMetrics: string;
|
||||
errorLoadingMetrics: string;
|
||||
noMetricsAvailable: string;
|
||||
|
||||
// Time ranges
|
||||
minutes60: string;
|
||||
day1: string;
|
||||
days7: string;
|
||||
month1: string;
|
||||
months3: string;
|
||||
|
||||
// Metric labels
|
||||
used: string;
|
||||
free: string;
|
||||
total: string;
|
||||
usage: string;
|
||||
cpu: string;
|
||||
memoryTitle: string;
|
||||
diskTitle: string;
|
||||
network: string;
|
||||
|
||||
// Charts and series
|
||||
cpuUsagePct: string;
|
||||
cpuUsageVsAvailable: string;
|
||||
cpuAvailablePct: string;
|
||||
ramUsagePct: string;
|
||||
memoryUsageBytes: string;
|
||||
usedMemory: string;
|
||||
totalMemory: string;
|
||||
diskUsagePct: string;
|
||||
diskUsageBytes: string;
|
||||
usedDisk: string;
|
||||
totalDisk: string;
|
||||
networkTraffic: string;
|
||||
networkSpeedKbs: string;
|
||||
rxBytes: string;
|
||||
txBytes: string;
|
||||
rxSpeedKbs: string;
|
||||
txSpeedKbs: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,11 @@ import { MaintenanceTranslations } from './maintenance';
|
||||
import { IncidentTranslations } from './incident';
|
||||
import { SSLTranslations } from './ssl';
|
||||
import { SettingsTranslations } from './settings';
|
||||
import { InstanceTranslations } from './instance';
|
||||
import { OperationTranslations } from './operation';
|
||||
import { RegionTranslations } from './region';
|
||||
import { DockerTranslations } from './docker';
|
||||
import { PublicTranslations } from './public';
|
||||
|
||||
export interface Translations {
|
||||
common: CommonTranslations;
|
||||
@@ -19,4 +24,9 @@ export interface Translations {
|
||||
incident: IncidentTranslations;
|
||||
ssl: SSLTranslations;
|
||||
settings: SettingsTranslations;
|
||||
instance: InstanceTranslations;
|
||||
operation: OperationTranslations;
|
||||
region: RegionTranslations;
|
||||
docker: DockerTranslations;
|
||||
public: PublicTranslations;
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
|
||||
export interface InstanceTranslations {
|
||||
|
||||
// InstanceMonitoring.tsx
|
||||
instanceMonitoring: string;
|
||||
describeMonitorInstance: string;
|
||||
addServerAgent: string;
|
||||
errorLoadingServers: string;
|
||||
unableToFetchServerData: string;
|
||||
retry: string;
|
||||
|
||||
// ServerTable.tsx
|
||||
servers: string;
|
||||
loadingServers: string;
|
||||
searchServersPlaceholder: string;
|
||||
noServersFound: string;
|
||||
name: string;
|
||||
status: string;
|
||||
OS: string;
|
||||
IPAddress: string;
|
||||
CPU: string;
|
||||
memory: string;
|
||||
disk: string;
|
||||
uptime: string;
|
||||
lastChecked: string;
|
||||
actions: string;
|
||||
viewServerDetail: string;
|
||||
containerMonitoring: string;
|
||||
resumeMonitoring: string;
|
||||
pauseMonitoring: string;
|
||||
editServer: string;
|
||||
deleteServer: string;
|
||||
deleteServerConfirmTitle: string;
|
||||
deleteServerConfirmDesc: string;
|
||||
cancel: string;
|
||||
deleting: string;
|
||||
delete: string;
|
||||
serverDeleted: string;
|
||||
serverDeletedDesc: string;
|
||||
error: string;
|
||||
deleteServerError: string;
|
||||
serverPaused: string;
|
||||
serverResumed: string;
|
||||
monitoringPaused: string;
|
||||
monitoringResumed: string;
|
||||
pauseServerError: string;
|
||||
resumeServerError: string;
|
||||
|
||||
// ServerStatsCards.tsx
|
||||
totalServers: string;
|
||||
onlineServers: string;
|
||||
offlineServers: string;
|
||||
warningServers: string;
|
||||
|
||||
// AddServerAgentDialog.tsx
|
||||
addServerMonitoringAgent: string;
|
||||
configureAgentDesc: string;
|
||||
configureAgent: string;
|
||||
oneClickInstall: string;
|
||||
dockerOneClick: string;
|
||||
manualInstallation: string;
|
||||
validationError: string;
|
||||
fillRequiredFields: string;
|
||||
serverAgentCreated: string;
|
||||
serverAgentCreatedDesc: string;
|
||||
failedToCreateAgent: string;
|
||||
|
||||
// ServerAgentConfigForm.tsx
|
||||
serverName: string;
|
||||
serverNamePlaceholder: string;
|
||||
serverNameDesc: string;
|
||||
serverAgentId: string;
|
||||
serverAgentIdDesc: string;
|
||||
operatingSystem: string;
|
||||
checkInterval: string;
|
||||
selectInterval: string;
|
||||
interval30s: string;
|
||||
interval1m: string;
|
||||
interval2m: string;
|
||||
interval5m: string;
|
||||
checkIntervalDesc: string;
|
||||
retryAttempts: string;
|
||||
selectRetryAttempts: string;
|
||||
attempt1: string;
|
||||
attempt2: string;
|
||||
attempt3: string;
|
||||
attempt5: string;
|
||||
retryAttemptsDesc: string;
|
||||
serverToken: string;
|
||||
serverTokenDesc: string;
|
||||
systemUrl: string;
|
||||
systemUrlDesc: string;
|
||||
creatingAgent: string;
|
||||
createServerAgent: string;
|
||||
|
||||
// EditServerDialog.tsx
|
||||
editServerConfiguration: string;
|
||||
serverNameLabel: string;
|
||||
enterServerNamePlaceholder: string;
|
||||
checkIntervalLabel: string;
|
||||
// selectInterval: string;
|
||||
interval10m: string;
|
||||
maxRetriesLabel: string;
|
||||
selectMaxRetries: string;
|
||||
retry1: string;
|
||||
retry2: string;
|
||||
retry3: string;
|
||||
retry5: string;
|
||||
retry10: string;
|
||||
dockerMonitoring: string;
|
||||
enabled: string;
|
||||
disabled: string;
|
||||
enableNotifications: string;
|
||||
notificationSettings: string;
|
||||
notificationChannels: string;
|
||||
loadingChannels: string;
|
||||
noChannelsAvailable: string;
|
||||
selectedChannels: string;
|
||||
serverSetThreshold: string;
|
||||
loadingThresholds: string;
|
||||
selectServerThreshold: string;
|
||||
noThreshold: string;
|
||||
thresholdDetails: string;
|
||||
cpuThresholdPct: string;
|
||||
ramThresholdPct: string;
|
||||
diskThresholdPct: string;
|
||||
networkThresholdPct: string;
|
||||
serverTemplate: string;
|
||||
loadingTemplates: string;
|
||||
selectServerTemplate: string;
|
||||
noTemplate: string;
|
||||
templateDetails: string;
|
||||
ramMessage: string;
|
||||
cpuMessage: string;
|
||||
diskMessage: string;
|
||||
networkMessage: string;
|
||||
upMessage: string;
|
||||
downMessage: string;
|
||||
noMessageDefined: string;
|
||||
serverUpdated: string;
|
||||
serverUpdatedDesc: string;
|
||||
updating: string;
|
||||
updateServer: string;
|
||||
failedToLoadChannels: string;
|
||||
failedToLoadTemplates: string;
|
||||
failedToLoadThresholds: string;
|
||||
warning: string;
|
||||
serverUpdatedButThresholdFailed: string;
|
||||
failedToUpdateServer: string;
|
||||
|
||||
// ServerHistoryCharts.tsx
|
||||
historicalPerformance: string;
|
||||
loading: string;
|
||||
errorLoadingChartData: string;
|
||||
noHistoricalData: string;
|
||||
rawMetricsCount: string;
|
||||
serverIdTimeRange: string;
|
||||
dataExistsOutsideRange: string;
|
||||
noMetricsDataFound: string;
|
||||
dataPointsTimeRange: string;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
|
||||
export interface OperationTranslations {
|
||||
|
||||
// OperationalPageContent.tsx
|
||||
failedToLoadOperationalPages: string;
|
||||
loadingoperationalPages: string;
|
||||
tryagain: string;
|
||||
operationalPages: string;
|
||||
describeOperation: string;
|
||||
refresh: string;
|
||||
noOperationalPagesFound: string;
|
||||
createYourFirstOperationalPage: string;
|
||||
totalPages: string;
|
||||
publicPages: string;
|
||||
operational: string;
|
||||
deleteOperationalPage: string;
|
||||
deleteOperationalPageConfirm: string;
|
||||
cancel: string;
|
||||
delete: string;
|
||||
deleting: string;
|
||||
|
||||
// editOperationalPageDialog.tsx
|
||||
editOperationalPage: string;
|
||||
updateYourOperationalPage: string;
|
||||
title: string;
|
||||
myServiceStatusPlaceholder: string;
|
||||
slug: string;
|
||||
myServiceStatusSlugPlaceholder: string;
|
||||
description: string;
|
||||
operationalPageDescriptionPlaceholder: string;
|
||||
theme: string;
|
||||
selectTheme: string;
|
||||
themeDefault: string;
|
||||
themeDark: string;
|
||||
themeLight: string;
|
||||
status: string;
|
||||
selectStatus: string;
|
||||
statusOperational: string;
|
||||
statusDegraded: string;
|
||||
statusMaintenance: string;
|
||||
statusMajorOutage: string;
|
||||
publicPage: string;
|
||||
makePagePublic: string;
|
||||
customDomainOptional: string;
|
||||
customDomainPlaceholder: string;
|
||||
customDomainDescription: string;
|
||||
cancelUpdate: string;
|
||||
updating: string;
|
||||
updatePage: string;
|
||||
|
||||
// ComponentsSelector.tsx
|
||||
statusPageComponents: string;
|
||||
addMonitoringComponentsDesc: string;
|
||||
selectedComponents: string;
|
||||
service: string;
|
||||
server: string;
|
||||
addComponent: string;
|
||||
componentName: string;
|
||||
componentNamePlaceholder: string;
|
||||
displayOrder: string;
|
||||
descriptionOptional: string;
|
||||
descriptionPlaceholder: string;
|
||||
uptimeServiceOptional: string;
|
||||
selectUptimeService: string;
|
||||
serverIdOptional: string;
|
||||
serverIdPlaceholder: string;
|
||||
cancelComponent : string;
|
||||
|
||||
// OperationalPageCard.tsx
|
||||
public: string;
|
||||
yes: string;
|
||||
no: string;
|
||||
updated: string;
|
||||
view: string;
|
||||
edit: string;
|
||||
|
||||
// CreateOperationalPageDialog.tsx
|
||||
createOperationalPage: string;
|
||||
createOperationalPageDesc: string;
|
||||
createPage: string;
|
||||
creating: string;
|
||||
initialStatus: string;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
export interface PublicTranslations {
|
||||
// CurrentStatusSection
|
||||
systemStatus: string;
|
||||
allOperational: string;
|
||||
degradedPerformance: string;
|
||||
underMaintenance: string;
|
||||
majorOutage: string;
|
||||
statusUnknown: string;
|
||||
autoUpdatedByHealth: string;
|
||||
lastUpdatedAt: string; // e.g., Last updated: {time} UTC
|
||||
liveStatusMonitoring: string;
|
||||
|
||||
// PublicStatusPage generic
|
||||
loadingStatusPage: string;
|
||||
fetchingRealtimeStatus: string;
|
||||
slugLabel: string; // Slug
|
||||
statusPageNotFound: string;
|
||||
notFoundDescription: string;
|
||||
goBack: string;
|
||||
retry: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
export interface RegionTranslations {
|
||||
|
||||
// RegionalMonitoringContent.tsx
|
||||
regionalmonitoring: string;
|
||||
descriptRegionPage: string;
|
||||
addRegionalAgent: string;
|
||||
totalAgents: string;
|
||||
regionalMonitoringAgents: string;
|
||||
onlineAgents: string;
|
||||
currentlyConnected: string;
|
||||
offlineAgents: string;
|
||||
disconnectedAgents: string;
|
||||
regionalAgents: string;
|
||||
noRegionalAgents: string;
|
||||
getStartedAddAgent: string;
|
||||
addFirstAgent: string;
|
||||
agentRemoved: string;
|
||||
agentRemovedDesc: string;
|
||||
regionalAgentAdded: string;
|
||||
regionalAgentAddedDesc: string;
|
||||
error: string;
|
||||
failedToRemoveAgent: string;
|
||||
|
||||
// AddRegionalAgentDialog.tsx
|
||||
addRegionalMonitoringAgent: string;
|
||||
deployRegionalMonitoringAgent: string;
|
||||
regionName: string;
|
||||
regionNamePlaceholder: string;
|
||||
agentServerIpAddress: string;
|
||||
agentIpPlaceholder: string;
|
||||
cancel: string;
|
||||
generateInstallation: string;
|
||||
generating: string;
|
||||
agentConfigurationReady: string;
|
||||
oneClickInstallScriptGenerated: string;
|
||||
oneClickInstallTab: string;
|
||||
agentDetailsTab: string;
|
||||
manualInstallTab: string;
|
||||
oneClickAutomaticInstallation: string;
|
||||
completeInstallationDescription: string;
|
||||
whatThisScriptDoes: string;
|
||||
scriptActionDownload: string;
|
||||
scriptActionInstall: string;
|
||||
scriptActionConfigure: string;
|
||||
scriptActionStart: string;
|
||||
scriptActionHealthChecks: string;
|
||||
runCommandOnServer: string;
|
||||
downloadCompleteScript: string;
|
||||
copyFullScript: string;
|
||||
localDevelopmentNotice: string;
|
||||
generatedAgentConfiguration: string;
|
||||
autoConfiguredDuringInstallation: string;
|
||||
agentId: string;
|
||||
regionNameDetail: string;
|
||||
serverIp: string;
|
||||
apiEndpoint: string;
|
||||
authenticationToken: string;
|
||||
configurationFileLocation: string;
|
||||
manualInstallationSteps: string;
|
||||
stepByStepManualInstallation: string;
|
||||
step1DownloadPackage: string;
|
||||
downloadAmd64Notice: string;
|
||||
downloadArm64Notice: string;
|
||||
step2InstallPackage: string;
|
||||
step3ConfigureAgent: string;
|
||||
copySampleConfiguration: string;
|
||||
addConfigurationValues: string;
|
||||
step4StartService: string;
|
||||
step5VerifyInstallation: string;
|
||||
addAnotherAgent: string;
|
||||
completeSetup: string;
|
||||
copied: string;
|
||||
copiedDescription: string;
|
||||
copyFailed: string;
|
||||
copyFailedDescription: string;
|
||||
copyFailedLocalhost: string;
|
||||
copyFailedChrome: string;
|
||||
downloaded: string;
|
||||
downloadedDescription: string;
|
||||
failedToCreateAgent: string;
|
||||
|
||||
// RegionalAgentCard.tsx
|
||||
defaultBadge: string;
|
||||
copyAgentId: string;
|
||||
removeAgent: string;
|
||||
online: string;
|
||||
offline: string;
|
||||
lastUpdated: string;
|
||||
activeMonitoring: string;
|
||||
connectionLost: string;
|
||||
}
|
||||
@@ -134,4 +134,67 @@ export interface ServicesTranslations {
|
||||
processing: string;
|
||||
back: string;
|
||||
last20Checks: string;
|
||||
|
||||
// OneClickInstallTab.tsx
|
||||
oneClickInstallTitle: string;
|
||||
oneClickInstallDesc: string;
|
||||
quickInstallCommand: string;
|
||||
copy: string;
|
||||
runCommandOnServer: string;
|
||||
sshIntoServer: string;
|
||||
pasteAndRun: string;
|
||||
agentInstalled: string;
|
||||
done: string;
|
||||
|
||||
// DockerOneClickTab.tsx
|
||||
dockerOneClickTitle: string;
|
||||
dockerOneClickDesc: string;
|
||||
dockerOneClickCommand: string;
|
||||
dockerScriptWill: string;
|
||||
dockerScriptStep1: string;
|
||||
dockerScriptStep2: string;
|
||||
dockerScriptStep3: string;
|
||||
dockerScriptStep4: string;
|
||||
directDockerTitle: string;
|
||||
directDockerDesc: string;
|
||||
dockerRunCommand: string;
|
||||
dockerPrerequisites: string;
|
||||
dockerPrereqStep1: string;
|
||||
dockerPrereqStep2: string;
|
||||
dockerPrereqStep3: string;
|
||||
|
||||
// ManualInstallTab.tsx
|
||||
manualInstallTitle: string;
|
||||
manualInstallDesc: string;
|
||||
serverName: string;
|
||||
agentId: string;
|
||||
osType: string;
|
||||
downloadScript: string;
|
||||
makeExecutable: string;
|
||||
runInstall: string;
|
||||
prerequisites: string;
|
||||
prereqRoot: string;
|
||||
prereqCurl: string;
|
||||
prereqInternet: string;
|
||||
afterInstall: string;
|
||||
agentWillStart: string;
|
||||
|
||||
// ServerDetail.tsx
|
||||
errorLoadingServer: string;
|
||||
unableToFetchServerData: string;
|
||||
backToServers: string;
|
||||
loadingServerDetails: string;
|
||||
serverDetail: string;
|
||||
monitorServerMetrics: string;
|
||||
serverHostnameIpOs: string;
|
||||
|
||||
// ContainerMonitoring.tsx
|
||||
errorLoadingContainers: string;
|
||||
unableToFetchContainerData: string;
|
||||
errorUnknown: string;
|
||||
containerMonitoring: string;
|
||||
monitorAndManageContainers: string;
|
||||
serverIdLabel: string;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -58,4 +58,107 @@ export interface SettingsTranslations {
|
||||
permissionNoticeAddUser: string;
|
||||
loadingSettings: string;
|
||||
loadingSettingsError: string;
|
||||
|
||||
//NotificationSettings.ts
|
||||
titleNotification: string;
|
||||
descriptionChannelsServices: string;
|
||||
addChannel: string;
|
||||
all: string;
|
||||
telegram: string;
|
||||
discord: string;
|
||||
slack: string;
|
||||
signal: string;
|
||||
googleChat: string;
|
||||
email: string;
|
||||
webhook: string;
|
||||
|
||||
// NotificationChannelDialog.tsx
|
||||
editChannel: string;
|
||||
addChannelDialog: string;
|
||||
channelName: string;
|
||||
channelNameDesc: string;
|
||||
channelType: string;
|
||||
selectType: string;
|
||||
enabled: string;
|
||||
enabledDesc: string;
|
||||
cancel: string;
|
||||
updateChannel: string;
|
||||
createChannel: string;
|
||||
payloadTemplates: string;
|
||||
availablePlaceholders: string;
|
||||
server: string;
|
||||
service: string;
|
||||
ssl: string;
|
||||
common: string;
|
||||
webhookUrl: string;
|
||||
webhookUrlDesc: string;
|
||||
payloadTemplate: string;
|
||||
payloadTemplateDesc: string;
|
||||
telegramChatId: string;
|
||||
telegramChatIdDesc: string;
|
||||
botToken: string;
|
||||
botTokenDesc: string;
|
||||
discordWebhookUrl: string;
|
||||
discordWebhookUrlDesc: string;
|
||||
slackWebhookUrl: string;
|
||||
slackWebhookUrlDesc: string;
|
||||
signalNumber: string;
|
||||
signalNumberDesc: string;
|
||||
signalApiEndpoint: string;
|
||||
signalApiEndpointDesc: string;
|
||||
googleChatWebhookUrl: string;
|
||||
googleChatWebhookUrlDesc: string;
|
||||
emailAddress: string;
|
||||
emailAddressDesc: string;
|
||||
emailSenderName: string;
|
||||
emailSenderNameDesc: string;
|
||||
smtpServer: string;
|
||||
// smtpPort: string;
|
||||
// smtpPassword: string;
|
||||
smtpPasswordDesc: string;
|
||||
ntfyEndpoint: string;
|
||||
ntfyEndpointDesc: string;
|
||||
apiToken: string;
|
||||
apiTokenOptional: string;
|
||||
apiTokenDesc: string;
|
||||
pushoverUserKey: string;
|
||||
pushoverUserKeyDesc: string;
|
||||
notifiarrChannelId: string;
|
||||
notifiarrChannelIdDesc: string;
|
||||
gotifyServerUrl: string;
|
||||
gotifyServerUrlDesc: string;
|
||||
errorSaveChannel: string;
|
||||
|
||||
channelNamePlaceholder: string;
|
||||
telegramChatIdPlaceholder: string;
|
||||
botTokenPlaceholder: string;
|
||||
discordWebhookUrlPlaceholder: string;
|
||||
slackWebhookUrlPlaceholder: string;
|
||||
signalNumberPlaceholder: string;
|
||||
signalApiEndpointPlaceholder: string;
|
||||
googleChatWebhookUrlPlaceholder: string;
|
||||
emailAddressPlaceholder: string;
|
||||
emailSenderNamePlaceholder: string;
|
||||
smtpServerPlaceholder: string;
|
||||
smtpPortPlaceholder: string;
|
||||
smtpPasswordPlaceholder: string;
|
||||
ntfyEndpointPlaceholder: string;
|
||||
apiTokenPlaceholder: string;
|
||||
pushoverUserKeyPlaceholder: string;
|
||||
notifiarrChannelIdPlaceholder: string;
|
||||
gotifyServerUrlPlaceholder: string;
|
||||
webhookUrlPlaceholder: string;
|
||||
|
||||
// DataRetentionSettings.tsx
|
||||
// permissionNotice: string;
|
||||
permissionNoticeDataRetention: string;
|
||||
loadingRetentionSettings: string;
|
||||
dataRetention: string;
|
||||
dataRetentionDescription: string;
|
||||
uptimeRetentionLabel: string;
|
||||
uptimeRetentionHelp: string;
|
||||
serverRetentionLabel: string;
|
||||
serverRetentionHelp: string;
|
||||
lastCleanup: string;
|
||||
// save: string;
|
||||
}
|
||||
Reference in New Issue
Block a user