You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.5 KiB
38 lines
1.5 KiB
9 years ago
|
/// <reference path="../../includes.ts"/>
|
||
|
/// <reference path="kubernetesHelpers.ts"/>
|
||
|
/// <reference path="kubernetesPlugin.ts"/>
|
||
|
|
||
|
module Kubernetes {
|
||
|
|
||
|
export var ServiceEditController = controller("ServiceEditController",
|
||
|
["$scope", "KubernetesModel", "KubernetesState", "KubernetesSchema", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", "SchemaRegistry",
|
||
|
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesState, KubernetesSchema,
|
||
|
$templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, schemas:HawtioForms.SchemaRegistry) => {
|
||
|
|
||
|
$scope.kubernetes = KubernetesState;
|
||
|
$scope.model = KubernetesModel;
|
||
|
$scope.id = $routeParams["id"];
|
||
|
$scope.schema = KubernetesSchema;
|
||
|
$scope.config = schemas.cloneSchema("io.fabric8.kubernetes.api.model.Service");
|
||
|
//$scope.config = KubernetesSchema.definitions.kubernetes_v1beta2_Service;
|
||
|
|
||
|
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
|
||
|
|
||
|
$scope.$on('$routeUpdate', ($event) => {
|
||
|
updateData();
|
||
|
});
|
||
|
|
||
|
updateData();
|
||
|
|
||
|
function updateData() {
|
||
|
if ($scope.id) {
|
||
|
$scope.entity = $scope.model.getService(KubernetesState.selectedNamespace, $scope.id);
|
||
|
Core.$apply($scope);
|
||
|
$scope.fetched = true;
|
||
|
} else {
|
||
|
$scope.fetched = true;
|
||
|
}
|
||
|
}
|
||
|
}]);
|
||
|
}
|