From f6505fc01c8aee4d2f9f7bc7537c3a93cfd5dab1 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Wed, 12 Jul 2017 22:51:41 -0700 Subject: luci-app-advanced-reboot: initial commit Signed-off-by: Stan Grishin --- .../view/advanced_reboot/advanced_reboot.htm | 92 ++++++++++++++++++++++ .../view/advanced_reboot/alternative_reboot.htm | 29 +++++++ .../luasrc/view/advanced_reboot/power_off.htm | 25 ++++++ 3 files changed, 146 insertions(+) create mode 100644 applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm create mode 100644 applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm create mode 100644 applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm (limited to 'applications/luci-app-advanced-reboot/luasrc/view') diff --git a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm new file mode 100644 index 0000000000..206d250543 --- /dev/null +++ b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm @@ -0,0 +1,92 @@ +<%# + Copyright 2008 Steven Barth + Copyright 2008-2015 Jo-Philipp Wich + Copyright 2017 Stan Grishin + Licensed to the public under the Apache License 2.0. +-%> + +<%+header%> + +

<%:Advanced Reboot%>

+
+ +<%- local c = require("luci.model.uci").cursor():changes(); if c and next(c) then -%> +

<%:Warning: There are unsaved changes that will get lost on reboot!%>

+<%- end -%> + +<%- if device_name then -%> +
+ <%=device_name%><%: Partitions%> + + + + + + + + + + + + + + + + + + + +
<%:Partition%><%:Status%><%:Firmware/OS (Kernel)%><%:Action%>
+ <%=boot_envvar1_partition_one%> + + <%- if boot_envvar1_partition_one == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%> + + <%=partition_one_os%> + + <%- if boot_envvar1_partition_one == current_partition then -%> +
+ + +
+ <%- else -%> +
+ + +
+ <%- end -%> +
+ <%=boot_envvar1_partition_two%> + + <%- if boot_envvar1_partition_two == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%> + + <%=partition_two_os%> + + <%- if boot_envvar1_partition_two == current_partition then -%> +
+ + +
+ <%- else -%> +
+ + +
+ <%- end -%> +
+
+<%- else -%> +

<%:Warning: This system does not have two partitions!%>

+<%- end -%> + +
+ +<%- if nixio.fs.access("/sbin/poweroff") then -%> +
+ + +
+<%- else -%> +

<%:Warning: This system does not support powering off!%>

+<%- end -%> + +<%+footer%> diff --git a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm new file mode 100644 index 0000000000..6325934094 --- /dev/null +++ b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm @@ -0,0 +1,29 @@ +<%# + Copyright 2008 Steven Barth + Copyright 2008-2009 Jo-Philipp Wich + Copyright 2017 Stan Grishin + Licensed to the public under the Apache License 2.0. +-%> + +<%+header%> + +

<%:Reboot Device to an Alternative Partition%> - <%:Confirm%>

+

+ <%_ WARNING: An alternative partition might have its own settings and completely different firmware.

+ As your network configuration and WiFi SSID/password on alternative partition might be different, + you might have to adjust your computer settings to be able to access your device once it reboots.

+ Please also be aware that alternative partition firmware might not provide an easy way to switch active partition + and boot back to the currently active partition.

+ Click "Proceed" below to reboot device to an alternative partition. %> +

+ +
+
+ + + + +
+
+ +<%+footer%> diff --git a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm new file mode 100644 index 0000000000..0ddea11e65 --- /dev/null +++ b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm @@ -0,0 +1,25 @@ +<%# + Copyright 2008 Steven Barth + Copyright 2008-2009 Jo-Philipp Wich + Copyright 2017 Stan Grishin + Licensed to the public under the Apache License 2.0. +-%> + +<%+header%> + +

<%:Power Off Device%> - <%:Confirm%>

+

+ <%_ WARNING: Power off might result in a reboot on a device which doesn't support power off.

+ Click "Proceed" below to power off your device. %> +

+ +
+
+ + + + +
+
+ +<%+footer%> -- cgit v1.2.3