-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
luci-mod-rdash: add new package #7431
base: master
Are you sure you want to change the base?
Conversation
Not sure if you'd want to change things again, but with the dashes in |
39f8783
to
04e494a
Compare
Updated the package name from |
screenshot of this? |
04e494a
to
cc72d2b
Compare
modules/luci-mod-info-dashboard/htdocs/luci-static/resources/view/info-dashboard/css/custom.css
Outdated
Show resolved
Hide resolved
...s/luci-mod-info-dashboard/htdocs/luci-static/resources/view/info-dashboard/include/d_dhcp.js
Outdated
Show resolved
Hide resolved
modules/luci-mod-info-dashboard/htdocs/luci-static/resources/view/info-dashboard/index.js
Outdated
Show resolved
Hide resolved
Consider naming your dashboard something creative. Name it after yourself if you want. "info" is waaaaay too generic and may clash with namespaces eventually that shall be used by openwrt itself. |
84f6a85
to
21da814
Compare
21da814
to
b612532
Compare
|
modules/luci-mod-rdash/htdocs/luci-static/resources/view/rdash/index.js
Outdated
Show resolved
Hide resolved
modules/luci-mod-rdash/htdocs/luci-static/resources/view/rdash/include/d_devices.js
Show resolved
Hide resolved
modules/luci-mod-rdash/htdocs/luci-static/resources/view/rdash/css/custom.css
Show resolved
Hide resolved
squash commits please |
42fcd2d
to
6d0ce68
Compare
This commit includes: - Adding the new package. - Renaming the package and replacing old files. - Adding an extra line at the end of files. Signed-off-by: Rick Clark <tplink.82d1@proton.me>
6d0ce68
to
e9e3667
Compare
Changes made as requested:
|
One question: how does everything look in dark mode? Those black line diagrams on a dark background might look interesting. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is using tab indentation instead of space as the rest of your JS files, you may want to align all the files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted. Yes please, use tab indentation.
Take a look at how I did it in dfd802a (if your css does not already handle that). |
# No configure step needed | ||
endef | ||
|
||
define Build/Compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the section? As far I remember you may want to declare the empty section to override i.e. remove the default compile step. Please try to run the build without it
# No compile step needed | ||
endef | ||
|
||
define Package/luci-mod-rdash/install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Luci build system will do all the steps itself. No need to declare them here.
@@ -0,0 +1,300 @@ | |||
.dashboard-container { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the cascade.css has variable with standard colors that you may want to use here
var mem = L.isObject(memoryinfo.memory) ? memoryinfo.memory : {}; | ||
var totalMemory = mem.total || 0; | ||
var usedMemory = (mem.total && mem.free) ? (mem.total - mem.free) : 0; | ||
var availableMemory = mem.free || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the var is unused
expect: { result: [] } | ||
}); | ||
|
||
var MountSkipList = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the list is unused
var boardinfo = data[0], | ||
systeminfo = data[1], | ||
memoryinfo = data[2], | ||
mounts = data[3], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the var is unused
Thanks all for the reviews. To be honest, I didn't think it would require lots of these steps (it's my first time). The goal of this project was about "getting everything in one place, just like the default firmware of a TP-Link router dashboard." So I took some parts of "10_system.js, 20_memory.js, 30_network.js, and 40_dhcp.js" and some parts of other packages, such as Luci-mod-dashboard and Luci-app-cpu-status, to combine them in one package. Im not experts in coding, so I wrote the code with ChatGPT's help. Finally, I will try to fix what you mentioned; if I can't, I'll shutdown the project. In the meantime, I'll change the pull to draft. |
If this gets merged, I hope that you're committing to maintain this in compatible status for several years. (We have been burned with enthusiastic creation of some theme or dashboard, and then soon after that the creator loses interest, and the app starts rotting when there are changes in the surrounding OpenWrt. ) |
"description": "Grant access to the system route status", | ||
"read": { | ||
"ubus": { | ||
"file": [ "exec" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This exec permissions does not appear to be required, please drop it.
"luci": [ "getVersion" ], | ||
"file": [ "list", "read" ], | ||
"system": [ "board", "info" ], | ||
"network.rrdns": [ "lookup" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There does not appear to be any reverse lookup calls in this code, so please drop this permission.
"/www/luci-static/resources/view/status/include": [ "list" ], | ||
"/etc/board.json": [ "read" ], | ||
"/proc/sys/net/netfilter/nf_conntrack_count": [ "read" ], | ||
"/proc/sys/net/netfilter/nf_conntrack_max": [ "read" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simplified dashboard code does not appear to read any of those files, drop the read permissions for them.
}, | ||
"ubus": { | ||
"luci": [ "getVersion" ], | ||
"file": [ "list", "read" ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There does not appear to be any filesystem listing calls, drop the list
permission
"/proc/sys/net/netfilter/nf_conntrack_max": [ "read" ] | ||
}, | ||
"ubus": { | ||
"luci": [ "getVersion" ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears unused
Description
This PR adds a new package,
luci-mod-rdash
, which provides an interactive dashboard for routers.Key features: