- 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:
1 parent
25f2828a15
commit
449a75eb2c
4 files changed
+20
-13
No files matched your search
@@ -27,22 +27,14 @@ import { useTranslation } from "react-i18next";
|
|||||||
* @returns {JSX.Element} The rendered Filter component.
|
* @returns {JSX.Element} The rendered Filter component.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const typeOptions = [
|
const getTypeOptions = () => [
|
||||||
{ value: "http", label: "HTTP(S)" },
|
{ value: "http", label: "HTTP(S)" },
|
||||||
{ value: "ping", label: "Ping" },
|
{ value: "ping", label: "Ping" },
|
||||||
{ value: "docker", label: "Docker" },
|
{ value: "docker", label: "Docker" },
|
||||||
{ value: "port", label: "Port" },
|
{ value: "port", label: "Port" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const statusOptions = [
|
// These functions were moved inline to ensure translations are applied correctly
|
||||||
{ value: "Up", label: "Up" },
|
|
||||||
{ value: "Down", label: "Down" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const stateOptions = [
|
|
||||||
{ value: "Active", label: "Active" },
|
|
||||||
{ value: "Paused", label: "Paused" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const Filter = ({
|
const Filter = ({
|
||||||
selectedTypes,
|
selectedTypes,
|
||||||
@@ -58,6 +50,18 @@ const Filter = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
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 handleTypeChange = (event) => {
|
||||||
const selectedValues = event.target.value;
|
const selectedValues = event.target.value;
|
||||||
setSelectedTypes(selectedValues.length > 0 ? selectedValues : undefined);
|
setSelectedTypes(selectedValues.length > 0 ? selectedValues : undefined);
|
||||||
|
|||||||
@@ -459,7 +459,8 @@
|
|||||||
},
|
},
|
||||||
"monitorState": {
|
"monitorState": {
|
||||||
"paused": "paused",
|
"paused": "paused",
|
||||||
"resumed": "resumed"
|
"resumed": "resumed",
|
||||||
|
"active": "active"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"uptime": "Uptime",
|
"uptime": "Uptime",
|
||||||
|
|||||||
@@ -424,7 +424,8 @@
|
|||||||
},
|
},
|
||||||
"monitorState": {
|
"monitorState": {
|
||||||
"paused": "приостановлен",
|
"paused": "приостановлен",
|
||||||
"resumed": "возобновлен"
|
"resumed": "возобновлен",
|
||||||
|
"active": "активный"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"uptime": "Аптайм",
|
"uptime": "Аптайм",
|
||||||
|
|||||||
@@ -447,7 +447,8 @@
|
|||||||
},
|
},
|
||||||
"monitorState": {
|
"monitorState": {
|
||||||
"paused": "duraklatıldı",
|
"paused": "duraklatıldı",
|
||||||
"resumed": "devam ettirildi"
|
"resumed": "devam ettirildi",
|
||||||
|
"active": "aktif"
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
"uptime": "Çalışma Süresi",
|
"uptime": "Çalışma Süresi",
|
||||||
|
|||||||
Reference in new issue
Block a user