35 lines
1.3 KiB
HTML
35 lines
1.3 KiB
HTML
|
<%+cbi/valueheader%>
|
||
|
<script type="text/javascript">//<![CDATA[
|
||
|
function update_data(btn, dataname)
|
||
|
{
|
||
|
btn.disabled = true;
|
||
|
btn.value = '<%:Updating...%> ';
|
||
|
st=dataname;
|
||
|
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "mosdns", "geo_update")%>',
|
||
|
{ set:st },
|
||
|
function(x,data)
|
||
|
{
|
||
|
var tb = document.getElementById(dataname+'-status');
|
||
|
if (tb)
|
||
|
{
|
||
|
switch (data.updating)
|
||
|
{
|
||
|
case true:
|
||
|
tb.innerHTML = "<font color='green'>" + "<%:Update success%>" + "</font>";
|
||
|
break;
|
||
|
case false:
|
||
|
tb.innerHTML = "<font color='red'>" + "<%:Update failed, Please check the network status%>" + "</font>";
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
btn.disabled = false;
|
||
|
btn.value = '<%:Check And Update%>';
|
||
|
}
|
||
|
);
|
||
|
return false;
|
||
|
}
|
||
|
//]]></script>
|
||
|
<input type="button" class="btn cbi-button-action" value="<%:Check And Update%>" onclick="return update_data(this,'<%=self.option%>')" />
|
||
|
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
|
||
|
<%+cbi/valuefooter%>
|