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 <table class="cbi-section-table" id="partitions">
25 <tr class="cbi-section-table-titles">
26 <th class="cbi-section-table-cell"><%:Partition%></th>
27 <th class="cbi-section-table-cell"><%:Status%></th>
28 <th class="cbi-section-table-cell"><%:Firmware/OS (Kernel)%></th>
29 <th class="cbi-section-table-cell"><%:Action%></th>
31 <tr class="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 <tr class="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 <p class="alert-message warning"><%:Warning: This system does not have two partitions!%></p>
87 <%- if nixio.fs.access("/sbin/poweroff") then -%>
88 <form method="post" action="<%=url('admin/system/advanced_reboot/power_off')%>">
89 <input type="hidden" name="token" value="<%=token%>" />
90 <input id="poweroff-button" type="submit" class="cbi-button cbi-button-apply" value="<%:Perform power off...%>" />
93 <p class="alert-message warning"><%:Warning: This system does not support powering off!%></p>