%h
%>')
+ .format(r.responseText || r.statusText || r.status)));
+
+ window.setTimeout(function() {
+ L.ui.changes.displayStatus(false);
+ }, L.env.apply_display * 1000);
+ }
+ });
+ },
+
+ revert: function() {
+ this.displayStatus('notice spinning',
+ E('p', _('Reverting configuration…')));
+
+ L.Request.request(L.url('admin/uci/revert'), {
+ method: 'post',
+ query: { sid: L.env.sessionid, token: L.env.token }
+ }).then(function(r) {
+ if (r.status === 200) {
+ document.dispatchEvent(new CustomEvent('uci-reverted'));
+
+ L.ui.changes.setIndicator(0);
+ L.ui.changes.displayStatus('notice',
+ E('p', _('Changes have been reverted.')));
+
+ window.setTimeout(function() {
+ //L.ui.changes.displayStatus(false);
+ window.location = window.location.href.split('#')[0];
+ }, L.env.apply_display * 1000);
+ }
+ else {
+ L.ui.changes.displayStatus('warning',
+ E('p', _('Revert request failed with status %h
')
+ .format(r.statusText || r.status)));
+
+ window.setTimeout(function() {
+ L.ui.changes.displayStatus(false);
+ }, L.env.apply_display * 1000);
+ }
+ });
+ }
+ }),
+
addValidator: function(field, type, optional /*, ... */) {
if (type == null)
return;
diff --git a/modules/luci-base/luasrc/controller/admin/uci.lua b/modules/luci-base/luasrc/controller/admin/uci.lua
index 1d955dd982..6b19c62f81 100644
--- a/modules/luci-base/luasrc/controller/admin/uci.lua
+++ b/modules/luci-base/luasrc/controller/admin/uci.lua
@@ -1,5 +1,5 @@
-- Copyright 2008 Steven Barth <%:There are no pending changes!%>
-<% end %> - - - -<%:The following changes have been reverted%>:
- <%- uci_changelog(changes) -%> -<% else %> -<%:There are no pending changes to revert!%>
-<% end %> - -<% if redir_url then %> -