treewide: rework uci apply workflow
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_uci / revert.htm
1 <%#
2  Copyright 2008 Steven Barth <steven@midlink.org>
3  Copyright 2008-2018 Jo-Philipp Wich <jo@mein.io>
4  Licensed to the public under the Apache License 2.0.
5 -%>
6
7 <%+header%>
8
9 <%-
10         local node, redir_url = luci.dispatcher.lookup(luci.http.formvalue("redir"))
11
12         include("cbi/apply_widget")
13         include("admin_uci/changelog")
14
15         cbi_apply_widget(redir_url or url("admin/uci/revert"))
16 -%>
17
18 <h2 name="content"><%:Configuration%> / <%:Revert%></h2>
19
20 <% if changes then %>
21         <p><strong><%:The following changes have been reverted%>:</strong></p>
22         <%- uci_changelog(changes) -%>
23 <% else %>
24         <p><strong><%:There are no pending changes to revert!%></strong></p>
25 <% end %>
26
27 <div class="alert-message" id="cbi_apply_status" style="display:none"></div>
28 <script type="text/javascript">
29         document.addEventListener("DOMContentLoaded", function() {
30                 uci_apply(true);
31         });
32 </script>
33
34 <% if redir_url then %>
35         <div class="cbi-page-actions">
36                 <form class="inline" method="get" action="<%=luci.util.pcdata(redir_url)%>">
37                         <input class="cbi-button cbi-button-link" style="margin:0" type="submit" value="<%:Back%>" />
38                 </form>
39         </div>
40 <% end %>
41
42 <%+footer%>