<%+cbi/valueheader%>
<%
	local fs = require "luci.openclash"
	local filename = fs.filename(self:cfgvalue(section)) or "config"
	local display = self.display or ""
	local idname = math.random(1000)..(string.match(filename, "[%w_]+") or "")
%>
<script type="text/javascript">//<![CDATA[
	function act_update_config_<%=idname%>(btn)
	{
		btn.disabled = true;
		btn.value    = '<%:UpDate%>';
		XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","update_config")%>',{filename: "<%=filename%>"}, function(x,status){});
		btn.disabled = false;
		return false;
	};
	
//]]></script>

<%
	if display == "" then
%>
<input type="button" class="btn cbi-button cbi-input-reload" value="<%:UpDate%>" onclick="return act_update_config_<%=idname%>(this)" />
<%
	end
%>
<%+cbi/valuefooter%>
