完善gfs配置页面

Web_Manager_Develope
wu ming 8 years ago
parent 9fba2532f1
commit 1fe0e27d9f

@ -24,10 +24,9 @@ declare module Configs {
usedSize: number; usedSize: number;
brick: Array<Block>; brick: Array<Block>;
folder?: Array<any>; folder?: Array<any>;
status: string; status: boolean;
path: string; path: string;
editable?: boolean; editable?: boolean;
alive?: boolean;
} }
/** /**
volumebrock volumebrock

40
defs.d.ts vendored

@ -18,26 +18,6 @@
/// <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"/>
@ -50,6 +30,7 @@
/// <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"/>
@ -78,4 +59,23 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/> /// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <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/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"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/> /// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>

File diff suppressed because one or more lines are too long

@ -248,8 +248,8 @@ gulp.task('connect', ['watch'], function() {
targetPath: '/hawtio/git' targetPath: '/hawtio/git'
}, { }, {
proto: "http", proto: "http",
port: "8088", port: "8080",
hostname: "192.168.0.110", hostname: "192.168.191.5",
path: '/java/console/api', path: '/java/console/api',
targetPath: "/" targetPath: "/"
}]; }];

@ -15,57 +15,62 @@
</div> </div>
</div> </div>
<div class="row" ng-repeat="volume in volumes"> <div class="row" ng-repeat="volume in volumes">
<table class="table sj_content_table sj_table_border" > <table class="table sj_content_table sj_table_border">
<thead class="no-scope"> <thead class="no-scope">
<tr> <tr>
<th ng-show="row.status == Started ||Created" class="sj_c_green table-header sj_table_td00" >已启用</th> <th ng-show="row.status" class="sj_c_green table-header sj_table_td00">已启用</th>
<th ng-show="row.status == Stopped" 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 class="no-fade table-header sj_table_td06"> <th class="no-fade table-header sj_table_td06">
<span class="">{{volume.name}}</span> <span class="">{{volume.name}}</span>
</th> </th>
<th class="no-fade table-header sj_table_td02" > <th class="no-fade table-header sj_table_td02">
<span class="">云路径:{{volume.path}}</span> <span class="">云路径:{{volume.path}}</span>
</th> </th>
<th class="no-fade table-header sj_table_td02" > <th class="no-fade table-header sj_table_td02">
<span class=""></span> <span class=""></span>
</th> </th>
<th class="no-fade table-header">
<th class="no-fade table-header"> <span class="">已用&nbsp;{{volume.formatUsedSize}}&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;{{volume.formatTotalSize}}</span>
<span class="">已用&nbsp;{{volume.formatUsedSize}}&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;{{volume.formatTotalSize}}</span> </th>
<th class="no-fade table-header sj_table_td01">
</th> <button class="btn sj_btn" ng-click="editRow(volume)">
<th class="no-fade table-header sj_table_td01"> <span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;编辑
<button class="btn sj_btn" ng-click="editRow(volume)"> </button>
<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;编辑 <button class="btn sj_btn" ng-click="showDeleteVolume.open(volume)">
</button> <span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;刪除
<button class="btn sj_btn" ng-click="deleteRow(volume)"> </button>
<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;刪除 </th>
</button> </tr>
</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="row in volume.brick track by $index" class="row.class"> <tr ng-repeat="row in volume.brick track by $index" class="row.class">
<td> <td>
<span ng-show="row.status" class="glyphicon glyphicon-ok sj_c_green " ></span> <span ng-show="row.status" class="glyphicon glyphicon-ok sj_c_green "></span>
<span ng-hide="row.status" class="glyphicon glyphicon-remove sj_c_green " ></span> <span ng-hide="row.status" class="glyphicon glyphicon-remove sj_c_green "></span>
</td> </td>
<td > <td>
<span class="">服务器{{$index+1}}</span> <span class="">服务器{{$index+1}}</span>
</td> </td>
<td > <td>
<span class="sj_table_td02">{{row.ip}}</span> <span class="sj_table_td02">{{row.ip}}</span>
</td> </td>
<td > <td>
<span class="sj_table_td02">存储路径:{{row.path}}</span> <span class="sj_table_td02">存储路径:{{row.path}}</span>
</td> </td>
<td > <td>
<span class="">已用&nbsp;{{row.formatUsedSize}}&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;{{row.formatAllSize}}</span> <span class="">已用&nbsp;{{row.formatUsedSize}}&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;{{row.formatAllSize}}</span>
</td> </td>
<td></td> <td></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div hawtio-confirm-dialog="showDeleteVolume.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showDeleteVolume.onCancelled()" on-ok="showDeleteVolume.onOk()">
<div class="dialog-body">
<p>
是否删除:{{showDeleteVolume.item.name}} 云盘?
</p>
</div>
</div>
</div> </div>

@ -4,9 +4,16 @@
<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;编辑 <span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;编辑
</button> </button>
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<button class="btn sj_btn" ng-click="deleteRow(entity)"> <button class="btn sj_btn" ng-click="deleteRowOne.open(entity)">
<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除 <span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除
</button> </button>
<div hawtio-confirm-dialog="deleteRowOne.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="deleteRowOne.onCancelled()" on-ok="deleteRowOne.onOk()">
<div class="dialog-body">
<p>
是否删除:{{deleteRowOne.item.name}} 任务?
</p>
</div>
</div>
</div> </div>
</script> </script>
<script type="text/ng-template" id="connectStatus.html"> <script type="text/ng-template" id="connectStatus.html">
@ -20,7 +27,7 @@
</div> </div>
</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"> <ng-form name="volumeForm" class=" mb10" novalidate="novalidate">
<table class="sj_new_table clear"> <table class="sj_new_table clear">
<tbody> <tbody>
@ -28,21 +35,21 @@
<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 " pattern="^\w{4,20}$" ng-disabled="!{{ngDialogData.editable}}"/> <input type="text" class="sj_txt_box03 mr10" ng-model="ngDialogData.name " pattern="^\w{4,20}$" ng-disabled="!{{ngDialogData.editable}}" />
</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}}" />
</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>
<button ng-hide="ngDialogData.status" class="sj_btn_red fl" ng-click="startVolume(ngDialogData)">启动</button> <button ng-hide="ngDialogData.status" class="sj_btn_red fl" ng-click="startVolume(ngDialogData)">启动</button>
</th> </th>
</tr> </tr>
<tr ng-repeat = "row in ngDialogData.brick"> <tr ng-repeat="row in ngDialogData.brick">
<th class="new_left"> <th class="new_left">
<span ng-show ="row.status" class="sj_icon_ok"></span> <span ng-show="row.status" class="sj_icon_ok"></span>
<span ng-hide = "row.status" class="sj_icon_warning"> <span ng-hide="row.status" class="sj_icon_warning">
</th> </th>
<th colspan="3"> <th colspan="3">
<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" />

@ -138,7 +138,7 @@ module Configs{
name: volume.name, name: volume.name,
path: volume.path, path: volume.path,
brick: brick, brick: brick,
status: volume.alive || false, status: volume.status,
editable: volume.editable || false editable: volume.editable || false
} }
} }

@ -27,10 +27,9 @@ module Configs{
usedSize: number; // volume已使用空间大小 usedSize: number; // volume已使用空间大小
brick: Array<Block>; //volume中的存储块 brick: Array<Block>; //volume中的存储块
folder?: Array<any>; //volume的文件 folder?: Array<any>; //volume的文件
status: string; status: boolean;
path: string; path: string;
editable?: boolean editable?: boolean
alive?: boolean
} }
//字节大小转换成字符大小 //字节大小转换成字符大小
@ -48,21 +47,12 @@ module Configs{
function formatVolume(volume:volume){ function formatVolume(volume:volume){
volume["formatTotalSize"] = getStringSize(volume.allSize); volume["formatTotalSize"] = getStringSize(volume.allSize);
volume["formatUsedSize"] = getStringSize(volume.usedSize); volume["formatUsedSize"] = getStringSize(volume.usedSize);
volume["editAble"] = false; volume["editable"] = false;
switch (volume.status) {
case "Stopped":
volume["alive"] = false;
break;
default:
volume["alive"] = true;
break;
}
angular.forEach(volume.brick, (brock) =>{ angular.forEach(volume.brick, (brock) =>{
brock["formatUsedSize"] = getStringSize(brock.usedSize); brock["formatUsedSize"] = getStringSize(brock.usedSize);
brock["formatAllSize"] = getStringSize(brock.availableSize); brock["formatAllSize"] = getStringSize(brock.availableSize);
brock["editAble"] = false; brock["editable"] = false;
}) })
} }
@ -124,7 +114,7 @@ module Configs{
} }
} }
}); });
this.cluster = result; this.cluster = result;
formatVolumes(this.cluster); formatVolumes(this.cluster);
} }

@ -21,14 +21,14 @@ module Configs{
data: { data: {
name: '', name: '',
path: '', path: '',
status: 'Stopped', status: false,
brick: [{ brick: [{
ip: ["0", "0", "0", "0"], ip: ["0", "0", "0", "0"],
path: '', path: '',
status: false, status: false,
editAble: true editable: true
}], }],
editAble: true editable: true
}, },
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
@ -45,8 +45,39 @@ module Configs{
}); });
} }
$scope.deleteRow = (volume) =>{ $scope.showDeleteVolume = {
console.log(volume); show: false,
item: null,
open: (entity) => {
var showDeleteVolume = $scope.showDeleteVolume;
showDeleteVolume.show = true;
showDeleteVolume.item = entity;
},
onOk: () => {
var showDeleteVolume = $scope.showDeleteVolume;
$timeout(() =>{
$http({
url: "/java/console/api/volume/delete",
method: 'POST',
data: showDeleteVolume.item
}).success(function(data,header,config,status){
/*
volume
*/
}).error(function(data,header,config,status){
});
}, 100);
},
onCancel: () =>{
var showDeleteVolume = $scope.showDeleteVolume;
showDeleteVolume.show = false;
showDeleteVolume.item = null;
}
}
/* (volume) =>{
$http({ $http({
url: "/java/console/api/volume/delete", url: "/java/console/api/volume/delete",
method: 'POST', method: 'POST',
@ -56,10 +87,10 @@ module Configs{
volume volume
*/
}).error(function(data,header,config,status){ }).error(function(data,header,config,status){
}); });
} }*/
}]); }]);
} }

@ -7,16 +7,30 @@ module Configs{
$scope.$emit('editRow', entity); $scope.$emit('editRow', entity);
} }
$scope.deleteRow = (entity) =>{ $scope.deleteRowOne ={
$scope.$emit('deleteRow', entity); show: false,
item: null,
open: (entity) => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = true;
deleteRowOne.item = entity;
},
onOk: () => {
var deleteRowOne = $scope.deleteRowOne;
$scope.$emit('deleteRow', deleteRowOne.item);
},
onCancel: () => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = false;
deleteRowOne.item = null;
}
} }
}]); }]);
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => { export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
$scope.status = $scope.ngDialogData.status; $scope.status = $scope.ngDialogData.status;
$scope.save = (entity) =>{ $scope.save = (entity) =>{
changeStatus(entity); changeStatus(entity);
console.log(entity);
$scope.closeThisDialog(); $scope.closeThisDialog();
} }
@ -36,16 +50,14 @@ module Configs{
ip: "", //存储块的机器ip地址 ip: "", //存储块的机器ip地址
path: "", //存储块路径 path: "", //存储块路径
status: false, //存储块的状态 status: false, //存储块的状态
editAble:true editable:true
}; };
addBrock(volume, block); addBrock(volume, block);
$scope.showMessage = false; $scope.showMessage = false;
} }
$scope.stopVolume = (volume) =>{ $scope.stopVolume = (volume) =>{
volume.status = false; volume.status = false;
//$scope. status=
} }
$scope.startVolume = (volume) =>{ $scope.startVolume = (volume) =>{
@ -53,9 +65,14 @@ module Configs{
} }
function changeStatus(entity){ function changeStatus(entity){
angular.forEach(entity.brick, (brick) =>{ angular.forEach(entity.brick, (brick) =>{
brick["ip"] = brick.ip.join("."); var ip = [];
if(brick["ip"] instanceof Object){
for(var key in brick["ip"])
ip.push(brick["ip"][key]);
brick["ip"] = ip.join("\.");
}
}); });
$http({ $http({

@ -132,8 +132,8 @@ module Kubernetes {
showDeleteOne.item = null; showDeleteOne.item = null;
} }
}; };
$scope.deleteRow = (entity) =>{ /*$scope.deleteRow = (entity) =>{
$scope.$emit('deleteRow', entity); $scope.$emit('deleteRow', entity);
} }*/
}]); }]);
} }

Loading…
Cancel
Save