Compare commits
1 Commits
3fbafbbcc7
...
bugfix/das
| Author | SHA1 | Date | |
|---|---|---|---|
| 71ce2a9f91 |
@@ -53,7 +53,7 @@ const RegionSelector = ({
|
||||
const getMagnificationLevel = () => {
|
||||
const test = socket.data;
|
||||
if (!socket.data) return null;
|
||||
|
||||
console.log(test);
|
||||
if (!test || !test.magnificationLevel) return "1x";
|
||||
return test?.magnificationLevel;
|
||||
};
|
||||
@@ -108,12 +108,12 @@ const RegionSelector = ({
|
||||
|
||||
const handleSaveclick = () => {
|
||||
const regions: ColourData[] = [];
|
||||
const test = Array.from(paintedCells.entries());
|
||||
const region1 = test.filter(([, cell]) => cell.region.name === "Bay 1");
|
||||
const region2 = test.filter(([, cell]) => cell.region.name === "Bay 2");
|
||||
const region3 = test.filter(([, cell]) => cell.region.name === "Bay 3");
|
||||
const region4 = test.filter(([, cell]) => cell.region.name === "Bay 4");
|
||||
const region5 = test.filter(([, cell]) => cell.region.name === "Bay 5");
|
||||
const paintedCellsArray = Array.from(paintedCells.entries());
|
||||
const region1 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 1");
|
||||
const region2 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 2");
|
||||
const region3 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 3");
|
||||
const region4 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 4");
|
||||
const region5 = paintedCellsArray.filter(([, cell]) => cell.region.name === "Bay 5");
|
||||
const region1Data = {
|
||||
id: 1,
|
||||
cells: region1.map(([key]) => [parseInt(key.split("-")[1]), parseInt(key.split("-")[0])]),
|
||||
|
||||
@@ -11,10 +11,14 @@ type CameraStatusProps = {
|
||||
};
|
||||
|
||||
const CameraStatus = ({ title, category, isError }: CameraStatusProps) => {
|
||||
const isAllGood = category && category.length > 0 && category.every((status) => status.tags.includes("RUNNING"));
|
||||
// check if some are down
|
||||
// check if all are down
|
||||
//check if offline
|
||||
const isAllGood =
|
||||
category &&
|
||||
category.length > 0 &&
|
||||
category.every((status) => {
|
||||
const allowedTags = ["RUNNING", "VIDEO-PLAYING"];
|
||||
return status.tags.every((tag) => allowedTags.includes(tag));
|
||||
});
|
||||
|
||||
return (
|
||||
<Card className="p-4">
|
||||
<div className="border-b border-gray-600">
|
||||
|
||||
@@ -10,7 +10,10 @@ type CameraStatusGridItemProps = {
|
||||
|
||||
const CameraStatusGridItem = ({ title, statusCategory }: CameraStatusGridItemProps) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const isAllGood = statusCategory?.every((status) => status.tags.includes("RUNNING"));
|
||||
const isAllGood = statusCategory?.every((status) => {
|
||||
const allowedTags = ["RUNNING", "VIDEO-PLAYING"];
|
||||
return status.tags.every((tag) => allowedTags.includes(tag));
|
||||
});
|
||||
|
||||
const handleClick = () => {
|
||||
setIsOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user