This commit is contained in:
wu ming 2016-09-29 14:00:13 +08:00
parent a9f82ff247
commit adb0638a4c
4 changed files with 2905 additions and 2925 deletions

40
defs.d.ts vendored
View File

@ -18,6 +18,26 @@
/// <reference path="d.ts/configs/ts/kubeClusterSetting.d.ts"/> /// <reference path="d.ts/configs/ts/kubeClusterSetting.d.ts"/>
/// <reference path="d.ts/configs/ts/regionalismCodeSearch.d.ts"/> /// <reference path="d.ts/configs/ts/regionalismCodeSearch.d.ts"/>
/// <reference path="d.ts/configs/ts/systemCodeSearch.d.ts"/> /// <reference path="d.ts/configs/ts/systemCodeSearch.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerModel.d.ts"/>
/// <reference path="d.ts/developer/ts/developerEnrichers.d.ts"/>
/// <reference path="d.ts/developer/ts/environmentPanel.d.ts"/>
/// <reference path="d.ts/developer/ts/fileMigrationTask.d.ts"/>
/// <reference path="d.ts/developer/ts/home.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJob.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJobs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesModel.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsLog.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsMetrics.d.ts"/>
/// <reference path="d.ts/developer/ts/navbar.d.ts"/>
/// <reference path="d.ts/developer/ts/pipeline.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelineDirective.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelines.d.ts"/>
/// <reference path="d.ts/developer/ts/project.d.ts"/>
/// <reference path="d.ts/developer/ts/projectSelector.d.ts"/>
/// <reference path="d.ts/developer/ts/projects.d.ts"/>
/// <reference path="d.ts/developer/ts/workspace.d.ts"/>
/// <reference path="d.ts/developer/ts/workspaces.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/apps.d.ts"/> /// <reference path="d.ts/kubernetes/ts/apps.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/build.d.ts"/> /// <reference path="d.ts/kubernetes/ts/build.d.ts"/>
@ -30,7 +50,6 @@
/// <reference path="d.ts/kubernetes/ts/deploymentConfig.d.ts"/> /// <reference path="d.ts/kubernetes/ts/deploymentConfig.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/deploymentConfigs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/deploymentConfigs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/events.d.ts"/> /// <reference path="d.ts/kubernetes/ts/events.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesModel.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/host.d.ts"/> /// <reference path="d.ts/kubernetes/ts/host.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/hosts.d.ts"/> /// <reference path="d.ts/kubernetes/ts/hosts.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/imageRepositories.d.ts"/> /// <reference path="d.ts/kubernetes/ts/imageRepositories.d.ts"/>
@ -60,22 +79,3 @@
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/> /// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/> /// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerModel.d.ts"/>
/// <reference path="d.ts/developer/ts/developerEnrichers.d.ts"/>
/// <reference path="d.ts/developer/ts/environmentPanel.d.ts"/>
/// <reference path="d.ts/developer/ts/fileMigrationTask.d.ts"/>
/// <reference path="d.ts/developer/ts/home.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJob.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJobs.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsLog.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsMetrics.d.ts"/>
/// <reference path="d.ts/developer/ts/navbar.d.ts"/>
/// <reference path="d.ts/developer/ts/pipeline.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelineDirective.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelines.d.ts"/>
/// <reference path="d.ts/developer/ts/project.d.ts"/>
/// <reference path="d.ts/developer/ts/projectSelector.d.ts"/>
/// <reference path="d.ts/developer/ts/projects.d.ts"/>
/// <reference path="d.ts/developer/ts/workspace.d.ts"/>
/// <reference path="d.ts/developer/ts/workspaces.d.ts"/>

File diff suppressed because one or more lines are too long

View File

@ -28,18 +28,18 @@
</script> </script>
<script type="text/ng-template" id="newDialog.html"> <script type="text/ng-template" id="newDialog.html">
<div class="sj_new_box"> <div class="sj_new_box">
<ng-form name="volumeForm" class=" mb10" novalidate="novalidate"> <form name="volumeForm" class=" mb10" ng-submit="onSubmit(ngDialogData)" novalidate="novalidate">
<table class="sj_new_table clear"> <table class="sj_new_table clear">
<tbody> <tbody>
<tr> <tr>
<th ng-show="ngDialogData.status" class="new_left sj_c_green">启用</th> <th ng-show="ngDialogData.status" class="new_left sj_c_green">启用</th>
<th ng-hide="ngDialogData.status" class="new_left sj_c_green">停止</th> <th ng-hide="ngDialogData.status" class="new_left sj_c_green">停止</th>
<th colspan="10"> <th colspan="10">
<input type="text" class="sj_txt_box03 mr10" ng-model="ngDialogData.name " ng-disabled="!{{ngDialogData.editable}}" /> <input type="text" class="sj_txt_box03 mr10" ng-model="ngDialogData.name " ng-disabled="!{{ngDialogData.editable}}" ng-pattern="/^\w{2,15}$/" required="required"/>
</th> </th>
<th>云目录:</th> <th>云目录:</th>
<th> <th>
<input type="text" class="sj_txt_box02 mr5" ng-model="ngDialogData.path" ng-disabled="!{{ngDialogData.editable}}" /> <input type="text" class="sj_txt_box02 mr5" ng-model="ngDialogData.path" ng-disabled="!{{ngDialogData.editable}}" ng-pattern="/^(\/[a-z0-9A-Z .%]+)+$/" required="required"/>
</th> </th>
<th> <th>
<button ng-show="ngDialogData.status" class="sj_btn_red fl" ng-click="stopVolume(ngDialogData)">停止</button> <button ng-show="ngDialogData.status" class="sj_btn_red fl" ng-click="stopVolume(ngDialogData)">停止</button>
@ -55,23 +55,23 @@
<input type="text" class="sj_txt_box04 mr5" value="服务器 {{$index + 1}} " ng-disabled="true" /> <input type="text" class="sj_txt_box04 mr5" value="服务器 {{$index + 1}} " ng-disabled="true" />
</th> </th>
<th> <th>
<input type="text" class="sj_txt_box05" ng-model="row.ip[0]" ng-disabled="!{{row.editable}}" /> <input type="text" class="sj_txt_box05" ng-model="row.ip[0]" ng-disabled="!{{row.editable}}" ng-pattern="/^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5]))))$/" required="required"/>
</th> </th>
<th>.</th> <th>.</th>
<th> <th>
<input type="text" class="sj_txt_box05" ng-model="row.ip[1]" ng-disabled="!{{row.editable}}" /> <input type="text" class="sj_txt_box05" ng-model="row.ip[1]" ng-disabled="!{{row.editable}}" ng-pattern="/^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5]))))$/" required="required"/>
</th> </th>
<th>.</th> <th>.</th>
<th> <th>
<input type="text" class="sj_txt_box05" ng-model="row.ip[2]" ng-disabled="!{{row.editable}}" /> <input type="text" class="sj_txt_box05" ng-model="row.ip[2]" ng-disabled="!{{row.editable}}" ng-pattern="/^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5]))))$/" required="required"/>
</th> </th>
<th>.</th> <th>.</th>
<th> <th>
<input type="text" class="sj_txt_box05 mr10" ng-model="row.ip[3]" ng-disabled="!{{row.editable}}" /> <input type="text" class="sj_txt_box05 mr10" ng-model="row.ip[3]" ng-disabled="!{{row.editable}}" ng-pattern="/^(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5]))))$/" required="required"/>
</th> </th>
<th>存储块:</th> <th>存储块:</th>
<th> <th>
<input type="text" class="sj_txt_box02 mr5" ng-model="row.path" ng-disabled="!{{row.editable}}"/> <input type="text" class="sj_txt_box02 mr5" ng-model="row.path" ng-disabled="!{{row.editable}}" ng-pattern="/^(\/[a-z0-9A-Z .%]+)+$/" required="required"/>
</th> </th>
<th> <th>
<!--<button class="sj_btn_grey fl">连接</button>--> <!--<button class="sj_btn_grey fl">连接</button>-->
@ -82,7 +82,7 @@
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th> <th>
<button class="sj_btn_blue mr5" ng-click="save(ngDialogData)" >保存</button> <button class="sj_btn_blue mr5" type="submit" >保存</button>
</th> </th>
<th> <th>
<button class="sj_btn_grey mr5" ng-click="cancel()">取消</button> <button class="sj_btn_grey mr5" ng-click="cancel()">取消</button>
@ -95,7 +95,8 @@
</tbody> </tbody>
</table> </table>
<div class="alert alert-warning" role="alert" ng-show="showMessage">"删除存储块失败:集群中至少包含一个存储块!"</div> <div class="alert alert-warning" role="alert" ng-show="showMessage">"删除存储块失败:集群中至少包含一个存储块!"</div>
</ng-form> <span class="alert alert-danger" role="alert" ng-show="$scope.validForm.$valid && submitted">名称、路径、Ip不能为空</span>
</form>
</div> </div>
</script> </script>
<div ng-controller="Kubernetes.TopLevel"> <div ng-controller="Kubernetes.TopLevel">

View File

@ -28,15 +28,16 @@ module Configs{
}]); }]);
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => { export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
$scope.submitted = false;
$scope.status = $scope.ngDialogData.status; $scope.status = $scope.ngDialogData.status;
$scope.save = (entity) =>{ $scope.save = (entity) =>{
//changeStatus(entity);
$scope.$emit('update', entity); $scope.$emit('update', entity);
$scope.closeThisDialog(); $scope.closeThisDialog();
} }
$scope. cancel = () =>{ $scope. cancel = () =>{
$scope.closeThisDialog(); $scope.closeThisDialog();
$scope.submitted = false;
} }
$scope.deleteBrock = (volume:volume, brock) => { $scope.deleteBrock = (volume:volume, brock) => {
@ -66,25 +67,12 @@ module Configs{
} }
function changeStatus(entity){ $scope.onSubmit = (entity) => {
angular.forEach(entity.brick, (brick) =>{ if($scope.validForm.$valid && $scope.validForm.$dirty){
var ip = []; $scope.closeThisDialog();
if(brick["ip"] instanceof Object){ }else{
for(var key in brick["ip"]) $scope.submitted = true;
ip.push(brick["ip"][key]);
brick["ip"] = ip.join("\.");
} }
});
$http({
url: "/java/console/api/volume/update",
method: 'POST',
data: entity
}).success(function(data,header,config,status){
$scope.model.updateVolumeData();
}).error(function(data,header,config,status){
});
} }
}]); }]);
} }