Selaa lähdekoodia

fix nxfs error

rufengsuixing 5 vuotta sitten
vanhempi
sitoutus
45d82a4e8d
2 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 1 1
      luasrc/controller/AdGuardHome.lua
  2. 5 5
      luasrc/view/AdGuardHome/yamleditor.htm

+ 1 - 1
luasrc/controller/AdGuardHome.lua

@@ -16,7 +16,7 @@ entry({"admin", "services", "AdGuardHome"},
 	entry({"admin", "services", "AdGuardHome", "reloadconfig"}, call("reload_config"))
 end 
 function reload_config()
-	NXFS.remove("/tmp/AdGuardHometmpconfig.yaml")
+	nixio.fs.remove("/tmp/AdGuardHometmpconfig.yaml")
 	luci.http.prepare_content("application/json")
 	luci.http.write('')
 end

+ 5 - 5
luasrc/view/AdGuardHome/yamleditor.htm

@@ -20,15 +20,15 @@ matchBrackets: true,//括号匹配
 foldGutter: true
 }
 );
-//]]>
 function reload_config(){
 	XHR.get('<%=url([[admin]], [[services]], [[AdGuardHome]], [[reloadconfig]])%>', null,
 	function(x, data) {
 	location.reload();
-	});
+	});}
+//]]>
 </script> 
-<%if NXFS.access("/tmp/AdGuardHometmpconfig.yaml") then%>
+<%fs=require"nixio.fs"%>
+<%if fs.access("/tmp/AdGuardHometmpconfig.yaml") then%>
 <input type="button" id="apply_update_button" value="<%:Reload Config%>" onclick=" return reload_config() "/>
 <%end%>
-<%+cbi/valuefooter%>
-	
+<%+cbi/valuefooter%>