From 3a7ee68241d59506f96e210e6088c2c65b0d1da1 Mon Sep 17 00:00:00 2001 From: Erik Reid <erik.reid@geant.org> Date: Thu, 13 Aug 2020 16:11:02 +0200 Subject: [PATCH] use /data/interfaces (no hostname) --- inventory_provider/static/interfaces.html | 25 ++++++++++++----------- inventory_provider/static/interfaces.js | 6 ++++-- inventory_provider/static/style.css | 2 +- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/inventory_provider/static/interfaces.html b/inventory_provider/static/interfaces.html index 80ca1c39..e4c59af9 100644 --- a/inventory_provider/static/interfaces.html +++ b/inventory_provider/static/interfaces.html @@ -9,18 +9,19 @@ <body> <div ng-controller="interfaces"> - <h2>Interfaces</h2> - <div> - <select - ng-options="r for r in routers" - ng-change="update_interfaces()" - ng-model="router"></select> - <select - ng-options="i for i in interfaces" - ng-change="update_status()" - ng-model="interface"> - </select> - </div> + <div class="column"> + <p><strong>interfaces</strong></p> + <ul> + <li ng-repeat="i in interfaces">{{i.router}}:{{i.name}} + <ul> + <li>{{i.description}}</li> + <li ng-repeat="v4 in i.ipv4">v4: {{v4}}</li> + <li ng-repeat="v6 in i.ipv6">v6: {{v6}}</li> + </ul> + </li> + </ul> + <!--div class="raw">{{interfaces}}</div--> + </div> <div> STATUS: {{status}} diff --git a/inventory_provider/static/interfaces.js b/inventory_provider/static/interfaces.js index 499350b2..63ab9939 100644 --- a/inventory_provider/static/interfaces.js +++ b/inventory_provider/static/interfaces.js @@ -12,12 +12,13 @@ myApp.controller('interfaces', function($scope, $http) { $http({ method: 'GET', - url: window.location.origin + "/data/routers" + url: window.location.origin + "/data/interfaces" }).then( - function(rsp) {$scope.routers = rsp.data;}, + function(rsp) {$scope.interfaces = rsp.data;}, function(rsp) {$scope.routers = ['error'];} ); + /* $scope.update_interfaces = function() { $http({ @@ -47,5 +48,6 @@ myApp.controller('interfaces', function($scope, $http) { function(rsp) {$scope.interfaces = 'query error';} ); } + */ }); \ No newline at end of file diff --git a/inventory_provider/static/style.css b/inventory_provider/static/style.css index a72ff44a..b234cbe2 100644 --- a/inventory_provider/static/style.css +++ b/inventory_provider/static/style.css @@ -1,6 +1,6 @@ .column { float: left; - width: 33.33%; + width: 100%%; } /* Clear floats after the columns */ -- GitLab