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>;
status: boolean;
editable: boolean;
hot: boolean;
}
interface Brick {
ip: Array<string>;

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

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

@ -223,7 +223,7 @@ declare module Kubernetes {
function getOracleStatus(labels: any): number;
function getExtractStatus(labels: any): number;
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 replicasIsCreated(replicationcontrollers: Array<any>, name: string): boolean;
function loadConfigs(): {
@ -250,4 +250,5 @@ declare module Kubernetes {
function create_locadEffect(msg: any): void;
function createSuccessInfo(icon: string, msg: string): void;
function removeMask(): void;
function checkRCIsExtracting(selected: Array<any>): boolean;
}

@ -67,7 +67,7 @@ declare module Kubernetes {
**/
function checkForExtract(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 alreadyExitInFolder(selectedItems: Array<any>, selectNode: any): boolean;
}

@ -3,6 +3,10 @@
/// <reference path="systemHelpers.d.ts" />
/// <reference path="systemServices.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 {
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>
</ul>
</nav>
<div class="sj_content_position clear" style="margin-top:70px;">
<ul>
<div class="sj_content_position clear" style="margin-top:50px;">
<!--<ul>
<li class="sj_icons_home"></li>
<li>当前位置:</li>
<li><a href="#">数据汇总</a> <span>&gt;</span></li>
<li><a href="#">社保系统</a><span>&gt;</span></li>
<li><a href="#">批次A</a></li>
</ul>
</ul>-->
</div>
<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>

@ -28,7 +28,9 @@
<span class="">云路径:{{volume.path}}</span>
</th>
<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 class="no-fade table-header">
<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>
</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>
</tr>

@ -105,6 +105,15 @@
</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;">
<button class="btn sj_btn_blue" type='submit' style="color:#fff;" >
<span class="glyphicon glyphicon-save "></span> 保存

@ -40,10 +40,6 @@
<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" />
</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 ng-repeat="row in ngDialogData.brick">
<th class="new_left">
@ -88,8 +84,11 @@
</th>
<!--<th>
<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 colspan="5">&nbsp;{{message}}</th>-->
</tr>
</tbody>
</table>
@ -239,7 +238,7 @@
<button class="btn pull-right sj_btn_blue " ng-click="replace()">
替换
</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>
</script>
@ -414,6 +413,16 @@
</div>
</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 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>

@ -147,12 +147,14 @@ module Configs{
editable: block.editable || false
});
});
return {
name: volume.name,
path: volume.path,
brick: brick,
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
brick: Array<Brick>;
status: boolean;
editable: boolean
editable: boolean,
hot: boolean
}
export interface Brick{

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

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

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

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

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

@ -8,7 +8,7 @@
<li role="presentation" ng-repeat="item in navbarItems" class="{{item.class}}"><a href="#" ng-click="selectBatchItem(item)">{{item.label}}</a></li>
</ul>
<div class="fr sj_searchbox">
<input type="text" class="sj_search_input" ng-model="keyQuery" placeholder="请选择或输入关键字,多关键字请用空格隔开" onkeydown="if(event.keyCode==13){searchButton.click()}"/>
<input type="text" class="sj_search_input" ng-model="keyQuery" placeholder="请选择或输入关键字,多关键字请用空格隔开" onkeydown="if(event.keyCode==13){searchButton.click()}" />
<a href="#" class="sj_search_btn" id="searchButton" ng-click="search()"></a>
</div>
</div>
@ -30,19 +30,19 @@
<i class="glyphicon glyphicon-export"></i> 迁移
</button>
<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> 启动
</button>
</div>
<ul class="fr sj_table_bottom">
<li class="mr5 ">当前显示1~{{model.data.length}}行,共{{model.data.length}}行。</li>
<li class="mr5 ">每页显示
<select ng-options="value for value in pageSizeChoses" ng-change="selectAction()" ng-model="options.currentTableSize"></select>
</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 ">每页显示
<select ng-options="value for value in pageSizeChoses" ng-cha=nge="selectAction()" ng-model="options.currentTableSize"></select>
</li>-->
<li class="mr5 ">当前页码</li>
<li>
<div class="hawtio-pager clearfix">
<label>{{options.currentPageNum}} / {{options.getPageSizeNum()}}</label>
<label>{{model.paramOptions.currentPageNum}} / {{model.paramOptions.totlePage}}</label>
<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="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>
<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 class="form-group">
<div class="col-sm-12 alert alert-warning" ng-show="!volumes || volumes.length == 0">

@ -12,6 +12,7 @@ module Developer{
public priorTableSize = 20;
public keyQuery = null;
public volumeType = 1;
public totlePage = 1;
public createParamData(){
var extendValue =["cityName", "districtName", "dataVersion", "systemName", "dataYear"];
@ -35,6 +36,7 @@ module Developer{
public getPageSizeNum(){
var num = Math.ceil(this.totalSize/this.currentTableSize);
console.log(this.totalSize);
if(num < this.currentPageNum)
num = this.currentPageNum;
return num;
@ -49,6 +51,9 @@ module Developer{
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){
return regionalismCode + "-" + systemId + "-" + version;
}
@ -59,6 +64,15 @@ module Developer{
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){
var result = item
result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
@ -106,22 +120,25 @@ module Developer{
function formatTask(items:Array<any>){
var result = [];
angular.forEach(items, (item) => {
result.push({
id: item.id,
_key: item.regionalismCode + "-" + item.systemCode + "-" + item.dataVersion,
name: item.cityName+ "-" + item.districtName,
systemName: item.systemName,
status: item.completeStatus,
process: item.rate,
from: item.dataPath,
to: item.dstPath,
labels:{
var tmp_batch="";
if(item.submittedBatch.indexOf("批次")==-1){
tmp_batch="批次"+item.submittedBatch;
}else{
tmp_batch=item.submittedBatch;
}
item["_key"] = item.regionalismCode + "-" + item.systemCode + "-" + item.dataVersion;
item["name"] = item.cityName+ "-" + item.districtName;
item["status"] = item.completeStatus;
item["from"] = item.dataPath;
item["process"] = item.rate;
item["to"] = item.dstPath;
item["labels"] ={
dataType: item.dataType,
batch: "批次"+item.submittedBatch,
batch: tmp_batch,
dataVersion: "版本"+item.dataVersion,
dataYear: item.year
}
});
result.push(item);
});
return result;
}
@ -146,7 +163,8 @@ module Developer{
data: createParamData(paramOptions),
success : function(data) {
result = data.data;
paramOptions.totalSize=data.length;
paramOptions.totalSize = data.length;
paramOptions.totlePage = data.page.totlePage;
}
});
return result;
@ -166,6 +184,7 @@ module Developer{
this.data = populateKeys(this.data);
this.data = populateNames(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.model=DataModel;
$scope.replicasModel = KubernetesModel;
init($scope, $location, $routeParams);
$scope.options = DataModel.paramOptions;
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
var result = getDataType($location)
$scope.options.dataType = result["dataType"];
$scope.options.volumeType = result["volumeType"];
var result = getDataType($location);
$scope.treeOptions = {
nodeChildren: "childNodes",
@ -65,6 +64,10 @@ module Developer {
return field.systemCode;
}
},
{
field: "dataBaseType",
displayName: '数据库类型',
},
{
field: "labels",
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.keyQuery += " " + text;
})
@ -99,19 +106,20 @@ module Developer {
nav.class="";
});
item.class="active";
$scope.model.updateParamOption("currentPageNum", 1);
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
$scope.model.updateParamOption("dataBatch", item.alias);
}
$scope.isEmptyOrFirst = () => {
var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum();
var length =$scope.model.paramOptions.totlePage;
return length <= 0 || idx <= 1;
}
$scope.isEmptyOrLast = () =>{
var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum();
var length =$scope.model.paramOptions.totlePage;
return length < 1 || idx >= length;
}
@ -125,7 +133,7 @@ module Developer {
$scope.last = () =>{
var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum();
var length =$scope.model.paramOptions.totlePage;
if(idx < length){
Kubernetes.eliminateChechBoxClick();
$scope.model.updateParamOption("currentPageNum", length);
@ -134,7 +142,7 @@ module Developer {
$scope.previous = () => {
var idx = $scope.model.getParamOption("currentPageNum");
var length =$scope.options.getPageSizeNum();
var length =$scope.model.paramOptions.totlePage;
if(idx > 1){
Kubernetes.eliminateChechBoxClick();
$scope.model.updateParamOption("currentPageNum", idx-1);
@ -142,7 +150,7 @@ module Developer {
}
$scope.next = () =>{
var length =$scope.options.getPageSizeNum();
var length =$scope.model.paramOptions.totlePage;
var idx = $scope.model.getParamOption("currentPageNum");
if(idx < length){
Kubernetes.eliminateChechBoxClick();
@ -150,7 +158,7 @@ module Developer {
}
}
$scope.$watch('options', (newValue, oldValue) => {
$scope.$watch('model.paramOptions', (newValue, oldValue) => {
if(newValue){
if(newValue.currentTableSize !== oldValue.currentTableSize)
$scope.options.priorTableSize = oldValue.currentTableSize;
@ -162,6 +170,8 @@ module Developer {
}, true);
$scope.search = () => {
//$scope.model.initParamOptions();
$scope.model.paramOptions.currentPageNum = 1;
$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 != ""){
Configs.customAlert("提示", "操作失败:" + message + ",不能删除!", '',null, 0, "error");
return;
@ -183,7 +193,7 @@ module Developer {
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'id',
index: 'alias',
onClose: (result:boolean) => {
var idColl = [];
if (result) {
@ -223,6 +233,7 @@ module Developer {
,$http:httpurl;
*/
if(Kubernetes.alreadyExitInFolder($scope.tableConfig.selectedItems, $scope.selectNode)){
migrationClick.close();
Configs.customAlert("提示", "操作失败:" + "数据已在当前目录!", '',null, 0, "error");
@ -250,10 +261,16 @@ module Developer {
},
open: (selected) =>{
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($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length >0)
@ -271,8 +288,16 @@ module Developer {
$scope.createOracleService = (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){
angular.forEach(items,(item)=>{
console.log(item);
var isExited = Kubernetes.checkForExit($scope.replicasModel.replicationControllers, item);
if(!isExited){
Kubernetes.createRC({
@ -287,7 +312,8 @@ module Developer {
districtName: item.districtName,
systemName: item.systemName,
id: item.id+"",
year: item.year
year: item.year,
checkoutFlag: item.checkoutFlag
},
path: item.dataPath+"app/",
isTarget: "false",
@ -311,8 +337,8 @@ module Developer {
}
function init($scope,$location,$routeParams){
//$scope.model.updateModel();
$scope.keyQuery = "";
$scope.model.initParamOptions();
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
if(ConfigsModel.cluster!=null)
$scope.volumes = ConfigsModel.cluster;
@ -339,7 +365,15 @@ module Developer {
title: "查看批次B的数据",
class: "",
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){
@ -347,6 +381,11 @@ module Developer {
var dataType;
var volumeType;
var subPath = path.split("/");
if(path.indexOf("hot") > -1)
$scope.isShow = true;
else
$scope.isShow = false;
switch (subPath[subPath.length -1]) {
case "financial":
dataType = "财政";

@ -5,9 +5,7 @@
</script>
<script type="text/ng-template" id="idTemplate.html">
<div class="ngCellText nowrap">
<a href="" title="View details for {{row.entity.metadata.name || row.entity.name}}">
<!--<img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}" ng-show="row.entity.$iconUrl">-->
<strong>{{row.entity.$oracleName || row.entity.name}}</strong></a>
<strong>{{row.entity.$oracleName || row.entity.name}}</strong>
</div>
</script>
<script type="text/ng-template" id="selectorTemplate.html">
@ -34,11 +32,11 @@
<a ng-show="row.entity.$podCounters.podsLink" title="pods status">
<span ng-show="row.entity.$extractStatus === 0" class="badge badge-info"> 待汇总</span>
<div ng-show="row.entity.$extractStatus === 1">
<span class="badge badge-success" > 汇总中</span>
<span class="badge badge-success"> 汇总中</span>
<span ng-include="'oracleLogTemplate.html'"></span>
</div>
<div ng-show="row.entity.$extractStatus === 2">
<span class="badge" > 已完成</span>
<span class="badge"> 已完成</span>
<span ng-include="'oracleLogTemplate.html'"></span>
</div>
</a>
@ -47,7 +45,7 @@
<script type="text/ng-template" id="labelTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.Labels">
<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>
</script>
<script type="text/ng-template" id="eventSourceTemplate.html">
@ -59,7 +57,7 @@
<script type="text/ng-template" id="dataLabelsTemplate.html">
<div class="ngCellText" ng-init="labels=row.entity.labels" ng-controller="Kubernetes.DataLabels">
<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>
</script>
<script type="text/ng-template" id="hostTemplate.html">
@ -213,9 +211,12 @@
</script>
<script type="text/ng-template" id="taskEdit.html">
<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;删除
</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 class="dialog-body">
<p>
@ -223,6 +224,13 @@
</p>
</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>
</script>
<!-- 迁移进度条 -->
@ -265,7 +273,6 @@
<span ng-show="entity.extractStatus == 2" class="badge"> 已完成</span>
</div>
</script>
<script type="text/ng-template" id="loadingMask.html">
<div class="custom-alert">
<div id="loading">
@ -273,7 +280,29 @@
</div>
</div>
</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 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>

@ -4,7 +4,7 @@
<span class="fa fa-caret-down"></span>
</div>
<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-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>

@ -61,7 +61,14 @@
ng-click="extractClick.open(id || tableConfig.selectedItems)">
<i class="glyphicon glyphicon-cloud-download"></i> 汇总
</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 class="row">

@ -1816,7 +1816,7 @@ module Kubernetes {
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);
var answer = targetOracle && true;
var inneedOracle = [];
@ -1836,7 +1836,7 @@ module Kubernetes {
var spinner;
$.ajax({
type: "POST",
url: UrlHelpers.join("/java/console/api/oracle", targetOracle.id+"", "extract"),
url: UrlHelpers.join(url, targetOracle.id+"", "extract"),
timeout: 8000,
dataType: 'json',
//async: false,
@ -1851,7 +1851,7 @@ module Kubernetes {
complete: (XMLHttpRequest, textStatus) => {
if(XMLHttpRequest.status == 200){
//spinner.spin();
Kubernetes.createSuccessInfo("success", "连接汇总库成功,即将执行汇总操作!");
Kubernetes.createSuccessInfo("success", "连接汇总库成功,即将执行汇总或抽取操作!");
setTimeout("Kubernetes.removeMask()", 1500);
}
else{
@ -1950,4 +1950,16 @@ module Kubernetes {
//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.$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;
replicationController.connectTo = selectedPods.map((pod) => {

@ -49,7 +49,7 @@ module Kubernetes {
$scope.openLogs = (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',
displayName: '数据汇总状态',
cellTemplate: $templateCache.get("dataSummaryTemplate.html")
},
{
field: '$checkStatus',
displayName: '检验状态',
cellTemplate: $templateCache.get("dataCheckStatus.html")
}
],
sortInfo: {
@ -86,7 +91,7 @@ module Kubernetes {
if(extractItems.length == 0){
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'metadata.name',
index: '$alias',
onClose: (result:boolean) => {
if (result) {
function deleteSelected(selected:Array<KubePod>, next:KubePod) {
@ -151,7 +156,7 @@ module Kubernetes {
if(extractItems.length == 0){
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'metadata.name',
index: '$alias',
onClose: (result:boolean) => {
if (result) {
function stopSelected(selected:Array<KubePod>, next:KubePod) {
@ -205,6 +210,50 @@ module Kubernetes {
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 = {
items: null,
selectedItem: {name: "当前没有可用的汇总库"},
@ -212,7 +261,7 @@ module Kubernetes {
onOk: () => {
var extractClick = $scope.extractClick;
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.dialog.close();
},
@ -222,7 +271,15 @@ module Kubernetes {
extractClick.selectedItem = $scope.configs.oracleParam[0];
var result = checkIsStartSuccess($scope.tableConfig.selectedItems);
if(result.length >0){
Configs.customAlert("提示", "操作失败:选择服务中存在未启动的数据,请先启动服务", '',null, 0, "error");
Configs.customAlert("提示", "操作失败:选择服务中存在未启动的数据库,请先启动服务", '',null, 0, "error");
return;
}
/**
**/
if(checkRCIsExtracting(selected)){
Configs.customAlert("提示", "操作失败:选择的数据库中有正在执行汇总的数据库,请勿重复执行汇总操作", '',null, 0, "error");
return;
}
extractClick.dialog.open();

@ -118,7 +118,7 @@ module Kubernetes {
item: null,
open: (entity) => {
if(entity.status == 1)
Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能迁移", '',null, 0, "error");
Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能删除", '',null, 0, "error");
else{
var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = true;
@ -135,9 +135,29 @@ module Kubernetes {
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) => {

@ -43,7 +43,7 @@ module Kubernetes {
},
terminals: {},
httpTask: {},
newTerminal: ($interval, podLink, containerName, entity, template = defaultTemplate) => {
newTerminal: ($interval, podLink, containerName, entity, url ,template = defaultTemplate) => {
var terminalId = UrlHelpers.join(podLink, containerName);
if (terminalId in self.terminals) {
log.debug("Already a terminal with id: ", terminalId);
@ -51,7 +51,7 @@ module Kubernetes {
return terminalId;
}
var scope = $rootScope.$new();
getLogs(entity, scope);
getLogs(entity, scope, url);
scope.podLink = podLink;
scope.containerName = containerName;
scope.id = terminalId;
@ -61,7 +61,7 @@ module Kubernetes {
return terminalId;
}else{
self.httpTask[terminalId] = $interval(() =>{
getLogs(entity, scope);
getLogs(entity, scope, url);
},2000);
}
var el = $($compile(template)(scope));
@ -300,7 +300,7 @@ module Kubernetes {
};
});
function getLogs(rc, scope){
function getLogs(rc, scope, url){
var xhr= new XMLHttpRequest();
xhr.onreadystatechange = () => {
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);
}
}

@ -240,18 +240,6 @@ module Kubernetes {
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){
for(var index in replicationControllers) {
var replicas = replicationControllers[index];
@ -283,7 +271,10 @@ module Kubernetes {
function checkForExitTask(transferTasks:Array<any>, selectItem){
for(var index in transferTasks){
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;
}
}
@ -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 = "";
for (var index in selectItem) {
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]);
if(getName(replicationControllers[i]) == item._key && getAnnotationValueBykey(replicationControllers[i],"year") == item["year"] && labels.version == item.labels.version){
message = "数据正在使用";
for(i in transferTasks){
/*if(transferTasks[i]["_key"] == item["_key"] && (transferTasks[i]["status"] == "1" || transferTasks[i]["status"] == "0") && item["year"] == transferTasks[i].labels.dataYear){
message = "数据正在迁移"
return message;
}*/
if(transferTasks[i].fkid == id && (transferTasks[i]["status"] == "1" || transferTasks[i]["status"] == "0")){
message = "数据正在迁移"
return message;
}
}
/**
*/
if(item["mark"] == 1)
continue;
/*
使
*/
for(i in transferTasks){
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){
message = "数据正在迁移"
for (var i in replicationControllers) {
var labels = getLabels(replicationControllers[i]);
if(getName(replicationControllers[i]) == item._key && getAnnotationValueBykey(replicationControllers[i],"year") == item["year"]){
message = "数据正在使用";
return message;
}
}
}
return message;
}

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

@ -18,7 +18,7 @@
</button>
</div>
<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">
<span class="help-block">
当前没有可以查看的数据请点击Excel导入按钮导入Excel数据</span></div>

@ -3,7 +3,7 @@
<div class="container-fluid sj_fluid">
<div class="mb10 clear">
<div class="row clear fl mr5 mt5">
<label>行政区划代码</label>
<label>地区:</label>
</div>
<div class="row clear fl">
<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>
</select>
</div>
<div class="row clear fl mr5 mt5">
<label>&nbsp;</label>
</div>
<div class="row clear fl">
<select class="form-control sj_select_box" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'">
<option value="all">全部</option>
<option ng-repeat="country in countries">{{country.name}}</option>
</select>
</div>
<div class="row clear fl mr5 mt5">
<label>&nbsp;区/县&nbsp;&nbsp;&nbsp;状态</label>
</div>
<div class="row clear fl mr10">
<select class="form-control sj_select_box" ng-change="statusSelect(z)" ng-model="z" ng-init="z='all'">
<option value="all">全部</option>
@ -29,7 +35,7 @@
<!--</button> -->
</div>
<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> 一键归档
</button>
</div>

@ -4,7 +4,7 @@
<div class="container-fluid sj_fluid ">
<div class="mb10 clear">
<div class="row clear fl mr5 mt5">
<label>行政区划代码</label>
<label>地区:</label>
</div>
<div class="row clear fl">
<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>
</select>
</div>
<div class="row clear fl mr5 mt5">
<label>&nbsp;&nbsp;</label>
</div>
<div class="row clear fl mr10">
<select class="form-control sj_select_box" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'">
<option value="all">请选择区/县</option>
<option ng-repeat="country in countries">{{country.name}}</option>
</select>
</div>
<div class="row clear fl mr5 mt5">
<label>区/县&nbsp;</label>
</div>
<div class="row clear fr mr20">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="deleteRows()">
<i class="glyphicon glyphicon-save"></i> 删除
</button>
</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">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="check()">
<i class="glyphicon glyphicon-save"></i> 校验
@ -40,8 +51,26 @@
</td>
<td title="'验证结果'">{{row.checkResult}}</td>
<td title="'采集'">{{row.collection}}</td>
<td title="'支付信息标准表'">{{row.payResultLast}}</td>
<td title="'可执行标准表'">{{row.execResultLast}}</td>
<td title="'支付信息标准表'">
<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.districtName}}</td>
<td title="'行政区划代码'">{{row.areaCode}}</td>
@ -54,6 +83,16 @@
<td title="'联系人'">{{row.departmentManager}}</td>
<td title="'联系方式'">{{row.managerContacts}}</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>
</table>
<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.cityFilter = $scope.model = SystemModel.sqlInfo;
SystemModel.updateSqlInfo();
$scope.model = SystemModel.sqlInfo;
$scope.checkboxes = {
checked: false,
items: {}
};
$scope.optionsFilter= {
x: "all",
y: "all",
z: "all"
}
$scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100],
dataset: $scope.model
});
$scope.citySelect = (x) => {
if($scope.z != 'all'){
$scope.statusFilter = [];
angular.forEach($scope.model, (item) => {
if($scope.status[item.sysStatus].label == $scope.z)
$scope.statusFilter.push(item)
});
}else
$scope.statusFilter = $scope.model;
if(x != 'all'){
$scope.optionsFilter.x = x;
$scope.optionsFilter.y = $scope.y = "all";
if(x != "all"){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); //获取当前市下所有区县
$scope.cityFilter = [];
angular.forEach($scope.statusFilter, (item) => {
if(x == item.cityName)
$scope.cityFilter.push(item);
});
}else{
$scope.countries=[];
$scope.y = 'all';
$scope.cityFilter = $scope.statusFilter;
$scope.countries = [];
}
$scope.countryFilter = $scope.cityFilter;
$scope.tableParams.settings({
dataset: $scope.cityFilter
});
}
$scope.countrySelect = (y) => {
if(y != 'all'){
$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.optionsFilter.y = y;
}
$scope.statusSelect = (z) => {
var tmp = [];
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.optionsFilter.z = z;
}
$scope.$watch(() =>{
return $scope.optionsFilter;
}, (value) =>{
shareUpdate($scope.model, value);
}, true);
$scope.quickCheck = () => {
updateSqlStatus("/java/console/api/filePackage/totalVerifySqlFile");
}
$scope.quitFile = () => {
$scope.quickFile = () => {
updateSqlStatus("/java/console/api/filePackage/totalOnholeSqlFile");
}
$scope.help = () => {
ngDialog.open({
template: 'statusHelp.html',
width: 900,
height: 600,
width: 600,
height: 370,
closeByDocument: false,
className: 'ngdialog-theme-default'
});
@ -127,7 +95,6 @@ module System{
break;
}
}
var checked = 0, unchecked = 0,
total = $scope.model.length;
angular.forEach($scope.model, function(item) {
@ -137,7 +104,6 @@ module System{
if ((unchecked == 0) || (checked == 0)) {
$scope.checkboxes.checked = (checked == total);
}
// grayed checkbox
angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0));
}, true);
@ -169,6 +135,7 @@ module System{
});
}
//审核
$scope.verifySql = (selected, type) => {
ngDialog.open({
template: 'sqlVerification.html',
@ -182,6 +149,7 @@ module System{
});
}
//替换
$scope.moveSql = (selected, type) => {
ngDialog.open({
template: 'sqlMove.html',
@ -211,8 +179,11 @@ module System{
}).success((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
shareUpdate(data);
$scope.model = SystemModel.sqlInfo = data.data;
shareUpdate($scope.model, $scope.optionsFilter);
}).error((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
});
});
@ -226,36 +197,50 @@ module System{
content: data.content
})
}).success((data,header,config,status) => {
shareUpdate(data);
$scope.model = SystemModel.sqlInfo = data.data;
shareUpdate($scope.model, $scope.optionsFilter);
}).error((data,header,config,status) => {
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){
$scope.filterResult = $scope.model = SystemModel.sqlInfo = data.data;
var result = [];
if($scope.x != "all"){
angular.forEach($scope.filterResult, (item) => {
if(item.cityName == $scope.x)
if(value.y != "all"){
angular.forEach(filter, (item) => {
if(item.districtName == value.y)
result.push(item);
});
$scope.filterResult = result;
filter = result;
result = [];
}
if($scope.y != "all"){
angular.forEach($scope.filterResult, (item) => {
if(item.districtName == $scope.y)
if(value.z != "all"){
angular.forEach(filter, (item) =>{
if($scope.status[item.sysStatus].label == value.z)
result.push(item);
});
$scope.filterResult = result;
filter = result;
result = [];
}
$scope.tableParams.settings({
dataset: $scope.filterResult
dataset: filter
});
$scope.checkboxes = {
checked: false,
items: {}
};
}
function updateSqlStatus(url: string) {
@ -266,51 +251,27 @@ module System{
items.push(item);
});
}
if(items.length <= 0)
return;
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
$http({
url: url,
method: 'POST',
data: JSON.stringify(items)
}).success(function(data,header,config,status){
var result = data.data, filter;
if($scope.z != 'all'){
result = [];
angular.forEach(data.data, (item) =>{
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
});
$scope.model = SystemModel.sqlInfo = data.data;
shareUpdate($scope.model, $scope.optionsFilter);
$("#load").remove();
Kubernetes.removeMask();
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$("#load").remove();
Kubernetes.removeMask();
Configs.customAlert("提示", "一键审核或归档失败!", '',null, 0, "error");
});
}
}])
}

@ -11,7 +11,7 @@ module System{
shareInit($scope);
$scope.modelServices = SystemModel;
//$scope.modelServices.updateExcelInfo();
$scope.modelServices.updateExcelInfo();
$scope.model = SystemModel.systemInfoList;
// 表头显示的信息
@ -93,98 +93,28 @@ module System{
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) =>{
$("#load").remove();
Kubernetes.removeMask();
$scope.model = SystemModel.systemInfoList = data.data;
$scope.tableParams.settings({
dataset: $scope.model
});
Configs.customAlert("提示", "操作成功: 本次合计新增了" + data.area + "个行政区划、" + data.system + "个信息系统,更新了" + data.update + "个信息系统", '',null, 0, "success");
},
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");
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) =>{
error: (XMLHttpRequest, textStatus, errorThrown) =>{
$("#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
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'
});
},
error: (MLHttpRequest, textStatus, errorThrown) =>{
//Configs.customAlert("提示", "操作失败: 本次excel文件录入失败, " + textStatus, '',null, 0, "error");
}
});
});
@ -196,8 +126,10 @@ module System{
//解决不同重复选择相同文件
var element = document.getElementById("file-uploads");
if(null != element)
element.outerHTML = element.outerHTML;
}
}, true);
}
//excel下载
@ -220,9 +152,9 @@ module System{
function booleanChoose(){
return [{id: '是', title: '是'}, {id: '否', title: '否'}];
}
// 数据库类型选择条件oracle/sqlServer
// 数据库类型选择条件oracle/sql Server
function databaseType(){
return [{id: 'oracle', title: 'ORACLE'}, {id: 'sqlServer', title: 'SQLSERVER'}];
return [{id: 'oracle', title: 'ORACLE'}, {id: 'sql Server', title: 'SQL SERVER'}];
}
//level选择条件

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

@ -3,9 +3,13 @@
/// <reference path="systemHelpers.ts"/>
/// <reference path="systemServices.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{
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);
$scope.cities = classifyCity(SystemModel.regionalismInfo);
$scope.model = SystemModel;
@ -21,6 +25,8 @@ module System{
});
$scope.citySelect = (x) =>{
$scope.countries=[];
$scope.y = "all";
if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
$http({
@ -36,8 +42,8 @@ module System{
throw "请求失败"
});
}else{
$scope.countries=[];
$scope.y = "all";
//$scope.countries=[];
//$scope.y = "all";
$scope.tableData = null;
$scope.checkboxes = {
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 = () =>{
var filter = [];
if($scope.tableData && $scope.tableData.length > 0){
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);
}
});
}
//检查数据是否存在
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({
url: "/java/console/api/checkout/deleteList",
method: "POST",
@ -85,7 +174,6 @@ module System{
}else{
result = $scope.tableData;
}
$scope.tableParams.settings({
dataset: result
});
@ -93,19 +181,120 @@ module System{
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 = () => {
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){
angular.forEach($scope.tableData, (item) => {
if($scope.checkboxes.items[item.id])
filter.push(item);
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;
}
/**
*/
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({
url: "/java/console/api/checkout/checkList",
method: "POST",
data: filter
data: selectedItems
}).success((data, header, config, status) => {
$scope.tableData = data.data;
var result = [];
@ -200,5 +389,12 @@ module System{
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