UI: fix ng-model complaint

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis 2018-03-03 19:49:19 +00:00
parent ccfb8f7be4
commit a8d91590ab
2 changed files with 14 additions and 9 deletions

View File

@ -89,11 +89,9 @@
</md-button>
</div>
<div layout-gt-sm="row">
<md-input-container class="md-icon-float md-block">
<label>Status</label>
<input ng-model="isReady(function)" type="text" readonly="readonly">
</md-input-container>
<ready-input></ready-input>
<md-input-container class="md-icon-float md-block">
<label>Replicas</label>

View File

@ -4,6 +4,16 @@
var app = angular.module('faasGateway', ['ngMaterial', 'faasGateway.funcStore']);
app.directive("readyInput", function() {
return {
"restrict": "E",
"template": '<md-input-container class="md-icon-float md-block">'+
' <label>Status</label>' +
' <input value="{{ function.ready ? \'Ready\' : \'Querying\' }}" type="text" readonly="readonly">' +
'</md-input-container>'
};
});
app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$mdDialog', '$mdToast', '$mdSidenav',
function($scope, $log, $http, $location, $timeout, $mdDialog, $mdToast, $mdSidenav) {
var newFuncTabIdx = 0;
@ -32,14 +42,11 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
};
$scope.isReady = function(selectedFunction) {
if(selectedFunction.ready != undefined && selectedFunction.ready) {
return "Ready";
}
return "Querying..";
return (selectedFunction.ready != undefined && selectedFunction.ready == true);
}
$scope.invocation.request = "";
$scope.isFunctionReady = "Querying";
$scope.fetchFunctionsDelay = 3500;
$scope.queryFunctionDelay = 2500;