2 Copyright
2008 Steven Barth
<steven@midlink.org
>
3 Copyright
2008-
2015 Jo-Philipp Wich
<jow@openwrt.org
>
4 Copyright
2017 Stan Grishin
<stangri@melmac.net
>
5 Licensed to the public under the Apache License
2.0.
10 <h2 name=
"content"><%:Advanced Reboot%
></h2>
13 <%- local c = require(
"luci.model.uci").cursor():changes(); if c and next(c) then -%
>
14 <p class=
"alert-message warning"><%:Warning: There are unsaved changes that will get lost on reboot!%
></p>
17 <%- if errorMessage and errorMessage ~=
"" then -%
>
18 <p class=
"alert-message warning"><%:ERROR: %
><%=errorMessage%
></p>
21 <%- if device_name then -%
>
22 <fieldset class=
"cbi-section">
23 <legend><%=device_name%
><%: Partitions%
></legend>
24 <div class=
"table cbi-section-table" id=
"partitions">
25 <div class=
"tr cbi-section-table-titles">
26 <div class=
"th cbi-section-table-cell"><%:Partition%
></div>
27 <div class=
"th cbi-section-table-cell"><%:Status%
></div>
28 <div class=
"th cbi-section-table-cell"><%:Firmware/OS (Kernel)%
></div>
29 <div class=
"th cbi-section-table-cell"><%:Action%
></div>
31 <div class=
"tr cbi-section-table-row">
33 <%=string.format(
"%X", boot_envvar1_partition_one)%
>
36 <%- if boot_envvar1_partition_one == current_partition then -%
><%:Current%
><%- else -%
><%:Alternative%
><%- end -%
>
42 <%- if boot_envvar1_partition_one == current_partition then -%
>
43 <form method=
"post" action=
"<%=url('admin/system/advanced_reboot/reboot')%>">
44 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
45 <input id=
"reboot-button" type=
"submit" class=
"cbi-button cbi-button-apply" value=
"<%:Reboot to current partition%>" />
48 <form method=
"post" action=
"<%=url('admin/system/advanced_reboot/alternative_reboot')%>">
49 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
50 <input id=
"altreboot-button" type=
"submit" class=
"cbi-button cbi-button-apply" value=
"<%:Reboot to alternative partition...%>" />
55 <div class=
"tr cbi-section-table-row">
57 <%=string.format(
"%X", boot_envvar1_partition_two)%
>
60 <%- if boot_envvar1_partition_two == current_partition then -%
><%:Current%
><%- else -%
><%:Alternative%
><%- end -%
>
66 <%- if boot_envvar1_partition_two == current_partition then -%
>
67 <form method=
"post" action=
"<%=url('admin/system/advanced_reboot/reboot')%>">
68 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
69 <input id=
"reboot-button" type=
"submit" class=
"cbi-button cbi-button-apply" value=
"<%:Reboot to current partition%>" />
72 <form method=
"post" action=
"<%=url('admin/system/advanced_reboot/alternative_reboot')%>">
73 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
74 <input id=
"altreboot-button" type=
"submit" class=
"cbi-button cbi-button-apply" value=
"<%:Reboot to alternative partition...%>" />
82 <%- if rom_board_name then -%
>
83 <p class=
"alert-message warning"><%=pcdata(translatef(
"Warning: Device (%s) is unknown or isn't a dual-partition device!", rom_board_name))%
></p>
85 <p class=
"alert-message warning"><%:Warning: Unable to obtain device information!%
></p>
91 <%- if nixio.fs.access(
"/sbin/poweroff") then -%
>
92 <form method=
"post" action=
"<%=url('admin/system/advanced_reboot/power_off')%>">
93 <input type=
"hidden" name=
"token" value=
"<%=token%>" />
94 <input id=
"poweroff-button" type=
"submit" class=
"cbi-button cbi-button-apply" value=
"<%:Perform power off...%>" />
97 <p class=
"alert-message warning"><%:Warning: This system does not support powering off!%
></p>