Skip to content

Commit 5110967

Browse files
committed
[mikrotik-sdwan] add ping/fetch tests and use worker tasks
1 parent e47c367 commit 5110967

File tree

19 files changed

+859
-106
lines changed

19 files changed

+859
-106
lines changed

TODO.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Do next
44

5+
- add link to modules in system/modules to the documentation page
6+
57
# Backlog
68

79
- sort out overlaying menu in bug api table
@@ -16,4 +18,6 @@
1618
- i need a flag to prevent the module ui from loading - overlayPanel or something? When a status item is so important the panel can't run.
1719
- check upgrade - the panel enabled should be false and it takes a long time to update
1820
- use logger rather than console.log
19-
- fix reload in logs
21+
- new worker design using tasks
22+
- update mikrotik modules using new core class
23+
- mikrotik routes module doesn't understand sub routing tables

src/modules/mikrotik-sdwan/TODO.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44
- need to handle no data better - critical
55
- add test for log route
66
- fetchFirewall isn't used!
7+
- if no routing table entries then hide tab?
8+
- clear pinger collection in db
9+
10+
- thurs 12/02
11+
12+
Working on default routes.
13+
Kind of done ping/fetch tests but needs historical data storing and showing in sparkline
14+
Using comments for bridges maybe isn't the best idea - what about internet routes with client IPs?
15+
And am I providing functionality to store static IPs and routes?

src/modules/mikrotik-sdwan/client/Module.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export default function Module(props) {
1212
<BugModuleWrapper {...props}>
1313
<Routes>
1414
<Route index element={<MainPanel {...props} />} />
15+
<Route path="entries" element={<MainPanel {...props} />} />
16+
<Route path="routes" element={<MainPanel {...props} />} />
1517
<Route path="add" element={<AddPanel {...props} />} />
1618
<Route
1719
path="config"

src/modules/mikrotik-sdwan/client/components/EntryList.jsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { useEffect } from "react";
1818
import AddEntryButton from "./AddEntryButton";
1919
import SetGroupDialog from "./SetGroupDialog";
2020

21-
const EntryStatus = ({ entry, routes }) => {
21+
const EntryStatus = ({ entry }) => {
2222
if (entry.static) {
2323
return <BugStatusLabel>STATIC</BugStatusLabel>;
2424
}
@@ -31,13 +31,18 @@ const EntryStatus = ({ entry, routes }) => {
3131
return <BugStatusLabel>UNKNOWN</BugStatusLabel>;
3232
};
3333

34-
export default function EntryList({ panelId, routes }) {
34+
export default function EntryList({ panelId }) {
3535
const sendAlert = useAlert();
3636
const [forceRefresh, doForceRefresh] = useForceRefresh();
3737
const { renameDialog } = useBugRenameDialog();
3838
const { customDialog } = useBugCustomDialog();
3939
const { confirmDialog } = useBugConfirmDialog();
4040

41+
const routes = useApiPoller({
42+
url: `/container/${panelId}/route`,
43+
interval: 2000,
44+
});
45+
4146
const entries = useApiPoller({
4247
url: `/container/${panelId}/entry`,
4348
interval: 2000,
@@ -222,9 +227,9 @@ export default function EntryList({ panelId, routes }) {
222227
}
223228

224229
return (
225-
<Box sx={{ p: 0.5 }}>
230+
<Stack spacing={1}>
226231
{entries?.data?.map((group) => (
227-
<Box key={group.group} sx={{ mb: 1 }}>
232+
<Box key={group.group} sx={{ mb: 0 }}>
228233
<Typography
229234
sx={{
230235
p: 2,
@@ -351,6 +356,6 @@ export default function EntryList({ panelId, routes }) {
351356
})}
352357
</Box>
353358
))}
354-
</Box>
359+
</Stack>
355360
);
356361
}

0 commit comments

Comments
 (0)