...
 
Commits (2)
......@@ -98,8 +98,8 @@ $(CODE_DIR)/$(if $(CODE_LOAD),$(CODE_LOAD)-,)$(PLUGIN).js: $(TMP_DIR)/$(if $(COD
$(Q)cat $$^ > $$@
$(PLUGIN)-install: $(PLUGIN_DIR)/po/template.pot $(CODE_DIR)/$(if $(CODE_LOAD),$(CODE_LOAD)-,)$(PLUGIN).js
$(call Plugin/$(PLUGIN)/install,$(BIN))
$(Q)if [ -d $(PLUGIN_DIR)/ubus ]; then mkdir -p $(BACKEND_BIN_DIR); $(CP) $(PLUGIN_DIR)/ubus/* $(BACKEND_BIN_DIR); chmod +x $(BACKEND_BIN_DIR)/*; fi
$(Q)if [ -f $(PLUGIN_DIR)/menu.json ]; then mkdir -p $(BIN)/usr/share/rpcd/menu.d; $(CP) $(PLUGIN_DIR)/menu.json $(BIN)/usr/share/rpcd/menu.d/$(PLUGIN).json; fi
#$(Q)if [ -d $(PLUGIN_DIR)/ubus ]; then mkdir -p $(BACKEND_BIN_DIR); $(CP) $(PLUGIN_DIR)/ubus/* $(BACKEND_BIN_DIR); chmod +x $(BACKEND_BIN_DIR)/*; fi
#$(Q)if [ -f $(PLUGIN_DIR)/menu.json ]; then mkdir -p $(BIN)/usr/share/rpcd/menu.d; $(CP) $(PLUGIN_DIR)/menu.json $(BIN)/usr/share/rpcd/menu.d/$(PLUGIN).json; fi
#$(Q)if [ -f $(PLUGIN_DIR)/access.json ]; then mkdir -p $(BIN)/usr/share/rpcd/acl.d; $(CP) $(PLUGIN_DIR)/access.json $(BIN)/usr/share/rpcd/acl.d/$(PLUGIN).json; fi
endef
......
......@@ -23,7 +23,7 @@ JUCI.app
var def = $.Deferred();
async.series([
function(next){
$rpc.$call("juci.network", "online").done(function(res){
$rpc.$call("testnet", "status").done(function(res){
$scope.internet = res && res.online;
}).always(function(){next();});
}, function(next){
......@@ -35,9 +35,14 @@ JUCI.app
} ], function(){
$scope.link = undefined;
async.eachSeries($scope.model.wans, function(wan, next){
$rpc.$call("juci.network", "has_link", {"interface":wan[".name"]}).done(function(data){
if(data && data.has_link)
$scope.link = true;
$rpc.$call("network.interface."+wan[".name"], "status").done(function(netstatus){
if(netstatus && netstatus.device) {
$rpc.$call("network.device", "status", { "name" : netstatus.device }).done(function(netdev){
if(netdev && netdev.carrier) {
link_up = netdev.carrier;
}
}).fail(function(e){console.log(e);});
}
}).fail(function(e){
console.log(e);
}).always(function(){
......@@ -58,7 +63,8 @@ JUCI.app
$scope.model.wans.map(function(wan){
if(!wan.interface)
return;
$rpc.$call("juci.network", "ifup", {interface:wan.interface}).fail(function(e){console.log(e);});
$rpc.$call("network.interface."+wan.interface, "down", {}).fail(function(e){console.log(e);});
$rpc.$call("network.interface."+wan.interface, "up", {}).fail(function(e){console.log(e);});
});
}
......@@ -68,7 +74,7 @@ JUCI.app
content: $tr(gettext("Are you sure you want to reboot?")),
on_button: function(btn, inst){
if(btn.value == "yes"){
$rpc.$call("juci.system", "reboot", {}).done(function(){
$rpc.$call("system", "reboot", {}).done(function(){
inst.close();
});
setTimeout(function(){window.location = "/reboot.html";}, 1000);
......
......@@ -53,7 +53,7 @@ JUCI.app
next();
});
function refresh(){
$rpc.$call("juci.network", "online").done(function(res){
$rpc.$call("testnet", "status").done(function(res){
$scope.up = res && res.online;
$scope.$apply();
}).fail(function(er){console.log(er);});
......@@ -123,7 +123,7 @@ JUCI.app
function update_online(){
var def = $.Deferred();
$rpc.$call("juci.network", "online").done(function(res){
$rpc.$call("testnet", "status").done(function(res){
$scope.online = res && res.online;
$scope.$apply();
def.resolve();
......@@ -144,9 +144,14 @@ JUCI.app
}
var link_up = false;
async.eachSeries($scope.wans, function(wan, next){
$rpc.$call("juci.network", "has_link", {"interface":wan[".name"]}).done(function(data){
if(data && data.has_link)
link_up = true;
$rpc.$call("network.interface."+wan[".name"], "status").done(function(netstatus){
if(netstatus && netstatus.device) {
$rpc.$call("network.device", "status", { "name" : netstatus.device }).done(function(netdev){
if(netdev && netdev.carrier) {
link_up = netdev.carrier;
}
}).fail(function(e){console.log(e);});
}
}).fail(function(e){
console.log(e);
}).always(function(){
......