Merge branch 'Web_Manager_Develope' of https://git.trustie.net/fhx569287825/aggregation-platform into Web_Manager_Develope

Web_Manager_Develope
Linda 8 years ago
commit db6799ce4f

@ -26,6 +26,7 @@ declare module Configs {
brick: Array<Brick>; brick: Array<Brick>;
status: boolean; status: boolean;
editable: boolean; editable: boolean;
hot: boolean;
} }
interface Brick { interface Brick {
ip: Array<string>; ip: Array<string>;

@ -27,6 +27,7 @@ declare module Configs {
status: boolean; status: boolean;
path: string; path: string;
editable?: boolean; editable?: boolean;
hot?: number;
} }
function formatVolumes(volumes: Array<volume>): void; function formatVolumes(volumes: Array<volume>): void;
/** /**

@ -12,6 +12,7 @@ declare module Developer {
priorTableSize: number; priorTableSize: number;
keyQuery: any; keyQuery: any;
volumeType: number; volumeType: number;
totlePage: number;
createParamData(): { createParamData(): {
currentPageNum: number; currentPageNum: number;
dataType: any; dataType: any;

@ -223,7 +223,7 @@ declare module Kubernetes {
function getOracleStatus(labels: any): number; function getOracleStatus(labels: any): number;
function getExtractStatus(labels: any): number; function getExtractStatus(labels: any): number;
function getOracleName(replicas: any): string; function getOracleName(replicas: any): string;
function extractDataToOracle($http: any, selectedReplicationControllers: any, targetOracle: Configs.oracleParam, fn?: (data, status) => void): void; function extractDataToOracle($http: any, url: any, selectedReplicationControllers: any, targetOracle: Configs.oracleParam, fn?: (data, status) => void): void;
function checkoutOracleIsRunning(rc: any): boolean; function checkoutOracleIsRunning(rc: any): boolean;
function replicasIsCreated(replicationcontrollers: Array<any>, name: string): boolean; function replicasIsCreated(replicationcontrollers: Array<any>, name: string): boolean;
function loadConfigs(): { function loadConfigs(): {
@ -250,4 +250,5 @@ declare module Kubernetes {
function create_locadEffect(msg: any): void; function create_locadEffect(msg: any): void;
function createSuccessInfo(icon: string, msg: string): void; function createSuccessInfo(icon: string, msg: string): void;
function removeMask(): void; function removeMask(): void;
function checkRCIsExtracting(selected: Array<any>): boolean;
} }

@ -67,7 +67,7 @@ declare module Kubernetes {
**/ **/
function checkForExtract(replicationControllers: Array<any>): any[]; function checkForExtract(replicationControllers: Array<any>): any[];
function checkIsStartSuccess(replicationControllers: Array<any>): any[]; function checkIsStartSuccess(replicationControllers: Array<any>): any[];
function checkForMigration(replicationControllers: Array<KubePod>, transferTasks: Array<any>, selectItem: Array<any>): string; function checkForMigration(replicationControllers: Array<KubePod>, transferTasks: Array<any>, selectItem: Array<any>, type: string): string;
function eliminateChechBoxClick(): void; function eliminateChechBoxClick(): void;
function alreadyExitInFolder(selectedItems: Array<any>, selectNode: any): boolean; function alreadyExitInFolder(selectedItems: Array<any>, selectNode: any): boolean;
} }

@ -3,6 +3,10 @@
/// <reference path="systemHelpers.d.ts" /> /// <reference path="systemHelpers.d.ts" />
/// <reference path="systemServices.d.ts" /> /// <reference path="systemServices.d.ts" />
/// <reference path="../../configs/ts/configsUtils.d.ts" /> /// <reference path="../../configs/ts/configsUtils.d.ts" />
/// <reference path="../../kubernetes/ts/kubernetesHelpers.d.ts" />
/// <reference path="../../configs/ts/customAlert.d.ts" />
/// <reference path="../../configs/ts/configsDataService.d.ts" />
/// <reference path="../../kubernetes/ts/term.d.ts" />
declare module System { declare module System {
var SystemVerificationController: ng.IModule; var SystemVerificationController: ng.IModule;
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -155,14 +155,14 @@
</li> </li>
</ul> </ul>
</nav> </nav>
<div class="sj_content_position clear" style="margin-top:70px;"> <div class="sj_content_position clear" style="margin-top:50px;">
<ul> <!--<ul>
<li class="sj_icons_home"></li> <li class="sj_icons_home"></li>
<li>当前位置:</li> <li>当前位置:</li>
<li><a href="#">数据汇总</a> <span>&gt;</span></li> <li><a href="#">数据汇总</a> <span>&gt;</span></li>
<li><a href="#">社保系统</a><span>&gt;</span></li> <li><a href="#">社保系统</a><span>&gt;</span></li>
<li><a href="#">批次A</a></li> <li><a href="#">批次A</a></li>
</ul> </ul>-->
</div> </div>
<platform-sub-tabs-outlet></platform-sub-tabs-outlet> <platform-sub-tabs-outlet></platform-sub-tabs-outlet>
<div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet> <div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet>

@ -28,7 +28,9 @@
<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>
<span ng-show="{{volume.hot==0}}">热区</span>
<span ng-show="{{volume.hot==1}}">冷区</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>
@ -59,7 +61,7 @@
<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>

@ -105,6 +105,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-2 control-label">标准表汇总库</label>
<div class="col-sm-10 sj_form_input">
<select class="form-control" ng-model="tableForm.type">
<option value=0 ng-selected="tableForm.type==0" selected></option>
<option value=1 ng-selected="tableForm.type==1"></option>
</select>
</div>
</div>
<div class="form-group" style="margin-left:140px;"> <div class="form-group" style="margin-left:140px;">
<button class="btn sj_btn_blue" type='submit' style="color:#fff;" > <button class="btn sj_btn_blue" type='submit' style="color:#fff;" >
<span class="glyphicon glyphicon-save "></span> 保存 <span class="glyphicon glyphicon-save "></span> 保存

@ -40,10 +40,6 @@
<th> <th>
<input type="text" class="sj_txt_box02 mr5" name="volumePath" ng-model="ngDialogData.path" ng-disabled="!{{ngDialogData.editable}}" ng-pattern="/^(\/[a-z0-9A-Z _\-.%]+)+$/" required="required" /> <input type="text" class="sj_txt_box02 mr5" name="volumePath" ng-model="ngDialogData.path" ng-disabled="!{{ngDialogData.editable}}" ng-pattern="/^(\/[a-z0-9A-Z _\-.%]+)+$/" required="required" />
</th> </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_blue fl" ng-click="startVolume(ngDialogData)">启动</button>
</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">
@ -88,8 +84,11 @@
</th> </th>
<!--<th> <!--<th>
<button class="sj_btn_grey mr5" ng-click="cancel()">取消</button> <button class="sj_btn_grey mr5" ng-click="cancel()">取消</button>
</th> -->
<th colspan="5" ng-show="!ngDialogData.name">
<span>是否为热区</span>
<input type="checkbox" checked="checked" name="hot" ng-model="ngDialogData.hot"/>
</th> </th>
<!--<th colspan="5">&nbsp;{{message}}</th>-->
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -239,7 +238,7 @@
<button class="btn pull-right sj_btn_blue " ng-click="replace()"> <button class="btn pull-right sj_btn_blue " ng-click="replace()">
替换 替换
</button> </button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button> <button class="sj_btn_grey mr5 fr" ng-click="cancel()">保留</button>
</div> </div>
</div> </div>
</script> </script>
@ -414,6 +413,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>

@ -147,12 +147,14 @@ module Configs{
editable: block.editable || false editable: block.editable || false
}); });
}); });
return { return {
name: volume.name, name: volume.name,
path: volume.path, path: volume.path,
brick: brick, brick: brick,
status: volume.status, status: volume.status,
editable: volume.editable || false editable: volume.editable || false,
hot: volume.hot == 0 ? true : false
} }
} }
@ -169,7 +171,8 @@ module Configs{
path: string path: string
brick: Array<Brick>; brick: Array<Brick>;
status: boolean; status: boolean;
editable: boolean editable: boolean,
hot: boolean
} }
export interface Brick{ export interface Brick{

@ -29,7 +29,8 @@ module Configs{
folder?: Array<any>; //volume的文件 folder?: Array<any>; //volume的文件
status: boolean; status: boolean;
path: string; path: string;
editable?: boolean editable?: boolean,
hot?: number
} }
//字节大小转换成字符大小 //字节大小转换成字符大小

@ -154,6 +154,7 @@ module Configs{
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);

@ -31,7 +31,8 @@ module Configs{
status: false, status: false,
editable: true editable: true
}], }],
editable: true editable: true,
hot: true
}, },
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
@ -128,6 +129,8 @@ module Configs{
} }
}); });
data.hot = data.hot == true ? 0 : 1;
var spinner; var spinner;
$.ajax({ $.ajax({

@ -46,6 +46,11 @@ module Configs{
field: "suffix", field: "suffix",
displayName: "表后缀" displayName: "表后缀"
}, },
{
field: "type",
displayName: "标准表汇总库",
cellTemplate: $templateCache.get("strandColumn.html")
},
{ {
field: "entity", field: "entity",
displayName: "操作", displayName: "操作",
@ -68,6 +73,7 @@ module Configs{
$scope.edit = false; $scope.edit = false;
$scope.tableForm = {}; $scope.tableForm = {};
$scope.tableForm["id"]=0; $scope.tableForm["id"]=0;
$scope.tableForm["type"]=0;
} }
$scope.cancel = () => { $scope.cancel = () => {

@ -68,6 +68,7 @@ module Configs{
} }
$scope.onSubmit = (entity) => { $scope.onSubmit = (entity) => {
console.log(entity);
if($scope.volumeForm.$valid){ if($scope.volumeForm.$valid){
$scope.$emit('update', entity); $scope.$emit('update', entity);
$scope.closeThisDialog(); $scope.closeThisDialog();
@ -104,13 +105,13 @@ module Configs{
throw "浏览器不支持FileReader读取文件"; throw "浏览器不支持FileReader读取文件";
}else{ }else{
Configs.FileInputPlugin((file) =>{ Configs.FileInputPlugin((file) =>{
$scope.enable = true;
if(typeof typeof FileReader == 'undefined') if(typeof typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件"; throw "浏览器不支持FileReader读取文件";
else{ else{
var fr = new FileReader(); var fr = new FileReader();
fr.onloadend = (e) =>{ fr.onloadend = (e) =>{
$scope.new_content = e.target["result"]; $scope.new_content = e.target["result"];
$scope.enable = true;
} }
fr.onloadstart = () =>{ fr.onloadstart = () =>{
@ -154,13 +155,13 @@ module Configs{
$scope.title = shareInit($scope.ngDialogData); $scope.title = shareInit($scope.ngDialogData);
$scope.sqlFileUpload = () =>{ $scope.sqlFileUpload = () =>{
Configs.FileInputPlugin((file) =>{ Configs.FileInputPlugin((file) =>{
$scope.enable = true; if(typeof FileReader == 'undefined')
if(typeof typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件"; throw "浏览器不支持FileReader读取文件";
else{ else{
var fr = new FileReader(); var fr = new FileReader();
fr.onloadend = (e) =>{ fr.onloadend = (e) =>{
$scope.content = e.target["result"]; $scope.content = e.target["result"];
$scope.enable = true;
} }
fr.onloadstart = () =>{ fr.onloadstart = () =>{
@ -230,6 +231,14 @@ module Configs{
} }
$scope.cancel = () => { $scope.cancel = () => {
//$scope.closeThisDialog();
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "delete",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog(); $scope.closeThisDialog();
} }
}]); }]);

@ -30,19 +30,19 @@
<i class="glyphicon glyphicon-export"></i> 迁移 <i class="glyphicon glyphicon-export"></i> 迁移
</button> </button>
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<button class="btn pull-right sj_btn_grey " ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)"> <button ng-show="isShow" class="btn pull-right sj_btn_grey " ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-play-circle"></i> 启动 <i class="glyphicon glyphicon-play-circle"></i> 启动
</button> </button>
</div> </div>
<ul class="fr sj_table_bottom"> <ul class="fr sj_table_bottom">
<li class="mr5 ">当前显示1~{{model.data.length}}行,共{{model.data.length}}行。</li> <li class="mr5 ">当前显示{{(model.paramOptions.currentPageNum-1)*20 + 1}}~{{(model.paramOptions.currentPageNum-1)*20 + model.data.length}}行,共{{model.paramOptions.totalSize}}行,</li>
<li class="mr5 ">每页显示 <!--<li class="mr5 ">每页显示
<select ng-options="value for value in pageSizeChoses" ng-change="selectAction()" ng-model="options.currentTableSize"></select> <select ng-options="value for value in pageSizeChoses" ng-cha=nge="selectAction()" ng-model="options.currentTableSize"></select>
</li> </li>-->
<li class="mr5 ">当前页码</li> <li class="mr5 ">当前页码</li>
<li> <li>
<div class="hawtio-pager clearfix"> <div class="hawtio-pager clearfix">
<label>{{options.currentPageNum}} / {{options.getPageSizeNum()}}</label> <label>{{model.paramOptions.currentPageNum}} / {{model.paramOptions.totlePage}}</label>
<div class=btn-group> <div class=btn-group>
<button class="btn sj_btn_grey" ng-disabled="isEmptyOrFirst()" ng-click="first()"><i class="fa fa-fast-backward"></i></button> <button class="btn sj_btn_grey" ng-disabled="isEmptyOrFirst()" ng-click="first()"><i class="fa fa-fast-backward"></i></button>
<button class="btn sj_btn_grey" ng-disabled="isEmptyOrFirst()" ng-click="previous()"><i class="fa fa-step-backward"></i></button> <button class="btn sj_btn_grey" ng-disabled="isEmptyOrFirst()" ng-click="previous()"><i class="fa fa-step-backward"></i></button>
@ -65,7 +65,7 @@
<label class="col-sm-3 control-label sj_contro_label" for="selectedItem "> <label class="col-sm-3 control-label sj_contro_label" for="selectedItem ">
请选择迁移集群 请选择迁移集群
</label> </label>
<select ng-model="migrationClick.selectedItem " class="col-sm-3 sj_modal_select" title="name of the new namespace " id="selectedItem " ng-options="x.name for x in volumes " /> <select ng-model="migrationClick.selectedItem " class="col-sm-3 sj_modal_select" id="selectedItem " ng-options="x.name for x in volumes " />
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12 alert alert-warning" ng-show="!volumes || volumes.length == 0"> <div class="col-sm-12 alert alert-warning" ng-show="!volumes || volumes.length == 0">

@ -12,6 +12,7 @@ module Developer{
public priorTableSize = 20; public priorTableSize = 20;
public keyQuery = null; public keyQuery = null;
public volumeType = 1; public volumeType = 1;
public totlePage = 1;
public createParamData(){ public createParamData(){
var extendValue =["cityName", "districtName", "dataVersion", "systemName", "dataYear"]; var extendValue =["cityName", "districtName", "dataVersion", "systemName", "dataYear"];
@ -35,6 +36,7 @@ module Developer{
public getPageSizeNum(){ public getPageSizeNum(){
var num = Math.ceil(this.totalSize/this.currentTableSize); var num = Math.ceil(this.totalSize/this.currentTableSize);
console.log(this.totalSize);
if(num < this.currentPageNum) if(num < this.currentPageNum)
num = this.currentPageNum; num = this.currentPageNum;
return num; return num;
@ -49,6 +51,9 @@ module Developer{
year: year year: year
} }
} }
function createAlias(cityName:string, districtName:string, systemName:string, version:string, year:string){
return cityName + "_" + districtName + "_" + systemName + "_" + year + "_版本" + version;
}
function createKey(regionalismCode, systemId, version){ function createKey(regionalismCode, systemId, version){
return regionalismCode + "-" + systemId + "-" + version; return regionalismCode + "-" + systemId + "-" + version;
} }
@ -59,6 +64,15 @@ module Developer{
return result; return result;
} }
function createItemsAlias(items: Array<any>){
var result = [];
angular.forEach(items, (item) => {
item.alias = createAlias(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
result.push(item);
});
return result;
}
function populateLabel(item){ function populateLabel(item){
var result = item var result = item
result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year); result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
@ -106,22 +120,25 @@ module Developer{
function formatTask(items:Array<any>){ function formatTask(items:Array<any>){
var result = []; var result = [];
angular.forEach(items, (item) => { angular.forEach(items, (item) => {
result.push({ var tmp_batch="";
id: item.id, if(item.submittedBatch.indexOf("批次")==-1){
_key: item.regionalismCode + "-" + item.systemCode + "-" + item.dataVersion, tmp_batch="批次"+item.submittedBatch;
name: item.cityName+ "-" + item.districtName, }else{
systemName: item.systemName, tmp_batch=item.submittedBatch;
status: item.completeStatus, }
process: item.rate, item["_key"] = item.regionalismCode + "-" + item.systemCode + "-" + item.dataVersion;
from: item.dataPath, item["name"] = item.cityName+ "-" + item.districtName;
to: item.dstPath, item["status"] = item.completeStatus;
labels:{ item["from"] = item.dataPath;
item["process"] = item.rate;
item["to"] = item.dstPath;
item["labels"] ={
dataType: item.dataType, dataType: item.dataType,
batch: "批次"+item.submittedBatch, batch: tmp_batch,
dataVersion: "版本"+item.dataVersion, dataVersion: "版本"+item.dataVersion,
dataYear: item.year dataYear: item.year
} }
}); result.push(item);
}); });
return result; return result;
} }
@ -147,6 +164,7 @@ module Developer{
success : function(data) { success : function(data) {
result = data.data; result = data.data;
paramOptions.totalSize = data.length; paramOptions.totalSize = data.length;
paramOptions.totlePage = data.page.totlePage;
} }
}); });
return result; return result;
@ -166,6 +184,7 @@ module Developer{
this.data = populateKeys(this.data); this.data = populateKeys(this.data);
this.data = populateNames(this.data); this.data = populateNames(this.data);
this.data = populateLabels(this.data); this.data = populateLabels(this.data);
this.data = createItemsAlias(this.data);
} }
//更新用户选择参数 //更新用户选择参数

@ -14,12 +14,11 @@ module Developer {
($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, ConfigsModel:Configs.ConfigsModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element, ngDialog) => { ($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataModel:Developer.DataModelService, ConfigsModel:Configs.ConfigsModelService, KubernetesState, $templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, $element, ngDialog) => {
$scope.model=DataModel; $scope.model=DataModel;
$scope.replicasModel = KubernetesModel; $scope.replicasModel = KubernetesModel;
init($scope, $location, $routeParams);
$scope.options = DataModel.paramOptions; $scope.options = DataModel.paramOptions;
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption; $scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
var result = getDataType($location) var result = getDataType($location);
$scope.options.dataType = result["dataType"];
$scope.options.volumeType = result["volumeType"];
$scope.treeOptions = { $scope.treeOptions = {
nodeChildren: "childNodes", nodeChildren: "childNodes",
@ -65,6 +64,10 @@ module Developer {
return field.systemCode; return field.systemCode;
} }
}, },
{
field: "dataBaseType",
displayName: '数据库类型',
},
{ {
field: "labels", field: "labels",
displayName: '数据标签', displayName: '数据标签',
@ -90,6 +93,10 @@ module Developer {
} }
}; };
init($scope, $location, $routeParams);
$scope.model.paramOptions.dataType = result["dataType"];
$scope.model.paramOptions.volumeType = result["volumeType"];
$scope.$on("dataLabelFilterUpdate", ($event, text, key) => { $scope.$on("dataLabelFilterUpdate", ($event, text, key) => {
$scope.keyQuery += " " + text; $scope.keyQuery += " " + text;
}) })
@ -99,19 +106,20 @@ module Developer {
nav.class=""; nav.class="";
}); });
item.class="active"; item.class="active";
$scope.model.updateParamOption("currentPageNum", 1);
$scope.model.updateParamOption("keyQuery", $scope.keyQuery); $scope.model.updateParamOption("keyQuery", $scope.keyQuery);
$scope.model.updateParamOption("dataBatch", item.alias); $scope.model.updateParamOption("dataBatch", item.alias);
} }
$scope.isEmptyOrFirst = () => { $scope.isEmptyOrFirst = () => {
var idx = $scope.model.getParamOption("currentPageNum"); var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum(); var length =$scope.model.paramOptions.totlePage;
return length <= 0 || idx <= 1; return length <= 0 || idx <= 1;
} }
$scope.isEmptyOrLast = () =>{ $scope.isEmptyOrLast = () =>{
var idx = $scope.model.getParamOption("currentPageNum"); var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum(); var length =$scope.model.paramOptions.totlePage;
return length < 1 || idx >= length; return length < 1 || idx >= length;
} }
@ -125,7 +133,7 @@ module Developer {
$scope.last = () =>{ $scope.last = () =>{
var idx = $scope.model.getParamOption("currentPageNum"); var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum(); var length =$scope.model.paramOptions.totlePage;
if(idx < length){ if(idx < length){
Kubernetes.eliminateChechBoxClick(); Kubernetes.eliminateChechBoxClick();
$scope.model.updateParamOption("currentPageNum", length); $scope.model.updateParamOption("currentPageNum", length);
@ -134,7 +142,7 @@ module Developer {
$scope.previous = () => { $scope.previous = () => {
var idx = $scope.model.getParamOption("currentPageNum"); var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum(); var length =$scope.model.paramOptions.totlePage;
if(idx > 1){ if(idx > 1){
Kubernetes.eliminateChechBoxClick(); Kubernetes.eliminateChechBoxClick();
$scope.model.updateParamOption("currentPageNum", idx-1); $scope.model.updateParamOption("currentPageNum", idx-1);
@ -142,7 +150,7 @@ module Developer {
} }
$scope.next = () =>{ $scope.next = () =>{
var length =$scope.options.getPageSizeNum(); var length =$scope.model.paramOptions.totlePage;
var idx = $scope.model.getParamOption("currentPageNum"); var idx = $scope.model.getParamOption("currentPageNum");
if(idx < length){ if(idx < length){
Kubernetes.eliminateChechBoxClick(); Kubernetes.eliminateChechBoxClick();
@ -150,7 +158,7 @@ module Developer {
} }
} }
$scope.$watch('options', (newValue, oldValue) => { $scope.$watch('model.paramOptions', (newValue, oldValue) => {
if(newValue){ if(newValue){
if(newValue.currentTableSize !== oldValue.currentTableSize) if(newValue.currentTableSize !== oldValue.currentTableSize)
$scope.options.priorTableSize = oldValue.currentTableSize; $scope.options.priorTableSize = oldValue.currentTableSize;
@ -162,6 +170,8 @@ module Developer {
}, true); }, true);
$scope.search = () => { $scope.search = () => {
//$scope.model.initParamOptions();
$scope.model.paramOptions.currentPageNum = 1;
$scope.model.updateParamOption("keyQuery", $scope.keyQuery); $scope.model.updateParamOption("keyQuery", $scope.keyQuery);
} }
@ -175,7 +185,7 @@ module Developer {
/* /*
使 使
*/ */
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems); var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems, "manager");
if(message != ""){ if(message != ""){
Configs.customAlert("提示", "操作失败:" + message + ",不能删除!", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:" + message + ",不能删除!", '',null, 0, "error");
return; return;
@ -183,7 +193,7 @@ module Developer {
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{ UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected, collection: selected,
index: 'id', index: 'alias',
onClose: (result:boolean) => { onClose: (result:boolean) => {
var idColl = []; var idColl = [];
if (result) { if (result) {
@ -223,6 +233,7 @@ module Developer {
,$http:httpurl; ,$http:httpurl;
*/ */
if(Kubernetes.alreadyExitInFolder($scope.tableConfig.selectedItems, $scope.selectNode)){ if(Kubernetes.alreadyExitInFolder($scope.tableConfig.selectedItems, $scope.selectNode)){
migrationClick.close(); migrationClick.close();
Configs.customAlert("提示", "操作失败:" + "数据已在当前目录!", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:" + "数据已在当前目录!", '',null, 0, "error");
@ -250,10 +261,16 @@ module Developer {
}, },
open: (selected) =>{ open: (selected) =>{
var migrationClick = $scope.migrationClick; var migrationClick = $scope.migrationClick;
ConfigsModel.updateVolumeData();
if(ConfigsModel.cluster!=null)
$scope.volumes = ConfigsModel.cluster;
/* /*
使 使
*/ */
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems);
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems, "manager");
if(message == ""){ if(message == ""){
if($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length >0) if($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length >0)
@ -271,8 +288,16 @@ module Developer {
$scope.createOracleService = (items) =>{ $scope.createOracleService = (items) =>{
var exitedItems = Kubernetes.checkForCreateOracle($scope.model.transferTasks, items); var exitedItems = Kubernetes.checkForCreateOracle($scope.model.transferTasks, items);
for (var i = 0; i < items.length; ++i) {
// code...
if(items[i].dataBaseType != 'ORACLE'){
Configs.customAlert("提示", "操作失败: 非ORACLE数据不需要挂载启动", '', null, 0, "error");
return;
}
}
if(exitedItems.length == 0){ if(exitedItems.length == 0){
angular.forEach(items,(item)=>{ angular.forEach(items,(item)=>{
console.log(item);
var isExited = Kubernetes.checkForExit($scope.replicasModel.replicationControllers, item); var isExited = Kubernetes.checkForExit($scope.replicasModel.replicationControllers, item);
if(!isExited){ if(!isExited){
Kubernetes.createRC({ Kubernetes.createRC({
@ -287,7 +312,8 @@ module Developer {
districtName: item.districtName, districtName: item.districtName,
systemName: item.systemName, systemName: item.systemName,
id: item.id+"", id: item.id+"",
year: item.year year: item.year,
checkoutFlag: item.checkoutFlag
}, },
path: item.dataPath+"app/", path: item.dataPath+"app/",
isTarget: "false", isTarget: "false",
@ -311,8 +337,8 @@ module Developer {
} }
function init($scope,$location,$routeParams){ function init($scope,$location,$routeParams){
//$scope.model.updateModel();
$scope.keyQuery = ""; $scope.keyQuery = "";
$scope.model.initParamOptions();
$scope.model.updateParamOption("keyQuery", $scope.keyQuery); $scope.model.updateParamOption("keyQuery", $scope.keyQuery);
if(ConfigsModel.cluster!=null) if(ConfigsModel.cluster!=null)
$scope.volumes = ConfigsModel.cluster; $scope.volumes = ConfigsModel.cluster;
@ -339,7 +365,15 @@ module Developer {
title: "查看批次B的数据", title: "查看批次B的数据",
class: "", class: "",
alias: "B" alias: "B"
}] }];
if(!($location.path().indexOf("hot") > -1)){
$scope.tableConfig.columnDefs.splice(7,0,{
field: "existHotData",
displayName: '是否已在热区',
cellTemplate: $templateCache.get("isExistHot.html")
});
}
} }
function getDataType($location){ function getDataType($location){
@ -347,6 +381,11 @@ module Developer {
var dataType; var dataType;
var volumeType; var volumeType;
var subPath = path.split("/"); var subPath = path.split("/");
if(path.indexOf("hot") > -1)
$scope.isShow = true;
else
$scope.isShow = false;
switch (subPath[subPath.length -1]) { switch (subPath[subPath.length -1]) {
case "financial": case "financial":
dataType = "财政"; dataType = "财政";

@ -5,9 +5,7 @@
</script> </script>
<script type="text/ng-template" id="idTemplate.html"> <script type="text/ng-template" id="idTemplate.html">
<div class="ngCellText nowrap"> <div class="ngCellText nowrap">
<a href="" title="View details for {{row.entity.metadata.name || row.entity.name}}"> <strong>{{row.entity.$oracleName || row.entity.name}}</strong>
<!--<img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}" ng-show="row.entity.$iconUrl">-->
<strong>{{row.entity.$oracleName || row.entity.name}}</strong></a>
</div> </div>
</script> </script>
<script type="text/ng-template" id="selectorTemplate.html"> <script type="text/ng-template" id="selectorTemplate.html">
@ -47,7 +45,7 @@
<script type="text/ng-template" id="labelTemplate.html"> <script type="text/ng-template" id="labelTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.Labels"> <div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.Labels">
<p ng-show="data"><strong>Labels</strong></p> <p ng-show="data"><strong>Labels</strong></p>
<span ng-repeat="label in labels track by $index" class="pod-label badge" ng-class="labelClass(label.key)" ng-click="handleClick(entity, label.key, label)" title="{{label.key}}"><span class="glyphicon glyphicon-tag"/> {{label.title}}</span> <span ng-repeat="label in labels track by $index" class="pod-label badge" ng-class="labelClass(label.key)" ng-click="handleClick(entity, label.key, label)"><span class="glyphicon glyphicon-tag"/> {{label.title}}</span>
</div> </div>
</script> </script>
<script type="text/ng-template" id="eventSourceTemplate.html"> <script type="text/ng-template" id="eventSourceTemplate.html">
@ -59,7 +57,7 @@
<script type="text/ng-template" id="dataLabelsTemplate.html"> <script type="text/ng-template" id="dataLabelsTemplate.html">
<div class="ngCellText" ng-init="labels=row.entity.labels" ng-controller="Kubernetes.DataLabels"> <div class="ngCellText" ng-init="labels=row.entity.labels" ng-controller="Kubernetes.DataLabels">
<p ng-show="data"><strong>Labels</strong></p> <p ng-show="data"><strong>Labels</strong></p>
<span ng-repeat="(key, value) in labels track by $index" class="pod-label badge" ng-class="labelClass(key)" ng-click="labelClick(entity, key, value)" title="{{key}}"><span class="glyphicon glyphicon-tag"/> {{value}}</span> <span ng-repeat="(key, value) in labels track by $index" class="pod-label badge" ng-class="labelClass(key)" ng-click="labelClick(entity, key, value)"><span class="glyphicon glyphicon-tag"/> {{value}}</span>
</div> </div>
</script> </script>
<script type="text/ng-template" id="hostTemplate.html"> <script type="text/ng-template" id="hostTemplate.html">
@ -213,9 +211,12 @@
</script> </script>
<script type="text/ng-template" id="taskEdit.html"> <script type="text/ng-template" id="taskEdit.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskEdit"> <div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskEdit">
<button class="btn sj_btn" ng-click="showDeleteOne.open(entity)"> <button class="btn sj_btn" ng-click="showDeleteOne.open(entity)" ng-disabled="entity.status == 1 || entity.status == 0">
<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除 <span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除
</button> </button>
<button class="btn sj_btn" ng-click="showCancelOne.open(entity)" ng-disabled="entity.process == 100 || entity.status = 3">
<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;取消
</button>
<div hawtio-confirm-dialog="showDeleteOne.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showDeleteOne.onCancelled()" on-ok="showDeleteOne.onOk()"> <div hawtio-confirm-dialog="showDeleteOne.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showDeleteOne.onCancelled()" on-ok="showDeleteOne.onOk()">
<div class="dialog-body"> <div class="dialog-body">
<p> <p>
@ -223,6 +224,13 @@
</p> </p>
</div> </div>
</div> </div>
<div hawtio-confirm-dialog="showCancelOne.show" title="是否取消任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showCancelOne.onCancelled()" on-ok="showCancelOne.onOk()">
<div class="dialog-body">
<p>
是否取消:{{entity.name}}-{{entity.systemName}} 任务?
</p>
</div>
</div>
</div> </div>
</script> </script>
<!-- 迁移进度条 --> <!-- 迁移进度条 -->
@ -265,7 +273,6 @@
<span ng-show="entity.extractStatus == 2" class="badge"> 已完成</span> <span ng-show="entity.extractStatus == 2" class="badge"> 已完成</span>
</div> </div>
</script> </script>
<script type="text/ng-template" id="loadingMask.html"> <script type="text/ng-template" id="loadingMask.html">
<div class="custom-alert"> <div class="custom-alert">
<div id="loading"> <div id="loading">
@ -273,7 +280,29 @@
</div> </div>
</div> </div>
</script> </script>
<script type="text/ng-template" id="dataCheckStatus.html">
<div class="ngCellText" ng-init="entity=row.entity">
<span ng-show="entity.metadata.annotations.checkoutFlag == 0">未校验</span>
<span ng-show="entity.metadata.annotations.checkoutFlag == 1">已校验</span>
<span ng-show="entity.metadata.annotations.checkoutFlag == 2">校验中</span>
</div>
</script>
<script type="text/ng-template" id="strandColumn.html">
<div class="ngCellText" ng-init="entity=row.entity">
<div ng-show="true" title="是否是标准表汇总库">
<span ng-show="entity.type == 0">&nbsp;</span>
<span ng-show="entity.type == 1">&nbsp;</span>
</div>
</div>
</script>
<script type="text/ng-template" id="isExistHot.html">
<div class="ngCellText" ng-init="entity=row.entity">
<div ng-show="true" title="是否是标准表汇总库">
<span ng-show="entity.existHotData == 0">&nbsp;</span>
<span ng-show="entity.existHotData == 1">&nbsp;</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>

@ -4,7 +4,7 @@
<span class="fa fa-caret-down"></span> <span class="fa fa-caret-down"></span>
</div> </div>
<div class="terminal-title" ng-mousedown="mouseDown($event)" ng-mouseup="mouseUp($event)" ng-mousemove="mouseMove($event)"> <div class="terminal-title" ng-mousedown="mouseDown($event)" ng-mouseup="mouseUp($event)" ng-mousemove="mouseMove($event)">
<h5 class="top-bottom-middle">{{containerName}}的汇总日志</h5> <h5 class="top-bottom-middle">{{containerName}}的抽取日志</h5>
<i class="fa fa-remove pull-right clickable" title="Close and exit this log" ng-click="close()"></i> <i class="fa fa-remove pull-right clickable" title="Close and exit this log" ng-click="close()"></i>
<i class="fa fa-square-o pull-right clickable" title="Maximize this log" ng-click="maximize($event)"></i> <i class="fa fa-square-o pull-right clickable" title="Maximize this log" ng-click="maximize($event)"></i>
<i class="fa fa-sort-desc pull-right clickable" ng-hide="maximized()" title="Minimize this log" ng-click="minimize($event)"></i> <i class="fa fa-sort-desc pull-right clickable" ng-hide="maximized()" title="Minimize this log" ng-click="minimize($event)"></i>

@ -61,7 +61,14 @@
ng-click="extractClick.open(id || tableConfig.selectedItems)"> ng-click="extractClick.open(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-cloud-download"></i> 汇总 <i class="glyphicon glyphicon-cloud-download"></i> 汇总
</button> </button>
<!--<span ng-include="'runButton.html'"></span>--> <span class="pull-right">&nbsp;</span>
<button ng-show="model.fetched"
ng-disabled="!id && tableConfig.selectedItems.length == 0"
class="btn btn-success pull-right sj_btn_grey"
ng-click="extractOracle(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-cloud-download"></i> 抽取
</button>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

@ -1816,7 +1816,7 @@ module Kubernetes {
return annotation["cityName"] + "-" + annotation["districtName"] + "-" + annotation["systemName"]; return annotation["cityName"] + "-" + annotation["districtName"] + "-" + annotation["systemName"];
} }
export function extractDataToOracle($http, selectedReplicationControllers, targetOracle: Configs.oracleParam, fn?:(data, status) => void){ export function extractDataToOracle($http, url, selectedReplicationControllers, targetOracle: Configs.oracleParam, fn?:(data, status) => void){
//console.log(targetReplicationController.length); //console.log(targetReplicationController.length);
var answer = targetOracle && true; var answer = targetOracle && true;
var inneedOracle = []; var inneedOracle = [];
@ -1836,7 +1836,7 @@ module Kubernetes {
var spinner; var spinner;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: UrlHelpers.join("/java/console/api/oracle", targetOracle.id+"", "extract"), url: UrlHelpers.join(url, targetOracle.id+"", "extract"),
timeout: 8000, timeout: 8000,
dataType: 'json', dataType: 'json',
//async: false, //async: false,
@ -1851,7 +1851,7 @@ module Kubernetes {
complete: (XMLHttpRequest, textStatus) => { complete: (XMLHttpRequest, textStatus) => {
if(XMLHttpRequest.status == 200){ if(XMLHttpRequest.status == 200){
//spinner.spin(); //spinner.spin();
Kubernetes.createSuccessInfo("success", "连接汇总库成功,即将执行汇总操作!"); Kubernetes.createSuccessInfo("success", "连接汇总库成功,即将执行汇总或抽取操作!");
setTimeout("Kubernetes.removeMask()", 1500); setTimeout("Kubernetes.removeMask()", 1500);
} }
else{ else{
@ -1950,4 +1950,16 @@ module Kubernetes {
//document.body.removeChild(result); //document.body.removeChild(result);
} }
export function checkRCIsExtracting(selected:Array<any>){
var answer = false;
for(var i = 0; i < selected.length; i++){
var label = getLabels(selected[i]);
if(label.isExtract == 1){
answer = true;
break;
}
}
return answer;
}
} }

@ -359,6 +359,10 @@ module Kubernetes {
replicationController.$oracleStatus = getOracleStatus(getLabels(replicationController)); replicationController.$oracleStatus = getOracleStatus(getLabels(replicationController));
replicationController.$extractStatus = getExtractStatus(getLabels(replicationController)); replicationController.$extractStatus = getExtractStatus(getLabels(replicationController));
//
var annotation = getAnnotations(replicationController);
var label = getLabels(replicationController);
replicationController.$alias = annotation.cityName + "_" + annotation.districtName + "_" + annotation.systemName + "_" + annotation.year + "_" + label.version;
var selectedPods = replicationController.$pods; var selectedPods = replicationController.$pods;
replicationController.connectTo = selectedPods.map((pod) => { replicationController.connectTo = selectedPods.map((pod) => {

@ -49,7 +49,7 @@ module Kubernetes {
$scope.openLogs = (entity) => { $scope.openLogs = (entity) => {
log.debug("Open logs: ", entity); log.debug("Open logs: ", entity);
TerminalService.newTerminal($interval, entity.metadata.selfLink, entity.$oracleName, entity,$templateCache.get(UrlHelpers.join(templatePath, 'logShell.html'))); TerminalService.newTerminal($interval, entity.metadata.selfLink, entity.$oracleName, entity, "/java/console/api/oracle/extract/log?rcName=" + getName(entity), $templateCache.get(UrlHelpers.join(templatePath, 'logShell.html')));
} }
}); });

@ -66,6 +66,11 @@ module Kubernetes {
{ field: '$extractStatus', { field: '$extractStatus',
displayName: '数据汇总状态', displayName: '数据汇总状态',
cellTemplate: $templateCache.get("dataSummaryTemplate.html") cellTemplate: $templateCache.get("dataSummaryTemplate.html")
},
{
field: '$checkStatus',
displayName: '检验状态',
cellTemplate: $templateCache.get("dataCheckStatus.html")
} }
], ],
sortInfo: { sortInfo: {
@ -86,7 +91,7 @@ module Kubernetes {
if(extractItems.length == 0){ if(extractItems.length == 0){
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{ UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected, collection: selected,
index: 'metadata.name', index: '$alias',
onClose: (result:boolean) => { onClose: (result:boolean) => {
if (result) { if (result) {
function deleteSelected(selected:Array<KubePod>, next:KubePod) { function deleteSelected(selected:Array<KubePod>, next:KubePod) {
@ -151,7 +156,7 @@ module Kubernetes {
if(extractItems.length == 0){ if(extractItems.length == 0){
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{ UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected, collection: selected,
index: 'metadata.name', index: '$alias',
onClose: (result:boolean) => { onClose: (result:boolean) => {
if (result) { if (result) {
function stopSelected(selected:Array<KubePod>, next:KubePod) { function stopSelected(selected:Array<KubePod>, next:KubePod) {
@ -205,6 +210,50 @@ module Kubernetes {
startSelected(selected, selected.shift()); startSelected(selected, selected.shift());
}; };
/**
**/
$scope.extractOracle = (selected) =>{
var answer = false;
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
if(ConfigsModel.oracleParam[i].type == 1){
answer = true
break;
}
}
if(answer == false){
/**
**/
Configs.customAlert("提示", "操作失败:没有配置默认的标准表汇总库", '',null, 0, "error");
return;
}
// 检查数据库是否已启动
var result = checkIsStartSuccess(selected);
if(result.length > 0){
Configs.customAlert("提示", "操作失败:选择服务中存在未启动的数据库,请先启动服务", '',null, 0, "error");
return;
}
var answer = false;
var selectedItem = null;
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
if(ConfigsModel.oracleParam[i].type == 1){
selectedItem = ConfigsModel.oracleParam[i];
answer = true
break;
}
}
if(answer == false){
/**
**/
Configs.customAlert("提示", "操作失败:没有配置默认的标准表汇总库", '',null, 0, "error");
return;
}
Kubernetes.extractDataToOracle($http, "/java/console/api/oracle/standardextract", selected, selectedItem);
}
$scope.extractClick = { $scope.extractClick = {
items: null, items: null,
selectedItem: {name: "当前没有可用的汇总库"}, selectedItem: {name: "当前没有可用的汇总库"},
@ -212,7 +261,7 @@ module Kubernetes {
onOk: () => { onOk: () => {
var extractClick = $scope.extractClick; var extractClick = $scope.extractClick;
extractClick.items = $scope.tableConfig.selectedItems; extractClick.items = $scope.tableConfig.selectedItems;
Kubernetes.extractDataToOracle($http, extractClick.items, extractClick.selectedItem); Kubernetes.extractDataToOracle($http, "/java/console/api/oracle", extractClick.items, extractClick.selectedItem);
//extractClick.selectedItem = $scope.filterReplicationControllers[0] || ""; //extractClick.selectedItem = $scope.filterReplicationControllers[0] || "";
extractClick.dialog.close(); extractClick.dialog.close();
}, },
@ -222,7 +271,15 @@ module Kubernetes {
extractClick.selectedItem = $scope.configs.oracleParam[0]; extractClick.selectedItem = $scope.configs.oracleParam[0];
var result = checkIsStartSuccess($scope.tableConfig.selectedItems); var result = checkIsStartSuccess($scope.tableConfig.selectedItems);
if(result.length >0){ if(result.length >0){
Configs.customAlert("提示", "操作失败:选择服务中存在未启动的数据,请先启动服务", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:选择服务中存在未启动的数据库,请先启动服务", '',null, 0, "error");
return;
}
/**
**/
if(checkRCIsExtracting(selected)){
Configs.customAlert("提示", "操作失败:选择的数据库中有正在执行汇总的数据库,请勿重复执行汇总操作", '',null, 0, "error");
return; return;
} }
extractClick.dialog.open(); extractClick.dialog.open();

@ -118,7 +118,7 @@ module Kubernetes {
item: null, item: null,
open: (entity) => { open: (entity) => {
if(entity.status == 1) if(entity.status == 1)
Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能迁移", '',null, 0, "error"); Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能删除", '',null, 0, "error");
else{ else{
var showDeleteOne = $scope.showDeleteOne; var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = true; showDeleteOne.show = true;
@ -135,9 +135,29 @@ module Kubernetes {
showDeleteOne.item = null; showDeleteOne.item = null;
} }
}; };
/*$scope.deleteRow = (entity) =>{
$scope.$emit('deleteRow', entity); $scope.showCancelOne = {
}*/ show: false,
item: null,
open: (entity) => {
/*if(entity.status == 1)
Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能删除!", '',null, 0, "error");
else{*/
var showCancelOne = $scope.showCancelOne;
showCancelOne.show = true;
showCancelOne.item = entity;
//}
},
onOk: () => {
var showCancelOne = $scope.showCancelOne;
$scope.$emit('deleteRow', showCancelOne.item);
},
onCancel: ()=>{
var showCancelOne = $scope.showCancelOne;
showCancelOne.show = false;
showCancelOne.item = null;
}
};
}]); }]);
export var LoadMask = controller('LoadMask', ['$scope', ($scope) => { export var LoadMask = controller('LoadMask', ['$scope', ($scope) => {

@ -43,7 +43,7 @@ module Kubernetes {
}, },
terminals: {}, terminals: {},
httpTask: {}, httpTask: {},
newTerminal: ($interval, podLink, containerName, entity, template = defaultTemplate) => { newTerminal: ($interval, podLink, containerName, entity, url ,template = defaultTemplate) => {
var terminalId = UrlHelpers.join(podLink, containerName); var terminalId = UrlHelpers.join(podLink, containerName);
if (terminalId in self.terminals) { if (terminalId in self.terminals) {
log.debug("Already a terminal with id: ", terminalId); log.debug("Already a terminal with id: ", terminalId);
@ -51,7 +51,7 @@ module Kubernetes {
return terminalId; return terminalId;
} }
var scope = $rootScope.$new(); var scope = $rootScope.$new();
getLogs(entity, scope); getLogs(entity, scope, url);
scope.podLink = podLink; scope.podLink = podLink;
scope.containerName = containerName; scope.containerName = containerName;
scope.id = terminalId; scope.id = terminalId;
@ -61,7 +61,7 @@ module Kubernetes {
return terminalId; return terminalId;
}else{ }else{
self.httpTask[terminalId] = $interval(() =>{ self.httpTask[terminalId] = $interval(() =>{
getLogs(entity, scope); getLogs(entity, scope, url);
},2000); },2000);
} }
var el = $($compile(template)(scope)); var el = $($compile(template)(scope));
@ -300,7 +300,7 @@ module Kubernetes {
}; };
}); });
function getLogs(rc, scope){ function getLogs(rc, scope, url){
var xhr= new XMLHttpRequest(); var xhr= new XMLHttpRequest();
xhr.onreadystatechange = () => { xhr.onreadystatechange = () => {
if(xhr.readyState == 4){ if(xhr.readyState == 4){
@ -319,7 +319,8 @@ module Kubernetes {
} }
} }
} }
xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false); xhr.open("POST", url, false);
//xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false);
xhr.send(null); xhr.send(null);
} }
} }

@ -240,18 +240,6 @@ module Kubernetes {
return trueValue; return trueValue;
} }
/*
,oracle
export function checkForMigration(replicationControllers:Array<KubePod>, selectItem:Array<any>){
var result = [];
angular.forEach(selectItem, (item) => {
if(checkForExit(replicationControllers, item))
result.push(item);
});
return result;
} */
export function checkForExit(replicationControllers:Array<KubePod>, selectItem){ export function checkForExit(replicationControllers:Array<KubePod>, selectItem){
for(var index in replicationControllers) { for(var index in replicationControllers) {
var replicas = replicationControllers[index]; var replicas = replicationControllers[index];
@ -283,7 +271,10 @@ module Kubernetes {
function checkForExitTask(transferTasks:Array<any>, selectItem){ function checkForExitTask(transferTasks:Array<any>, selectItem){
for(var index in transferTasks){ for(var index in transferTasks){
var task = transferTasks[index]; var task = transferTasks[index];
if(task["_key"] == selectItem["_key"] && (task["status"] == "1" || task["status"] == "0") && selectItem["year"] == task.labels.dataYear){ if(task["_key"] == selectItem["_key"] && selectItem["year"] == task.labels.dataYear ){
if(task.status == 2 || task.status == 3)
return false;
else
return true; return true;
} }
} }
@ -316,31 +307,51 @@ module Kubernetes {
/* /*
使 使
*/ */
export function checkForMigration(replicationControllers:Array<KubePod>, transferTasks: Array<any>, selectItem:Array<any>){ export function checkForMigration(replicationControllers:Array<KubePod>, transferTasks: Array<any>, selectItem:Array<any>, type:string){
var message = ""; var message = "";
for (var index in selectItem) { for (var index in selectItem) {
var item = selectItem[index]; var item = selectItem[index];
var id = null;
if(type == 'manager')
id = item.id;
if(type == 'verify')
id = item.dataId
/* /*
使
*/ */
for (var i in replicationControllers) {
var labels = getLabels(replicationControllers[i]); for(i in transferTasks){
if(getName(replicationControllers[i]) == item._key && getAnnotationValueBykey(replicationControllers[i],"year") == item["year"] && labels.version == item.labels.version){ /*if(transferTasks[i]["_key"] == item["_key"] && (transferTasks[i]["status"] == "1" || transferTasks[i]["status"] == "0") && item["year"] == transferTasks[i].labels.dataYear){
message = "数据正在使用"; message = "数据正在迁移"
return message;
}*/
if(transferTasks[i].fkid == id && (transferTasks[i]["status"] == "1" || transferTasks[i]["status"] == "0")){
message = "数据正在迁移"
return message; return message;
} }
} }
/**
*/
if(item["mark"] == 1)
continue;
/* /*
使
*/ */
for(i in transferTasks){ for (var i in replicationControllers) {
if(transferTasks[i]["_key"] == item["_key"] && (transferTasks[i]["status"] == "1" || transferTasks[i]["status"] == "0") && item["year"] == transferTasks[i].labels.dataYear && item.labels.version == transferTasks[i].labels.dataVersion){ var labels = getLabels(replicationControllers[i]);
message = "数据正在迁移" if(getName(replicationControllers[i]) == item._key && getAnnotationValueBykey(replicationControllers[i],"year") == item["year"]){
message = "数据正在使用";
return message; return message;
} }
} }
} }
return message; return message;
} }

@ -160,10 +160,10 @@ module Navigation {
class="{{breadcrumb.active ? 'active' : ''}}" class="{{breadcrumb.active ? 'active' : ''}}"
ng-class="$last ? 'dropdown' : ''" ng-class="$last ? 'dropdown' : ''"
> >
<a ng-show="breadcrumb.href" href="{{breadcrumb.href}}">{{label(breadcrumb)}}</a> <a ng-show="false" href="{{breadcrumb.href}}"></a>
<span ng-hide="breadcrumb.href">{{label(breadcrumb)}}</span> <span ng-hide="true">{{label(breadcrumb)}}</span>
</li> </li>
<li ng-show="pageTitle"> <li ng-show="false">
<span ng-bind="pageTitle"></span> <span ng-bind="pageTitle"></span>
</li> </li>
</ol> </ol>

@ -18,7 +18,7 @@
</button> </button>
</div> </div>
<div ng-show="true"> <div ng-show="true">
<div class="col-md-12" style="padding-left:0; padding-right:20px;"> <div class="col-md-12" style="padding-left:0px; padding-right:0px;">
<div ng-show="model.length == 0" class="alert alert-warning sj_alert-warning"> <div ng-show="model.length == 0" class="alert alert-warning sj_alert-warning">
<span class="help-block"> <span class="help-block">
当前没有可以查看的数据请点击Excel导入按钮导入Excel数据</span></div> 当前没有可以查看的数据请点击Excel导入按钮导入Excel数据</span></div>

@ -3,7 +3,7 @@
<div class="container-fluid sj_fluid"> <div class="container-fluid sj_fluid">
<div class="mb10 clear"> <div class="mb10 clear">
<div class="row clear fl mr5 mt5"> <div class="row clear fl mr5 mt5">
<label>行政区划代码</label> <label>地区:</label>
</div> </div>
<div class="row clear fl"> <div class="row clear fl">
<select class="form-control sj_select_box" ng-change="citySelect(x)" ng-model="x" ng-init="x='all'"> <select class="form-control sj_select_box" ng-change="citySelect(x)" ng-model="x" ng-init="x='all'">
@ -11,12 +11,18 @@
<option ng-repeat="city in cities">{{city}}</option> <option ng-repeat="city in cities">{{city}}</option>
</select> </select>
</div> </div>
<div class="row clear fl mr5 mt5">
<label>&nbsp;</label>
</div>
<div class="row clear fl"> <div class="row clear fl">
<select class="form-control sj_select_box" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'"> <select class="form-control sj_select_box" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'">
<option value="all">全部</option> <option value="all">全部</option>
<option ng-repeat="country in countries">{{country.name}}</option> <option ng-repeat="country in countries">{{country.name}}</option>
</select> </select>
</div> </div>
<div class="row clear fl mr5 mt5">
<label>&nbsp;区/县&nbsp;&nbsp;&nbsp;状态</label>
</div>
<div class="row clear fl mr10"> <div class="row clear fl mr10">
<select class="form-control sj_select_box" ng-change="statusSelect(z)" ng-model="z" ng-init="z='all'"> <select class="form-control sj_select_box" ng-change="statusSelect(z)" ng-model="z" ng-init="z='all'">
<option value="all">全部</option> <option value="all">全部</option>
@ -29,7 +35,7 @@
<!--</button> --> <!--</button> -->
</div> </div>
<div class="row clear fr"> <div class="row clear fr">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="quitFile()"> <button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="quickFile()">
<i class="glyphicon glyphicon-save"></i> 一键归档 <i class="glyphicon glyphicon-save"></i> 一键归档
</button> </button>
</div> </div>

@ -4,7 +4,7 @@
<div class="container-fluid sj_fluid "> <div class="container-fluid sj_fluid ">
<div class="mb10 clear"> <div class="mb10 clear">
<div class="row clear fl mr5 mt5"> <div class="row clear fl mr5 mt5">
<label>行政区划代码</label> <label>地区:</label>
</div> </div>
<div class="row clear fl"> <div class="row clear fl">
<select class="form-control sj_select_box" ng-change="citySelect(x)" ng-model="x" ng-init="x='all'"> <select class="form-control sj_select_box" ng-change="citySelect(x)" ng-model="x" ng-init="x='all'">
@ -12,17 +12,28 @@
<option ng-repeat="city in cities">{{city}}</option> <option ng-repeat="city in cities">{{city}}</option>
</select> </select>
</div> </div>
<div class="row clear fl mr5 mt5">
<label>&nbsp;&nbsp;</label>
</div>
<div class="row clear fl mr10"> <div class="row clear fl mr10">
<select class="form-control sj_select_box" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'"> <select class="form-control sj_select_box" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'">
<option value="all">请选择区/县</option> <option value="all">请选择区/县</option>
<option ng-repeat="country in countries">{{country.name}}</option> <option ng-repeat="country in countries">{{country.name}}</option>
</select> </select>
</div> </div>
<div class="row clear fl mr5 mt5">
<label>区/县&nbsp;</label>
</div>
<div class="row clear fr mr20"> <div class="row clear fr mr20">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="deleteRows()"> <button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="deleteRows()">
<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> 校验
@ -40,8 +51,26 @@
</td> </td>
<td title="'验证结果'">{{row.checkResult}}</td> <td title="'验证结果'">{{row.checkResult}}</td>
<td title="'采集'">{{row.collection}}</td> <td title="'采集'">{{row.collection}}</td>
<td title="'支付信息标准表'">{{row.payResultLast}}</td> <td title="'支付信息标准表'">
<td title="'可执行标准表'">{{row.execResultLast}}</td> <span ng-show="row.payResultLast == 0">未校验</span>
<span ng-show="row.payResultLast == 1">不需校验</span>
<span ng-show="row.payResultLast == 2">校验中</span>
<span ng-show="row.payResultLast == 3">标准表存在</span>
<span ng-show="row.payResultLast == 4">标准表不存在</span>
<span ng-show="row.payResultLast == 5">待抽取</span>
<span ng-show="row.payResultLast == 6">正在抽取</span>
<span ng-show="row.payResultLast == 7">抽取完成</span>
</td>
<td title="'可执行标准表'">
<span ng-show="row.execResultLast == 0">未校验</span>
<span ng-show="row.execResultLast == 1">不需校验</span>
<span ng-show="row.execResultLast == 2">校验中</span>
<span ng-show="row.execResultLast == 3">标准表存在</span>
<span ng-show="row.execResultLast == 4">标准表不存在</span>
<span ng-show="row.execResultLast == 5">待抽取</span>
<span ng-show="row.execResultLast == 6">正在抽取</span>
<span ng-show="row.execResultLast == 7">抽取完成</span>
</td>
<td title="'市'">{{row.cityName}}</td> <td title="'市'">{{row.cityName}}</td>
<td title="'区/县'">{{row.districtName}}</td> <td title="'区/县'">{{row.districtName}}</td>
<td title="'行政区划代码'">{{row.areaCode}}</td> <td title="'行政区划代码'">{{row.areaCode}}</td>
@ -54,6 +83,16 @@
<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="'抽取日志'">
<button class="btn sj_btn" ng-click="openLog(row)">
<span>查看日志</span>
</button>
</td>
</tr> </tr>
</table> </table>
<div ng-hide="tableData.length > 0" class="col-sm-12 alert alert-warning sj_alert-warning"> <div ng-hide="tableData.length > 0" class="col-sm-12 alert alert-warning sj_alert-warning">

@ -13,95 +13,63 @@ module System{
$scope.status = [{id: 0, label: "有缺失"}, {id: 1, label: "正常"}, {id: 2, label:"待归档"}, {id: 3, label: "待审核"}]; $scope.status = [{id: 0, label: "有缺失"}, {id: 1, label: "正常"}, {id: 2, label:"待归档"}, {id: 3, label: "待审核"}];
$scope.cityFilter = $scope.model = SystemModel.sqlInfo; SystemModel.updateSqlInfo();
$scope.model = SystemModel.sqlInfo;
$scope.checkboxes = { $scope.checkboxes = {
checked: false, checked: false,
items: {} items: {}
}; };
$scope.optionsFilter= {
x: "all",
y: "all",
z: "all"
}
$scope.tableParams = new NgTableParams({count: 25}, { $scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100], counts: [25, 50, 100],
dataset: $scope.model dataset: $scope.model
}); });
$scope.citySelect = (x) => { $scope.citySelect = (x) => {
if($scope.z != 'all'){ $scope.optionsFilter.x = x;
$scope.statusFilter = []; $scope.optionsFilter.y = $scope.y = "all";
angular.forEach($scope.model, (item) => { if(x != "all"){
if($scope.status[item.sysStatus].label == $scope.z)
$scope.statusFilter.push(item)
});
}else
$scope.statusFilter = $scope.model;
if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); //获取当前市下所有区县 $scope.countries = classifyCountry(SystemModel.regionalismInfo, x); //获取当前市下所有区县
$scope.cityFilter = [];
angular.forEach($scope.statusFilter, (item) => {
if(x == item.cityName)
$scope.cityFilter.push(item);
});
}else{ }else{
$scope.countries = []; $scope.countries = [];
$scope.y = 'all';
$scope.cityFilter = $scope.statusFilter;
} }
$scope.countryFilter = $scope.cityFilter;
$scope.tableParams.settings({
dataset: $scope.cityFilter
});
} }
$scope.countrySelect = (y) => { $scope.countrySelect = (y) => {
if(y != 'all'){ $scope.optionsFilter.y = y;
$scope.countryFilter = [];
angular.forEach($scope.cityFilter, (item) => {
if(item.districtName == y)
$scope.countryFilter.push(item);
});
}else
$scope.countryFilter = $scope.cityFilter
$scope.tableParams.settings({
dataset: $scope.countryFilter
});
} }
$scope.statusSelect = (z) => { $scope.statusSelect = (z) => {
var tmp = []; $scope.optionsFilter.z = z;
if($scope.x == 'all')
tmp = $scope.model;
else
tmp = $scope.countryFilter ;
var result = [];
if(z != 'all'){
angular.forEach(tmp, (item) => {
if($scope.status[item.sysStatus].label == z)
result.push(item);
});
$scope.tableParams.settings({
dataset: result
});
}else{
$scope.tableParams.settings({
dataset: tmp
});
}
} }
$scope.$watch(() =>{
return $scope.optionsFilter;
}, (value) =>{
shareUpdate($scope.model, value);
}, true);
$scope.quickCheck = () => { $scope.quickCheck = () => {
updateSqlStatus("/java/console/api/filePackage/totalVerifySqlFile"); updateSqlStatus("/java/console/api/filePackage/totalVerifySqlFile");
} }
$scope.quitFile = () => { $scope.quickFile = () => {
updateSqlStatus("/java/console/api/filePackage/totalOnholeSqlFile"); updateSqlStatus("/java/console/api/filePackage/totalOnholeSqlFile");
} }
$scope.help = () => { $scope.help = () => {
ngDialog.open({ ngDialog.open({
template: 'statusHelp.html', template: 'statusHelp.html',
width: 900, width: 600,
height: 600, height: 370,
closeByDocument: false, closeByDocument: false,
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
@ -127,7 +95,6 @@ module System{
break; break;
} }
} }
var checked = 0, unchecked = 0, var checked = 0, unchecked = 0,
total = $scope.model.length; total = $scope.model.length;
angular.forEach($scope.model, function(item) { angular.forEach($scope.model, function(item) {
@ -137,7 +104,6 @@ module System{
if ((unchecked == 0) || (checked == 0)) { if ((unchecked == 0) || (checked == 0)) {
$scope.checkboxes.checked = (checked == total); $scope.checkboxes.checked = (checked == total);
} }
// grayed checkbox
angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0)); angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0));
}, true); }, true);
@ -169,6 +135,7 @@ module System{
}); });
} }
//审核
$scope.verifySql = (selected, type) => { $scope.verifySql = (selected, type) => {
ngDialog.open({ ngDialog.open({
template: 'sqlVerification.html', template: 'sqlVerification.html',
@ -182,6 +149,7 @@ module System{
}); });
} }
//替换
$scope.moveSql = (selected, type) => { $scope.moveSql = (selected, type) => {
ngDialog.open({ ngDialog.open({
template: 'sqlMove.html', template: 'sqlMove.html',
@ -211,8 +179,11 @@ module System{
}).success((data,header,config,status) => { }).success((data,header,config,status) => {
$("#load").remove(); $("#load").remove();
Kubernetes.removeMask(); Kubernetes.removeMask();
shareUpdate(data); $scope.model = SystemModel.sqlInfo = data.data;
shareUpdate($scope.model, $scope.optionsFilter);
}).error((data,header,config,status) => { }).error((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
}); });
}); });
@ -226,36 +197,50 @@ module System{
content: data.content content: data.content
}) })
}).success((data,header,config,status) => { }).success((data,header,config,status) => {
shareUpdate(data); $scope.model = SystemModel.sqlInfo = data.data;
shareUpdate($scope.model, $scope.optionsFilter);
}).error((data,header,config,status) => { }).error((data,header,config,status) => {
Configs.customAlert("提示", "脚本替换或归档失败!", '',null, 0, "error"); Configs.customAlert("提示", "脚本替换或归档失败!", '',null, 0, "error");
})
}); });
});
function shareUpdate (data, value){
var filter = data, result = [];
if(value.x != "all"){
angular.forEach(filter, (item) => {
if(item.cityName == value.x)
result.push(item);
});
filter = result;
result = [];
}
function shareUpdate (data){ if(value.y != "all"){
$scope.filterResult = $scope.model = SystemModel.sqlInfo = data.data; angular.forEach(filter, (item) => {
var result = []; if(item.districtName == value.y)
if($scope.x != "all"){
angular.forEach($scope.filterResult, (item) => {
if(item.cityName == $scope.x)
result.push(item); result.push(item);
}); });
$scope.filterResult = result; filter = result;
result = []; result = [];
} }
if($scope.y != "all"){ if(value.z != "all"){
angular.forEach($scope.filterResult, (item) => { angular.forEach(filter, (item) =>{
if(item.districtName == $scope.y) if($scope.status[item.sysStatus].label == value.z)
result.push(item); result.push(item);
}); });
$scope.filterResult = result; filter = result;
result = []; result = [];
} }
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: $scope.filterResult dataset: filter
}); });
$scope.checkboxes = {
checked: false,
items: {}
};
} }
function updateSqlStatus(url: string) { function updateSqlStatus(url: string) {
@ -266,51 +251,27 @@ module System{
items.push(item); items.push(item);
}); });
} }
if(items.length <= 0) if(items.length <= 0)
return; return;
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
$http({ $http({
url: url, url: url,
method: 'POST', method: 'POST',
data: JSON.stringify(items) data: JSON.stringify(items)
}).success(function(data,header,config,status){ }).success(function(data,header,config,status){
var result = data.data, filter; $scope.model = SystemModel.sqlInfo = data.data;
if($scope.z != 'all'){ shareUpdate($scope.model, $scope.optionsFilter);
result = []; $("#load").remove();
angular.forEach(data.data, (item) =>{ Kubernetes.removeMask();
if($scope.status[item.sysStatus].label == $scope.z)
result.push(item);
});
}
filter = result;
if($scope.x != 'all'){
filter = [];
var tmp = [];
angular.forEach(result, (item) => {
if($scope.x == item.cityName)
tmp.push(item);
});
filter = tmp;
if($scope.y != 'all'){
filter = [];
angular.forEach(tmp, (item) => {
if($scope.y == item.districtName)
filter.push(item);
});
}
}
$scope.tableParams.settings({
dataset: filter
});
//响应成功 //响应成功
}).error(function(data,header,config,status){ }).error(function(data,header,config,status){
//处理响应失败 //处理响应失败
$("#load").remove();
Kubernetes.removeMask();
Configs.customAlert("提示", "一键审核或归档失败!", '',null, 0, "error");
}); });
} }
}]) }])
} }

@ -11,7 +11,7 @@ module System{
shareInit($scope); shareInit($scope);
$scope.modelServices = SystemModel; $scope.modelServices = SystemModel;
//$scope.modelServices.updateExcelInfo(); $scope.modelServices.updateExcelInfo();
$scope.model = SystemModel.systemInfoList; $scope.model = SystemModel.systemInfoList;
// 表头显示的信息 // 表头显示的信息
@ -93,98 +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("提示", "操作成功: 本次合计新增了" + data.area + "个行政区划、" + data.system + "个信息系统,更新了" + data.update + "个信息系统", '',null, 0, "success");
}, },
error: (MLHttpRequest, textStatus, errorThrown) =>{ error: (XMLHttpRequest, 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");
if(null != element)
element.outerHTML = element.outerHTML;
}
}, 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(); $("#load").remove();
Kubernetes.removeMask(); Kubernetes.removeMask();
if(XMLHttpRequest.status == 200){ if(XMLHttpRequest["responseJSON"].err && XMLHttpRequest["responseJSON"].err instanceof Array)
Configs.customAlert("提示", "操作成功: 本次excel文件录入成功", '',null, 0, "success"); ngDialog.open({
}else{ template: 'uploadErrorInfo.html',
Configs.customAlert("提示", "操作失败: 本次excel文件录入失败", '',null, 0, "error"); width: 790,
} closeByDocument: false,
}, data: XMLHttpRequest["responseJSON"].err,
success : (data) =>{ className: 'ngdialog-theme-default'
$scope.model = SystemModel.systemInfoList = data.data;
$scope.tableParams.settings({
dataset: $scope.model
}); });
},
error: (MLHttpRequest, textStatus, errorThrown) =>{
//Configs.customAlert("提示", "操作失败: 本次excel文件录入失败, " + textStatus, '',null, 0, "error");
} }
}); });
}); });
@ -196,8 +126,10 @@ module System{
//解决不同重复选择相同文件 //解决不同重复选择相同文件
var element = document.getElementById("file-uploads"); var element = document.getElementById("file-uploads");
if(null != element)
element.outerHTML = element.outerHTML; element.outerHTML = element.outerHTML;
} }
}, true);
} }
//excel下载 //excel下载

@ -39,6 +39,13 @@ module System{
HawtioNav.add(systemTab); HawtioNav.add(systemTab);
}]); }]);
_module.filter("customFilter", () => {
return (input, subString) => {
var repx = new RegExp(subString + "$");
return input.replace(repx, "");
}
});
// 加载模块 // 加载模块
hawtioPluginLoader.addModule(pluginName); hawtioPluginLoader.addModule(pluginName);
} }

@ -3,9 +3,13 @@
/// <reference path="systemHelpers.ts"/> /// <reference path="systemHelpers.ts"/>
/// <reference path="systemServices.ts"/> /// <reference path="systemServices.ts"/>
/// <reference path="../../configs/ts/configsUtils.ts"/> /// <reference path="../../configs/ts/configsUtils.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
/// <reference path="../../configs/ts/customAlert.ts"/>
/// <reference path="../../configs/ts/configsDataService.ts"/>
/// <reference path="../../kubernetes/ts/term.ts"/>
module System{ module System{
export var SystemVerificationController = controller('SystemVerificationController', ['$scope', '$location', '$http', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', '$element', ($scope, $location, $http, $templateCache, Upload, NgTableParams, ngDialog, SystemModel, $element) => { export var SystemVerificationController = controller('SystemVerificationController', ['$scope', '$interval', '$location', '$http', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', '$element', '$timeout', 'ConfigsModel', 'DataModel', 'TerminalService', 'KubernetesModel', ($scope, $interval, $location, $http, $templateCache, Upload, NgTableParams, ngDialog, SystemModel, $element, $timeout, ConfigsModel, DataModel, TerminalService, KubernetesModel) => {
shareInit($scope); shareInit($scope);
$scope.cities = classifyCity(SystemModel.regionalismInfo); $scope.cities = classifyCity(SystemModel.regionalismInfo);
$scope.model = SystemModel; $scope.model = SystemModel;
@ -21,6 +25,8 @@ module System{
}); });
$scope.citySelect = (x) =>{ $scope.citySelect = (x) =>{
$scope.countries=[];
$scope.y = "all";
if(x != 'all'){ if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); $scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
$http({ $http({
@ -36,8 +42,8 @@ module System{
throw "请求失败" throw "请求失败"
}); });
}else{ }else{
$scope.countries=[]; //$scope.countries=[];
$scope.y = "all"; //$scope.y = "all";
$scope.tableData = null; $scope.tableData = null;
$scope.checkboxes = { $scope.checkboxes = {
checked: false, checked: false,
@ -63,13 +69,96 @@ module System{
} }
} }
$scope.checkSQLSERVER = () => {
/**
**
**/
var answer = false;
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
if(ConfigsModel.oracleParam[i].type == 1){
answer = true
break;
}
}
if(answer == false){
/**
**/
Configs.customAlert("提示", "操作失败:没有配置默认的标准表汇总库", '',null, 0, "error");
return;
}
var selectedItems = [];
if($scope.tableData && $scope.tableData.length > 0){
for (var i = 0; i < $scope.tableData.length; ++i) {
var item = $scope.tableData[i];
if($scope.checkboxes.items[item.id]){
if(item.collection == '否'){
/*
**
code
*/
Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error");
return;
}7
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
if(item.dataBaseType == 'ORACLE'){
Configs.customAlert("提示", "操作失败:ORACLE数据请在服务集群界面中抽取标准表", '',null, 0, "error");
return;
}
selectedItems.push(item);
}
}
$http({
url: "/java/console/api/checkout/extractList",
method: "POST",
data: selectedItems
}).success((data, header, config, status) => {
//console.log(data);
}).error((data, header, config, status) => {
throw "请求失败"
});
}
}
$scope.deleteRows = () =>{ $scope.deleteRows = () =>{
var filter = []; var filter = [];
if($scope.tableData && $scope.tableData.length > 0){ if($scope.tableData && $scope.tableData.length > 0){
angular.forEach($scope.tableData, (item) => { angular.forEach($scope.tableData, (item) => {
if($scope.checkboxes.items[item.id]) if($scope.checkboxes.items[item.id]){
item["index"] = item.cityName + "_" + item.districtName + "_" + item.sysName + "_" + item.year + "_版本" + item.dataVersion;
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
filter.push(item); filter.push(item);
}
}); });
}
//检查数据是否存在
for(var i = 0; i < filter.length; i++){
if(filter[i].collection == '否'){
Configs.customAlert("提示", "操作失败:部分数据不存在,无法删除", '',null, 0, "error");
return;
}
}
//检查数据是否已启动 //检查数据是否在迁移
var message = Kubernetes.checkForMigration(KubernetesModel.replicationControllers, DataModel.transferTasks, filter, "verify");
if(message != ""){
Configs.customAlert("提示", "操作失败:部分数据" + message +",无法删除", '',null, 0, "error");
return
}
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: filter,
index: 'index',
onClose: (result:boolean) => {
if(result){
$http({ $http({
url: "/java/console/api/checkout/deleteList", url: "/java/console/api/checkout/deleteList",
method: "POST", method: "POST",
@ -85,7 +174,6 @@ module System{
}else{ }else{
result = $scope.tableData; result = $scope.tableData;
} }
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: result dataset: result
}); });
@ -93,19 +181,120 @@ module System{
throw "请求失败" throw "请求失败"
}); });
} }
},
title: '是否需要删除采集数据?',
action: '以下采集数据文件将会被删除:',
okText: '删除',
okClass: 'btn-danger sj_btn_cir',
custom: "该删除操作将会彻底删除数据文件,是否删除,请确认!",
customClass: "alert alert-warning sj_alert-warning",
cancelText: "取消",
cancelClass: 'sj_btn_grey'
}).open();
} }
$scope.check = () => { $scope.check = () => {
var filter = []; //var sqlServerDB = [];
var oracleDB = [];
var selectedItems = [];
/**
**
**/
var answer = false;
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
if(ConfigsModel.oracleParam[i].type == 1){
answer = true
break;
}
}
if(answer == false){
/**
**/
Configs.customAlert("提示", "操作失败:没有配置默认的标准表汇总库", '',null, 0, "error");
return;
}
if($scope.tableData && $scope.tableData.length > 0){ if($scope.tableData && $scope.tableData.length > 0){
angular.forEach($scope.tableData, (item) => { for (var i = 0; i < $scope.tableData.length; ++i) {
if($scope.checkboxes.items[item.id]) var item = $scope.tableData[i];
filter.push(item); if($scope.checkboxes.items[item.id]){
if(item.collection == '否'){
/*
**
code
*/
Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error");
return;
}
/**
*/
if(item.payResultLast == 1){
Configs.customAlert("提示", "操作失败:选择的系统存在不需要校验的系统", '',null, 0, "error");
return;
}
/**
*/
if(item.mark == 1 && item.dataBaseType == 'ORACLE'){
Configs.customAlert("提示", "操作失败:选择的系统的数据存储在冷区,请先将数据迁移到热区再检验!", '',null, 0, "error");
return
}
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
selectedItems.push(item);
if(item.dataBaseType == 'ORACLE'){
oracleDB.push(item);
}
}
}
/*
*/
var exited = Kubernetes.checkForCreateOracle(DataModel.transferTasks, selectedItems);
if(exited.length > 0 ){
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能执行校验操作!", '', null, 0, "error");
return;
}
/*
Oracleoracle
*/
if(oracleDB.length > 0){
angular.forEach(oracleDB, (item) =>{
Kubernetes.createRC({
name: item._key,
labels: {
system: item.sysCode.toString(),
version: item.dataVersion.toString(),
region: item.areaCode.toString()
},
annotations: {
cityName: item.cityName,
districtName: item.districtName,
systemName: item.sysName,
id: item.dataId+"",
year: item.year,
checkoutFlag: item.checkoutFlag
},
path: item.path+"app/",
isTarget: "false",
isExtract: item.extractStatus
}, (rc) =>{
//Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", rc, 0);
});
}); });
$timeout(() => {
$location.path('/kubernetes/namespace/default/replicationControllers');
}, 500);
}
$http({ $http({
url: "/java/console/api/checkout/checkList", url: "/java/console/api/checkout/checkList",
method: "POST", method: "POST",
data: filter data: selectedItems
}).success((data, header, config, status) => { }).success((data, header, config, status) => {
$scope.tableData = data.data; $scope.tableData = data.data;
var result = []; var result = [];
@ -200,5 +389,12 @@ module System{
Configs.customAlert("提示", "操作失败:发生请求失败,不能删除!", '',null, 0, "error"); Configs.customAlert("提示", "操作失败:发生请求失败,不能删除!", '',null, 0, "error");
}); });
}); });
$scope.openLog = (entity) => {
var name = entity.areaCode + "_" + entity.sysCode + "_" + entity.dataVersion
var containerName = entity.cityName + "-" + entity.districtName + "-" + entity.sysName + "-版本" + entity.dataVersion;
entity["name"] = name;
TerminalService.newTerminal($interval, entity.id+"", containerName, entity, "/java/console/api/standardextract/log?rcName=" + name, $templateCache.get(UrlHelpers.join(Kubernetes.templatePath, 'logShell.html')));
}
}]); }]);
} }
Loading…
Cancel
Save