Speedtest: added speedtest widget to status/diagnostics ej klart
authorReidar Cederqvist <reidar.cederqvist@gmail.com>
Wed, 30 Sep 2015 14:42:39 +0000 (16:42 +0200)
committerMartin Schröder <mkschreder.uk@gmail.com>
Thu, 8 Oct 2015 07:45:17 +0000 (09:45 +0200)
plugins/juci-diagnostics/access.json
plugins/juci-diagnostics/src/pages/status.diagnostics.html
plugins/juci-utils/src/widgets/diagnostics-widget-speedtest.html
plugins/juci-utils/src/widgets/diagnostics-widget-speedtest.js

index 1ec4445..070d0db 100644 (file)
@@ -7,7 +7,15 @@
                                        "ping", 
                                        "traceroute"
                                ]
-                       }
+                       },
+                       "uci": [
+                               "speedtest"     
+                       ]
+               },
+               "write": {
+                       "uci": [
+                               "speedtest"
+                       ]
                }
        }
 }
index 1be29bb..807d9af 100644 (file)
@@ -36,5 +36,8 @@
                        <div class="alert alert-default" ng-show="data.traceResults">{{'Trace results'|translate}}: <br/><pre>{{data.traceResults}}</pre></div>
                        <div class="alert alert-danger" ng-show="data.traceError">{{'Error'|translate}}: <br/><pre>{{data.traceError}}</pre></div>
                </juci-config-section>
+               <juci-config-section>
+                       <diagnostics-widget-90-speedtest></diagnostics-widget-90-speedtest>
+               </juci-config-section>
        </div>
 </juci-layout-with-sidebar>
index 8bcf1f6..69059c9 100644 (file)
@@ -1,4 +1,31 @@
 <div>
-       <juci-contentbox show=true title="TPtest" icon="fa fa-fighter-jet">diagnostics-widget-speedtest content goes here</juci-contentbox>
+       <juci-expandable title="TP test">
+               <juci-config-lines>
+                       <juci-config-line title="{{'Test direction'|translate}}">
+                               <juci-select ng-model="testType[0].value" ng-items="testType"/>
+                       </juci-config-line>
+                       <juci-config-line title="{{'Package size'|translate}}">
+                               <input type="number" min="10000" max="100000" step="1000" class="form-control" ng-model="packagesize"/>
+                       </juci-config-line>
+                       <juci-config-line title="{{'address and prot' | translate}}">
+                               <juci-select ng-model="addresses[0].value" ng-items="addresses"/>
+                       </juci-config-line>
+                       <juci-config-line>
+                               <button class="btn btn-default" ng-click="onRemoveAddress()">
+                                       <i class="fa fa-minus"></i>
+                               </button>
+                               <button class="btn btn-default" ng-click="onAddAddress()">
+                                       <i class="fa fa-plus"></i>
+                               </button>
+                       </juci-config-line>
+                       <juci-config-line>
+                               <button class="btn btn-default" ng-click="runTest()">
+                               {{'Run test' | translate}}</button>
+                       </juci-config-line>
+               </juci-config-lines>
+       </juci-expandable>
 </div>
 
+
+                       
+
index a8035db..d8f9a75 100644 (file)
@@ -4,15 +4,13 @@ JUCI.app
        return {
                templateUrl: "/widgets/diagnostics-widget-speedtest.html",
                controller: "diagnosticsWidget90Speedtest", 
-               replace: true
-        };  
-}).directive("overviewWidget99Speedtest", function($compile, $parse){
-       return {
-               templateUrl: "/widgets/diagnostics-widget-speedtest.html",
-               controller: "diagnosticsWidget90Speedtest", 
-               replace: true
         };  
 })
-.controller("diagnosticsWidget90Speedtest", function($scope, $rpc, $events){
-       
+.controller("diagnosticsWidget90Speedtest", function($scope, $rpc, $events, $uci){
+       $scope.packagesize = 50000;
+       $scope.testType = [{value:"up_down", label: "up and down"}, {value:"up", label: "up"}, {value:"down", label:"down"} ];
+       $scope.addresses = [{label:"tptest.bredband.net/1640"}, {label:"tptest.elion.ee/1550"}];
+       //$uci.$sync("speedtest").done(function(){
+               //$scope.testservers = $uci.speedtest["@testserver"]; 
+       //});
 });