修个volume状态按钮

This commit is contained in:
wu ming 2016-09-29 10:19:39 +08:00
parent 7268a3f121
commit a9f82ff247
6 changed files with 2934 additions and 2895 deletions

40
defs.d.ts vendored
View File

@ -18,26 +18,6 @@
/// <reference path="d.ts/configs/ts/kubeClusterSetting.d.ts"/>
/// <reference path="d.ts/configs/ts/regionalismCodeSearch.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/breadcrumbs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/build.d.ts"/>
@ -50,6 +30,7 @@
/// <reference path="d.ts/kubernetes/ts/deploymentConfig.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/kubernetesModel.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/imageRepositories.d.ts"/>
@ -79,3 +60,22 @@
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.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

@ -18,8 +18,8 @@
<table class="table sj_content_table sj_table_border">
<thead class="no-scope">
<tr>
<th ng-show="row.status" class="sj_c_green table-header sj_table_td00">已启用</th>
<th ng-hide="row.status" class="sj_c_green table-header sj_table_td00">已停止</th>
<th ng-show="volume.status" class="sj_c_green table-header sj_table_td00">已启用</th>
<th ng-hide="volume.status" class="sj_c_green table-header sj_table_td00">已停止</th>
<th class="no-fade table-header sj_table_td06">
<span class="">{{volume.name}}</span>
</th>

View File

@ -42,8 +42,8 @@
<input type="text" class="sj_txt_box02 mr5" ng-model="ngDialogData.path" ng-disabled="!{{ngDialogData.editable}}" />
</th>
<th>
<button ng-show="ngDialogData.status" class="sj_btn_blue fl" ng-click="stopVolume(ngDialogData)">停止</button>
<button ng-hide="ngDialogData.status" class="sj_btn_red fl" ng-click="startVolume(ngDialogData)">启动</button>
<button ng-show="ngDialogData.status" class="sj_btn_red fl" ng-click="stopVolume(ngDialogData)">停止</button>
<button ng-hide="ngDialogData.status" class="sj_btn_blue fl" ng-click="startVolume(ngDialogData)">启动</button>
</th>
</tr>
<tr ng-repeat="row in ngDialogData.brick">

View File

@ -18,6 +18,7 @@ module Configs{
template: 'newDialog.html',
controller:'Configs.VolumeController',
width: 1005,
scope: $scope,
data: {
name: '',
path: '',
@ -40,6 +41,7 @@ module Configs{
template: 'newDialog.html',
width: 1005,
data: fVolume,
scope: $scope,
className: 'ngdialog-theme-default',
controller: 'Configs.VolumeController'
});
@ -75,5 +77,27 @@ module Configs{
showDeleteVolume.item = null;
}
}
$scope.$on('update', (event, data) => {
angular.forEach(data.brick, (brick) =>{
var ip = [];
if(brick["ip"] instanceof Object){
for(var key in brick["ip"])
ip.push(brick["ip"][key]);
brick["ip"] = ip.join("\.");
}
});
$http({
url: "/java/console/api/volume/update",
method: 'POST',
data: data
}).success(function(data,header,config,status){
$scope.model.updateVolumeData();
console.log("更新了");
}).error(function(data,header,config,status){
});
});
}]);
}

View File

@ -30,7 +30,8 @@ module Configs{
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
$scope.status = $scope.ngDialogData.status;
$scope.save = (entity) =>{
changeStatus(entity);
//changeStatus(entity);
$scope.$emit('update', entity);
$scope.closeThisDialog();
}
@ -80,11 +81,7 @@ module Configs{
method: 'POST',
data: entity
}).success(function(data,header,config,status){
/*
volume信息
*/
$scope.model.updateVolumeData();
}).error(function(data,header,config,status){
});