2 LuCI - Lua Configuration Interface
3 Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
15 <% export("cbi_apply_xhr", function(id, configs) -%>
16 <fieldset class="cbi-section" id="cbi-apply-<%=id%>">
17 <legend><%:Applying changes%></legend>
18 <script type="text/javascript"><![CDATA[
19 var apply_xhr = new XHR();
21 apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "restart", table.concat(configs, ","))%>', null,
23 var intv = window.setInterval(
26 apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "status")%>', null,
28 if( x.responseText == 'finish' )
30 window.clearInterval(intv);
32 var e = document.getElementById('cbi-apply-<%=id%>-status');
35 e.innerHTML = '<%:Configuration applied.%>';
36 window.setTimeout(function() { e.parentNode.style.display = 'none' }, 1000);
41 var e = document.getElementById('cbi-apply-<%=id%>-status');
42 if( e && x.responseText ) e.innerHTML = x.responseText;
53 <img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
54 <span id="cbi-apply-<%=id%>-status"><%:Waiting for router...%></span>