luci-theme-argon icon indicating copy to clipboard operation
luci-theme-argon copied to clipboard

最新luci snapshot无法正确显示登陆界面

Open msdos03 opened this issue 2 years ago • 42 comments

Describe the bug 大约4天前,在最新的snapshot版本luci上使用argon主题是正常的,但是今天更新feeds后,Argon登陆背景无法显示

To Reproduce Steps to reproduce the behavior:

  1. 更新feeds并编译openwrt snapshot(master分支)
  2. 安装argon主题
  3. 访问luci
  4. 看到以下界面 error

Expected behavior 显示正常的argon登陆界面

Openwrt (please complete the following information):

  • Versiosn: Powered by LuCI Master (git-22.314.85334-0141732 / ArgonTheme v2.2.9.4 / OpenWrt SNAPSHOT r21247+64-2403428c75
  • Theme argon
  • Version ArgonTheme v2.2.9.4

Desktop (please complete the following information):

  • OS: windows11
  • Browser: edge/chrome
  • Version: latest

Smartphone (please complete the following information):

  • Device: MI 8
  • OS: android12
  • Browser: chrome android
  • Version: 108.0.5359.28

Additional context

msdos03 avatar Nov 12 '22 06:11 msdos03

我以为是我的问题,那没事了 截图_2022-11-13_14-30-18

jkfujr avatar Nov 13 '22 06:11 jkfujr

我以为是我的问题,那没事了 截图_2022-11-13_14-30-18

目前作者好像是好久不维护了😢你会修这个问题吗?

msdos03 avatar Nov 13 '22 11:11 msdos03

近期会检查修复

jerrykuku avatar Nov 13 '22 11:11 jerrykuku

近期会检查修复

感谢作者大大

msdos03 avatar Nov 13 '22 11:11 msdos03

官方的最新的 openwrt snapshot是么?

jerrykuku avatar Nov 13 '22 11:11 jerrykuku

官方的最新的 openwrt snapshot是么?

我的是22.03.2

jkfujr avatar Nov 13 '22 11:11 jkfujr

官方的最新的 openwrt snapshot是么?

是的,我的openwrt版本就是当天才pull过并更新过feeds的官方snapshot版本,看样子jkfujr的22.03版本用了和我同版本的luci也有同样的问题。

msdos03 avatar Nov 13 '22 11:11 msdos03

插个眼

chummumm avatar Nov 14 '22 07:11 chummumm

@jerrykuku or @jjm2473 I reproduced here with latest snapshot using base language (English) system. The menus are OK, but the sysauth login page is not working fine, no background at all. image

It is completely missing the background, both in desktop and mobile profiles.

For some reason, latest Luci releases are executing /usr/share/ucode/luci/template/sysauth.ut instead of /usr/lib/lua/luci/view/themes/argon/sysauth.htm

It seems the new approach for OpenWrt going forward is to use js instead of lua in those files, locating them in /usr/share/ucode/luci/template/themes/argon/ instead of in /usr/lib/lua/luci/view/themes/argon/ with a .ut extension instead of .htm Maybe it is time to start moving on with js and ucode.

Lua is now being deprecated in OpenWrt. It is still stuck in lua 5.1 and instead of updating it to a newer version, the best option is to move to a lighter language as they explain here. The project has chosen ucode to replace lua. So this allows for a lighter implementation, more similar to js. The change is effective now and old themes using lua will stop working in OpenWrt snapshots.

I really hope you guys could easily port those .htm files to ucode .ut as it is the standard going forward.

okibcn avatar Nov 18 '22 07:11 okibcn

@jerrykuku or @jjm2473 I reproduced here with latest snapshot using base language (English) system. The menus are OK, but the sysauth login page is not working fine, no background at all. image

It is completely missing the background, both in desktop and mobile profiles.

For some reason, latest Luci releases are executing /usr/share/ucode/luci/template/sysauth.ut instead of /usr/lib/lua/luci/view/themes/argon/sysauth.htm

It seems the new approach for OpenWrt going forward is to use js instead of lua in those files, locating them in /usr/share/ucode/luci/template/themes/argon/ instead of in /usr/lib/lua/luci/view/themes/argon/ with a .ut extension instead of .htm Maybe it is time to start moving on with js and ucode.

Lua is now being deprecated in OpenWrt. It is still stuck in lua 5.1 and instead of updating it to a newer version, the best option is to move to a lighter language as they explain here. The project has chosen ucode to replace lua. So this allows for a lighter implementation, more similar to js. The change is effective now and old themes using lua will stop working in OpenWrt snapshots.

I really hope you guys could easily port those .htm files to ucode .ut as it is the standard going forward.

Thanks for analysing the issue!

msdos03 avatar Nov 20 '22 11:11 msdos03

@jerrykuku or @jjm2473 I reproduced here with latest snapshot using base language (English) system. The menus are OK, but the sysauth login page is not working fine, no background at all. image

It is completely missing the background, both in desktop and mobile profiles.

For some reason, latest Luci releases are executing /usr/share/ucode/luci/template/sysauth.ut instead of /usr/lib/lua/luci/view/themes/argon/sysauth.htm

It seems the new approach for OpenWrt going forward is to use js instead of lua in those files, locating them in /usr/share/ucode/luci/template/themes/argon/ instead of in /usr/lib/lua/luci/view/themes/argon/ with a .ut extension instead of .htm Maybe it is time to start moving on with js and ucode.

Lua is now being deprecated in OpenWrt. It is still stuck in lua 5.1 and instead of updating it to a newer version, the best option is to move to a lighter language as they explain here. The project has chosen ucode to replace lua. So this allows for a lighter implementation, more similar to js. The change is effective now and old themes using lua will stop working in OpenWrt snapshots.

I really hope you guys could easily port those .htm files to ucode .ut as it is the standard going forward.

Thanks, I will test it asap.

jerrykuku avatar Nov 20 '22 15:11 jerrykuku

Hey, @jerrykuku thanks for taking care of this. I am not proficient in node.js, but as far as I know, there is a new template for LuCI themes. for instance, this is the new version of the bootstrap theme.

I see you have other repositories using js, so I hope you could port the Lua code in argon to js without major problems. As far as I see, the code can use any js code, so basically, you can use any js lib on the server side of those ut (code template) files.

I hope this could help you to get to speed with this code rewrite.

okibcn avatar Nov 20 '22 16:11 okibcn

Well, after some conversations, it seems that Lua is still supported, but upon errors, it goes to the default ut file. So far LuCI retains by default the capability of using old , this actually is a kind of bug in the Argon theme itself. The shipped sysauth.htm is rendered but throws a runtime exception, which causes LuCI to fall back to it's builtin default sysauth.ut.

The issue is within this line:

https://github.com/jerrykuku/luci-theme-argon/blob/master/luasrc/view/themes/argon/sysauth.htm#L132

On 22.03, the global node variable is not defined which causes the .. ( (node and node.title) and ' - ' .. translate(node.title) or '') part to be skipped. On current snapshots, node is defined and refers to the dispatcher's node() function, leading to a Lua attempt to index a function value exception due to the node.title expression. After removing the extraneous code which has never been rendered anyway, the theme appears to function normally.

For those willing to make it work right now before @jerrykuku updates the code, you can just open a console to your router by typing ssh [email protected] (use the IP of your router) in PowerShell or Linux, and in your OpenWrt router CLI type:

sed -i "s/ .. ( (node and node.title) and ' - ' .. translate(node.title) or '')//g" /usr/lib/lua/luci/view/themes/argon/sysauth.htm

okibcn avatar Nov 20 '22 17:11 okibcn

新版Luci编译后再次无法正常显示

WenqiOfficial avatar Jan 27 '23 11:01 WenqiOfficial

lua不是用得好好的吗,怎么又要发明一个语言

jjm2473 avatar Jan 29 '23 08:01 jjm2473

The objective is to remove lua to reduce even more the space requirements. The goal of OpenWRT is to fit inside the smallest routers as well as larger routers.

okibcn avatar Jan 29 '23 08:01 okibcn

22.03.5 进pw卡好一会每次

skullcrossbones avatar Aug 11 '23 11:08 skullcrossbones

因为pw还是使用旧版的luci插件框架,数据都是直接后端渲染的

jjm2473 avatar Aug 11 '23 14:08 jjm2473

因为pw还是使用旧版的luci插件框架,数据都是直接后端渲染的

问题是pw2也这样

skullcrossbones avatar Aug 11 '23 18:08 skullcrossbones

你们的正常显示了么?我是(lede)Powered by LuCI Master (git-23.242.63652-d82d969) / ArgonTheme v1.8.3 / OpenWrt R23.8.23 按照上边issue的方法依旧不显示

Kimaru-bili avatar Sep 01 '23 05:09 Kimaru-bili

你们的正常显示了么?我是(lede)Powered by LuCI Master (git-23.242.63652-d82d969) / ArgonTheme v1.8.3 / OpenWrt R23.8.23 安装上边issue的方法依旧不显示

薛定谔的LEDE

SpeedPartner avatar Sep 01 '23 18:09 SpeedPartner

你们的正常显示了么?我是(lede)Powered by LuCI Master (git-23.242.63652-d82d969) / ArgonTheme v1.8.3 / OpenWrt R23.8.23 安装上边issue的方法依旧不显示

薛定谔的LEDE

😭

Kimaru-bili avatar Sep 01 '23 18:09 Kimaru-bili

😭

LEDE和官方master的LuCI分支很难分辨...LEDE的LuCI编译出来也是Powered by LuCI Master ... 建议你看下目前固件的加载动画来区分,18.06的LuCI需要加载完才能继续操作,21.02+则可以在加载的同时操作Web界面.

SpeedPartner avatar Sep 02 '23 02:09 SpeedPartner

😭

LEDE和官方master的LuCI分支很难分辨...LEDE的LuCI编译出来也是Powered by LuCI Master ... 建议你看下目前固件的加载动画来区分,18.06的LuCI需要加载完才能继续操作,21.02+则可以在加载的同时操作Web界面.

我感觉我的像是21.02+以后的版本(以前点开一些界面加载的时候点别的没反应,现在可以直接中断加载切过去了

Kimaru-bili avatar Sep 02 '23 02:09 Kimaru-bili

我感觉我的像是21.02+以后的版本(以前点开一些界面加载的时候点别的没反应,现在可以直接中断加载切过去了

loading gif dark mode 这种加载动画就是18.06的

SpeedPartner avatar Sep 02 '23 05:09 SpeedPartner

我感觉我的像是21.02+以后的版本(以前点开一些界面加载的时候点别的没反应,现在可以直接中断加载切过去了

loading gif dark mode 这种加载动画就是18.06的

那没事了(我是18.06 Screenshot_2023-09-02-13-28-06-449_com android chrome emmm 怪(同时也能同时操作背后的Web界面)

Kimaru-bili avatar Sep 02 '23 05:09 Kimaru-bili

emmm 怪(同时也能同时操作背后的Web界面)

抱歉,我的错;确实可以进行其他操作;21.02+样式不同. 所以,你所述的无法显示登录界面是怎样的情况?

SpeedPartner avatar Sep 02 '23 05:09 SpeedPartner

emmm 怪(同时也能同时操作背后的Web界面)

抱歉,我的错;确实可以进行其他操作;21.02+样式不同. 所以,你所述的无法显示登录界面是怎样的情况?

(没事 问题不大) 登录页面的壁纸没法正常显示 我已经添加了 不知道为什么 上边的Issuse有个解决方案我试了一下没有用 就问了一下 Screenshot_2023-09-02-14-04-54-650_com android chrome Screenshot_2023-09-02-14-04-59-535_com android chrome

Kimaru-bili avatar Sep 02 '23 06:09 Kimaru-bili

请检查下: luci-base luci-compat luci-mod-admin-full 这三个软件包是否均安装,版本是否相同.

SpeedPartner avatar Sep 02 '23 07:09 SpeedPartner

都安装了 且版本相同 Screenshot_2023-09-02-15-14-18-072_com android chrome Screenshot_2023-09-02-15-13-59-987_com android chrome Screenshot_2023-09-02-15-13-38-928_com android chrome

Kimaru-bili avatar Sep 02 '23 07:09 Kimaru-bili