Files

25 lines
781 B
HTML

<%+cbi/valueheader%>
<script type="text/javascript">
//<![CDATA[
function import_file_name(btn, option, file_path) {
ocPrompt('<%:Paste the name of the new file (including the extension) here:%>', '', function(value, setError, close) {
if (!value) return;
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "create_file")%>', {filename: value, filepath: file_path}, function(x, status) {
if (x && x.status == 200)
{
close();
location.reload();
}
else
{
setError('<%:Create File Failed%>');
}
});
});
return false;
}
//]]>
</script>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Create File%>" onclick="return import_file_name(this, '<%=self.option%>', '<%=self.value%>')" />
<%+cbi/valuefooter%>