changed from ubus-scriptd to questd
authorReidar Cederqvist <reidar.cederqvist@gmail.com>
Thu, 31 Mar 2016 14:30:09 +0000 (16:30 +0200)
committerReidar Cederqvist <reidar.cederqvist@gmail.com>
Thu, 31 Mar 2016 15:52:31 +0000 (17:52 +0200)
77 files changed:
juci/access.json
juci/src/js/juci.js
plugins/juci-broadcom-dsl/access.json
plugins/juci-broadcom-dsl/src/main.js
plugins/juci-broadcom-dsl/src/pages/page-broadcom-dsl-status.js
plugins/juci-broadcom-ethernet/access.json
plugins/juci-broadcom-wl/access.json
plugins/juci-broadcom-wl/src/broadcom-wl.js
plugins/juci-broadcom-wl/src/pages/wireless-status.js
plugins/juci-broadcom-wl/src/widgets/overview.wifi.js
plugins/juci-broadcom-wl/src/widgets/uci.wireless.device.edit.js
plugins/juci-ddns/access.json
plugins/juci-ddns/src/widgets/ddns-network-settings-edit.js
plugins/juci-diagnostics/access.json
plugins/juci-diagnostics/src/pages/status-diagnostics.js
plugins/juci-diagnostics/src/widgets/diagnostics-widget-speedtest.js
plugins/juci-dnsmasq-dhcp/access.json
plugins/juci-dnsmasq-dhcp/src/widgets/dhcp-leases-widget.js
plugins/juci-dropbear/access.json
plugins/juci-dropbear/src/pages/settings-management-dropbear.js
plugins/juci-ethernet/access.json
plugins/juci-ethernet/src/juci-ethernet.js
plugins/juci-event/src/pages/status-events.js
plugins/juci-firewall-fw3/access.json
plugins/juci-firewall-fw3/src/pages/internet-firewall-dmz.js
plugins/juci-firewall-fw3/src/pages/internet-parental-control.js
plugins/juci-firewall-fw3/src/widgets/firewall-client-port-mapping.js
plugins/juci-generate-page/access.json
plugins/juci-igmpinfo/access.json
plugins/juci-igmpinfo/src/pages/status-tv.js
plugins/juci-inteno-router/access.json
plugins/juci-inteno-voice-client/access.json
plugins/juci-inteno-voice-client/src/widgets/brcm-advanced.js
plugins/juci-inteno-voice-client/src/widgets/sip-advanced.js
plugins/juci-minidlna/access.json
plugins/juci-minidlna/src/pages/internet-services-minidlna.js
plugins/juci-minidlna/src/widgets/minidlna-file-tree.js
plugins/juci-mod-status/src/pages/status-restart.js
plugins/juci-mod-status/src/pages/status-status-network.js
plugins/juci-mod-system/access.json
plugins/juci-mod-system/src/pages/settings-configuration.js
plugins/juci-mod-system/src/pages/settings-password.js
plugins/juci-mod-system/src/pages/settings-services.js
plugins/juci-mod-system/src/pages/settings-system.js
plugins/juci-mod-system/src/pages/status-system-processes.js
plugins/juci-mod-system/src/pages/status-system.js
plugins/juci-mod-system/src/system.js
plugins/juci-natalie-dect/access.json
plugins/juci-natalie-dect/src/pages/voice-dect.js
plugins/juci-netmode/access.json
plugins/juci-network-netifd/access.json
plugins/juci-network-netifd/src/network-netifd.js
plugins/juci-network-netifd/src/pages/status-network-routes.js
plugins/juci-network-netifd/src/widgets/network-connection-edit.js
plugins/juci-network-netifd/src/widgets/network-connection-proto-3g-edit.js
plugins/juci-network-netifd/src/widgets/network-connection-proto-4g-edit.js
plugins/juci-network-netifd/src/widgets/network-connection-proto-ppp-edit.js
plugins/juci-openwrt-wireless/access.json
plugins/juci-openwrt-wireless/src/openwrt-wireless.js
plugins/juci-openwrt-wireless/src/pages/wireless-clients.js
plugins/juci-openwrt-wireless/src/pages/wireless-status-simple.js
plugins/juci-openwrt-wireless/src/widgets/overview.wifi.js
plugins/juci-openwrt-wireless/src/widgets/uci.wireless.device.edit.js
plugins/juci-openwrt-wireless/src/widgets/uci.wireless.interface.macfilter.edit.js
plugins/juci-realtime-graphs/access.json
plugins/juci-realtime-graphs/src/widgets/rtgraph-ethernet-interface.js
plugins/juci-router-openwrt/access.json
plugins/juci-samba/access.json
plugins/juci-samba/src/widgets/samba-file-tree.js
plugins/juci-samba/src/widgets/samba-share-edit.js
plugins/juci-sysupgrade/access.json
plugins/juci-sysupgrade/src/pages/settings-upgrade.js
plugins/juci-sysupgrade/src/sysupgrade.js [deleted file]
plugins/juci-upnp/access.json
plugins/juci-upnp/src/pages/upnpd-settings.js
plugins/juci-upnp/src/pages/upnpd-status.js
plugins/juci-usb/access.json

index 9b9ad74..cc386b4 100644 (file)
@@ -31,7 +31,8 @@
                "read": {
                        "ubus": {
                                "/juci/system": [
-                                       "events"
+                                       "run"
+                                       /*"events"*/
                                ], 
                                "juci.ui": [
                                        "*"
index ec69463..8e6da91 100644 (file)
@@ -86,8 +86,8 @@
                // TODO: maybe rewrite the init sequence
                async.series([
                        function(next){
-                               scope.UBUS.$init().done(function(){
-                                       if(!scope.UBUS.juci || !scope.UBUS.juci.system || !scope.UBUS.juci.system.info){
+                               $rpc.$init().done(function(){
+                                       if(!$rpc.juci || !$rpc.juci.system){
                                                // TODO: make this prettier. 
                                                //alert("Can not establish ubus connection to router. If the router is rebooting then please wait a few minutes and try again."); 
                                                //return; 
                                        JUCI.page(page, "pages/"+page+".html", redirect); 
                                }); 
                                next(); 
-                               /*$rpc.juci.ui.menu().done(function(data){
-                                       //console.log(JSON.stringify(data)); 
-                                       // get menu keys and sort them so that parent elements will come before their children
-                                       // this will automatically happen using normal sort because parent element paths are always shorter than their childrens. 
-                                       //var keys = Object.keys(data.menu).sort(function (a, b) { 
-                                       //      return a.localeCompare(b) ; 
-                                       //}); 
-                                       var keys = Object.keys(data.menu); 
-                                       
-                                       keys.map(function(key){
-                                               var menu = data.menu[key]; 
-                                               var view = menu.view; 
-                                               var redirect = menu.redirect; 
-                                               var path = key; 
-                                               //console.log("MENU: "+path); 
-                                               var obj = {
-                                                       path: path, 
-                                                       href: menu.page || path.replace(/\//g, "-").replace(/_/g, "-"), 
-                                                       modes: menu.modes || [ ], 
-                                                       text: menu.title 
-                                               }; 
-                                               $juci.navigation.register(obj); 
-                                               if(redirect) redirect = redirect.replace(/\//g, "-").replace(/_/g, "-"); 
-                                               // NOTE: all juci page templates currently have form word<dot>word<dot>..html
-                                               // And their names correspond to the structure of the menu we get from the box.
-                                               // - This makes it easy to find the right page file and simplifies managing a lot of pages.
-                                               // - This also allows plugins to override existing pages simply by supplying their own versions of the page templates
-                                               // - Conclusion: this is one of the things that should almost never be rewritten without providing 
-                                               //   a fallback mechanism for supporting the old (this) way because all plugins depend on this.  
-                                               // JUCI.page(obj.href, "pages/"+obj.path.replace(/\//g, ".")+".html", redirect); 
-                                               JUCI.page(obj.href, "pages/"+obj.href+".html", redirect); 
-                                       }); 
-                                       //console.log("NAV: "+JSON.stringify($navigation.tree())); 
-                                       //$rootScope.$apply(); 
-                                       next(); 
-                               }).fail(function(){
-                                       next();
-                               });*/ 
                        }, 
                        function(next){
                                // set various gui settings such as mode (and maybe theme) here
index e638a6a..ec7eb45 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {
                                "/juci/broadcom.dsl": [
-                                       "status"
+                                       "run"
+                                       /*"status"*/
                                ]
                        }, 
                        "uci": [
index f8d1396..89febf2 100644 (file)
@@ -74,7 +74,7 @@ JUCI.app
                        return deferred.promise(); 
                }, 
                status: function(){
-                       return $rpc.juci.broadcom.dsl.status(); 
+                       return $rpc.juci.broadcom.dsl.run({"method":"status"}); 
                }
        }; 
 }).run(function($ethernet, $network, $uci, $broadcomDsl){
index 1b78d5e..b78ce20 100644 (file)
@@ -46,7 +46,7 @@ JUCI.app
                }; 
 
                JUCI.interval.repeat("dslstatus", 1000, function(done){
-                       $rpc.juci.broadcom.dsl.status().done(function(dslstats){
+                       $rpc.juci.broadcom.dsl.run({"method":"status"}).done(function(dslstats){
                                dslstats = dslstats.dslstats; 
                                
                                // compute floating point values (because ubus blobs do not support floats yet)
index 9f89c50..f8bcd9a 100644 (file)
@@ -26,7 +26,8 @@
                "read": {
                        "ubus": {
                                "/juci/ethernet": [
-                                       "adapters"
+                                       "run"
+                                       /*"adapters"*/
                                ] 
                        }, 
                        "uci": [
index 76e8597..cac18fe 100644 (file)
@@ -4,26 +4,29 @@
                "read": {
                        "ubus": {
                                "/juci/wireless.wps": [
-                                       "genpin", 
-                                       "pbc", 
-                                       "setpin", 
-                                       "showpin", 
-                                       "stapin", 
-                                       "checkpin",
-                                       "status", 
-                                       "stop"
+                                       "run"
+                                       /*"genpin", */
+                                       /*"pbc", */
+                                       /*"setpin", */
+                                       /*"showpin", */
+                                       /*"stapin", */
+                                       /*"checkpin",*/
+                                       /*"status", */
+                                       /*"stop"*/
                                ], 
                                "/juci/wireless": [
-                                       "defaults", 
-                                       "radios", 
-                                       "devices", 
-                                       "clients", 
-                                       "scan", 
-                                       "scanresults"
+                                       "run"
+                                       /*"defaults", */
+                                       /*"radios", */
+                                       /*"devices", */
+                                       /*"clients", */
+                                       /*"scan", */
+                                       /*"scanresults"*/
                                ],
                                "/juci/broadcom.wireless.lua": [
-                                       "scan", 
-                                       "scanresults"
+                                       "run"
+                                       /*"scan", */
+                                       /*"scanresults"*/
                                ],
                                "router": [
                                        "stas",
index 28ccf55..02d5cb6 100644 (file)
@@ -159,7 +159,7 @@ JUCI.app.factory("$wireless", function($uci, $rpc, $network, gettext){
        
        Wireless.prototype.getDefaults = function(){
                var deferred = $.Deferred(); 
-               $rpc.juci.wireless.defaults().done(function(result){
+               $rpc.juci.wireless.run({"method":"defaults"}).done(function(result){
                        if(!result) {
                                deferred.reject(); 
                                return; 
@@ -174,7 +174,7 @@ JUCI.app.factory("$wireless", function($uci, $rpc, $network, gettext){
        
        Wireless.prototype.scan = function(opts){
                var deferred = $.Deferred(); 
-               $rpc.juci.broadcom.wireless.lua.scan(opts).always(function(){
+               $rpc.juci.broadcom.wireless.lua.run({"method":"scan", "args":JSON.stringify(opts)}).always(function(){
                        deferred.resolve(); 
                });  
                return deferred.promise(); 
@@ -182,7 +182,7 @@ JUCI.app.factory("$wireless", function($uci, $rpc, $network, gettext){
        
        Wireless.prototype.getScanResults = function(opts){
                var deferred = $.Deferred(); 
-               $rpc.juci.broadcom.wireless.lua.scanresults(opts).done(function(result){
+               $rpc.juci.broadcom.wireless.lua.run({"method":"scanresults", "args":JSON.stringify(opts)}).done(function(result){
                        deferred.resolve(result.access_points); 
                }); 
                return deferred.promise(); 
index 8ae000e..def2137 100644 (file)
@@ -24,7 +24,7 @@ JUCI.app
        }
        $scope.radioToScan = {};
        $uci.$sync("wireless").done(function(){
-               $rpc.juci.wireless.radios().done(function(data){
+               $rpc.juci.wireless.run({"method":"radios"}).done(function(data){
                        $scope.wlRadios = Object.keys(data).map(function(x){ return data[x]; });
                        $scope.scanableRadios = $scope.wlRadios.filter(function(radio){
                                return parseInt(radio.current_channel) < 52;
index c61dc26..be6a916 100644 (file)
@@ -33,7 +33,7 @@ JUCI.app
 })
 .controller("overviewStatusWidgetWifi", function($scope, $uci, $rpc){
        $scope.wifiRadios = [];
-       $rpc.juci.wireless.radios().done(function(data){
+       $rpc.juci.wireless.run({"method":"radios"}).done(function(data){
                $scope.wifiRadios = Object.keys(data).map(function(radio){ return data[radio]; });
                $scope.$apply(); 
        });
@@ -102,7 +102,7 @@ JUCI.app
                async.series([
                        function(next){
                                $uci.$sync("wireless").done(function(){
-                                       $rpc.juci.wireless.devices().done(function(result){
+                                       $rpc.juci.wireless.run({"method":"devices"}).done(function(result){
                                                $scope.vifs = $uci.wireless["@wifi-iface"].map(function(iface){
                                                        var dev = result.devices.find(function(dev){
                                                                return iface.ifname.value == dev.device; 
index 39661f2..c76c1f5 100644 (file)
@@ -32,7 +32,7 @@ JUCI.app
        $scope.$watch("device", function(device){
                if(!device) return; 
 
-               $rpc.juci.wireless.radios().done(function(result){
+               $rpc.juci.wireless.run({"method":"radios"}).done(function(result){
                        if(device[".name"] in result){
                                var settings = result[device[".name"]]; 
                                $scope.allChannels = settings.channels.map(function(x){ return { label: x, value: x }; }); 
index e77aa88..212b765 100644 (file)
@@ -8,7 +8,8 @@
                        ], 
                        "ubus": {
                                "/juci/ddns": [ 
-                                       "providers"
+                                       "run"
+                                       /*"providers"*/
                                ]
                        }
                },
index 9838618..72a8838 100644 (file)
@@ -47,7 +47,7 @@ JUCI.app
                }); 
                $scope.$apply(); 
        }); 
-       $rpc.juci.ddns.providers().done(function(result){
+       $rpc.juci.ddns.run({"method":"providers"}).done(function(result){
                if(!result || !result.providers) return; 
                $scope.allServices = result.providers.map(function(p){ return { label: p, value: p }}); 
                $scope.$apply(); 
index 85a3925..7a7cb7f 100644 (file)
@@ -7,8 +7,9 @@
                                        "run"
                                ],
                                "/juci/diagnostics": [
-                                       "ping", 
-                                       "traceroute"
+                                       "run"
+                                       /*"ping", */
+                                       /*"traceroute"*/
                                ]
                        },
                        "uci": [
index 70cb311..a3fea29 100644 (file)
@@ -26,7 +26,7 @@ JUCI.app
                $scope.$apply(); 
        }); 
        $scope.onTraceTest = function(){
-               $rpc.juci.diagnostics.traceroute({ host: $scope.data.traceHost }).done(function(result){
+               $rpc.juci.diagnostics.run({"method":"traceroute","args":JSON.stringify({ host: $scope.data.traceHost })}).done(function(result){
                        if(result.stderr) $scope.data.traceError = result.stderr; 
                        $scope.data.traceResults = result.stdout; 
                        $scope.$apply(); 
@@ -39,7 +39,7 @@ JUCI.app
        $scope.onPingTest = function(){
                $scope.data.pingResults = "..."; 
                $scope.data.error = "";
-               $rpc.juci.diagnostics.ping({ host: $scope.data.pingHost }).done(function(result){
+               $rpc.juci.diagnostics.run({"method":"ping","args":JSON.stringify({ host: $scope.data.pingHost })}).done(function(result){
                        if(result.stderr) $scope.data.pingError = result.stderr; 
                        $scope.data.pingResults = result.stdout; 
                        $scope.$apply(); 
index 18d27bf..36b3805 100644 (file)
@@ -59,12 +59,12 @@ JUCI.app
                var port = server.port.value;
                var address = server.server.value;
                $scope.data.state="running";
-               $rpc.juci.speedtest.run({
+               $rpc.juci.speedtest.run({"method":"run","args":JSON.stringify({
                        "testmode": $scope.data.test_type,
                        "port": port,
                        "packagesize": $scope.data.packagesize * 1000,
                        "address": address
-               }).done(function(response){
+               })}).done(function(response){
                        if(response && response.message=="success"){
                                $scope.data.state="running";
                        }else{
index 90b37a1..56b3784 100644 (file)
@@ -7,8 +7,9 @@
                        ],
                        "ubus": {
                                "/juci/dhcp": [
-                                       "ipv4leases",
-                                       "ipv6leases"
+                                       "run"
+                                       /*"ipv4leases",*/
+                                       /*"ipv6leases"*/
                                ]
                        }
                },
index 677a2ae..cb1ec34 100644 (file)
@@ -28,7 +28,7 @@ JUCI.app
 })
 .controller("dhcpLeasesWidget", function($rpc, $uci, $scope){
        JUCI.interval.repeat("ipv4leases", 1000, function(done){
-               $rpc.juci.dhcp.ipv4leases().done(function(data){
+               $rpc.juci.dhcp.run({"method":"ipv4leases"}).done(function(data){
                        $scope.ipv4leases = data.leases;
                        $scope.$apply();
                }).always(function(){
@@ -36,7 +36,7 @@ JUCI.app
                });
        });
        JUCI.interval.repeat("ipv6leases", 1000, function(done){
-               $rpc.juci.dhcp.ipv6leases().done(function(data){
+               $rpc.juci.dhcp.run({"method":"ipv6leases"}).done(function(data){
                        $scope.ipv6leases = data.leases;
                        $scope.$apply();
                }).always(function(){
index 41c3503..93eb046 100644 (file)
@@ -4,9 +4,10 @@
                "read": {
             "ubus": {
                                "/juci/dropbear": [
-                                       "add_public_key",
-                                       "get_public_keys",
-                                       "remove_public_key"
+                                       "run"
+                                       /*"add_public_key",*/
+                                       /*"get_public_keys",*/
+                                       /*"remove_public_key"*/
                 ]
             },
                        "uci": [
index b51254f..2fb6743 100644 (file)
@@ -78,7 +78,7 @@ JUCI.app
                }
        }
        function refresh(){
-               $rpc.juci.dropbear.get_public_keys().done(function(result){
+               $rpc.juci.dropbear.run({"method":"get_public_keys"}).done(function(result){
                        $scope.keyList = result.keys;
                        $scope.$apply();
                }).fail(function(){
@@ -88,7 +88,7 @@ JUCI.app
        refresh(); 
 
        $scope.onDeleteKey = function(item){
-               $rpc.juci.dropbear.remove_public_key(item).done(function(res){
+               $rpc.juci.dropbear.run({"method":"remove_public_key","args":JSON.stringify(item)}).done(function(res){
                        if(res.error) alert($tr(res.error));    
                        refresh();
                });
@@ -96,7 +96,7 @@ JUCI.app
 
        $scope.onAddKey = function(){
                dropbearAddKey.show().done(function(data){
-                       $rpc.juci.dropbear.add_public_key(data).done(function(result){
+                       $rpc.juci.dropbear.run({"method":"add_public_key", "args":JSON.stringify(data)}).done(function(result){
                                if(result.error) alert($tr(result.error)); 
                                refresh();
                        });
index b12ae92..48e892d 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {
                                "/juci/ethernet": [
-                                       "adapters"
+                                       "run"
+                                       /*"adapters"*/
                                ]
                        }
                }
index 1e38f7b..30fcfc5 100644 (file)
@@ -32,7 +32,7 @@ JUCI.app.factory("$ethernet", function($rpc){
        Ethernet.prototype.getAdapters = function(){
                var def = $.Deferred(); 
                var self = this; 
-               $rpc.juci.ethernet.adapters().done(function(result){
+               $rpc.juci.ethernet.run({"method":"adapters"}).done(function(result){
                        if(result && result.adapters) {
                                // pipe all adapters though all subsystems and annotate them
                                async.each(self._subsystems, function(sys, next){
index 41933fd..7a0ffdf 100644 (file)
@@ -71,11 +71,7 @@ JUCI.app
                if($scope.data.filter == "") limit = limit.slice(0, -1);
                else limit += $scope.data.filter;
                if(request === null){
-                       request = $rpc.juci.system.log({
-                               limit: $scope.data.limit, 
-                               filter: limit,
-                               type: $scope.data.type
-                       }).done(function(result){
+                       request = $rpc.juci.system.run({"method":"log", "args": "{\"limit\":\""+$scope.data.limit+"\",\"filter\":\""+limit+"\",\"type\": \""+$scope.data.type+"\"}"}).done(function(result){
                                if(result && result.lines){
                                        $scope.logs = result.lines; 
                                        $scope.$apply();
index 53d3b59..c407613 100644 (file)
@@ -7,10 +7,12 @@
                                        "status"
                                ],
                                "/juci/firewall": [
-                                       "excluded_ports"
+                                       "run"
+                                       /*"excluded_ports"*/
                                ],
                                "/juci/system.time": [
-                                       "timediff"
+                                       "run"
+                                       /*"timediff"*/
                                ]
                        }, 
                        "uci": [
index a6e7b2b..550ec30 100644 (file)
@@ -31,7 +31,7 @@ JUCI.app
                $uci.firewall.dmz.ip6addr.value = value.ip6addr; 
        }); 
        // Excluded ports is read from a tmp file that is not created by default. This is a patch feature added to dmz firewall script. Please update your script if you want to use it. 
-       $rpc.juci.firewall && $rpc.juci.firewall.excluded_ports().done(function(data){
+       $rpc.juci.firewall && $rpc.juci.firewall.run({"method":"excluded_ports"}).done(function(data){
                if(data.result && data.result.length){
                        $scope.nonforwardedPorts = data.result;
                        $scope.$apply();
index dddc646..54e6e6a 100644 (file)
@@ -60,7 +60,7 @@ JUCI.app
                                next(); 
                        }
                }, function(next){
-                       $rpc.juci.system.time.timediff().done(function(data){
+                       $rpc.juci.system.time.run({"method":"timediff"}).done(function(data){
                                $scope.diff = data.diff;
                        }).always(function(){next();});
                }], function(){
index 675487c..357236c 100644 (file)
@@ -29,7 +29,7 @@ JUCI.app
 
        $scope.$watch("client", function(){
                if(!$rpc.juci.firewall) return;
-               $rpc.juci.firewall.excluded_ports().done(function(res){
+               $rpc.juci.firewall.run({"method":"excluded_ports"}).done(function(res){
                        $scope.excluded_ports = res.result || "";
                        reload();
                });
index 7ea8d3f..51debd2 100644 (file)
@@ -7,12 +7,14 @@
                        ],
                        "ubus": {
                                "/juci/minidlna": [
-                                       "folder_tree",
-                                       "autocomplete",
-                                       "status"
+                                       "run"
+                                       /*"folder_tree",*/
+                                       /*"autocomplete",*/
+                                       /*"status"*/
                                ],
                                "/juci/system.service": [
-                                       "status"
+                                       "run"
+                                       /*"status"*/
                                ]
                        }
                },
index 9417abe..e22cd25 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {
                                "/juci/iptv": [
-                                       "igmptable"
+                                       "run"
+                                       /*"igmptable"*/
                                ]
                        }
                }
index f121ce6..e62335f 100644 (file)
@@ -21,7 +21,7 @@
 JUCI.app
 .controller("StatusTVPageCtrl", function($scope, $rpc, gettext){
        if($rpc.juci.iptv){
-               $rpc.juci.iptv.igmptable().done(function(result){
+               $rpc.juci.iptv.run({"method":"igmptable"}).done(function(result){
                        if(!result.table) {
                                $scope.$emit("error", gettext("Unable to retreive igmptable from device!")); 
                                return; 
index c77a6ee..fd6ff34 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {
                                "/juci/iptv": [
-                                       "igmptable"
+                                       "run"
+                                       /*"igmptable"*/
                                ]
                        }
                }
index 0623c05..8b75d8b 100644 (file)
                                        "list"
                                ],
                                "/juci/voice_client": [
-                                       "get_trusted_ca",
-                                       "set_trusted_ca"
+                                       "run"
+                                       /*"get_trusted_ca",*/
+                                       /*"set_trusted_ca"*/
                                ],
                                "/juci/system": [
-                                       "reboot"
+                                       "run"
+                                       /*"reboot"*/
                                ]
                        }, 
                        "uci": [
index 43d5b54..12346a9 100644 (file)
@@ -28,7 +28,7 @@ JUCI.app
                                on_apply: function(btn){
                                        if(btn.value == "apply"){
                                                $uci.$save().done(function(){
-                                                       $rpc.juci.system.reboot()
+                                                       $rpc.juci.system.run({"method":"reboot"})
                                                        console.log("rebooting");
                                                        location = "/reboot.html";
                                                });
index e1dad46..0747bf2 100644 (file)
@@ -10,13 +10,13 @@ JUCI.app
        };
 }).controller("sipAdvancedCtrl", function($scope, $uci, $tr, gettext, $network, $rpc){
        $scope.ssl = {};
-       $rpc.juci.voice_client.get_trusted_ca().done(function(data){
+       $rpc.juci.voice_client.run({"method":"get_trusted_ca"}).done(function(data){
                $scope.ssl.ovalue = $scope.ssl.value = data.result;
                $scope.$apply();
        });
        $scope.save_ssl = function(){
                var test = $scope.ssl.value.split("\n").join("\n\r");
-               $rpc.juci.voice_client.set_trusted_ca({data:test}).done(function(data){
+               $rpc.juci.voice_client.run({"method":"set_trusted_ca","args":JSON.stringify({data:test})}).done(function(data){
                        if(data.result == "success"){
                                $scope.ssl.ovalue = $scope.ssl.value;
                                $scope.ssl.saved = true;
index a1c7b2d..6a4c268 100644 (file)
@@ -7,12 +7,14 @@
                        ],
                        "ubus": {
                                "/juci/minidlna": [
-                                       "folder_tree",
+                                       "run"
+                                       /*"folder_tree",
                                        "autocomplete",
-                                       "status"
+                                       "status"*/
                                ],
                                "/juci/system.service": [
-                                       "status"
+                                       "run"
+                                       /*"status"*/
                                ]
                        }
                },
index 09d712a..23f18c0 100644 (file)
@@ -58,12 +58,12 @@ JUCI.app
                });
        });
 
-       $rpc.juci.minidlna.status().done(function(data){
+       $rpc.juci.minidlna.run({"method":"status"}).done(function(data){
                $scope.count = data.count;
                $scope.$apply();
        });
        
-       $rpc.juci.system.service.status({name:"minidlna"}).done(function(result){
+       $rpc.juci.system.service.run({"method":"status", "args":"{\"name\":\"minidlna\"}"}).done(function(result){
                $scope.is_running = result.running ? "active" : "inactive";
                $scope.$apply();
        });
@@ -140,7 +140,7 @@ JUCI.app
        var tag_promise = null;
        $scope.loadTags = function(text){
                if(!tag_promise) tag_promise = new Promise(function(resolve, reject){
-                       $rpc.juci.minidlna.autocomplete({path:text}).done(function(data){
+                       $rpc.juci.minidlna.run({"method":"autocomplete", "args":"{\"path\":\""+text+"\"}"}).done(function(data){
                                tag_promise = null;
                                if(data.folders) resolve(data.folders);
                                else reject(data);
index c44add5..e7ee246 100644 (file)
@@ -44,7 +44,7 @@ JUCI.app
        $scope.on_select = function(branch){
                $scope.model.selected = branch; 
        }
-       $rpc.juci.minidlna.folder_tree().done(function(data){
+       $rpc.juci.minidlna.run({"method":"folder_tree"}).done(function(data){
                function to_tree_format(obj){
                        return Object.keys(obj).map(function(folder){
                                if(obj[folder]["children"]){
index 76d7e31..9236d3d 100644 (file)
@@ -27,7 +27,7 @@ JUCI.app
                        on_button: function(btn, inst){
                                if(btn.value == "yes"){
                                        window.location = "/reboot.html";
-                                       $rpc.juci.system.reboot().done(function(){
+                                       $rpc.juci.system.run({"method":"reboot"}).done(function(){
                                                inst.close();
                                        });
                                }
@@ -38,10 +38,6 @@ JUCI.app
                                { label: $tr(gettext("No")), value: "no" }
                        ]
                });
-
-               /*$rpc.juci.system.reboot().done(function(){
-                       console.log("Restarting the system..."); 
-               }); */
        }
        
        function waitUntilDown(){
@@ -66,7 +62,7 @@ JUCI.app
                $scope.showRestartProgress = 1; 
                $scope.showConfirmation = 0; 
                $scope.progress = 0; 
-               $rpc.juci.system.reboot().done(function(){
+               $rpc.juci.system.run({"method":"reboot"}).done(function(){
                        var rpc = true; 
                        $scope.message = "Waiting for reboot..."; 
                        $scope.$apply(); 
index 8714e14..13a5493 100644 (file)
@@ -39,9 +39,9 @@ JUCI.app
        
        JUCI.interval.repeat("status.system.refresh", 1000, function(resume){
                async.parallel([
-                       function (cb){$rpc.juci.network.conntrack_count().done(function(res){conntrack = res; cb();}).fail(function(){cb();});},
-                       function (cb){$rpc.juci.network.clients().done(function(res){clients = res.clients; cb();}).fail(function(){cb();});},
-                       function (cb){$rpc.juci.network.dhcp_leases().done(function(res){leases = res.leases || []; cb();}).fail(function(){cb();});}
+                       function (cb){$rpc.juci.network.run({"method":"conntrack_count"}).done(function(res){conntrack = res; cb();}).fail(function(){cb();});},
+                       function (cb){$rpc.juci.network.run({"method":"clients"}).done(function(res){clients = res.clients; cb();}).fail(function(){cb();});},
+                       function (cb){$rpc.juci.network.run({"method":"dhcp_leases"}).done(function(res){leases = res.leases || []; cb();}).fail(function(){cb();});}
                ], function(){
                        $scope.systemConnectionsTbl.rows = [
                                [$tr(gettext("Active Connections")), '<juci-progress value="'+ conntrack.count +'" total="'+conntrack.limit+'"></juci-progress>']
index 99f9637..ce6c1e6 100644 (file)
@@ -4,46 +4,53 @@
                "read": {
                        "ubus": {
                                "/juci/system": [
-                                       "defaultreset", 
-                                       "filesystems", 
-                                       "log", 
-                                       "reboot", 
-                                       "info"
+                                       "run"
+                                       /*"defaultreset", */
+                                       /*"filesystems", */
+                                       /*"log", */
+                                       /*"reboot", */
+                                       /*"info"*/
                                ], 
                                "session": [
                                        "list"
                                ],
                                "/juci/system.upgrade": [
-                                       "check", 
-                                       "test", 
-                                       "start", 
-                                       "clean"
+                                       "run"
+                                       /*"check", */
+                                       /*"test", */
+                                       /*"start", */
+                                       /*"clean"*/
                                ], 
                                "/juci/system.user": [
-                                       "setpassword",
-                                       "listusers"
+                                       "run"
+                                       /*"setpassword",*/
+                                       /*"listusers"*/
                                ], 
                                "/juci/system.time": [
-                                       "zonelist", 
-                                       "get", 
-                                       "set"
+                                       "run"
+                                       /*"zonelist", */
+                                       /*"get", */
+                                       /*"set"*/
                                ], 
                                "/juci/system.conf": [
-                                       "restore", 
-                                       "defaultreset", 
-                                       "features",
-                                       "list"
+                                       "run"
+                                       /*"restore", */
+                                       /*"defaultreset", */
+                                       /*"features",*/
+                                       /*"list"*/
                                ], 
                                "/juci/system.process": [
-                                       "list"
+                                       "run"
+                                       /*"list"*/
                                ],
                                "/juci/system.service": [
-                                       "list",
-                                       "start",
-                                       "stop",
-                                       "enable",
-                                       "disable",
-                                       "reload"
+                                       "run"
+                                       /*"list",*/
+                                       /*"start",*/
+                                       /*"stop",*/
+                                       /*"enable",*/
+                                       /*"disable",*/
+                                       /*"reload"*/
                                ],
                                "router": [
                                        "info"
                        "passwd": [ "self" ],
                        "ubus": {
                                "/juci/system.service": [
-                                       "start",
-                                       "stop",
-                                       "enable",
-                                       "disable",
-                                       "reload"
+                                       "run"
+                                       /*"start",*/
+                                       /*"stop",*/
+                                       /*"enable",*/
+                                       /*"disable",*/
+                                       /*"reload"*/
                                ]
                        },
                        "uci": [
index dce4f2d..db69f3b 100644 (file)
@@ -24,13 +24,13 @@ JUCI.app
        $scope.resetPossible = 0; 
        $scope.resetPossible = 1; 
 
-       $rpc.juci.system.conf.features().done(function(features){
+       $rpc.juci.system.conf.run({"method":"features"}).done(function(features){
                $scope.features = features; 
        }); 
 
        $scope.onReset = function(){
                if(confirm(gettext("This will reset your configuration to factory defaults. Do you want to continue?"))){
-                       $rpc.juci.system.defaultreset().done(function(result){
+                       $rpc.juci.system.run({"method":"defaultreset"}).done(function(result){
                                console.log("Performing reset: "+JSON.stringify(result)); 
                                window.location = "/reboot.html";  
                        }); 
@@ -71,16 +71,16 @@ JUCI.app
        }
        $scope.onUploadComplete = function(result){
                console.log("Uploaded: "+JSON.stringify(result)); 
-               $rpc.juci.system.conf.restore({
+               $rpc.juci.system.conf.run({"method":"restore","args":JSON.stringify({
                        pass: $scope.data.pass
-               }).done(function(result){
+               })}).done(function(result){
                        if(result.error){
                                alert(result.error); 
                        } else {
                                $scope.showUploadModal = 0; 
                                $scope.$apply(); 
                                if(confirm($tr(gettext("Configuration has been restored. You need to reboot the device for settings to take effect! Do you want to reboot now?")))){
-                                       $rpc.juci.system.reboot(); 
+                                       $rpc.juci.system.run({"method":"reboot"}); 
                                }
                        }
                }).fail(function(err){
index 503c2a6..28e48de 100644 (file)
@@ -30,7 +30,7 @@ JUCI.app
        }; 
        $scope.passwordStrength = 1; 
        
-       $rpc.juci.system.user.listusers({ sid: $rpc.$sid() }).done(function(result){
+       $rpc.juci.system.user.run({"method":"listusers","args":JSON.stringify({ sid: $rpc.$sid() })}).done(function(result){
                $scope.allUsers = result.users.map(function(x){
                        return { label: x, value: x }; 
                }); 
@@ -68,7 +68,7 @@ JUCI.app
                if($scope.modal.password != $scope.modal.password2) alert($tr(gettext("Passwords do not match!"))); 
                else {
                        // TODO: change to correct username
-                       $rpc.juci.system.user.setpassword({sid: $rpc.$sid(), username: username, password: $scope.modal.password, oldpassword: $scope.modal.old_password}).done(function(data){
+                       $rpc.juci.system.user.run({"method":"setpassword","args":JSON.stringify({sid: $rpc.$sid(), username: username, password: $scope.modal.password, oldpassword: $scope.modal.old_password})}).done(function(data){
                                if(data.error){
                                        alert(data.error); 
                                } else {
index c8bb97a..02966ad 100644 (file)
@@ -21,7 +21,7 @@
 JUCI.app
 .controller("ServicesStatusPage", function($scope, $rpc){
        JUCI.interval.repeat("juci-services-page", 5000, function(done){
-               $rpc.juci.system.service.list().done(function(result){
+               $rpc.juci.system.service.run({"method":"list"}).done(function(result){
                        $scope.services = result.services; 
                        $scope.services.map(function(service){
                                service.reload = false;
@@ -39,12 +39,12 @@ JUCI.app
 
        $scope.onServiceEnable = function(service){
                if(service.enabled){
-                       $rpc.juci.system.service.disable(service).done(function(){
+                       $rpc.juci.system.service.run({"method":"disable", "args":JSON.stringify(service)}).done(function(){
                                console.log("service: " + service.name + " is disabled");
                                $scope.$apply();
                        });     
                } else {
-                       $rpc.juci.system.service.enable(service).done(function(){
+                       $rpc.juci.system.service.run({"method":"enable", "args":JSON.stringify(service)}).done(function(){
                                console.log("service: " + service.name + " is enabled");
                                $scope.$apply();
                        });
@@ -53,7 +53,7 @@ JUCI.app
        
        $scope.onServiceReload = function(service){
                service.reload = true;
-               $rpc.juci.system.service.reload(service).done(function(){
+               $rpc.juci.system.service.run({"method":"reload", "args":JSON.stringify(service)}).done(function(){
                        console.log("service: " + service.name + " is reloded");
                        service.reload = false;
                        $scope.$apply();
@@ -62,13 +62,13 @@ JUCI.app
 
        $scope.onServiceToggle = function(service){
                if(service.running){
-                       $rpc.juci.system.service.stop(service).done(function(){
+                       $rpc.juci.system.service.run({"method":"stop", "args":JSON.stringify(service)}).done(function(){
                                service.running = true;
                                console.log("service: " + service.name + " is stoped");
                                $scope.$apply();
                        });     
                } else {
-                       $rpc.juci.system.service.start(service).done(function(){
+                       $rpc.juci.system.service.run({"method":"start", "args":JSON.stringify(service)}).done(function(){
                                service.running = false;
                                console.log("service: " + service.name + " is started");
                                $scope.$apply();
index af7af11..ce82927 100644 (file)
@@ -34,7 +34,7 @@ JUCI.app
                        }).always(function(){next();}); 
                }, 
                function(next){
-                       $rpc.juci.system.time.zonelist().done(function(result){
+                       $rpc.juci.system.time.run({"method":"zonelist"}).done(function(result){
                                if(result && result.zones){
                                        $scope.timezones = result.zones; 
                                        $scope.allTimeZones = Object.keys(result.zones).sort().map(function(k){
@@ -61,7 +61,7 @@ JUCI.app
        });
 
        JUCI.interval.repeat("system.time", 1000, function(done){
-               $rpc.juci.system.time.get().done(function(result){
+               $rpc.juci.system.time.run({"method":"get"}).done(function(result){
                        $scope.localtime = result.local_time;
                        $scope.$apply();
                        done();
index e9188c4..180a41d 100644 (file)
@@ -21,7 +21,7 @@
 JUCI.app
 .controller("StatusSystemProcesses", function ($scope, $rpc) {
        JUCI.interval.repeat("juci-process-list", 5000, function(done){
-               $rpc.juci.system.process.list().done(function(processes){
+               $rpc.juci.system.process.run({"method":"list"}).done(function(processes){
                        $scope.processes = processes.list; 
                        $scope.columns = processes.fields; 
                        $scope.$apply(); 
index ca1c37d..e8e917a 100644 (file)
@@ -48,14 +48,14 @@ JUCI.app
 
        JUCI.interval.repeat("status.system.refresh", 1000, function(resume){
                async.parallel([
-                       function (cb){$rpc.juci.system.info().done(function(res){info = res; cb();}).fail(function(){cb();});},
+                       function (cb){$rpc.juci.system.run({"method":"info"}).done(function(res){info = res; cb();}).fail(function(){cb();});},
                        function (cb){$rpc.system.info().done(function(res){sys = res; cb();}).fail(function(){cb();});},
                        function (cb){$network.getNetworkLoad().done(function(load){ netLoad = load; cb(); }).fail(function(){cb();});},
                        function (cb){
                                if(!$rpc.system.board) cb(); 
                                else $rpc.system.board().done(function(res){board = res; cb();}).fail(function(){cb();});
                        },
-                       function (cb){$rpc.juci.system.filesystems().done(function(res){
+                       function (cb){$rpc.juci.system.run({"method":"filesystems"}).done(function(res){
                                filesystems = res.filesystems; 
                                cb();
                        }).fail(function(){cb();});}
index 8b3a829..8f52fa0 100644 (file)
@@ -62,32 +62,32 @@ JUCI.app.factory("$systemService", function($rpc){
        return {
                list: function(){
                        var def = $.Deferred(); 
-                       $rpc.juci.system.service.list().done(function(res){
+                       $rpc.juci.system.service.run({"method":"list"}).done(function(res){
                                if(res && res.services){
                                        var result = res.services.map(function(service){
                                                service.enable = function(){
                                                        var self = this; 
                                                        console.log("enabling service "+self.name); 
-                                                       return $rpc.juci.system.service.enable({ name: self.name }).done(function(){ self.enabled = true; }); 
+                                                       return $rpc.juci.system.service.run({"method":"enable","args":JSON.stringify({ name: self.name })}).done(function(){ self.enabled = true; }); 
                                                }
                                                service.disable = function(){
                                                        var self = this; 
                                                        console.log("disabling service "+self.name); 
-                                                       return $rpc.juci.system.service.disable({ name: self.name }).done(function(){ self.enabled = false; });
+                                                       return $rpc.juci.system.service.run({"method":"disable","args":JSON.stringify({ name: self.name })}).done(function(){ self.enabled = false; });
                                                }
                                                service.start = function(){
                                                        var self = this; 
                                                        console.log("starting service "+self.name); 
-                                                       return $rpc.juci.system.service.start({ name: self.name }).done(function(){ self.running = true; }); 
+                                                       return $rpc.juci.system.service.run({"method":"start","args":JSON.stringify({ name: self.name })}).done(function(){ self.running = true; }); 
                                                }
                                                service.stop = function(){
                                                        var self = this; 
                                                        console.log("stopping service "+self.name); 
-                                                       return $rpc.juci.system.service.stop({ name: self.name }).done(function(){ self.running = false; }); 
+                                                       return $rpc.juci.system.service.run({"method":"stop","args":JSON.stringify({ name: self.name })}).done(function(){ self.running = false; }); 
                                                }
                                                service.reload = function(){
                                                        var self = this; 
-                                                       return $rpc.juci.system.service.reload({ name: self.name }); 
+                                                       return $rpc.juci.system.service.run({"method":"reload","args":JSON.stringify({ name: self.name })}); 
                                                }
                                                return service; 
                                        }); 
index f4de12e..b387a61 100644 (file)
@@ -4,9 +4,10 @@
                "read": {
                        "ubus": {
                                "/juci/dect": [
-                                       "status",
-                                       "ping", 
-                                       "pair"
+                                       "run"
+                                       /*"status",*/
+                                       /*"ping", */
+                                       /*"pair"*/
                                ]
                        },
                        "uci": [
index d7b0997..285d1a5 100644 (file)
@@ -31,7 +31,7 @@ JUCI.app
        var numDevices = 0;
        if($rpc.juci && $rpc.juci.dect){
                JUCI.interval.repeat("dect.refresh", 1000, function(done){
-                       $rpc.juci.dect.status().done(function(stats){
+                       $rpc.juci.dect.run({"method":"status"}).done(function(stats){
                                if(stats.handsets && stats.handsets.length !== numDevices){
                                        numDevices = stats.handsets.length;
                                        $scope.dismissed = true;
@@ -43,11 +43,11 @@ JUCI.app
                });
                $scope.onStartPairing = function(){
                        $scope.dismissed = false;
-                       $rpc.juci.dect.pair();
+                       $rpc.juci.dect.run({"method":"pair"});
                        timer = setTimeout(function(){$scope.dismissed = true;}, 1000*180);
                }
                $scope.onPingHandset = function(hs){
-                       $rpc.juci.dect.ping({ id: hs.id }).done(function(){
+                       $rpc.juci.dect.run({"method":"ping","args":JSON.stringify({ id: hs.id })}).done(function(){
                        });
                }
        }
index ff48cc5..ce21779 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {
                                "/juci/netmode": [
-                                       "select"
+                                       "run"
+                                       /*"select"*/
                                ]
                        }, 
                        "uci": [
index fa12744..d838fc1 100644 (file)
@@ -4,22 +4,25 @@
                "read": {
                        "ubus": {
                                "/juci/network": [
-                                       "clients", 
+                                       "run"
+                                       /*"clients", 
                                        "load", 
                                        "nat_table", 
                                        "nameservers",
                                        "services",
-                                       "protocols"
+                                       "protocols"*/
                                ], 
                                "/juci/modems": [
-                                       "list",
-                                       "list4g"
+                                       "run"
+                                       /*"list",
+                                       "list4g"*/
                                ],
                                "/juci/network.status": [ 
-                                       "arp", 
+                                       "run"
+                                       /*"arp", 
                                        "ipv4routes", 
                                        "ipv6routes",
-                                       "ipv6neigh"
+                                       "ipv6neigh"*/
                                ], 
                                "network.interface": [
                                        "dump"
index 1c46fed..d999c23 100644 (file)
@@ -26,7 +26,7 @@
                var sync_hosts = $uci.$sync("hosts"); 
                function _refreshClients(self){
                        var deferred = $.Deferred(); 
-                       $rpc.juci.network.clients().done(function(res){
+                       $rpc.juci.network.run({"method":"clients"}).done(function(res){
                                sync_hosts.done(function(){
                                        if(res && res.clients){
                                                self.clients = res.clients.map(function(cl){
                
                NetworkBackend.prototype.getNameServers = function(){
                        var deferred = $.Deferred(); 
-                       $rpc.juci.network.nameservers().done(function(result){
+                       $rpc.juci.network.run({"method":"nameservers"}).done(function(result){
                                if(result && result.nameservers) deferred.resolve(result.nameservers); 
                                else deferred.reject(); 
                        }); 
                NetworkBackend.prototype.getNetworkLoad = function(){
                        var def = $.Deferred(); 
                        
-                       $rpc.juci.network.load().done(function(res){
+                       $rpc.juci.network.run({"method":"load"}).done(function(res){
                                def.resolve(res); 
                        });
                        
                NetworkBackend.prototype.getNatTable = function(){
                        var def = $.Deferred(); 
                        
-                       $rpc.juci.network.nat_table().done(function(result){
+                       $rpc.juci.network.run({"method":"nat_table"}).done(function(result){
                                if(result && result.table){
                                        def.resolve(result.table); 
                                } else {
 
                NetworkBackend.prototype.getServices = function(){
                        var def = $.Deferred(); 
-                       $rpc.juci.network.services().done(function(result){
+                       $rpc.juci.network.run({"method":"services"}).done(function(result){
                                if(result && result.list) def.resolve(result.list); 
                                else def.reject(); 
                        }); 
index b7ddb02..62a274b 100644 (file)
 
 JUCI.app
 .controller("StatusNetworkRoutes", function($scope, $rpc){
-       $rpc.juci.network.status.arp().done(function(arp_table){
+       $rpc.juci.network.status.run({"method":"arp"}).done(function(arp_table){
                $scope.arp_table = arp_table.clients; 
-               $rpc.juci.network.status.ipv4routes().done(function(ipv4_routes){
+               $rpc.juci.network.status.run({"method":"ipv4routes"}).done(function(ipv4_routes){
                        $scope.ipv4_routes = ipv4_routes.routes; 
-                       $rpc.juci.network.status.ipv6routes().done(function(ipv6_routes){
+                       $rpc.juci.network.status.run({"method":"ipv6routes"}).done(function(ipv6_routes){
                                $scope.ipv6_routes = ipv6_routes.routes; 
                                $scope.$apply(); 
                        }); 
                }); 
        }); 
-       $rpc.juci.network.status.ipv6neigh().done(function(result){
+       $rpc.juci.network.status.run({"method":"ipv6neigh"}).done(function(result){
                $scope.neighbors = result.neighbors;    
                $scope.$apply(); 
        }); 
index 6694cde..8e3e002 100644 (file)
@@ -27,7 +27,7 @@ JUCI.app
        }
        
        $scope.allProtocolTypes = $network.getProtocolTypes();
-       $rpc.juci.network.protocols().done(function(data){
+       $rpc.juci.network.run({"method":"protocols"}).done(function(data){
                $scope.protocolTypes = $scope.allProtocolTypes.filter(function(x){
                        if(x.value == "static" || x.value == "none") return true; //should allways be there
                        return data.protocols.find(function(p){ return p == x.value }) != undefined;
index 7e6c9fc..4deebda 100644 (file)
@@ -34,7 +34,7 @@ JUCI.app
        $scope.togglePasswd = function(){
                $scope.showPass = !$scope.showPass;
        };
-       $rpc.juci.modems.list().done(function(data){
+       $rpc.juci.modems.run({"method":"list"}).done(function(data){
                $scope.allModemDevices = data.modems.map(function(x){return {label: x, value: x}});
                $scope.$apply();
        });
index 2f5c412..78f6c51 100644 (file)
@@ -13,7 +13,7 @@ JUCI.app
 })
 .controller("networkConnectionProto4gEdit", function($scope, $rpc){
        $scope.device = {};
-       $rpc.juci.modems.list4g().done(function(data){
+       $rpc.juci.modems.run({"method":"list4g"}).done(function(data){
                if(data.info) return;
                $scope.modems = data.modems;
                $scope.allModemDevices = data.modems.map(function(x){ return { label: x.name, value:x.service+":"+x.dev+":"+x.ifname }});
index bed2733..ea898e3 100644 (file)
@@ -14,7 +14,7 @@ JUCI.app
 })
 .controller("networkConnectionProtoPppEdit", function($scope, $rpc){
        $scope.modemDevices = [];
-       $rpc.juci.modems.list().done(function(data){
+       $rpc.juci.modems.run({"method":"list"}).done(function(data){
                $scope.modemDevices = data.modems.map(function(x){ return { label:x, value:x}});
                $scope.$apply();
        });
index 8d8c29a..89397c9 100644 (file)
@@ -4,13 +4,14 @@
                "read": {
                        "ubus": {
                                "/juci/wireless": [
-                                       "devices",
-                                       "caps", 
-                                       "radios", 
-                                       "clients",
-                                       "countrylist",
-                                       "htmodelist", 
-                                       "freqlist"
+                                       "run"
+                                       /*"devices",*/
+                                       /*"caps", */
+                                       /*"radios", */
+                                       /*"clients",*/
+                                       /*"countrylist",*/
+                                       /*"htmodelist", */
+                                       /*"freqlist"*/
                                ]
                        },
                        "uci": [ "wireless" ]
index 64590f8..45b1040 100644 (file)
@@ -78,7 +78,7 @@ JUCI.app.factory("$wireless", function($uci, $rpc, $network, gettext){
 
        Wireless.prototype.getConnectedClients = function(){
                var def = $.Deferred(); 
-               $rpc.juci.wireless.clients().done(function(clients){
+               $rpc.juci.wireless.run({"method":"clients"}).done(function(clients){
                        if(clients && clients.clients) {
                                clients.clients.map(function(cl){
                                        if(cl.rssi && cl.noise && cl.noise > 0)
@@ -132,7 +132,7 @@ JUCI.app.factory("$wireless", function($uci, $rpc, $network, gettext){
        
        Wireless.prototype.getDefaults = function(){
                var deferred = $.Deferred(); 
-               $rpc.juci.wireless.defaults().done(function(result){
+               $rpc.juci.wireless.run({"method":"defaults"}).done(function(result){
                        if(!result) {
                                deferred.reject(); 
                                return; 
@@ -144,25 +144,6 @@ JUCI.app.factory("$wireless", function($uci, $rpc, $network, gettext){
                });  
                return deferred.promise(); 
        }
-/*     
-       Wireless.prototype.scan = function(){
-               var deferred = $.Deferred(); 
-               $rpc.juci.broadcom.wld.scan().done(function(result){
-                       
-               }).always(function(){
-                       deferred.resolve(); 
-               });  
-               return deferred.promise(); 
-       }
-       
-       Wireless.prototype.getScanResults = function(){
-               var deferred = $.Deferred(); 
-               $rpc.juci.broadcom.wld.scanresults().done(function(result){
-                       deferred.resolve(result.list); 
-               }); 
-               return deferred.promise(); 
-       }
-*/     
        return new Wireless(); 
 }); 
 
index 29b306e..3442e60 100644 (file)
@@ -19,7 +19,7 @@
 JUCI.app
 .controller("wirelessClientsPage", function($scope, $network, $rpc){
        JUCI.interval.repeat("wireless-clients-refresh", 5000, function(done){
-               $rpc.juci.wireless.clients().done(function(result){
+               $rpc.juci.wireless.run({"method":"clients"}).done(function(result){
                        if(!result || !result.clients) return; 
                        $network.getConnectedClients().done(function(clients){
                                $scope.clients = clients.filter(function(cl){
index 4c59ade..b8e8969 100644 (file)
@@ -21,7 +21,7 @@
 JUCI.app
 .controller("wirelessStatusSimplePage", function($scope, $rpc, $tr, gettext){
        JUCI.interval.repeat("wireless-refresh", 5000, function(done){
-               $rpc.juci.wireless.devices().done(function(result){
+               $rpc.juci.wireless.run({"method":"devices"}).done(function(result){
                        if(!result || !result.devices) return; 
                        $scope.devices = result.devices.map(function(dev){
                                dev._table = [
index f159b40..a20c5c4 100644 (file)
@@ -47,7 +47,7 @@ JUCI.app
                                next(); 
                        }); 
                }, function(next){
-                       $rpc.juci.wireless.clients().done(function(result){
+                       $rpc.juci.wireless.run({"method":"clients"}).done(function(result){
                                $scope.done = 1; 
                                var clients = {}; 
                                result.clients.map(function(x){ 
@@ -106,7 +106,7 @@ JUCI.app
                async.series([
                        function(next){
                                $uci.$sync("wireless").done(function(){
-                                       $rpc.juci.wireless.devices().done(function(result){
+                                       $rpc.juci.wireless.run({"method":"devices"}).done(function(result){
                                                $scope.wifi = $uci.wireless;  
                                                $scope.vifs = result.devices.map(function(dev){
                                                        var uci_dev = $uci.wireless["@wifi-iface"].find(function(w){
@@ -123,7 +123,7 @@ JUCI.app
                                }); 
                        }, 
                        function(next){
-                               $rpc.juci.wireless.clients().done(function(clients){
+                               $rpc.juci.wireless.run({"method":"clients"}).done(function(clients){
                                        $scope.wireless.clients = clients.clients; 
                                        $scope.wireless.clients.map(function(cl){
                                                // check flags 
index 50f49d3..4644ace 100644 (file)
@@ -31,7 +31,7 @@ JUCI.app
        $scope.$watch("device", function(device){
                if(!device) return; 
                
-               $rpc.juci.wireless.radios().done(function(result){
+               $rpc.juci.wireless.run({"method":"radios"}).done(function(result){
                        if(device[".name"] in result){
                                var settings = result[device[".name"]]; 
                                $scope.allChannels = [{ label: $tr(gettext("Auto")), value: "auto" }].concat(settings.channels).map(function(x){ return { label: x, value: x }; }); 
@@ -41,7 +41,7 @@ JUCI.app
                        $scope.$apply(); 
                }); 
                
-               $rpc.juci.wireless.htmodelist({ device: $scope.device.ifname.value }).done(function(result){
+               $rpc.juci.wireless.run({"method":"htmodelist", "args":JSON.stringify({ device: $scope.device.ifname.value })}).done(function(result){
                        if(!result || !result.htmodes) return; 
                        $scope.allBandwidthModes = Object.keys(result.htmodes).filter(function(k){ return result.htmodes[k]; }).map(function(x){
                                return { label: x, value: x }; 
@@ -49,7 +49,7 @@ JUCI.app
                        $scope.$apply(); 
                }); 
                
-               $rpc.juci.wireless.freqlist({ device: $scope.device.ifname.value }).done(function(result){
+               $rpc.juci.wireless.run({"method":"freqlist","args":JSON.stringify({ device: $scope.device.ifname.value })}).done(function(result){
                        if(!result || !result.channels) return; 
                        $scope.allChannels = result.channels.map(function(ch){
                                return { label: $tr(gettext("Channel")) + " " + ch.channel + " (" + (ch.mhz / 1000) + "Ghz)", value: ch.channel }; 
@@ -57,7 +57,7 @@ JUCI.app
                        $scope.$apply(); 
                }); 
 
-               $rpc.juci.wireless.countrylist({ device: $scope.device.ifname.value }).done(function(result){
+               $rpc.juci.wireless.run({"method":"countrylist","args":JSON.stringify({ device: $scope.device.ifname.value })}).done(function(result){
                        $scope.regChoices = result.countries.sort(function(a, b){
                                if(a.name < b.name) return -1; 
                                else if(a.name > b.name) return 1; 
index a54ef15..41d620c 100644 (file)
@@ -78,7 +78,7 @@ JUCI.app
                }
        }; 
        
-       $rpc.juci.wireless.clients().done(function(clients){
+       $rpc.juci.wireless.run({"method":"clients"}).done(function(clients){
                $scope.client_list = Object.keys(clients)
                        .filter(function(k){
                                return clients[k].connected; 
index 251687f..9ec34bd 100644 (file)
@@ -3,7 +3,7 @@
                "description": "JUCI Realtime Graphs Module",
                "read": {
                        "ubus": {
-                               "/juci/rtgraphs": [ "get" ]
+                               "/juci/rtgraphs": [ "run"/*"get"*/ ]
                        }
                } 
        }
index 84c3251..55bfb67 100644 (file)
@@ -57,7 +57,7 @@ JUCI.app
                
                JUCI.interval.repeat("graph-update-"+Math.random(), 2000, function(done){
                        var start_time = 0; 
-                       $rpc.juci.rtgraphs.get({ethdevice: $scope.ifname}).done(function(result){
+                       $rpc.juci.rtgraphs.run({"method":"get","args":JSON.stringify({ethdevice: $scope.ifname})}).done(function(result){
                                if(!result.graph || !result.graph.length) return; 
                                if(!start_time) start_time = result.graph[0][0]; 
                                //dataset.remove(dataset.getIds()); 
index c77a6ee..fd6ff34 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {
                                "/juci/iptv": [
-                                       "igmptable"
+                                       "run"
+                                       /*"igmptable"*/
                                ]
                        }
                }
index 5152cc3..71d476e 100644 (file)
@@ -7,8 +7,9 @@
                        ],
                        "ubus": {
                                "/juci/samba": [
-                                       "folder_tree",
-                                       "autocomplete"
+                                       "run"
+                                       /*"folder_tree",*/
+                                       /*"autocomplete"*/
                                ]
                        }
                }, 
@@ -18,8 +19,9 @@
                        ],
                        "ubus": {
                                "/juci/samba": [
-                                       "folder_tree",
-                                       "autocomplete"
+                                       "run"
+                                       /*"folder_tree",*/
+                                       /*"autocomplete"*/
                                ]
                        }
                }
index 754d78b..4f06225 100644 (file)
@@ -38,7 +38,7 @@ JUCI.app
                if(!branch || !branch.path) return;
                $scope.model.path = branch.path.slice(4); 
        }
-       $rpc.juci.samba.folder_tree().done(function(data){
+       $rpc.juci.samba.run({"method":"folder_tree"}).done(function(data){
                function to_tree_format(obj){
                        return Object.keys(obj).map(function(folder){
                                if(obj[folder]["children"]){
index e5da76a..feafa10 100644 (file)
@@ -84,7 +84,7 @@ JUCI.app
                        if(!def){
                                def = $.Deferred(); 
                                $scope.loadingLocations = true;
-                               $rpc.juci.samba.autocomplete({ path: query.slice(1) }).done(function(result){
+                               $rpc.juci.samba.run({"method":"autocomplete","args":JSON.stringify({ path: query.slice(1) })}).done(function(result){
                                        def.resolve(result.folders); 
                                }).fail(function(){
                                        def.reject(); 
index 79d9bf4..76f011d 100644 (file)
@@ -4,10 +4,11 @@
                "read": {
                        "ubus": {
                                "/juci/system.upgrade": [
-                                       "check", 
-                                       "test", 
-                                       "start", 
-                                       "clean"
+                                       "run"
+                                       /*"check", */
+                                       /*"test", */
+                                       /*"start", */
+                                       /*"clean"*/
                                ]
                        }, 
                        "uci": [ "system" ]
                        "uci": [ "system" ],
                        "ubus": {
                                "/juci/system.upgrade": [
-                                       "check", 
-                                       "test", 
-                                       "start", 
-                                       "clean"
+                                       "run"
+                                       /*"check", */
+                                       /*"test", */
+                                       /*"start", */
+                                       /*"clean"*/
                                ]
                        }
                }
index d287dcd..1a25980 100644 (file)
@@ -83,7 +83,7 @@ JUCI.app
                //console.log("calling ubus call /juci/system.upgrade start now");
                $scope.progress = $tr(gettext("Upgrading"));
                $scope.$apply();
-               $rpc.juci.system.upgrade.start({"path": $scope.$PATH, "keep": (($scope.$KEEP)?1:0)}).always(function(){ // this always returns true;
+               $rpc.juci.system.upgrade.run({"method":"start","args":JSON.stringify({"path": $scope.$PATH, "keep": (($scope.$KEEP)?1:0)})}).always(function(){ // this always returns true;
                        $scope.showUpgradeStatus = 0; 
                        $scope.$apply();
                        window.location = "/reboot.html";
@@ -96,7 +96,7 @@ JUCI.app
        $scope.onCheckUSB = function(){
                $scope.usbUpgradeAvailable = false;
                $scope.usbCheckInProgress = 1; 
-               $rpc.juci.system.upgrade.check({type: "usb"}).done(function(response){
+               $rpc.juci.system.upgrade.run({"method":"check","args":JSON.stringify({type: "usb"})}).done(function(response){
                        if(response.usb) {
                                $scope.usbUpgrade = response.usb; 
                                $scope.usbUpgradeStatus = $tr(gettext("New Software Available!"));
@@ -114,7 +114,7 @@ JUCI.app
        $scope.onCheckOnline = function(){
                $scope.onlineUpgradeAvailable = false;
                $scope.onlineCheckInProgress = 1; 
-               $rpc.juci.system.upgrade.check({type: "online"}).done(function(response){
+               $rpc.juci.system.upgrade.run({"method":"check","args":JSON.stringify({type: "online"})}).done(function(response){
                        if(response.online) {
                                $scope.onlineUpgrade = response.online; 
                                $scope.onlineUpgradeStatus = $tr(gettext("New Software Available!"));
@@ -136,7 +136,7 @@ JUCI.app
                        $scope.$KEEP = keep;
                        $scope.$PATH = $scope.uploadFilename;
                        console.log("testing image: "+ $scope.uploadFilename);
-                       $rpc.juci.system.upgrade.test({"path":$scope.onlineUpgrade}).fail(function(){
+                       $rpc.juci.system.upgrade.run({"method":"test","args":JSON.stringify({"path":$scope.onlineUpgrade})}).fail(function(){
                                $scope.showUpgradeStatus = 0;
                                $scope.$apply();
                        });
@@ -151,7 +151,7 @@ JUCI.app
                        $scope.$KEEP = keep;
                        $scope.$PATH = $scope.usbUpgrade;
                        console.log("testing image: "+$scope.usbUpgrade);
-                       $rpc.juci.system.upgrade.test({"path":$scope.usbUpgrade}).fail(function(){
+                       $rpc.juci.system.upgrade.run({"method":"test","args":JSON.stringify({"path":$scope.usbUpgrade})}).fail(function(){
                                $scope.showUpgradeStatus = 0;
                                $scope.$apply();
                        });
@@ -185,7 +185,7 @@ JUCI.app
                        var json = $(this).contents().text(); 
                        try {
                                $scope.$KEEP = keep;
-                               $rpc.juci.system.upgrade.test({"path":$scope.uploadFilename}).fail(function(){
+                               $rpc.juci.system.upgrade.run({"method":"test","args":JSON.stringify({"path":$scope.uploadFilename})}).fail(function(){
                                        $scope.showUpgradeStatus = 0;
                                        $scope.$apply();
                                });
diff --git a/plugins/juci-sysupgrade/src/sysupgrade.js b/plugins/juci-sysupgrade/src/sysupgrade.js
deleted file mode 100644 (file)
index 4f2c47b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2015 Inteno Broadband Technology AB. All rights reserved.
- *
- * Author: Martin K. Schröder <mkschreder.uk@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- */
-
-/*JUCI.app.run(function($uci, $rpc, $tr, gettext, upgradePopup){
-       var upgrades = []; 
-       
-       async.series([
-               function(next){
-                       $uci.$sync("system").done(function(){
-                               if(!$uci.system.upgrade) {
-                                       $uci.system.$create({ ".type": "upgrade", ".name": "upgrade" }).done(function(section){
-                                               $uci.$save().done(function(){
-                                                       console.log("Created missing section system.upgrade in UCI!"); 
-                                                       next(); 
-                                               }); 
-                                       }); 
-                               } else {
-                                       next(); 
-                               }
-                       }); 
-               }, 
-               function(next){
-                       $rpc.juci.system.upgrade.check().done(function(response){
-                               if(response.all && response.all.length) {
-                                       upgradePopup.show({ images: response.all.map(function(x){ return { label: x, value: x }; }) }).done(function(selected){
-                                               $rpc
-                                       }); 
-                                       if(confirm($tr(gettext("A new system software upgrade is available. Do you want to visit upgrade page and upgrade now?")))) {
-                                               window.location = "/#!/settings-upgrade"; 
-                                       }
-                               } 
-                               next(); 
-                       }); 
-               }
-       ], function(){
-               
-       }); 
-}); */
index 9f8e8a4..32a954f 100644 (file)
@@ -4,7 +4,8 @@
                "read": {
                        "ubus": {       
                                "/juci/upnpd": [
-                                       "ports"
+                                       "run"
+                                       /*"ports"*/
                                ]
                        }, 
                        "uci": [
index 38557f5..01682f9 100644 (file)
@@ -23,7 +23,7 @@ JUCI.app
        JUCI.interval.repeat("upnp-status-refresh", 1000, function(done){
                $systemService.find("miniupnpd").done(function(service){
                        $scope.service = service;
-                       $rpc.juci.upnpd.ports().done(function(result){ 
+                       $rpc.juci.upnpd.run({"method":"ports"}).done(function(result){ 
                                $scope.upnpOpenPorts = result.ports; 
                                $scope.$apply();
                                done(); 
index de200a5..f438b50 100644 (file)
@@ -20,7 +20,7 @@
 
 JUCI.app
 .controller("UPNPStatusPage", function($scope, $rpc){  
-       $rpc.juci.upnpd.ports().done(function(result){
+       $rpc.juci.upnpd.run({"method":"ports"}).done(function(result){
                $scope.upnpOpenPorts = result.ports; 
                $scope.loaded = true; 
                $scope.$apply(); 
index 2653d44..4062b20 100644 (file)
@@ -7,7 +7,8 @@
                                        "usb"
                                ],
                                "/juci/usb": [
-                                       "list"
+                                       "run"
+                                       /*"list"*/
                                ]
                        }
                }