modified tsconfig.app.json file to deal with errors i was getting, also made changes to the tabs on the devices page and moved group stuff out of the router and into the device page file
This commit is contained in:
parent
bc8b0a3405
commit
0ec54b2d31
4 changed files with 16 additions and 26 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -4220,7 +4220,7 @@
|
||||||
},
|
},
|
||||||
"node_modules/protobuf-ts": {
|
"node_modules/protobuf-ts": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#8c31044c11d0b97c40a253cc917a333f33c3cdf4",
|
"resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#7fa04da5ae9ec99cf1caa6971ca1541fe44f10c4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"protobufjs": "^6.8.8"
|
"protobufjs": "^6.8.8"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@ import Header from "app/Header";
|
||||||
import Logout from "pages/Logout";
|
import Logout from "pages/Logout";
|
||||||
import Devices from "pages/Devices";
|
import Devices from "pages/Devices";
|
||||||
import DevicePage from "pages/Device";
|
import DevicePage from "pages/Device";
|
||||||
import { Groups } from "@mui/icons-material";
|
|
||||||
import GroupsPage from "pages/Groups";
|
import GroupsPage from "pages/Groups";
|
||||||
import { Group } from "models";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean,
|
open: boolean,
|
||||||
|
|
@ -34,7 +32,6 @@ export default function Router(props: Props) {
|
||||||
const {open, onOpen, onClose, toggleTheme } = props;
|
const {open, onOpen, onClose, toggleTheme } = props;
|
||||||
const { isAuthenticated, loginWithRedirect, isLoading } = useAuth0();
|
const { isAuthenticated, loginWithRedirect, isLoading } = useAuth0();
|
||||||
const isMobile = useMobile();
|
const isMobile = useMobile();
|
||||||
const [groups, setGroups] = useState<Group[]>([]);
|
|
||||||
|
|
||||||
const RelativeRoutes = () => {
|
const RelativeRoutes = () => {
|
||||||
console.log("relative route")
|
console.log("relative route")
|
||||||
|
|
@ -76,7 +73,7 @@ export default function Router(props: Props) {
|
||||||
<Route
|
<Route
|
||||||
key="Devices page route"
|
key="Devices page route"
|
||||||
path="" // "/settings/basic"
|
path="" // "/settings/basic"
|
||||||
element={<Devices groups={groups} setGroups={setGroups} key={"Devices page"} />}
|
element={<Devices key={"Devices page"} />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/:deviceID" // "/settings/basic"
|
path="/:deviceID" // "/settings/basic"
|
||||||
|
|
@ -91,10 +88,6 @@ export default function Router(props: Props) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(groups)
|
|
||||||
}, [groups])
|
|
||||||
|
|
||||||
const GroupsRoute = () => {
|
const GroupsRoute = () => {
|
||||||
console.log("groups route")
|
console.log("groups route")
|
||||||
console.log(window.location.pathname)
|
console.log(window.location.pathname)
|
||||||
|
|
@ -108,7 +101,7 @@ export default function Router(props: Props) {
|
||||||
<Route
|
<Route
|
||||||
key="Devices page route"
|
key="Devices page route"
|
||||||
path="/:groupID/devices/"
|
path="/:groupID/devices/"
|
||||||
element={<Devices groups={groups} setGroups={setGroups} key={"Devices page"}/>}
|
element={<Devices key={"Devices page"}/>}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/:groupID/devices/:deviceID"
|
path="/:groupID/devices/:deviceID"
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,8 @@ const useStyles = makeStyles((theme: Theme) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
interface Props {
|
export default function Devices() {
|
||||||
groups: Group[];
|
const [groups, setGroups] = useState<Group[]>([]);
|
||||||
setGroups: React.Dispatch<React.SetStateAction<Group[]>>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Devices(props: Props) {
|
|
||||||
const { groups, setGroups } = props;
|
|
||||||
const isMobile = useMobile();
|
const isMobile = useMobile();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -182,8 +177,11 @@ export default function Devices(props: Props) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadDevices()
|
loadDevices()
|
||||||
|
|
||||||
}, [limit, page, order, orderBy, search, tab])
|
}, [limit, page, order, orderBy, search, tab])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -373,22 +371,21 @@ export default function Devices(props: Props) {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tabs
|
<Tabs
|
||||||
{...{}}
|
|
||||||
value={groups.length > 0 ? tab : "all"}
|
value={groups.length > 0 ? tab : "all"}
|
||||||
onChange={handleTabChange}
|
onChange={handleTabChange}
|
||||||
variant="scrollable"
|
variant="scrollable"
|
||||||
scrollButtons="auto"
|
scrollButtons="auto"
|
||||||
sx={{ borderRadius: 1 }}
|
sx={{ borderRadius: 1 }}
|
||||||
>
|
>
|
||||||
<Tab {...{}} value={"all"} label="All" />
|
<Tab value={"all"} label="All" />
|
||||||
{groupsLoading ?
|
{groupsLoading ?
|
||||||
<CircularProgress/>
|
<Tab value={"loading"} label={<CircularProgress />}/>
|
||||||
: groups.map((group, index) => {
|
: groups.map((group, index) => {
|
||||||
if (group.id()) return (
|
if (group.id()) return (
|
||||||
<Tab {...{}} value={group.id().toString()} label={group.name()} key={"group-tab-"+index}/>
|
<Tab value={group.id().toString()} label={group.name()} key={"group-tab-"+index}/>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
<Tab {...{}} value={"never"} label={<CreateGroupIcon className={classes.green} />} onClick={() => openGroupSettings(undefined, "add")} />
|
<Tab value={"never"} label={<CreateGroupIcon className={classes.green} />} onClick={() => openGroupSettings(undefined, "add")} />
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Box>
|
</Box>
|
||||||
<ResponsiveTable<pond.Device>
|
<ResponsiveTable<pond.Device>
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "node",
|
||||||
"allowImportingTsExtensions": true,
|
//"allowImportingTsExtensions": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"moduleDetection": "force",
|
//"moduleDetection": "force",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue