[Solved] Customize Luci Overview Page

Hello!

I built my own firmware and I have a little problem.
As you can see on the screenshot below, I have a section "Memory" and "Storage" on the Luci Overview page. What does "Storage" mean? Can I disable it?

Best regards,
Sada1400

The short answer is 'no'.
The long answer would be, you have the source, you can patch it out.

Storage settings should provide reasonable results on anything but initramfs images.

1 Like

Thank you for your reply.
Ok, I will try it. But can you explain, what is the difference between Memory and Storage?

RAM vs. flash/disk space.

Ah, ok, thanks. But I don't understand why it's zero all the time.... I have to check this.

You can remove this section by deleting the file /www/luci-static/resources/view/status/include/25_storage.js on your router, then clear your browser cache and reload.

Wrt. the zero values, check the output of ubus call system info - the values are supposed to come from the "root": { ... } and "tmp": { ... } dictionaries.

2 Likes

I entered the command and got the following output:

ubus call system info
{
        "localtime": 1635066221,
        "uptime": 139,
        "load": [
                52704,
                32000,
                12512
        ],
        "memory": {
                "total": 59777024,
                "free": 29396992,
                "shared": 307200,
                "buffered": 3923968,
                "available": 25354240,
                "cached": 11550720
        },
        "swap": {
                "total": 0,
                "free": 0
        }
}

I looked in 25_storage.js and saw that "root": {} and "tmp": {} are required, as you said before. My system info is missing the sections, so it shows an empty table.

                var root = L.isObject(systeminfo.root) ? systeminfo.root : {},
                    tmp = L.isObject(systeminfo.tmp) ? systeminfo.tmp : {};

                var fields = [];
                fields.push(_('Disk space'), root.used*1024, root.total*1024);
                fields.push(_('Temp space'), tmp.used*1024, tmp.total*1024);

My question is, why are these parameters missing? Is it a misconfiguration in menuconfig or kernel_menuconfig?

I think I have found the "problem". I built OpenWrt with version 21.02. and used the Luci-Master as package. In the tag openwrt-21.02. the featue 25_storage.js did not exist yet. This is newly added and probably the feature does not work yet in version 21.02. I'll check out the master now and then try to build the firmware again.

Thanks again for the help.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like

I forgot to run a "make distclean" and "make clean" before rebuilding the project. With the right packages everything works as expected.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.