完善gfs配置页面
This commit is contained in:
parent
9fba2532f1
commit
1fe0e27d9f
|
@ -24,10 +24,9 @@ declare module Configs {
|
|||
usedSize: number;
|
||||
brick: Array<Block>;
|
||||
folder?: Array<any>;
|
||||
status: string;
|
||||
status: boolean;
|
||||
path: string;
|
||||
editable?: boolean;
|
||||
alive?: boolean;
|
||||
}
|
||||
/**
|
||||
刪除volume中指定的brock
|
||||
|
|
|
@ -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"/>
|
||||
|
@ -78,4 +59,23 @@
|
|||
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
|
||||
/// <reference path="d.ts/kubernetes/ts/tabs.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"/>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -248,8 +248,8 @@ gulp.task('connect', ['watch'], function() {
|
|||
targetPath: '/hawtio/git'
|
||||
}, {
|
||||
proto: "http",
|
||||
port: "8088",
|
||||
hostname: "192.168.0.110",
|
||||
port: "8080",
|
||||
hostname: "192.168.191.5",
|
||||
path: '/java/console/api',
|
||||
targetPath: "/"
|
||||
}];
|
||||
|
|
|
@ -15,57 +15,62 @@
|
|||
</div>
|
||||
</div>
|
||||
<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">
|
||||
<tr>
|
||||
<th ng-show="row.status == Started ||Created" 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 class="no-fade table-header sj_table_td06">
|
||||
<span class="">{{volume.name}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header sj_table_td02" >
|
||||
<span class="">云路径:{{volume.path}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header sj_table_td02" >
|
||||
<span class=""></span>
|
||||
</th>
|
||||
|
||||
<th class="no-fade table-header">
|
||||
<span class="">已用 {{volume.formatUsedSize}} / 共 {{volume.formatTotalSize}}</span>
|
||||
|
||||
</th>
|
||||
<th class="no-fade table-header sj_table_td01">
|
||||
<button class="btn sj_btn" ng-click="editRow(volume)">
|
||||
<span class="glyphicon glyphicon-pencil"></span> 编辑
|
||||
</button>
|
||||
<button class="btn sj_btn" ng-click="deleteRow(volume)">
|
||||
<span class="glyphicon glyphicon-trash"></span> 刪除
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
<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 class="no-fade table-header sj_table_td06">
|
||||
<span class="">{{volume.name}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header sj_table_td02">
|
||||
<span class="">云路径:{{volume.path}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header sj_table_td02">
|
||||
<span class=""></span>
|
||||
</th>
|
||||
<th class="no-fade table-header">
|
||||
<span class="">已用 {{volume.formatUsedSize}} / 共 {{volume.formatTotalSize}}</span>
|
||||
</th>
|
||||
<th class="no-fade table-header sj_table_td01">
|
||||
<button class="btn sj_btn" ng-click="editRow(volume)">
|
||||
<span class="glyphicon glyphicon-pencil"></span> 编辑
|
||||
</button>
|
||||
<button class="btn sj_btn" ng-click="showDeleteVolume.open(volume)">
|
||||
<span class="glyphicon glyphicon-trash"></span> 刪除
|
||||
</button>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="row in volume.brick track by $index" class="row.class">
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td >
|
||||
<span class="">服务器{{$index+1}}</span>
|
||||
</td>
|
||||
<td >
|
||||
<span class="sj_table_td02">{{row.ip}}</span>
|
||||
</td>
|
||||
<td >
|
||||
<span class="sj_table_td02">存储路径:{{row.path}}</span>
|
||||
</td>
|
||||
<td >
|
||||
<span class="">已用 {{row.formatUsedSize}} / 共 {{row.formatAllSize}}</span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr ng-repeat="row in volume.brick track by $index" class="row.class">
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td>
|
||||
<span class="">服务器{{$index+1}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="sj_table_td02">{{row.ip}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="sj_table_td02">存储路径:{{row.path}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="">已用 {{row.formatUsedSize}} / 共 {{row.formatAllSize}}</span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
|
|
@ -4,9 +4,16 @@
|
|||
<span class="glyphicon glyphicon-pencil"></span> 编辑
|
||||
</button>
|
||||
<span class="pull-right"> </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> 删除
|
||||
</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>
|
||||
</script>
|
||||
<script type="text/ng-template" id="connectStatus.html">
|
||||
|
@ -20,7 +27,7 @@
|
|||
</div>
|
||||
</script>
|
||||
<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">
|
||||
<table class="sj_new_table clear">
|
||||
<tbody>
|
||||
|
@ -28,21 +35,21 @@
|
|||
<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 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>
|
||||
<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>
|
||||
<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>
|
||||
</th>
|
||||
</tr>
|
||||
<tr ng-repeat = "row in ngDialogData.brick">
|
||||
<tr ng-repeat="row in ngDialogData.brick">
|
||||
<th class="new_left">
|
||||
<span ng-show ="row.status" class="sj_icon_ok"></span>
|
||||
<span ng-hide = "row.status" class="sj_icon_warning">
|
||||
<span ng-show="row.status" class="sj_icon_ok"></span>
|
||||
<span ng-hide="row.status" class="sj_icon_warning">
|
||||
</th>
|
||||
<th colspan="3">
|
||||
<input type="text" class="sj_txt_box04 mr5" value="服务器 {{$index + 1}} " ng-disabled="true" />
|
||||
|
|
|
@ -138,7 +138,7 @@ module Configs{
|
|||
name: volume.name,
|
||||
path: volume.path,
|
||||
brick: brick,
|
||||
status: volume.alive || false,
|
||||
status: volume.status,
|
||||
editable: volume.editable || false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,10 +27,9 @@ module Configs{
|
|||
usedSize: number; // volume已使用空间大小
|
||||
brick: Array<Block>; //volume中的存储块
|
||||
folder?: Array<any>; //volume的文件
|
||||
status: string;
|
||||
status: boolean;
|
||||
path: string;
|
||||
editable?: boolean
|
||||
alive?: boolean
|
||||
editable?: boolean
|
||||
}
|
||||
|
||||
//字节大小转换成字符大小
|
||||
|
@ -48,21 +47,12 @@ module Configs{
|
|||
function formatVolume(volume:volume){
|
||||
volume["formatTotalSize"] = getStringSize(volume.allSize);
|
||||
volume["formatUsedSize"] = getStringSize(volume.usedSize);
|
||||
volume["editAble"] = false;
|
||||
switch (volume.status) {
|
||||
case "Stopped":
|
||||
volume["alive"] = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
volume["alive"] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
volume["editable"] = false;
|
||||
|
||||
angular.forEach(volume.brick, (brock) =>{
|
||||
brock["formatUsedSize"] = getStringSize(brock.usedSize);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@ module Configs{
|
|||
data: {
|
||||
name: '',
|
||||
path: '',
|
||||
status: 'Stopped',
|
||||
status: false,
|
||||
brick: [{
|
||||
ip: ["0", "0", "0", "0"],
|
||||
path: '',
|
||||
status: false,
|
||||
editAble: true
|
||||
editable: true
|
||||
}],
|
||||
editAble: true
|
||||
editable: true
|
||||
},
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
|
@ -45,8 +45,39 @@ module Configs{
|
|||
});
|
||||
}
|
||||
|
||||
$scope.deleteRow = (volume) =>{
|
||||
console.log(volume);
|
||||
$scope.showDeleteVolume = {
|
||||
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({
|
||||
url: "/java/console/api/volume/delete",
|
||||
method: 'POST',
|
||||
|
@ -56,10 +87,10 @@ module Configs{
|
|||
|
||||
更新volume信息
|
||||
|
||||
*/
|
||||
|
||||
}).error(function(data,header,config,status){
|
||||
|
||||
});
|
||||
}
|
||||
}*/
|
||||
}]);
|
||||
}
|
|
@ -7,16 +7,30 @@ module Configs{
|
|||
$scope.$emit('editRow', entity);
|
||||
}
|
||||
|
||||
$scope.deleteRow = (entity) =>{
|
||||
$scope.$emit('deleteRow', entity);
|
||||
$scope.deleteRowOne ={
|
||||
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) => {
|
||||
$scope.status = $scope.ngDialogData.status;
|
||||
$scope.save = (entity) =>{
|
||||
changeStatus(entity);
|
||||
console.log(entity);
|
||||
changeStatus(entity);
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
|
@ -36,16 +50,14 @@ module Configs{
|
|||
ip: "", //存储块的机器ip地址
|
||||
path: "", //存储块路径
|
||||
status: false, //存储块的状态
|
||||
editAble:true
|
||||
editable:true
|
||||
};
|
||||
addBrock(volume, block);
|
||||
$scope.showMessage = false;
|
||||
}
|
||||
|
||||
$scope.stopVolume = (volume) =>{
|
||||
volume.status = false;
|
||||
//$scope. status=
|
||||
|
||||
volume.status = false;
|
||||
}
|
||||
|
||||
$scope.startVolume = (volume) =>{
|
||||
|
@ -53,9 +65,14 @@ module Configs{
|
|||
|
||||
}
|
||||
|
||||
function changeStatus(entity){
|
||||
function changeStatus(entity){
|
||||
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({
|
||||
|
|
|
@ -132,8 +132,8 @@ module Kubernetes {
|
|||
showDeleteOne.item = null;
|
||||
}
|
||||
};
|
||||
$scope.deleteRow = (entity) =>{
|
||||
/*$scope.deleteRow = (entity) =>{
|
||||
$scope.$emit('deleteRow', entity);
|
||||
}
|
||||
}*/
|
||||
}]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue