Skip to content

luci-app-smart-reboot: add LuCI frontend for smart-reboot - #8328

Open
minicom365 wants to merge 1 commit into
openwrt:masterfrom
minicom365:luci-app-smart-reboot
Open

luci-app-smart-reboot: add LuCI frontend for smart-reboot#8328
minicom365 wants to merge 1 commit into
openwrt:masterfrom
minicom365:luci-app-smart-reboot

Conversation

@minicom365

Copy link
Copy Markdown

This adds LuCI support for smart-reboot.

Features

  • Enable/disable toggle
  • Reboot time input (HH:MM)
  • Interface selection (including select-all mode)
  • Last automatic reboot status display
  • Idle sampling / threshold settings
  • Built-in i18n catalogs for 18 languages

i18n Languages

ko, ja, zh_Hans, zh_Hant, de, fr, es, it, pt_BR, ru, uk, vi, th, id, tr, pl, nl, ar

Testing

  • OpenWrt 23.05-based buildroot
  • Target: ipq806x/generic
  • LuCI page render / save / service interaction verified

Dependency

Signed-off-by: minicom365 3387910@naver.com

@github-actions

This comment has been minimized.

@minicom365
minicom365 force-pushed the luci-app-smart-reboot branch 2 times, most recently from 999d37f to 6c8caf4 Compare February 17, 2026 02:28
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@minicom365
minicom365 force-pushed the luci-app-smart-reboot branch 3 times, most recently from 46e1e52 to 8fd2331 Compare February 17, 2026 03:47
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@minicom365
minicom365 force-pushed the luci-app-smart-reboot branch from 8fd2331 to 1682278 Compare February 17, 2026 05:31
@github-actions

Copy link
Copy Markdown

Warning

Some formality checks failed.

Consider (re)reading submissions guidelines.

Failed checks

Issues marked with an ❌ are failing checks.

Commit 1682278

  • 🔶 Author name (최민) seems to be a nickname or an alias
  • 🔶 Committer name (최민) seems to be a nickname or an alias

For more details, see the full job log.

Something broken? Consider providing feedback.

@minicom365 minicom365 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented all suggested ucode API replacements in smart-reboot-check.

  • replaced the lock shell command with fs.open() + file.lock()/lock("u") and a cleanup helper
  • removed every system("lock -u …") occurrence, now using the native handle
  • swapped system("sleep …") for the builtin sleep(milliseconds) function

These changes appear in the new commits on both the local repo and the packages branch (see commit c41ab4e6f on the packages PR). All existing review threads can be considered resolved. Thanks for the pointers!

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found beyond the inline comments.


Generated by Claude Code

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PO2LMO:=$(STAGING_DIR_HOSTPKG)/bin/po2lmo

include $(INCLUDE_DIR)/package.mk

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Makefile hand-rolls package.mk plus a manual PO2LMO loop and install rules, but every other in-tree luci-app uses the shared luci.mk instead (all 100 apps under applications/luci-app-*/ do — e.g. luci-app-statistics/Makefile). Switching to luci.mk gives you the standard LUCI_TITLE / LUCI_DEPENDS metadata, automatic htdocs/root install, and — importantly — proper i18n packaging (see the next comment). Recommend replacing the bottom half of this Makefile with the conventional form:

include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-smart-reboot

LUCI_TITLE:=LuCI support for smart-reboot
LUCI_DEPENDS:=+smart-reboot
PKG_LICENSE:=Apache-2.0

include ../../luci.mk

# call BuildPackage - OpenWrt buildroot signature

(+luci-base is added implicitly by luci.mk.)


Generated by Claude Code

Comment on lines +22 to +38

define Build/Compile
$(INSTALL_DIR) $(PKG_BUILD_DIR)/i18n
for po in ./po/*/smart-reboot.po; do \
lang=$$(basename $$(dirname $$$$po)); \
$(PO2LMO) $$$$po $(PKG_BUILD_DIR)/i18n/smart-reboot.$$$$lang.lmo; \
done
endef

define Package/luci-app-smart-reboot/install
$(INSTALL_DIR) $(1)/www
$(CP) ./htdocs/* $(1)/www/

$(INSTALL_DIR) $(1)/
$(CP) ./root/* $(1)/
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
$(CP) $(PKG_BUILD_DIR)/i18n/*.lmo $(1)/usr/lib/lua/luci/i18n/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This compiles all 18 catalogs and bundles every .lmo into the main luci-app-smart-reboot package. The in-tree convention (via luci.mk) instead emits one luci-i18n-smart-reboot-<lang> package per language, so a user installs only the translations they want and the base app stays lean. Dropping these custom Build/Compile and install rules and using luci.mk (previous comment) produces the standard per-language i18n packages automatically — no manual po2lmo loop needed.


Generated by Claude Code

@@ -0,0 +1,38 @@
msgid ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No po/templates/smart-reboot.pot is included. All in-tree luci-apps commit a po/templates/<name>.pot source catalog (it is the file Weblate translates from and i18n-sync regenerates); without it the translation tooling has no template. Please add the generated po/templates/smart-reboot.pot. Separately, these hand-written catalogs omit the standard PO headers (Project-Id-Version, Plural-Forms, Content-Transfer-Encoding, etc.) that every other in-tree catalog carries — worth generating them through the normal po workflow rather than by hand so they survive the next Weblate sync.


Generated by Claude Code

@@ -0,0 +1,38 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this ko catalog's header is missing the Language: ko\n field that every other catalog in this PR includes (e.g. de has Language: de\n), and the file also lacks a trailing newline. Add the language tag for consistency:

Suggested change
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgstr "Content-Type: text/plain; charset=UTF-8\nLanguage: ko\n"

Generated by Claude Code

@openwrt openwrt Bot added add package Introduces a new package Makefile build script not following guidelines Pull request does not follow formatting guidelines labels Jul 23, 2026
@openwrt

openwrt Bot commented Jul 23, 2026

Copy link
Copy Markdown

Formality Check: Failed

We completed the verification flow. Please review the formatting overview logs below.

🛑 CRITICAL ERRORS

Commit 856ea2f - luci-app-smart-reboot: add LuCI frontend:

  • File 'applications/luci-app-smart-reboot/po/ko/smart-reboot.po' is missing a trailing newline

Tip

Do not close this pull request to make corrections. Instead, modify your existing commits (e.g. git commit --amend) and update the branch using git push --force-with-lease --force-if-includes. The checks will re-run automatically.


Something broken? Consider reporting an issue.
Running version 949a8cc deployed on 2026-07-24 10:15:22 CEST

@minicom365
minicom365 force-pushed the luci-app-smart-reboot branch from 4072e3d to 11b9739 Compare July 23, 2026 08:25

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the change since the last review (Makefile now uses luci.mk, resolving the prior packaging and per-language i18n comments). One inline follow-up on the missing PKG_MAINTAINER.


Generated by Claude Code

PKG_NAME:=luci-app-smart-reboot
LUCI_TITLE:=LuCI support for smart-reboot
LUCI_DEPENDS:=+smart-reboot
PKG_LICENSE:=Apache-2.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The switch to luci.mk resolves the earlier packaging/i18n comments — thanks. One thing still missing: PKG_MAINTAINER. The formality check on this commit fails with New OpenWrt package is missing the mandatory parameter: 'PKG_MAINTAINER', and 95 of the 100 in-tree applications/luci-app-*/Makefile set it (e.g. luci-app-ddns). Add it next to PKG_LICENSE:

Suggested change
PKG_LICENSE:=Apache-2.0
PKG_LICENSE:=Apache-2.0
PKG_MAINTAINER:=Min Choi <3387910@naver.com>

Generated by Claude Code

@minicom365
minicom365 force-pushed the luci-app-smart-reboot branch from 11b9739 to 9c1cdbb Compare July 24, 2026 08:13
Add LuCI UI for configuring smart-reboot.

- Enable/disable toggle and HH:MM reboot time input
- Interface selection with select-all option
- Show last automatic reboot timestamp
- Provide i18n catalogs for 18 languages

Signed-off-by: Min Choi <3387910@naver.com>
@minicom365
minicom365 force-pushed the luci-app-smart-reboot branch from 9c1cdbb to 856ea2f Compare July 24, 2026 09:00

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit; no new issues found. The only change since the last review adds PKG_MAINTAINER, resolving the prior formality-check follow-up.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add package Introduces a new package Makefile build script not following guidelines Pull request does not follow formatting guidelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants