mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-16 14:49:48 -06:00
- Added translations for Status filter options (Up/Down) using monitorStatus keys
- Added translations for State filter options (Active/Paused) using monitorState keys
This commit is contained in:
@@ -27,22 +27,14 @@ import { useTranslation } from "react-i18next";
|
||||
* @returns {JSX.Element} The rendered Filter component.
|
||||
*/
|
||||
|
||||
const typeOptions = [
|
||||
const getTypeOptions = () => [
|
||||
{ value: "http", label: "HTTP(S)" },
|
||||
{ value: "ping", label: "Ping" },
|
||||
{ value: "docker", label: "Docker" },
|
||||
{ value: "port", label: "Port" },
|
||||
];
|
||||
|
||||
const statusOptions = [
|
||||
{ value: "Up", label: "Up" },
|
||||
{ value: "Down", label: "Down" },
|
||||
];
|
||||
|
||||
const stateOptions = [
|
||||
{ value: "Active", label: "Active" },
|
||||
{ value: "Paused", label: "Paused" },
|
||||
];
|
||||
// These functions were moved inline to ensure translations are applied correctly
|
||||
|
||||
const Filter = ({
|
||||
selectedTypes,
|
||||
@@ -58,6 +50,18 @@ const Filter = ({
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const typeOptions = getTypeOptions();
|
||||
// Create status options with translations
|
||||
const statusOptions = [
|
||||
{ value: "Up", label: t("monitorStatus.up") },
|
||||
{ value: "Down", label: t("monitorStatus.down") },
|
||||
];
|
||||
// Create state options with translations
|
||||
const stateOptions = [
|
||||
{ value: "Active", label: t("monitorState.active") },
|
||||
{ value: "Paused", label: t("monitorState.paused") },
|
||||
];
|
||||
|
||||
const handleTypeChange = (event) => {
|
||||
const selectedValues = event.target.value;
|
||||
setSelectedTypes(selectedValues.length > 0 ? selectedValues : undefined);
|
||||
|
||||
@@ -459,7 +459,8 @@
|
||||
},
|
||||
"monitorState": {
|
||||
"paused": "paused",
|
||||
"resumed": "resumed"
|
||||
"resumed": "resumed",
|
||||
"active": "active"
|
||||
},
|
||||
"menu": {
|
||||
"uptime": "Uptime",
|
||||
|
||||
@@ -424,7 +424,8 @@
|
||||
},
|
||||
"monitorState": {
|
||||
"paused": "приостановлен",
|
||||
"resumed": "возобновлен"
|
||||
"resumed": "возобновлен",
|
||||
"active": "активный"
|
||||
},
|
||||
"menu": {
|
||||
"uptime": "Аптайм",
|
||||
|
||||
@@ -447,7 +447,8 @@
|
||||
},
|
||||
"monitorState": {
|
||||
"paused": "duraklatıldı",
|
||||
"resumed": "devam ettirildi"
|
||||
"resumed": "devam ettirildi",
|
||||
"active": "aktif"
|
||||
},
|
||||
"menu": {
|
||||
"uptime": "Çalışma Süresi",
|
||||
|
||||
Reference in New Issue
Block a user