Hide the namespace selector when on swarm or <2 K8s ns

We now hide the new namespace dropdown selector when
there is only 1 namespace, or when we are on swarm
This is also hidden in the function create page and
the function detail page

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
This commit is contained in:
Alistair Hey
2019-12-15 16:23:26 +00:00
committed by Alex Ellis
parent d90288143d
commit 04fead5eab
3 changed files with 12 additions and 7 deletions

View File

@ -23,7 +23,6 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
contentType: "text"
};
$scope.namespaceSelect = $scope.selectedNamespace;
$scope.baseUrl = $location.absUrl().replace(/\ui\/$/, '');
try {
$scope.canCopyToClipboard = document.queryCommandSupported('copy');
@ -43,6 +42,8 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
showPostInvokedToast(msg);
}
$scope.toggleSideNav = function() {
$mdSidenav('left').toggle();
};
@ -310,7 +311,7 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
$scope.labelsToLabelInputs(func.labels);
$scope.annotationsToAnnotationInputs(func.annotations);
$scope.secretsToSecretInputs(func.secrets);
$scope.item.namespace = func.selectedNamespace;
$scope.item.namespace = $scope.namespaceSelected();
$scope.selectedFunc = func;
@ -365,6 +366,10 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
});
};
$scope.fnNamespaceSelected = function(inputNamespace) {
$scope.namespaceSelect = inputNamespace;
}
$scope.onEnvInputExpand = function() {
$scope.envFieldsVisible = !$scope.envFieldsVisible;
}