tab name changes, aypos button, removed area related tabs

This commit is contained in:
2025-07-28 23:34:22 +03:00
parent 5c2ea1c427
commit 5fa787e054
12 changed files with 54 additions and 192 deletions

View File

@@ -33,7 +33,7 @@ const DataCenter = () => {
minWidth: "100px",
},
{
name: "Data Center",
name: "Data Centers",
selector: (row) => row.dataCenter,
sortable: true,
minWidth: "200px",

View File

@@ -30,7 +30,6 @@ import { default as SweetAlert } from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import { getDataCenters, createDataCenter, updateDataCenter, deleteDataCenter } from "../redux/actions/dataCenter";
import { useTranslation } from "react-i18next";
import { getAreas } from "../redux/actions/areas";
import { getSectors, getSectorById, getSubSectorById, getConsuptionUnits } from "../redux/actions/datas";
import { getAllEmissionSources } from "../redux/actions/emissionSources";
import { permissionCheck } from "../components/permission-check";
@@ -105,7 +104,6 @@ const DataCenterManagement = () => {
name: "",
externalId: "",
number: "",
areaId: null,
address: "",
latitude: null,
longitude: null,
@@ -122,10 +120,8 @@ const DataCenterManagement = () => {
const [mapPosition, setMapPosition] = useState(null);
const dataCenterStore = useSelector((state) => state.dataCenter);
const areasStore = useSelector((state) => state.areas);
const datasStore = useSelector((state) => state.datas);
const emissionSourceStore = useSelector((state) => state.emissionSources);
const [areasOptions, setAreasOptions] = useState([]);
const [sectorsOptions, setSectorsOptions] = useState([]);
const [subSectorsOptions, setSubSectorsOptions] = useState([]);
const [emissionSourcesOptions, setEmissionSourcesOptions] = useState([]);
@@ -154,14 +150,7 @@ const DataCenterManagement = () => {
minWidth: "200px",
},
{
name: t("DataCenter.city"),
selector: (row) => row.area?.cityNames,
sortable: true,
minWidth: "150px",
cell: (row) => <span>{row.area?.cityNames || "-"}</span>,
},
{
name: "AYPOS",
name: "Dashboard",
selector: (row) => row.ayposURL,
sortable: false,
minWidth: "150px",
@@ -173,7 +162,7 @@ const DataCenterManagement = () => {
size="sm"
onClick={() => window.open(row.ayposURL, '_blank')}
>
AYPOS
Dashboard
</Button>
) : (
<span>-</span>
@@ -225,19 +214,9 @@ const DataCenterManagement = () => {
useEffect(() => {
dispatch(getDataCenters());
dispatch(getAreas());
dispatch(getSectors());
}, [dispatch]);
useEffect(() => {
setAreasOptions(
areasStore?.areas?.map((area) => ({
value: area?.id,
label: area?.tag,
}))
);
}, [areasStore]);
useEffect(() => {
setSectorsOptions(
datasStore?.sectors?.map((sector) => ({
@@ -334,7 +313,6 @@ const DataCenterManagement = () => {
name: row.dataCenter,
externalId: row.externalId,
number: row.number,
areaId: row.area?.id,
address: row.address,
latitude: row.latitude,
longitude: row.longitude,
@@ -432,7 +410,6 @@ const DataCenterManagement = () => {
name: "",
externalId: "",
number: "",
areaId: null,
address: "",
latitude: null,
longitude: null,
@@ -638,28 +615,6 @@ const DataCenterManagement = () => {
/>
</FormGroup>
</Col>
<Col sm="12">
<FormGroup>
<Label for="area">{t("DataCenter.area")}</Label>
<Select
id="area"
name="area"
placeholder={t("DataCenter.selectArea")}
options={areasOptions}
value={areasOptions?.find(
(option) => option.value === selectedDataCenter.areaId
)}
onChange={(option) =>
setSelectedDataCenter({
...selectedDataCenter,
areaId: option?.value,
})
}
isClearable
filterOption={customFilterForSelect}
/>
</FormGroup>
</Col>
<Col sm="12">
<FormGroup>
<Label for="address">{t("DataCenter.address")}</Label>

View File

@@ -701,7 +701,7 @@ const Graphics = () => {
<div style={{ marginTop: "2%", marginBottom: "2%" }}>
<Card>
<CardHeader className="border-bottom">
<CardTitle tag="h4">Grafikler</CardTitle>
<CardTitle tag="h4">Reports</CardTitle>
<Button
className="ml-2"
color="primary"

View File

@@ -642,16 +642,13 @@ const Map = () => {
</p>
)}
{dc.ayposURL && (
<div className="mt-2">
<Button
color="primary"
size="sm"
className="w-100"
onClick={() => window.open(dc.ayposURL, '_blank')}
>
AYPOS
</Button>
</div>
<Button
className="w-100 mb-1"
color="primary"
onClick={() => window.open(dc.ayposURL, '_blank')}
>
Dashboard
</Button>
)}
</div>
</Popup>