---V1.5版本

This commit is contained in:
wu ming 2016-12-13 15:00:19 +08:00
parent 1ea7fae6f3
commit 64f0a0e949
8 changed files with 3190 additions and 3292 deletions

File diff suppressed because one or more lines are too long

View File

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

View File

@ -414,7 +414,16 @@
</div> </div>
</script> </script>
<script type="text/ng-template" id="uploadErrorInfo.html">
<div class="container-fluid">
<div class="row">
<span class="col-md-5"">错误信息:</span>
</div>
<div class="row" ng-repeat="info in ngDialogData">
<span>{{info}}</span>
</div>
</div>
</script>
<div ng-controller="Kubernetes.TopLevel"> <div ng-controller="Kubernetes.TopLevel">
<div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over uploader="uploader" over-class="ready-drop"> <div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over uploader="uploader" over-class="ready-drop">
<div class="row kubernetes-view" ng-view></div> <div class="row kubernetes-view" ng-view></div>

View File

@ -151,9 +151,10 @@ module Configs{
export function FileInputPlugin(fn: Function, isMultiple?:boolean){ export function FileInputPlugin(fn: Function, isMultiple?:boolean){
var inputObj = document.createElement('input'); var inputObj = document.createElement('input');
inputObj.setAttribute('id','myFileInput'); inputObj.setAttribute('id', 'myFileInput');
inputObj.setAttribute('type','file'); inputObj.setAttribute('type', 'file');
inputObj.setAttribute("style",'visibility:hidden'); inputObj.setAttribute("style", 'visibility:hidden');
inputObj.setAttribute("accept", "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
if(isMultiple) if(isMultiple)
inputObj.setAttribute("multiple", "multiple"); inputObj.setAttribute("multiple", "multiple");
document.body.appendChild(inputObj); document.body.appendChild(inputObj);

View File

@ -396,9 +396,7 @@ module Developer {
break; break;
default: default:
volumeType = 1 volumeType = 1
} }
console.log(dataType);
console.log(volumeType) ;
return { return {
"dataType": dataType, "dataType": dataType,
"volumeType": volumeType "volumeType": volumeType

View File

@ -29,16 +29,16 @@
<i class="glyphicon glyphicon-save"></i> 删除 <i class="glyphicon glyphicon-save"></i> 删除
</button> </button>
</div> </div>
<div class="row clear fr mr5">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="checkSQLSERVER()">
<i class="glyphicon glyphicon-save"></i> 抽取
</button>
</div>
<div class="row clear fr mr5"> <div class="row clear fr mr5">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="check()"> <button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="check()">
<i class="glyphicon glyphicon-save"></i> 校验 <i class="glyphicon glyphicon-save"></i> 校验
</button> </button>
</div> </div>
<div class="row clear fr mr5">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="checkSQLSERVER()">
<i class="glyphicon glyphicon-save"></i> 抽取
</button>
</div>
</div> </div>
<div class="col-md-12 clear"> <div class="col-md-12 clear">
<table ng-show="tableData.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped table_sj_td_center"> <table ng-show="tableData.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped table_sj_td_center">
@ -83,6 +83,11 @@
<td title="'联系人'">{{row.departmentManager}}</td> <td title="'联系人'">{{row.departmentManager}}</td>
<td title="'联系方式'">{{row.managerContacts}}</td> <td title="'联系方式'">{{row.managerContacts}}</td>
<td title="'数据库类型'">{{row.dataBaseType}}</td> <td title="'数据库类型'">{{row.dataBaseType}}</td>
<td title="'存储状态'">
<span ng-show="row.mark==0">热区</span>
<span ng-show="row.mark==1">冷区</span>
<span ng-show="row.mark==null"></span>
</td>
<td title="'抽取日志'"> <td title="'抽取日志'">
<button class="btn sj_btn" ng-click="openLog(row)"> <button class="btn sj_btn" ng-click="openLog(row)">
<span>查看日志</span> <span>查看日志</span>

View File

@ -93,22 +93,28 @@ module System{
data: JSON.stringify(fileNameList), data: JSON.stringify(fileNameList),
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
complete: (XMLHttpRequest, textStatus) =>{ complete: (XMLHttpRequest, textStatus) =>{
$("#load").remove();
Kubernetes.removeMask();
if(XMLHttpRequest.status == 200){
Configs.customAlert("提示", "操作成功: 本次excel文件录入成功", '',null, 0, "success");
}else{
Configs.customAlert("提示", "操作失败: 本次excel文件录入失败", '',null, 0, "error");
}
}, },
success : (data) =>{ success : (data) =>{
$("#load").remove();
Kubernetes.removeMask();
$scope.model = SystemModel.systemInfoList = data.data; $scope.model = SystemModel.systemInfoList = data.data;
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: $scope.model dataset: $scope.model
}); });
Configs.customAlert("提示", "操作成功: 本次excel文件录入成功", '',null, 0, "success");
}, },
error: (MLHttpRequest, textStatus, errorThrown) =>{ error: (XMLHttpRequest, textStatus, errorThrown) =>{
//Configs.customAlert("提示", "操作失败: 本次excel文件录入失败, " + textStatus, '',null, 0, "error"); $("#load").remove();
Kubernetes.removeMask();
if(XMLHttpRequest["responseJSON"].err && XMLHttpRequest["responseJSON"].err instanceof Array)
ngDialog.open({
template: 'uploadErrorInfo.html',
width: 790,
closeByDocument: false,
data: XMLHttpRequest["responseJSON"].err,
className: 'ngdialog-theme-default'
});
} }
}); });
}); });
@ -124,81 +130,7 @@ module System{
element.outerHTML = element.outerHTML; element.outerHTML = element.outerHTML;
} }
}, true); }, true);
} }
$scope.upLoadExcelFiles = (files) =>{
var fileNameList = []; //获取文件名列表
angular.forEach(files, (file) => {
fileNameList.push(file.name);
});
Configs.create_mask();
Kubernetes.create_locadEffect("正在上传文件...");
var target = document.getElementById('loading');
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
var r = new Resumable({
target:'/java/console/api/fileOperation/file/upload',
chunkSize:1*1024*1024,
simultaneousUploads:4,
testChunks: false,
throttleProgressCallbacks:1,
method: "octet"
/*headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
}*/
});
if(!r.support){
throw "当前浏览器不支持Resumable.js文件上传";
}else{
angular.forEach(files, (file) => {
r.addFile(file);
})
r.on('fileAdded', function(file){
r.upload();
});
r.on('complete', function(){
$('#loadmsg').html("所以文件上传完毕,正在读取文件中的数据,此过程时间可能会较长,请稍等...");
$.ajax({
type: "POST",
url: UrlHelpers.join("/java/console/api/fileOperation/importExcel"),
timeout: 8000 * fileNameList.length,
dataType: 'json',
data: JSON.stringify(fileNameList),
contentType: "application/json; charset=utf-8",
complete: (XMLHttpRequest, textStatus) =>{
$("#load").remove();
Kubernetes.removeMask();
if(XMLHttpRequest.status == 200){
Configs.customAlert("提示", "操作成功: 本次excel文件录入成功", '',null, 0, "success");
}else{
Configs.customAlert("提示", "操作失败: 本次excel文件录入失败", '',null, 0, "error");
}
},
success : (data) =>{
$scope.model = SystemModel.systemInfoList = data.data;
$scope.tableParams.settings({
dataset: $scope.model
});
},
error: (MLHttpRequest, textStatus, errorThrown) =>{
//Configs.customAlert("提示", "操作失败: 本次excel文件录入失败, " + textStatus, '',null, 0, "error");
}
});
});
r.on('fileProgress', function(file){
$('#loadmsg').html("上传文件:" + file.fileName + " " + Math.floor(r.progress()*100) + '%');
//Kubernetes.create_locadEffect("上传文件:" + file.name + " " + Math.floor(r.progress()*100) + '%'); //创建数据加载效果层
});
//解决不同重复选择相同文件
var element = document.getElementById("file-uploads");
element.outerHTML = element.outerHTML;
}
}
//excel下载 //excel下载
$scope.downLoadExcelFile = () =>{ $scope.downLoadExcelFile = () =>{

View File

@ -99,7 +99,8 @@ module System{
*/ */
Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error");
return; return;
} }7
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion; item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
if(item.dataBaseType == 'ORACLE'){ if(item.dataBaseType == 'ORACLE'){
Configs.customAlert("提示", "操作失败:ORACLE数据请在服务集群界面中抽取标准表", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:ORACLE数据请在服务集群界面中抽取标准表", '',null, 0, "error");
@ -138,11 +139,9 @@ module System{
Configs.customAlert("提示", "操作失败:部分数据不存在,无法删除", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:部分数据不存在,无法删除", '',null, 0, "error");
return; return;
} }
} }
//检查数据是否在迁移 //检查数据是否已启动 //检查数据是否在迁移
//检查数据是否已启动
var message = Kubernetes.checkForMigration(KubernetesModel.replicationControllers, DataModel.transferTasks.transferTasks , filter); var message = Kubernetes.checkForMigration(KubernetesModel.replicationControllers, DataModel.transferTasks.transferTasks , filter);
if(message != ""){ if(message != ""){
@ -151,7 +150,7 @@ module System{
} }
/*UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{ UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: filter, collection: filter,
index: 'index', index: 'index',
onClose: (result:boolean) => { onClose: (result:boolean) => {
@ -187,7 +186,7 @@ module System{
customClass: "alert alert-warning sj_alert-warning", customClass: "alert alert-warning sj_alert-warning",
cancelText: "取消", cancelText: "取消",
cancelClass: 'sj_btn_grey' cancelClass: 'sj_btn_grey'
}).open(); */ }).open();
} }
$scope.check = () => { $scope.check = () => {
@ -224,6 +223,15 @@ module System{
Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error");
return; return;
} }
/**
*/
if(item.mark == 1){
Configs.customAlert("提示", "操作失败:选择的系统的数据存储在冷区,请先将数据迁移到热区再检验!", '',null, 0, "error");
return
}
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion; item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
selectedItems.push(item); selectedItems.push(item);
if(item.dataBaseType == 'ORACLE'){ if(item.dataBaseType == 'ORACLE'){