--修复Bug

Web_Manager_Develope
wu ming 8 years ago
parent 0698be5104
commit 1ea7fae6f3

@ -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;
}

2
defs.d.ts vendored

@ -77,6 +77,7 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/system/ts/systemHelpers.d.ts"/>
/// <reference path="d.ts/system/ts/systemPlugin.d.ts"/>
/// <reference path="d.ts/system/ts/regionalismCodeSearch.d.ts"/>
@ -85,4 +86,3 @@
/// <reference path="d.ts/system/ts/systemCodeSearch.d.ts"/>
/// <reference path="d.ts/system/ts/systemList.d.ts"/>
/// <reference path="d.ts/system/ts/systemVerification.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>

File diff suppressed because one or more lines are too long

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

@ -155,20 +155,20 @@
</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>
<div class="row" ng-class="getClass()">
<hawtio-breadcrumbs-outlet></hawtio-breadcrumbs-outlet>
</div>
<hawtio-breadcrumbs-outlet></hawtio-breadcrumbs-outlet>
</div>
<div class="row" ng-class="getClass()">
<div ng-include src="viewPartial">
</div>

@ -414,14 +414,7 @@
</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>
<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>

@ -35,7 +35,7 @@ module Configs{
}
}
function get_width() {
function get_width() {
return (document.body.clientWidth + document.body.scrollLeft);
}

@ -103,14 +103,14 @@ module Configs{
if(typeof FileReader == 'undefined'){
throw "浏览器不支持FileReader读取文件";
}else{
Configs.FileInputPlugin((file) =>{
$scope.enable = true;
Configs.FileInputPlugin((file) =>{
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 = () =>{
@ -153,14 +153,14 @@ module Configs{
$scope.content = "";
$scope.title = shareInit($scope.ngDialogData);
$scope.sqlFileUpload = () =>{
Configs.FileInputPlugin((file) =>{
$scope.enable = true;
if(typeof typeof FileReader == 'undefined')
Configs.FileInputPlugin((file) =>{
if(typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else{
var fr = new FileReader();
fr.onloadend = (e) =>{
$scope.content = e.target["result"];
$scope.enable = true;
}
fr.onloadstart = () =>{

@ -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,7 +30,7 @@
<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>

@ -13,13 +13,12 @@ module Developer {
export var WorkspacesController = controller("WorkspacesController", ["$scope", "KubernetesModel", "DataModel", "ConfigsModel", "KubernetesState", "$templateCache", "$location", "$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.replicasModel = KubernetesModel;
init($scope, $location, $routeParams);
$scope.replicasModel = KubernetesModel;
$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",
@ -94,11 +93,15 @@ 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;
})
$scope.selectBatchItem = (item)=> {
$scope.selectBatchItem = (item)=> {
$scope.navbarItems.forEach((nav) =>{
nav.class="";
});
@ -155,8 +158,8 @@ module Developer {
}
}
$scope.$watch('options', (newValue, oldValue) => {
if(newValue){
$scope.$watch('model.paramOptions', (newValue, oldValue) => {
if(newValue){
if(newValue.currentTableSize !== oldValue.currentTableSize)
$scope.options.priorTableSize = oldValue.currentTableSize;
else
@ -326,10 +329,7 @@ module Developer {
}
}
function init($scope,$location,$routeParams){
//$scope.model.updateModel();
//console.log($scope.options.currentPageNum);
console.log("==============================");
function init($scope,$location,$routeParams){
$scope.keyQuery = "";
$scope.model.initParamOptions();
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
@ -358,14 +358,27 @@ 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){
var path = $location.path();
var dataType;
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]) {
case "financial":
dataType = "财政";
@ -383,7 +396,9 @@ module Developer {
break;
default:
volumeType = 1
}
}
console.log(dataType);
console.log(volumeType) ;
return {
"dataType": dataType,
"volumeType": volumeType

@ -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,20 +32,20 @@
<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>
</div>
</a>
</div>
</script>
<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">
@ -242,7 +240,7 @@
<div ng-show="entity.status == 0">
<sapn class="glyphicon glyphicon-minus"> 待迁移
</div>
<div ng-show="entity.status == 1">
<div ng-show="entity.status == 1">
<span class="glyphicon glyphicon-transfer"> 迁移中
</div>
<div ng-show="entity.status == 2">
@ -261,26 +259,41 @@
<script type="text/ng-template" id="dataExtractTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity">
<span ng-show="entity.extractStatus == 0" class="badge badge-info"> 待汇总</span>
<span ng-show="entity.extractStatus == 1" class="badge badge-success"> 汇总中</span>
<span ng-show="entity.extractStatus == 2" class="badge"> 已完成</span>
</div>
<span ng-show="entity.extractStatus == 1" class="badge badge-success"> 汇总中</span>
<span ng-show="entity.extractStatus == 2" class="badge"> 已完成</span>
</div>
</script>
<script type="text/ng-template" id="loadingMask.html">
<div class="custom-alert">
<div class="custom-alert">
<div id="loading">
<span ng-bind="ngDialogData.msg" />
</div>
</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>
<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">

@ -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;
}
}

@ -273,7 +273,15 @@ module Kubernetes {
if(result.length >0){
Configs.customAlert("提示", "操作失败:选择服务中存在未启动的数据库,请先启动服务", '',null, 0, "error");
return;
}
}
/**
**/
if(checkRCIsExtracting(selected)){
Configs.customAlert("提示", "操作失败:选择的数据库中有正在执行汇总的数据库,请勿重复执行汇总操作", '',null, 0, "error");
return;
}
extractClick.dialog.open();
/*extractData.selectedItem = $scope.filterReplicationControllers[0] || "";
extractData.items = selected;*/

@ -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];
@ -282,9 +270,12 @@ module Kubernetes {
function checkForExitTask(transferTasks:Array<any>, selectItem){
for(var index in transferTasks){
var task = transferTasks[index];
if(task["_key"] == selectItem["_key"] && selectItem["year"] == task.labels.dataYear){
return true;
var task = transferTasks[index];
if(task["_key"] == selectItem["_key"] && selectItem["year"] == task.labels.dataYear ){
if(task.status == 2 || task.status == 3)
return false;
else
return true;
}
}
return false;
@ -317,6 +308,7 @@ module Kubernetes {
使
*/
export function checkForMigration(replicationControllers:Array<KubePod>, transferTasks: Array<any>, selectItem:Array<any>){
console.log(selectItem);
var message = "";
for (var index in selectItem) {
var item = selectItem[index];
@ -326,7 +318,7 @@ module Kubernetes {
*/
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){
if(getName(replicationControllers[i]) == item._key && getAnnotationValueBykey(replicationControllers[i],"year") == item["year"]){
message = "数据正在使用";
return message;
}
@ -336,7 +328,7 @@ module Kubernetes {
*/
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){
if(transferTasks[i]["_key"] == item["_key"] && (transferTasks[i]["status"] == "1" || transferTasks[i]["status"] == "0") && item["year"] == transferTasks[i].labels.dataYear){
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,12 +12,18 @@
<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> 删除

@ -15,87 +15,53 @@ module System{
SystemModel.updateSqlInfo();
$scope.cityFilter = $scope.model = SystemModel.sqlInfo;
$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.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.countryFilter = $scope.cityFilter;
$scope.tableParams.settings({
dataset: $scope.cityFilter
});
$scope.optionsFilter.x = x;
$scope.optionsFilter.y = $scope.y = "all";
if(x != "all"){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); //获取当前市下所有区县
}else{
$scope.countries = [];
}
}
$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.countrySelect = (y) => {
$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");
}
@ -118,212 +84,191 @@ module System{
});
});
// watch for data checkboxes
$scope.$watch(function() {
return $scope.checkboxes.items;
}, function(values) {
$scope.checkable = false;
for(var index in values){
if(values[index] == true){
$scope.checkable = true;
break;
}
}
var checked = 0, unchecked = 0,
total = $scope.model.length;
angular.forEach($scope.model, function(item) {
checked += ($scope.checkboxes.items[item.id]) || 0;
unchecked += Number((!$scope.checkboxes.items[item.id])) || 0;
});
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);
// watch for data checkboxes
$scope.$watch(function() {
return $scope.checkboxes.items;
}, function(values) {
$scope.checkable = false;
for(var index in values){
if(values[index] == true){
$scope.checkable = true;
break;
}
}
var checked = 0, unchecked = 0,
total = $scope.model.length;
angular.forEach($scope.model, function(item) {
checked += ($scope.checkboxes.items[item.id]) || 0;
unchecked += Number((!$scope.checkboxes.items[item.id])) || 0;
});
if ((unchecked == 0) || (checked == 0)) {
$scope.checkboxes.checked = (checked == total);
}
angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0));
}, true);
//查看
$scope.viewSql = (selected, type) => {
ngDialog.open({
template: 'sqlView.html',
controller:'Configs.SqlViewController',
width: 1000,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.viewSql = (selected, type) => {
ngDialog.open({
template: 'sqlView.html',
controller:'Configs.SqlViewController',
width: 1000,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
//上传
$scope.addSql = (selected, type) => {
ngDialog.open({
template: 'sqlAdd.html',
controller:'Configs.SqlAddController',
width: 600,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.verifySql = (selected, type) => {
ngDialog.open({
template: 'sqlVerification.html',
controller:'Configs.sqlVerificationController',
width: 1000,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.moveSql = (selected, type) => {
ngDialog.open({
template: 'sqlMove.html',
controller:'Configs.sqlMoveController',
width: 600,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.addSql = (selected, type) => {
ngDialog.open({
template: 'sqlAdd.html',
controller:'Configs.SqlAddController',
width: 600,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.$on('onOk', (event, data) => {
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
var target = document.getElementById('loading')
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: data.type, opt: data.opt},
data: JSON.stringify({
item: data.item,
content: data.content
})
}).success((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
shareUpdate(data);
}).error((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
});
$scope.verifySql = (selected, type) => {
ngDialog.open({
template: 'sqlVerification.html',
controller:'Configs.sqlVerificationController',
width: 1000,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.$on("replace", (event, data) => {
$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: data.type, opt: data.opt},
data: JSON.stringify({
item: data.item,
content: data.content
})
}).success((data,header,config,status) => {
shareUpdate(data);
}).error((data,header,config,status) => {
Configs.customAlert("提示", "脚本替换或归档失败!", '',null, 0, "error");
})
});
$scope.moveSql = (selected, type) => {
ngDialog.open({
template: 'sqlMove.html',
controller:'Configs.sqlMoveController',
width: 600,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
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)
result.push(item);
});
$scope.filterResult = result;
result = [];
}
$scope.$on('onOk', (event, data) => {
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
var target = document.getElementById('loading')
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: data.type, opt: data.opt},
data: JSON.stringify({
item: data.item,
content: data.content
})
}).success((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
$scope.model = SystemModel.sqlInfo = data.data;
shareUpdate($scope.model, $scope.optionsFilter);
}).error((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
});
});
if($scope.y != "all"){
angular.forEach($scope.filterResult, (item) => {
if(item.districtName == $scope.y)
result.push(item);
});
$scope.filterResult = result;
result = [];
}
$scope.$on("replace", (event, data) => {
$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: data.type, opt: data.opt},
data: JSON.stringify({
item: data.item,
content: data.content
})
}).success((data,header,config,status) => {
//shareUpdate(data);
}).error((data,header,config,status) => {
Configs.customAlert("提示", "脚本替换或归档失败!", '',null, 0, "error");
});
});
$scope.tableParams.settings({
dataset: $scope.filterResult
});
}
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 updateSqlStatus(url: string) {
var items = [];
if($scope.model && $scope.model.length > 0){
angular.forEach($scope.model, (item) => {
if($scope.checkboxes.items[item.id])
items.push(item);
if(value.y != "all"){
angular.forEach(filter, (item) => {
if(item.districtName == value.y)
result.push(item);
});
}
if(items.length <= 0)
return;
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
filter = result;
result = [];
}
$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(value.z != "all"){
angular.forEach(filter, (item) =>{
if($scope.status[item.sysStatus].label == value.z)
result.push(item);
});
filter = result;
result = [];
}
$scope.tableParams.settings({
dataset: filter
});
if($scope.x != 'all'){
filter = [];
var tmp = [];
angular.forEach(result, (item) => {
if($scope.x == item.cityName)
tmp.push(item);
});
$scope.checkboxes = {
checked: false,
items: {}
};
}
filter = tmp;
function updateSqlStatus(url: string) {
var items = [];
if($scope.model && $scope.model.length > 0){
angular.forEach($scope.model, (item) => {
if($scope.checkboxes.items[item.id])
items.push(item);
});
}
if(items.length <= 0)
return;
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
if($scope.y != 'all'){
filter = [];
angular.forEach(tmp, (item) => {
if($scope.y == item.districtName)
filter.push(item);
});
}
}
$("#load").remove();
Kubernetes.removeMask();
$scope.tableParams.settings({
dataset: filter
});
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$("#load").remove();
Kubernetes.removeMask();
Configs.customAlert("提示", "一键审核或归档失败!", '',null, 0, "error");
});
}
$http({
url: url,
method: 'POST',
data: JSON.stringify(items)
}).success(function(data,header,config,status){
$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");
});
}
}])
}

@ -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);
}

@ -9,7 +9,7 @@
/// <reference path="../../kubernetes/ts/term.ts"/>
module System{
export var SystemVerificationController = controller('SystemVerificationController', ['$scope', '$interval', '$location', '$http', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', '$element', '$timeout', 'ConfigsModel', 'DataModel', 'TerminalService', ($scope, $interval, $location, $http, $templateCache, Upload, NgTableParams, ngDialog, SystemModel, $element, $timeout, ConfigsModel, DataModel, TerminalService) => {
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;
@ -127,12 +127,31 @@ module System{
angular.forEach($scope.tableData, (item) => {
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.transferTasks , filter);
if(message != ""){
Configs.customAlert("提示", "操作失败:部分数据" + message +",无法删除", '',null, 0, "error");
return
}
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
/*UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: filter,
index: 'index',
onClose: (result:boolean) => {
@ -168,7 +187,7 @@ module System{
customClass: "alert alert-warning sj_alert-warning",
cancelText: "取消",
cancelClass: 'sj_btn_grey'
}).open();
}).open(); */
}
$scope.check = () => {

Loading…
Cancel
Save