mirror of
https://github.com/mkschreder/juci.git
synced 2025-01-09 04:19:29 +08:00
Wifi validation fix
This commit is contained in:
parent
358f99fb30
commit
799834d4b5
@ -58,7 +58,7 @@ var spawn = require('child_process').spawn;
|
||||
setTimeout(function recompile(){
|
||||
spawn('make', ["-C", "juci-theme-inteno"], { customFds: [0,1,2] })
|
||||
.on("exit", function(code){
|
||||
spawn('make', ["debug"], { customFds: [0,1,2] })
|
||||
spawn('make', ["debug", "DEFAULT_THEME=y"], { customFds: [0,1,2] })
|
||||
.on("exit", function(code){
|
||||
console.log("Recompiled gui, code: "+code);
|
||||
setTimeout(recompile, 5000);
|
||||
|
@ -30,6 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</juci-config-section>
|
||||
<juci-errors></juci-errors>
|
||||
<juci-config-apply></juci-config-apply>
|
||||
</div>
|
||||
</juci-layout-with-sidebar>
|
||||
|
@ -38,7 +38,6 @@
|
||||
</div>
|
||||
</juci-config-line>
|
||||
</juci-config-lines>
|
||||
<juci-errors ng-model="errors"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,7 +80,7 @@
|
||||
case "psk":
|
||||
case "psk2":
|
||||
case "mixed-psk": {
|
||||
if(!section.key.value || !(section.key.value.length > 8 && section.key.value.length < 64))
|
||||
if(!section.key.value || !(section.key.value.length >= 8 && section.key.value.length < 64))
|
||||
throw new Error("WPA key must be 8-63 characters long!");
|
||||
} break;
|
||||
default:
|
||||
|
@ -24,7 +24,7 @@ fi
|
||||
#done
|
||||
|
||||
if [ "$MODE" == "RELEASE" ]; then
|
||||
for file in `find ${WWW} -type f | grep -v "\.gz"`; do
|
||||
for file in `find ${WWW} -type f | grep -v "\.gz" | grep -v cgi-bin`; do
|
||||
echo "Compressing ${file}...";
|
||||
gzip -f ${file}
|
||||
done
|
||||
@ -75,4 +75,6 @@ echo "<!doctype html>
|
||||
</body>
|
||||
</html>" > ${INDEX}
|
||||
|
||||
gzip -f ${INDEX}
|
||||
if [ "$MODE" == "RELEASE" ]; then
|
||||
gzip -f ${INDEX}
|
||||
fi
|
||||
|
@ -57,7 +57,7 @@ INDEX:=$(OUTDIR)/index.html
|
||||
TEMPLATES:=$(wildcard src/html/*.html) $(wildcard src/widgets/*.html) $(wildcard src/pages/*.html)
|
||||
JUCI_TEMPLATE_CC:=../juci-build-tpl-cache
|
||||
|
||||
all: $(OUTDIR) files $(CSS) $(JSLIB) $(JS) $(INDEX) $(HTML)
|
||||
all: $(OUTDIR) files $(CSS) $(JSLIB) $(JS) $(HTML)
|
||||
cat $(HTML) >> $(JS)
|
||||
rm -f $(HTML)
|
||||
|
||||
@ -71,7 +71,7 @@ files:
|
||||
$(INSTALL_DIR) $(OUTDIR)/js/
|
||||
$(CP) ./src/img/ $(OUTDIR)/
|
||||
$(CP) ./src/fonts/ $(OUTDIR)/
|
||||
$(CP) ./src/index.html $(OUTDIR)/
|
||||
#$(CP) ./src/index.html $(OUTDIR)/
|
||||
# TODO: this needs to be replaced later with /etc/config/juci with proper acl permissions
|
||||
$(CP) ./juci.config.json $(OUTDIR)/config.json
|
||||
|
||||
@ -87,9 +87,6 @@ $(JSLIB): $(JSLIBS)
|
||||
rm -f $(JSLIB); touch $(JSLIB)
|
||||
for file in $(JSLIBS); do echo $$file; cat $$file >> $(JSLIB); echo ';' >> $(JSLIB); done
|
||||
|
||||
$(INDEX): src/index.html
|
||||
cp $(INDEX) src/index.html
|
||||
|
||||
$(HTML): $(TEMPLATES)
|
||||
$(JUCI_TEMPLATE_CC) $(TEMPLATES) $(HTML)
|
||||
|
||||
|
@ -111,6 +111,9 @@ JUCI.app.config(function ($stateProvider, $locationProvider, $compileProvider, $
|
||||
$rootScope.errors.concat(errors.map(function(x){ return { message: x }; }));
|
||||
}
|
||||
});
|
||||
$rootScope.$on("errors_begin", function(ev){
|
||||
$rootScope.errors.splice(0, $rootScope.errors.length);
|
||||
});
|
||||
// set current language
|
||||
gettextCatalog.currentLanguage = "en";
|
||||
gettextCatalog.debug = true;
|
||||
|
@ -263,6 +263,10 @@
|
||||
errors.push(k+": "+err);
|
||||
}
|
||||
});
|
||||
if(self[".validator"] && (self[".validator"] instanceof Function)){
|
||||
var e = self[".validator"](self);
|
||||
if(e) errors.push(e);
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,7 @@ $juci.module("core")
|
||||
};
|
||||
}).controller("juciConfigApplyController", function($scope, $uci){
|
||||
$scope.onApply = function(){
|
||||
$scope.$emit("errors_begin");
|
||||
//if($scope.onPreApply) $scope.onPreApply();
|
||||
$scope.busy = 1;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user