Compare commits
13 Commits
Author | SHA1 | Date |
---|---|---|
lili | f5d6b60ed8 | |
lili | 4e26bc1f8e | |
lili | d2f880064b | |
lili | 56edb8ea7b | |
lili | acae8c92df | |
lili | 9750e1467d | |
lili | 30c70fba37 | |
lili | 3ac9da8ad2 | |
lili | 4218595a3a | |
ladventure | 1ae916723d | |
ladventure | 93ad9c5304 | |
ladventure | b0fbb27903 | |
pengfei | 57d45a80f7 |
|
@ -9,6 +9,7 @@ declare module Configs {
|
|||
static UPDATE: string;
|
||||
static PUT: string;
|
||||
static MOVE: string;
|
||||
static CREATE_DATABASE: string;
|
||||
static EXTRACT: string;
|
||||
}
|
||||
function createOracleInfo(array: Array<any>, id: number): {
|
||||
|
|
|
@ -4,9 +4,9 @@ declare module Configs {
|
|||
function removeElementByValue(array: Array<any>, value: any, key?: string): void;
|
||||
function removeElementsByValue(array: Array<any>, elements: Array<any>): void;
|
||||
/**
|
||||
对象的深拷贝
|
||||
对象的深拷贝
|
||||
*/
|
||||
function deepCopy(object: any): any;
|
||||
function downloadFile($scope: any, $http: any, url: any, fn?: any): void;
|
||||
function downloadFile($scope: any, $http: any, url: any, fileName: any, fn?: any): void;
|
||||
function FileInputPlugin(fn: Function, isMultiple?: boolean): void;
|
||||
}
|
||||
|
|
|
@ -13,4 +13,5 @@ declare module Configs {
|
|||
var sqlVerificationController: ng.IModule;
|
||||
var sqlMoveController: ng.IModule;
|
||||
var sysVerUpdateController: ng.IModule;
|
||||
var dataExportController: ng.IModule;
|
||||
}
|
||||
|
|
|
@ -70,4 +70,5 @@ declare module Kubernetes {
|
|||
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;
|
||||
function alreadyExitInCluster(selectedItems: Array<any>, volumePath: any): boolean;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -173,7 +173,7 @@ gulp.task('connect', ['watch'], function() {
|
|||
localProxies.push({
|
||||
proto: "http",
|
||||
port: "8080",
|
||||
hostname: "localhost", //hostname:localhost
|
||||
hostname: "localhost", //hostname:localhost
|
||||
path: '/api/v1/proxy/namespaces/default/services/fabric8-forge',
|
||||
targetPath: "/"
|
||||
});
|
||||
|
@ -249,7 +249,7 @@ gulp.task('connect', ['watch'], function() {
|
|||
}, {
|
||||
proto: "http",
|
||||
port: "9001",
|
||||
hostname: "192.168.191.100", //hostname:"127.0.0.1"
|
||||
hostname: "192.168.191.102", //hostname:"127.0.0.1"
|
||||
path: '/java/console/api',
|
||||
targetPath: "/"
|
||||
}];
|
||||
|
@ -355,4 +355,4 @@ gulp.task('site', ['clean', 'build'], function() {
|
|||
});
|
||||
});
|
||||
|
||||
gulp.task('default', ['connect']);
|
||||
gulp.task('default', ['connect']);
|
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
|
@ -16,10 +16,15 @@ a:hover,a:active{color:#333;}
|
|||
.cl{ clear:both; overflow:hidden;}
|
||||
/* public*/
|
||||
.mt2{margin-top: 3px;}
|
||||
.mt5{ margin-top: 5px;}.mt10{ margin-top: 10px;}.mt15{ margin-top: 15px;}
|
||||
.ml5{ margin-left:5px;}.ml10{ margin-left:10px;}.ml15{ margin-left:15px;}
|
||||
.mt5{ margin-top: 5px;}.mt10{ margin-top: 10px;}.mt15{ margin-top: 15px;}.mt20{ margin-top: 20px;}.mt30{ margin-top: 30px;}
|
||||
.ml5{ margin-left:5px;}.ml10{ margin-left:10px;}.ml15{ margin-left:15px;}.ml20{ margin-left: 20px;}
|
||||
.mr5{ margin-right:5px;}.mr10{ margin-right:10px;}.mr15{ margin-right:15px;}.mr17{ margin-right:17px;}.mr20{ margin-right:20px;}
|
||||
.mb10{ margin-bottom: 10px;}
|
||||
.mb5{ margin-bottom: 5px;}.mb10{ margin-bottom: 10px;}
|
||||
.margin20{ margin:20px;}
|
||||
.pt5{ padding-top:5px;}
|
||||
.pb5{ padding-bottom:5px;}
|
||||
.padding20{ padding: 20px;}
|
||||
.height20{ height:20px;}
|
||||
a.sj_btn_grey{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #fdfdfd,#e8e8e8);background-image:linear-gradient(top,#fdfdfd,#e8e8e8); border:1px solid #cecece; color:#505050;}
|
||||
a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3d3);background-image:linear-gradient(top,#eeeeee,#d3d3d3);}
|
||||
.sj_btn_grey{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #fdfdfd,#e8e8e8);background-image:linear-gradient(top,#fdfdfd,#e8e8e8); border:1px solid #cecece; color:#505050;}
|
||||
|
@ -77,6 +82,7 @@ a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3
|
|||
.sj_table_td00{ width:5%;}
|
||||
.sj_table_td06{ width:15%;}
|
||||
.sj_over_hid{ display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
||||
.sj_over_hid2{ overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
||||
.sj_content_table table tr td input{ margin-top:15px;}
|
||||
.sj_content_table .sj_table_top td{ border-bottom:1px solid #a6a6a6; font-weight:bold; border-right:1px solid #ccc;}
|
||||
.sj_table_bottom{ height:30px; line-height:30px; }
|
||||
|
@ -205,4 +211,12 @@ table tr.sj_popup_toptxt th{ font-weight: bold; text-align: center; color: #333
|
|||
.container-fluid{ padding-left: 0; padding-right: 0;}
|
||||
.sj_fluid{ margin-left:20px; margin-right: 20px;}
|
||||
.custom-alert {width: 330px; border: none;background-color: #fff;font-weight: bold;font-size: 12px;-webkit-border-radius:5px; -moz-border-radius:5px;-o-border-radius:5px; border-radius:5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
|
||||
.custom-alert-title { line-height: 30px;padding: 0px 10px;background-color: #3b94d6;}
|
||||
.custom-alert-title { line-height: 30px;padding: 0px 10px;background-color: #3b94d6;}
|
||||
|
||||
.sj-border-black{ border:1px solid #000;}
|
||||
.export-li{ width:446px; height:30px;}
|
||||
.export-label { height:30px;}
|
||||
.export-li input{ width: 18px; height:18px;}
|
||||
.export-li span{width:400px; height:18px;}
|
||||
.box-sizing{ -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; }
|
||||
.border-left-none{ boder-left:none;}
|
85
package.json
85
package.json
|
@ -1,42 +1,43 @@
|
|||
{
|
||||
"name": "hawtio-kubernetes",
|
||||
"version": "2.0.0",
|
||||
"devDependencies": {
|
||||
"bower": "^1.3.12",
|
||||
"del": "^2.2.0",
|
||||
"event-stream": "^3.1.7",
|
||||
"gulp": "^3.8.10",
|
||||
"gulp-angular-templatecache": "^1.5.0",
|
||||
"gulp-concat": "^2.4.2",
|
||||
"gulp-concat-filenames": "^1.0.0",
|
||||
"gulp-filter": "^3.0.1",
|
||||
"gulp-less": "^3.0.5",
|
||||
"gulp-load-plugins": "^0.8.0",
|
||||
"gulp-ng-annotate": "^1.1.0",
|
||||
"gulp-notify": "^2.1.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-sourcemaps": "^1.5.1",
|
||||
"gulp-typescript": "^2.4.2",
|
||||
"gulp-watch": "^3.0.0",
|
||||
"hawtio-node-backend": "^2.0.5",
|
||||
"stringify-object": "^2.0.0",
|
||||
"through2": "^0.6.3",
|
||||
"underscore.string": "^2.4.0",
|
||||
"urijs": "^1.17.0",
|
||||
"url-join": "^0.0.1",
|
||||
"which": "^1.0.8",
|
||||
"wiredep": "^2.2.2",
|
||||
"yargs": "^3.32.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^2.0.0-rc.6",
|
||||
"connect-multiparty": "^2.0.0",
|
||||
"hawtio-node-backend": "^2.1.0",
|
||||
"k8s": "^0.2.7",
|
||||
"node-crontab": "0.0.8",
|
||||
"oracledb": "^1.9.3",
|
||||
"xml2js": "^0.4.16",
|
||||
"xmldom": "^0.1.22",
|
||||
"xpath.js": "^1.0.6"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "hawtio-kubernetes",
|
||||
"version": "2.0.0",
|
||||
"devDependencies": {
|
||||
"bower": "^1.3.12",
|
||||
"del": "^2.2.0",
|
||||
"event-stream": "^3.1.7",
|
||||
"gulp": "^3.8.10",
|
||||
"gulp-angular-templatecache": "^1.5.0",
|
||||
"gulp-concat": "^2.4.2",
|
||||
"gulp-concat-filenames": "^1.0.0",
|
||||
"gulp-filter": "^3.0.1",
|
||||
"gulp-less": "^3.0.5",
|
||||
"gulp-load-plugins": "^0.8.0",
|
||||
"gulp-ng-annotate": "^1.1.0",
|
||||
"gulp-notify": "^2.1.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-sourcemaps": "^1.5.1",
|
||||
"gulp-typescript": "^2.4.2",
|
||||
"gulp-watch": "^3.0.0",
|
||||
"hawtio-node-backend": "^2.0.5",
|
||||
"stringify-object": "^2.0.0",
|
||||
"tern": "^0.21.0",
|
||||
"through2": "^0.6.3",
|
||||
"underscore.string": "^2.4.0",
|
||||
"urijs": "^1.17.0",
|
||||
"url-join": "^0.0.1",
|
||||
"which": "^1.0.8",
|
||||
"wiredep": "^2.2.2",
|
||||
"yargs": "^3.32.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^2.0.0-rc.6",
|
||||
"connect-multiparty": "^2.0.0",
|
||||
"hawtio-node-backend": "^2.1.0",
|
||||
"k8s": "^0.2.7",
|
||||
"node-crontab": "0.0.8",
|
||||
"oracledb": "^1.9.3",
|
||||
"xml2js": "^0.4.16",
|
||||
"xmldom": "^0.1.22",
|
||||
"xpath.js": "^1.0.6"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,128 +5,318 @@
|
|||
<div class="row">
|
||||
<div hawtio-tabs></div>
|
||||
</div>
|
||||
<div class="container-content ">
|
||||
<div class="container-fluid sj_fluid">
|
||||
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
|
||||
<p class="alert alert-info">当前没有配置汇总库信息,请配置,否则汇总操作将不可用!</p>
|
||||
</div>
|
||||
<div class="row mb10" ng-show="model.oracleParam.length">
|
||||
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>
|
||||
<button class="btn sj_btn_green mb10" style="color:#fff;" ng-click="create()">
|
||||
<span class="glyphicon glyphicon-plus"></span> 添加
|
||||
</button>
|
||||
<div class="container-content ">
|
||||
<div class="container-fluid sj_fluid">
|
||||
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
|
||||
<p class="alert alert-info">当前没有配置汇总库信息,请配置,否则汇总操作将不可用!</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row " style="padding-top:10px;" ng-show="tableForm && (edit || add)">
|
||||
<h3 class="mb10" ng-show="edit">编辑汇总库连接信息:</h3>
|
||||
<h3 class="mb10" ng-show="add">添加汇总库信息:</h3>
|
||||
<div class="col-md-6 col-md-offset-1 ">
|
||||
<form class="form-horizontal" novalidate="novalidate" name="validForm" ng-submit="onSubmit(tableForm)">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">名称</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control " type="text" ng-model="tableForm.name" name="orcName" ng-minlength="2" ng-maxlength="20" required="required" ng-focus="tableForm.name=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcName.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcName.$error.required">名称不能为空</span>
|
||||
<span role="alert" ng-show="!validForm.orcName.$error.required && validForm.orcName.$invalid">请输入2-20个字符的数据名称</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">IP</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.ip" name="orcIP" ng-pattern="/((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))/" required="required" ng-focus="tableForm.ip=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcIP.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcIP.$error.required">IP不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcIP.$error.pattern">请输入正确的IP地址</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">端口号</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.port" name="orcPort" ng-pattern="/^([1-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/" required="required" ng-focus="tableForm.port=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPort.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcPort.$error.required">端口号不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcPort.$error.pattern">端口号必须为1~65535的数字</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">用戶名</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.user" name="orcUser" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.user=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcUser.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcUser.$error.required">用户名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcUser.$error.pattern">用户名必须为2-15个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.password" name="orcPassword" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.password=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPassword.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcPassword.$error.required">密码不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcPassword.$error.pattern">密码必须为2-15个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">服务名</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.databaseName" name="orcService" ng-pattern="/^[a-zA-Z]{1,10}$/" required="required" ng-focus="tableForm.databaseName=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcService.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcService.$error.required">服务名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcService.$error.pattern">服务名必须为1-10个字母</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">表空间名</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.tableName" name="orcTable" ng-pattern="/^\w{1,15}$/" required="required" ng-focus="tableForm.tableName=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcTable.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcTable.$error.required">表空间名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcTable.$error.pattern">表空间名必须为1-15个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">表后缀名</label>
|
||||
<div class="col-sm-10 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.suffix" name="orcSuffix" ng-pattern="/^\w{1,10}$/" required="required" ng-focus="tableForm.suffix=''"/>
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcSuffix.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcSuffix.$error.required">表后缀名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcSuffix.$error.pattern">表后缀名必须为1-10个字母、数字或下划线</span>
|
||||
</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:145px;">
|
||||
<button class="btn sj_btn_blue" type='submit' style="color:#fff;" >
|
||||
<span class="glyphicon glyphicon-save "></span> 保存
|
||||
</button>
|
||||
<button class="btn sj_btn_grey" ng-click='cancel()'>
|
||||
<span class="glyphicon glyphicon-remove "></span> 取消
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row mb10" ng-show="model.oracleParam.length">
|
||||
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>
|
||||
<button class="btn sj_btn_green mb10" style="color:#fff;" ng-click="create()">
|
||||
<span class="glyphicon glyphicon-plus"></span> 添加
|
||||
</button>
|
||||
<button class="btn sj_btn_green mb10" style="color:#fff;" ng-click="createGatherDababase()">
|
||||
<span class="glyphicon glyphicon-plus"></span> 创建汇总库
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row " style="padding-top:10px;" ng-show="tableForm && (edit || add)">
|
||||
<h3 class="mb10" ng-show="edit">编辑汇总库连接信息:</h3>
|
||||
<h3 class="mb10" ng-show="add">添加汇总库信息:</h3>
|
||||
<div class="col-md-6 col-md-offset-1 ">
|
||||
<form class="form-horizontal" novalidate="novalidate" name="validForm" ng-submit="onSubmit(tableForm)">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">名称</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control " type="text" ng-model="tableForm.name" name="orcName" ng-minlength="2" ng-maxlength="20" required="required" ng-focus="tableForm.name" placeholder="请输入2-20个字符的数据名称" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcName.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcName.$error.required">名称不能为空</span>
|
||||
<span role="alert" ng-show="!validForm.orcName.$error.required && validForm.orcName.$invalid">请输入2-20个字符的数据名称</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group" ng-show="add">
|
||||
<label class="col-sm-3 control-label">是否创建汇总库</label>
|
||||
<div class="col-sm-9 sj_form_input ">
|
||||
<select class="form-control " ng-model="tableForm.isCreateGatherOracle">
|
||||
<option value=1 ng-selected="tableForm.isCreateGatherOracle==1">是</option>
|
||||
<option value=0 ng-selected="tableForm.isCreateGatherOracle==0" selected>否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">IP</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.ip" name="orcIP" ng-pattern="/((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))/" required="required" ng-focus="tableForm.ip" placeholder="oracle的IP,例如:0.0.0.0" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcIP.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcIP.$error.required">IP不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcIP.$error.pattern">请输入正确的IP地址</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">端口号</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.port" name="orcPort" ng-pattern="/^([1-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/" required="required" ng-focus="tableForm.port" placeholder="oracle的的端口,1~65535" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPort.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcPort.$error.required">端口号不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcPort.$error.pattern">端口号必须为1~65535的数字</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div ng-switch="tableForm.isCreateGatherOracle">
|
||||
<div ng-switch-when="1">
|
||||
<div class="form-group ">
|
||||
<label class="col-sm-3 control-label">开始时间</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.startTime" name="startTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.startTime" placeholder="开始时间,格式为yyyy-MM 例如:2018-02" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.startTime.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.startTime.$error.required">开始时间不能为空</span>
|
||||
<span role="alert" ng-show="validForm.startTime.$error.pattern">格式为yyyy-MM 例如:2018-02</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">结束时间</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.endTime" name="orcEndTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.endTime" placeholder="结束时间,格式为yyyy-MM 例如:2018-02" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcEndTime.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcEndTime.$error.required">结束时间不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcEndTime.$error.pattern">格式为yyyy-MM 例如:2018-02</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系人</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.contact" name="contact" ng-pattern="" required="required" ng-focus="tableForm.contact" placeholder="联系人" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.contact.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.contact.$error.required">联系人不能为空</span>
|
||||
<span role="alert" ng-show="validForm.contact.$error.pattern">联系人为有效联系人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系方式</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.phone" name="phone" ng-pattern="/^[1][3,4,5,7,8][0-9]{9}$/" required="required" ng-focus="tableForm.phone" placeholder="联系方式" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.phone.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.phone.$error.required">联系方式不能为空</span>
|
||||
<span role="alert" ng-show="validForm.phone.$error.pattern">手机号必须为有效的手机号码</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">数据版本号</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.dataVersion" name="dataVersion" ng-pattern="/^[1-9]\d*$/" required="required" ng-focus="tableForm.phone" placeholder="数据版本号" ng-init="tableForm.dataVersion=1" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.phone.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.phone.$error.required">版本号不能为空</span>
|
||||
<span role="alert" ng-show="validForm.dataVersion.$error.pattern">数据版本号必须为正整数</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">编码方式</label>
|
||||
<div class="col-sm-9 sj_form_input ">
|
||||
<select class="form-control " ng-model="tableForm.encoding">
|
||||
<option value=0 ng-selected="tableForm.encoding==GBK" selected>GBK</option>
|
||||
<option value=1 ng-selected="tableForm.encoding==UTF8">UTF8</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用戶名</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.user" name="orcUser" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.user" placeholder="oracle的用户名,2-15个字母、数字或下划线" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcUser.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcUser.$error.required">用户名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcUser.$error.pattern">用户名必须为2-15个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">密码</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.password" name="orcPassword" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.password" placeholder="oracle的密码,2-15个字母、数字或下划线" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPassword.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcPassword.$error.required">密码不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcPassword.$error.pattern">密码必须为2-15个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">服务名</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.databaseName" name="orcService" ng-pattern="/^[a-zA-Z]{1,10}$/" required="required" ng-focus="tableForm.databaseName" placeholder="oracle的实例名,1-10个字母,例如ORCL" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcService.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcService.$error.required">服务名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcService.$error.pattern">服务名必须为1-10个字母</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">表空间名</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.tableName" name="orcTable" ng-pattern="/^\w{1,15}$/" required="required" ng-focus="tableForm.tableName" placeholder="oracle的表空间名,1-15个字母、数字或下划线" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcTable.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcTable.$error.required">表空间名不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcTable.$error.pattern">表空间名必须为1-15个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户名后缀</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.suffix" name="orcSuffix" ng-pattern="/^\w{1,10}$/" required="required" ng-focus="tableForm.suffix" placeholder="汇总生成新表的后缀名,1-10个字母、数字或下划线" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcSuffix.$invalid && submitted">
|
||||
<span role="alert" ng-show="validForm.orcSuffix.$error.required">用户名后缀不能为空</span>
|
||||
<span role="alert" ng-show="validForm.orcSuffix.$error.pattern">用户名后缀名必须为1-10个字母、数字或下划线</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标准表汇总库</label>
|
||||
<div class="col-sm-9 sj_form_input ">
|
||||
<select class="form-control " ng-model="tableForm.type">
|
||||
<option value=0 ng-selected="tableForm.type==0" ng-init="tableForm.type==0">否</option>
|
||||
<option value=1 ng-selected="tableForm.type==1">是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-left:145px;">
|
||||
<button class="btn sj_btn_blue" type='submit' style="color:#fff; margin-right:30px;">
|
||||
<span class="glyphicon glyphicon-save "></span> 保存
|
||||
</button>
|
||||
<button class="btn sj_btn_grey" ng-click='cancel()'>
|
||||
<span class="glyphicon glyphicon-remove "></span> 取消
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<hr>
|
||||
<div class="row " style="padding-top:10px;" ng-show="tableForm && createDatabase">
|
||||
<h3 class="mb10" ng-show="createDatabase">填写创建汇总库信息:</h3>
|
||||
<div class="col-md-6 col-md-offset-1 ">
|
||||
<form class="form-horizontal" novalidate="novalidate" name="createDatabaseForm" ng-submit="onSubmitCreateDatabase(tableForm)">
|
||||
<div class="form-group" ng-show="0">
|
||||
<label class="col-sm-3 control-label">汇总库系统名称</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control " type="text" ng-model="tableForm.systemName" name="systemName" ng-minlength="2" ng-maxlength="20" required="required" ng-focus="tableForm.systemName" ng-init="tableForm.systemName='汇总库'" placeholder="请输入2-20个字符的汇总库系统名称" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.systemName.$invalid && submittedCreateDatabase">
|
||||
<span role="alert" ng-show="createDatabaseForm.systemName.$error.required">汇总库系统名称不能为空</span>
|
||||
<span role="alert" ng-show="!createDatabaseForm.systemName.$error.required && createDatabaseForm.systemName.$invalid">请输入2-20个字符的汇总库系统名称</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="col-sm-3 control-label">开始时间</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.startTime" name="startTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.startTime" placeholder="开始时间,格式为yyyy-MM 例如:2018-02" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.startTime.$invalid && submittedCreateDatabase">
|
||||
<span role="alert" ng-show="createDatabaseForm.startTime.$error.required">开始时间不能为空</span>
|
||||
<span role="alert" ng-show="createDatabaseForm.startTime.$error.pattern">格式为yyyy-MM 例如:2018-02</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">结束时间</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.endTime" name="endTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.endTime" placeholder="结束时间,格式为yyyy-MM 例如:2018-02" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.endTime.$invalid && submittedCreateDatabase">
|
||||
<span role="alert" ng-show="createDatabaseForm.endTime.$error.required">结束时间不能为空</span>
|
||||
<span role="alert" ng-show="createDatabaseForm.endTime.$error.pattern">格式为yyyy-MM 例如:2018-02</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系人</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.contact" name="contact" ng-pattern="" required="required" ng-focus="tableForm.contact" placeholder="联系人" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.contact.$invalid && submittedCreateDatabase">
|
||||
<span role="alert" ng-show="createDatabaseForm.contact.$error.required">联系人不能为空</span>
|
||||
<span role="alert" ng-show="createDatabaseForm.contact.$error.pattern">联系人为有效联系人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">联系方式</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.phone" name="phone" ng-pattern="/^[1][3,4,5,7,8][0-9]{9}$/" required="required" ng-focus="tableForm.phone" placeholder="联系方式" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.phone.$invalid && submittedCreateDatabase">
|
||||
<span role="alert" ng-show="createDatabaseForm.phone.$error.required">联系方式不能为空</span>
|
||||
<span role="alert" ng-show="createDatabaseForm.phone.$error.pattern">手机号必须为有效的手机号码</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">数据版本号</label>
|
||||
<div class="col-sm-9 sj_form_input">
|
||||
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.dataVersion" name="dataVersion" ng-pattern="/^[1-9]\d*$/" required="required" ng-focus="tableForm.dataVersion" placeholder="数据版本号" ng-init="tableForm.dataVersion=1" />
|
||||
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.dataVersion.$invalid && submittedCreateDatabase">
|
||||
<span role="alert" ng-show="createDatabaseForm.dataVersion.$error.required">版本号不能为空</span>
|
||||
<span role="alert" ng-show="createDatabaseForm.dataVersion.$error.pattern">数据版本号必须为正整数</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">编码方式</label>
|
||||
<div class="col-sm-9 sj_form_input ">
|
||||
<select class="form-control " ng-model="createDatabaseForm.encoding">
|
||||
<option value="GBK" ng-selected="createDatabaseForm.encoding==GBK" selected>GBK</option>
|
||||
<option value="UTF8" ng-selected="createDatabaseForm.encoding==UTF8">UTF8</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-left:145px;">
|
||||
<button class="btn sj_btn_blue" type='submit' style="color:#fff; margin-right:30px;">
|
||||
<span class="glyphicon glyphicon-save "></span> 保存
|
||||
</button>
|
||||
<button class="btn sj_btn_grey" ng-click='cancelCreateDatabase()'>
|
||||
<span class="glyphicon glyphicon-remove "></span> 取消
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
.form-horizontal input::-webkit-input-placeholder {
|
||||
font-family: "微软雅黑";
|
||||
font-size: 12px;
|
||||
line-height: 28px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.form-horizontal input::-moz-placeholder {
|
||||
font-family: "微软雅黑";
|
||||
font-size: 12px;
|
||||
line-height: 28px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.form-horizontal input:-moz-placeholder {
|
||||
font-family: "微软雅黑";
|
||||
font-size: 12px;
|
||||
line-height: 28px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.form-horizontal input:-ms-input-placeholder {
|
||||
font-family: "微软雅黑";
|
||||
font-size: 12px;
|
||||
line-height: 28px;
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
|
@ -84,10 +84,10 @@
|
|||
</th>
|
||||
<!--<th>
|
||||
<button class="sj_btn_grey mr5" ng-click="cancel()">取消</button>
|
||||
</th> -->
|
||||
</th> -->
|
||||
<th colspan="5" ng-show="ngDialogData.editable">
|
||||
<span>是否为热区</span>
|
||||
<input type="checkbox" checked="checked" name="hot" ng-model="ngDialogData.hot"/>
|
||||
<input type="checkbox" checked="checked" name="hot" ng-model="ngDialogData.hot" />
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -366,76 +366,113 @@
|
|||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="statusHelp.html">
|
||||
<div class="sj_new_box05">
|
||||
<h2 class="sj_popup_h2 mb10 mt10">帮助</h2>
|
||||
<table class="sj_new_table02 mb10" cellpadding="0" cellspacing="0">
|
||||
<thead >
|
||||
<tr class="sj_popup_toptxt ">
|
||||
<th >操作</th>
|
||||
<th >归档脚本</th>
|
||||
<th >新版版本</th>
|
||||
<th >详细说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr >
|
||||
<td class="sj_popup_txtbold">审核</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class=" sj_popup_midtxt">保留:删除新版脚本文件,保留现有归档脚本
|
||||
<br/>替换:新版脚本文件移动并覆盖原有归档脚本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">上传</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class=" sj_popup_midtxt">选择本地脚本文件,系统按照命名规范重命名文件并归档</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">归档</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class=" sj_popup_midtxt">将上报的脚本文件移动到归档路径进行归档</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">查看</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class=" sj_popup_midtxt">重新上传:选择本地脚本文件,系统按照命名规范重命名文件并覆盖现有的归档脚本</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="sj_popup_p">
|
||||
<p>一键归档:待归档状态的所有脚本文件,后台一次性全部归档</p>
|
||||
<p>一键审核:待审核状态的所有脚本文件,后台一次性全部替换</p>
|
||||
</div>
|
||||
<script type="text/ng-template" id="statusHelp.html">
|
||||
<div class="sj_new_box05">
|
||||
<h2 class="sj_popup_h2 mb10 mt10">帮助</h2>
|
||||
<table class="sj_new_table02 mb10" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr class="sj_popup_toptxt ">
|
||||
<th>操作</th>
|
||||
<th>归档脚本</th>
|
||||
<th>新版版本</th>
|
||||
<th>详细说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">审核</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class=" sj_popup_midtxt">保留:删除新版脚本文件,保留现有归档脚本
|
||||
<br/>替换:新版脚本文件移动并覆盖原有归档脚本</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">上传</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class=" sj_popup_midtxt">选择本地脚本文件,系统按照命名规范重命名文件并归档</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">归档</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class=" sj_popup_midtxt">将上报的脚本文件移动到归档路径进行归档</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="sj_popup_txtbold">查看</td>
|
||||
<td class="sj_popup_txtbold">有</td>
|
||||
<td class="sj_popup_txtbold">无</td>
|
||||
<td class=" sj_popup_midtxt">重新上传:选择本地脚本文件,系统按照命名规范重命名文件并覆盖现有的归档脚本</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="sj_popup_p">
|
||||
<p>一键归档:待归档状态的所有脚本文件,后台一次性全部归档</p>
|
||||
<p>一键审核:待审核状态的所有脚本文件,后台一次性全部替换</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="uploadErrorInfo.html">
|
||||
<div class="container-fluid ">
|
||||
<h2 class="sj_popup_h2 mb10 fb ml15">错误信息:</h2>
|
||||
<div class=" mb10" style="height:400px;overflow-y:auto;">
|
||||
<table class="sj_new_table02 mb10 ml15" cellpadding="0" cellspacing="0">
|
||||
<thead >
|
||||
<tr class="sj_popup_toptxt ">
|
||||
<th >文件名</th>
|
||||
<th >错误描述</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="info in ngDialogData">
|
||||
<td class="sj_popup_midtxt">{{info.name}}</td>
|
||||
<td class="sj_popup_midtxt">{{info.value}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class=" mb10" style="height:400px;overflow-y:auto;">
|
||||
<table class="sj_new_table02 mb10 ml15" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr class="sj_popup_toptxt ">
|
||||
<th>文件名</th>
|
||||
<th>错误描述</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="info in ngDialogData">
|
||||
<td class="sj_popup_midtxt">{{info.name}}</td>
|
||||
<td class="sj_popup_midtxt">{{info.value}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
<script type="text/ng-template" id="dataExport.html">
|
||||
<div class="container-fluid cl padding20 box-sizing">
|
||||
<div class="sj_table_td05 sj-border-black mt10 padding20 fl">
|
||||
<h3 class="mb10">选择需要导出的数据</h3>
|
||||
<ul class="mb10" style="height:400px;overflow-y:auto;">
|
||||
<li class="cl export-li">
|
||||
<label class="export-label">
|
||||
<input type="checkbox" ng-model="flag" class="fl" ng-click="selectAll(flag)" />
|
||||
<span class="ml5 mt5 fl sj_over_hid">全选</span>
|
||||
</label>
|
||||
</li>
|
||||
<li class="cl export-li" ng-repeat="item in uniqueData">
|
||||
<label class="export-label">
|
||||
<input type="checkbox" id={{item.id}} ng-checked="ischeckedId(item.id) " ng-click="selectId(item.id,$event) " class="fl " />
|
||||
<span class="ml5 mt5 fl sj_over_hid ">{{item.cityName}}_{{item.districtName}}_{{item.systemName}}_{{item.endYear}}_{{item.submittedBatch}}_{{item.dataVersion}}</span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sj_table_td05 sj-border-black mt10 padding20 border-left-none fl ">
|
||||
<h3 class="mb10 ">选择导出数据类型</h3>
|
||||
<ul class="mb10 " style="height:400px;overflow-y:auto; ">
|
||||
<li class="cl export-li " ng-repeat="item in export ">
|
||||
<label class="export-label">
|
||||
<input type="checkbox" id={{item.type}} ng-checked="ischeckedType(item.type) " ng-click="selectType(item.type,$event) " class="fl " />
|
||||
<span class="ml5 mt5 fl sj_over_hid " style="width: 100px;">{{item.exportName}}</span>
|
||||
<span class="ml5 mt5 fl sj_over_hid " style="width:100px;" ng-show="item.exportName=='汇总库' && gatherOracleSelected">请选择汇总库</span>
|
||||
<select class="ml5 mt5 fl sj_over_hid" style="width: 150px;" ng-show="item.exportName=='汇总库' && gatherOracleSelected" ng-model="$parent.selectGatherOracleName">
|
||||
<option ng-repeat="one in gatherOracles " value="{{one.id}} ">{{one.name}}</option>
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<button class="sj_btn_blue mt20 fr " ng-click="onsubmit(idList,typeList,selectGatherOracleName) ">保存</button>
|
||||
<button class="sj_btn_grey mt20 mr5 fr " ng-click="cancel() ">取消</button>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,215 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="configPlugin.ts"/>
|
||||
/// <reference path="configsDataService.ts"/>
|
||||
/// <reference path="../../developer/ts/developerNavigation.ts"/>
|
||||
/// <reference path="../../developer/ts/dataManagerHelper.ts"/>
|
||||
var Configs;
|
||||
(function (Configs) {
|
||||
var OperateType = (function () {
|
||||
function OperateType() {
|
||||
}
|
||||
Object.defineProperty(OperateType, "DELETE", {
|
||||
get: function () { return "delete"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(OperateType, "UPDATE", {
|
||||
get: function () { return "update"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(OperateType, "PUT", {
|
||||
get: function () { return "put"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(OperateType, "MOVE", {
|
||||
get: function () { return "move"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(OperateType, "EXTRACT", {
|
||||
get: function () { return "extract"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return OperateType;
|
||||
})();
|
||||
Configs.OperateType = OperateType;
|
||||
Configs._module.controller('Configs.MenuItemController', ['$scope', '$location', function ($scope, $location) {
|
||||
$scope.menuItem = [{
|
||||
icon: "glyphicon glyphicon-cloud-upload",
|
||||
label: "数据管理配置",
|
||||
title: "配置数据存储信息",
|
||||
href: UrlHelpers.join(Configs.context, "/gluster-fs/setting")
|
||||
},
|
||||
{
|
||||
icon: "glyphicon glyphicon-th-list",
|
||||
label: "服务集群配置",
|
||||
title: "配置服务集群信息",
|
||||
href: UrlHelpers.join(Configs.context, "/kube-cluster/setting")
|
||||
}];
|
||||
}]);
|
||||
function createConfigBreadcrumbs($scope, $location, $routeParams) {
|
||||
var url = $location.url();
|
||||
var label, title;
|
||||
switch (url) {
|
||||
case "/config/gluster-fs/setting":
|
||||
label = "数据管理配置";
|
||||
title = "配置数据存储信息";
|
||||
break;
|
||||
case "/config/kube-cluster/setting":
|
||||
label = "服务集群配置";
|
||||
title = "配置服务集群信息";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Developer.activateCurrent([{
|
||||
href: url,
|
||||
label: label,
|
||||
title: title //item.title
|
||||
}]);
|
||||
}
|
||||
function createOracleInfo(array, id) {
|
||||
var result = { "id": id };
|
||||
angular.forEach(array, function (arr) {
|
||||
result[arr.field] = arr.value;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Configs.createOracleInfo = createOracleInfo;
|
||||
function shareInit($scope, $location, $routeParams) {
|
||||
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.mask = true;
|
||||
/**
|
||||
创建全屏遮挡
|
||||
*/
|
||||
$("#mask").css("position", "absolute");
|
||||
$("#mask").css("background", "black");
|
||||
$("#mask").css("opacity", 0.4);
|
||||
$("#mask").css("filter", "progid:DXImageTransform.Microsoft.Alpha(style=4,opacity=25)");
|
||||
$("#mask").css("top", "0px");
|
||||
$("#mask").css("left", "0px");
|
||||
$("#mask").css("width", document.body.clientWidth + document.body.scrollLeft);
|
||||
$("#mask").css("height", document.body.clientHeight + document.body.scrollTop);
|
||||
$("#mask").css("zIndex", 1000);
|
||||
}
|
||||
Configs.shareInit = shareInit;
|
||||
function createNewObejct(array, obj) {
|
||||
var result = [];
|
||||
if (obj) {
|
||||
angular.forEach(array, function (arr) {
|
||||
result.push({
|
||||
field: arr.field,
|
||||
name: arr.displayName,
|
||||
value: obj[arr.field]
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
angular.forEach(array, function (arr) {
|
||||
result.push({
|
||||
field: arr.field,
|
||||
name: arr.displayName,
|
||||
value: null
|
||||
});
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Configs.createNewObejct = createNewObejct;
|
||||
function oracleInfoOperate($http, url, operate, resource, fn) {
|
||||
if (resource === null)
|
||||
throw "不能操作空资源对象";
|
||||
if (angular.isArray(resource)) {
|
||||
var ids = [];
|
||||
angular.forEach(resource, function (item) {
|
||||
var id = item["id"] || item["name"] || item["_id"] || item["_key"];
|
||||
ids.push(id);
|
||||
});
|
||||
$http({
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
url: UrlHelpers.join(url, operate + "s"),
|
||||
data: ids,
|
||||
}).success(function (data, header, config, status) {
|
||||
if (angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
}).error(function (data, header, config, status) {
|
||||
if (angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
});
|
||||
}
|
||||
else {
|
||||
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
|
||||
var RESTfulUrl = url;
|
||||
if (id == "undefined") {
|
||||
RESTfulUrl = UrlHelpers.join(url, operate);
|
||||
}
|
||||
else {
|
||||
RESTfulUrl = UrlHelpers.join(url, id + "", operate);
|
||||
}
|
||||
$http({
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
url: RESTfulUrl,
|
||||
data: JSON.stringify(resource),
|
||||
}).success(function (data, header, config, status) {
|
||||
if (angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
// console.log("success");
|
||||
// console.log(data + "_." + header + "_.." + config + "_..." + status);
|
||||
// console.log("success");
|
||||
}).error(function (data, header, config, status) {
|
||||
if (angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
});
|
||||
}
|
||||
}
|
||||
Configs.oracleInfoOperate = oracleInfoOperate;
|
||||
function createConfigHelperNavBar($scope, $location, $routeParams) {
|
||||
return Developer.activateCurrent([
|
||||
{
|
||||
href: UrlHelpers.join(Configs.context, "regionalism-code/searching"),
|
||||
label: "行政区划检索",
|
||||
title: "检索行政区划代码"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Configs.context, "system-code/searching"),
|
||||
label: "系统编码检索",
|
||||
title: "检索系统编码"
|
||||
}
|
||||
]);
|
||||
}
|
||||
Configs.createConfigHelperNavBar = createConfigHelperNavBar;
|
||||
function formatVolume(volume) {
|
||||
var brick = [];
|
||||
angular.forEach(volume.brick, function (block) {
|
||||
brick.push({
|
||||
ip: block.ip.split("."),
|
||||
status: block.status,
|
||||
path: block.path,
|
||||
editable: block.editable || false
|
||||
});
|
||||
});
|
||||
return {
|
||||
name: volume.name,
|
||||
path: volume.path,
|
||||
brick: brick,
|
||||
status: volume.status,
|
||||
editable: volume.editable || false,
|
||||
hot: volume.hot == 0 ? true : false
|
||||
};
|
||||
}
|
||||
Configs.formatVolume = formatVolume;
|
||||
function volumesFormat(volumes) {
|
||||
var result = [];
|
||||
angular.forEach(volumes, function (volume) {
|
||||
result.push(formatVolume(volume));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Configs.volumesFormat = volumesFormat;
|
||||
})(Configs || (Configs = {}));
|
||||
//# sourceMappingURL=ConfigsHelper.js.map
|
File diff suppressed because one or more lines are too long
|
@ -3,203 +3,212 @@
|
|||
/// <reference path="configsDataService.ts"/>
|
||||
/// <reference path="../../developer/ts/developerNavigation.ts"/>
|
||||
/// <reference path="../../developer/ts/dataManagerHelper.ts"/>
|
||||
module Configs{
|
||||
export class OperateType{
|
||||
public static get DELETE():string {return "delete"}
|
||||
public static get UPDATE():string {return "update"}
|
||||
public static get PUT():string{return "put"}
|
||||
public static get MOVE():string{return "move"}
|
||||
public static get EXTRACT():string{return "extract"}
|
||||
}
|
||||
module Configs {
|
||||
export class OperateType {
|
||||
public static get DELETE(): string { return "delete" }
|
||||
public static get UPDATE(): string { return "update" }
|
||||
public static get PUT(): string { return "put" }
|
||||
public static get MOVE(): string { return "move" }
|
||||
public static get CREATE_DATABASE(): string { return "createDatabase" }
|
||||
public static get EXTRACT(): string { return "extract" }
|
||||
}
|
||||
|
||||
_module.controller('Configs.MenuItemController',['$scope', '$location', ($scope, $location) => {
|
||||
$scope.menuItem=[{
|
||||
icon: "glyphicon glyphicon-cloud-upload",
|
||||
label: "数据管理配置",
|
||||
title: "配置数据存储信息",
|
||||
href: UrlHelpers.join(context, "/gluster-fs/setting")
|
||||
},
|
||||
{
|
||||
icon: "glyphicon glyphicon-th-list",
|
||||
label: "服务集群配置",
|
||||
title: "配置服务集群信息",
|
||||
href: UrlHelpers.join(context, "/kube-cluster/setting")
|
||||
}]
|
||||
}]);
|
||||
_module.controller('Configs.MenuItemController', ['$scope', '$location', ($scope, $location) => {
|
||||
$scope.menuItem = [{
|
||||
icon: "glyphicon glyphicon-cloud-upload",
|
||||
label: "数据管理配置",
|
||||
title: "配置数据存储信息",
|
||||
href: UrlHelpers.join(context, "/gluster-fs/setting")
|
||||
},
|
||||
{
|
||||
icon: "glyphicon glyphicon-th-list",
|
||||
label: "服务集群配置",
|
||||
title: "配置服务集群信息",
|
||||
href: UrlHelpers.join(context, "/kube-cluster/setting")
|
||||
}
|
||||
]
|
||||
}]);
|
||||
|
||||
function createConfigBreadcrumbs($scope, $location, $routeParams){
|
||||
var url = $location.url();
|
||||
var label, title;
|
||||
switch (url) {
|
||||
case "/config/gluster-fs/setting":
|
||||
label = "数据管理配置";
|
||||
title= "配置数据存储信息";
|
||||
break;
|
||||
case "/config/kube-cluster/setting":
|
||||
label = "服务集群配置";
|
||||
title= "配置服务集群信息";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return Developer.activateCurrent([{
|
||||
href: url,
|
||||
label: label,//item.label,
|
||||
title: title//item.title
|
||||
}]);
|
||||
}
|
||||
function createConfigBreadcrumbs($scope, $location, $routeParams) {
|
||||
var url = $location.url();
|
||||
var label, title;
|
||||
switch (url) {
|
||||
case "/config/gluster-fs/setting":
|
||||
label = "数据管理配置";
|
||||
title = "配置数据存储信息";
|
||||
break;
|
||||
case "/config/kube-cluster/setting":
|
||||
label = "服务集群配置";
|
||||
title = "配置服务集群信息";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
export function createOracleInfo(array:Array<any>, id:number){
|
||||
var result ={"id": id};
|
||||
angular.forEach(array, (arr) => {
|
||||
result[arr.field] = arr.value;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
return Developer.activateCurrent([{
|
||||
href: url,
|
||||
label: label, //item.label,
|
||||
title: title //item.title
|
||||
}]);
|
||||
}
|
||||
|
||||
export function shareInit($scope, $location, $routeParams){
|
||||
$scope. subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.mask = true;
|
||||
/**
|
||||
创建全屏遮挡
|
||||
*/
|
||||
$("#mask").css("position", "absolute");
|
||||
$("#mask").css("background", "black");
|
||||
$("#mask").css("opacity", 0.4);
|
||||
$("#mask").css("filter", "progid:DXImageTransform.Microsoft.Alpha(style=4,opacity=25)");
|
||||
$("#mask").css("top", "0px");
|
||||
$("#mask").css("left", "0px");
|
||||
$("#mask").css("width", document.body.clientWidth + document.body.scrollLeft);
|
||||
$("#mask").css("height", document.body.clientHeight + document.body.scrollTop);
|
||||
$("#mask").css("zIndex", 1000);
|
||||
}
|
||||
export function createOracleInfo(array: Array < any > , id: number) {
|
||||
var result = { "id": id };
|
||||
angular.forEach(array, (arr) => {
|
||||
result[arr.field] = arr.value;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export function createNewObejct(array:Array<any>, obj){
|
||||
var result =[];
|
||||
if(obj){
|
||||
angular.forEach(array, (arr) =>{
|
||||
result.push({
|
||||
field: arr.field,
|
||||
name: arr.displayName,
|
||||
value: obj[arr.field]
|
||||
});
|
||||
});
|
||||
}else{
|
||||
angular.forEach(array, (arr) =>{
|
||||
result.push({
|
||||
field: arr.field,
|
||||
name: arr.displayName,
|
||||
value: null
|
||||
});
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function shareInit($scope, $location, $routeParams) {
|
||||
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.mask = true;
|
||||
/**
|
||||
创建全屏遮挡
|
||||
*/
|
||||
$("#mask").css("position", "absolute");
|
||||
$("#mask").css("background", "black");
|
||||
$("#mask").css("opacity", 0.4);
|
||||
$("#mask").css("filter", "progid:DXImageTransform.Microsoft.Alpha(style=4,opacity=25)");
|
||||
$("#mask").css("top", "0px");
|
||||
$("#mask").css("left", "0px");
|
||||
$("#mask").css("width", document.body.clientWidth + document.body.scrollLeft);
|
||||
$("#mask").css("height", document.body.clientHeight + document.body.scrollTop);
|
||||
$("#mask").css("zIndex", 1000);
|
||||
}
|
||||
|
||||
export function oracleInfoOperate($http, url:string, operate:string, resource, fn?: (data, status)=>void ){
|
||||
if(resource === null)
|
||||
throw "不能操作空资源对象";
|
||||
if(angular.isArray(resource)){
|
||||
var ids = [];
|
||||
angular.forEach(resource, (item) => {
|
||||
var id = item["id"] || item["name"] || item["_id"] || item["_key"];
|
||||
ids.push(id);
|
||||
});
|
||||
$http({
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
url: UrlHelpers.join(url, operate+"s"),
|
||||
data: ids,
|
||||
}).success((data,header,config,status) => {
|
||||
if(angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
}).error((data,header,config,status) => {
|
||||
if(angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
});
|
||||
}else{
|
||||
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
|
||||
var RESTfulUrl=url;
|
||||
if(id == "undefined"){
|
||||
RESTfulUrl = UrlHelpers.join(url, operate);
|
||||
}else{
|
||||
RESTfulUrl = UrlHelpers.join(url, id+"", operate);
|
||||
}
|
||||
|
||||
$http({
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
url: RESTfulUrl,
|
||||
data: JSON.stringify(resource),
|
||||
}).success((data,header,config,status) => {
|
||||
if(angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
}).error((data,header,config,status) => {
|
||||
if(angular.isFunction(fn))
|
||||
fn(data, header);
|
||||
});
|
||||
}
|
||||
}
|
||||
export function createNewObejct(array: Array < any > , obj) {
|
||||
var result = [];
|
||||
if (obj) {
|
||||
angular.forEach(array, (arr) => {
|
||||
result.push({
|
||||
field: arr.field,
|
||||
name: arr.displayName,
|
||||
value: obj[arr.field]
|
||||
});
|
||||
});
|
||||
} else {
|
||||
angular.forEach(array, (arr) => {
|
||||
result.push({
|
||||
field: arr.field,
|
||||
name: arr.displayName,
|
||||
value: null
|
||||
});
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function createConfigHelperNavBar($scope, $location, $routeParams){
|
||||
return Developer.activateCurrent([
|
||||
{
|
||||
href: UrlHelpers.join(context, "regionalism-code/searching"),
|
||||
label: "行政区划检索",
|
||||
title: "检索行政区划代码"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(context,"system-code/searching"),
|
||||
label: "系统编码检索",
|
||||
title: "检索系统编码"
|
||||
}
|
||||
]);
|
||||
}
|
||||
export function oracleInfoOperate($http, url: string, operate: string, resource, fn ? : (data, status) => void) {
|
||||
if (resource === null)
|
||||
throw "不能操作空资源对象";
|
||||
if (angular.isArray(resource)) {
|
||||
var ids = [];
|
||||
angular.forEach(resource, (item) => {
|
||||
var id = item["id"] || item["name"] || item["_id"] || item["_key"];
|
||||
ids.push(id);
|
||||
});
|
||||
$http({
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
url: UrlHelpers.join(url, operate + "s"),
|
||||
data: ids,
|
||||
}).then(function successCallback(response) {
|
||||
if (angular.isFunction(fn))
|
||||
fn(response.data, response.header);
|
||||
}, function errorCallback(response) {
|
||||
fn(response.data, response.header);
|
||||
});
|
||||
} else {
|
||||
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
|
||||
var RESTfulUrl = url;
|
||||
if (typeof(id) == "undefined") {
|
||||
RESTfulUrl = UrlHelpers.join(url, operate);
|
||||
} else {
|
||||
RESTfulUrl = UrlHelpers.join(url, id + "", operate);
|
||||
}
|
||||
|
||||
export function formatVolume(volume: volume): formatedVolume{
|
||||
var brick:Array<Brick> = [];
|
||||
angular.forEach(volume.brick, (block:Block) => {
|
||||
brick.push({
|
||||
ip: block.ip.split("."),
|
||||
status: block.status,
|
||||
path: block.path,
|
||||
editable: block.editable || false
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
name: volume.name,
|
||||
path: volume.path,
|
||||
brick: brick,
|
||||
status: volume.status,
|
||||
editable: volume.editable || false,
|
||||
hot: volume.hot == 0 ? true : false
|
||||
}
|
||||
}
|
||||
$http({
|
||||
method: "POST",
|
||||
dataType: 'json',
|
||||
url: RESTfulUrl,
|
||||
data: JSON.stringify(resource),
|
||||
}).then(function successCallback(response) {
|
||||
if (angular.isFunction(fn))
|
||||
fn(response.data, response.status);
|
||||
}, function errorCallback(response) {
|
||||
fn(response.data, response.status);
|
||||
});
|
||||
// success((data,header,config,status) => {
|
||||
// if(angular.isFunction(fn))
|
||||
// fn(data, header);
|
||||
// // console.log("success");
|
||||
// // console.log(data + "_." + header + "_.." + config + "_..." + status);
|
||||
// // console.log("success");
|
||||
// }).error((data,header,config,status) => {
|
||||
// if(angular.isFunction(fn))
|
||||
// fn(data, header);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export function volumesFormat(volumes: Array<volume>): Array<formatedVolume>{
|
||||
var result:Array<formatedVolume> = [];
|
||||
angular.forEach(volumes, (volume) => {
|
||||
result.push(formatVolume(volume));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
export function createConfigHelperNavBar($scope, $location, $routeParams) {
|
||||
return Developer.activateCurrent([{
|
||||
href: UrlHelpers.join(context, "regionalism-code/searching"),
|
||||
label: "行政区划检索",
|
||||
title: "检索行政区划代码"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(context, "system-code/searching"),
|
||||
label: "系统编码检索",
|
||||
title: "检索系统编码"
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
export interface formatedVolume{
|
||||
name: string
|
||||
path: string
|
||||
brick: Array<Brick>;
|
||||
status: boolean;
|
||||
editable: boolean,
|
||||
hot: boolean
|
||||
}
|
||||
export function formatVolume(volume: volume): formatedVolume {
|
||||
var brick: Array < Brick > = [];
|
||||
angular.forEach(volume.brick, (block: Block) => {
|
||||
brick.push({
|
||||
ip: block.ip.split("."),
|
||||
status: block.status,
|
||||
path: block.path,
|
||||
editable: block.editable || false
|
||||
});
|
||||
});
|
||||
|
||||
export interface Brick{
|
||||
ip: Array<string>;
|
||||
status: boolean;
|
||||
path: string;
|
||||
editable: boolean
|
||||
}
|
||||
return {
|
||||
name: volume.name,
|
||||
path: volume.path,
|
||||
brick: brick,
|
||||
status: volume.status,
|
||||
editable: volume.editable || false,
|
||||
hot: volume.hot == 0 ? true : false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
export function volumesFormat(volumes: Array < volume > ): Array < formatedVolume > {
|
||||
var result: Array < formatedVolume > = [];
|
||||
angular.forEach(volumes, (volume) => {
|
||||
result.push(formatVolume(volume));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export interface formatedVolume {
|
||||
name: string
|
||||
path: string
|
||||
brick: Array < Brick > ;
|
||||
status: boolean;
|
||||
editable: boolean,
|
||||
hot: boolean
|
||||
}
|
||||
|
||||
export interface Brick {
|
||||
ip: Array < string > ;
|
||||
status: boolean;
|
||||
path: string;
|
||||
editable: boolean
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
var Configs;
|
||||
(function (Configs) {
|
||||
Configs.pluginName = "Configs";
|
||||
Configs.context = "/config";
|
||||
Configs.pluginPath = 'plugins/configs/';
|
||||
Configs.templatePath = Configs.pluginPath + 'html/';
|
||||
Configs._module = angular.module(Configs.pluginName, ['hawtio-core', 'hawtio-ui', 'ui.codemirror', 'nvd3', 'ngTable', 'ngDialog']);
|
||||
Configs.route = PluginHelpers.createRoutingFunction(Configs.templatePath);
|
||||
Configs.controller = PluginHelpers.createControllerFunction(Configs._module, Configs.pluginName);
|
||||
Configs._module.config(['$provide', '$routeProvider', function ($provide, $routeProvider) {
|
||||
$routeProvider.when(UrlHelpers.join(Configs.context, 'gluster-fs/setting'), Configs.route('glusterfsSetting.html', false))
|
||||
.when(UrlHelpers.join(Configs.context, 'kube-cluster/setting'), Configs.route('kubeClusterSetting.html', false))
|
||||
.when(Configs.context, { redirectTo: UrlHelpers.join(Configs.context, '/kube-cluster/setting') });
|
||||
}]);
|
||||
Configs._module.run(['viewRegistry', '$templateCache', 'HawtioExtension', '$compile', function (viewRegistry, $templateCache, ext, $compile) {
|
||||
ext.add('config-setting', function ($scope) {
|
||||
var template = $templateCache.get(UrlHelpers.join(Configs.templatePath, "configMenuItem.html"));
|
||||
return $compile(template)($scope);
|
||||
});
|
||||
viewRegistry['config'] = Configs.templatePath + "shareLayout.html";
|
||||
}]);
|
||||
Configs._module.directive('gfsConfigTable', [function () {
|
||||
return {
|
||||
restrict: 'AE',
|
||||
replace: true,
|
||||
scope: {
|
||||
tableTitle: '=',
|
||||
tableContent: '='
|
||||
},
|
||||
template: "<table class=\"table table-hover\">\n <tr>\n <th ng-repeat=\"column in tableTitle.column\" class=\"no-fade table-header\">\n \t<span class=\"{{column.class}}\">{{column.title}}</span>\n </th> \n </tr>\n <tr ng-repeat = \"row in tableContent\" class=\"row.class\">\n \t<td ng-repeat=\"col in row\" class=\"col.class\">\n \t\t<span class=\"col.class\">{{col.title}}</span>\n \t</td>\n </tr> \n </table> \n ",
|
||||
link: function (scope, element, attr) {
|
||||
}
|
||||
};
|
||||
}]);
|
||||
hawtioPluginLoader.addModule(Configs.pluginName);
|
||||
})(Configs || (Configs = {}));
|
||||
//# sourceMappingURL=configPlugin.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"configPlugin.js","sourceRoot":"","sources":["configPlugin.ts"],"names":["Configs"],"mappings":"AAAA,yCAAyC;AAEzC,IAAO,OAAO,CAoDb;AApDD,WAAO,OAAO,EAAC,CAAC;IAEJA,kBAAUA,GAAGA,SAASA,CAACA;IACvBA,eAAOA,GAAGA,SAASA,CAACA;IACpBA,kBAAUA,GAAGA,kBAAkBA,CAACA;IAC7BA,oBAAYA,GAAGA,kBAAUA,GAAGA,OAAOA,CAACA;IACvCA,eAAOA,GAAGA,OAAOA,CAACA,MAAMA,CAACA,kBAAUA,EAAEA,CAACA,aAAaA,EAAEA,WAAWA,EAAEA,eAAeA,EAAEA,MAAMA,EAAEA,SAASA,EAAEA,UAAUA,CAACA,CAACA,CAACA;IACnHA,aAAKA,GAAGA,aAAaA,CAACA,qBAAqBA,CAACA,oBAAYA,CAACA,CAACA;IAC1DA,kBAAUA,GAAGA,aAAaA,CAACA,wBAAwBA,CAACA,eAAOA,EAAEA,kBAAUA,CAACA,CAACA;IAEpFA,eAAOA,CAACA,MAAMA,CAACA,CAACA,UAAUA,EAAEA,gBAAgBA,EAAEA,UAACA,QAAQA,EAAEA,cAAcA;YACtEA,cAAcA,CAACA,IAAIA,CAACA,UAAUA,CAACA,IAAIA,CAACA,eAAOA,EAAEA,oBAAoBA,CAACA,EAAEA,aAAKA,CAACA,uBAAuBA,EAAEA,KAAKA,CAACA,CAACA;iBACpGA,IAAIA,CAACA,UAAUA,CAACA,IAAIA,CAACA,eAAOA,EAAEA,sBAAsBA,CAACA,EAAEA,aAAKA,CAACA,yBAAyBA,EAAEA,KAAKA,CAACA,CAACA;iBAC/FA,IAAIA,CAACA,eAAOA,EAAEA,EAACA,UAAUA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,eAAOA,EAAEA,uBAAuBA,CAACA,EAACA,CAACA,CAACA;QACtFA,CAACA,CAACA,CAACA,CAACA;IAEHA,eAAOA,CAACA,GAAGA,CAACA,CAACA,cAAcA,EAAEA,gBAAgBA,EAAEA,iBAAiBA,EAAEA,UAAUA,EAAEA,UAACA,YAAYA,EAAEA,cAAuCA,EAAEA,GAAGA,EAAGA,QAA2BA;YACjKA,GAAGA,CAACA,GAAGA,CAACA,gBAAgBA,EAAEA,UAACA,MAAMA;gBAChCA,IAAIA,QAAQA,GAAIA,cAAcA,CAACA,GAAGA,CAASA,UAAUA,CAACA,IAAIA,CAACA,oBAAYA,EAAEA,qBAAqBA,CAACA,CAACA,CAACA;gBACjGA,MAAMA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,MAAMA,CAACA,CAACA;YACnCA,CAACA,CAACA,CAACA;YAEHA,YAAYA,CAACA,QAAQA,CAACA,GAAGA,oBAAYA,GAAGA,kBAAkBA,CAACA;QAC/DA,CAACA,CAACA,CAACA,CAACA;IAENA,eAAOA,CAACA,SAASA,CAACA,gBAAgBA,EAAEA,CAACA;YACpCA,MAAMA,CAAAA;gBACLA,QAAQA,EAAEA,IAAIA;gBACdA,OAAOA,EAAGA,IAAIA;gBACdA,KAAKA,EAAEA;oBACNA,UAAUA,EAAEA,GAAGA;oBACfA,YAAYA,EAAEA,GAAGA;iBACjBA;gBACDA,QAAQA,EAAEA,woBAYDA;gBACDA,IAAIA,EAAEA,UAACA,KAAKA,EAAEA,OAAOA,EAAEA,IAAIA;gBAC3BA,CAACA;aACTA,CAAAA;QACFA,CAACA,CAACA,CAACA,CAACA;IAELA,kBAAkBA,CAACA,SAASA,CAACA,kBAAUA,CAACA,CAACA;AAC1CA,CAACA,EApDM,OAAO,KAAP,OAAO,QAoDb"}
|
|
@ -0,0 +1,129 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="configPlugin.ts"/>
|
||||
var Configs;
|
||||
(function (Configs) {
|
||||
//字节大小转换成字符大小
|
||||
function getStringSize(size) {
|
||||
var result = size;
|
||||
var suffix = ["B", "KB", "MB", "GB", "TB", "PB"];
|
||||
var count = 1;
|
||||
while (result >= 1024) {
|
||||
result = result / 1024;
|
||||
count++;
|
||||
}
|
||||
return result.toFixed(2) + suffix[count];
|
||||
}
|
||||
function formatVolume(volume) {
|
||||
volume["formatTotalSize"] = getStringSize(volume.allSize);
|
||||
volume["formatUsedSize"] = getStringSize(volume.usedSize);
|
||||
volume["editable"] = false;
|
||||
angular.forEach(volume.brick, function (brock) {
|
||||
brock["formatUsedSize"] = getStringSize(brock.usedSize);
|
||||
brock["formatAllSize"] = getStringSize(brock.availableSize);
|
||||
brock["editable"] = false;
|
||||
});
|
||||
}
|
||||
function formatVolumes(volumes) {
|
||||
angular.forEach(volumes, function (volume) {
|
||||
formatVolume(volume);
|
||||
});
|
||||
}
|
||||
Configs.formatVolumes = formatVolumes;
|
||||
function IsBrockEquals(brock1, brock2) {
|
||||
return brock1.ip == brock2.ip && brock1.path == brock2.path;
|
||||
}
|
||||
/**
|
||||
刪除volume中指定的brock
|
||||
*/
|
||||
function deleteBrock(volume, brock) {
|
||||
for (var i = 0; i < volume.brick.length; i++) {
|
||||
var brick = volume.brick[i];
|
||||
if (IsBrockEquals(brick, brock)) {
|
||||
volume.brick.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Configs.deleteBrock = deleteBrock;
|
||||
/**
|
||||
volume添加brock
|
||||
*/
|
||||
function addBrock(volume, brock) {
|
||||
if (brock != null && brock != undefined)
|
||||
volume.brick.push(brock);
|
||||
}
|
||||
Configs.addBrock = addBrock;
|
||||
var ConfigsModelService = (function () {
|
||||
function ConfigsModelService() {
|
||||
this.cluster = [];
|
||||
this.oracleParam = [];
|
||||
this.systemInfo = [];
|
||||
this.regionalismInfo = [];
|
||||
this.updateAllData();
|
||||
}
|
||||
ConfigsModelService.prototype.updateAllData = function () {
|
||||
this.updateVolumeData();
|
||||
this.updateOracleParam();
|
||||
//this.updateCodeInfo();
|
||||
};
|
||||
ConfigsModelService.prototype.updateVolumeData = function () {
|
||||
var result = null;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
url: "/java/console/api/volume/list",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.cluster = JSON.parse(result);
|
||||
formatVolumes(this.cluster);
|
||||
};
|
||||
/*public updateCodeInfo(){
|
||||
var result=null;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type : "POST",
|
||||
url : "/java/console/api/code/list",
|
||||
success : function(data) {
|
||||
if(data){
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.regionalismInfo = result.regionalism;
|
||||
this.systemInfo = result.system;
|
||||
}*/
|
||||
ConfigsModelService.prototype.updateOracleParam = function () {
|
||||
var result = null;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
url: "/java/console/api/oracle/list",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.oracleParam = result;
|
||||
};
|
||||
ConfigsModelService.prototype.getFolderByVolumeName = function (name) {
|
||||
if (this.cluster === null)
|
||||
return null;
|
||||
for (var i = 0; i < this.cluster.length; i++) {
|
||||
if (this.cluster[i].name === name)
|
||||
return this.cluster[i].folder;
|
||||
}
|
||||
};
|
||||
return ConfigsModelService;
|
||||
})();
|
||||
Configs.ConfigsModelService = ConfigsModelService;
|
||||
Configs._module.factory('ConfigsModel', ['$rootScope', '$http', '$location', '$resource', function ($rootScope, $http, $location, $resource) {
|
||||
var $scope = new ConfigsModelService();
|
||||
return $scope;
|
||||
}]);
|
||||
})(Configs || (Configs = {}));
|
||||
//# sourceMappingURL=configsDataService.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"configsDataService.js","sourceRoot":"","sources":["configsDataService.ts"],"names":["Configs","Configs.getStringSize","Configs.formatVolume","Configs.formatVolumes","Configs.IsBrockEquals","Configs.deleteBrock","Configs.addBrock","Configs.ConfigsModelService","Configs.ConfigsModelService.constructor","Configs.ConfigsModelService.updateAllData","Configs.ConfigsModelService.updateVolumeData","Configs.ConfigsModelService.updateOracleParam","Configs.ConfigsModelService.getFolderByVolumeName"],"mappings":"AAAA,yCAAyC;AACzC,uCAAuC;AACvC,IAAO,OAAO,CAoKb;AApKD,WAAO,OAAO,EAAA,CAAC;IAiCXA,aAAaA;IAChBA,uBAAuBA,IAAYA;QAClCC,IAAIA,MAAMA,GAAGA,IAAIA,CAACA;QAClBA,IAAIA,MAAMA,GAAEA,CAACA,GAAGA,EAAEA,IAAIA,EAAEA,IAAIA,EAAEA,IAAIA,EAAEA,IAAIA,EAAEA,IAAIA,CAACA,CAACA;QAChDA,IAAIA,KAAKA,GAACA,CAACA,CAACA;QACZA,OAAMA,MAAMA,IAAIA,IAAIA,EAACA,CAACA;YACrBA,MAAMA,GAAGA,MAAMA,GAACA,IAAIA,CAACA;YACrBA,KAAKA,EAAGA,CAACA;QACVA,CAACA;QACDA,MAAMA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,KAAKA,CAACA,CAACA;IAC1CA,CAACA;IAEDD,sBAAsBA,MAAaA;QAClCE,MAAMA,CAACA,iBAAiBA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA;QAC1DA,MAAMA,CAACA,gBAAgBA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,CAACA,QAAQA,CAACA,CAACA;QAC1DA,MAAMA,CAACA,UAAUA,CAACA,GAAGA,KAAKA,CAACA;QAE3BA,OAAOA,CAACA,OAAOA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,UAACA,KAAKA;YACnCA,KAAKA,CAACA,gBAAgBA,CAACA,GAAGA,aAAaA,CAACA,KAAKA,CAACA,QAAQA,CAACA,CAACA;YACxDA,KAAKA,CAACA,eAAeA,CAACA,GAAGA,aAAaA,CAACA,KAAKA,CAACA,aAAaA,CAACA,CAACA;YAC5DA,KAAKA,CAACA,UAAUA,CAACA,GAAGA,KAAKA,CAACA;QAC3BA,CAACA,CAACA,CAAAA;IACHA,CAACA;IAEDF,uBAA8BA,OAAqBA;QAClDG,OAAOA,CAACA,OAAOA,CAACA,OAAOA,EAAEA,UAACA,MAAMA;YAC/BA,YAAYA,CAACA,MAAMA,CAACA,CAACA;QACtBA,CAACA,CAACA,CAAAA;IACHA,CAACA;IAJeH,qBAAaA,gBAI5BA,CAAAA;IAEDA,uBAAuBA,MAAaA,EAAEA,MAAaA;QAClDI,MAAMA,CAACA,MAAMA,CAACA,EAAEA,IAAIA,MAAMA,CAACA,EAAEA,IAAIA,MAAMA,CAACA,IAAIA,IAAIA,MAAMA,CAACA,IAAIA,CAACA;IAC7DA,CAACA;IAEDJ;;MAEEA;IACFA,qBAA4BA,MAAaA,EAAEA,KAAWA;QACrDK,GAAGA,CAAAA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,MAAMA,CAACA,KAAKA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAACA,CAACA;YAC5CA,IAAIA,KAAKA,GAAGA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA;YAC5BA,EAAEA,CAAAA,CAACA,aAAaA,CAACA,KAAKA,EAAEA,KAAKA,CAACA,CAACA,CAAAA,CAACA;gBAC/BA,MAAMA,CAACA,KAAKA,CAACA,MAAMA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;gBAC1BA,KAAKA,CAACA;YACPA,CAACA;QACFA,CAACA;IACFA,CAACA;IAReL,mBAAWA,cAQ1BA,CAAAA;IAEDA;;MAEEA;IACFA,kBAAyBA,MAAaA,EAAEA,KAAWA;QAClDM,EAAEA,CAAAA,CAACA,KAAKA,IAAIA,IAAIA,IAAIA,KAAKA,IAAIA,SAASA,CAACA;YACtCA,MAAMA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA;IAC3BA,CAACA;IAHeN,gBAAQA,WAGvBA,CAAAA;IAEDA;QAMCO;YALOC,YAAOA,GAAgBA,EAAEA,CAACA;YAC1BA,gBAAWA,GAAqBA,EAAEA,CAACA;YACnCA,eAAUA,GAAcA,EAAEA,CAACA;YAC3BA,oBAAeA,GAAeA,EAAEA,CAACA;YAGvCA,IAAIA,CAACA,aAAaA,EAAEA,CAACA;QACtBA,CAACA;QAEMD,2CAAaA,GAApBA;YACCE,IAAIA,CAACA,gBAAgBA,EAAEA,CAACA;YACxBA,IAAIA,CAACA,iBAAiBA,EAAEA,CAACA;YACzBA,wBAAwBA;QACzBA,CAACA;QACSF,8CAAgBA,GAAvBA;YACCG,IAAIA,MAAMA,GAACA,IAAIA,CAACA;YAChBA,CAACA,CAACA,IAAIA,CAACA;gBACTA,KAAKA,EAAEA,KAAKA;gBACZA,IAAIA,EAAGA,MAAMA;gBACbA,GAAGA,EAAGA,+BAA+BA;gBACrCA,OAAOA,EAAGA,UAASA,IAAIA;oBACnB,EAAE,CAAA,CAAC,IAAI,CAAC,CAAA,CAAC;wBACR,MAAM,GAAG,IAAI,CAAC;oBAClB,CAAC;gBACF,CAAC;aACDA,CAACA,CAACA;YACHA,IAAIA,CAACA,OAAOA,GAAEA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,CAACA;YAC9BA,aAAaA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;QAChCA,CAACA;QAEDH;;;;;;;;;;;;;;WAcGA;QAEIA,+CAAiBA,GAAxBA;YACCI,IAAIA,MAAMA,GAACA,IAAIA,CAACA;YAChBA,CAACA,CAACA,IAAIA,CAACA;gBACNA,KAAKA,EAAEA,KAAKA;gBACZA,IAAIA,EAAGA,MAAMA;gBACbA,GAAGA,EAAGA,+BAA+BA;gBACrCA,OAAOA,EAAGA,UAASA,IAAIA;oBACnB,EAAE,CAAA,CAAC,IAAI,CAAC,CAAA,CAAC;wBACR,MAAM,GAAG,IAAI,CAAC;oBAClB,CAAC;gBACF,CAAC;aACDA,CAACA,CAACA;YACHA,IAAIA,CAACA,WAAWA,GAAGA,MAAMA,CAACA;QAC3BA,CAACA;QAEMJ,mDAAqBA,GAA5BA,UAA6BA,IAAYA;YACxCK,EAAEA,CAAAA,CAACA,IAAIA,CAACA,OAAOA,KAAGA,IAAIA,CAACA;gBACtBA,MAAMA,CAACA,IAAIA,CAACA;YACbA,GAAGA,CAAAA,CAACA,GAAGA,CAAEA,CAACA,GAACA,CAACA,EAAEA,CAACA,GAAEA,IAAIA,CAACA,OAAOA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAACA,CAACA;gBAC1CA,EAAEA,CAAAA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,IAAIA,CAACA;oBAChCA,MAAMA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA,CAACA,CAACA,MAAMA,CAACA;YAChCA,CAACA;QACFA,CAACA;QACFL,0BAACA;IAADA,CAACA,AAtEDP,IAsECA;IAtEYA,2BAAmBA,sBAsE/BA,CAAAA;IAEEA,eAAOA,CAACA,OAAOA,CAACA,cAAcA,EAAEA,CAACA,YAAYA,EAAEA,OAAOA,EAAEA,WAAWA,EAAEA,WAAWA,EAAEA,UAACA,UAAUA,EAAEA,KAAKA,EAAEA,SAASA,EAAEA,SAASA;YACzHA,IAAIA,MAAMA,GAAGA,IAAIA,mBAAmBA,EAAEA,CAACA;YACvCA,MAAMA,CAACA,MAAMA,CAACA;QACfA,CAACA,CAACA,CAACA,CAACA;AACRA,CAACA,EApKM,OAAO,KAAP,OAAO,QAoKb"}
|
|
@ -1,169 +1,185 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="customAlert.ts"/>
|
||||
module Configs{
|
||||
export function removeElementByValue(array:Array<any> ,value:any, key?:string ){
|
||||
if(key){
|
||||
for(var i=0; i<array.length; i++){
|
||||
if(array[i][key] === value){
|
||||
array.splice(i ,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(var i=0 ; i<array.length; i++){
|
||||
if(array[i] === value){
|
||||
array.splice(i ,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function removeElementsByValue(array: Array<any>, elements:Array<any>){
|
||||
angular.forEach(elements, (element) =>{
|
||||
removeElementByValue(array, element.value, element.key);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
对象的深拷贝
|
||||
*/
|
||||
|
||||
export function deepCopy(object) {
|
||||
var n,i;
|
||||
if (object instanceof Array) {
|
||||
n = [];
|
||||
for (i = 0; i < object.length; ++i) {
|
||||
n[i] = deepCopy(object[i]);
|
||||
}
|
||||
return n;
|
||||
|
||||
} else if (object instanceof Object) {
|
||||
n = {}
|
||||
for (i in object) {
|
||||
n[i] = deepCopy(object[i]);
|
||||
}
|
||||
return n;
|
||||
} else {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
export function downloadFile($scope, $http, url, fn?){
|
||||
$http.get(url, { responseType: 'arraybuffer'})
|
||||
.success( function(data, status, headers) {
|
||||
if(angular.isFunction(fn))
|
||||
fn();
|
||||
var octetStreamMime = 'application/octet-stream';
|
||||
var success = false;
|
||||
// Get the headers
|
||||
headers = headers();
|
||||
// Get the filename from the x-filename header or default to "服务列表"
|
||||
var filename = "服务文件";
|
||||
var params = headers['content-disposition'].split(";");
|
||||
for(var i = 0; i< params.length; i++){
|
||||
if(params[i].indexOf("filename") != -1){
|
||||
var tmp = params[i].split("=");
|
||||
if(tmp.length == 2)
|
||||
filename = tmp[1].replace(new RegExp("\"", "gm"),"");
|
||||
}
|
||||
}
|
||||
|
||||
// Determine the content type from the header or default to "application/octet-stream"
|
||||
var contentType = headers['content-type'] || octetStreamMime;
|
||||
try{
|
||||
// Try using msSaveBlob if supported
|
||||
console.log("Trying saveBlob method ...");
|
||||
var blob = new Blob([data], { type: contentType });
|
||||
if(navigator.msSaveBlob)
|
||||
navigator.msSaveBlob(blob, filename);
|
||||
else {
|
||||
// Try using other saveBlob implementations, if available
|
||||
var saveBlob = navigator["webkitSaveBlob"] || navigator["mozSaveBlob"] || navigator["saveBlob"];
|
||||
if(saveBlob === undefined) throw "Not supported";
|
||||
saveBlob(blob, filename);
|
||||
}
|
||||
console.log("saveBlob succeeded");
|
||||
success = true;
|
||||
} catch(ex){
|
||||
console.log("saveBlob method failed with the following exception:");
|
||||
console.log(ex);
|
||||
}
|
||||
if(!success){
|
||||
// Get the blob url creator
|
||||
var urlCreator = window.URL || window["webkitURL"] || window["mozURL"] || window["msURL"];
|
||||
if(urlCreator){
|
||||
// Try to use a download link
|
||||
var link = document.createElement('a');
|
||||
if('download' in link){
|
||||
// Try to simulate a click
|
||||
try{
|
||||
// Prepare a blob URL
|
||||
console.log("Trying download link method with simulated click ...");
|
||||
var blob = new Blob([data], { type: contentType });
|
||||
var url = urlCreator.createObjectURL(blob);
|
||||
link.setAttribute('href', url);
|
||||
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
|
||||
link.setAttribute("download", filename);
|
||||
// Simulate clicking the download link
|
||||
var event = document.createEvent('MouseEvents');
|
||||
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
link.dispatchEvent(event);
|
||||
console.log("Download link method with simulated click succeeded");
|
||||
success = true;
|
||||
}catch(ex) {
|
||||
console.log("Download link method with simulated click failed with the following exception:");
|
||||
console.log(ex);
|
||||
}
|
||||
module Configs {
|
||||
export function removeElementByValue(array: Array < any > , value: any, key ? : string) {
|
||||
if (key) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (array[i][key] === value) {
|
||||
array.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
if(!success){
|
||||
// Fallback to window.location method
|
||||
try{
|
||||
// Prepare a blob URL
|
||||
// Use application/octet-stream when using window.location to force download
|
||||
console.log("Trying download link method with window.location ...");
|
||||
var blob = new Blob([data], { type: octetStreamMime });
|
||||
var url = urlCreator.createObjectURL(blob);
|
||||
window.location = url;
|
||||
console.log("Download link method with window.location succeeded");
|
||||
success = true;
|
||||
}catch(ex){
|
||||
console.log("Download link method with window.location failed with the following exception:");
|
||||
console.log(ex);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (array[i] === value) {
|
||||
array.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!success){
|
||||
// Fallback to window.open method
|
||||
console.log("No methods worked for saving the arraybuffer, using last resort window.open");
|
||||
window.open('_blank', '');
|
||||
Configs.customAlert("提示", "文件下载失败", '',null, 0, "error");
|
||||
}
|
||||
}).error(function(data, status) {
|
||||
console.log("Request failed with status: " + status);
|
||||
// Optionally write the error out to scope
|
||||
fn();
|
||||
Configs.customAlert("提示", "文件下载失败", '',null, 0, "error");
|
||||
$scope.errorDetails = "Request failed with status: " + status;
|
||||
}
|
||||
}
|
||||
|
||||
export function removeElementsByValue(array: Array < any > , elements: Array < any > ) {
|
||||
angular.forEach(elements, (element) => {
|
||||
removeElementByValue(array, element.value, element.key);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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("accept", "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
if(isMultiple)
|
||||
inputObj.setAttribute("multiple", "multiple");
|
||||
document.body.appendChild(inputObj);
|
||||
inputObj.click();
|
||||
inputObj.onchange = (element) =>{
|
||||
fn(element.target["files"]);
|
||||
var my = document.getElementById("myFileInput");
|
||||
if(null != my)
|
||||
document.body.removeChild(my);
|
||||
}
|
||||
/**
|
||||
对象的深拷贝
|
||||
*/
|
||||
|
||||
export function deepCopy(object) {
|
||||
var n, i;
|
||||
if (object instanceof Array) {
|
||||
n = [];
|
||||
for (i = 0; i < object.length; ++i) {
|
||||
n[i] = deepCopy(object[i]);
|
||||
}
|
||||
return n;
|
||||
|
||||
} else if (object instanceof Object) {
|
||||
n = {}
|
||||
for (i in object) {
|
||||
n[i] = deepCopy(object[i]);
|
||||
}
|
||||
return n;
|
||||
} else {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
export function downloadFile($scope, $http, url, fileName, fn ? ) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.responseType = "blob";
|
||||
xhr.onload = function() {
|
||||
if (this.status == 200) {
|
||||
var blob = this.response;
|
||||
var octetStreamMime = 'application/octet-stream';
|
||||
// Get the filename from the x-filename header or default to "服务列表"
|
||||
var filename = fileName;
|
||||
// Determine the content type from the header or default to "application/octet-stream"
|
||||
var contentType = octetStreamMime;
|
||||
// Get the blob url creator
|
||||
var urlCreator = window.URL || window["webkitURL"] || window["mozURL"] || window["msURL"];
|
||||
if (urlCreator) {
|
||||
// Try to use a download link
|
||||
var link = document.createElement('a');
|
||||
if ('download' in link) {
|
||||
// Try to simulate a click
|
||||
try {
|
||||
// Prepare a blob URL
|
||||
console.log("Trying download link method with simulated click ...");
|
||||
|
||||
var url = urlCreator.createObjectURL(blob);
|
||||
link.setAttribute('href', url);
|
||||
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
|
||||
link.setAttribute("download", filename);
|
||||
// Simulate clicking the download link
|
||||
var event = document.createEvent('MouseEvents');
|
||||
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
link.dispatchEvent(event);
|
||||
console.log("Download link method with simulated click succeeded");
|
||||
Configs.customAlert("提示", "文件下载完成", '', null, 0, "success");
|
||||
} catch (ex) {
|
||||
console.log("Download link method with simulated click failed with the following exception:");
|
||||
console.log(ex);
|
||||
Configs.customAlert("提示", "文件下载失败", '', null, 0, "error");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Fallback to window.open method
|
||||
console.log("No methods worked for saving the arraybuffer, using last resort window.open");
|
||||
window.open('_blank', '');
|
||||
Configs.customAlert("提示", "文件下载失败", '', null, 0, "error");
|
||||
}
|
||||
}
|
||||
if (angular.isFunction(fn))
|
||||
fn();
|
||||
}
|
||||
xhr.send();
|
||||
}
|
||||
// export function downloadFile($scope, $http, url, fn ? ) {
|
||||
// $http.get(url, { responseType: 'arraybuffer' }).then(function successCallback(response) {
|
||||
// $scope.names = response.data.sites;
|
||||
// }, function errorCallback(response) {
|
||||
// // 请求失败执行代码
|
||||
// });
|
||||
// .success(function(data, status, headers) {
|
||||
// var octetStreamMime = 'application/octet-stream';
|
||||
// var success = false;
|
||||
// // Get the headers
|
||||
// headers = headers();
|
||||
// // Get the filename from the x-filename header or default to "服务列表"
|
||||
// var filename = "服务文件";
|
||||
// var params = headers['content-disposition'].split(";");
|
||||
// for (var i = 0; i < params.length; i++) {
|
||||
// if (params[i].indexOf("filename") != -1) {
|
||||
// var tmp = params[i].split("=");
|
||||
// if (tmp.length == 2)
|
||||
// filename = tmp[1].replace(new RegExp("\"", "gm"), "");
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Determine the content type from the header or default to "application/octet-stream"
|
||||
// var contentType = octetStreamMime;
|
||||
|
||||
// // Get the blob url creator
|
||||
// var urlCreator = window.URL || window["webkitURL"] || window["mozURL"] || window["msURL"];
|
||||
// if (urlCreator) {
|
||||
// // Try to use a download link
|
||||
// var link = document.createElement('a');
|
||||
// if ('download' in link) {
|
||||
// // Try to simulate a click
|
||||
// try {
|
||||
// // Prepare a blob URL
|
||||
// console.log("Trying download link method with simulated click ...");
|
||||
// var blob = new Blob([data], { type: contentType });
|
||||
// var url = urlCreator.createObjectURL(blob);
|
||||
// link.setAttribute('href', url);
|
||||
// // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
|
||||
// link.setAttribute("download", filename);
|
||||
// // Simulate clicking the download link
|
||||
// var event = document.createEvent('MouseEvents');
|
||||
// event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
// link.dispatchEvent(event);
|
||||
// console.log("Download link method with simulated click succeeded");
|
||||
|
||||
// } catch (ex) {
|
||||
// console.log("Download link method with simulated click failed with the following exception:");
|
||||
// console.log(ex);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// // Fallback to window.open method
|
||||
// console.log("No methods worked for saving the arraybuffer, using last resort window.open");
|
||||
// window.open('_blank', '');
|
||||
// Configs.customAlert("提示", "文件下载失败", '', null, 0, "error");
|
||||
// }
|
||||
// }).error(function(data, status) {
|
||||
// console.log("Request failed with status: " + status);
|
||||
// // Optionally write the error out to scope
|
||||
// Configs.customAlert("提示", "文件下载失败", '', null, 0, "error");
|
||||
// $scope.errorDetails = "Request failed with status: " + status;
|
||||
// });
|
||||
// }
|
||||
|
||||
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("accept", "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
inputObj.setAttribute("accept", "application/sql");
|
||||
if (isMultiple)
|
||||
inputObj.setAttribute("multiple", "multiple");
|
||||
document.body.appendChild(inputObj);
|
||||
inputObj.click();
|
||||
inputObj.onchange = (element) => {
|
||||
fn(element.target["files"]);
|
||||
var my = document.getElementById("myFileInput");
|
||||
if (null != my)
|
||||
document.body.removeChild(my);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
var Configs;
|
||||
(function (Configs) {
|
||||
function customAlert(title, content, func, cancel, focus, icon) {
|
||||
/*
|
||||
自定义 alert框
|
||||
title :
|
||||
text :
|
||||
func :
|
||||
cancel:
|
||||
focus :
|
||||
icon :
|
||||
*/
|
||||
icon = "../../../new/images/msgbox_" + icon + ".png";
|
||||
create_mask();
|
||||
var temp = "<div class=\"custom-alert\" >"
|
||||
+ "<div class=\"custom-alert-title\">" + title + "</div>"
|
||||
+ "<table class=\"custom-alert-body\"><tr><td class=\"custom-alert-td\"><img src=\""
|
||||
+ icon + "\" class=\"custom-alert-img\"></td>"
|
||||
+ "<td ><div calss=\"custom-alert-content\">"
|
||||
+ content + "</div></td></tr></table>"
|
||||
+ "<div class=\"custom-alert-bottom\"><input type='button' "
|
||||
+ " class=\"custom-alert-ok\" value='确认' id=\"msgconfirmb\" onclick=\"Configs.remove();"
|
||||
+ func + ";\">";
|
||||
if (null != cancel) {
|
||||
temp += " <input type='button' class=\"custom-alert-cancel\" onClick='Configs.remove()'>";
|
||||
}
|
||||
temp += "</div></div>";
|
||||
create_msgbox(400, 200, temp);
|
||||
if (focus == 0 || focus == "0" || null == focus) {
|
||||
document.getElementById("msgconfirmb").focus();
|
||||
}
|
||||
else if (focus == 1 || focus == "1") {
|
||||
document.getElementById("msgcancelb").focus();
|
||||
}
|
||||
}
|
||||
Configs.customAlert = customAlert;
|
||||
function get_width() {
|
||||
return (document.body.clientWidth + document.body.scrollLeft);
|
||||
}
|
||||
function get_height() {
|
||||
return (document.body.clientHeight + document.body.scrollTop);
|
||||
}
|
||||
function get_left(w) {
|
||||
var bw = document.body.clientWidth;
|
||||
var bh = document.body.clientHeight;
|
||||
w = parseFloat(w);
|
||||
return (bw / 2 - w / 2 + document.body.scrollLeft);
|
||||
}
|
||||
function get_top(h) {
|
||||
var bw = document.body.clientWidth;
|
||||
var bh = document.body.clientHeight;
|
||||
h = parseFloat(h);
|
||||
return (bh / 2 - h / 2 + document.body.scrollTop);
|
||||
}
|
||||
function create_mask() {
|
||||
var mask = document.createElement("div");
|
||||
mask.id = "mask";
|
||||
mask.style.position = "absolute";
|
||||
mask.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=4,opacity=25)";
|
||||
mask.style.opacity = "0.4";
|
||||
mask.style.background = "black";
|
||||
mask.style.top = "0px";
|
||||
mask.style.left = "0px";
|
||||
mask.style.width = get_width() + "px";
|
||||
mask.style.height = get_height() + "px";
|
||||
mask.style.zIndex = "1000000000";
|
||||
document.body.appendChild(mask);
|
||||
}
|
||||
Configs.create_mask = create_mask;
|
||||
function create_msgbox(w, h, t) {
|
||||
var box = document.createElement("div");
|
||||
box.id = "msgbox";
|
||||
box.style.position = "absolute";
|
||||
box.style.width = w + "px";
|
||||
box.style.height = h + "px";
|
||||
box.style.overflow = "visible";
|
||||
box.innerHTML = t;
|
||||
box.style.zIndex = "1000000001";
|
||||
document.body.appendChild(box);
|
||||
re_pos();
|
||||
}
|
||||
function re_mask() {
|
||||
var mask = document.getElementById("mask");
|
||||
if (null == mask)
|
||||
return;
|
||||
mask.style.width = get_width() + "px";
|
||||
mask.style.height = get_height() + "px";
|
||||
}
|
||||
function re_pos() {
|
||||
var box = document.getElementById("msgbox");
|
||||
if (null != box) {
|
||||
var w = box.style.width;
|
||||
var h = box.style.height;
|
||||
box.style.left = get_left(w) + "px";
|
||||
box.style.top = get_top(h) + "px";
|
||||
}
|
||||
}
|
||||
function remove() {
|
||||
var mask = document.getElementById("mask");
|
||||
var msgbox = document.getElementById("msgbox");
|
||||
if (null == mask && null == msgbox)
|
||||
return;
|
||||
document.body.removeChild(mask);
|
||||
document.body.removeChild(msgbox);
|
||||
}
|
||||
Configs.remove = remove;
|
||||
function re_show() {
|
||||
re_pos();
|
||||
re_mask();
|
||||
}
|
||||
function load_func() {
|
||||
window.onresize = re_show;
|
||||
window.onscroll = re_show;
|
||||
}
|
||||
})(Configs || (Configs = {}));
|
||||
//# sourceMappingURL=customAlert.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"customAlert.js","sourceRoot":"","sources":["customAlert.ts"],"names":["Configs","Configs.customAlert","Configs.get_width","Configs.get_height","Configs.get_left","Configs.get_top","Configs.create_mask","Configs.create_msgbox","Configs.re_mask","Configs.re_pos","Configs.remove","Configs.re_show","Configs.load_func"],"mappings":"AAAA,yCAAyC;AACzC,IAAO,OAAO,CAwHb;AAxHD,WAAO,OAAO,EAAA,CAAC;IACdA,qBAA4BA,KAAKA,EAAEA,OAAOA,EAAEA,IAAIA,EAAEA,MAAMA,EAAEA,KAAKA,EAAEA,IAAIA;QACpEC;;;;;;;;UAQQA;QACFA,IAAIA,GAAGA,6BAA6BA,GAAGA,IAAIA,GAAGA,MAAMA,CAACA;QACrDA,WAAWA,EAAEA,CAACA;QACdA,IAAIA,IAAIA,GAAGA,+BAA+BA;cACvCA,oCAAoCA,GAAGA,KAAKA,GAAGA,QAAQA;cACvDA,mFAAmFA;cACnFA,IAAIA,GAAGA,qCAAqCA;cAC5CA,2CAA2CA;cAC3CA,OAAOA,GAAGA,0BAA0BA;cACpCA,0DAA0DA;cAC1DA,sFAAsFA;cACtFA,IAAIA,GAAGA,MAAMA,CAACA;QACjBA,EAAEA,CAACA,CAACA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA;YACjBA,IAAIA,IAAIA,kGAAkGA,CAACA;QAC/GA,CAACA;QACDA,IAAIA,IAAIA,cAAcA,CAACA;QAEvBA,aAAaA,CAACA,GAAGA,EAAEA,GAAGA,EAAEA,IAAIA,CAACA,CAACA;QAE9BA,EAAEA,CAACA,CAACA,KAAKA,IAAIA,CAACA,IAAIA,KAAKA,IAAIA,GAAGA,IAAIA,IAAIA,IAAIA,KAAKA,CAACA,CAACA,CAACA;YAC9CA,QAAQA,CAACA,cAAcA,CAACA,aAAaA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACnDA,CAACA;QAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,KAAKA,IAAIA,CAACA,IAAIA,KAAKA,IAAIA,GAAGA,CAACA,CAACA,CAACA;YACpCA,QAAQA,CAACA,cAAcA,CAACA,YAAYA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QAClDA,CAACA;IACLA,CAACA;IAjCYD,mBAAWA,cAiCvBA,CAAAA;IAEDA;QACIE,MAAMA,CAACA,CAACA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;IAClEA,CAACA;IAEDF;QACIG,MAAMA,CAACA,CAACA,QAAQA,CAACA,IAAIA,CAACA,YAAYA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA;IAClEA,CAACA;IAEDH,kBAAkBA,CAACA;QACfI,IAAIA,EAAEA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,CAACA;QACnCA,IAAIA,EAAEA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,YAAYA,CAACA;QACpCA,CAACA,GAAGA,UAAUA,CAACA,CAACA,CAACA,CAACA;QAClBA,MAAMA,CAACA,CAACA,EAAEA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;IACvDA,CAACA;IAEDJ,iBAAiBA,CAACA;QACdK,IAAIA,EAAEA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,CAACA;QACnCA,IAAIA,EAAEA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,YAAYA,CAACA;QACpCA,CAACA,GAAGA,UAAUA,CAACA,CAACA,CAACA,CAACA;QAClBA,MAAMA,CAACA,CAACA,EAAEA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA;IACtDA,CAACA;IAEDL;QACIM,IAAIA,IAAIA,GAAGA,QAAQA,CAACA,aAAaA,CAACA,KAAKA,CAACA,CAACA;QACzCA,IAAIA,CAACA,EAAEA,GAAGA,MAAMA,CAACA;QACjBA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,GAAGA,UAAUA,CAACA;QACjCA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,6DAA6DA,CAACA;QAClFA,IAAIA,CAACA,KAAKA,CAACA,OAAOA,GAAGA,KAAKA,CAACA;QAC3BA,IAAIA,CAACA,KAAKA,CAACA,UAAUA,GAAGA,OAAOA,CAACA;QAChCA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,GAAGA,KAAKA,CAACA;QACvBA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,GAAGA,KAAKA,CAACA;QACxBA,IAAIA,CAACA,KAAKA,CAACA,KAAKA,GAAGA,SAASA,EAAEA,GAAGA,IAAIA,CAACA;QACtCA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,UAAUA,EAAEA,GAAGA,IAAIA,CAACA;QACxCA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,YAAYA,CAACA;QACjCA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,CAACA;IACpCA,CAACA;IAbeN,mBAAWA,cAa1BA,CAAAA;IAEDA,uBAAuBA,CAACA,EAAEA,CAACA,EAAEA,CAACA;QAC1BO,IAAIA,GAAGA,GAAGA,QAAQA,CAACA,aAAaA,CAACA,KAAKA,CAACA,CAACA;QACxCA,GAAGA,CAACA,EAAEA,GAAGA,QAAQA,CAACA;QAClBA,GAAGA,CAACA,KAAKA,CAACA,QAAQA,GAAGA,UAAUA,CAACA;QAChCA,GAAGA,CAACA,KAAKA,CAACA,KAAKA,GAAGA,CAACA,GAAGA,IAAIA,CAACA;QAC3BA,GAAGA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,GAAGA,IAAIA,CAACA;QAC5BA,GAAGA,CAACA,KAAKA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC/BA,GAAGA,CAACA,SAASA,GAAGA,CAACA,CAACA;QAClBA,GAAGA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,YAAYA,CAACA;QAChCA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,CAACA,GAAGA,CAACA,CAACA;QAC/BA,MAAMA,EAAEA,CAACA;IACbA,CAACA;IAEDP;QACIQ,IAAIA,IAAIA,GAAGA,QAAQA,CAACA,cAAcA,CAACA,MAAMA,CAACA,CAACA;QAC3CA,EAAEA,CAACA,CAACA,IAAIA,IAAIA,IAAIA,CAACA;YAACA,MAAMA,CAACA;QACzBA,IAAIA,CAACA,KAAKA,CAACA,KAAKA,GAAGA,SAASA,EAAEA,GAAGA,IAAIA,CAACA;QACtCA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,UAAUA,EAAEA,GAAGA,IAAIA,CAACA;IAC5CA,CAACA;IAEDR;QACIS,IAAIA,GAAGA,GAAGA,QAAQA,CAACA,cAAcA,CAACA,QAAQA,CAACA,CAACA;QAC5CA,EAAEA,CAACA,CAACA,IAAIA,IAAIA,GAAGA,CAACA,CAACA,CAACA;YACdA,IAAIA,CAACA,GAAGA,GAAGA,CAACA,KAAKA,CAACA,KAAKA,CAACA;YACxBA,IAAIA,CAACA,GAAGA,GAAGA,CAACA,KAAKA,CAACA,MAAMA,CAACA;YACzBA,GAAGA,CAACA,KAAKA,CAACA,IAAIA,GAAGA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA;YACpCA,GAAGA,CAACA,KAAKA,CAACA,GAAGA,GAAGA,OAAOA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA;QACtCA,CAACA;IACLA,CAACA;IAEDT;QACIU,IAAIA,IAAIA,GAAGA,QAAQA,CAACA,cAAcA,CAACA,MAAMA,CAACA,CAACA;QAC3CA,IAAIA,MAAMA,GAAGA,QAAQA,CAACA,cAAcA,CAACA,QAAQA,CAACA,CAACA;QAC/CA,EAAEA,CAACA,CAACA,IAAIA,IAAIA,IAAIA,IAAIA,IAAIA,IAAIA,MAAMA,CAACA;YAACA,MAAMA,CAACA;QAC3CA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,CAACA;QAChCA,QAAQA,CAACA,IAAIA,CAACA,WAAWA,CAACA,MAAMA,CAACA,CAACA;IACtCA,CAACA;IANeV,cAAMA,SAMrBA,CAAAA;IAEDA;QACIW,MAAMA,EAAEA,CAACA;QACTA,OAAOA,EAAEA,CAACA;IACdA,CAACA;IAEDX;QACIY,MAAMA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;QAC1BA,MAAMA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC9BA,CAACA;AACLZ,CAACA,EAxHM,OAAO,KAAP,OAAO,QAwHb"}
|
|
@ -76,7 +76,7 @@ module Configs{
|
|||
Configs.create_mask(); //创建遮罩层
|
||||
Kubernetes.create_locadEffect("正在更新云盘信息,请稍等!"); //创建数据加载效果层
|
||||
var target = document.getElementById('loading')
|
||||
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
// spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
},
|
||||
complete: (XMLHttpRequest, textStatus) => {
|
||||
if(XMLHttpRequest.status == 200){
|
||||
|
@ -145,7 +145,7 @@ module Configs{
|
|||
Configs.create_mask(); //创建遮罩层
|
||||
Kubernetes.create_locadEffect("正在更新云盘信息,请稍等!"); //创建数据加载效果层
|
||||
var target = document.getElementById('loading')
|
||||
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
// spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
},
|
||||
complete: (XMLHttpRequest, textStatus) => {
|
||||
if(XMLHttpRequest.status == 200){
|
||||
|
|
|
@ -3,148 +3,227 @@
|
|||
/// <reference path="configsHelper.ts"/>
|
||||
/// <reference path="configsUtils.ts"/>
|
||||
|
||||
module Configs{
|
||||
module Configs {
|
||||
|
||||
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout","ConfigsModel",
|
||||
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel) => {
|
||||
$scope.model= ConfigsModel;
|
||||
$scope.model.updateOracleParam();
|
||||
$scope.submitted = false;
|
||||
|
||||
$scope.tableConfig={
|
||||
data: 'model.oracleParam',
|
||||
selectedItems: [],
|
||||
columnDefs: [{
|
||||
field: "name",
|
||||
displayName: "名称"
|
||||
},
|
||||
{
|
||||
field: "ip",
|
||||
displayName: "IP"
|
||||
},
|
||||
{
|
||||
field: "port",
|
||||
displayName: "端口号"
|
||||
},
|
||||
{
|
||||
field: "user",
|
||||
displayName: "用户名"
|
||||
},
|
||||
{
|
||||
field: "password",
|
||||
displayName: "密码"
|
||||
},
|
||||
{
|
||||
field: "databaseName",
|
||||
displayName: "服务名"
|
||||
},
|
||||
{
|
||||
field: "tableName",
|
||||
displayName: "表空间名"
|
||||
},
|
||||
{
|
||||
field: "suffix",
|
||||
displayName: "表后缀"
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
displayName: "标准表汇总库",
|
||||
cellTemplate: $templateCache.get("strandColumn.html")
|
||||
},
|
||||
{
|
||||
field: "entity",
|
||||
displayName: "操作",
|
||||
cellTemplate: $templateCache.get("tableEdit.html")
|
||||
}],
|
||||
enableRowClickSelection: false,
|
||||
showSelectionCheckbox: false,
|
||||
multiSelect: false,
|
||||
sortInfo: {
|
||||
sortBy: "name",
|
||||
ascending: true
|
||||
}
|
||||
}
|
||||
|
||||
shareInit($scope, $location, $routeParams);
|
||||
|
||||
$scope.create = () =>{
|
||||
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "ConfigsModel", "DataModel", "$modal",
|
||||
($scope, $templateCache: ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel, DataModel, $modal) => {
|
||||
$scope.model = ConfigsModel;
|
||||
$scope.model.updateOracleParam();
|
||||
$scope.submitted = false;
|
||||
$scope.add= true;
|
||||
$scope.edit = false;
|
||||
$scope.tableForm = {};
|
||||
$scope.tableForm["id"]=0;
|
||||
$scope.tableForm["type"]=0;
|
||||
$scope.tableForm["name"]='请输入2-20个字符的数据名称';
|
||||
$scope.tableForm["ip"]='oracle的IP,例如:0.0.0.0';
|
||||
$scope.tableForm["port"]='oracle的的端口,1~65535';
|
||||
$scope.tableForm["user"]='oracle的用户名,2-15个字母、数字或下划线';
|
||||
$scope.tableForm["password"]='oracle的密码,2-15个字母、数字或下划线';
|
||||
$scope.tableForm["databaseName"]='oracle的实例名,1-10个字母,例如ORCL';
|
||||
$scope.tableForm["tableName"]='oracle的表空间名,1-15个字母、数字或下划线';
|
||||
$scope.tableForm["suffix"]='汇总生成新表的后缀名,1-10个字母、数字或下划线';
|
||||
}
|
||||
$scope.submittedCreateDatabase = false;
|
||||
$scope.DataModel = DataModel;
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.tableForm =null;
|
||||
$scope.add = false;
|
||||
$scope.edit = false;
|
||||
$scope.submitted = false;
|
||||
}
|
||||
|
||||
$scope.onSubmit = (oracle) => {
|
||||
if($scope.tableForm["name"]=='请输入2-20个字符的数据名称')
|
||||
$scope.tableForm["name"]='';
|
||||
if($scope.tableForm["ip"]=='oracle的IP,例如:0.0.0.0')
|
||||
$scope.tableForm["ip"]='';
|
||||
if($scope.tableForm["port"]=='oracle的的端口,1~65535')
|
||||
$scope.tableForm["port"]='';
|
||||
if($scope.tableForm["user"]=='oracle的用户名,2-15个字母、数字或下划线')
|
||||
$scope.tableForm["user"]='';
|
||||
if($scope.tableForm["password"]=='oracle的密码,2-15个字母、数字或下划线')
|
||||
$scope.tableForm["password"]='';
|
||||
if($scope.tableForm["databaseName"]=='oracle的实例名,1-10个字母,例如ORCL')
|
||||
$scope.tableForm["databaseName"]='';
|
||||
if($scope.tableForm["tableName"]=='oracle的表空间名,1-15个字母、数字或下划线')
|
||||
$scope.tableForm["tableName"]='';
|
||||
if($scope.tableForm["suffix"]=='汇总生成新表的后缀名,1-10个字母、数字或下划线')
|
||||
$scope.tableForm["suffix"]='';
|
||||
console.log(ConfigsModel.oracleParam);
|
||||
console.log("Configs00000000");
|
||||
|
||||
|
||||
if($scope.validForm.$valid && $scope.validForm.$dirty){
|
||||
$scope.edit = false;
|
||||
$scope.add = false;
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.UPDATE, oracle, (result, status) => {
|
||||
if(status===200){
|
||||
$scope.model.updateOracleParam();
|
||||
}else{
|
||||
throw "资源请求失败";
|
||||
$scope.tableConfig = {
|
||||
data: 'model.oracleParam',
|
||||
selectedItems: [],
|
||||
columnDefs: [{
|
||||
field: "name",
|
||||
displayName: "名称"
|
||||
},
|
||||
{
|
||||
field: "ip",
|
||||
displayName: "IP"
|
||||
},
|
||||
{
|
||||
field: "port",
|
||||
displayName: "端口号"
|
||||
},
|
||||
{
|
||||
field: "user",
|
||||
displayName: "用户名"
|
||||
},
|
||||
{
|
||||
field: "password",
|
||||
displayName: "密码"
|
||||
},
|
||||
{
|
||||
field: "databaseName",
|
||||
displayName: "服务名"
|
||||
},
|
||||
{
|
||||
field: "tableName",
|
||||
displayName: "表空间名"
|
||||
},
|
||||
{
|
||||
field: "suffix",
|
||||
displayName: "用户名后缀"
|
||||
},
|
||||
{
|
||||
field: "type",
|
||||
displayName: "标准表汇总库",
|
||||
cellTemplate: $templateCache.get("strandColumn.html")
|
||||
|
||||
},
|
||||
{
|
||||
field: "entity",
|
||||
displayName: "操作",
|
||||
cellTemplate: $templateCache.get("tableEdit.html")
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$scope.submitted = true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.$on("editRow", (event, data) =>{
|
||||
$scope.submitted = false;
|
||||
$scope.tableForm = deepCopy(data);
|
||||
$scope.edit = true;
|
||||
$scope.add = false;
|
||||
//$scope.rowId = data.id
|
||||
//createNewObejct($scope.tableConfig.columnDefs, data);
|
||||
//removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
|
||||
}) ;
|
||||
|
||||
$scope.$on("deleteRow", (event, data) =>{
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.DELETE, data, (result, status) => {
|
||||
if(status===200){
|
||||
console.log("准备更新");
|
||||
$scope.model.updateOracleParam();
|
||||
}else{
|
||||
throw "资源请求失败";
|
||||
],
|
||||
enableRowClickSelection: false,
|
||||
showSelectionCheckbox: false,
|
||||
multiSelect: false,
|
||||
sortInfo: {
|
||||
sortBy: "name",
|
||||
ascending: true
|
||||
}
|
||||
}
|
||||
|
||||
shareInit($scope, $location, $routeParams);
|
||||
|
||||
$scope.create = () => {
|
||||
$scope.submitted = false;
|
||||
$scope.add = true;
|
||||
$scope.edit = false;
|
||||
$scope.createDatabase = false;
|
||||
$scope.tableForm = {};
|
||||
$scope.tableForm["id"] = 0;
|
||||
$scope.tableForm["type"] = 0;
|
||||
$scope.tableForm["name"] = '';
|
||||
$scope.tableForm["ip"] = '';
|
||||
$scope.tableForm["port"] = '';
|
||||
$scope.tableForm["user"] = '';
|
||||
$scope.tableForm["password"] = '';
|
||||
$scope.tableForm["databaseName"] = '';
|
||||
$scope.tableForm["tableName"] = '';
|
||||
$scope.tableForm["suffix"] = '';
|
||||
|
||||
}
|
||||
|
||||
$scope.createGatherDababase = () => {
|
||||
$scope.submittedCreateDatabase = false;
|
||||
|
||||
$scope.add = false;
|
||||
$scope.edit = false;
|
||||
$scope.createDatabase = true;
|
||||
|
||||
$scope.tableForm = {};
|
||||
|
||||
$scope.tableForm["dataVersion"] = 1;
|
||||
$scope.tableForm["systemName"] = '汇总库';
|
||||
$scope.tableForm["startTime"] = '';
|
||||
$scope.tableForm["endTime"] = '';
|
||||
$scope.tableForm["contact"] = '';
|
||||
$scope.tableForm["phone"] = '';
|
||||
$scope.tableForm["encoding"] = 'UTF8';
|
||||
|
||||
}
|
||||
$scope.cancel = () => {
|
||||
$scope.tableForm = null;
|
||||
$scope.add = false;
|
||||
$scope.edit = false;
|
||||
$scope.submitted = false;
|
||||
}
|
||||
$scope.cancelCreateDatabase = () => {
|
||||
$scope.tableForm = null;
|
||||
$scope.createDatabase = false;
|
||||
|
||||
$scope.submittedCreateDatabase = false;
|
||||
}
|
||||
$scope.onSubmit = (oracle) => {
|
||||
if ($scope.tableForm["name"] == '请输入2-20个字符的数据名称')
|
||||
$scope.tableForm["name"] = '';
|
||||
if ($scope.tableForm["ip"] == 'oracle的IP,例如:0.0.0.0')
|
||||
$scope.tableForm["ip"] = '';
|
||||
if ($scope.tableForm["port"] == 'oracle的的端口,1~65535')
|
||||
$scope.tableForm["port"] = '';
|
||||
if ($scope.tableForm["user"] == 'oracle的用户名,2-15个字母、数字或下划线')
|
||||
$scope.tableForm["user"] = '';
|
||||
if ($scope.tableForm["password"] == 'oracle的密码,2-15个字母、数字或下划线')
|
||||
$scope.tableForm["password"] = '';
|
||||
if ($scope.tableForm["databaseName"] == 'oracle的实例名,1-10个字母,例如ORCL')
|
||||
$scope.tableForm["databaseName"] = '';
|
||||
if ($scope.tableForm["tableName"] == 'oracle的表空间名,1-15个字母、数字或下划线')
|
||||
$scope.tableForm["tableName"] = '';
|
||||
if ($scope.tableForm["suffix"] == '汇总生成新表的后缀名,1-10个字母、数字或下划线')
|
||||
$scope.tableForm["suffix"] = '';
|
||||
|
||||
if ($scope.validForm.$valid && $scope.validForm.$dirty) {
|
||||
$scope.edit = false;
|
||||
$scope.add = false
|
||||
console.log(oracle);
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.UPDATE, oracle, (result, status) => {
|
||||
|
||||
if (status == 200) {
|
||||
$scope.model.updateOracleParam();
|
||||
Configs.customAlert("提示", "汇总库更新成功", '', null, 0, "success");
|
||||
} else if (status == 400) {
|
||||
console.log(result);
|
||||
Configs.customAlert("提示", "汇总库更新失败,名称不能重复", '', null, 0, "error");
|
||||
} else {
|
||||
console.log(result);
|
||||
Configs.customAlert("提示", "汇总库配置失败: 系统异常!", '', null, 0, "error");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.submitted = true;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.onSubmitCreateDatabase = (oracle) => {
|
||||
|
||||
if ($scope.tableForm["systemName"] == '请输入2-20个字符的汇总库系统名称')
|
||||
$scope.tableForm["systemName"] = '';
|
||||
if ($scope.tableForm["startTime"] == '开始时间,格式为yyyy-MM 例如:2018-02')
|
||||
$scope.tableForm["startTime"] = '';
|
||||
if ($scope.tableForm["endTime"] == '结束时间,格式为yyyy-MM 例如:2018-02')
|
||||
$scope.tableForm["endTime"] = '';
|
||||
if ($scope.tableForm["contact"] == '联系人')
|
||||
$scope.tableForm["contact"] = '';
|
||||
if ($scope.tableForm["phone"] == '联系方式')
|
||||
$scope.tableForm["phone"] = '';
|
||||
|
||||
if ($scope.createDatabaseForm.$valid && $scope.createDatabaseForm.$dirty) {
|
||||
$scope.createDatabase = false;
|
||||
|
||||
console.log(oracle);
|
||||
Configs.customAlert("提示", "准备创建汇总库,请稍后前往数据管理页面查看创建的汇总库", '', null, 0, "success");
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.CREATE_DATABASE, oracle, (result, status) => {
|
||||
|
||||
if (status === 200) {
|
||||
Configs.customAlert("提示", "汇总库创建成功,请前往数据管理页面中启动创建的汇总库并查看参数在配置服务集群", '', null, 0, "success");
|
||||
} else {
|
||||
console.log(result);
|
||||
Configs.customAlert("提示", "汇总库创建失败!\n" + result.msg, '', null, 0, "error");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$scope.submittedCreateDatabase = true;
|
||||
}
|
||||
}
|
||||
$scope.$on("editRow", (event, data) => {
|
||||
$scope.submitted = false;
|
||||
$scope.tableForm = deepCopy(data);
|
||||
$scope.edit = true;
|
||||
$scope.add = false;
|
||||
$scope.createDatabase = false;
|
||||
|
||||
//$scope.rowId = data.id
|
||||
//createNewObejct($scope.tableConfig.columnDefs, data);
|
||||
//removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
|
||||
});
|
||||
//removeElementByValue($scope.model, data._id, "_id");
|
||||
});
|
||||
}]);
|
||||
|
||||
$scope.$on("deleteRow", (event, data) => {
|
||||
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.DELETE, data, (result, status) => {
|
||||
if (status == 200) {
|
||||
$scope.model.updateOracleParam();
|
||||
Configs.customAlert("提示", "汇总库删除成功", '', null, 0, "success");
|
||||
} else {
|
||||
console.log(result);
|
||||
Configs.customAlert("提示", "汇总库配置失败: 系统异常!", '', null, 0, "error");
|
||||
}
|
||||
|
||||
});
|
||||
//removeElementByValue($scope.model, data._id, "_id");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
]);
|
||||
|
||||
|
||||
}
|
|
@ -5,342 +5,498 @@
|
|||
/// <reference path="../../configs/ts/customAlert.ts"/>
|
||||
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
|
||||
|
||||
module Configs{
|
||||
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
|
||||
$scope.editRow = (entity)=>{
|
||||
$scope.$emit('editRow', entity);
|
||||
}
|
||||
module Configs {
|
||||
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
|
||||
$scope.editRow = (entity) => {
|
||||
$scope.$emit('editRow', entity);
|
||||
}
|
||||
|
||||
$scope.deleteRowOne ={
|
||||
show: false,
|
||||
item: null,
|
||||
open: (entity) => {
|
||||
var deleteRowOne = $scope.deleteRowOne;
|
||||
deleteRowOne.show = true;
|
||||
deleteRowOne.item = entity;
|
||||
},
|
||||
onOk: () => {
|
||||
var deleteRowOne = $scope.deleteRowOne;
|
||||
$scope.$emit('deleteRow', deleteRowOne.item);
|
||||
},
|
||||
onCancel: () => {
|
||||
var deleteRowOne = $scope.deleteRowOne;
|
||||
deleteRowOne.show = false;
|
||||
deleteRowOne.item = null;
|
||||
}
|
||||
}
|
||||
}]);
|
||||
$scope.deleteRowOne = {
|
||||
show: false,
|
||||
item: null,
|
||||
open: (entity) => {
|
||||
var deleteRowOne = $scope.deleteRowOne;
|
||||
deleteRowOne.show = true;
|
||||
deleteRowOne.item = entity;
|
||||
},
|
||||
onOk: () => {
|
||||
var deleteRowOne = $scope.deleteRowOne;
|
||||
$scope.$emit('deleteRow', deleteRowOne.item);
|
||||
},
|
||||
onCancel: () => {
|
||||
var deleteRowOne = $scope.deleteRowOne;
|
||||
deleteRowOne.show = false;
|
||||
deleteRowOne.item = null;
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.submitted = false;
|
||||
$scope.status = $scope.ngDialogData.status;
|
||||
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.submitted = false;
|
||||
$scope.status = $scope.ngDialogData.status;
|
||||
|
||||
$scope. cancel = () =>{
|
||||
$scope.closeThisDialog();
|
||||
$scope.submitted = false;
|
||||
}
|
||||
$scope.cancel = () => {
|
||||
$scope.closeThisDialog();
|
||||
$scope.submitted = false;
|
||||
}
|
||||
|
||||
$scope.deleteBrock = (volume:volume, brock) => {
|
||||
if(volume.brick.length>1)
|
||||
deleteBrock(volume, brock);
|
||||
else
|
||||
$scope.showMessage = true;
|
||||
}
|
||||
$scope.deleteBrock = (volume: volume, brock) => {
|
||||
if (volume.brick.length > 1)
|
||||
deleteBrock(volume, brock);
|
||||
else
|
||||
$scope.showMessage = true;
|
||||
}
|
||||
|
||||
$scope.addBrock = (volume) => {
|
||||
var block = {
|
||||
ip: "", //存储块的机器ip地址
|
||||
path: "", //存储块路径
|
||||
status: false, //存储块的状态
|
||||
editable:true
|
||||
};
|
||||
addBrock(volume, block);
|
||||
$scope.showMessage = false;
|
||||
}
|
||||
$scope.addBrock = (volume) => {
|
||||
var block = {
|
||||
ip: "", //存储块的机器ip地址
|
||||
path: "", //存储块路径
|
||||
status: false, //存储块的状态
|
||||
editable: true
|
||||
};
|
||||
addBrock(volume, block);
|
||||
$scope.showMessage = false;
|
||||
}
|
||||
|
||||
$scope.stopVolume = (volume) =>{
|
||||
volume.status = false;
|
||||
}
|
||||
$scope.stopVolume = (volume) => {
|
||||
volume.status = false;
|
||||
}
|
||||
|
||||
$scope.startVolume = (volume) =>{
|
||||
volume.status = true;
|
||||
$scope.startVolume = (volume) => {
|
||||
volume.status = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$scope.onSubmit = (entity) => {
|
||||
console.log(entity);
|
||||
if($scope.volumeForm.$valid){
|
||||
$scope.$emit('update', entity);
|
||||
$scope.closeThisDialog();
|
||||
}else{
|
||||
$scope.submitted = true;
|
||||
}
|
||||
}
|
||||
}]);
|
||||
$scope.onSubmit = (entity) => {
|
||||
console.log(entity);
|
||||
if ($scope.volumeForm.$valid) {
|
||||
$scope.$emit('update', entity);
|
||||
$scope.closeThisDialog();
|
||||
} else {
|
||||
$scope.submitted = true;
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
|
||||
}]);
|
||||
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) => {}]);
|
||||
|
||||
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.content = "";
|
||||
getSqlContent();
|
||||
function getSqlContent(){
|
||||
$http({
|
||||
url: "/java/console/api/filePackage/readSqlFile",
|
||||
method:'POST',
|
||||
params: {type: $scope.ngDialogData.type},
|
||||
data: JSON.stringify($scope.ngDialogData.item)
|
||||
}).success(function(data,header,config,status){
|
||||
$scope.old_content = data.data1;
|
||||
//响应成功
|
||||
}).error(function(data,header,config,status){
|
||||
//处理响应失败
|
||||
$scope.old_content = "获取脚本内容失败"
|
||||
});
|
||||
}
|
||||
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.content = "";
|
||||
getSqlContent();
|
||||
|
||||
$scope.upLoadSqlFile = () => {
|
||||
if(typeof FileReader == 'undefined'){
|
||||
throw "浏览器不支持FileReader读取文件";
|
||||
}else{
|
||||
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;
|
||||
}
|
||||
function getSqlContent() {
|
||||
$http({
|
||||
url: "/java/console/api/filePackage/readSqlFile",
|
||||
method: 'POST',
|
||||
params: { type: $scope.ngDialogData.type },
|
||||
data: JSON.stringify($scope.ngDialogData.item)
|
||||
}).success(function(data, header, config, status) {
|
||||
$scope.old_content = data.data1;
|
||||
//响应成功
|
||||
}).error(function(data, header, config, status) {
|
||||
//处理响应失败
|
||||
$scope.old_content = "获取脚本内容失败"
|
||||
});
|
||||
}
|
||||
|
||||
fr.onloadstart = () =>{
|
||||
$scope.$apply(() =>{
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
});
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
}
|
||||
$scope.upLoadSqlFile = () => {
|
||||
if (typeof FileReader == 'undefined') {
|
||||
throw "浏览器不支持FileReader读取文件";
|
||||
} else {
|
||||
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.readAsText(file[0],"GBK");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
fr.onloadstart = () => {
|
||||
$scope.$apply(() => {
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
});
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
}
|
||||
|
||||
$scope.onOk = () => {
|
||||
$scope.enable = false;
|
||||
if(null == $scope.new_content || $scope.new_content == ""){
|
||||
console.log("上传的内容不能为空");
|
||||
$scope.closeThisDialog();
|
||||
}else{
|
||||
$scope.$emit("onOk",{
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.new_content,
|
||||
opt: "add",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}
|
||||
fr.readAsText(file[0], "GBK");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.enable = false;
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}]);
|
||||
$scope.onOk = () => {
|
||||
$scope.enable = false;
|
||||
if (null == $scope.new_content || $scope.new_content == "") {
|
||||
console.log("上传的内容不能为空");
|
||||
$scope.closeThisDialog();
|
||||
} else {
|
||||
$scope.$emit("onOk", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.new_content,
|
||||
opt: "add",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}
|
||||
|
||||
export var SqlAddController = controller('SqlAddController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.content = "";
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.sqlFileUpload = () =>{
|
||||
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 = () =>{
|
||||
$scope.$apply(() =>{
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
});
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
}
|
||||
|
||||
fr.readAsText(file[0],"GBK");
|
||||
}
|
||||
});
|
||||
}
|
||||
$scope.cancel = () => {
|
||||
$scope.enable = false;
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}]);
|
||||
|
||||
$scope.onOk = () => {
|
||||
$scope.enable = false;
|
||||
if(null ==$scope.content || $scope.content == ""){
|
||||
console.log("上传的内容不能为空");
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
else{
|
||||
$scope.$emit("onOk",{
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "add",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}
|
||||
export var SqlAddController = controller('SqlAddController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.content = "";
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.sqlFileUpload = () => {
|
||||
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;
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.enable = false;
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
}]);
|
||||
fr.onloadstart = () => {
|
||||
$scope.$apply(() => {
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
});
|
||||
$scope.content = "正在读取数据请稍等...";
|
||||
}
|
||||
|
||||
export var sqlVerificationController = controller('sqlVerificationController', ['$scope', '$http', ($scope, $http) => {
|
||||
getSqlContent();
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.replace = () => {
|
||||
$scope.$emit("replace", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "replace",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
function getSqlContent(){
|
||||
$http({
|
||||
url: "/java/console/api/filePackage/readSqlFile",
|
||||
method:'POST',
|
||||
params: {type: $scope.ngDialogData.type},
|
||||
data: JSON.stringify($scope.ngDialogData.item)
|
||||
}).success(function(data,header,config,status){
|
||||
$scope.standard = data.data1;
|
||||
$scope.unnormal = data.data2;
|
||||
//响应成功
|
||||
}).error(function(data,header,config,status){
|
||||
//处理响应失败
|
||||
$scope.unnormal = $scope.standard = "获取脚本内容失败";
|
||||
});
|
||||
}
|
||||
fr.readAsText(file[0], "GBK");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
//$scope.closeThisDialog();
|
||||
$scope.$emit("replace", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "delete",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}]);
|
||||
$scope.onOk = () => {
|
||||
$scope.enable = false;
|
||||
if (null == $scope.content || $scope.content == "") {
|
||||
console.log("上传的内容不能为空");
|
||||
$scope.closeThisDialog();
|
||||
} else {
|
||||
$scope.$emit("onOk", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "add",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}
|
||||
|
||||
export var sqlMoveController = controller("sqlMoveController", ['$scope', '$http', ($scope, $http) => {
|
||||
getSqlContent();
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.move = () => {
|
||||
$scope.$emit("replace", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "replace",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
$scope.cancel = () => {
|
||||
$scope.enable = false;
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}]);
|
||||
|
||||
function getSqlContent(){
|
||||
$http({
|
||||
url: "/java/console/api/filePackage/readSqlFile",
|
||||
method:'POST',
|
||||
params: {type: $scope.ngDialogData.type},
|
||||
data: JSON.stringify($scope.ngDialogData.item)
|
||||
}).success(function(data,header,config,status){
|
||||
$scope.content = data.data2;
|
||||
//响应成功
|
||||
}).error(function(data,header,config,status){
|
||||
//处理响应失败
|
||||
$scope.content = "获取脚本内容失败";
|
||||
});
|
||||
}
|
||||
}]);
|
||||
export var sqlVerificationController = controller('sqlVerificationController', ['$scope', '$http', ($scope, $http) => {
|
||||
getSqlContent();
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.replace = () => {
|
||||
$scope.$emit("replace", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "replace",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
export var sysVerUpdateController = controller('sysVerUpdateController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.checkboxItmes = [];
|
||||
$scope.click = ($event, name) => {
|
||||
if($event.target.checked){
|
||||
if($scope.checkboxItmes.indexOf(name) == -1)
|
||||
$scope.checkboxItmes.push(name)
|
||||
}
|
||||
else{
|
||||
for(var i= 0; i < $scope.checkboxItmes.length; i++){
|
||||
if($scope.checkboxItmes[i] === name){
|
||||
$scope.checkboxItmes.splice(i,1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function getSqlContent() {
|
||||
$http({
|
||||
url: "/java/console/api/filePackage/readSqlFile",
|
||||
method: 'POST',
|
||||
params: { type: $scope.ngDialogData.type },
|
||||
data: JSON.stringify($scope.ngDialogData.item)
|
||||
}).success(function(data, header, config, status) {
|
||||
$scope.standard = data.data1;
|
||||
$scope.unnormal = data.data2;
|
||||
//响应成功
|
||||
}).error(function(data, header, config, status) {
|
||||
//处理响应失败
|
||||
$scope.unnormal = $scope.standard = "获取脚本内容失败";
|
||||
});
|
||||
}
|
||||
|
||||
getData();
|
||||
$scope.cancel = () => {
|
||||
//$scope.closeThisDialog();
|
||||
$scope.$emit("replace", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "delete",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}]);
|
||||
|
||||
$scope.replace = () => {
|
||||
$scope.requestBody = $scope.data1;
|
||||
angular.forEach($scope.checkboxItmes, (item) => {
|
||||
$scope.requestBody[item] = $scope.data2[item];
|
||||
});
|
||||
$scope.$emit("updateRow", $scope.requestBody);
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
export var sqlMoveController = controller("sqlMoveController", ['$scope', '$http', ($scope, $http) => {
|
||||
getSqlContent();
|
||||
$scope.title = shareInit($scope.ngDialogData);
|
||||
$scope.move = () => {
|
||||
$scope.$emit("replace", {
|
||||
url: "/java/console/api/filePackage/handleSqlFile",
|
||||
item: $scope.ngDialogData.item,
|
||||
content: $scope.content,
|
||||
opt: "replace",
|
||||
type: $scope.ngDialogData.type
|
||||
});
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
$scope.cancel = () => {
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
function getData(){
|
||||
$http({
|
||||
url: "/java/console/api/checkout/findDetails",
|
||||
method:'POST',
|
||||
data: JSON.stringify($scope.ngDialogData)
|
||||
}).success(function(data,header,config,status){
|
||||
$scope.data1 = data.data1;
|
||||
$scope.data2 = data.data2;
|
||||
//响应成功
|
||||
}).error(function(data,header,config,status){
|
||||
//处理响应失败
|
||||
$scope.content = "获取脚本内容失败";
|
||||
});
|
||||
}
|
||||
}]);
|
||||
function getSqlContent() {
|
||||
$http({
|
||||
url: "/java/console/api/filePackage/readSqlFile",
|
||||
method: 'POST',
|
||||
params: { type: $scope.ngDialogData.type },
|
||||
data: JSON.stringify($scope.ngDialogData.item)
|
||||
}).success(function(data, header, config, status) {
|
||||
$scope.content = data.data2;
|
||||
//响应成功
|
||||
}).error(function(data, header, config, status) {
|
||||
//处理响应失败
|
||||
$scope.content = "获取脚本内容失败";
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
function shareInit(ngDialogData) {
|
||||
var title = "";
|
||||
if(ngDialogData.type != 'undefined'){
|
||||
switch (ngDialogData.type) {
|
||||
case "userTableStatus" :
|
||||
title = "UserTablespace";
|
||||
break;
|
||||
case "ckPayStatus":
|
||||
title = "Chechout_Pay"
|
||||
break;
|
||||
|
||||
case "ckIndicateStatus":
|
||||
title = "Chechout_Indicate"
|
||||
break;
|
||||
}
|
||||
}
|
||||
return title;
|
||||
}
|
||||
export var sysVerUpdateController = controller('sysVerUpdateController', ['$scope', '$http', ($scope, $http) => {
|
||||
$scope.checkboxItmes = [];
|
||||
$scope.click = ($event, name) => {
|
||||
if ($event.target.checked) {
|
||||
if ($scope.checkboxItmes.indexOf(name) == -1)
|
||||
$scope.checkboxItmes.push(name)
|
||||
} else {
|
||||
for (var i = 0; i < $scope.checkboxItmes.length; i++) {
|
||||
if ($scope.checkboxItmes[i] === name) {
|
||||
$scope.checkboxItmes.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getData();
|
||||
|
||||
$scope.replace = () => {
|
||||
$scope.requestBody = $scope.data1;
|
||||
angular.forEach($scope.checkboxItmes, (item) => {
|
||||
$scope.requestBody[item] = $scope.data2[item];
|
||||
});
|
||||
$scope.$emit("updateRow", $scope.requestBody);
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
function getData() {
|
||||
$http({
|
||||
url: "/java/console/api/checkout/findDetails",
|
||||
method: 'POST',
|
||||
data: JSON.stringify($scope.ngDialogData)
|
||||
}).success(function(data, header, config, status) {
|
||||
$scope.data1 = data.data1;
|
||||
$scope.data2 = data.data2;
|
||||
//响应成功
|
||||
}).error(function(data, header, config, status) {
|
||||
//处理响应失败
|
||||
$scope.content = "获取脚本内容失败";
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
export var dataExportController = controller("dataExportController", ['$scope', '$http', 'DataModel', 'ConfigsModel', ($scope, $http, DataModel: Developer.DataModelService, ConfigsModel: Configs.ConfigsModelService) => {
|
||||
|
||||
$scope.model = DataModel;
|
||||
|
||||
getUniqueData($scope);
|
||||
$scope.gatherOracles = ConfigsModel.oracleParam;
|
||||
// $scope.gatherOracles = ["2017汇总库"];
|
||||
$scope.export = [{ "type": 1, "exportName": "原始数据" }, { "type": 2, "exportName": "汇总库" }, { "type": 3, "exportName": "标准表抽取脚本" }];
|
||||
$scope.gatherOracleSelected = false;
|
||||
$scope.idList = [];
|
||||
$scope.typeList = [];
|
||||
$scope.selectGatherOracleName = "";
|
||||
$scope.gatherOracleList = [];
|
||||
$scope.flag = false;
|
||||
|
||||
|
||||
$scope.ischeckedId = function(id) {
|
||||
return $scope.idList.indexOf(id) >= 0;
|
||||
}
|
||||
$scope.selectId = function(id, event) {
|
||||
var action = event.target;
|
||||
if (action.checked) {
|
||||
if ($scope.idList.indexOf(id) == -1) {
|
||||
$scope.idList.push(id);
|
||||
return $scope.idList;
|
||||
}
|
||||
} else {
|
||||
var idx = $scope.idList.indexOf(id);
|
||||
if (idx != -1) {
|
||||
$scope.idList.splice(idx, 1);
|
||||
return $scope.idList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.ischeckedType = function(type) {
|
||||
|
||||
return $scope.typeList.indexOf(type) >= 0;
|
||||
}
|
||||
$scope.selectType = function(type, event) {
|
||||
var action = event.target;
|
||||
|
||||
|
||||
if (action.checked) {
|
||||
if (type == 2) {
|
||||
$scope.gatherOracleSelected = true;
|
||||
}
|
||||
|
||||
if ($scope.typeList.indexOf(type) == -1) {
|
||||
|
||||
$scope.typeList.push(type);
|
||||
return $scope.typeList;
|
||||
}
|
||||
} else {
|
||||
if (type == 2) {
|
||||
$scope.gatherOracleSelected = false;
|
||||
}
|
||||
var idx = $scope.typeList.indexOf(type);
|
||||
if (idx != -1) {
|
||||
$scope.typeList.splice(idx, 1);
|
||||
return $scope.typeList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.selectAll = function(flag) {
|
||||
if ($scope.flag) {
|
||||
flag = false;
|
||||
angular.forEach($scope.uniqueData, function(item, index) {
|
||||
$scope.idList.push(item.id);
|
||||
});
|
||||
return $scope.idList;
|
||||
} else {
|
||||
flag = true;
|
||||
$scope.idList = [];
|
||||
return $scope.idList;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.cancel = () => {
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
|
||||
$scope.onsubmit = (idList, typeList, selectGatherOracleName) => {
|
||||
if (!idList.length) {
|
||||
Configs.customAlert("提示", "请选择需要导出的数据", '', null, 0, "error");
|
||||
return;
|
||||
}
|
||||
if (!typeList.length) {
|
||||
Configs.customAlert("提示", "请选择需要导出的类型", '', null, 0, "error");
|
||||
return;
|
||||
}
|
||||
if ((selectGatherOracleName == undefined || selectGatherOracleName == "") && $scope.gatherOracleSelected) {
|
||||
Configs.customAlert("提示", "请选择汇总库汇总库", '', null, 0, "error");
|
||||
return;
|
||||
}
|
||||
// var idListStr="";
|
||||
// var typeListStr="";
|
||||
// var gatherOracleName="selectGatherOracleName";
|
||||
|
||||
// for( var id in idList){
|
||||
// idList
|
||||
// }
|
||||
|
||||
$scope.gatherOracleList.push(selectGatherOracleName);
|
||||
var exportDataFrom = {
|
||||
idList: idList,
|
||||
typeList: typeList,
|
||||
gatherOracleList: $scope.gatherOracleList,
|
||||
};
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
url: UrlHelpers.join("/java/console/api/oracle/exportData"),
|
||||
dataType: 'json',
|
||||
|
||||
// data: JSON.stringify({ "idList": idList, "typeList": typeList, "gatherOracleList": $scope.gatherOracleList }),
|
||||
data: JSON.stringify(exportDataFrom),
|
||||
|
||||
|
||||
success: (data) => {
|
||||
|
||||
Configs.customAlert("提示", "正在导出,查看详情请点击查看导出日志!", '', null, 0, "success");
|
||||
|
||||
},
|
||||
error: (data) => {
|
||||
Configs.customAlert("提示", "导出失败:" + data.responseText, '', null, 0, "error");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$scope.closeThisDialog();
|
||||
}
|
||||
}]);
|
||||
|
||||
function shareInit(ngDialogData) {
|
||||
var title = "";
|
||||
if (ngDialogData.type != 'undefined') {
|
||||
switch (ngDialogData.type) {
|
||||
case "userTableStatus":
|
||||
title = "UserTablespace";
|
||||
break;
|
||||
case "ckPayStatus":
|
||||
title = "Chechout_Pay"
|
||||
break;
|
||||
|
||||
case "ckIndicateStatus":
|
||||
title = "Chechout_Indicate"
|
||||
break;
|
||||
}
|
||||
}
|
||||
return title;
|
||||
}
|
||||
|
||||
function getUniqueData($scope) {
|
||||
var result;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
url: UrlHelpers.join("/java/console/api/getAllData"),
|
||||
dataType: 'json',
|
||||
|
||||
success: (data) => {
|
||||
$scope.uniqueData = data;
|
||||
result = data;
|
||||
return "success";
|
||||
},
|
||||
error: (data) => {
|
||||
|
||||
return "获取数据失败";
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
<div ng-controller="Developer.HomeController">
|
||||
<div class="jumbotron">
|
||||
<h1>Perspectives</h1>
|
||||
|
||||
<p>
|
||||
Please choose the perspective you would like to use:
|
||||
</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<p class="text-center">
|
||||
<a class="btn btn-lg btn-primary" href="/workspaces" role="button"
|
||||
title="Create or work on Projects">
|
||||
<i class="fa fa-tasks"></i>
|
||||
 Develop 禄
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p class="text-center">
|
||||
Work on projects and source code
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p class="text-center">
|
||||
<a class="btn btn-lg btn-primary" href="/namespaces" role="button"
|
||||
title="Look around the various Namespaces at running Pods and Services">
|
||||
<i class="fa fa-cubes"></i>
|
||||
Operate 禄
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p class="text-center">
|
||||
Manage and run Pods and Services
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -7,7 +7,6 @@
|
|||
<ul class="nav nav-tabs sj_nav_taps fl" ng-show="navbarItems.length">
|
||||
<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()}" />
|
||||
<a href="#" class="sj_search_btn" id="searchButton" ng-click="search()"></a>
|
||||
|
@ -19,7 +18,7 @@
|
|||
<div ng-show="model.data.length">
|
||||
<table class="table table-striped table-bordered sj_content_table" hawtio-simple-table="tableConfig" id="tableConfig"></table>
|
||||
<div class="row clear">
|
||||
<div class=" fl">
|
||||
<div class=" fl">
|
||||
<!--<input type="checkbox" class="fl mr5 " style="margin-top: 8px;" />
|
||||
<label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>-->
|
||||
<span class="pull-right"> </span>
|
||||
|
@ -31,7 +30,7 @@
|
|||
<i class="glyphicon glyphicon-export"></i> 迁移
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
<!-- <button style="background-image: -webkit-linear-gradient(top, #fdfdfd,rgb(19, 236, 116));" -->
|
||||
<!-- <button style="background-image: -webkit-linear-gradient(top, #fdfdfd,rgb(19, 236, 116));" -->
|
||||
<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>
|
||||
|
@ -67,7 +66,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" 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-change="change()" 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">
|
||||
|
@ -77,17 +76,22 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-hide="!volumes || volumes.length == 0">
|
||||
<!-- 迁移的时候不选择具体的存储位置,具体的存储位置自动选择 -->
|
||||
<!-- <div ng-hide="!volumes || volumes.length == 0"> -->
|
||||
<div ng-hide="1 == 1">
|
||||
<treecontrol class="tree-classic" tree-model="migrationClick.selectedItem.folder" options="treeOptions" on-selection="showSelected(node)" selected-node="selectNode">
|
||||
{{node.name}}
|
||||
</treecontrol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer ">
|
||||
<input class="btn btn-primary sj_btn_blue" type="submit" ng-disabled="!selectNode || selectNode.children.length <= 0" value="确定">
|
||||
<!-- <input class="btn btn-primary sj_btn_blue" type="submit" ng-disabled="!selectNode || selectNode.children.length <= 0" value="确定"> -->
|
||||
<input class="btn btn-primary sj_btn_blue" type="submit" value="确定">
|
||||
<button class="btn btn-warning cancel sj_btn_grey" type="button" ng-click="migrationClick.close()">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="prettify "></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
</script>
|
|
@ -0,0 +1,68 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="developerNavigation.ts"/>
|
||||
/// <reference path="developerHelpers.ts"/>
|
||||
var Developer;
|
||||
(function (Developer) {
|
||||
var log = Logger.get('developer-navigation');
|
||||
function createCurrentSubNavBar($scope, $location, $routeParams) {
|
||||
return Developer.activateCurrent([
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "cold/data-type/all"),
|
||||
label: "冷区数据管理",
|
||||
title: "数据汇总任务",
|
||||
items: [{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "cold/data-type/all"),
|
||||
label: "全部",
|
||||
title: "全部数据"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "cold/data-type/financial"),
|
||||
label: "财政",
|
||||
title: "财政数据"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview/", "cold/data-type/social-security"),
|
||||
label: "社保",
|
||||
title: "社保数据"
|
||||
}]
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "hot/data-type/all"),
|
||||
label: "热区数据管理",
|
||||
title: "查看所有数据",
|
||||
items: [{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "hot/data-type/all"),
|
||||
label: "全部",
|
||||
title: "全部数据"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "hot/data-type/financial"),
|
||||
label: "财政",
|
||||
title: "财政数据"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview/", "hot/data-type/social-security"),
|
||||
label: "社保",
|
||||
title: "社保数据"
|
||||
}]
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview/", "task/done"),
|
||||
label: "任务管理",
|
||||
title: "任务查看",
|
||||
items: [{
|
||||
href: UrlHelpers.join(Developer.context, "Overview", "task/done"),
|
||||
label: "已完成的任务",
|
||||
title: "已完成的迁移任务"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(Developer.context, "Overview/", "task/running"),
|
||||
label: "正在迁移的任务",
|
||||
title: "正在迁移的任务"
|
||||
}]
|
||||
},
|
||||
]);
|
||||
}
|
||||
Developer.createCurrentSubNavBar = createCurrentSubNavBar;
|
||||
})(Developer || (Developer = {}));
|
||||
//# sourceMappingURL=dataManagerHelper.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"dataManagerHelper.js","sourceRoot":"","sources":["dataManagerHelper.ts"],"names":["Developer","Developer.createCurrentSubNavBar"],"mappings":"AAAA,yCAAyC;AACzC,8CAA8C;AAC9C,2CAA2C;AAC3C,IAAO,SAAS,CA6Df;AA7DD,WAAO,SAAS,EAAA,CAAC;IACbA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA,GAAGA,CAACA,sBAAsBA,CAACA,CAACA;IAC7CA,gCAAuCA,MAAMA,EAAEA,SAASA,EAAEA,YAAYA;QACxEC,MAAMA,CAACA,yBAAeA,CAACA;YACtBA;gBACCA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,oBAAoBA,CAACA;gBAC9DA,KAAKA,EAAEA,QAAQA;gBACfA,KAAKA,EAAEA,QAAQA;gBACfA,KAAKA,EAAEA,CAACA;wBACLA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,oBAAoBA,CAACA;wBAC9DA,KAAKA,EAAEA,IAAIA;wBACXA,KAAKA,EAAEA,MAAMA;qBACbA;oBACDA;wBACAA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,0BAA0BA,CAACA;wBACnEA,KAAKA,EAAEA,IAAIA;wBACXA,KAAKA,EAAEA,MAAMA;qBACbA;oBACDA;wBACCA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,WAAWA,EAACA,gCAAgCA,CAACA;wBAC3EA,KAAKA,EAAEA,IAAIA;wBACXA,KAAKA,EAAEA,MAAMA;qBACbA,CAACA;aACJA;YACDA;gBACCA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,mBAAmBA,CAACA;gBAC7DA,KAAKA,EAAEA,QAAQA;gBACfA,KAAKA,EAAEA,QAAQA;gBACfA,KAAKA,EAAEA,CAACA;wBACJA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,mBAAmBA,CAACA;wBAC7DA,KAAKA,EAAEA,IAAIA;wBACXA,KAAKA,EAAEA,MAAMA;qBACdA;oBACDA;wBACCA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,yBAAyBA,CAACA;wBAClEA,KAAKA,EAAEA,IAAIA;wBACXA,KAAKA,EAAEA,MAAMA;qBACdA;oBACDA;wBACEA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,WAAWA,EAACA,+BAA+BA,CAACA;wBAC1EA,KAAKA,EAAEA,IAAIA;wBACXA,KAAKA,EAAEA,MAAMA;qBACbA,CAACA;aACLA;YACDA;gBACEA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,WAAWA,EAACA,WAAWA,CAACA;gBACtDA,KAAKA,EAAEA,MAAMA;gBACbA,KAAKA,EAAEA,MAAMA;gBACbA,KAAKA,EAAEA,CAACA;wBACLA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,UAAUA,EAACA,WAAWA,CAACA;wBACrDA,KAAKA,EAAEA,QAAQA;wBACfA,KAAKA,EAAEA,UAAUA;qBACjBA;oBACDA;wBACCA,IAAIA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,iBAAOA,EAACA,WAAWA,EAACA,cAAcA,CAACA;wBACzDA,KAAKA,EAAEA,SAASA;wBAChBA,KAAKA,EAAEA,SAASA;qBAChBA,CAACA;aACLA;SACDA,CAACA,CAACA;IACJA,CAACA;IA1DkBD,gCAAsBA,yBA0DxCA,CAAAA;AACFA,CAACA,EA7DM,SAAS,KAAT,SAAS,QA6Df"}
|
|
@ -1,243 +1,251 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="developerPlugin.ts"/>
|
||||
module Developer{
|
||||
export class OptionsParams{
|
||||
public pagerSizeOption = [20,50,100];
|
||||
public dataType =null;
|
||||
public currentTableSize = 20;
|
||||
public dataBatch = null;
|
||||
public labels = {};
|
||||
public currentPageNum = 1;
|
||||
public totalSize = null;
|
||||
public priorTableSize = 20;
|
||||
public keyQuery = null;
|
||||
public volumeType = 1;
|
||||
public totlePage = 1;
|
||||
module Developer {
|
||||
export class OptionsParams {
|
||||
public pagerSizeOption = [20, 50, 100];
|
||||
public dataType = null;
|
||||
public currentTableSize = 20;
|
||||
public dataBatch = null;
|
||||
public labels = {};
|
||||
public currentPageNum = 1;
|
||||
public totalSize = null;
|
||||
public priorTableSize = 20;
|
||||
public keyQuery = null;
|
||||
public volumeType = 1;
|
||||
public totlePage = 1;
|
||||
|
||||
public createParamData(){
|
||||
var extendValue =["cityName", "districtName", "dataVersion", "systemName", "dataYear"];
|
||||
var result={
|
||||
currentPageNum: this.currentPageNum,
|
||||
dataType: this.dataType,
|
||||
submittedBatch: this.dataBatch,
|
||||
limit: this.currentTableSize,
|
||||
priorTableSize: this.priorTableSize,
|
||||
keyQuery: this.keyQuery,
|
||||
volumeType: this.volumeType
|
||||
}
|
||||
public createParamData() {
|
||||
var extendValue = ["cityName", "districtName", "dataVersion", "systemName", "dataYear"];
|
||||
var result = {
|
||||
currentPageNum: this.currentPageNum,
|
||||
dataType: this.dataType,
|
||||
submittedBatch: this.dataBatch,
|
||||
limit: this.currentTableSize,
|
||||
priorTableSize: this.priorTableSize,
|
||||
keyQuery: this.keyQuery,
|
||||
volumeType: this.volumeType
|
||||
}
|
||||
|
||||
angular.forEach(this.labels,(value, key) =>{
|
||||
if(extendValue.indexOf(key))
|
||||
result[key] = value;
|
||||
});
|
||||
angular.forEach(this.labels, (value, key) => {
|
||||
if (extendValue.indexOf(key))
|
||||
result[key] = value;
|
||||
});
|
||||
console.log(result);
|
||||
console.log("参数");
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
public getPageSizeNum() {
|
||||
var num = Math.ceil(this.totalSize / this.currentTableSize);
|
||||
console.log(this.totalSize);
|
||||
if (num < this.currentPageNum)
|
||||
num = this.currentPageNum;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
public getPageSizeNum(){
|
||||
var num = Math.ceil(this.totalSize/this.currentTableSize);
|
||||
console.log(this.totalSize);
|
||||
if(num < this.currentPageNum)
|
||||
num = this.currentPageNum;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
function createLabel(cityName:string, districtName:string, systemName:string, version:string, year:string){
|
||||
return{
|
||||
cityName: cityName,
|
||||
districtName: districtName,
|
||||
systemName: systemName,
|
||||
version: "版本"+version,
|
||||
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;
|
||||
}
|
||||
function createLabel(cityName: string, districtName: string, systemName: string, version: string, year: string) {
|
||||
return {
|
||||
cityName: cityName,
|
||||
districtName: districtName,
|
||||
systemName: systemName,
|
||||
version: "版本" + version,
|
||||
year: year
|
||||
}
|
||||
}
|
||||
|
||||
function populateKey(item){
|
||||
var result = item;
|
||||
result["_key"] = createKey(item.regionalismCode, item.systemCode, item.dataVersion);
|
||||
return result;
|
||||
}
|
||||
function createAlias(cityName: string, districtName: string, systemName: string, version: string, year: string) {
|
||||
return cityName + "_" + districtName + "_" + systemName + "_" + year + "_版本" + version;
|
||||
}
|
||||
|
||||
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 createKey(regionalismCode, systemId, version) {
|
||||
return regionalismCode + "-" + systemId + "-" + version;
|
||||
}
|
||||
|
||||
function populateLabel(item){
|
||||
var result = item
|
||||
result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
|
||||
return result;
|
||||
}
|
||||
function populateKey(item) {
|
||||
var result = item;
|
||||
result["_key"] = createKey(item.regionalismCode, item.systemCode, item.dataVersion);
|
||||
return result;
|
||||
}
|
||||
|
||||
function populateLabels(items:Array<any>){
|
||||
var result = [];
|
||||
angular.forEach(items, (item) => {
|
||||
result.push(populateLabel(item));
|
||||
});
|
||||
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 populateKeys(items:Array<any>){
|
||||
var result =[];
|
||||
angular.forEach(items, (item) =>{
|
||||
result.push(populateKey(item));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function populateLabel(item) {
|
||||
var result = item
|
||||
result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
|
||||
return result;
|
||||
}
|
||||
|
||||
function createName(cityName, districtName){
|
||||
return cityName + "-" + districtName;
|
||||
}
|
||||
function populateLabels(items: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(items, (item) => {
|
||||
result.push(populateLabel(item));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function populateName(item){
|
||||
var result = item;
|
||||
result["name"] = createName(item.cityName, item.districtName);
|
||||
return result;
|
||||
}
|
||||
function populateKeys(items: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(items, (item) => {
|
||||
result.push(populateKey(item));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function populateNames(items:Array<any>){
|
||||
var result = [];
|
||||
angular.forEach(items, (item) =>{
|
||||
result.push(populateName(item));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function createName(cityName, districtName) {
|
||||
return cityName + "-" + districtName;
|
||||
}
|
||||
|
||||
function createParamData(options: OptionsParams){
|
||||
return options.createParamData();
|
||||
}
|
||||
function populateName(item) {
|
||||
var result = item;
|
||||
result["name"] = createName(item.cityName, item.districtName);
|
||||
return result;
|
||||
}
|
||||
|
||||
function formatTask(items:Array<any>){
|
||||
var result = [];
|
||||
angular.forEach(items, (item) => {
|
||||
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: tmp_batch,
|
||||
dataVersion: "版本"+item.dataVersion,
|
||||
dataYear: item.year
|
||||
}
|
||||
result.push(item);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function populateNames(items: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(items, (item) => {
|
||||
result.push(populateName(item));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export class DataModelService{
|
||||
public data:Array<any> = [];
|
||||
public paramOptions: OptionsParams = new OptionsParams();
|
||||
public transferTasks: Array<any> = [];
|
||||
public doneTask: Array<any> = [];
|
||||
public runningTask: Array<any> = [];
|
||||
function createParamData(options: OptionsParams) {
|
||||
return options.createParamData();
|
||||
}
|
||||
|
||||
constructor(){
|
||||
this.updateModel();
|
||||
}
|
||||
function formatTask(items: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(items, (item) => {
|
||||
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: tmp_batch,
|
||||
dataVersion: "版本" + item.dataVersion,
|
||||
dataYear: item.year
|
||||
}
|
||||
result.push(item);
|
||||
});
|
||||
// console.log(result);
|
||||
// console.log("formatTask");
|
||||
return result;
|
||||
}
|
||||
|
||||
//更新数据模型
|
||||
protected getDataModel(paramOptions){
|
||||
var result ;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type : "POST",
|
||||
url : "/java/console/api/data.json",
|
||||
dataType : 'json',
|
||||
data: createParamData(paramOptions),
|
||||
success : function(data) {
|
||||
result = data.data;
|
||||
paramOptions.totalSize = data.length;
|
||||
paramOptions.totlePage = data.page.totlePage;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
export class DataModelService {
|
||||
public data: Array < any > = [];
|
||||
public paramOptions: OptionsParams = new OptionsParams();
|
||||
public transferTasks: Array < any > = [];
|
||||
public doneTask: Array < any > = [];
|
||||
public runningTask: Array < any > = [];
|
||||
|
||||
public initParamOptions(){
|
||||
this.paramOptions = new OptionsParams();
|
||||
}
|
||||
constructor() {
|
||||
this.updateModel();
|
||||
}
|
||||
|
||||
public updateModel(){
|
||||
this.data = this.getDataModel(this.paramOptions);
|
||||
this.maybeFormat();
|
||||
}
|
||||
//更新数据模型
|
||||
protected getDataModel(paramOptions) {
|
||||
var result;
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
url: "/java/console/api/data.json",
|
||||
dataType: 'json',
|
||||
data: createParamData(paramOptions),
|
||||
success: function(data) {
|
||||
result = data.data;
|
||||
paramOptions.totalSize = data.length;
|
||||
paramOptions.totlePage = data.page.totlePage;
|
||||
}
|
||||
});
|
||||
console.log(result);
|
||||
console.log("getDataModel");
|
||||
return result;
|
||||
}
|
||||
|
||||
//格式数据模型中的每个单条记录
|
||||
public maybeFormat(){
|
||||
this.data = populateKeys(this.data);
|
||||
this.data = populateNames(this.data);
|
||||
this.data = populateLabels(this.data);
|
||||
this.data = createItemsAlias(this.data);
|
||||
}
|
||||
public initParamOptions() {
|
||||
this.paramOptions = new OptionsParams();
|
||||
}
|
||||
|
||||
//更新用户选择参数
|
||||
public updateParamOption(option:string, value:any){
|
||||
this.paramOptions[option] = value;
|
||||
}
|
||||
public updateModel() {
|
||||
this.data = this.getDataModel(this.paramOptions);
|
||||
this.maybeFormat();
|
||||
}
|
||||
|
||||
//根据key获取用户选择参数
|
||||
public getParamOption(key:string){
|
||||
return this.paramOptions[key];
|
||||
}
|
||||
//格式数据模型中的每个单条记录
|
||||
public maybeFormat() {
|
||||
this.data = populateKeys(this.data);
|
||||
this.data = populateNames(this.data);
|
||||
this.data = populateLabels(this.data);
|
||||
this.data = createItemsAlias(this.data);
|
||||
}
|
||||
|
||||
public startIntervalTask($interval, $http){
|
||||
var result;
|
||||
var timer = $interval(() => {
|
||||
this.doneTask = [];
|
||||
this.runningTask = [];
|
||||
$.ajax({
|
||||
async: true,
|
||||
type : "POST",
|
||||
url : "/java/console/api/task/transfer/list",
|
||||
success : function(data) {
|
||||
if(data){
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.transferTasks = formatTask(result);
|
||||
angular.forEach(this.transferTasks, (task) => {
|
||||
if(task.completeStatus == 2)
|
||||
this.doneTask.push(task);
|
||||
else
|
||||
this.runningTask.push(task);
|
||||
})
|
||||
},1500);
|
||||
//更新用户选择参数
|
||||
public updateParamOption(option: string, value: any) {
|
||||
this.paramOptions[option] = value;
|
||||
}
|
||||
|
||||
timer.then(() =>{
|
||||
console.log("Done!");
|
||||
}, () =>{
|
||||
console.log("error");
|
||||
}, () =>{
|
||||
console.log("每次都更新");
|
||||
});
|
||||
}
|
||||
}
|
||||
//根据key获取用户选择参数
|
||||
public getParamOption(key: string) {
|
||||
return this.paramOptions[key];
|
||||
}
|
||||
|
||||
//创建数据模型服务
|
||||
_module.factory("DataModel", ['$rootScope', '$http', '$interval', '$location', '$resource', ($rootScope, $http, $interval, $location, $resource) => {
|
||||
|
||||
var $scope = new DataModelService();
|
||||
$scope.startIntervalTask($interval, $http);
|
||||
return $scope;
|
||||
}]);
|
||||
public startIntervalTask($interval, $http) {
|
||||
var result;
|
||||
var timer = $interval(() => {
|
||||
this.doneTask = [];
|
||||
this.runningTask = [];
|
||||
$.ajax({
|
||||
async: true,
|
||||
type: "POST",
|
||||
url: "/java/console/api/task/transfer/list",
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
result = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.transferTasks = formatTask(result);
|
||||
angular.forEach(this.transferTasks, (task) => {
|
||||
if (task.completeStatus == 2)
|
||||
this.doneTask.push(task);
|
||||
else
|
||||
this.runningTask.push(task);
|
||||
})
|
||||
}, 1500);
|
||||
|
||||
timer.then(() => {
|
||||
console.log("Done!");
|
||||
}, () => {
|
||||
console.log("error");
|
||||
}, () => {
|
||||
console.log("每次都更新");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//创建数据模型服务
|
||||
_module.factory("DataModel", ['$rootScope', '$http', '$interval', '$location', '$resource', ($rootScope, $http, $interval, $location, $resource) => {
|
||||
|
||||
var $scope = new DataModelService();
|
||||
$scope.startIntervalTask($interval, $http);
|
||||
return $scope;
|
||||
}]);
|
||||
}
|
|
@ -0,0 +1,280 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts" />
|
||||
var Developer;
|
||||
(function (Developer) {
|
||||
Developer.context = '/workspaces';
|
||||
Developer.hash = '#' + Developer.context;
|
||||
Developer.pluginName = 'Developer';
|
||||
Developer.pluginPath = 'plugins/developer/';
|
||||
Developer.templatePath = Developer.pluginPath + 'html/';
|
||||
Developer.log = Logger.get(Developer.pluginName);
|
||||
Developer.jenkinsServiceName = "jenkins";
|
||||
Developer.jenkinsServiceNameAndPort = Developer.jenkinsServiceName + ":http";
|
||||
Developer.jenkinsHttpConfig = {
|
||||
headers: {
|
||||
Accept: "application/json, text/x-json, text/plain"
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Returns true if the value hasn't changed from the last cached JSON version of this object
|
||||
*/
|
||||
function hasObjectChanged(value, state) {
|
||||
var json = angular.toJson(value || "");
|
||||
var oldJson = state.json;
|
||||
state.json = json;
|
||||
return !oldJson || json !== oldJson;
|
||||
}
|
||||
Developer.hasObjectChanged = hasObjectChanged;
|
||||
function projectForScope($scope) {
|
||||
if ($scope) {
|
||||
return $scope.buildConfig || $scope.entity || ($scope.model || {}).project;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Developer.projectForScope = projectForScope;
|
||||
/**
|
||||
* Lets load the project versions for the given namespace
|
||||
*/
|
||||
function loadProjectVersions($scope, $element, project, env, ns, answer, caches) {
|
||||
var projectAnnotation = "project";
|
||||
var versionAnnotation = "version";
|
||||
var projectNamespace = project.$namespace;
|
||||
var projectName = project.$name;
|
||||
var cache = caches[ns];
|
||||
if (!cache) {
|
||||
cache = {};
|
||||
caches[ns] = cache;
|
||||
}
|
||||
var status = {
|
||||
rcs: [],
|
||||
pods: [],
|
||||
routes: [],
|
||||
services: []
|
||||
};
|
||||
var imageStreamTags = [];
|
||||
function updateModel() {
|
||||
var projectInfos = {};
|
||||
var model = $scope.model || {};
|
||||
angular.forEach(status.rcs, function (item) {
|
||||
var metadata = item.metadata || {};
|
||||
var name = metadata.name;
|
||||
var labels = metadata.labels || {};
|
||||
var annotations = metadata.annotations || {};
|
||||
var spec = item.spec || {};
|
||||
var selector = spec.selector;
|
||||
var project = labels[projectAnnotation];
|
||||
var version = labels[versionAnnotation];
|
||||
// lets try the S2I defaults...
|
||||
if (!project) {
|
||||
project = labels["app"];
|
||||
}
|
||||
if (!version) {
|
||||
version = annotations["openshift.io/deployment-config.latest-version"];
|
||||
}
|
||||
if (project && version && project === projectName) {
|
||||
var projects = projectInfos[project];
|
||||
if (!projects) {
|
||||
projects = {
|
||||
project: project,
|
||||
versions: {}
|
||||
};
|
||||
projectInfos[project] = projects;
|
||||
}
|
||||
var versionInfo = projects.versions[version];
|
||||
if (!versionInfo) {
|
||||
versionInfo = {
|
||||
replicationControllers: {}
|
||||
};
|
||||
projects.versions[version] = versionInfo;
|
||||
}
|
||||
if (name) {
|
||||
versionInfo.replicationControllers[name] = item;
|
||||
item.$name = name;
|
||||
if (projectNamespace && projectName) {
|
||||
item.$viewLink = UrlHelpers.join("/workspaces/", projectNamespace, "projects", projectName, "namespace", ns, "replicationControllers", name);
|
||||
}
|
||||
else {
|
||||
Developer.log.warn("Missing project data! " + projectNamespace + " name " + projectName);
|
||||
}
|
||||
item.$services = [];
|
||||
var rcLink = null;
|
||||
status.services.forEach(function (service) {
|
||||
var repSelector = Kubernetes.getSelector(item);
|
||||
var serviceSelector = Kubernetes.getSelector(service);
|
||||
if (serviceSelector && repSelector &&
|
||||
Kubernetes.selectorMatches(serviceSelector, repSelector) &&
|
||||
Kubernetes.getNamespace(service) === Kubernetes.getNamespace(item)) {
|
||||
status.routes.forEach(function (route) {
|
||||
var serviceName = Kubernetes.getName(service);
|
||||
if (serviceName === Kubernetes.getName(route)) {
|
||||
service["$route"] = route;
|
||||
service["$host"] = Core.pathGet(route, ["spec", "host"]);
|
||||
item.$services.push(service);
|
||||
if (!rcLink) {
|
||||
var url = Kubernetes.serviceLinkUrl(service, true);
|
||||
if (url) {
|
||||
// TODO find icon etc?
|
||||
rcLink = {
|
||||
name: serviceName,
|
||||
href: url
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
item["$serviceLink"] = rcLink;
|
||||
}
|
||||
item.$buildId = annotations["fabric8.io/build-id"] || item.$buildId;
|
||||
item.$buildUrl = annotations["fabric8.io/build-url"] || item.$buildUrl;
|
||||
item.$gitCommit = annotations["fabric8.io/git-commit"] || item.$gitCommit;
|
||||
item.$gitUrl = annotations["fabric8.io/git-url"] || item.$gitUrl;
|
||||
item.$gitBranch = annotations["fabric8.io/git-branch"] || item.$gitBranch;
|
||||
if (!item.$gitCommit) {
|
||||
var image = getImage(item);
|
||||
if (image) {
|
||||
if (!$scope.$isWatchImages) {
|
||||
$scope.$isWatchImages = true;
|
||||
Kubernetes.watch($scope, $element, "images", null, function (data) {
|
||||
imageStreamTags = data;
|
||||
checkForMissingMetadata();
|
||||
});
|
||||
}
|
||||
else {
|
||||
checkForMissingMetadata();
|
||||
}
|
||||
}
|
||||
function getImage(item) {
|
||||
var image = "";
|
||||
// lets see if we can find the commit id from a S2I image name
|
||||
// TODO needs this issue fixed to find it via an OpenShift annotation:
|
||||
// https://github.com/openshift/origin/issues/6241
|
||||
var containers = Core.pathGet(item, ["spec", "template", "spec", "containers"]);
|
||||
if (containers && containers.length) {
|
||||
var container = containers[0];
|
||||
if (container) {
|
||||
image = container.image;
|
||||
}
|
||||
}
|
||||
return image;
|
||||
}
|
||||
function checkForMissingMetadata() {
|
||||
angular.forEach(projects.versions, function (vi) {
|
||||
angular.forEach(vi.replicationControllers, function (item, name) {
|
||||
if (!item.$gitCommit) {
|
||||
var image = getImage(item);
|
||||
if (image) {
|
||||
angular.forEach(imageStreamTags, function (imageStreamTag) {
|
||||
var imageName = imageStreamTag.dockerImageReference;
|
||||
if (imageName && imageName === image) {
|
||||
var foundISTag = imageStreamTag;
|
||||
var manifestJSON = imageStreamTag.dockerImageManifest;
|
||||
if (manifestJSON) {
|
||||
var manifest = angular.fromJson(manifestJSON) || {};
|
||||
var history = manifest.history;
|
||||
if (history && history.length) {
|
||||
var v1 = history[0].v1Compatibility;
|
||||
if (v1) {
|
||||
var data = angular.fromJson(v1);
|
||||
var env = Core.pathGet(data, ["config", "Env"]);
|
||||
angular.forEach(env, function (envExp) {
|
||||
if (envExp) {
|
||||
var values = envExp.split("=");
|
||||
if (values.length === 2 && values[0] == "OPENSHIFT_BUILD_NAME") {
|
||||
var buildName = values[1];
|
||||
if (buildName) {
|
||||
item.$buildId = buildName;
|
||||
item.$buildUrl = Developer.projectWorkspaceLink(ns, projectName, "buildLogs/" + buildName);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var labels = Core.pathGet(data, ["config", "Labels"]);
|
||||
if (labels) {
|
||||
item.$gitCommit = labels["io.openshift.build.commit.id"] || item.$gitCommit;
|
||||
item.$gitCommitAuthor = labels["io.openshift.build.commit.author"] || item.$gitCommitAuthor;
|
||||
item.$gitCommitDate = labels["io.openshift.build.commit.date"] || item.$gitCommitDate;
|
||||
item.$gitCommitMessage = labels["io.openshift.build.commit.message"] || item.$gitCommitMessage;
|
||||
item.$gitBranch = labels["io.openshift.build.commit.ref"] || item.$gitBranch;
|
||||
if (!item.$gitUrl && item.$gitCommit) {
|
||||
item.$gitUrl = Developer.projectWorkspaceLink(ns, projectName, "wiki/commitDetail///" + item.$gitCommit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (selector) {
|
||||
var selectorText = Kubernetes.labelsToString(selector, ",");
|
||||
var podLinkUrl = UrlHelpers.join(Developer.projectLink(projectName), "namespace", ns, "pods");
|
||||
item.pods = [];
|
||||
item.$podCounters = Kubernetes.createPodCounters(selector, status.pods, item.pods, selectorText, podLinkUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
// lets check for a project name if we have lots of RCs with no pods, lets remove them!
|
||||
angular.forEach(projectInfos, function (project, projectName) {
|
||||
var rcsNoPods = [];
|
||||
var rcsWithPods = [];
|
||||
angular.forEach(project.versions, function (versionInfo) {
|
||||
var rcs = versionInfo.replicationControllers;
|
||||
angular.forEach(rcs, function (item, name) {
|
||||
var count = Kubernetes.podCounterTotal(item.$podCounters);
|
||||
if (count) {
|
||||
rcsWithPods.push(name);
|
||||
}
|
||||
else {
|
||||
rcsNoPods.push(function () {
|
||||
delete rcs[name];
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
if (rcsWithPods.length) {
|
||||
// lets remove all the empty RCs
|
||||
angular.forEach(rcsNoPods, function (fn) {
|
||||
fn();
|
||||
});
|
||||
}
|
||||
});
|
||||
if (hasObjectChanged(projectInfos, cache)) {
|
||||
Developer.log.debug("project versions has changed!");
|
||||
answer[ns] = projectInfos;
|
||||
}
|
||||
}
|
||||
Kubernetes.watch($scope, $element, "replicationcontrollers", ns, function (data) {
|
||||
if (data) {
|
||||
status.rcs = data;
|
||||
updateModel();
|
||||
}
|
||||
});
|
||||
Kubernetes.watch($scope, $element, "services", ns, function (data) {
|
||||
if (data) {
|
||||
status.services = data;
|
||||
updateModel();
|
||||
}
|
||||
});
|
||||
Kubernetes.watch($scope, $element, "routes", ns, function (data) {
|
||||
if (data) {
|
||||
status.routes = data;
|
||||
updateModel();
|
||||
}
|
||||
});
|
||||
Kubernetes.watch($scope, $element, "pods", ns, function (data) {
|
||||
if (data) {
|
||||
status.pods = data;
|
||||
updateModel();
|
||||
}
|
||||
});
|
||||
}
|
||||
Developer.loadProjectVersions = loadProjectVersions;
|
||||
})(Developer || (Developer = {}));
|
||||
//# sourceMappingURL=developerHelpers.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,687 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
var Developer;
|
||||
(function (Developer) {
|
||||
var log = Logger.get('developer-navigation');
|
||||
function developBreadcrumb() {
|
||||
return {
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces"),
|
||||
label: "Teams",
|
||||
title: "View all the available teams",
|
||||
isActive: function (subTab, path) { return false; }
|
||||
};
|
||||
}
|
||||
function operateBreadcrumb() {
|
||||
return {
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/namespaces"),
|
||||
label: "Manage",
|
||||
title: "Manage the projects and resources inside them"
|
||||
};
|
||||
}
|
||||
function workspaceLink() {
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", Kubernetes.currentKubernetesNamespace());
|
||||
}
|
||||
Developer.workspaceLink = workspaceLink;
|
||||
function projectLink(projectId) {
|
||||
var link = workspaceLink();
|
||||
if (projectId) {
|
||||
return UrlHelpers.join(link, "/projects", projectId);
|
||||
}
|
||||
else {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
Developer.projectLink = projectLink;
|
||||
function createWorkspacesBreadcrumbs(developPerspective) {
|
||||
return [developBreadcrumb()];
|
||||
}
|
||||
Developer.createWorkspacesBreadcrumbs = createWorkspacesBreadcrumbs;
|
||||
function createWorkspacesSubNavBars(developPerspective) {
|
||||
return activateCurrent([
|
||||
developBreadcrumb(),
|
||||
operateBreadcrumb()
|
||||
]);
|
||||
}
|
||||
Developer.createWorkspacesSubNavBars = createWorkspacesSubNavBars;
|
||||
function createWorkspaceBreadcrumbs(children, workspaceName) {
|
||||
if (children === void 0) { children = null; }
|
||||
if (workspaceName === void 0) { workspaceName = null; }
|
||||
var answer = createWorkspacesBreadcrumbs(true);
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
if (workspaceName) {
|
||||
answer.push({
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces/", workspaceName),
|
||||
label: workspaceName,
|
||||
title: "View the project: " + workspaceName,
|
||||
isActive: function (subTab, path) { return false; }
|
||||
});
|
||||
return processChildren(answer, children);
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
Developer.createWorkspaceBreadcrumbs = createWorkspaceBreadcrumbs;
|
||||
function createEnvironmentBreadcrumbs($scope, $location, $routeParams) {
|
||||
var ns = Kubernetes.currentKubernetesNamespace();
|
||||
var namespacesLink = UrlHelpers.join(HawtioCore.documentBase(), "/kubernetes/namespace");
|
||||
var workspaceName = $routeParams.workspace;
|
||||
var project = $routeParams.project;
|
||||
var environment = $routeParams.namespace;
|
||||
if (workspaceName && project) {
|
||||
var projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", project);
|
||||
$scope.$projectLink = projectLink;
|
||||
$scope.$projectNamespaceLink = UrlHelpers.join(projectLink, "namespace", ns);
|
||||
namespacesLink = UrlHelpers.join(projectLink, "namespace");
|
||||
var children = [
|
||||
{
|
||||
href: UrlHelpers.join(projectLink, "environments"),
|
||||
label: "Environments",
|
||||
title: "View the environments for this project"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(namespacesLink, ns, "apps"),
|
||||
label: function () { return environmentName(workspaceName, ns); },
|
||||
title: "View the runtime of the workspace: " + ns
|
||||
}
|
||||
];
|
||||
return createProjectBreadcrumbs(project, children, workspaceName);
|
||||
}
|
||||
else if (workspaceName && environment && workspaceName != environment) {
|
||||
// find label for namespace environment
|
||||
var children = [
|
||||
{
|
||||
href: environmentsLink(workspaceName),
|
||||
label: "Environments",
|
||||
title: "View the environments for this project"
|
||||
},
|
||||
{
|
||||
href: environmentLink(workspaceName, environment),
|
||||
label: function () { return environmentName(workspaceName, environment); },
|
||||
title: "View this environment"
|
||||
}
|
||||
];
|
||||
return createProjectBreadcrumbs(project, children, workspaceName);
|
||||
}
|
||||
else if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
var answer = createWorkspaceBreadcrumbs(workspaceName);
|
||||
answer.push({
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "workspaces", workspaceName, "namespace", ns, "apps"),
|
||||
label: 'Runtime',
|
||||
title: "View the runtime of the workspace: " + ns
|
||||
});
|
||||
return activateCurrent(answer);
|
||||
}
|
||||
Developer.createEnvironmentBreadcrumbs = createEnvironmentBreadcrumbs;
|
||||
/**
|
||||
* Returns the name of the given environment namespace
|
||||
*/
|
||||
function environmentName(workspaceName, environment) {
|
||||
/*var model = Kubernetes.getKubernetesModel();
|
||||
if (model) {
|
||||
return model.environmentName(workspaceName, environment);
|
||||
}*/
|
||||
return environment;
|
||||
}
|
||||
function createProjectBreadcrumbs(projectName, children, workspaceName) {
|
||||
if (projectName === void 0) { projectName = null; }
|
||||
if (children === void 0) { children = null; }
|
||||
if (workspaceName === void 0) { workspaceName = null; }
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
var answer = createWorkspaceBreadcrumbs(null, workspaceName);
|
||||
if (workspaceName) {
|
||||
if (projectName) {
|
||||
answer.push({
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects"),
|
||||
label: "Apps",
|
||||
title: "View all the apps in this project"
|
||||
});
|
||||
answer.push({
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName),
|
||||
label: projectName,
|
||||
title: "View the project: " + projectName
|
||||
});
|
||||
}
|
||||
return processChildren(answer, children);
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
Developer.createProjectBreadcrumbs = createProjectBreadcrumbs;
|
||||
function createProjectSettingsBreadcrumbs(projectName, workspaceName) {
|
||||
if (workspaceName === void 0) { workspaceName = null; }
|
||||
var children = [];
|
||||
if (!projectName) {
|
||||
children = [{
|
||||
label: "New App",
|
||||
title: "Lets make a new app"
|
||||
}];
|
||||
}
|
||||
return createProjectBreadcrumbs(projectName, children, workspaceName);
|
||||
}
|
||||
Developer.createProjectSettingsBreadcrumbs = createProjectSettingsBreadcrumbs;
|
||||
function createWorkspaceSubNavBars() {
|
||||
var workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
return activateCurrent([
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName),
|
||||
label: "Dashboard",
|
||||
class: "fa fa-tachometer",
|
||||
title: "View the dashboard for the apps, environments and pipelines in this project"
|
||||
},
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "apps"),
|
||||
label: "Apps",
|
||||
class: "fa fa-rocket",
|
||||
title: "View the apps in this project"
|
||||
},
|
||||
{
|
||||
isValid: function () { return jenkinsLink(); },
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "jenkinsJob"),
|
||||
label: "Builds",
|
||||
class: "fa fa-code",
|
||||
title: "View the builds in this project"
|
||||
},
|
||||
{
|
||||
href: environmentsLink(),
|
||||
label: "Environments",
|
||||
class: "fa fa-cubes",
|
||||
title: "View the environments for this project"
|
||||
},
|
||||
{
|
||||
href: namespaceRuntimeLink(workspaceName),
|
||||
label: "Runtime",
|
||||
class: "fa fa-cube",
|
||||
title: "View the Runtime perspective for this project"
|
||||
}
|
||||
]);
|
||||
}
|
||||
Developer.createWorkspaceSubNavBars = createWorkspaceSubNavBars;
|
||||
function namespaceRuntimeLink(workspaceName) {
|
||||
if (workspaceName === void 0) { workspaceName = null; }
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "workspaces", workspaceName, "namespace", workspaceName, "apps");
|
||||
}
|
||||
Developer.namespaceRuntimeLink = namespaceRuntimeLink;
|
||||
function createBuildsLink(workspaceName, projectName, jenkinsJobId) {
|
||||
workspaceName = workspaceName || Kubernetes.currentKubernetesNamespace();
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, "jenkinsJob", jenkinsJobId);
|
||||
}
|
||||
/**
|
||||
* Creates a routing function that loads a template and inject the needed directives to properly
|
||||
* display/update the Developer module managed tabs and bread crumbs for when the route is active.
|
||||
*
|
||||
* Example Usage:
|
||||
*
|
||||
* var route = Developer.createTabRoutingFunction("/app/somedir");
|
||||
* $routeProvider.when('/profiles', route('view.html', false, [{
|
||||
* label: "Profiles",
|
||||
* title: "Browse the profiles of this project"
|
||||
* }]
|
||||
* ));
|
||||
*
|
||||
* @param baseURL
|
||||
* @returns {function(string, boolean=, Array<Developer.BreadcrumbConfig>=): {template: string, reloadOnSearch: boolean, controller: string|string|(function(any, ng.route.IRouteParamsService): undefined)[]}}
|
||||
*/
|
||||
function createTabRoutingFunction(baseURL) {
|
||||
return function (templateName, reloadOnSearch, children) {
|
||||
if (reloadOnSearch === void 0) { reloadOnSearch = true; }
|
||||
return {
|
||||
template: "<div hawtio-breadcrumbs></div><div hawtio-tabs></div><ng-include src='contentTemplateUrl'></ng-include>",
|
||||
reloadOnSearch: reloadOnSearch,
|
||||
controller: ["$scope", "$routeParams", function ($scope, $routeParams) {
|
||||
if ($routeParams["namespace"] == null) {
|
||||
log.error("The :namespace route parameter was not defined for the route.");
|
||||
}
|
||||
if ($routeParams["projectId"] == null) {
|
||||
log.error("The :projectId route parameter was not defined for the route.");
|
||||
}
|
||||
$scope.namespace = $routeParams["namespace"];
|
||||
$scope.projectId = $routeParams["projectId"];
|
||||
$scope.contentTemplateUrl = UrlHelpers.join(baseURL, templateName);
|
||||
$scope.breadcrumbConfig = Developer.createProjectBreadcrumbs($scope.projectId, children);
|
||||
$scope.subTabConfig = Developer.createProjectSubNavBars($scope.projectId);
|
||||
}]
|
||||
};
|
||||
};
|
||||
}
|
||||
Developer.createTabRoutingFunction = createTabRoutingFunction;
|
||||
function createProjectSubNavBars(projectName, jenkinsJobId, $scope) {
|
||||
if (jenkinsJobId === void 0) { jenkinsJobId = null; }
|
||||
if ($scope === void 0) { $scope = null; }
|
||||
var workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
var projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName);
|
||||
var buildsLink = UrlHelpers.join(projectLink, "builds");
|
||||
if (!jenkinsJobId) {
|
||||
jenkinsJobId = projectName;
|
||||
}
|
||||
var jenkinsBuildLink = null;
|
||||
var pipelinesLink = null;
|
||||
if (projectName && jenkinsJobId) {
|
||||
jenkinsBuildLink = createBuildsLink(workspaceName, projectName, jenkinsJobId);
|
||||
pipelinesLink = UrlHelpers.join(jenkinsBuildLink, "pipelines");
|
||||
}
|
||||
function isJenkinsBuild() {
|
||||
var answer = jenkinsLink() && jenkinsBuildLink;
|
||||
if (answer && $scope) {
|
||||
var entity = Developer.projectForScope($scope);
|
||||
if (entity) {
|
||||
return answer && entity.$jenkinsJob;
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
var answer = [
|
||||
/*
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName),
|
||||
label: "All Apps",
|
||||
class: 'fa fa-angle-double-left',
|
||||
title: "View the apps in this project"
|
||||
},
|
||||
{
|
||||
template: `<div ng-include="'plugins/developer/html/projectSelector.html'"></div>`
|
||||
},
|
||||
*/
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, "environments"),
|
||||
isActive: function (subTab, path) {
|
||||
var href = normalizeHref(subTab.href);
|
||||
//console.log("subTab: ", subTab, " path: ", path);
|
||||
if (path === href) {
|
||||
return true;
|
||||
}
|
||||
var rootPath = href.replace(/\/environments/, '');
|
||||
if (path === rootPath) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
//href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName),
|
||||
label: "Dashboard",
|
||||
class: "fa fa-tachometer",
|
||||
title: "View the app dashboard for the activity, environments and pipelines"
|
||||
},
|
||||
{
|
||||
isValid: function () { return isJenkinsBuild() && pipelinesLink; },
|
||||
id: "pipelines",
|
||||
href: pipelinesLink,
|
||||
label: "Pipelines",
|
||||
class: "fa fa-ellipsis-h",
|
||||
title: "View the pipeline builds for this app"
|
||||
},
|
||||
{
|
||||
isValid: function () { return !isJenkinsBuild(); },
|
||||
href: buildsLink,
|
||||
label: "Builds",
|
||||
class: "fa fa-bars",
|
||||
title: "View the builds for this app"
|
||||
},
|
||||
{
|
||||
isValid: function () { return isJenkinsBuild(); },
|
||||
isActive: function (item, path) {
|
||||
if (path.indexOf('/log/') > 0) {
|
||||
return false;
|
||||
}
|
||||
if (path.indexOf('/jenkinsJob/') > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
id: "builds",
|
||||
href: jenkinsBuildLink,
|
||||
label: "Builds",
|
||||
class: "fa fa-bars",
|
||||
title: "View the Jenkins builds for this app"
|
||||
},
|
||||
{
|
||||
isValid: function () { return isJenkinsBuild(); },
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, "jenkinsJob", jenkinsJobId, "metrics"),
|
||||
label: "Metrics",
|
||||
class: "fa fa-bar-chart",
|
||||
title: "View the metrics for this project"
|
||||
},
|
||||
/*
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, "tools"),
|
||||
label: "Tools",
|
||||
title: "View the tools for this project"
|
||||
},
|
||||
*/
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, "buildConfigEdit"),
|
||||
label: "Settings",
|
||||
class: "fa fa-cog",
|
||||
title: "View the app configuration",
|
||||
isActive: function (subTab, path) {
|
||||
if (_.endsWith(path, '/buildConfigEdit')) {
|
||||
return true;
|
||||
}
|
||||
if (_.endsWith(path, '/forge/secrets')) {
|
||||
return true;
|
||||
}
|
||||
if (_.endsWith(path, '/forge/command/devops-edit')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
];
|
||||
var context = {
|
||||
workspaceName: workspaceName,
|
||||
projectName: projectName,
|
||||
projectLink: projectLink,
|
||||
jenkinsJobId: jenkinsJobId,
|
||||
$scope: $scope
|
||||
};
|
||||
angular.forEach(Developer.customProjectSubTabFactories, function (fn) {
|
||||
if (angular.isFunction(fn)) {
|
||||
var subtab = fn(context);
|
||||
if (subtab) {
|
||||
if (angular.isArray(subtab)) {
|
||||
angular.forEach(subtab, function (t) {
|
||||
answer.push(t);
|
||||
});
|
||||
}
|
||||
else {
|
||||
answer.push(subtab);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return activateCurrent(answer);
|
||||
}
|
||||
Developer.createProjectSubNavBars = createProjectSubNavBars;
|
||||
function createProjectSettingsSubNavBars(projectName, jenkinsJobId) {
|
||||
if (jenkinsJobId === void 0) { jenkinsJobId = null; }
|
||||
if (!projectName) {
|
||||
return [];
|
||||
}
|
||||
var workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
var projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName);
|
||||
if (!jenkinsJobId) {
|
||||
jenkinsJobId = projectName;
|
||||
}
|
||||
var answer = [
|
||||
{
|
||||
href: UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, "buildConfigEdit"),
|
||||
label: "Core",
|
||||
title: "View the core build configuration"
|
||||
},
|
||||
{
|
||||
href: projectSecretsLink(workspaceName, projectName),
|
||||
label: "Secrets",
|
||||
title: "View or change the secrets used to edit source code in the source control system"
|
||||
},
|
||||
{
|
||||
href: editPipelineLink(workspaceName, projectName),
|
||||
label: "Pipeline",
|
||||
title: "View the DevOps and pipeline configuration"
|
||||
},
|
||||
{
|
||||
isValid: function () { return forgeProjectHasBuilder("maven"); },
|
||||
href: editMavenBuildLink(workspaceName, projectName),
|
||||
label: "Maven",
|
||||
title: "View the Maven build configuration"
|
||||
}
|
||||
];
|
||||
return activateCurrent(answer);
|
||||
}
|
||||
Developer.createProjectSettingsSubNavBars = createProjectSettingsSubNavBars;
|
||||
function forgeProjectHasBuilder(name) {
|
||||
var forgeProject = Kubernetes.inject("ForgeProject");
|
||||
if (forgeProject) {
|
||||
return forgeProject.hasBuilder(name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Developer.forgeProjectHasBuilder = forgeProjectHasBuilder;
|
||||
function forgeProjectHasPerspective(name) {
|
||||
var forgeProject = Kubernetes.inject("ForgeProject");
|
||||
if (forgeProject) {
|
||||
return forgeProject.hasPerspective(name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Developer.forgeProjectHasPerspective = forgeProjectHasPerspective;
|
||||
function editPipelineLinkScope($scope) {
|
||||
return editPipelineLink($scope.namespace, $scope.projectId || $scope.projectName || $scope.project);
|
||||
}
|
||||
Developer.editPipelineLinkScope = editPipelineLinkScope;
|
||||
function createProjectLink(workspaceName) {
|
||||
if (workspaceName === void 0) { workspaceName = null; }
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "/forge/createProject");
|
||||
}
|
||||
Developer.createProjectLink = createProjectLink;
|
||||
function editPipelineLink(workspaceName, projectName) {
|
||||
return projectWorkspaceLink(workspaceName, projectName, "forge/command/devops-edit");
|
||||
}
|
||||
Developer.editPipelineLink = editPipelineLink;
|
||||
function editMavenBuildLink(workspaceName, projectName) {
|
||||
return projectWorkspaceLink(workspaceName, projectName, "forge/command/fabric8-setup");
|
||||
}
|
||||
Developer.editMavenBuildLink = editMavenBuildLink;
|
||||
function projectSecretsLink(workspaceName, projectName) {
|
||||
return projectWorkspaceLink(workspaceName, projectName, "forge/secrets", false);
|
||||
}
|
||||
Developer.projectSecretsLink = projectSecretsLink;
|
||||
function secretsNamespaceLink(workspaceName, projectName, secretsNamespace) {
|
||||
var prefix = projectWorkspaceLink(workspaceName, projectName, "") || "kubernetes";
|
||||
return UrlHelpers.join(prefix, "namespace", secretsNamespace, "secrets");
|
||||
}
|
||||
Developer.secretsNamespaceLink = secretsNamespaceLink;
|
||||
function projectWorkspaceLink(workspaceName, projectName, path, ignoreBlankProject) {
|
||||
if (ignoreBlankProject === void 0) { ignoreBlankProject = true; }
|
||||
if (ignoreBlankProject && !projectName) {
|
||||
return "";
|
||||
}
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", projectName, path);
|
||||
}
|
||||
Developer.projectWorkspaceLink = projectWorkspaceLink;
|
||||
function environmentsLink(workspaceName) {
|
||||
if (workspaceName === void 0) { workspaceName = null; }
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "environments");
|
||||
}
|
||||
Developer.environmentsLink = environmentsLink;
|
||||
function environmentLink(workspaceName, environmentNamespace, path, ignoreBlankProject) {
|
||||
if (path === void 0) { path = ""; }
|
||||
if (ignoreBlankProject === void 0) { ignoreBlankProject = true; }
|
||||
if (ignoreBlankProject && !environmentNamespace) {
|
||||
return "";
|
||||
}
|
||||
if (!workspaceName) {
|
||||
workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
}
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "namespace", environmentNamespace, path);
|
||||
}
|
||||
Developer.environmentLink = environmentLink;
|
||||
Developer.customProjectSubTabFactories = [];
|
||||
function createJenkinsBreadcrumbs(projectName, jobId, buildId) {
|
||||
var workspaceName = Kubernetes.currentKubernetesNamespace();
|
||||
var children = [
|
||||
{
|
||||
id: "builds",
|
||||
href: createBuildsLink(workspaceName, projectName, jobId),
|
||||
label: "Builds",
|
||||
title: "View the builds for this app"
|
||||
}
|
||||
];
|
||||
if (buildId) {
|
||||
children.push({
|
||||
id: "",
|
||||
href: "",
|
||||
label: "#" + buildId,
|
||||
title: "Build #" + buildId
|
||||
});
|
||||
}
|
||||
return createProjectBreadcrumbs(projectName, children);
|
||||
}
|
||||
Developer.createJenkinsBreadcrumbs = createJenkinsBreadcrumbs;
|
||||
function createJenkinsSubNavBars(projectName, jenkinsJobId, buildId, extraOption) {
|
||||
if (extraOption === void 0) { extraOption = null; }
|
||||
var answer = createProjectSubNavBars(projectName, jenkinsJobId);
|
||||
if (extraOption) {
|
||||
// extraOption.active = true;
|
||||
answer.push(extraOption);
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
Developer.createJenkinsSubNavBars = createJenkinsSubNavBars;
|
||||
function createEnvironmentSubNavBars($scope, $location, $routeParams) {
|
||||
var ns = Kubernetes.currentKubernetesNamespace();
|
||||
var workspaceName = $routeParams.workspace;
|
||||
var project = $routeParams.project;
|
||||
var environment = $routeParams.namespace;
|
||||
var projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/kubernetes");
|
||||
/*console.log("=====================")
|
||||
console.log(projectLink);
|
||||
if (workspaceName && project) {
|
||||
projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/kubernetes", workspaceName, "projects", project);
|
||||
} else {
|
||||
projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/kubernetes", workspaceName || ns);
|
||||
}*/
|
||||
var namespacesLink = UrlHelpers.join(projectLink, "namespace");
|
||||
return activateCurrent([
|
||||
{
|
||||
href: UrlHelpers.join(namespacesLink, ns, "replicationControllers"),
|
||||
label: "服务管理",
|
||||
class: "fa fa-clone",
|
||||
title: "View the Replicas for this project"
|
||||
},
|
||||
]);
|
||||
}
|
||||
Developer.createEnvironmentSubNavBars = createEnvironmentSubNavBars;
|
||||
function environmentInstanceLink(env, projectName) {
|
||||
if (projectName === void 0) { projectName = null; }
|
||||
if (env) {
|
||||
var envNamespace = env["namespace"];
|
||||
if (envNamespace) {
|
||||
if (projectName) {
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", Kubernetes.currentKubernetesNamespace(), "projects", projectName, "namespace", envNamespace);
|
||||
}
|
||||
else {
|
||||
return UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", Kubernetes.currentKubernetesNamespace(), "namespace", envNamespace);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
Developer.environmentInstanceLink = environmentInstanceLink;
|
||||
function namespaceLink($scope, $routeParams, path) {
|
||||
if (path === void 0) { path = null; }
|
||||
var ns = Kubernetes.currentKubernetesNamespace();
|
||||
var workspaceName = $routeParams.workspace;
|
||||
var project = $routeParams.project;
|
||||
var projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/kubernetes");
|
||||
if (workspaceName && project) {
|
||||
projectLink = UrlHelpers.join(HawtioCore.documentBase(), "/workspaces", workspaceName, "projects", project);
|
||||
}
|
||||
return UrlHelpers.join(projectLink, "namespace", ns, path);
|
||||
}
|
||||
Developer.namespaceLink = namespaceLink;
|
||||
/**
|
||||
* Removes the URL query string if its inside the given text
|
||||
*/
|
||||
function trimQuery(text) {
|
||||
if (text) {
|
||||
var idx = text.indexOf("?");
|
||||
if (idx >= 0) {
|
||||
return text.substring(0, idx);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
// Cater for the app running at some weird document base
|
||||
function normalizeHref(href) {
|
||||
if (!href) {
|
||||
return null;
|
||||
}
|
||||
var regex = new RegExp('^' + HawtioCore.documentBase().replace('/', '\\/'));
|
||||
return href.replace(regex, '/');
|
||||
}
|
||||
Developer.normalizeHref = normalizeHref;
|
||||
function activateCurrent(navBarItems) {
|
||||
navBarItems = _.compact(navBarItems);
|
||||
var injector = HawtioCore.injector;
|
||||
var $location = injector ? injector.get("$location") : null;
|
||||
if ($location) {
|
||||
var path = normalizeHref(trimQuery($location.path()));
|
||||
var found = false;
|
||||
function makeActive(item) {
|
||||
item.active = true;
|
||||
found = true;
|
||||
}
|
||||
function getHref(item) {
|
||||
var href = item.href;
|
||||
var trimHref = trimQuery(href);
|
||||
return normalizeHref(trimHref);
|
||||
}
|
||||
angular.forEach(navBarItems, function (item) {
|
||||
if (!found && item) {
|
||||
if (angular.isFunction(item.isActive)) {
|
||||
if (item.isActive(item, path)) {
|
||||
makeActive(item);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var trimHref = getHref(item);
|
||||
if (!trimHref) {
|
||||
return;
|
||||
}
|
||||
if (trimHref === path) {
|
||||
makeActive(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// Maybe it's a sub-item of a tab, let's fall back to that maybe
|
||||
if (!found) {
|
||||
angular.forEach(navBarItems, function (item) {
|
||||
if (!found) {
|
||||
if (!angular.isFunction(item.isActive)) {
|
||||
var trimHref = getHref(item);
|
||||
if (!trimHref) {
|
||||
return;
|
||||
}
|
||||
if (_.startsWith(path, trimHref)) {
|
||||
makeActive(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// still not found, let's log it
|
||||
if (!found) {
|
||||
log.debug("No navigation tab found for path:", path);
|
||||
}
|
||||
}
|
||||
return navBarItems;
|
||||
}
|
||||
Developer.activateCurrent = activateCurrent;
|
||||
function processChildren(answer, children) {
|
||||
if (children) {
|
||||
if (angular.isArray(children)) {
|
||||
answer = answer.concat(children);
|
||||
}
|
||||
else {
|
||||
answer.push(children);
|
||||
}
|
||||
}
|
||||
activateCurrent(answer);
|
||||
return answer;
|
||||
}
|
||||
})(Developer || (Developer = {}));
|
||||
//# sourceMappingURL=developerNavigation.js.map
|
File diff suppressed because one or more lines are too long
|
@ -8,406 +8,416 @@
|
|||
/// <reference path="dataManagerModel.ts"/>
|
||||
/// <reference path="../../configs/ts/configsHelper.ts"/>
|
||||
/// <reference path="../../configs/ts/customAlert.ts"/>
|
||||
|
||||
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;
|
||||
|
||||
$scope.options = DataModel.paramOptions;
|
||||
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
|
||||
var result = getDataType($location);
|
||||
|
||||
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;
|
||||
|
||||
$scope.treeOptions = {
|
||||
nodeChildren: "childNodes",
|
||||
dirSelectable: true,
|
||||
injectClasses: {
|
||||
ul: "a1",
|
||||
li: "a2",
|
||||
liSelected: "a7",
|
||||
iExpanded: "a3",
|
||||
iCollapsed: "a4",
|
||||
iLeaf: "a5",
|
||||
label: "a6",
|
||||
labelSelected: "a8"
|
||||
}
|
||||
}
|
||||
$scope.options = DataModel.paramOptions;
|
||||
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
|
||||
var result = getDataType($location);
|
||||
|
||||
//配置数据表格需要显示的内容及显示格式
|
||||
$scope.tableConfig = {
|
||||
data: 'model.data',
|
||||
showSelectionCheckbox: true,
|
||||
enableRowClickSelection: false,
|
||||
multiSelect: true,
|
||||
selectedItems: [],
|
||||
filterOptions: {
|
||||
filterText: $location.search()["q"] || ''
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
field: "_key",
|
||||
displayName: '编码'
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
displayName: '市-区/县',
|
||||
customSortField: (field) => {
|
||||
return field.regionalismCode;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: "systemName",
|
||||
displayName: '系统名称',
|
||||
customSortField: (field) => {
|
||||
return field.systemCode;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: "dataBaseType",
|
||||
displayName: '数据库类型',
|
||||
},
|
||||
{
|
||||
field: "labels",
|
||||
displayName: '数据标签',
|
||||
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
|
||||
},
|
||||
{
|
||||
field: "year",
|
||||
displayName: '年度',
|
||||
},
|
||||
{
|
||||
field: "collectingTime",
|
||||
displayName: '采集时间'
|
||||
},
|
||||
{
|
||||
field: "extractStatus",
|
||||
displayName: '汇总状态',
|
||||
cellTemplate: $templateCache.get("dataExtractTemplate.html")
|
||||
$scope.treeOptions = {
|
||||
nodeChildren: "childNodes",
|
||||
dirSelectable: true,
|
||||
injectClasses: {
|
||||
ul: "a1",
|
||||
li: "a2",
|
||||
liSelected: "a7",
|
||||
iExpanded: "a3",
|
||||
iCollapsed: "a4",
|
||||
iLeaf: "a5",
|
||||
label: "a6",
|
||||
labelSelected: "a8"
|
||||
}
|
||||
}
|
||||
|
||||
//配置数据表格需要显示的内容及显示格式
|
||||
$scope.tableConfig = {
|
||||
data: 'model.data',
|
||||
showSelectionCheckbox: true,
|
||||
enableRowClickSelection: false,
|
||||
multiSelect: true,
|
||||
selectedItems: [],
|
||||
filterOptions: {
|
||||
filterText: $location.search()["q"] || ''
|
||||
},
|
||||
columnDefs: [{
|
||||
field: "_key",
|
||||
displayName: '编码'
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
displayName: '市-区/县',
|
||||
customSortField: (field) => {
|
||||
return field.regionalismCode;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: "systemName",
|
||||
displayName: '系统名称',
|
||||
customSortField: (field) => {
|
||||
return field.systemCode;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: "dataBaseType",
|
||||
displayName: '数据库类型',
|
||||
},
|
||||
{
|
||||
field: "labels",
|
||||
displayName: '数据标签',
|
||||
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
|
||||
},
|
||||
{
|
||||
field: "year",
|
||||
displayName: '年度',
|
||||
},
|
||||
{
|
||||
field: "collectingTime",
|
||||
displayName: '采集时间'
|
||||
},
|
||||
{
|
||||
field: "extractStatus",
|
||||
displayName: '汇总状态',
|
||||
cellTemplate: $templateCache.get("dataExtractTemplate.html")
|
||||
}
|
||||
],
|
||||
sortInfo: {
|
||||
sortBy: "_key",
|
||||
ascending: true
|
||||
}
|
||||
};
|
||||
|
||||
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.navbarItems.forEach((nav) => {
|
||||
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.model.paramOptions.totlePage;
|
||||
return length <= 0 || idx <= 1;
|
||||
}
|
||||
|
||||
$scope.isEmptyOrLast = () => {
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
var length = $scope.model.paramOptions.totlePage;
|
||||
return length < 1 || idx >= length;
|
||||
}
|
||||
|
||||
$scope.first = () => {
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
if (idx > 1) {
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.last = () => {
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
var length = $scope.model.paramOptions.totlePage;
|
||||
if (idx < length) {
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", length);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.previous = () => {
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
var length = $scope.model.paramOptions.totlePage;
|
||||
if (idx > 1) {
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", idx - 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.next = () => {
|
||||
var length = $scope.model.paramOptions.totlePage;
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
if (idx < length) {
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", idx + 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.$watch('model.paramOptions', (newValue, oldValue) => {
|
||||
if (newValue) {
|
||||
if (newValue.currentTableSize !== oldValue.currentTableSize)
|
||||
$scope.options.priorTableSize = oldValue.currentTableSize;
|
||||
else
|
||||
$scope.options.priorTableSize = newValue.currentTableSize;
|
||||
DataModel.updateModel();
|
||||
}
|
||||
|
||||
}, true);
|
||||
|
||||
$scope.search = () => {
|
||||
//$scope.model.initParamOptions();
|
||||
$scope.model.paramOptions.currentPageNum = 1;
|
||||
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
|
||||
|
||||
}
|
||||
|
||||
$scope.deletePrompt = (selected) => {
|
||||
if (angular.isString(selected)) {
|
||||
selected = [{
|
||||
id: selected
|
||||
}];
|
||||
}
|
||||
/*
|
||||
判断数据是否已挂载使用和正在迁移。
|
||||
*/
|
||||
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks, $scope.tableConfig.selectedItems, "manager");
|
||||
if (message != "") {
|
||||
Configs.customAlert("提示", "操作失败:" + message + ",不能删除!", '', null, 0, "error");
|
||||
return;
|
||||
}
|
||||
|
||||
UI.multiItemConfirmActionDialog( < UI.MultiItemConfirmActionOptions > {
|
||||
collection: selected,
|
||||
index: 'alias',
|
||||
onClose: (result: boolean) => {
|
||||
var idColl = [];
|
||||
if (result) {
|
||||
angular.forEach(selected, (select) => {
|
||||
idColl.push(select.id);
|
||||
});
|
||||
$http({
|
||||
method: "POST",
|
||||
url: "/java/console/api/delete/data",
|
||||
params: { "data": idColl }
|
||||
}).success(function(data, status, headers, config) {
|
||||
//成功之后做一些事情
|
||||
DataModel.updateModel();
|
||||
}).error(function(data, status, headers, config) {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
title: '是否需要删除采集数据?',
|
||||
action: '以下采集数据文件将会被删除:',
|
||||
okText: '删除',
|
||||
okClass: 'btn-danger sj_btn_cir',
|
||||
custom: "该删除操作将会彻底删除数据文件,是否删除,请确认!",
|
||||
customClass: "alert alert-warning sj_alert-warning",
|
||||
cancelText: "取消",
|
||||
cancelClass: 'sj_btn_grey'
|
||||
}).open();
|
||||
}
|
||||
|
||||
//测试代码
|
||||
// $scope.change= function (){
|
||||
// console.info($scope.model.data);
|
||||
// }
|
||||
|
||||
$scope.migrationClick = {
|
||||
items: null,
|
||||
selectedItem: { "name": "当前没有可以迁移的集群" },
|
||||
dialog: new UI.Dialog(),
|
||||
onOk: () => {
|
||||
var migrationClick = $scope.migrationClick;
|
||||
/*
|
||||
向后台发生数据迁移请求,$http:发生http异步请求;第二个参数:请求url;第三个参数:请求操作类型;第四个参数:请求携带的数据;第五个参数:
|
||||
一个回调函数,请求响应后的回调函数。
|
||||
*/
|
||||
//$scope.tableConfig.selectedItems[0].volumePath $scope.vlome
|
||||
|
||||
var volumePath = migrationClick.selectedItem.path;
|
||||
if (Kubernetes.alreadyExitInCluster($scope.tableConfig.selectedItems, volumePath)) {
|
||||
migrationClick.close();
|
||||
Configs.customAlert("提示", "操作失败:" + "数据已在当前集群中!", '', null, 0, "error");
|
||||
return;
|
||||
};
|
||||
|
||||
$scope.selectNode = $scope.migrationClick.selectedItem.folder[0];
|
||||
// $scope.selectNode.path=volumePath;
|
||||
Configs.oracleInfoOperate($http, "/java/console/api/volume", Configs.OperateType.MOVE, {
|
||||
"name": migrationClick.selectedItem.name,
|
||||
"selectItems": $scope.tableConfig.selectedItems,
|
||||
"selectNode": $scope.selectNode
|
||||
}, (result, status) => {
|
||||
if (status === 200) {
|
||||
//$scope.model.updateOracleParam();
|
||||
} else
|
||||
throw "资源请求失败";
|
||||
});
|
||||
/*
|
||||
页面跳转
|
||||
*/
|
||||
$timeout(() => {
|
||||
$location.path("/workspaces/Overview/task/running");
|
||||
}, 250);
|
||||
migrationClick.close();
|
||||
},
|
||||
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, "manager");
|
||||
|
||||
if (message == "") {
|
||||
if ($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length > 0)
|
||||
migrationClick.selectedItem = $scope.volumes[0];
|
||||
migrationClick.dialog.open();
|
||||
} else {
|
||||
Configs.customAlert("提示", "操作失败:" + message + ", 不能迁移!", '', null, 0, "error");
|
||||
}
|
||||
},
|
||||
close: () => {
|
||||
$scope.migrationClick.selectedItem = { "name": "当前没有可以迁移的集群" };
|
||||
$scope.migrationClick.dialog.close();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.createOracleService = (items) => {
|
||||
console.log($scope.tableConfig.selectedItems);
|
||||
console.log("selected");
|
||||
var exitedItems = Kubernetes.checkForCreateOracle($scope.model.transferTasks, items);
|
||||
console.log(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({
|
||||
name: item._key,
|
||||
labels: {
|
||||
system: item.systemCode.toString(),
|
||||
version: item.dataVersion.toString(),
|
||||
region: item.regionalismCode.toString()
|
||||
},
|
||||
annotations: {
|
||||
cityName: item.cityName,
|
||||
districtName: item.districtName,
|
||||
systemName: item.systemName,
|
||||
id: item.id + "",
|
||||
year: item.year,
|
||||
checkoutFlag: item.checkoutFlag
|
||||
},
|
||||
path: item.dataPath + "app/",
|
||||
isTarget: "false",
|
||||
isExtract: item.extractStatus
|
||||
}, (rc) => {
|
||||
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", rc, 50000000000);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$timeout(() => {
|
||||
$location.path('/kubernetes/namespace/default/replicationControllers');
|
||||
}, 200);
|
||||
} else {
|
||||
var name = "";
|
||||
angular.forEach(exitedItems, (item) => {
|
||||
name += item.name + "-" + item.systemName + ",";
|
||||
});
|
||||
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能被启动!", '', null, 0, "error");
|
||||
}
|
||||
}
|
||||
|
||||
function init($scope, $location, $routeParams) {
|
||||
$scope.keyQuery = "";
|
||||
$scope.model.initParamOptions();
|
||||
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
|
||||
if (ConfigsModel.cluster != null)
|
||||
$scope.volumes = ConfigsModel.cluster;
|
||||
|
||||
//创建二级菜单
|
||||
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.navbarItems = [{
|
||||
herf: "",
|
||||
label: "全部",
|
||||
title: "查看全部数据",
|
||||
class: "active",
|
||||
alias: null
|
||||
},
|
||||
{
|
||||
herf: "",
|
||||
label: "批次A",
|
||||
title: "查看批次A的数据",
|
||||
class: "",
|
||||
alias: "A"
|
||||
},
|
||||
{
|
||||
herf: "",
|
||||
label: "批次B",
|
||||
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("/");
|
||||
if (path.indexOf("hot") > -1)
|
||||
$scope.isShow = true;
|
||||
else
|
||||
$scope.isShow = false;
|
||||
|
||||
switch (subPath[subPath.length - 1]) {
|
||||
case "financial":
|
||||
dataType = "财政";
|
||||
break;
|
||||
case "social-security":
|
||||
dataType = "社保";
|
||||
break;
|
||||
default:
|
||||
dataType = null;
|
||||
break;
|
||||
};
|
||||
switch (subPath[3]) {
|
||||
case "hot":
|
||||
volumeType = 0
|
||||
break;
|
||||
default:
|
||||
volumeType = 1
|
||||
}
|
||||
return {
|
||||
"dataType": dataType,
|
||||
"volumeType": volumeType
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
sortInfo: {
|
||||
sortBy: "_key",
|
||||
ascending: true
|
||||
}
|
||||
};
|
||||
|
||||
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.navbarItems.forEach((nav) =>{
|
||||
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.model.paramOptions.totlePage;
|
||||
return length <= 0 || idx <= 1;
|
||||
}
|
||||
|
||||
$scope.isEmptyOrLast = () =>{
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
var length =$scope.model.paramOptions.totlePage;
|
||||
return length < 1 || idx >= length;
|
||||
}
|
||||
|
||||
$scope.first = () => {
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
if(idx >1){
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", 1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.last = () =>{
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
var length =$scope.model.paramOptions.totlePage;
|
||||
if(idx < length){
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", length);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.previous = () => {
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
var length =$scope.model.paramOptions.totlePage;
|
||||
if(idx > 1){
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", idx-1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.next = () =>{
|
||||
var length =$scope.model.paramOptions.totlePage;
|
||||
var idx = $scope.model.getParamOption("currentPageNum");
|
||||
if(idx < length){
|
||||
Kubernetes.eliminateChechBoxClick();
|
||||
$scope.model.updateParamOption("currentPageNum", idx+1);
|
||||
}
|
||||
}
|
||||
|
||||
$scope.$watch('model.paramOptions', (newValue, oldValue) => {
|
||||
if(newValue){
|
||||
if(newValue.currentTableSize !== oldValue.currentTableSize)
|
||||
$scope.options.priorTableSize = oldValue.currentTableSize;
|
||||
else
|
||||
$scope.options.priorTableSize = newValue.currentTableSize;
|
||||
DataModel.updateModel();
|
||||
}
|
||||
|
||||
}, true);
|
||||
|
||||
$scope.search = () => {
|
||||
//$scope.model.initParamOptions();
|
||||
$scope.model.paramOptions.currentPageNum = 1;
|
||||
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
|
||||
|
||||
}
|
||||
|
||||
$scope.deletePrompt = (selected) => {
|
||||
if (angular.isString(selected)) {
|
||||
selected = [{
|
||||
id: selected
|
||||
}];
|
||||
}
|
||||
/*
|
||||
判断数据是否已挂载使用和正在迁移。
|
||||
*/
|
||||
var message = Kubernetes.checkForMigration($scope.replicasModel.replicationControllers, $scope.model.transferTasks , $scope.tableConfig.selectedItems, "manager");
|
||||
if(message != ""){
|
||||
Configs.customAlert("提示", "操作失败:" + message + ",不能删除!", '',null, 0, "error");
|
||||
return;
|
||||
}
|
||||
|
||||
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
|
||||
collection: selected,
|
||||
index: 'alias',
|
||||
onClose: (result:boolean) => {
|
||||
var idColl = [];
|
||||
if (result) {
|
||||
angular.forEach(selected, (select) => {
|
||||
idColl.push(select.id);
|
||||
});
|
||||
$http({
|
||||
method: "POST",
|
||||
url: "/java/console/api/delete/data",
|
||||
params: {"data": idColl}
|
||||
}).success(function(data, status, headers, config) {
|
||||
//成功之后做一些事情
|
||||
DataModel.updateModel();
|
||||
}).error(function(data, status, headers, config) {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
title: '是否需要删除采集数据?',
|
||||
action: '以下采集数据文件将会被删除:',
|
||||
okText: '删除',
|
||||
okClass: 'btn-danger sj_btn_cir',
|
||||
custom: "该删除操作将会彻底删除数据文件,是否删除,请确认!",
|
||||
customClass: "alert alert-warning sj_alert-warning",
|
||||
cancelText: "取消",
|
||||
cancelClass: 'sj_btn_grey'
|
||||
}).open();
|
||||
}
|
||||
|
||||
$scope.migrationClick = {
|
||||
items:null,
|
||||
selectedItem: {"name": "当前没有可以迁移的集群"},
|
||||
dialog: new UI.Dialog(),
|
||||
onOk: () => {
|
||||
var migrationClick = $scope.migrationClick;
|
||||
/*
|
||||
向后台发生数据迁移请求,$http:发生http异步请求;第二个参数:请求url;第三个参数:请求操作类型;第四个参数:请求携带的数据;第五个参数:
|
||||
一个回调函数,请求响应后的回调函数。
|
||||
*/
|
||||
|
||||
if(Kubernetes.alreadyExitInFolder($scope.tableConfig.selectedItems, $scope.selectNode)){
|
||||
migrationClick.close();
|
||||
Configs.customAlert("提示", "操作失败:" + "数据已在当前目录!", '',null, 0, "error");
|
||||
return;
|
||||
};
|
||||
|
||||
Configs.oracleInfoOperate($http, "/java/console/api/volume", Configs.OperateType.MOVE,
|
||||
{
|
||||
"name": migrationClick.selectedItem.name,
|
||||
"selectItems": $scope.tableConfig.selectedItems,
|
||||
"selectNode": $scope.selectNode
|
||||
}, (result, status) => {
|
||||
if(status===200){
|
||||
//$scope.model.updateOracleParam();
|
||||
}else
|
||||
throw "资源请求失败";
|
||||
});
|
||||
/*
|
||||
页面跳转
|
||||
*/
|
||||
$timeout(() =>{
|
||||
$location.path("/workspaces/Overview/task/running");
|
||||
},250);
|
||||
migrationClick.close();
|
||||
},
|
||||
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, "manager");
|
||||
|
||||
if(message == ""){
|
||||
if($scope.volumes && $scope.volumes instanceof Array && $scope.volumes.length >0)
|
||||
migrationClick.selectedItem = $scope.volumes[0];
|
||||
migrationClick.dialog.open();
|
||||
}else{
|
||||
Configs.customAlert("提示", "操作失败:" + message + ", 不能迁移!", '',null, 0, "error");
|
||||
}
|
||||
},
|
||||
close: () => {
|
||||
$scope.migrationClick.selectedItem = {"name": "当前没有可以迁移的集群"};
|
||||
$scope.migrationClick.dialog.close();
|
||||
}
|
||||
};
|
||||
|
||||
$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({
|
||||
name: item._key,
|
||||
labels: {
|
||||
system: item.systemCode.toString(),
|
||||
version: item.dataVersion.toString(),
|
||||
region: item.regionalismCode.toString()
|
||||
},
|
||||
annotations: {
|
||||
cityName: item.cityName,
|
||||
districtName: item.districtName,
|
||||
systemName: item.systemName,
|
||||
id: item.id+"",
|
||||
year: item.year,
|
||||
checkoutFlag: item.checkoutFlag
|
||||
},
|
||||
path: item.dataPath+"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');
|
||||
}, 200);
|
||||
}else{
|
||||
var name = "";
|
||||
angular.forEach(exitedItems, (item) => {
|
||||
name += item.name + "-" + item.systemName + ",";
|
||||
});
|
||||
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能被启动!", '', null, 0, "error");
|
||||
}
|
||||
}
|
||||
|
||||
function init($scope,$location,$routeParams){
|
||||
$scope.keyQuery = "";
|
||||
$scope.model.initParamOptions();
|
||||
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
|
||||
if(ConfigsModel.cluster!=null)
|
||||
$scope.volumes = ConfigsModel.cluster;
|
||||
|
||||
//创建二级菜单
|
||||
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
|
||||
$scope.navbarItems =[{
|
||||
herf: "",
|
||||
label: "全部",
|
||||
title: "查看全部数据",
|
||||
class: "active",
|
||||
alias: null
|
||||
},
|
||||
{
|
||||
herf: "",
|
||||
label: "批次A",
|
||||
title: "查看批次A的数据",
|
||||
class: "",
|
||||
alias: "A"
|
||||
},
|
||||
{
|
||||
herf: "",
|
||||
label: "批次B",
|
||||
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("/");
|
||||
if(path.indexOf("hot") > -1)
|
||||
$scope.isShow = true;
|
||||
else
|
||||
$scope.isShow = false;
|
||||
|
||||
switch (subPath[subPath.length -1]) {
|
||||
case "financial":
|
||||
dataType = "财政";
|
||||
break;
|
||||
case "social-security":
|
||||
dataType = "社保";
|
||||
break;
|
||||
default:
|
||||
dataType = null;
|
||||
break;
|
||||
};
|
||||
switch (subPath[3]) {
|
||||
case "hot":
|
||||
volumeType = 0
|
||||
break;
|
||||
default:
|
||||
volumeType = 1
|
||||
}
|
||||
return {
|
||||
"dataType": dataType,
|
||||
"volumeType": volumeType
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}
|
||||
]);
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
/// <reference path="../libs/hawtio-forms/defs.d.ts"/>
|
||||
/// <reference path="../libs/hawtio-kubernetes-api/defs.d.ts"/>
|
||||
/// <reference path="../libs/hawtio-oauth/defs.d.ts"/>
|
||||
/// <reference path="../libs/hawtio-ui/defs.d.ts"/>
|
||||
/// <reference path="../libs/hawtio-utilities/defs.d.ts"/>
|
||||
//# sourceMappingURL=includes.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"includes.js","sourceRoot":"","sources":["includes.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,+DAA+D;AAC/D,sDAAsD;AACtD,mDAAmD;AACnD,0DAA0D"}
|
|
@ -233,7 +233,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/ng-template" id="taskRecordEdit.html">
|
||||
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskRecordEdit">
|
||||
<button class="btn sj_btn" style="border:0;background:none;" ng-click="showDeleteOne.open(entity)" ng-disabled="entity.status == 1 || entity.status == 0">
|
||||
|
@ -252,16 +251,15 @@
|
|||
<!-- <div style="height:80%;" class="ngCellText progress" ng-init="entity=row.entity"> -->
|
||||
<div ng-init="entity=row.entity">
|
||||
<div style="position:relative;text-align:right;width:100%;height:25px">
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
<div ng-show="entity.status!==3" class="progress-bar progress-bar-success active sj_progress_bar " role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="text-align:left;height:15px;width: {{entity.process}}%">
|
||||
<!-- <span class="sj_progress_font">{{entity.process}}%</span> -->
|
||||
<!-- <span class="sj_progress_font">{{entity.process}}%</span> -->
|
||||
</div>
|
||||
<div style="position:relative;text-align:right;width:100%;height:15px;line-height:90%">
|
||||
<span>{{entity.process}}%</span>
|
||||
<span>{{entity.process}}%</span>
|
||||
</div>
|
||||
|
||||
<!-- <div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active sj_progress_bar" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="30" aria-valuemax="100" style="width: 100%" title="{{entity.process}}%">
|
||||
<!-- <div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active sj_progress_bar" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="30" aria-valuemax="100" style="width: 100%" title="{{entity.process}}%">
|
||||
<span class="sj_progress_font">{{entity.process}}%</span>
|
||||
</div> -->
|
||||
</div>
|
||||
|
@ -318,15 +316,37 @@
|
|||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="isExistHot.html">
|
||||
<div class="ngCellText" ng-init="entity=row.entity">
|
||||
<div ng-show="true" title="是否是标准表汇总库">
|
||||
<div class="ngCellText" ng-init="entity=row.entity">
|
||||
<div ng-show="true" title="是否在热区">
|
||||
<span ng-show="entity.existHotData == 0"> 否</span>
|
||||
<span ng-show="entity.existHotData == 1"> 是</span>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="modal.html">
|
||||
<div>
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" align="center">
|
||||
标题信息
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div align="center">
|
||||
{{data}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" ng-click="ok()">
|
||||
确认
|
||||
</button>
|
||||
<button class="btn btn-warning" ng-click="cancel()">
|
||||
退出
|
||||
</button>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,15 +1,16 @@
|
|||
<div class="terminal-window pod-log-window" pod-log-window ng-mousedown="raise()">
|
||||
<div class="resize-dot" ng-mousedown="startResize($event)" ng-hide="docked"></div>
|
||||
<div class="centered scroll-indicator" ng-hide="atBottom" ng-click="atBottom = true">
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
<!--<div class="terminal-body" scroll-glue ng-model="atBottom" style="overflow-y:hidden"> -->
|
||||
<div class="resize-dot" ng-mousedown="startResize($event)" ng-hide="docked"></div>
|
||||
<div class="centered scroll-indicator" ng-hide="atBottom" ng-click="atBottom = true">
|
||||
<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" ng-hide="isExportLog">{{containerName}}的抽取日志</h5>
|
||||
<h5 class="top-bottom-middle" ng-hide="!isExportLog">导出日志</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>
|
||||
</div>
|
||||
<!--<div class="terminal-body" scroll-glue ng-model="atBottom" style="overflow-y:hidden"> -->
|
||||
<textarea style="height:100%; width:100%" disabled="disabled">{{logs}}</textarea>
|
||||
<!--</div>-->
|
||||
</div>
|
||||
<!--</div>-->
|
||||
</div>
|
|
@ -68,7 +68,7 @@
|
|||
class="btn btn-success pull-right sj_btn_grey"
|
||||
ng-click="extractOracle(id || tableConfig.selectedItems)">
|
||||
<i class="glyphicon glyphicon-cloud-download"></i> 抽取
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row sj_fluid">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1850,12 +1850,12 @@ module Kubernetes {
|
|||
},
|
||||
complete: (XMLHttpRequest, textStatus) => {
|
||||
if(XMLHttpRequest.status == 200){
|
||||
//spinner.spin();
|
||||
spinner.spin();
|
||||
Kubernetes.createSuccessInfo("success", "连接汇总库成功,即将执行汇总或抽取操作!");
|
||||
setTimeout("Kubernetes.removeMask()", 1500);
|
||||
}
|
||||
else{
|
||||
//spinner.spin();
|
||||
spinner.spin();
|
||||
Kubernetes.createSuccessInfo("error", "连接汇总库失败,请检查服务集群中的汇总库配置是否正确!");
|
||||
setTimeout("Kubernetes.removeMask()", 1500);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,213 @@
|
|||
var Kubernetes;
|
||||
(function (Kubernetes) {
|
||||
var consts = (function () {
|
||||
function consts() {
|
||||
}
|
||||
Object.defineProperty(consts.prototype, "NAMESPACE_STORAGE_KEY", {
|
||||
get: function () { return "k8sSelectedNamespace"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return consts;
|
||||
})();
|
||||
Kubernetes.consts = consts;
|
||||
Kubernetes.Constants = new consts();
|
||||
var WatchTypes = (function () {
|
||||
function WatchTypes() {
|
||||
}
|
||||
Object.defineProperty(WatchTypes, "ENDPOINTS", {
|
||||
get: function () { return "endpoints"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "EVENTS", {
|
||||
get: function () { return "events"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "NAMESPACES", {
|
||||
get: function () { return "namespaces"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "NODES", {
|
||||
get: function () { return "nodes"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "PERSISTENT_VOLUMES", {
|
||||
get: function () { return "persistentvolumes"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "PERSISTENT_VOLUME_CLAIMS", {
|
||||
get: function () { return "persistentvolumeclaims"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "PODS", {
|
||||
get: function () { return "pods"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "REPLICATION_CONTROLLERS", {
|
||||
get: function () { return "replicationcontrollers"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "RESOURCE_QUOTAS", {
|
||||
get: function () { return "resourcequotas"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "OAUTH_CLIENTS", {
|
||||
get: function () { return "oauthclients"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "SECRETS", {
|
||||
get: function () { return "secrets"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "SERVICES", {
|
||||
get: function () { return "services"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "SERVICE_ACCOUNTS", {
|
||||
get: function () { return "serviceaccounts"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "TEMPLATES", {
|
||||
get: function () { return "templates"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "ROUTES", {
|
||||
get: function () { return "routes"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "BUILD_CONFIGS", {
|
||||
get: function () { return "buildconfigs"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "BUILDS", {
|
||||
get: function () { return "builds"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "DEPLOYMENT_CONFIGS", {
|
||||
get: function () { return "deploymentconfigs"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "IMAGE_STREAMS", {
|
||||
get: function () { return "imagestreams"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "POLICIES", {
|
||||
get: function () { return "policies"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "POLICY_BINDINGS", {
|
||||
get: function () { return "policybindings"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "PROJECTS", {
|
||||
get: function () { return "projects"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "ROLE_BINDINGS", {
|
||||
get: function () { return "rolebindings"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchTypes, "ROLES", {
|
||||
get: function () { return "roles"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return WatchTypes;
|
||||
})();
|
||||
Kubernetes.WatchTypes = WatchTypes;
|
||||
var NamespacedTypes = (function () {
|
||||
function NamespacedTypes() {
|
||||
}
|
||||
Object.defineProperty(NamespacedTypes, "k8sTypes", {
|
||||
get: function () {
|
||||
return [
|
||||
WatchTypes.ENDPOINTS,
|
||||
WatchTypes.EVENTS,
|
||||
WatchTypes.NODES,
|
||||
WatchTypes.PERSISTENT_VOLUMES,
|
||||
WatchTypes.PERSISTENT_VOLUME_CLAIMS,
|
||||
WatchTypes.PODS,
|
||||
WatchTypes.REPLICATION_CONTROLLERS,
|
||||
WatchTypes.RESOURCE_QUOTAS,
|
||||
WatchTypes.PERSISTENT_VOLUMES,
|
||||
WatchTypes.SECRETS,
|
||||
WatchTypes.SERVICES,
|
||||
WatchTypes.SERVICE_ACCOUNTS
|
||||
];
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(NamespacedTypes, "osTypes", {
|
||||
get: function () {
|
||||
return [
|
||||
WatchTypes.TEMPLATES,
|
||||
WatchTypes.BUILD_CONFIGS,
|
||||
WatchTypes.ROUTES,
|
||||
WatchTypes.BUILDS,
|
||||
WatchTypes.BUILD_CONFIGS,
|
||||
WatchTypes.DEPLOYMENT_CONFIGS,
|
||||
WatchTypes.IMAGE_STREAMS,
|
||||
WatchTypes.OAUTH_CLIENTS,
|
||||
WatchTypes.POLICIES,
|
||||
WatchTypes.POLICY_BINDINGS,
|
||||
WatchTypes.PROJECTS,
|
||||
];
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return NamespacedTypes;
|
||||
})();
|
||||
Kubernetes.NamespacedTypes = NamespacedTypes;
|
||||
var WatchActions = (function () {
|
||||
function WatchActions() {
|
||||
}
|
||||
Object.defineProperty(WatchActions, "ANY", {
|
||||
get: function () { return "*"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchActions, "ADDED", {
|
||||
get: function () { return "ADDED"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchActions, "MODIFIED", {
|
||||
get: function () { return "MODIFIED"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(WatchActions, "DELETED", {
|
||||
get: function () { return "DELETED"; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return WatchActions;
|
||||
})();
|
||||
Kubernetes.WatchActions = WatchActions;
|
||||
})(Kubernetes || (Kubernetes = {}));
|
||||
//# sourceMappingURL=kubernetesInterfaces.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,237 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="kubernetesHelpers.ts"/>
|
||||
var Kubernetes;
|
||||
(function (Kubernetes) {
|
||||
Kubernetes._module = angular.module(Kubernetes.pluginName, ['hawtio-core', 'hawtio-ui', 'ui.codemirror', 'ui.validate', 'kubernetesUI']);
|
||||
Kubernetes.controller = PluginHelpers.createControllerFunction(Kubernetes._module, Kubernetes.pluginName);
|
||||
Kubernetes.route = PluginHelpers.createRoutingFunction(Kubernetes.templatePath);
|
||||
Kubernetes._module.config(['$routeProvider', function ($routeProvider) {
|
||||
$routeProvider
|
||||
.when(UrlHelpers.join(Kubernetes.context, '/pods'), Kubernetes.route('pods.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'replicationControllers'), Kubernetes.route('replicationControllers.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'services'), Kubernetes.route('services.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'events'), Kubernetes.route('events.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'apps'), Kubernetes.route('apps.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'apps/:namespace'), Kubernetes.route('apps.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'templates'), Kubernetes.route('templates.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'hosts'), Kubernetes.route('hosts.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'hosts/:id'), Kubernetes.route('host.html', true))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'pipelines'), Kubernetes.route('pipelines.html', false))
|
||||
.when(UrlHelpers.join(Kubernetes.context, 'overview'), Kubernetes.route('overview.html', true))
|
||||
.when(Kubernetes.context, { redirectTo: UrlHelpers.join(Kubernetes.context, 'replicationControllers') });
|
||||
angular.forEach([Kubernetes.context, "/workspaces/:workspace/projects/:project"], function (context) {
|
||||
$routeProvider
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/podCreate'), Kubernetes.route('podCreate.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/podEdit/:id'), Kubernetes.route('podEdit.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/pods'), Kubernetes.route('pods.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/pods/:id'), Kubernetes.route('pod.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/replicationControllers'), Kubernetes.route('replicationControllers.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/replicationControllers/:id'), Kubernetes.route('replicationController.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/replicationControllerCreate'), Kubernetes.route('replicationControllerCreate.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/replicationControllerEdit/:id'), Kubernetes.route('replicationControllerEdit.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/secrets'), Kubernetes.route('secrets.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/secrets/:id'), Kubernetes.route('secret.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/secretCreate'), Kubernetes.route('secret.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/services'), Kubernetes.route('services.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/services/:id'), Kubernetes.route('service.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/serviceCreate'), Kubernetes.route('serviceCreate.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/serviceEdit/:id'), Kubernetes.route('serviceEdit.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/events'), Kubernetes.route('events.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/apps'), Kubernetes.route('apps.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/overview'), Kubernetes.route('overview.html', true))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace/templates/:targetNamespace'), Kubernetes.route('templates.html', false))
|
||||
.when(UrlHelpers.join(context, '/namespace/:namespace'), Kubernetes.route('apps.html', false))
|
||||
.when(UrlHelpers.join(context, 'builds'), Kubernetes.route('builds.html', false))
|
||||
.when(UrlHelpers.join(context, 'builds/:id'), Kubernetes.route('build.html', true))
|
||||
.when(UrlHelpers.join(context, 'buildLogs/:id'), Kubernetes.route('buildLogs.html', true))
|
||||
.when(UrlHelpers.join(context, 'buildConfigs'), Kubernetes.route('buildConfigs.html', false))
|
||||
.when(UrlHelpers.join(context, 'buildConfigs/:id'), Kubernetes.route('buildConfig.html', true))
|
||||
.when(UrlHelpers.join(context, 'buildConfigEdit/:id'), Kubernetes.route('buildConfigEdit.html', true))
|
||||
.when(UrlHelpers.join(context, 'deploymentConfigs'), Kubernetes.route('deploymentConfigs.html', false))
|
||||
.when(UrlHelpers.join(context, 'deploymentConfigs/:id'), Kubernetes.route('deploymentConfig.html', true))
|
||||
.when(UrlHelpers.join(context, 'imageRepositories'), Kubernetes.route('imageRepositories.html', false));
|
||||
});
|
||||
angular.forEach([Kubernetes.context, "/workspaces/:workspace", "/workspaces/:workspace/projects/:project"], function (context) {
|
||||
$routeProvider
|
||||
.when(UrlHelpers.join(context, 'buildConfigEdit'), Kubernetes.route('buildConfigEdit.html', true))
|
||||
.when(UrlHelpers.join(context, 'buildConfigEdit/:id'), Kubernetes.route('buildConfigEdit.html', true))
|
||||
.when(UrlHelpers.join(context, 'importProject'), Kubernetes.route('importProject.html', true));
|
||||
});
|
||||
}]);
|
||||
Kubernetes._module.factory('AppLibraryURL', ['$rootScope', function ($rootScope) {
|
||||
return UrlHelpers.join(Kubernetes.kubernetesApiUrl(), "/proxy", Kubernetes.kubernetesNamespacePath(), "/services/app-library");
|
||||
}]);
|
||||
Kubernetes._module.factory('WikiGitUrlPrefix', function () {
|
||||
return UrlHelpers.join(Kubernetes.kubernetesApiUrl(), "/proxy", Kubernetes.kubernetesNamespacePath(), "services/app-library");
|
||||
});
|
||||
Kubernetes._module.factory('wikiRepository', ["$location", "localStorage", function ($location, localStorage) {
|
||||
return false;
|
||||
}]);
|
||||
Kubernetes._module.factory('ConnectDialogService', ['$rootScope', function ($rootScope) {
|
||||
return {
|
||||
dialog: new UI.Dialog(),
|
||||
saveCredentials: false,
|
||||
userName: null,
|
||||
password: null,
|
||||
jolokiaUrl: null,
|
||||
containerName: null,
|
||||
view: null
|
||||
};
|
||||
}]);
|
||||
Kubernetes._module.filter('kubernetesPageLink', function () { return Kubernetes.entityPageLink; });
|
||||
Kubernetes._module.filter('relativeTime', function () {
|
||||
return function (date) {
|
||||
return humandate.relativeTime(date);
|
||||
};
|
||||
});
|
||||
Kubernetes._module.run(['viewRegistry', 'ServiceRegistry', 'HawtioNav', 'KubernetesModel', '$templateCache', function (viewRegistry, ServiceRegistry, HawtioNav, KubernetesModel, $templateCache) {
|
||||
Kubernetes.log.debug("Running");
|
||||
viewRegistry['kubernetes'] = Kubernetes.templatePath + 'layoutKubernetes.html';
|
||||
//viewRegistry['kubernetes'] = Configs.templatePath + 'shareLayout.html';
|
||||
var builder = HawtioNav.builder();
|
||||
var apps = builder.id('kube-apps')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'apps'); })
|
||||
.title(function () { return 'Apps'; })
|
||||
.build();
|
||||
var services = builder.id('kube-services')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'services'); })
|
||||
.title(function () { return 'Services'; })
|
||||
.build();
|
||||
var controllers = builder.id('kube-controllers')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'replicationControllers'); })
|
||||
.title(function () { return 'oracle服务'; })
|
||||
.build();
|
||||
var pods = builder.id('kube-pods')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'pods'); })
|
||||
.title(function () { return '测试页面'; })
|
||||
.build();
|
||||
var events = builder.id('kube-events')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'events'); })
|
||||
.title(function () { return '服务启动日志'; })
|
||||
.build();
|
||||
var hosts = builder.id('kube-hosts')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'hosts'); })
|
||||
.title(function () { return '集群节点'; })
|
||||
.build();
|
||||
var overview = builder.id('kube-overview')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'overview'); })
|
||||
.title(function () { return 'Diagram'; })
|
||||
.build();
|
||||
var builds = builder.id('kube-builds')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'builds'); })
|
||||
.title(function () { return 'Builds'; })
|
||||
.build();
|
||||
var buildConfigs = builder.id('kube-buildConfigs')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'buildConfigs'); })
|
||||
.title(function () { return 'Build Configs'; })
|
||||
.build();
|
||||
var deploys = builder.id('kube-deploys')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'deploymentConfigs'); })
|
||||
.title(function () { return 'Deploys'; })
|
||||
.build();
|
||||
var imageRepositories = builder.id('kube-imageRepositories')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'imageRepositories'); })
|
||||
.title(function () { return 'Registries'; })
|
||||
.build();
|
||||
var pipelines = builder.id('kube-pipelines')
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'pipelines'); })
|
||||
.title(function () { return 'Pipelines'; })
|
||||
.build();
|
||||
var repos = builder.id('kube-repos')
|
||||
.href(function () { return "/forge/repos"; })
|
||||
.isValid(function () { return ServiceRegistry.hasService(Kubernetes.fabric8ForgeServiceName) && ServiceRegistry.hasService(Kubernetes.gogsServiceName); })
|
||||
.title(function () { return 'Repositories'; })
|
||||
.build();
|
||||
var mainTab = builder.id('kubernetes')
|
||||
.rank(100)
|
||||
.defaultPage({
|
||||
rank: 20,
|
||||
isValid: function (yes, no) {
|
||||
yes();
|
||||
}
|
||||
})
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, "/namespace/default/replicationControllers"); })
|
||||
.title(function () { return '服务集群'; })
|
||||
.tabs(controllers, pods, events)
|
||||
.build();
|
||||
HawtioNav.add(mainTab);
|
||||
/* testKubernetesModel
|
||||
HawtioNav.add({
|
||||
id: 'k8sAppSwitcher',
|
||||
title: () => '', // not used as 'template' below overrides this
|
||||
isValid: () => KubernetesModel.serviceApps.length > 0,
|
||||
context: true,
|
||||
template: () => $templateCache.get(UrlHelpers.join(templatePath, 'serviceApps.html'))
|
||||
});
|
||||
*/
|
||||
var projectsTab = builder.id('openshift')
|
||||
.rank(100)
|
||||
.href(function () { return UrlHelpers.join(Kubernetes.context, 'buildConfigs') + '?sub-tab=kube-buildConfigs'; })
|
||||
.title(function () { return 'Projects'; })
|
||||
.tabs(repos, buildConfigs, builds, deploys, imageRepositories)
|
||||
.build();
|
||||
//HawtioNav.add(projectsTab);
|
||||
}]);
|
||||
hawtioPluginLoader.registerPreBootstrapTask({
|
||||
name: 'KubernetesInit',
|
||||
task: function (next) {
|
||||
$.getScript('osconsole/config.js')
|
||||
.done(function (script, textStatus) {
|
||||
var config = Kubernetes.osConfig = window['OPENSHIFT_CONFIG'];
|
||||
Kubernetes.log.debug("Fetched OAuth config: ", config);
|
||||
var master = config.master_uri;
|
||||
if (!master && config.api && config.api.k8s) {
|
||||
var masterUri = new URI().host(config.api.k8s.hostPort).path("").query("");
|
||||
if (config.api.k8s.proto) {
|
||||
masterUri.protocol(config.api.k8s.proto);
|
||||
}
|
||||
master = masterUri.toString();
|
||||
}
|
||||
OSOAuthConfig = config.openshift;
|
||||
GoogleOAuthConfig = config.google;
|
||||
KeycloakConfig = config.keycloak;
|
||||
if (OSOAuthConfig && !master) {
|
||||
// TODO auth.master_uri no longer used right?
|
||||
// master = OSOAuthConfig.master_uri;
|
||||
if (!master) {
|
||||
var oauth_authorize_uri = OSOAuthConfig.oauth_authorize_uri;
|
||||
if (oauth_authorize_uri) {
|
||||
var text = oauth_authorize_uri;
|
||||
var idx = text.indexOf("://");
|
||||
if (idx > 0) {
|
||||
idx += 3;
|
||||
idx = text.indexOf("/", idx);
|
||||
if (idx > 0) {
|
||||
master = text.substring(0, ++idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((!Kubernetes.masterUrl || Kubernetes.masterUrl === "/") && (!master || master === "/")) {
|
||||
// lets default the master to the current protocol and host/port
|
||||
// in case the master url is "/" and we are
|
||||
// serving up static content from inside /api/v1/namespaces/default/services/fabric8 or something like that
|
||||
var href = location.href;
|
||||
if (href) {
|
||||
master = new URI(href).query("").path("").toString();
|
||||
}
|
||||
}
|
||||
if (master) {
|
||||
Kubernetes.masterUrl = master;
|
||||
next();
|
||||
return;
|
||||
}
|
||||
})
|
||||
.fail(function (response) {
|
||||
Kubernetes.log.debug("Error fetching OAUTH config: ", response);
|
||||
})
|
||||
.always(function () {
|
||||
next();
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
hawtioPluginLoader.addModule('ngResource');
|
||||
hawtioPluginLoader.addModule(Kubernetes.pluginName);
|
||||
})(Kubernetes || (Kubernetes = {}));
|
||||
//# sourceMappingURL=kubernetesPlugin.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,509 @@
|
|||
/*
|
||||
read a object from jiangsu province , such as nanjing with some information
|
||||
读取江苏的某个地区的信息,以及系统信息
|
||||
*/
|
||||
var Kubernetes;
|
||||
(function (Kubernetes) {
|
||||
Kubernetes.system_arr = [{ "sys_name": "部门预算", "sys_id": "1" }, { "sys_name": "非税收入收缴管理系统", "sys_id": "2" },
|
||||
{ "sys_name": "预算执行系统", "sys_id": "3" }, { "sys_name": "资产管理系统", "sys_id": "4" }, { "sys_name": "用友财政综合管理信息系统", "sys_id": "5" },
|
||||
{ "sys_name": "用友A++", "sys_id": "6" }, { "sys_name": "浦口财政一体化", "sys_id": "7" }, { "sys_name": "栖霞区财政业务信息管理系统", "sys_id": "8" },
|
||||
{ "sys_name": "一体化系统", "sys_id": "9" }, { "sys_name": "财政管理一体化系统", "sys_id": "10" }, { "sys_name": "滨江开发区财政分局", "sys_id": "11" },
|
||||
{ "sys_name": "江宁经济技术开发区财政分局", "sys_id": "12" }, { "sys_name": "江宁科学园财政分局", "sys_id": "13" }, { "sys_name": "财政一体化系统", "sys_id": "14" },
|
||||
{ "sys_name": "A++财政一体化平台", "sys_id": "15" }, { "sys_name": "非税系统", "sys_id": "16" }, { "sys_name": "一体化预算执行系统", "sys_id": "17" },
|
||||
{ "sys_name": "一体化", "sys_id": "18" }, { "sys_name": "国库集中支付管理信息系统", "sys_id": "19" }, { "sys_name": "国库集中支付", "sys_id": "20" },
|
||||
{ "sys_name": "财政专户核算及非税系统", "sys_id": "21" }, { "sys_name": "集中支付系统", "sys_id": "22" }, { "sys_name": "财政专户核算系统", "sys_id": "23" },
|
||||
{ "sys_name": "非税收缴系统", "sys_id": "24" }, { "sys_name": "财政一体化平台", "sys_id": "25" }, { "sys_name": "富深预算执行", "sys_id": "26" },
|
||||
{ "sys_name": "用友非税及票据", "sys_id": "27" }, { "sys_name": "用友预算执行", "sys_id": "28" }, { "sys_name": "江苏省财政预算执行系统", "sys_id": "29" },
|
||||
{ "sys_name": "用友通用软件", "sys_id": "30" }, { "sys_name": "联友软件/通用财务", "sys_id": "31" }, { "sys_name": "用友GRPG-U8R10财政管理软件", "sys_id": "32" },
|
||||
{ "sys_name": "用友GPP-R10财政管理软件", "sys_id": "33" }, { "sys_name": "富深协通财政一体化管理信息系统", "sys_id": "34" }, { "sys_name": "财务统一核算系统", "sys_id": "35" },
|
||||
{ "sys_name": "公共财政管理软件", "sys_id": "36" }, { "sys_name": "A++财政一体化信息平台", "sys_id": "37" }, { "sys_name": "新中大公共财务管理软件", "sys_id": "38" },
|
||||
{ "sys_name": "富深财政一体化管理系统", "sys_id": "39" }, { "sys_name": "新中大公共财政管理系统", "sys_id": "40" }, { "sys_name": "富深协通财政一体化业务管理系统软件", "sys_id": "41" },
|
||||
{ "sys_name": "新中大公共财政管理软件Gsoft", "sys_id": "42" }, { "sys_name": "财政一体化业务系统", "sys_id": "43" }, { "sys_name": "财政一体化软件", "sys_id": "44" },
|
||||
{ "sys_name": "非税收入系统", "sys_id": "45" }, { "sys_name": "总预算系统", "sys_id": "46" }, { "sys_name": "国库集中支付系统", "sys_id": "47" }, { "sys_name": "用款计划系统", "sys_id": "48" },
|
||||
{ "sys_name": "指标管理系统", "sys_id": "49" }, { "sys_name": "财政综合业务管理平台", "sys_id": "50" }, { "sys_name": "财政一体化管理信息系统", "sys_id": "51" }, { "sys_name": "工资统发", "sys_id": "52" },
|
||||
{ "sys_name": "国有资产", "sys_id": "53" }, { "sys_name": "乡镇非税收入", "sys_id": "54" }, { "sys_name": "乡镇集中支付", "sys_id": "55" }, { "sys_name": "非税征缴系统", "sys_id": "56" },
|
||||
{ "sys_name": "预算编制与执行系统", "sys_id": "57" }, { "sys_name": "预算管理综合业务平台", "sys_id": "58" }, { "sys_name": "u8管理软件", "sys_id": "59" }, { "sys_name": "财政指标管理系统", "sys_id": "60" },
|
||||
{ "sys_name": "用友GRP-R9财务管理软件", "sys_id": "61" }, { "sys_name": "用友GRP-U8财政管理软件", "sys_id": "62" }, { "sys_name": "账务处理系统", "sys_id": "63" }, { "sys_name": "R9i财政管理软件", "sys_id": "64" },
|
||||
{ "sys_name": "u8财政管理软件", "sys_id": "65" }, { "sys_name": "相城区财政综合管理信息系统", "sys_id": "66" }, { "sys_name": "财政非税综合管理系统", "sys_id": "67" }, { "sys_name": "财政综合管理平台", "sys_id": "68" },
|
||||
{ "sys_name": "吴江区财政一体化", "sys_id": "69" }, { "sys_name": "用友R9", "sys_id": "70" }, { "sys_name": "财政公共应用服务平台", "sys_id": "71" }, { "sys_name": "金蝶K/3创新管理平台", "sys_id": "72" }, { "sys_name": "账务数据系统", "sys_id": "73" },
|
||||
{ "sys_name": "公共财政服务平台", "sys_id": "74" }, { "sys_name": "会计核算系统", "sys_id": "75" }, { "sys_name": "项目库", "sys_id": "76" }, { "sys_name": "财政总预算(外)专户管理系统", "sys_id": "77" },
|
||||
{ "sys_name": "城建资金专户管理系统", "sys_id": "78" }, { "sys_name": "农保专户管理系统", "sys_id": "79" }, { "sys_name": "农业发展基金专户管理系统", "sys_id": "80" },
|
||||
{ "sys_name": "失地农民保障资金专户", "sys_id": "81" }, { "sys_name": "非税收入征管系统", "sys_id": "82" }, { "sys_name": "工资统发人员信息", "sys_id": "83" },
|
||||
{ "sys_name": "预算指标-国库集中支付系统", "sys_id": "84" }, { "sys_name": "总预算会计核算系统", "sys_id": "85" }, { "sys_name": "部门预算编审系统", "sys_id": "86" },
|
||||
{ "sys_name": "公务消费管理系统", "sys_id": "87" }, { "sys_name": "国有资产管理系统", "sys_id": "88" }, { "sys_name": "区镇财政管理“一体化”系统", "sys_id": "89" },
|
||||
{ "sys_name": "县本级财政管理“一体化”系统", "sys_id": "90" }, { "sys_name": "用友政务", "sys_id": "91" }, { "sys_name": "财政专户核算(行政口专项资金)", "sys_id": "92" },
|
||||
{ "sys_name": "财政专户核算(经建口专项资金)", "sys_id": "93" }, { "sys_name": "财政专户核算(农业保险专账)", "sys_id": "94" }, { "sys_name": "财政专户核算(农业综合开发专账)", "sys_id": "95" },
|
||||
{ "sys_name": "财政专户核算(社保资金专账)", "sys_id": "96" }, { "sys_name": "财政专户核算(土地出让专账)", "sys_id": "97" }, { "sys_name": "财政专户核算(综合口专项资金)", "sys_id": "98" },
|
||||
{ "sys_name": "非税收入管理系统", "sys_id": "99" }, { "sys_name": "农业专向及农业发展基金专项", "sys_id": "100" }, { "sys_name": "总预算会计核算", "sys_id": "101" }, { "sys_name": "金财工程一体化支撑平台", "sys_id": "102" },
|
||||
{ "sys_name": "非税收缴", "sys_id": "103" }, { "sys_name": "学校预算执行", "sys_id": "104" }, { "sys_name": "预算执行", "sys_id": "105" }, { "sys_name": "专项资金", "sys_id": "106" },
|
||||
{ "sys_name": "总预算", "sys_id": "107" }, { "sys_name": "部门预算系统", "sys_id": "108" }, { "sys_name": "财政专户核算", "sys_id": "109" }, { "sys_name": "财政专户账务系统", "sys_id": "110" },
|
||||
{ "sys_name": "富深财政一体化业务管理系统", "sys_id": "111" }, { "sys_name": "国有资产系统", "sys_id": "112" }, { "sys_name": "国库专项资金管理系统", "sys_id": "113" },
|
||||
{ "sys_name": "非税收缴管理系统", "sys_id": "114" }, { "sys_name": "财政管理系统(新农保)", "sys_id": "115" }, { "sys_name": "财政管理系统(城市居民医疗统筹)", "sys_id": "116" },
|
||||
{ "sys_name": "财政管理系统(集中支付中心)", "sys_id": "117" }, { "sys_name": "财政管理系统(解困金)", "sys_id": "118" }, { "sys_name": "财政管理系统(旧城改造)", "sys_id": "119" },
|
||||
{ "sys_name": "财政管理系统(社保资金账户)", "sys_id": "120" }, { "sys_name": "财政管理系统(土地出让专帐)", "sys_id": "121" }, { "sys_name": "财政管理系统(预拨及非集中支付中心)", "sys_id": "122" },
|
||||
{ "sys_name": "财政管理系统(预算外资金)", "sys_id": "123" }, { "sys_name": "总预算会计", "sys_id": "124" }, { "sys_name": "财务核算系统", "sys_id": "125" }, { "sys_name": "工资统发系统", "sys_id": "126" },
|
||||
{ "sys_name": "预算编审系统", "sys_id": "127" }, { "sys_name": "预算管理系统", "sys_id": "128" }, { "sys_name": "预算外资金(从联网审计中取数)", "sys_id": "129" },
|
||||
{ "sys_name": "G6-E财务管理系统", "sys_id": "130" }, { "sys_name": "新中大公共财政管理软件", "sys_id": "131" }, { "sys_name": "用友GRP/R9财政管理软件", "sys_id": "132" },
|
||||
{ "sys_name": "用友GRP-U8R10", "sys_id": "133" }, { "sys_name": "财政一体化管理系统(基建户)", "sys_id": "134" }, { "sys_name": "财政一体化管理系统(集中支付中心)", "sys_id": "135" },
|
||||
{ "sys_name": "财政一体化管理系统(农业综合开发)", "sys_id": "136" }, { "sys_name": "财政一体化管理系统(预算外资金)", "sys_id": "137" }, { "sys_name": "财政一体化管理系统(支农专户)", "sys_id": "138" },
|
||||
{ "sys_name": "财政一体化管理系统(总预算)", "sys_id": "139" }, { "sys_name": "国资管理系统", "sys_id": "140" }, { "sys_name": "乡财县管系统", "sys_id": "141" }, { "sys_name": "预算编制管理系统", "sys_id": "142" },
|
||||
{ "sys_name": "盐城市_市本级_部门预算", "sys_id": "143" }, { "sys_name": "盐城市_市本级_非税收管理系统", "sys_id": "144" }, { "sys_name": "盐城市_市本级_预算执行系统", "sys_id": "145" },
|
||||
{ "sys_name": "盐城市_亭湖区_财政专户", "sys_id": "146" }, { "sys_name": "盐城市_亭湖区_非税收入管理", "sys_id": "147" }, { "sys_name": "盐城市_亭湖区_国库集中支付管理", "sys_id": "148" },
|
||||
{ "sys_name": "盐城市_亭湖区_预算指标管理", "sys_id": "149" }, { "sys_name": "盐城市_亭湖区_总预算会计核算", "sys_id": "150" }, { "sys_name": "盐城市_盐都区_财政专户核算系统", "sys_id": "151" },
|
||||
{ "sys_name": "盐城市_盐都区_非税收入管理系统", "sys_id": "152" }, { "sys_name": "盐城市_盐都区_国库集中支付系统", "sys_id": "153" }, { "sys_name": "盐城市_盐都区_总预算会计核算系统", "sys_id": "154" },
|
||||
{ "sys_name": "盐城市_响水县_部门预算管理系统", "sys_id": "155" }, { "sys_name": "盐城市_响水县_财政一体化信息系统", "sys_id": "156" }, { "sys_name": "盐城市_响水县_非税收入收缴管理系统", "sys_id": "157" },
|
||||
{ "sys_name": "盐城市_滨海县财政一体化", "sys_id": "158" }, { "sys_name": "盐城市_阜宁县_财政管理软件", "sys_id": "159" }, { "sys_name": "盐城市_阜宁县_财政管理软件用友U8", "sys_id": "160" },
|
||||
{ "sys_name": "盐城市_射阳县_财政预算执行一体化系统", "sys_id": "161" }, { "sys_name": "盐城市_建湖县_非税收缴", "sys_id": "162" },
|
||||
{ "sys_name": "盐城市_建湖县_财政一体化", "sys_id": "163" }, { "sys_name": "盐城市_建湖县_国库集中支付", "sys_id": "164" },
|
||||
{ "sys_name": "盐城市_东台市_部门预算编审系统", "sys_id": "165" }, { "sys_name": "盐城市_东台市_财政一体化信息系统", "sys_id": "166" },
|
||||
{ "sys_name": "盐城市_东台市_财政专户核算系统", "sys_id": "167" }, { "sys_name": "盐城市_东台市_非税收入收缴管理系统", "sys_id": "168" },
|
||||
{ "sys_name": "盐城市_东台市_总预算会计核算系统", "sys_id": "169" }, { "sys_name": "盐城市_大丰区_部门预算系统", "sys_id": "170" },
|
||||
{ "sys_name": "盐城市_大丰区_财政一体化", "sys_id": "171" }, { "sys_name": "盐城市_大丰区_总预算会计核算财务软件", "sys_id": "172" },
|
||||
{ "sys_name": "盐城市_经济技术开发区_部门预算软件", "sys_id": "173" }, { "sys_name": "盐城市_经济技术开发区_国库集中支付", "sys_id": "174" },
|
||||
{ "sys_name": "老非税收入征缴系统", "sys_id": "175" }, { "sys_name": "扬州财政一体化信息管理系统", "sys_id": "176" }, { "sys_name": "非税收入征收", "sys_id": "177" },
|
||||
{ "sys_name": "部门预算编制", "sys_id": "178" }, { "sys_name": "非税收入收缴", "sys_id": "179" }, { "sys_name": "行政事业性单位国有资产管理", "sys_id": "180" },
|
||||
{ "sys_name": "财政业务系统", "sys_id": "181" }, { "sys_name": "财政业务综合系统", "sys_id": "182" }, { "sys_name": "江都开发区预算执行系统", "sys_id": "183" },
|
||||
{ "sys_name": "财政一体化", "sys_id": "184" }, { "sys_name": "富深协通财政一体化业务管理系统", "sys_id": "185" }, { "sys_name": "富深协通非税收缴系统", "sys_id": "186" },
|
||||
{ "sys_name": "富深协通工资统发系统", "sys_id": "187" }, { "sys_name": "非税收入", "sys_id": "188" }, { "sys_name": "财政综合业务系统", "sys_id": "189" },
|
||||
{ "sys_name": "泰州市_市本级_部门预算系统", "sys_id": "190" }, { "sys_name": "泰州市_市本级_非税收入系统", "sys_id": "191" }, { "sys_name": "泰州市_市本级_绩效管理系统", "sys_id": "192" },
|
||||
{ "sys_name": "泰州市_市本级_预算执行系统", "sys_id": "193" }, { "sys_name": "泰州市_市本级_综合治税系统", "sys_id": "194" }, { "sys_name": "泰州市_海陵区_部门预算编制系统", "sys_id": "195" },
|
||||
{ "sys_name": "泰州市_海陵区_县区财政一体化", "sys_id": "196" }, { "sys_name": "泰州市_高港区_预算执行系统", "sys_id": "197" },
|
||||
{ "sys_name": "泰州市_姜堰区_部门预算系统", "sys_id": "198" }, { "sys_name": "泰州市_姜堰区_财政一体化系统", "sys_id": "199" },
|
||||
{ "sys_name": "泰州市_姜堰区_非税收缴系统", "sys_id": "200" }, { "sys_name": "泰州市_姜堰区_预算执行系统", "sys_id": "201" },
|
||||
{ "sys_name": "泰州市_医药高新区_财政一体化系统", "sys_id": "202" }, { "sys_name": "泰州市_兴化市_部门预算", "sys_id": "203" },
|
||||
{ "sys_name": "泰州市_兴化市_非税收缴", "sys_id": "204" }, { "sys_name": "泰州市_兴化市_国库集中支付", "sys_id": "205" },
|
||||
{ "sys_name": "泰州市_靖江市_预算执行系统", "sys_id": "206" }, { "sys_name": "泰州市_靖江市_非税收入收缴", "sys_id": "207" },
|
||||
{ "sys_name": "泰州市_靖江市_部门预算编审系统", "sys_id": "208" }, { "sys_name": "泰州市_泰兴市_部门预算系统", "sys_id": "209" },
|
||||
{ "sys_name": "泰州市_泰兴市_非税收入管理系统", "sys_id": "210" }, { "sys_name": "泰州市_泰兴市_预算执行系统", "sys_id": "211" },
|
||||
{ "sys_name": "部门预算管理系统", "sys_id": "212" }, { "sys_name": "财政一体化平台及国库集中支付系统", "sys_id": "213" },
|
||||
{ "sys_name": "新中大非税收入管理", "sys_id": "214" }, { "sys_name": "联友财务管理系统", "sys_id": "215" }, { "sys_name": "国库集中支付、指标管理系统", "sys_id": "216" },
|
||||
{ "sys_name": "开发区总预算系统", "sys_id": "217" }, { "sys_name": "国库账务系统", "sys_id": "218" }, { "sys_name": "化学工业园区非税收入管理系统", "sys_id": "219" },
|
||||
{ "sys_name": "非税收入账套", "sys_id": "220" }, { "sys_name": "化学工业园区预算执行系统", "sys_id": "221" }, { "sys_name": "会计核算", "sys_id": "222" },
|
||||
{ "sys_name": "总预算会计账", "sys_id": "223" }, { "sys_name": "预算内外收支核算系统", "sys_id": "224" }, { "sys_name": "账户核算系统", "sys_id": "225" },
|
||||
{ "sys_name": "总预算核算系统", "sys_id": "226" }, { "sys_name": "账务处理系统(收支分类改革升级版)", "sys_id": "227" }, { "sys_name": "财政预算外业务", "sys_id": "228" },
|
||||
{ "sys_name": "用友U8R10财政一体化平台", "sys_id": "229" }, { "sys_name": "开发区财政系统", "sys_id": "230" }, { "sys_name": "高新区总预算系统", "sys_id": "231" },
|
||||
{ "sys_name": "开发区公共财政服务平台", "sys_id": "232" }, { "sys_name": "用友GRP-U8管理软件", "sys_id": "233" }, { "sys_name": "盐城市_城南新区_国库集中支付系统", "sys_id": "234" },
|
||||
{ "sys_name": "盐城市_城南新区_总预算账务处理系统", "sys_id": "235" }, { "sys_name": "财政预算指标管理", "sys_id": "236" }, { "sys_name": "泰州市_市本级_行政管理系统", "sys_id": "237" },
|
||||
{ "sys_name": "新中大财务软件", "sys_id": "238" }, { "sys_name": "开发区新中大财务核算系统", "sys_id": "239" }, { "sys_name": "开发区账务系统", "sys_id": "240" }];
|
||||
Kubernetes.origin_place_arr = [{ "city_code": "3201", "city": "南京市", "county": "市本级", "county_code": "320100", "sys_name": "部门预算", "sys_code": "BMYS" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "市本级", "county_code": "320100", "sys_name": "非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "市本级", "county_code": "320100", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "市本级", "county_code": "320100", "sys_name": "资产管理系统", "sys_code": "ZCGL" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "玄武区", "county_code": "320102", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "秦淮区", "county_code": "320104", "sys_name": "用友财政综合管理信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "建邺区", "county_code": "320105", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "鼓楼区", "county_code": "320106", "sys_name": "用友A++", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "浦口区", "county_code": "320111", "sys_name": "浦口财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "栖霞区", "county_code": "320113", "sys_name": "栖霞区财政业务信息管理系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "雨花台区", "county_code": "320114", "sys_name": "一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "江宁区", "county_code": "320115", "sys_name": "财政管理一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "江宁区", "county_code": "320115", "sys_name": "滨江开发区财政分局", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "江宁区", "county_code": "320115", "sys_name": "江宁经济技术开发区财政分局", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "江宁区", "county_code": "320115", "sys_name": "江宁科学园财政分局", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "六合区", "county_code": "320116", "sys_name": "一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "高淳区", "county_code": "320118", "sys_name": "财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "溧水区", "county_code": "320124", "sys_name": "A++财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "市本级", "county_code": "320200", "sys_name": "财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "市本级", "county_code": "320200", "sys_name": "非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "崇安区", "county_code": "320202", "sys_name": "非税系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "崇安区", "county_code": "320202", "sys_name": "一体化预算执行系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "南长区", "county_code": "320203", "sys_name": "非税系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "南长区", "county_code": "320203", "sys_name": "一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "北塘区", "county_code": "320204", "sys_name": "国库集中支付管理信息系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "锡山区", "county_code": "320205", "sys_name": "国库集中支付", "sys_code": "GKZF" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "锡山区", "county_code": "320205", "sys_name": "财政专户核算及非税系统", "sys_code": "ZHHS_FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "惠山区", "county_code": "320206", "sys_name": "财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "滨湖区", "county_code": "320211", "sys_name": "集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "滨湖区", "county_code": "320211", "sys_name": "非税系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "滨湖区", "county_code": "320211", "sys_name": "财政专户核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "新区", "county_code": "320214", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "新区", "county_code": "320214", "sys_name": "非税收缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "新区", "county_code": "320214", "sys_name": "财政专户核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "江阴市", "county_code": "320281", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "宜兴市", "county_code": "320282", "sys_name": "非税收缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "宜兴市", "county_code": "320282", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "市本级", "county_code": "320300", "sys_name": "富深预算执行", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "市本级", "county_code": "320300", "sys_name": "用友非税及票据", "sys_code": "FSSR" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "市本级", "county_code": "320300", "sys_name": "用友预算执行", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "鼓楼区", "county_code": "320302", "sys_name": "江苏省财政预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "鼓楼区", "county_code": "320302", "sys_name": "用友通用软件", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "云龙区", "county_code": "320303", "sys_name": "江苏省财政预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "云龙区", "county_code": "320303", "sys_name": "联友软件/通用财务", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "云龙区", "county_code": "320303", "sys_name": "用友GRPG-U8R10财政管理软件", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "贾汪区", "county_code": "320305", "sys_name": "用友GPP-R10财政管理软件", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "泉山区", "county_code": "320311", "sys_name": "富深协通财政一体化管理信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "铜山区", "county_code": "320312", "sys_name": "财务统一核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "铜山区", "county_code": "320312", "sys_name": "非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "铜山区", "county_code": "320312", "sys_name": "公共财政管理软件", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "丰县", "county_code": "320321", "sys_name": "A++财政一体化信息平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "丰县", "county_code": "320321", "sys_name": "新中大公共财务管理软件", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "沛县", "county_code": "320322", "sys_name": "富深财政一体化管理系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "沛县", "county_code": "320322", "sys_name": "新中大公共财政管理系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "睢宁县", "county_code": "320324", "sys_name": "富深协通财政一体化业务管理系统软件", "sys_code": "YTH" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "睢宁县", "county_code": "320324", "sys_name": "新中大公共财政管理软件Gsoft", "sys_code": "KJHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "新沂市", "county_code": "320381", "sys_name": "江苏省财政预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "邳州", "county_code": "320382", "sys_name": "财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "本级", "county_code": "320400", "sys_name": "财政一体化业务系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "天宁区", "county_code": "320402", "sys_name": "财政一体化软件", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "天宁区", "county_code": "320402", "sys_name": "非税收入系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "天宁区", "county_code": "320402", "sys_name": "总预算系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区", "county_code": "320404", "sys_name": "非税收入系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区", "county_code": "320404", "sys_name": "国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区", "county_code": "320404", "sys_name": "用款计划系统", "sys_code": "JHGL" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区", "county_code": "320404", "sys_name": "指标管理系统", "sys_code": "ZBGL" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区", "county_code": "320404", "sys_name": "总预算系统", "sys_code": "ZYS" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "新北区", "county_code": "320411", "sys_name": "财政综合业务管理平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "武进区", "county_code": "320412", "sys_name": "财政一体化管理信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳市", "county_code": "320481", "sys_name": "部门预算", "sys_code": "BMYS" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳市", "county_code": "320481", "sys_name": "工资统发", "sys_code": "GZTF" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳市", "county_code": "320481", "sys_name": "国有资产", "sys_code": "ZCGL" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳市", "county_code": "320481", "sys_name": "乡镇非税收入", "sys_code": "XZFS" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳市", "county_code": "320481", "sys_name": "乡镇集中支付", "sys_code": "XZGK" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "金坛区", "county_code": "320482", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "市本级", "county_code": "320500", "sys_name": "非税征缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "市本级", "county_code": "320500", "sys_name": "预算编制与执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "工业园区", "county_code": "320501", "sys_name": "预算管理综合业务平台", "sys_code": "YSGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "虎丘区", "county_code": "320505", "sys_name": "u8管理软件", "sys_code": "CZGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "虎丘区", "county_code": "320505", "sys_name": "财政指标管理系统", "sys_code": "ZBGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "虎丘区", "county_code": "320505", "sys_name": "国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "虎丘区", "county_code": "320505", "sys_name": "用友GRP-R9财务管理软件", "sys_code": "CWGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "虎丘区", "county_code": "320505", "sys_name": "用友GRP-U8财政管理软件", "sys_code": "CWGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "虎丘区", "county_code": "320505", "sys_name": "账务处理系统", "sys_code": "ZWCL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "吴中区", "county_code": "320506", "sys_name": "R9i财政管理软件", "sys_code": "CZGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "吴中区", "county_code": "320506", "sys_name": "部门预算", "sys_code": "BMYS" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "吴中区", "county_code": "320506", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "吴中区", "county_code": "320506", "sys_name": "非税系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "相城区", "county_code": "320507", "sys_name": "u8财政管理软件", "sys_code": "CZGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "相城区", "county_code": "320507", "sys_name": "相城区财政综合管理信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "姑苏区", "county_code": "320508", "sys_name": "财政非税综合管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "姑苏区", "county_code": "320508", "sys_name": "财政综合管理平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "吴江区", "county_code": "320509", "sys_name": "吴江区财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "常熟市", "county_code": "320581", "sys_name": "非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "常熟市", "county_code": "320581", "sys_name": "用友R9", "sys_code": "KJHS" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "常熟市", "county_code": "320581", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "张家港市", "county_code": "320582", "sys_name": "财政公共应用服务平台", "sys_code": "GGFW" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "张家港市", "county_code": "320582", "sys_name": "金蝶K/3创新管理平台", "sys_code": "CZGL" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "张家港市", "county_code": "320582", "sys_name": "账务数据系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "昆山市", "county_code": "320583", "sys_name": "非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "昆山市", "county_code": "320583", "sys_name": "公共财政服务平台", "sys_code": "GGFW" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "昆山市", "county_code": "320583", "sys_name": "国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市", "county_code": "320585", "sys_name": "非税收入系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市", "county_code": "320585", "sys_name": "会计核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市", "county_code": "320585", "sys_name": "项目库", "sys_code": "XMK" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市", "county_code": "320585", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "本级", "county_code": "320600", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "崇川区", "county_code": "320602", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "港闸区", "county_code": "320611", "sys_name": "财政总预算(外)专户管理系统", "sys_code": "YSWZH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "港闸区", "county_code": "320611", "sys_name": "城建资金专户管理系统", "sys_code": "CJZH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "港闸区", "county_code": "320611", "sys_name": "农保专户管理系统", "sys_code": "NBZH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "港闸区", "county_code": "320611", "sys_name": "农业发展基金专户管理系统", "sys_code": "NFJJ" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "港闸区", "county_code": "320611", "sys_name": "失地农民保障资金专户", "sys_code": "SDNM" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "港闸区", "county_code": "320611", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "通州区", "county_code": "320612", "sys_name": "非税收入征管系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "通州区", "county_code": "320612", "sys_name": "工资统发人员信息", "sys_code": "GZTF" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "通州区", "county_code": "320612", "sys_name": "预算指标-国库集中支付系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "通州区", "county_code": "320612", "sys_name": "总预算会计核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海安县", "county_code": "320621", "sys_name": "部门预算编审系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海安县", "county_code": "320621", "sys_name": "公务消费管理系统", "sys_code": "GWXF" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海安县", "county_code": "320621", "sys_name": "国有资产管理系统", "sys_code": "ZCGL" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海安县", "county_code": "320621", "sys_name": "区镇财政管理“一体化”系统", "sys_code": "XZYTH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海安县", "county_code": "320621", "sys_name": "县本级财政管理“一体化”系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "如东县", "county_code": "320623", "sys_name": "用友政务", "sys_code": "YTH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(行政口专项资金)", "sys_code": "ZHXZ" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(经建口专项资金)", "sys_code": "ZHJJ" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(农业保险专账)", "sys_code": "ZHNB" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(农业综合开发专账)", "sys_code": "ZHNF" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(社保资金专账)", "sys_code": "ZHSB" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(土地出让专账)", "sys_code": "ZHTD" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "财政专户核算(综合口专项资金)", "sys_code": "ZHZH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "农业专向及农业发展基金专项", "sys_code": "NFZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "启东市", "county_code": "320681", "sys_name": "总预算会计核算", "sys_code": "KJHS" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "如皋市", "county_code": "320682", "sys_name": "金财工程一体化支撑平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海门市", "county_code": "320684", "sys_name": "非税收缴", "sys_code": "FSSR" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海门市", "county_code": "320684", "sys_name": "学校预算执行", "sys_code": "YSZXXX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海门市", "county_code": "320684", "sys_name": "预算执行", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海门市", "county_code": "320684", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海门市", "county_code": "320684", "sys_name": "专项资金", "sys_code": "ZXZJ" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "海门市", "county_code": "320684", "sys_name": "总预算", "sys_code": "ZYS" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "市本级", "county_code": "320700", "sys_name": "部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "市本级", "county_code": "320700", "sys_name": "财政专户核算", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "市本级", "county_code": "320700", "sys_name": "非税收入系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "市本级", "county_code": "320700", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "连云区", "county_code": "320703", "sys_name": "财政专户账务系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "连云区", "county_code": "320703", "sys_name": "富深财政一体化管理系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "海州区", "county_code": "320706", "sys_name": "富深财政一体化业务管理系统", "sys_code": "" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "海州区", "county_code": "320706", "sys_name": "新中大公共财政管理系统", "sys_code": "" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "赣榆区", "county_code": "320721", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "赣榆区", "county_code": "320721", "sys_name": "国有资产系统", "sys_code": "CZGL" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "东海县", "county_code": "320722", "sys_name": "部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "东海县", "county_code": "320722", "sys_name": "国库专项资金管理系统", "sys_code": "ZXZJ" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "东海县", "county_code": "320722", "sys_name": "国有资产管理系统", "sys_code": "ZCGL" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "东海县", "county_code": "320722", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "灌云县", "county_code": "320723", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "灌南县", "county_code": "320724", "sys_name": "非税系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "灌南县", "county_code": "320724", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "市本级", "county_code": "320800", "sys_name": "非税收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "市本级", "county_code": "320800", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(新农保)", "sys_code": "ZHNB" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(城市居民医疗统筹)", "sys_code": "ZHYB" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(集中支付中心)", "sys_code": "GKZF" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(解困金)", "sys_code": "ZHJK" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(旧城改造)", "sys_code": "ZHCG" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(社保资金账户)", "sys_code": "ZHSB" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(土地出让专帐)", "sys_code": "ZHTD" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(预拨及非集中支付中心)", "sys_code": "ZHYB" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "财政管理系统(预算外资金)", "sys_code": "YSW" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清河区", "county_code": "320802", "sys_name": "总预算会计", "sys_code": "KJHS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "财务核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "工资统发系统", "sys_code": "GZTF" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "用友政务", "sys_code": "YYZW" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "预算编审系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "预算管理系统", "sys_code": "YSGL" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "预算外资金(从联网审计中取数)", "sys_code": "YSW" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "预算编审系统", "sys_code": "YSBS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮阴区", "county_code": "320804", "sys_name": "G6-E财务管理系统", "sys_code": "CWGL" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮阴区", "county_code": "320804", "sys_name": "江苏省财政预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮阴区", "county_code": "320804", "sys_name": "新中大公共财政管理软件", "sys_code": "CZGL" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮阴区", "county_code": "320804", "sys_name": "用友GRP/R9财政管理软件", "sys_code": "CZGL" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮阴区", "county_code": "320804", "sys_name": "用友GRP-U8R10", "sys_code": "CWGL" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "淮安区", "county_code": "320803", "sys_name": "预算编审系统", "sys_code": "YSBS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清浦区", "county_code": "320811", "sys_name": "财政一体化管理系统(基建户)", "sys_code": "ZHJJ" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清浦区", "county_code": "320811", "sys_name": "财政一体化管理系统(集中支付中心)", "sys_code": "GKZF" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清浦区", "county_code": "320811", "sys_name": "财政一体化管理系统(农业综合开发)", "sys_code": "ZHNF" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清浦区", "county_code": "320811", "sys_name": "财政一体化管理系统(预算外资金)", "sys_code": "YSW" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清浦区", "county_code": "320811", "sys_name": "财政一体化管理系统(支农专户)", "sys_code": "ZHZN" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "清浦区", "county_code": "320811", "sys_name": "财政一体化管理系统(总预算)", "sys_code": "KJHS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "涟水县", "county_code": "320826", "sys_name": "非税征缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "涟水县", "county_code": "320826", "sys_name": "国资管理系统", "sys_code": "ZCGL" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "涟水县", "county_code": "320826", "sys_name": "乡财县管系统", "sys_code": "XCXG" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "涟水县", "county_code": "320826", "sys_name": "乡财县管系统", "sys_code": "XCXG" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "涟水县", "county_code": "320826", "sys_name": "预算编制管理系统", "sys_code": "YSBS" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "涟水县", "county_code": "320826", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "洪泽县", "county_code": "320829", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "洪泽县", "county_code": "320829", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "盱眙县", "county_code": "320830", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "金湖县", "county_code": "320831", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "市本级", "county_code": "320900", "sys_name": "盐城市_市本级_部门预算", "sys_code": "BMYS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "市本级", "county_code": "320900", "sys_name": "盐城市_市本级_非税收管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "市本级", "county_code": "320900", "sys_name": "盐城市_市本级_预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "亭湖区", "county_code": "320902", "sys_name": "盐城市_亭湖区_财政专户", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "亭湖区", "county_code": "320902", "sys_name": "盐城市_亭湖区_非税收入管理", "sys_code": "FSSR" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "亭湖区", "county_code": "320902", "sys_name": "盐城市_亭湖区_国库集中支付管理", "sys_code": "GKZF" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "亭湖区", "county_code": "320902", "sys_name": "盐城市_亭湖区_预算指标管理", "sys_code": "ZBGL" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "亭湖区", "county_code": "320902", "sys_name": "盐城市_亭湖区_总预算会计核算", "sys_code": "KJHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "盐都区", "county_code": "320903", "sys_name": "盐城市_盐都区_财政专户核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "盐都区", "county_code": "320903", "sys_name": "盐城市_盐都区_非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "盐都区", "county_code": "320903", "sys_name": "盐城市_盐都区_国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "盐都区", "county_code": "320903", "sys_name": "盐城市_盐都区_总预算会计核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "响水县", "county_code": "320921", "sys_name": "盐城市_响水县_部门预算管理系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "响水县", "county_code": "320921", "sys_name": "盐城市_响水县_财政一体化信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "响水县", "county_code": "320921", "sys_name": "盐城市_响水县_非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "滨海县", "county_code": "320922", "sys_name": "盐城市_滨海县财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "阜宁县", "county_code": "320923", "sys_name": "盐城市_阜宁县_财政管理软件", "sys_code": "CZGL" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "阜宁县", "county_code": "320923", "sys_name": "盐城市_阜宁县_财政管理软件用友U8", "sys_code": "YYZW" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "射阳县", "county_code": "320924", "sys_name": "盐城市_射阳县_财政预算执行一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "建湖县", "county_code": "320925", "sys_name": "盐城市_建湖县_非税收缴", "sys_code": "FSSR" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "建湖县", "county_code": "320925", "sys_name": "盐城市_建湖县_财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "建湖县", "county_code": "320925", "sys_name": "盐城市_建湖县_国库集中支付", "sys_code": "GKZF" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "东台市", "county_code": "320981", "sys_name": "盐城市_东台市_部门预算编审系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "东台市", "county_code": "320981", "sys_name": "盐城市_东台市_财政一体化信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "东台市", "county_code": "320981", "sys_name": "盐城市_东台市_财政专户核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "东台市", "county_code": "320981", "sys_name": "盐城市_东台市_非税收入收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "东台市", "county_code": "320981", "sys_name": "盐城市_东台市_总预算会计核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "大丰区", "county_code": "320982", "sys_name": "盐城市_大丰区_部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "大丰区", "county_code": "320982", "sys_name": "盐城市_大丰区_财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "大丰区", "county_code": "320982", "sys_name": "盐城市_大丰区_总预算会计核算财务软件", "sys_code": "KJHS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "经济技术开发区", "county_code": "320991", "sys_name": "盐城市_经济技术开发区_部门预算软件", "sys_code": "BMYS" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "经济技术开发区", "county_code": "320991", "sys_name": "盐城市_经济技术开发区_国库集中支付", "sys_code": "GKZF" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "市本级", "county_code": "321000", "sys_name": "财政专户核算", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "市本级", "county_code": "321000", "sys_name": "老非税收入征缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "市本级", "county_code": "321000", "sys_name": "扬州财政一体化信息管理系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "广陵区", "county_code": "321002", "sys_name": "财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "广陵区", "county_code": "321002", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "邗江区", "county_code": "321003", "sys_name": "财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "邗江区", "county_code": "321003", "sys_name": "非税系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "邗江区", "county_code": "321003", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "宝应县", "county_code": "321023", "sys_name": "非税收入征收", "sys_code": "FSSR" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "宝应县", "county_code": "321023", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "仪征市", "county_code": "321081", "sys_name": "部门预算编制", "sys_code": "BMYS" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "仪征市", "county_code": "321081", "sys_name": "非税收入收缴", "sys_code": "FSSR" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "仪征市", "county_code": "321081", "sys_name": "行政事业性单位国有资产管理", "sys_code": "ZCGL" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "仪征市", "county_code": "321081", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "高邮市", "county_code": "321084", "sys_name": "财政业务系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "江都区", "county_code": "321088", "sys_name": "财政业务综合系统", "sys_code": "ZHYW" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "江都区", "county_code": "321088", "sys_name": "江都开发区预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "市本级", "county_code": "321100", "sys_name": "财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "京口区", "county_code": "321102", "sys_name": "富深协通财政一体化业务管理系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "京口区", "county_code": "321102", "sys_name": "富深协通非税收缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "京口区", "county_code": "321102", "sys_name": "富深协通工资统发系统", "sys_code": "GZTF" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "润州区", "county_code": "321111", "sys_name": "部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "润州区", "county_code": "321111", "sys_name": "财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "润州区", "county_code": "321111", "sys_name": "非税收入", "sys_code": "FSSR" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "丹徒区", "county_code": "321112", "sys_name": "财政综合业务系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "丹阳市", "county_code": "321181", "sys_name": "部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "丹阳市", "county_code": "321181", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "扬中市", "county_code": "321182", "sys_name": "部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "扬中市", "county_code": "321182", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "句容市", "county_code": "321183", "sys_name": "非税收入", "sys_code": "FSSR" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "句容市", "county_code": "321183", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "市本级", "county_code": "321200", "sys_name": "泰州市_市本级_部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "市本级", "county_code": "321200", "sys_name": "泰州市_市本级_非税收入系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "市本级", "county_code": "321200", "sys_name": "泰州市_市本级_绩效管理系统", "sys_code": "JXGL" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "市本级", "county_code": "321200", "sys_name": "泰州市_市本级_预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "市本级", "county_code": "321200", "sys_name": "泰州市_市本级_综合治税系统", "sys_code": "ZHZS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "海陵区", "county_code": "321202", "sys_name": "泰州市_海陵区_部门预算编制系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "海陵区", "county_code": "321202", "sys_name": "泰州市_海陵区_县区财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "高港区", "county_code": "321203", "sys_name": "泰州市_高港区_预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "姜堰区", "county_code": "321204", "sys_name": "泰州市_姜堰区_部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "姜堰区", "county_code": "321204", "sys_name": "泰州市_姜堰区_财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "姜堰区", "county_code": "321204", "sys_name": "泰州市_姜堰区_非税收缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "姜堰区", "county_code": "321204", "sys_name": "泰州市_姜堰区_预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "医药高新区", "county_code": "321205", "sys_name": "泰州市_医药高新区_财政一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "兴化市", "county_code": "321281", "sys_name": "泰州市_兴化市_部门预算", "sys_code": "BMYS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "兴化市", "county_code": "321281", "sys_name": "泰州市_兴化市_非税收缴", "sys_code": "FSSR" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "兴化市", "county_code": "321281", "sys_name": "泰州市_兴化市_国库集中支付", "sys_code": "GKZF" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "靖江市", "county_code": "321282", "sys_name": "泰州市_靖江市_预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "靖江市", "county_code": "321282", "sys_name": "泰州市_靖江市_非税收入收缴", "sys_code": "FSSR" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "靖江市", "county_code": "321282", "sys_name": "泰州市_靖江市_部门预算编审系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "泰兴市", "county_code": "321283", "sys_name": "泰州市_泰兴市_部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "泰兴市", "county_code": "321283", "sys_name": "泰州市_泰兴市_非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "泰兴市", "county_code": "321283", "sys_name": "泰州市_泰兴市_预算执行系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "市本级", "county_code": "321300", "sys_name": "部门预算管理系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "市本级", "county_code": "321300", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "市本级", "county_code": "321300", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿城区", "county_code": "321302", "sys_name": "财政一体化平台及国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿城区", "county_code": "321302", "sys_name": "新中大非税收入管理", "sys_code": "FSSR" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿城区", "county_code": "321302", "sys_name": "总预算会计核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿豫区", "county_code": "321311", "sys_name": "非税收缴管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿豫区", "county_code": "321311", "sys_name": "联友财务管理系统", "sys_code": "CWGL" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿豫区", "county_code": "321311", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "沭阳县", "county_code": "321322", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "沭阳县", "county_code": "321322", "sys_name": "国库集中支付、指标管理系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "沭阳县", "county_code": "321322", "sys_name": "开发区总预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "沭阳县", "county_code": "321322", "sys_name": "总预算会计核算", "sys_code": "KJHS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "泗阳县", "county_code": "321323", "sys_name": "预算执行", "sys_code": "YSZX" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "泗洪县", "county_code": "321324", "sys_name": "部门预算系统", "sys_code": "BMYS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "泗洪县", "county_code": "321324", "sys_name": "非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "泗洪县", "county_code": "321324", "sys_name": "国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "泗洪县", "county_code": "321324", "sys_name": "国库账务系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "高新区", "county_code": "320100GXQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "化工园区", "county_code": "320100HGY", "sys_name": "化学工业园区非税收入管理系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "经济技术开发区", "county_code": "320100JKQ", "sys_name": "非税收入账套", "sys_code": "FSZT" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "化工园区", "county_code": "320101HGY", "sys_name": "化学工业园区预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "经济技术开发区", "county_code": "320101JKQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "化工园区", "county_code": "320102HGY", "sys_name": "会计核算", "sys_code": "KYHS" },
|
||||
{ "city_code": "3201", "city": "南京市", "county": "经济技术开发区", "county_code": "320102JKQ", "sys_name": "总预算会计账", "sys_code": "KJHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "锡山开发区", "county_code": "320205KFQ", "sys_name": "预算内外收支核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "滨湖区马山开发区", "county_code": "320211KFQ", "sys_name": "账户核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "江阴开发区", "county_code": "320281kfq", "sys_name": "财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "江阴开发区", "county_code": "320281kfq", "sys_name": "账户核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "宜兴环科园", "county_code": "320282KFQ", "sys_name": "财务核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3202", "city": "无锡市", "county": "宜兴开发区", "county_code": "320282KFQ", "sys_name": "总预算核算系统", "sys_code": "ZHHS" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "经济技术开发区", "county_code": "320300JKQ", "sys_name": "富深协通财政一体化业务管理系统软件", "sys_code": "YTH" },
|
||||
{ "city_code": "3203", "city": "徐州市", "county": "经济技术开发区", "county_code": "320300JKQ", "sys_name": "账务处理系统(收支分类改革升级版)", "sys_code": "KJHS" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "天宁经开区", "county_code": "320402JKQ", "sys_name": "账务处理系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区开发区", "county_code": "320404KFQ", "sys_name": "国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区开发区", "county_code": "320405KFQ", "sys_name": "用款计划系统", "sys_code": "JHGL" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区开发区", "county_code": "320406KFQ", "sys_name": "指标管理系统", "sys_code": "ZBGL" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "钟楼区开发区", "county_code": "320407KFQ", "sys_name": "总预算系统", "sys_code": "ZYS" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "经开区", "county_code": "320412JKQ", "sys_name": "财政预算外业务", "sys_code": "YSW" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "经开区", "county_code": "320412JKQ", "sys_name": "非税收缴系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "经开区", "county_code": "320412JKQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "武进高新区", "county_code": "320413GXQ", "sys_name": "财政一体化管理信息系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳中关村", "county_code": "320481ZGC", "sys_name": "用友U8R10财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3204", "city": "常州市", "county": "溧阳中关村开发区", "county_code": "320481ZGCKF", "sys_name": "用友U8R10财政一体化平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "相城区开发区", "county_code": "320507KFQ", "sys_name": "开发区财政系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "常熟市高新区", "county_code": "320581GXQ", "sys_name": "高新区总预算系统", "sys_code": "ZYS" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "昆山市开发区", "county_code": "320583KFQ", "sys_name": "开发区公共财政服务平台", "sys_code": "YTH" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市新区", "county_code": "320585XQ", "sys_name": "非税收入系统", "sys_code": "FSSR" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市新区", "county_code": "320586XQ", "sys_name": "会计核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3205", "city": "苏州市", "county": "太仓市新区", "county_code": "320587XQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "开发区", "county_code": "320600KFQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "苏通园区", "county_code": "320600STY", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3206", "city": "南通市", "county": "通州湾示范区", "county_code": "320600TZW", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3207", "city": "连云港市", "county": "开发区", "county_code": "320701KFQ", "sys_name": "非税收入", "sys_code": "FSSR" },
|
||||
{ "city_code": "3208", "city": "淮安市", "county": "开发区", "county_code": "320800KFQ", "sys_name": "用友GRP-U8管理软件", "sys_code": "YTH" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "城南新区", "county_code": "320900CZXQ", "sys_name": "盐城市_城南新区_国库集中支付系统", "sys_code": "GKZF" },
|
||||
{ "city_code": "3209", "city": "盐城市", "county": "城南新区", "county_code": "320901CZXQ", "sys_name": "盐城市_城南新区_总预算账务处理系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "化工园区", "county_code": "321000HGY", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "开发区", "county_code": "321000KFQ", "sys_name": "非税收入收缴", "sys_code": "FSSR" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "科技新城", "county_code": "321000KJC", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "蜀冈-瘦西湖风景名胜区", "county_code": "321000SXH", "sys_name": "财政预算指标管理", "sys_code": "ZBGL" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "蜀冈-瘦西湖风景名胜区", "county_code": "321000SXH", "sys_name": "总预算会计核算", "sys_code": "KJHS" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "开发区", "county_code": "321001KFQ", "sys_name": "一体化系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "开发区", "county_code": "321002KFQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3210", "city": "扬州市", "county": "高邮开发区", "county_code": "321084KFQ", "sys_name": "财政业务系统", "sys_code": "YTH" },
|
||||
{ "city_code": "3211", "city": "镇江市", "county": "新区", "county_code": "321100XQ", "sys_name": "财政一体化", "sys_code": "YTH" },
|
||||
{ "city_code": "3212", "city": "泰州市", "county": "市本级", "county_code": "321200", "sys_name": "泰州市_市本级_行政管理系统", "sys_code": "XZGL" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "湖滨新城", "county_code": "321300HBXC", "sys_name": "新中大财务软件", "sys_code": "KJHS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "经开区", "county_code": "321300JKQ", "sys_name": "新中大公共财政管理软件", "sys_code": "YTH" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "洋河新区", "county_code": "321300YHXQ", "sys_name": "预算执行系统", "sys_code": "YSZX" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "宿豫区开发区", "county_code": "321311KFQ", "sys_name": "开发区新中大财务核算系统", "sys_code": "KJHS" },
|
||||
{ "city_code": "3213", "city": "宿迁市", "county": "泗洪县开发区", "county_code": "321324KFQ", "sys_name": "开发区账务系统", "sys_code": "KJHS" }];
|
||||
function getCountyByCode(code) {
|
||||
//var jsobj = JSON.parse(origin_place_arr);
|
||||
var jsobj = Kubernetes.origin_place_arr;
|
||||
var jsonlength = jsobj.length;
|
||||
for (var i = 0; i < jsonlength; i++) {
|
||||
if (jsobj[i].county_code == code) {
|
||||
return jsobj[i].city + jsobj[i].county;
|
||||
}
|
||||
}
|
||||
return code;
|
||||
}
|
||||
Kubernetes.getCountyByCode = getCountyByCode;
|
||||
function getCodeByCounty(place) {
|
||||
place = place.replace(/\s*\t*/gim, "");
|
||||
//var jsobj = JSON.parse(origin_place_arr);
|
||||
var jsobj = Kubernetes.origin_place_arr;
|
||||
var jsonlength = jsobj.length;
|
||||
for (var i = 0; i < jsonlength; i++) {
|
||||
if (jsobj[i].city === "" || jsobj[i].city == undefined)
|
||||
continue;
|
||||
if (jsobj[i].county === "" || jsobj[i].county == undefined)
|
||||
continue;
|
||||
if ((place.indexOf(jsobj[i].city) != -1) && (place.indexOf(jsobj[i].county) != -1)) {
|
||||
return jsobj[i].county_code;
|
||||
}
|
||||
}
|
||||
return place;
|
||||
}
|
||||
Kubernetes.getCodeByCounty = getCodeByCounty;
|
||||
function getSystemNameById(id) {
|
||||
var temJson = Kubernetes.system_arr;
|
||||
var sys_size = temJson.length;
|
||||
for (var i = 0; i < sys_size; i++) {
|
||||
if (temJson[i].sys_id == id) {
|
||||
return temJson[i].sys_name;
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
Kubernetes.getSystemNameById = getSystemNameById;
|
||||
function getIdBySystemName(name) {
|
||||
var temJson = Kubernetes.system_arr;
|
||||
var sys_size = temJson.length;
|
||||
for (var i = 0; i < sys_size; i++) {
|
||||
if (temJson[i].sys_name == name) {
|
||||
return temJson[i].sys_id;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
Kubernetes.getIdBySystemName = getIdBySystemName;
|
||||
function getCodeBySystemName(name) {
|
||||
var jsobj = Kubernetes.origin_place_arr;
|
||||
var jsonlength = jsobj.length;
|
||||
for (var i = 0; i < jsonlength; i++) {
|
||||
if (jsobj[i].sys_name == name) {
|
||||
return jsobj[i].sys_code;
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
Kubernetes.getCodeBySystemName = getCodeBySystemName;
|
||||
})(Kubernetes || (Kubernetes = {}));
|
||||
//# sourceMappingURL=readPlacedivision.js.map
|
File diff suppressed because one or more lines are too long
|
@ -4,54 +4,54 @@
|
|||
|
||||
module Kubernetes {
|
||||
|
||||
export var ReplicationControllerController = controller("ReplicationControllerController",
|
||||
["$scope", "KubernetesModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
|
||||
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesState,
|
||||
$templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
|
||||
export var ReplicationControllerController = controller("ReplicationControllerController", ["$scope", "KubernetesModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
|
||||
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesState,
|
||||
$templateCache: ng.ITemplateCacheService, $location: ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
|
||||
|
||||
$scope.kubernetes = KubernetesState;
|
||||
$scope.model = KubernetesModel;
|
||||
$scope.rawModel = null
|
||||
$scope.kubernetes = KubernetesState;
|
||||
$scope.model = KubernetesModel;
|
||||
$scope.rawModel = null
|
||||
|
||||
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
|
||||
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
|
||||
|
||||
$scope.itemConfig = {
|
||||
properties: {
|
||||
'^\\/labels$': {
|
||||
template: $templateCache.get('labelTemplate.html')
|
||||
$scope.itemConfig = {
|
||||
properties: {
|
||||
'^\\/labels$': {
|
||||
template: $templateCache.get('labelTemplate.html')
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on('kubernetesModelUpdated', () => {
|
||||
updateData();
|
||||
});
|
||||
|
||||
$scope.$on('$routeUpdate', ($event) => {
|
||||
updateData();
|
||||
});
|
||||
|
||||
$scope.$watch('model.pods', (newValue, oldValue) => {
|
||||
updateData();
|
||||
}, true);
|
||||
|
||||
$scope.flipRaw = () => {
|
||||
$scope.rawMode = !$scope.rawMode;
|
||||
Core.$apply($scope);
|
||||
};
|
||||
|
||||
updateData();
|
||||
|
||||
function updateData() {
|
||||
if ($scope.dirty) {
|
||||
return;
|
||||
}
|
||||
$scope.id = $routeParams["id"];
|
||||
$scope.item = $scope.model.getReplicationController(KubernetesState.selectedNamespace, $scope.id);
|
||||
if ($scope.item) {
|
||||
$scope.rawModel = toRawYaml($scope.item);
|
||||
}
|
||||
Core.$apply($scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on('kubernetesModelUpdated', () => {
|
||||
updateData();
|
||||
});
|
||||
|
||||
$scope.$on('$routeUpdate', ($event) => {
|
||||
updateData();
|
||||
});
|
||||
|
||||
$scope.$watch('model.pods', (newValue, oldValue) => {
|
||||
updateData();
|
||||
}, true);
|
||||
|
||||
$scope.flipRaw = () => {
|
||||
$scope.rawMode = !$scope.rawMode;
|
||||
Core.$apply($scope);
|
||||
};
|
||||
|
||||
updateData();
|
||||
|
||||
function updateData() {
|
||||
if ($scope.dirty) {
|
||||
return;
|
||||
}
|
||||
$scope.id = $routeParams["id"];
|
||||
$scope.item = $scope.model.getReplicationController(KubernetesState.selectedNamespace, $scope.id);
|
||||
if ($scope.item) {
|
||||
$scope.rawModel = toRawYaml($scope.item);
|
||||
}
|
||||
Core.$apply($scope);
|
||||
}
|
||||
}]);
|
||||
}
|
||||
]);
|
||||
}
|
|
@ -6,9 +6,9 @@
|
|||
module Kubernetes {
|
||||
|
||||
export var ReplicationControllers = controller("ReplicationControllers",
|
||||
["$scope", "KubernetesModel", "KubernetesReplicationControllers", "KubernetesPods", "ConfigsModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
|
||||
["$scope", "KubernetesModel", "KubernetesReplicationControllers", "KubernetesPods", "ConfigsModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", "ngDialog",
|
||||
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesReplicationControllers:ng.resource.IResourceClass<any>, KubernetesPods:ng.resource.IResourceClass<any>, ConfigsModel, KubernetesState,
|
||||
$templateCache, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
|
||||
$templateCache, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL, ngDialog) => {
|
||||
|
||||
$scope.kubernetes = KubernetesState;
|
||||
$scope.configs = ConfigsModel;
|
||||
|
@ -295,5 +295,7 @@ module Kubernetes {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
}]);
|
||||
}
|
||||
|
|
|
@ -3,325 +3,329 @@
|
|||
|
||||
module Kubernetes {
|
||||
|
||||
var log = Logger.get("kubernetes-term-windows");
|
||||
var log = Logger.get("kubernetes-term-windows");
|
||||
|
||||
_module.config((kubernetesContainerSocketProvider) => {
|
||||
kubernetesContainerSocketProvider.WebSocketFactory = "CustomWebSockets";
|
||||
});
|
||||
_module.config((kubernetesContainerSocketProvider) => {
|
||||
kubernetesContainerSocketProvider.WebSocketFactory = "CustomWebSockets";
|
||||
});
|
||||
|
||||
_module.factory('CustomWebSockets', (userDetails:any) => {
|
||||
return function CustomWebSocket(url, protocols) {
|
||||
var paths = url.split('?');
|
||||
if (!_.startsWith(paths[0], masterApiUrl())) {
|
||||
paths[0] = UrlHelpers.join(masterApiUrl(), paths[0]);
|
||||
}
|
||||
url = KubernetesAPI.wsUrl(paths[0]);
|
||||
url.search(paths[1] + '&access_token=' + userDetails.token);
|
||||
log.debug("Using ws url: ", url.toString());
|
||||
return new WebSocket(url.toString(), protocols);
|
||||
};
|
||||
});
|
||||
|
||||
_module.service('TerminalService', ($rootScope, $document, $compile, $interval, $templateCache) => {
|
||||
var body = $document.find('body');
|
||||
function positionTerminals(terminals) {
|
||||
var total = _.keys(terminals).length;
|
||||
var dist = (body.width() - 225) / total;
|
||||
var position = 5;
|
||||
angular.forEach(terminals, (value, key) => {
|
||||
if (!value.scope.docked) {
|
||||
return;
|
||||
}
|
||||
value.el.css('left', position + 'px');
|
||||
position = position + dist;
|
||||
});
|
||||
}
|
||||
var defaultTemplate = $templateCache.get(UrlHelpers.join(templatePath, 'termShell.html'));
|
||||
var self = {
|
||||
positionTerminals: () => {
|
||||
positionTerminals(self.terminals);
|
||||
},
|
||||
terminals: {},
|
||||
httpTask: {},
|
||||
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);
|
||||
self.raiseTerminal(terminalId);
|
||||
return terminalId;
|
||||
}
|
||||
var scope = $rootScope.$new();
|
||||
getLogs(entity, scope, url);
|
||||
scope.podLink = podLink;
|
||||
scope.containerName = containerName;
|
||||
scope.id = terminalId;
|
||||
scope.docked = true;
|
||||
if(terminalId in self.httpTask){
|
||||
self.raiseTerminal(terminalId);
|
||||
return terminalId;
|
||||
}else{
|
||||
self.httpTask[terminalId] = $interval(() =>{
|
||||
getLogs(entity, scope, url);
|
||||
},2000);
|
||||
}
|
||||
var el = $($compile(template)(scope));
|
||||
var term = {
|
||||
scope: scope,
|
||||
el: el
|
||||
_module.factory('CustomWebSockets', (userDetails: any) => {
|
||||
return function CustomWebSocket(url, protocols) {
|
||||
var paths = url.split('?');
|
||||
if (!_.startsWith(paths[0], masterApiUrl())) {
|
||||
paths[0] = UrlHelpers.join(masterApiUrl(), paths[0]);
|
||||
}
|
||||
url = KubernetesAPI.wsUrl(paths[0]);
|
||||
url.search(paths[1] + '&access_token=' + userDetails.token);
|
||||
log.debug("Using ws url: ", url.toString());
|
||||
return new WebSocket(url.toString(), protocols);
|
||||
};
|
||||
body.append(el);
|
||||
self.terminals[terminalId] = term;
|
||||
positionTerminals(self.terminals);
|
||||
return terminalId;
|
||||
},
|
||||
closeTerminal: (id) => {
|
||||
var term = self.terminals[id];
|
||||
var timer = self.httpTask[id];
|
||||
if(timer){
|
||||
$interval.cancel(timer);
|
||||
delete self.httpTask[id];
|
||||
}
|
||||
if (term) {
|
||||
term.el.remove();
|
||||
delete self.terminals[id];
|
||||
positionTerminals(self.terminals);
|
||||
}
|
||||
},
|
||||
raiseTerminal: (id) => {
|
||||
angular.forEach(self.terminals, (value, key) => {
|
||||
if (key === id) {
|
||||
value.el.css('z-index', '4000');
|
||||
value.el.find('.terminal').focus();
|
||||
} else {
|
||||
value.el.css('z-index', '3000');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return self;
|
||||
});
|
||||
|
||||
export function addWindowActions(scope, element, TerminalService) {
|
||||
var moved = false;
|
||||
var lastX = 0;
|
||||
var lastY = 0;
|
||||
var header = element.find('.terminal-title');
|
||||
var body = element.find('.terminal-body');
|
||||
element.on('$destroy', () => {
|
||||
$('#main').css({ display: 'inherit' });
|
||||
});
|
||||
|
||||
var HEIGHT = 348;
|
||||
var WIDTH = 600;
|
||||
var TITLE_HEIGHT = 35;
|
||||
var NAV_OFFSET = 46;
|
||||
_module.service('TerminalService', ($rootScope, $document, $compile, $interval, $templateCache) => {
|
||||
var body = $document.find('body');
|
||||
|
||||
element.css({
|
||||
height: HEIGHT,
|
||||
width: WIDTH
|
||||
});
|
||||
header.css({
|
||||
height: TITLE_HEIGHT
|
||||
});
|
||||
body.css({
|
||||
position: 'absolute',
|
||||
top: 35,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0
|
||||
});
|
||||
scope.close = () => {
|
||||
TerminalService.closeTerminal(scope.id);
|
||||
};
|
||||
scope.raise = () => {
|
||||
TerminalService.raiseTerminal(scope.id);
|
||||
};
|
||||
scope.$watch('docked', (docked) => {
|
||||
if (docked) {
|
||||
element.width(WIDTH);
|
||||
if (!element.hasClass('minimized')) {
|
||||
element.height(HEIGHT);
|
||||
}
|
||||
}
|
||||
});
|
||||
scope.startResize = (e) => {
|
||||
e.preventDefault();
|
||||
log.debug("Start resize");
|
||||
scope.resizing = true;
|
||||
element.on('mouseup', scope.stopResize);
|
||||
$(document).on('mousemove', scope.doResize);
|
||||
$(document).on('mouseleave', scope.stopResize);
|
||||
};
|
||||
scope.doResize = (e) => {
|
||||
if (scope.resizing) {
|
||||
log.debug("Resizing, e: ", e);
|
||||
if (!moved) {
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
moved = true;
|
||||
return;
|
||||
}
|
||||
var height = element.height();
|
||||
var width = element.width();
|
||||
var deltaX = e.clientX - lastX;
|
||||
var deltaY = e.clientY - lastY;
|
||||
var newHeight = height + deltaY;
|
||||
var newWidth = width + deltaX;
|
||||
if (newHeight > 35 && newWidth > 80) {
|
||||
element.height(height + deltaY);
|
||||
element.width(width + deltaX);
|
||||
}
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
}
|
||||
};
|
||||
scope.stopResize = (e) => {
|
||||
scope.resizing = false;
|
||||
moved = false;
|
||||
element.off('mouseup', scope.stopResize);
|
||||
$(document).off('mousemove', scope.doResize);
|
||||
$(document).off('mouseleave', scope.stopResize);
|
||||
}
|
||||
scope.mouseDown = (e) => {
|
||||
e.preventDefault();
|
||||
if (element.hasClass('minimized') || element.hasClass('maximized')) {
|
||||
return;
|
||||
}
|
||||
scope.dragging = true;
|
||||
element.on('mouseup', scope.mouseUp);
|
||||
$(document).on('mousemove', scope.mouseMove);
|
||||
$(document).on('mouseleave', scope.mouseUp);
|
||||
};
|
||||
scope.mouseUp = (e) => {
|
||||
e.preventDefault();
|
||||
scope.dragging = false;
|
||||
moved = false;
|
||||
var height = element.height();
|
||||
var offset = element.offset();
|
||||
var winHeight = $(window).height();
|
||||
if (offset.top > (winHeight - height - 20)) {
|
||||
element.css({ top: "inherit", left: "inherit" });
|
||||
scope.docked = true;
|
||||
TerminalService.positionTerminals();
|
||||
} else {
|
||||
scope.docked = false;
|
||||
}
|
||||
element.off('mouseup', scope.mouseUp);
|
||||
$(document).off('mousemove', scope.mouseMove);
|
||||
$(document).off('mouseleave', scope.mouseUp);
|
||||
};
|
||||
scope.mouseMove = (e) => {
|
||||
if (scope.dragging) {
|
||||
if (!moved) {
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
moved = true;
|
||||
return;
|
||||
}
|
||||
var deltaX = e.clientX - lastX;
|
||||
var deltaY = e.clientY - lastY;
|
||||
var elOffset = element.offset();
|
||||
element.offset({ top: elOffset.top + deltaY, left: elOffset.left + deltaX });
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
}
|
||||
}
|
||||
|
||||
function restoreWindow(scope, element) {
|
||||
if (scope.offset) {
|
||||
element.offset(scope.offset);
|
||||
scope.docked = false;
|
||||
}
|
||||
if (scope.height) {
|
||||
element.height(scope.height);
|
||||
}
|
||||
if (scope.width) {
|
||||
element.width(scope.width);
|
||||
}
|
||||
}
|
||||
|
||||
function saveWindow(scope, element) {
|
||||
scope.offset = element.offset();
|
||||
scope.height = element.height();
|
||||
scope.width = element.width();
|
||||
}
|
||||
|
||||
scope.maximized = () => {
|
||||
return element.hasClass('maximized');
|
||||
}
|
||||
|
||||
scope.maximize = ($e) => {
|
||||
$e.preventDefault();
|
||||
if (element.hasClass('minimized')) {
|
||||
scope.minimize();
|
||||
}
|
||||
if (element.hasClass('maximized')) {
|
||||
restoreWindow(scope, element);
|
||||
$('#main').css({ display: 'inherit' });
|
||||
} else {
|
||||
saveWindow(scope, element);
|
||||
$('#main').css({ display: 'none' });
|
||||
element.css({
|
||||
height: 'inherit',
|
||||
bottom: 0,
|
||||
width: '100%',
|
||||
top: NAV_OFFSET,
|
||||
left: 0
|
||||
});
|
||||
}
|
||||
element.toggleClass('maximized');
|
||||
}
|
||||
scope.minimize = ($e) => {
|
||||
$e.preventDefault();
|
||||
if (element.hasClass('maximized')) {
|
||||
scope.maximize();
|
||||
}
|
||||
if (element.hasClass('minimized')) {
|
||||
restoreWindow(scope, element);
|
||||
} else {
|
||||
saveWindow(scope, element);
|
||||
scope.docked = true;
|
||||
element.css({ height: TITLE_HEIGHT, top: "inherit", left: "inherit" });
|
||||
TerminalService.positionTerminals();
|
||||
}
|
||||
element.toggleClass('minimized');
|
||||
};
|
||||
}
|
||||
|
||||
_module.directive('terminalWindow', ($compile, TerminalService) => {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: false,
|
||||
link: (scope:any, element, attr) => {
|
||||
addWindowActions(scope, element, TerminalService);
|
||||
var body = element.find('.terminal-body');
|
||||
body.append($compile('<kubernetes-container-terminal pod="podLink" container="containerName" command="bash"></kubernetes-container-terminal>')(scope));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
function getLogs(rc, scope, url){
|
||||
var xhr= new XMLHttpRequest();
|
||||
xhr.onreadystatechange = () => {
|
||||
if(xhr.readyState == 4){
|
||||
if (xhr.status == 200){
|
||||
if(xhr.responseText !="" && xhr.responseText !=null){
|
||||
var logObject = JSON.parse(xhr.responseText);
|
||||
scope.logs = logObject[getName(rc)];
|
||||
}else{
|
||||
scope.logs = "当前没有可以查看的日志信息";
|
||||
function positionTerminals(terminals) {
|
||||
var total = _.keys(terminals).length;
|
||||
var dist = (body.width() - 225) / total;
|
||||
var position = 5;
|
||||
angular.forEach(terminals, (value, key) => {
|
||||
if (!value.scope.docked) {
|
||||
return;
|
||||
}
|
||||
|
||||
//return ({text: "aaaaaa"});
|
||||
|
||||
}else{
|
||||
//log = "当前没有可以查看的日志!";
|
||||
}
|
||||
value.el.css('left', position + 'px');
|
||||
position = position + dist;
|
||||
});
|
||||
}
|
||||
}
|
||||
xhr.open("POST", url, false);
|
||||
//xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false);
|
||||
xhr.send(null);
|
||||
}
|
||||
}
|
||||
var defaultTemplate = $templateCache.get(UrlHelpers.join(templatePath, 'termShell.html'));
|
||||
var self = {
|
||||
positionTerminals: () => {
|
||||
positionTerminals(self.terminals);
|
||||
},
|
||||
terminals: {},
|
||||
httpTask: {},
|
||||
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);
|
||||
self.raiseTerminal(terminalId);
|
||||
return terminalId;
|
||||
}
|
||||
var scope = $rootScope.$new();
|
||||
if (containerName == "") {
|
||||
scope.isExportLog = true;
|
||||
}
|
||||
getLogs(entity, scope, url);
|
||||
scope.podLink = podLink;
|
||||
scope.containerName = containerName;
|
||||
scope.id = terminalId;
|
||||
scope.docked = true;
|
||||
if (terminalId in self.httpTask) {
|
||||
self.raiseTerminal(terminalId);
|
||||
return terminalId;
|
||||
} else {
|
||||
self.httpTask[terminalId] = $interval(() => {
|
||||
getLogs(entity, scope, url);
|
||||
}, 2000);
|
||||
}
|
||||
var el = $($compile(template)(scope));
|
||||
var term = {
|
||||
scope: scope,
|
||||
el: el
|
||||
};
|
||||
body.append(el);
|
||||
self.terminals[terminalId] = term;
|
||||
positionTerminals(self.terminals);
|
||||
return terminalId;
|
||||
},
|
||||
|
||||
closeTerminal: (id) => {
|
||||
var term = self.terminals[id];
|
||||
var timer = self.httpTask[id];
|
||||
if (timer) {
|
||||
$interval.cancel(timer);
|
||||
delete self.httpTask[id];
|
||||
}
|
||||
if (term) {
|
||||
term.el.remove();
|
||||
delete self.terminals[id];
|
||||
positionTerminals(self.terminals);
|
||||
}
|
||||
},
|
||||
raiseTerminal: (id) => {
|
||||
angular.forEach(self.terminals, (value, key) => {
|
||||
if (key === id) {
|
||||
value.el.css('z-index', '4000');
|
||||
value.el.find('.terminal').focus();
|
||||
} else {
|
||||
value.el.css('z-index', '3000');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return self;
|
||||
});
|
||||
|
||||
export function addWindowActions(scope, element, TerminalService) {
|
||||
var moved = false;
|
||||
var lastX = 0;
|
||||
var lastY = 0;
|
||||
var header = element.find('.terminal-title');
|
||||
var body = element.find('.terminal-body');
|
||||
element.on('$destroy', () => {
|
||||
$('#main').css({ display: 'inherit' });
|
||||
});
|
||||
|
||||
var HEIGHT = 348;
|
||||
var WIDTH = 600;
|
||||
var TITLE_HEIGHT = 35;
|
||||
var NAV_OFFSET = 46;
|
||||
|
||||
element.css({
|
||||
height: HEIGHT,
|
||||
width: WIDTH
|
||||
});
|
||||
header.css({
|
||||
height: TITLE_HEIGHT
|
||||
});
|
||||
body.css({
|
||||
position: 'absolute',
|
||||
top: 35,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0
|
||||
});
|
||||
scope.close = () => {
|
||||
TerminalService.closeTerminal(scope.id);
|
||||
};
|
||||
scope.raise = () => {
|
||||
TerminalService.raiseTerminal(scope.id);
|
||||
};
|
||||
scope.$watch('docked', (docked) => {
|
||||
if (docked) {
|
||||
element.width(WIDTH);
|
||||
if (!element.hasClass('minimized')) {
|
||||
element.height(HEIGHT);
|
||||
}
|
||||
}
|
||||
});
|
||||
scope.startResize = (e) => {
|
||||
e.preventDefault();
|
||||
log.debug("Start resize");
|
||||
scope.resizing = true;
|
||||
element.on('mouseup', scope.stopResize);
|
||||
$(document).on('mousemove', scope.doResize);
|
||||
$(document).on('mouseleave', scope.stopResize);
|
||||
};
|
||||
scope.doResize = (e) => {
|
||||
if (scope.resizing) {
|
||||
log.debug("Resizing, e: ", e);
|
||||
if (!moved) {
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
moved = true;
|
||||
return;
|
||||
}
|
||||
var height = element.height();
|
||||
var width = element.width();
|
||||
var deltaX = e.clientX - lastX;
|
||||
var deltaY = e.clientY - lastY;
|
||||
var newHeight = height + deltaY;
|
||||
var newWidth = width + deltaX;
|
||||
if (newHeight > 35 && newWidth > 80) {
|
||||
element.height(height + deltaY);
|
||||
element.width(width + deltaX);
|
||||
}
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
}
|
||||
};
|
||||
scope.stopResize = (e) => {
|
||||
scope.resizing = false;
|
||||
moved = false;
|
||||
element.off('mouseup', scope.stopResize);
|
||||
$(document).off('mousemove', scope.doResize);
|
||||
$(document).off('mouseleave', scope.stopResize);
|
||||
}
|
||||
scope.mouseDown = (e) => {
|
||||
e.preventDefault();
|
||||
if (element.hasClass('minimized') || element.hasClass('maximized')) {
|
||||
return;
|
||||
}
|
||||
scope.dragging = true;
|
||||
element.on('mouseup', scope.mouseUp);
|
||||
$(document).on('mousemove', scope.mouseMove);
|
||||
$(document).on('mouseleave', scope.mouseUp);
|
||||
};
|
||||
scope.mouseUp = (e) => {
|
||||
e.preventDefault();
|
||||
scope.dragging = false;
|
||||
moved = false;
|
||||
var height = element.height();
|
||||
var offset = element.offset();
|
||||
var winHeight = $(window).height();
|
||||
if (offset.top > (winHeight - height - 20)) {
|
||||
element.css({ top: "inherit", left: "inherit" });
|
||||
scope.docked = true;
|
||||
TerminalService.positionTerminals();
|
||||
} else {
|
||||
scope.docked = false;
|
||||
}
|
||||
element.off('mouseup', scope.mouseUp);
|
||||
$(document).off('mousemove', scope.mouseMove);
|
||||
$(document).off('mouseleave', scope.mouseUp);
|
||||
};
|
||||
scope.mouseMove = (e) => {
|
||||
if (scope.dragging) {
|
||||
if (!moved) {
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
moved = true;
|
||||
return;
|
||||
}
|
||||
var deltaX = e.clientX - lastX;
|
||||
var deltaY = e.clientY - lastY;
|
||||
var elOffset = element.offset();
|
||||
element.offset({ top: elOffset.top + deltaY, left: elOffset.left + deltaX });
|
||||
lastX = e.clientX;
|
||||
lastY = e.clientY;
|
||||
}
|
||||
}
|
||||
|
||||
function restoreWindow(scope, element) {
|
||||
if (scope.offset) {
|
||||
element.offset(scope.offset);
|
||||
scope.docked = false;
|
||||
}
|
||||
if (scope.height) {
|
||||
element.height(scope.height);
|
||||
}
|
||||
if (scope.width) {
|
||||
element.width(scope.width);
|
||||
}
|
||||
}
|
||||
|
||||
function saveWindow(scope, element) {
|
||||
scope.offset = element.offset();
|
||||
scope.height = element.height();
|
||||
scope.width = element.width();
|
||||
}
|
||||
|
||||
scope.maximized = () => {
|
||||
return element.hasClass('maximized');
|
||||
}
|
||||
|
||||
scope.maximize = ($e) => {
|
||||
$e.preventDefault();
|
||||
if (element.hasClass('minimized')) {
|
||||
scope.minimize();
|
||||
}
|
||||
if (element.hasClass('maximized')) {
|
||||
restoreWindow(scope, element);
|
||||
$('#main').css({ display: 'inherit' });
|
||||
} else {
|
||||
saveWindow(scope, element);
|
||||
$('#main').css({ display: 'none' });
|
||||
element.css({
|
||||
height: 'inherit',
|
||||
bottom: 0,
|
||||
width: '100%',
|
||||
top: NAV_OFFSET,
|
||||
left: 0
|
||||
});
|
||||
}
|
||||
element.toggleClass('maximized');
|
||||
}
|
||||
scope.minimize = ($e) => {
|
||||
$e.preventDefault();
|
||||
if (element.hasClass('maximized')) {
|
||||
scope.maximize();
|
||||
}
|
||||
if (element.hasClass('minimized')) {
|
||||
restoreWindow(scope, element);
|
||||
} else {
|
||||
saveWindow(scope, element);
|
||||
scope.docked = true;
|
||||
element.css({ height: TITLE_HEIGHT, top: "inherit", left: "inherit" });
|
||||
TerminalService.positionTerminals();
|
||||
}
|
||||
element.toggleClass('minimized');
|
||||
};
|
||||
}
|
||||
|
||||
_module.directive('terminalWindow', ($compile, TerminalService) => {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: false,
|
||||
link: (scope: any, element, attr) => {
|
||||
addWindowActions(scope, element, TerminalService);
|
||||
var body = element.find('.terminal-body');
|
||||
body.append($compile('<kubernetes-container-terminal pod="podLink" container="containerName" command="bash"></kubernetes-container-terminal>')(scope));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
function getLogs(rc, scope, url) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange = () => {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
if (xhr.responseText != "" && xhr.responseText != null) {
|
||||
var logObject = JSON.parse(xhr.responseText);
|
||||
scope.logs = logObject[getName(rc)];
|
||||
} else {
|
||||
scope.logs = "当前没有可以查看的日志信息";
|
||||
}
|
||||
|
||||
//return ({text: "aaaaaa"});
|
||||
|
||||
} else {
|
||||
//log = "当前没有可以查看的日志!";
|
||||
}
|
||||
}
|
||||
}
|
||||
xhr.open("POST", url, false);
|
||||
//xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false);
|
||||
xhr.send(null);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"out": "",
|
||||
"sourceMap": true,
|
||||
"target": "es5"
|
||||
},
|
||||
"files": [
|
||||
"kubernetesPlugin.ts"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,382 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="./kubernetesHelpers.ts"/>
|
||||
var Kubernetes;
|
||||
(function (Kubernetes) {
|
||||
Kubernetes.hostPorts = [];
|
||||
/**
|
||||
* Sorts the the ip field
|
||||
*
|
||||
* @param ip the ip such as '10.1.2.13'
|
||||
* @returns {any}
|
||||
*/
|
||||
function sortByPodIp(ip) {
|
||||
// i guess there is maybe nicer ways of sort this without parsing and slicing
|
||||
var regex = /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
|
||||
var groups = regex.exec(ip);
|
||||
if (angular.isDefined(groups)) {
|
||||
var g1 = ("00" + groups[1]).slice(-3);
|
||||
var g2 = ("00" + groups[2]).slice(-3);
|
||||
var g3 = ("00" + groups[3]).slice(-3);
|
||||
var g4 = ("00" + groups[4]).slice(-3);
|
||||
var answer = g1 + g2 + g3 + g4;
|
||||
return answer;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Kubernetes.sortByPodIp = sortByPodIp;
|
||||
function ramdomPort() {
|
||||
var hostPort = Math.floor(30000 + Math.random() * (65535 - 30000));
|
||||
while (Kubernetes.hostPorts.indexOf(hostPort) === 0) {
|
||||
hostPort = Math.floor(30000 + Math.random() * (65535 - 30000));
|
||||
}
|
||||
Kubernetes.hostPorts.push(hostPort);
|
||||
return hostPort;
|
||||
}
|
||||
Kubernetes.ramdomPort = ramdomPort;
|
||||
function getRandomString(len) {
|
||||
len = len || 32;
|
||||
var $chars = 'abcdefhijkmnprstwxyz'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1
|
||||
var maxPos = $chars.length;
|
||||
var pwd = '';
|
||||
for (var i = 0; i < len; i++) {
|
||||
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return pwd;
|
||||
}
|
||||
Kubernetes.getRandomString = getRandomString;
|
||||
var resourceRCTemplate = (function () {
|
||||
function resourceRCTemplate() {
|
||||
this.image = "oracle:utf8";
|
||||
this.names = ["oradata"];
|
||||
}
|
||||
resourceRCTemplate.prototype.createRC = function (Obj) {
|
||||
var labels = {
|
||||
"style": "oracle",
|
||||
"status": "0",
|
||||
"isExtract": Obj.isExtract + "" || "0",
|
||||
"isTarget": Obj.isTarget
|
||||
};
|
||||
for (var item in Obj.labels)
|
||||
labels[item] = Obj.labels[item];
|
||||
return {
|
||||
"apiVersion": Kubernetes.defaultApiVersion,
|
||||
"kind": "ReplicationController",
|
||||
"metadata": {
|
||||
"name": Obj.name,
|
||||
"labels": labels,
|
||||
"annotations": Obj.annotations
|
||||
},
|
||||
"spec": {
|
||||
replicas: Obj.replicas || 1,
|
||||
"template": this.createTemplate(Obj)
|
||||
}
|
||||
};
|
||||
};
|
||||
resourceRCTemplate.prototype.createVolumeMounts = function () {
|
||||
var volumeMounts = [];
|
||||
for (var item in this.names) {
|
||||
if (this.names[item] === 'flash-recovery-area')
|
||||
volumeMounts.push({
|
||||
"name": this.names[item],
|
||||
"mountPath": "/opt/oracle/app/flash_recovery_area"
|
||||
});
|
||||
else
|
||||
volumeMounts.push({
|
||||
"name": this.names[item],
|
||||
"mountPath": "/opt/oracle/app/" + this.names[item]
|
||||
});
|
||||
}
|
||||
return volumeMounts;
|
||||
};
|
||||
resourceRCTemplate.prototype.createVolumes = function (rootPath) {
|
||||
var volumes = [];
|
||||
for (var item in this.names) {
|
||||
if (this.names[item] === 'flash-recovery-area')
|
||||
volumes.push({
|
||||
"name": this.names[item],
|
||||
"hostPath": {
|
||||
"path": rootPath + "flash_recovery_area"
|
||||
}
|
||||
});
|
||||
else
|
||||
volumes.push({
|
||||
"name": this.names[item],
|
||||
"hostPath": {
|
||||
"path": rootPath + this.names[item]
|
||||
}
|
||||
});
|
||||
}
|
||||
return volumes;
|
||||
};
|
||||
resourceRCTemplate.prototype.createContainers = function (Obj) {
|
||||
var containers = [];
|
||||
containers.push({
|
||||
"name": "oracle",
|
||||
"image": this.image,
|
||||
"imagePullPolicy": "IfNotPresent",
|
||||
"command": ["/assets/entrypoint.sh"],
|
||||
"ports": [{
|
||||
"containerPort": 1521,
|
||||
"hostPort": Obj.port || ramdomPort()
|
||||
}],
|
||||
"resources": {
|
||||
"cpu": "100m",
|
||||
"memory": "3Gi"
|
||||
},
|
||||
"volumeMounts": this.createVolumeMounts()
|
||||
});
|
||||
return containers;
|
||||
};
|
||||
resourceRCTemplate.prototype.createTemplate = function (Obj) {
|
||||
return {
|
||||
"metadata": {
|
||||
//"name": Obj.name,
|
||||
"labels": Obj.labels
|
||||
},
|
||||
"spec": {
|
||||
"terminationGracePeriodSeconds": 0,
|
||||
"containers": this.createContainers(Obj),
|
||||
"volumes": this.createVolumes(Obj.path)
|
||||
}
|
||||
};
|
||||
};
|
||||
return resourceRCTemplate;
|
||||
})();
|
||||
Kubernetes.resourceRCTemplate = resourceRCTemplate;
|
||||
function labelToChinese(labels) {
|
||||
var answer = {};
|
||||
angular.forEach(labels, function (value, key) {
|
||||
answer[key] = labelChangeToChines(value, key);
|
||||
});
|
||||
return answer;
|
||||
}
|
||||
Kubernetes.labelToChinese = labelToChinese;
|
||||
function findSameNameReplicationControllers(replicationControllers, name) {
|
||||
var names = [];
|
||||
replicationControllers.forEach(function (rc) {
|
||||
var rcName = Kubernetes.getName(rc);
|
||||
if (rcName.indexof(name) !== -1)
|
||||
names.push(rcName);
|
||||
});
|
||||
if (names.length === 0) {
|
||||
return name + "_1";
|
||||
}
|
||||
else {
|
||||
var max = 0;
|
||||
names.forEach(function (value) {
|
||||
var answer = value.split("_");
|
||||
var key = parseInt(answer[1]);
|
||||
if (max < key)
|
||||
max = key;
|
||||
});
|
||||
return name + (max + 1);
|
||||
}
|
||||
}
|
||||
Kubernetes.findSameNameReplicationControllers = findSameNameReplicationControllers;
|
||||
function isFilterRC(rc) {
|
||||
var answer = false;
|
||||
angular.forEach(Core.pathGet(rc, ["metadata", "labels"]), function (value, key) {
|
||||
if (key === 'isTarget' && value === 'true') {
|
||||
answer = true;
|
||||
}
|
||||
});
|
||||
return answer;
|
||||
}
|
||||
Kubernetes.isFilterRC = isFilterRC;
|
||||
function isInclude(rcs, rc) {
|
||||
for (var i in rcs) {
|
||||
if (Kubernetes.getName(rcs[i]) === Kubernetes.getName(rc))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Kubernetes.isInclude = isInclude;
|
||||
function labelChangeToChines(value, key) {
|
||||
var trueValue = '';
|
||||
switch (key) {
|
||||
case 'type':
|
||||
if (value === '01')
|
||||
trueValue = '财政';
|
||||
else if (value === '02')
|
||||
trueValue = '社保';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'batch':
|
||||
if (value === 'A')
|
||||
trueValue = '批次A';
|
||||
else if (value === 'B')
|
||||
trueValue = '批次B';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'region':
|
||||
trueValue = Kubernetes.getCountyByCode(value);
|
||||
break;
|
||||
case 'system':
|
||||
trueValue = Kubernetes.getSystemNameById(value);
|
||||
break;
|
||||
case 'version':
|
||||
var reg = new RegExp('^[0-9]$').exec(value);
|
||||
if (reg)
|
||||
trueValue = '版本' + reg[0];
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'isTarget':
|
||||
if (value === 'true')
|
||||
trueValue = '汇总数据库';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
default:
|
||||
trueValue = value;
|
||||
}
|
||||
return trueValue;
|
||||
}
|
||||
Kubernetes.labelChangeToChines = labelChangeToChines;
|
||||
function checkForExit(replicationControllers, selectItem) {
|
||||
for (var index in replicationControllers) {
|
||||
var replicas = replicationControllers[index];
|
||||
if (Kubernetes.getName(replicas) == selectItem._key && getAnnotationValueBykey(replicas, "year") == selectItem["year"])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Kubernetes.checkForExit = checkForExit;
|
||||
function getAnnotationValueBykey(replicationController, key) {
|
||||
var annotations = Kubernetes.getAnnotations(replicationController);
|
||||
if (annotations && annotations != undefined) {
|
||||
return annotations[key];
|
||||
}
|
||||
}
|
||||
/*
|
||||
启动oracle时检查是否正在迁移
|
||||
*/
|
||||
function checkForCreateOracle(transferTasks, selectItems) {
|
||||
var result = [];
|
||||
angular.forEach(selectItems, function (item) {
|
||||
if (checkForExitTask(transferTasks, item))
|
||||
result.push(item);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Kubernetes.checkForCreateOracle = checkForCreateOracle;
|
||||
function checkForExitTask(transferTasks, selectItem) {
|
||||
for (var index in transferTasks) {
|
||||
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;
|
||||
}
|
||||
/**
|
||||
|
||||
**/
|
||||
function checkForExtract(replicationControllers) {
|
||||
var result = [];
|
||||
angular.forEach(replicationControllers, function (replicas) {
|
||||
var labels = Kubernetes.getLabels(replicas);
|
||||
if (labels["isExtract"] == "1")
|
||||
result.push(replicas);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Kubernetes.checkForExtract = checkForExtract;
|
||||
function checkIsStartSuccess(replicationControllers) {
|
||||
var result = [];
|
||||
angular.forEach(replicationControllers, function (replicas) {
|
||||
var labels = Kubernetes.getLabels(replicas);
|
||||
if (labels["status"] != "2")
|
||||
result.push(replicas);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Kubernetes.checkIsStartSuccess = checkIsStartSuccess;
|
||||
;
|
||||
/*
|
||||
检查数据否已挂载使用或正在迁移。
|
||||
*/
|
||||
function checkForMigration(replicationControllers, transferTasks, selectItem, type) {
|
||||
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 (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 (var i in replicationControllers) {
|
||||
var labels = Kubernetes.getLabels(replicationControllers[i]);
|
||||
if (Kubernetes.getName(replicationControllers[i]) == item._key && getAnnotationValueBykey(replicationControllers[i], "year") == item["year"]) {
|
||||
message = "数据正在使用";
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
Kubernetes.checkForMigration = checkForMigration;
|
||||
function eliminateChechBoxClick() {
|
||||
var element = $("#tableConfig > thead > tr input:checkbox");
|
||||
if (element.is(':checked'))
|
||||
element.click();
|
||||
}
|
||||
Kubernetes.eliminateChechBoxClick = eliminateChechBoxClick;
|
||||
/*
|
||||
是否已存在当前
|
||||
*/
|
||||
function alreadyExitInFolder(selectedItems, selectNode) {
|
||||
var childNodes = selectNode.childNodes;
|
||||
for (var i in selectedItems) {
|
||||
var itemName = selectedItems[i].regionalismCode + "_" + selectedItems[i].systemCode;
|
||||
for (var j in childNodes) {
|
||||
if (childNodes[j].name == itemName) {
|
||||
var childrens = childNodes[j].childNodes;
|
||||
for (var k in childrens)
|
||||
if (childrens[k].name == selectedItems[i].dataVersion)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Kubernetes.alreadyExitInFolder = alreadyExitInFolder;
|
||||
function alreadyExitInCluster(selectedItems, volumePath) {
|
||||
for (var i in selectedItems) {
|
||||
if (selectedItems[i].datapath.startWith(volumePath)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Kubernetes.alreadyExitInCluster = alreadyExitInCluster;
|
||||
})(Kubernetes || (Kubernetes = {}));
|
||||
//# sourceMappingURL=utilHelpers.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,388 +1,397 @@
|
|||
/// <reference path="../../includes.ts"/>
|
||||
/// <reference path="./kubernetesHelpers.ts"/>
|
||||
module Kubernetes {
|
||||
export var hostPorts =[];
|
||||
export var hostPorts = [];
|
||||
|
||||
/**
|
||||
* Sorts the the ip field
|
||||
*
|
||||
* @param ip the ip such as '10.1.2.13'
|
||||
* @returns {any}
|
||||
*/
|
||||
export function sortByPodIp(ip) : any {
|
||||
// i guess there is maybe nicer ways of sort this without parsing and slicing
|
||||
var regex = /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
|
||||
var groups = regex.exec(ip);
|
||||
if (angular.isDefined(groups)) {
|
||||
var g1 = ("00" + groups[1]).slice(-3);
|
||||
var g2 = ("00" + groups[2]).slice(-3);
|
||||
var g3 = ("00" + groups[3]).slice(-3);
|
||||
var g4 = ("00" + groups[4]).slice(-3);
|
||||
var answer = g1 + g2 + g3 + g4;
|
||||
return answer;
|
||||
} else {
|
||||
return 0;
|
||||
/**
|
||||
* Sorts the the ip field
|
||||
*
|
||||
* @param ip the ip such as '10.1.2.13'
|
||||
* @returns {any}
|
||||
*/
|
||||
export function sortByPodIp(ip): any {
|
||||
// i guess there is maybe nicer ways of sort this without parsing and slicing
|
||||
var regex = /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
|
||||
var groups = regex.exec(ip);
|
||||
if (angular.isDefined(groups)) {
|
||||
var g1 = ("00" + groups[1]).slice(-3);
|
||||
var g2 = ("00" + groups[2]).slice(-3);
|
||||
var g3 = ("00" + groups[3]).slice(-3);
|
||||
var g4 = ("00" + groups[4]).slice(-3);
|
||||
var answer = g1 + g2 + g3 + g4;
|
||||
return answer;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function ramdomPort(): number{
|
||||
var hostPort=Math.floor(30000+Math.random()*(65535-30000));
|
||||
while(hostPorts.indexOf(hostPort) === 0){
|
||||
hostPort = Math.floor(30000+Math.random()*(65535-30000));
|
||||
}
|
||||
hostPorts.push(hostPort);
|
||||
return hostPort
|
||||
}
|
||||
|
||||
export function getRandomString(len : number) : string{
|
||||
len = len || 32;
|
||||
var $chars = 'abcdefhijkmnprstwxyz'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1
|
||||
var maxPos = $chars.length;
|
||||
var pwd = '';
|
||||
for (var i = 0; i < len; i++) {
|
||||
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return pwd;
|
||||
}
|
||||
|
||||
export class resourceRCTemplate{
|
||||
|
||||
public image="oracle:utf8";
|
||||
public names = ["oradata"];
|
||||
|
||||
public createRC(Obj){
|
||||
var labels = {
|
||||
"style": "oracle",
|
||||
"status": "0",
|
||||
"isExtract": Obj.isExtract+"" || "0",
|
||||
"isTarget": Obj.isTarget
|
||||
};
|
||||
for(var item in Obj.labels)
|
||||
labels[item] = Obj.labels[item];
|
||||
|
||||
return {
|
||||
"apiVersion" : Kubernetes.defaultApiVersion,
|
||||
"kind" : "ReplicationController",
|
||||
"metadata" : {
|
||||
"name" : Obj.name,
|
||||
"labels" : labels,
|
||||
"annotations": Obj.annotations
|
||||
},
|
||||
"spec" : {
|
||||
replicas : Obj.replicas || 1,
|
||||
"template" : this.createTemplate(Obj)
|
||||
}
|
||||
export function ramdomPort(): number {
|
||||
var hostPort = Math.floor(30000 + Math.random() * (65535 - 30000));
|
||||
while (hostPorts.indexOf(hostPort) === 0) {
|
||||
hostPort = Math.floor(30000 + Math.random() * (65535 - 30000));
|
||||
}
|
||||
}
|
||||
hostPorts.push(hostPort);
|
||||
return hostPort
|
||||
}
|
||||
|
||||
public createVolumeMounts(){
|
||||
var volumeMounts = [];
|
||||
for(var item in this.names){
|
||||
if(this.names[item] === 'flash-recovery-area')
|
||||
volumeMounts.push({
|
||||
"name" : this.names[item],
|
||||
"mountPath" : "/opt/oracle/app/flash_recovery_area"
|
||||
});
|
||||
else
|
||||
volumeMounts.push({
|
||||
"name" : this.names[item],
|
||||
"mountPath" : "/opt/oracle/app/" + this.names[item]
|
||||
});
|
||||
export function getRandomString(len: number): string {
|
||||
len = len || 32;
|
||||
var $chars = 'abcdefhijkmnprstwxyz'; // 默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1
|
||||
var maxPos = $chars.length;
|
||||
var pwd = '';
|
||||
for (var i = 0; i < len; i++) {
|
||||
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return volumeMounts;
|
||||
}
|
||||
return pwd;
|
||||
}
|
||||
|
||||
public createVolumes(rootPath :string){
|
||||
var volumes = [];
|
||||
for(var item in this.names){
|
||||
if(this.names[item] === 'flash-recovery-area')
|
||||
volumes.push({
|
||||
"name" : this.names[item],
|
||||
"hostPath" :{
|
||||
"path" : rootPath + "flash_recovery_area"
|
||||
}
|
||||
});
|
||||
else
|
||||
volumes.push({
|
||||
"name" : this.names[item],
|
||||
"hostPath" :{
|
||||
"path" : rootPath + this.names[item]
|
||||
}
|
||||
});
|
||||
}
|
||||
return volumes;
|
||||
}
|
||||
export class resourceRCTemplate {
|
||||
|
||||
public createContainers(Obj){
|
||||
var containers = [];
|
||||
containers.push(
|
||||
{
|
||||
"name" : "oracle",
|
||||
"image": this.image,
|
||||
"imagePullPolicy": "IfNotPresent",
|
||||
"command":["/assets/entrypoint.sh"],
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": 1521,
|
||||
"hostPort": Obj.port || ramdomPort()
|
||||
}],
|
||||
"resources": {
|
||||
"cpu": "100m",
|
||||
"memory": "3Gi"
|
||||
},
|
||||
"volumeMounts" : this.createVolumeMounts()
|
||||
});
|
||||
return containers
|
||||
}
|
||||
public image = "oracle:utf8";
|
||||
public names = ["oradata"];
|
||||
|
||||
public createTemplate(Obj){
|
||||
return {
|
||||
"metadata":
|
||||
{
|
||||
//"name": Obj.name,
|
||||
"labels": Obj.labels
|
||||
},
|
||||
"spec" : {
|
||||
"terminationGracePeriodSeconds" : 0,
|
||||
"containers" : this.createContainers(Obj),
|
||||
"volumes" : this.createVolumes(Obj.path)
|
||||
public createRC(Obj) {
|
||||
var labels = {
|
||||
"style": "oracle",
|
||||
"status": "0",
|
||||
"isExtract": Obj.isExtract + "" || "0",
|
||||
"isTarget": Obj.isTarget
|
||||
};
|
||||
for (var item in Obj.labels)
|
||||
labels[item] = Obj.labels[item];
|
||||
|
||||
return {
|
||||
"apiVersion": Kubernetes.defaultApiVersion,
|
||||
"kind": "ReplicationController",
|
||||
"metadata": {
|
||||
"name": Obj.name,
|
||||
"labels": labels,
|
||||
"annotations": Obj.annotations
|
||||
},
|
||||
"spec": {
|
||||
replicas: Obj.replicas || 1,
|
||||
"template": this.createTemplate(Obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function labelToChinese(labels){
|
||||
var answer = {};
|
||||
angular.forEach(labels,(value, key) => {
|
||||
answer[key] = labelChangeToChines(value, key);
|
||||
});
|
||||
return answer
|
||||
}
|
||||
|
||||
export function findSameNameReplicationControllers(replicationControllers, name){
|
||||
var names = [];
|
||||
replicationControllers.forEach((rc) => {
|
||||
var rcName = getName(rc);
|
||||
if(rcName.indexof(name) !== -1)
|
||||
names.push(rcName);
|
||||
});
|
||||
|
||||
if(names.length === 0){
|
||||
return name + "_1";
|
||||
}else{
|
||||
var max = 0;
|
||||
names.forEach((value) => {
|
||||
var answer = value.split("_");
|
||||
var key = parseInt(answer[1]);
|
||||
if(max < key)
|
||||
max = key;
|
||||
});
|
||||
return name + (max+1);
|
||||
}
|
||||
}
|
||||
|
||||
export function isFilterRC(rc){
|
||||
var answer = false;
|
||||
angular.forEach(Core.pathGet(rc, ["metadata", "labels"]),(value, key) => {
|
||||
if(key === 'isTarget' && value === 'true'){
|
||||
answer = true;
|
||||
}
|
||||
});
|
||||
return answer;
|
||||
}
|
||||
|
||||
export function isInclude(rcs, rc){
|
||||
for(var i in rcs){
|
||||
if(getName(rcs[i]) === getName(rc))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function labelChangeToChines(value:string, key:string){
|
||||
var trueValue = '';
|
||||
switch(key){
|
||||
case 'type':
|
||||
if(value === '01')
|
||||
trueValue = '财政';
|
||||
else if(value === '02')
|
||||
trueValue = '社保';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'batch':
|
||||
if(value === 'A')
|
||||
trueValue = '批次A';
|
||||
else if(value === 'B')
|
||||
trueValue = '批次B';
|
||||
else
|
||||
trueValue = value;
|
||||
|
||||
break;
|
||||
case 'region':
|
||||
trueValue = Kubernetes.getCountyByCode(value);
|
||||
break;
|
||||
case 'system':
|
||||
trueValue = Kubernetes.getSystemNameById(value);
|
||||
break;
|
||||
case 'version':
|
||||
var reg= new RegExp('^[0-9]$').exec(value);
|
||||
if(reg)
|
||||
trueValue = '版本' + reg[0];
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'isTarget':
|
||||
if(value === 'true')
|
||||
trueValue = '汇总数据库';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
default:
|
||||
trueValue = value;
|
||||
}
|
||||
return trueValue;
|
||||
}
|
||||
|
||||
export function checkForExit(replicationControllers:Array<KubePod>, selectItem){
|
||||
for(var index in replicationControllers) {
|
||||
var replicas = replicationControllers[index];
|
||||
if(getName(replicas)==selectItem._key && getAnnotationValueBykey(replicas,"year") == selectItem["year"])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getAnnotationValueBykey(replicationController, key:string){
|
||||
var annotations = getAnnotations(replicationController);
|
||||
if(annotations && annotations != undefined){
|
||||
return annotations[key];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
启动oracle时检查是否正在迁移
|
||||
*/
|
||||
export function checkForCreateOracle(transferTasks:Array<any>, selectItems:Array<any>){
|
||||
var result = [];
|
||||
angular.forEach(selectItems, (item) => {
|
||||
if(checkForExitTask(transferTasks, item))
|
||||
result.push(item);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
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 ){
|
||||
if(task.status == 2 || task.status == 3)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
**/
|
||||
export function checkForExtract(replicationControllers: Array<any>){
|
||||
var result = [];
|
||||
angular.forEach(replicationControllers, (replicas) => {
|
||||
var labels = getLabels(replicas);
|
||||
if(labels["isExtract"] == "1")
|
||||
result.push(replicas);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export function checkIsStartSuccess(replicationControllers: Array<any>){
|
||||
var result = [];
|
||||
angular.forEach(replicationControllers, (replicas) => {
|
||||
var labels = getLabels(replicas);
|
||||
if(labels["status"] != "2")
|
||||
result.push(replicas);
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
检查数据否已挂载使用或正在迁移。
|
||||
*/
|
||||
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(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;
|
||||
public createVolumeMounts() {
|
||||
var volumeMounts = [];
|
||||
for (var item in this.names) {
|
||||
if (this.names[item] === 'flash-recovery-area')
|
||||
volumeMounts.push({
|
||||
"name": this.names[item],
|
||||
"mountPath": "/opt/oracle/app/flash_recovery_area"
|
||||
});
|
||||
else
|
||||
volumeMounts.push({
|
||||
"name": this.names[item],
|
||||
"mountPath": "/opt/oracle/app/" + this.names[item]
|
||||
});
|
||||
}
|
||||
return volumeMounts;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
数据是否在热区,如果在则需要判断数据是否已启动
|
||||
*/
|
||||
if(item["mark"] == 1)
|
||||
continue;
|
||||
|
||||
/*
|
||||
检查迁移文件是否已挂载使用
|
||||
*/
|
||||
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;
|
||||
public createVolumes(rootPath: string) {
|
||||
var volumes = [];
|
||||
for (var item in this.names) {
|
||||
if (this.names[item] === 'flash-recovery-area')
|
||||
volumes.push({
|
||||
"name": this.names[item],
|
||||
"hostPath": {
|
||||
"path": rootPath + "flash_recovery_area"
|
||||
}
|
||||
});
|
||||
else
|
||||
volumes.push({
|
||||
"name": this.names[item],
|
||||
"hostPath": {
|
||||
"path": rootPath + this.names[item]
|
||||
}
|
||||
});
|
||||
}
|
||||
return volumes;
|
||||
}
|
||||
}
|
||||
|
||||
public createContainers(Obj) {
|
||||
var containers = [];
|
||||
containers.push({
|
||||
"name": "oracle",
|
||||
"image": this.image,
|
||||
"imagePullPolicy": "IfNotPresent",
|
||||
"command": ["/assets/entrypoint.sh"],
|
||||
"ports": [{
|
||||
"containerPort": 1521,
|
||||
"hostPort": Obj.port || ramdomPort()
|
||||
}],
|
||||
"resources": {
|
||||
"cpu": "100m",
|
||||
"memory": "3Gi"
|
||||
},
|
||||
"volumeMounts": this.createVolumeMounts()
|
||||
});
|
||||
return containers
|
||||
}
|
||||
|
||||
public createTemplate(Obj) {
|
||||
return {
|
||||
"metadata": {
|
||||
//"name": Obj.name,
|
||||
"labels": Obj.labels
|
||||
},
|
||||
"spec": {
|
||||
"terminationGracePeriodSeconds": 0,
|
||||
"containers": this.createContainers(Obj),
|
||||
"volumes": this.createVolumes(Obj.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
export function labelToChinese(labels) {
|
||||
var answer = {};
|
||||
angular.forEach(labels, (value, key) => {
|
||||
answer[key] = labelChangeToChines(value, key);
|
||||
});
|
||||
return answer
|
||||
}
|
||||
|
||||
export function eliminateChechBoxClick(){
|
||||
var element = $("#tableConfig > thead > tr input:checkbox");
|
||||
if(element.is(':checked'))
|
||||
element.click();
|
||||
}
|
||||
export function findSameNameReplicationControllers(replicationControllers, name) {
|
||||
var names = [];
|
||||
replicationControllers.forEach((rc) => {
|
||||
var rcName = getName(rc);
|
||||
if (rcName.indexof(name) !== -1)
|
||||
names.push(rcName);
|
||||
});
|
||||
|
||||
/*
|
||||
是否已存在当前
|
||||
*/
|
||||
export function alreadyExitInFolder(selectedItems: Array<any>, selectNode){
|
||||
var childNodes = selectNode.childNodes;
|
||||
for(var i in selectedItems) {
|
||||
var itemName = selectedItems[i].regionalismCode + "_" + selectedItems[i].systemCode;
|
||||
for (var j in childNodes) {
|
||||
if(childNodes[j].name == itemName){
|
||||
var childrens = childNodes[j].childNodes;
|
||||
for(var k in childrens)
|
||||
if(childrens[k].name == selectedItems[i].dataVersion)
|
||||
if (names.length === 0) {
|
||||
return name + "_1";
|
||||
} else {
|
||||
var max = 0;
|
||||
names.forEach((value) => {
|
||||
var answer = value.split("_");
|
||||
var key = parseInt(answer[1]);
|
||||
if (max < key)
|
||||
max = key;
|
||||
});
|
||||
return name + (max + 1);
|
||||
}
|
||||
}
|
||||
|
||||
export function isFilterRC(rc) {
|
||||
var answer = false;
|
||||
angular.forEach(Core.pathGet(rc, ["metadata", "labels"]), (value, key) => {
|
||||
if (key === 'isTarget' && value === 'true') {
|
||||
answer = true;
|
||||
}
|
||||
});
|
||||
return answer;
|
||||
}
|
||||
|
||||
export function isInclude(rcs, rc) {
|
||||
for (var i in rcs) {
|
||||
if (getName(rcs[i]) === getName(rc))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function labelChangeToChines(value: string, key: string) {
|
||||
var trueValue = '';
|
||||
switch (key) {
|
||||
case 'type':
|
||||
if (value === '01')
|
||||
trueValue = '财政';
|
||||
else if (value === '02')
|
||||
trueValue = '社保';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'batch':
|
||||
if (value === 'A')
|
||||
trueValue = '批次A';
|
||||
else if (value === 'B')
|
||||
trueValue = '批次B';
|
||||
else
|
||||
trueValue = value;
|
||||
|
||||
break;
|
||||
case 'region':
|
||||
trueValue = Kubernetes.getCountyByCode(value);
|
||||
break;
|
||||
case 'system':
|
||||
trueValue = Kubernetes.getSystemNameById(value);
|
||||
break;
|
||||
case 'version':
|
||||
var reg = new RegExp('^[0-9]$').exec(value);
|
||||
if (reg)
|
||||
trueValue = '版本' + reg[0];
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
case 'isTarget':
|
||||
if (value === 'true')
|
||||
trueValue = '汇总数据库';
|
||||
else
|
||||
trueValue = value;
|
||||
break;
|
||||
default:
|
||||
trueValue = value;
|
||||
}
|
||||
return trueValue;
|
||||
}
|
||||
|
||||
export function checkForExit(replicationControllers: Array < KubePod > , selectItem) {
|
||||
for (var index in replicationControllers) {
|
||||
var replicas = replicationControllers[index];
|
||||
if (getName(replicas) == selectItem._key && getAnnotationValueBykey(replicas, "year") == selectItem["year"])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getAnnotationValueBykey(replicationController, key: string) {
|
||||
var annotations = getAnnotations(replicationController);
|
||||
if (annotations && annotations != undefined) {
|
||||
return annotations[key];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
启动oracle时检查是否正在迁移
|
||||
*/
|
||||
export function checkForCreateOracle(transferTasks: Array < any > , selectItems: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(selectItems, (item) => {
|
||||
if (checkForExitTask(transferTasks, item))
|
||||
result.push(item);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
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) {
|
||||
if (task.status == 2 || task.status == 3)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
**/
|
||||
export function checkForExtract(replicationControllers: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(replicationControllers, (replicas) => {
|
||||
var labels = getLabels(replicas);
|
||||
if (labels["isExtract"] == "1")
|
||||
result.push(replicas);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export function checkIsStartSuccess(replicationControllers: Array < any > ) {
|
||||
var result = [];
|
||||
angular.forEach(replicationControllers, (replicas) => {
|
||||
var labels = getLabels(replicas);
|
||||
if (labels["status"] != "2")
|
||||
result.push(replicas);
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
检查数据否已挂载使用或正在迁移。
|
||||
*/
|
||||
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 (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 (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;
|
||||
}
|
||||
|
||||
|
||||
export function eliminateChechBoxClick() {
|
||||
var element = $("#tableConfig > thead > tr input:checkbox");
|
||||
if (element.is(':checked'))
|
||||
element.click();
|
||||
}
|
||||
|
||||
/*
|
||||
是否已存在当前
|
||||
*/
|
||||
export function alreadyExitInFolder(selectedItems: Array < any > , selectNode) {
|
||||
var childNodes = selectNode.childNodes;
|
||||
for (var i in selectedItems) {
|
||||
var itemName = selectedItems[i].regionalismCode + "_" + selectedItems[i].systemCode;
|
||||
for (var j in childNodes) {
|
||||
if (childNodes[j].name == itemName) {
|
||||
var childrens = childNodes[j].childNodes;
|
||||
for (var k in childrens)
|
||||
if (childrens[k].name == selectedItems[i].dataVersion)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function alreadyExitInCluster(selectedItems: Array < any > , volumePath) {
|
||||
|
||||
|
||||
for (var i = 0; i < selectedItems.length; ++i) {
|
||||
if (selectedItems[i].dataPath.indexOf(volumePath) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -13,9 +13,21 @@
|
|||
<i class="glyphicon glyphicon-export"></i> Excel导出
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
<button class="sj_btn_green fl mr5" ng-click="upLoadExcelFile()">
|
||||
<button class="sj_btn_green mr5" ng-click="upLoadExcelFile()">
|
||||
<i class="glyphicon glyphicon-import"></i>Excel导入
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
<div class="row clear fr mb10">
|
||||
<!--<input type="checkbox" class="fl mr5 " style="margin-top: 8px;" />
|
||||
<label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>-->
|
||||
<button class="btn pull-right sj_btn_grey mr20" ng-click="openLog()">
|
||||
<i class="glyphicon glyphicon-export"></i> 导出日志查看
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
<button class="sj_btn_green mr5" ng-click="dataManagementExport()">
|
||||
<i class="glyphicon glyphicon-export"></i> 导出
|
||||
</button>
|
||||
<span class="pull-right"> </span>
|
||||
</div>
|
||||
<div ng-show="true">
|
||||
<div class="col-md-12" >
|
||||
|
|
|
@ -6,272 +6,274 @@
|
|||
/// <reference path="../../configs/ts/customAlert.ts"/>
|
||||
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
|
||||
|
||||
module System{
|
||||
export var SystemSQLManagement = controller('SystemSQLManagement', ['$scope', '$location', '$http', '$element', '$templateCache', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $http, $element, $templateCache, NgTableParams, ngDialog, SystemModel) => {
|
||||
shareInit($scope);
|
||||
$scope.cities = classifyCity(SystemModel.regionalismInfo);
|
||||
module System {
|
||||
export var SystemSQLManagement = controller('SystemSQLManagement', ['$scope', '$location', '$http', '$element', '$templateCache', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $http, $element, $templateCache, NgTableParams, ngDialog, SystemModel) => {
|
||||
shareInit($scope);
|
||||
$scope.cities = classifyCity(SystemModel.regionalismInfo);
|
||||
|
||||
$scope.status = [{id: 0, label: "有缺失"}, {id: 1, label: "正常"}, {id: 2, label:"待归档"}, {id: 3, label: "待审核"}];
|
||||
$scope.status = [{ id: 0, label: "有缺失" }, { id: 1, label: "正常" }, { id: 2, label: "待归档" }, { id: 3, label: "待审核" }];
|
||||
|
||||
SystemModel.updateSqlInfo();
|
||||
SystemModel.updateSqlInfo();
|
||||
|
||||
$scope.model = SystemModel.sqlInfo;
|
||||
$scope.model = SystemModel.sqlInfo;
|
||||
|
||||
$scope.checkboxes = {
|
||||
checked: false,
|
||||
items: {}
|
||||
};
|
||||
$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) => {
|
||||
$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) => {
|
||||
$scope.optionsFilter.y = y;
|
||||
}
|
||||
|
||||
$scope.statusSelect = (z) => {
|
||||
$scope.optionsFilter.z = z;
|
||||
}
|
||||
|
||||
$scope.$watch(() =>{
|
||||
return $scope.optionsFilter;
|
||||
}, (value) =>{
|
||||
shareUpdate($scope.model, value);
|
||||
}, true);
|
||||
|
||||
$scope.quickCheck = () => {
|
||||
updateSqlStatus("/java/console/api/filePackage/totalVerifySqlFile");
|
||||
}
|
||||
|
||||
$scope.quickFile = () => {
|
||||
updateSqlStatus("/java/console/api/filePackage/totalOnholeSqlFile");
|
||||
}
|
||||
|
||||
$scope.help = () => {
|
||||
ngDialog.open({
|
||||
template: 'statusHelp.html',
|
||||
width: 600,
|
||||
height: 370,
|
||||
closeByDocument: false,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
|
||||
// watch for check all checkbox
|
||||
$scope.$watch(function() {
|
||||
return $scope.checkboxes.checked;
|
||||
}, function(value) {
|
||||
angular.forEach($scope.model, function(item) {
|
||||
$scope.checkboxes.items[item.id] = value;
|
||||
});
|
||||
});
|
||||
|
||||
// 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;
|
||||
$scope.optionsFilter = {
|
||||
x: "all",
|
||||
y: "all",
|
||||
z: "all"
|
||||
}
|
||||
}
|
||||
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.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.$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();
|
||||
});
|
||||
});
|
||||
|
||||
$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) => {
|
||||
$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);
|
||||
$scope.tableParams = new NgTableParams({ count: 25 }, {
|
||||
counts: [25, 50, 100],
|
||||
dataset: $scope.model
|
||||
});
|
||||
filter = result;
|
||||
result = [];
|
||||
}
|
||||
|
||||
if(value.y != "all"){
|
||||
angular.forEach(filter, (item) => {
|
||||
if(item.districtName == value.y)
|
||||
result.push(item);
|
||||
});
|
||||
filter = result;
|
||||
result = [];
|
||||
}
|
||||
$scope.citySelect = (x) => {
|
||||
$scope.optionsFilter.x = x;
|
||||
$scope.optionsFilter.y = $scope.y = "all";
|
||||
if (x != "all") {
|
||||
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); //获取当前市下所有区县
|
||||
} else {
|
||||
$scope.countries = [];
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
$scope.countrySelect = (y) => {
|
||||
$scope.optionsFilter.y = y;
|
||||
}
|
||||
|
||||
$scope.checkboxes = {
|
||||
checked: false,
|
||||
items: {}
|
||||
};
|
||||
}
|
||||
$scope.statusSelect = (z) => {
|
||||
$scope.optionsFilter.z = z;
|
||||
}
|
||||
|
||||
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);
|
||||
$scope.$watch(() => {
|
||||
return $scope.optionsFilter;
|
||||
}, (value) => {
|
||||
shareUpdate($scope.model, value);
|
||||
}, true);
|
||||
|
||||
$scope.quickCheck = () => {
|
||||
updateSqlStatus("/java/console/api/filePackage/totalVerifySqlFile");
|
||||
}
|
||||
|
||||
$scope.quickFile = () => {
|
||||
updateSqlStatus("/java/console/api/filePackage/totalOnholeSqlFile");
|
||||
}
|
||||
|
||||
$scope.help = () => {
|
||||
ngDialog.open({
|
||||
template: 'statusHelp.html',
|
||||
width: 600,
|
||||
height: 370,
|
||||
closeByDocument: false,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
|
||||
// watch for check all checkbox
|
||||
$scope.$watch(function() {
|
||||
return $scope.checkboxes.checked;
|
||||
}, function(value) {
|
||||
angular.forEach($scope.model, function(item) {
|
||||
$scope.checkboxes.items[item.id] = value;
|
||||
});
|
||||
});
|
||||
}
|
||||
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){
|
||||
$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");
|
||||
});
|
||||
}
|
||||
}])
|
||||
// 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.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.$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();
|
||||
});
|
||||
});
|
||||
|
||||
$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) => {
|
||||
$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 = [];
|
||||
}
|
||||
|
||||
if (value.y != "all") {
|
||||
angular.forEach(filter, (item) => {
|
||||
if (item.districtName == value.y)
|
||||
result.push(item);
|
||||
});
|
||||
filter = result;
|
||||
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
|
||||
});
|
||||
|
||||
$scope.checkboxes = {
|
||||
checked: false,
|
||||
items: {}
|
||||
};
|
||||
}
|
||||
|
||||
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("正在更新文件,请稍等!"); //创建数据加载效果层
|
||||
|
||||
$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");
|
||||
});
|
||||
}
|
||||
}])
|
||||
}
|
|
@ -6,165 +6,190 @@
|
|||
/// <reference path="systemHelpers.ts"/>
|
||||
/// <reference path="../../configs/ts/configsUtils.ts"/>
|
||||
|
||||
module System{
|
||||
export var SystemListController = controller('SystemListController', ['$scope', '$location', '$http', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $http, $templateCache, Upload, NgTableParams, ngDialog, SystemModel) => {
|
||||
shareInit($scope);
|
||||
module System {
|
||||
export var SystemListController = controller('SystemListController', ['$scope', '$interval', '$location', '$http', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', 'TerminalService', ($scope, $interval, $location, $http, $templateCache, Upload, NgTableParams, ngDialog, SystemModel, TerminalService) => {
|
||||
shareInit($scope);
|
||||
|
||||
$scope.modelServices = SystemModel;
|
||||
$scope.modelServices.updateExcelInfo();
|
||||
$scope.model = SystemModel.systemInfoList;
|
||||
$scope.modelServices = SystemModel;
|
||||
$scope.modelServices.updateExcelInfo();
|
||||
$scope.model = SystemModel.systemInfoList;
|
||||
|
||||
// 表头显示的信息
|
||||
$scope.columns= [
|
||||
{ field: 'id', title: '操作', show: true},
|
||||
{ field: "collection", title: "采集对象", filter: { collection: "select" }, filterData: booleanChoose(), show: true },
|
||||
{ field: "cityName", title: "市", filter: { cityName: 'text' }, show: true },
|
||||
{ field: "districtName", title: "区/县", filter: { districtName: 'text' }, show: true },
|
||||
{ field: "areaCode", title: "行政区划代码", filter: {areaCode: 'text'}, show: true },
|
||||
{ field: "areaLevel", title: "地区级次", filter: { areaLevel: "select" }, filterData: levelType(), show: true },
|
||||
{ field: "sysName", title: "信息系统名称", filter: { sysName: "text" }, show: true },
|
||||
{ field: "departmentManager", title: "联系人", filter: { departmentManager: "text" }, show: true },
|
||||
{ field: "managerContacts", title: "联系方式", filter: { managerContacts: "text" }, show: true },
|
||||
{ field: "dataBaseType", title: "数据库类型", filter: { dataBaseType: "select" }, filterData: databaseType(), show: true},
|
||||
{ field: "userTablespaceStatus", title: "oracle用户名表空间", filter: { userTablespaceStatus: "select" }, filterData: booleanChoose(), show: true},
|
||||
{ field: "checkoutPayStatus", title: "支付信息标准表脚本", filter: { checkoutPayStatus: "select" }, filterData: booleanChoose(), show: true},
|
||||
{ field: "checkoutIndicateStatus", title: "可执行标准表脚本", filter: { checkoutIndicateStatus: "select" }, filterData: booleanChoose(), show: true},
|
||||
];
|
||||
// 表头显示的信息
|
||||
$scope.columns = [
|
||||
{ field: 'id', title: '操作', show: true },
|
||||
{ field: "collection", title: "采集对象", filter: { collection: "select" }, filterData: booleanChoose(), show: true },
|
||||
{ field: "cityName", title: "市", filter: { cityName: 'text' }, show: true },
|
||||
{ field: "districtName", title: "区/县", filter: { districtName: 'text' }, show: true },
|
||||
{ field: "areaCode", title: "行政区划代码", filter: { areaCode: 'text' }, show: true },
|
||||
{ field: "areaLevel", title: "地区级次", filter: { areaLevel: "select" }, filterData: levelType(), show: true },
|
||||
{ field: "sysName", title: "信息系统名称", filter: { sysName: "text" }, show: true },
|
||||
{ field: "departmentManager", title: "联系人", filter: { departmentManager: "text" }, show: true },
|
||||
{ field: "managerContacts", title: "联系方式", filter: { managerContacts: "text" }, show: true },
|
||||
{ field: "dataBaseType", title: "数据库类型", filter: { dataBaseType: "select" }, filterData: databaseType(), show: true },
|
||||
{ field: "userTablespaceStatus", title: "oracle用户名表空间", filter: { userTablespaceStatus: "select" }, filterData: booleanChoose(), show: true },
|
||||
{ field: "checkoutPayStatus", title: "支付信息标准表脚本", filter: { checkoutPayStatus: "select" }, filterData: booleanChoose(), show: true },
|
||||
{ field: "checkoutIndicateStatus", title: "可执行标准表脚本", filter: { checkoutIndicateStatus: "select" }, filterData: booleanChoose(), show: true },
|
||||
];
|
||||
|
||||
// 点击查看按钮事件处理函数
|
||||
$scope.viewClick = (selected) => {
|
||||
ngDialog.open({
|
||||
template: 'systemInfo.html',
|
||||
controller: 'Configs.SystemInfoController',
|
||||
width: 790,
|
||||
closeByDocument: false,
|
||||
data: selected,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
// 表数据
|
||||
$scope.tableParams = new NgTableParams({count: 25}, {
|
||||
counts: [25, 50, 100],
|
||||
dataset: $scope.model
|
||||
});
|
||||
|
||||
// 文件上传
|
||||
$scope.upLoadExcelFile = () => {
|
||||
Configs.FileInputPlugin((files) =>{
|
||||
var fileNameList = []; //获取文件名列表
|
||||
angular.forEach(files, (file) => {
|
||||
fileNameList.push(file.name);
|
||||
// 点击查看按钮事件处理函数
|
||||
$scope.viewClick = (selected) => {
|
||||
ngDialog.open({
|
||||
template: 'systemInfo.html',
|
||||
controller: 'Configs.SystemInfoController',
|
||||
width: 790,
|
||||
closeByDocument: false,
|
||||
data: selected,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
// 表数据
|
||||
$scope.tableParams = new NgTableParams({ count: 25 }, {
|
||||
counts: [25, 50, 100],
|
||||
dataset: $scope.model
|
||||
});
|
||||
|
||||
Configs.create_mask();
|
||||
Kubernetes.create_locadEffect("正在上传文件...");
|
||||
var target = document.getElementById('loading');
|
||||
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
// 文件上传
|
||||
$scope.upLoadExcelFile = () => {
|
||||
Configs.FileInputPlugin((files) => {
|
||||
var fileNameList = []; //获取文件名列表
|
||||
angular.forEach(files, (file) => {
|
||||
fileNameList.push(file.name);
|
||||
});
|
||||
|
||||
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);
|
||||
})
|
||||
Configs.create_mask();
|
||||
Kubernetes.create_locadEffect("正在上传文件...");
|
||||
var target = document.getElementById('loading');
|
||||
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
// var Resumable = require('resumable');
|
||||
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"
|
||||
}*/
|
||||
});
|
||||
|
||||
r.on('fileAdded', function(file){
|
||||
r.upload();
|
||||
});
|
||||
if (!r.support) {
|
||||
throw "当前浏览器不支持Resumable.js文件上传";
|
||||
} else {
|
||||
angular.forEach(files, (file) => {
|
||||
r.addFile(file);
|
||||
})
|
||||
|
||||
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) =>{
|
||||
r.on('fileAdded', function(file) {
|
||||
r.upload();
|
||||
});
|
||||
|
||||
},
|
||||
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: (XMLHttpRequest, textStatus, errorThrown) =>{
|
||||
$("#load").remove();
|
||||
Kubernetes.removeMask();
|
||||
if(XMLHttpRequest["responseJSON"].err && XMLHttpRequest["responseJSON"].err instanceof Array)
|
||||
ngDialog.open({
|
||||
template: 'uploadErrorInfo.html',
|
||||
width: 755,
|
||||
closeByDocument: false,
|
||||
data: XMLHttpRequest["responseJSON"].err,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
});
|
||||
r.on('complete', function() {
|
||||
$('#loadmsg').html("所有文件上传完毕,正在读取文件中的数据,此过程时间可能会较长,请稍等...");
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
url: UrlHelpers.join("/java/console/api/fileOperation/importExcel"),
|
||||
dataType: 'json',
|
||||
data: JSON.stringify(fileNameList),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
complete: (XMLHttpRequest, textStatus) => {
|
||||
|
||||
},
|
||||
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: (XMLHttpRequest, textStatus, errorThrown) => {
|
||||
$("#load").remove();
|
||||
Kubernetes.removeMask();
|
||||
if (XMLHttpRequest["responseJSON"].err && XMLHttpRequest["responseJSON"].err instanceof Array)
|
||||
ngDialog.open({
|
||||
template: 'uploadErrorInfo.html',
|
||||
width: 755,
|
||||
closeByDocument: false,
|
||||
data: XMLHttpRequest["responseJSON"].err,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//excel下载
|
||||
$scope.downLoadExcelFile = () => {
|
||||
Configs.create_mask();
|
||||
Kubernetes.create_locadEffect("正在导出excel文件,请稍等...");
|
||||
var target = document.getElementById('loading');
|
||||
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
Configs.downloadFile($scope, $http, '/java/console/api/fileOperation/file/download', "export.xls", () => {
|
||||
$("#load").remove();
|
||||
Kubernetes.removeMask();
|
||||
});
|
||||
|
||||
r.on('fileProgress', function(file){
|
||||
$('#loadmsg').html("上传文件:" + file.fileName + " " + Math.floor(r.progress()*100) + '%');
|
||||
//Kubernetes.create_locadEffect("上传文件:" + file.name + " " + Math.floor(r.progress()*100) + '%'); //创建数据加载效果层
|
||||
}
|
||||
|
||||
$scope.downloadFilePackage = () => {
|
||||
Configs.create_mask();
|
||||
Kubernetes.create_locadEffect("正在下载文件包,请稍等...");
|
||||
var target = document.getElementById('loading');
|
||||
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
|
||||
Configs.downloadFile($scope, $http, '/java/console/api/filePackage/download', "package.zip", () => {
|
||||
$("#load").remove();
|
||||
Kubernetes.removeMask();
|
||||
});
|
||||
|
||||
//解决不同重复选择相同文件
|
||||
var element = document.getElementById("file-uploads");
|
||||
if(null != element)
|
||||
element.outerHTML = element.outerHTML;
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
//excel下载
|
||||
$scope.downLoadExcelFile = () =>{
|
||||
Configs.downloadFile($scope, $http, '/java/console/api/fileOperation/file/download', () =>{
|
||||
Configs.customAlert("提示","导出成功,文件下载完成",'',null,0,"success");
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$scope.downloadFilePackage = () =>{
|
||||
Configs.create_mask();
|
||||
Kubernetes.create_locadEffect("正在下载文件,请稍等...");
|
||||
var target = document.getElementById('loading');
|
||||
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
|
||||
Configs.downloadFile($scope, $http, '/java/console/api/filePackage/download', () =>{
|
||||
$("#load").remove();
|
||||
Kubernetes.removeMask();
|
||||
});
|
||||
}
|
||||
$scope.dataManagementExport = () => {
|
||||
ngDialog.open({
|
||||
template: 'dataExport.html',
|
||||
width: 1005,
|
||||
height: 600,
|
||||
// data: {id : id},
|
||||
scope: $scope,
|
||||
className: 'ngdialog-theme-default',
|
||||
controller: 'Configs.dataExportController',
|
||||
closeByDocument: false
|
||||
});
|
||||
}
|
||||
$scope.openLog = () => {
|
||||
|
||||
//boolean选择条件:是/否
|
||||
function booleanChoose(){
|
||||
return [{id: '是', title: '是'}, {id: '否', title: '否'}];
|
||||
}
|
||||
// 数据库类型选择条件:oracle/sql Server
|
||||
function databaseType(){
|
||||
return [{id: 'oracle', title: 'ORACLE'}, {id: 'sql Server', title: 'SQL SERVER'}];
|
||||
}
|
||||
TerminalService.newTerminal($interval, "exportData", "", "export_data", "/java/console/api/oracle/exportData/log", $templateCache.get(UrlHelpers.join(Kubernetes.templatePath, 'logShell.html')));
|
||||
}
|
||||
|
||||
//level选择条件
|
||||
function levelType(){
|
||||
return [{id: '省', title: '省'}, {id: '市', title: '市'}, {id: '县', title: '县'}];
|
||||
}
|
||||
}])
|
||||
//boolean选择条件:是/否
|
||||
function booleanChoose() {
|
||||
return [{ id: '是', title: '是' }, { id: '否', title: '否' }];
|
||||
}
|
||||
// 数据库类型选择条件:oracle/sql Server
|
||||
function databaseType() {
|
||||
return [{ id: 'oracle', title: 'ORACLE' }, { id: 'sql Server', title: 'SQL SERVER' }];
|
||||
}
|
||||
|
||||
//level选择条件
|
||||
function levelType() {
|
||||
return [{ id: '省', title: '省' }, { id: '市', title: '市' }, { id: '县', title: '县' }];
|
||||
}
|
||||
}])
|
||||
}
|
|
@ -8,393 +8,404 @@
|
|||
/// <reference path="../../configs/ts/configsDataService.ts"/>
|
||||
/// <reference path="../../kubernetes/ts/term.ts"/>
|
||||
|
||||
module System{
|
||||
module System {
|
||||
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);
|
||||
shareInit($scope);
|
||||
$scope.cities = classifyCity(SystemModel.regionalismInfo);
|
||||
$scope.model = SystemModel;
|
||||
$scope.tableData = null;
|
||||
$scope.tableData = null;
|
||||
$scope.checkboxes = {
|
||||
checked: false,
|
||||
items: {}
|
||||
};
|
||||
// 表数据
|
||||
$scope.tableParams = new NgTableParams({count: 25}, {
|
||||
};
|
||||
// 表数据
|
||||
$scope.tableParams = new NgTableParams({ count: 25 }, {
|
||||
counts: [25, 50, 100],
|
||||
dataset: $scope.tableData
|
||||
});
|
||||
});
|
||||
|
||||
$scope.citySelect = (x) =>{
|
||||
$scope.countries=[];
|
||||
$scope.y = "all";
|
||||
if(x != 'all'){
|
||||
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
|
||||
$http({
|
||||
url: "/java/console/api/checkout/findByCity",
|
||||
method: "POST",
|
||||
data: x
|
||||
}).success((data, header, config, status) => {
|
||||
$scope.tableData =data.data;
|
||||
$scope.citySelect = (x) => {
|
||||
$scope.countries = [];
|
||||
$scope.y = "all";
|
||||
if (x != 'all') {
|
||||
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
url: UrlHelpers.join("/java/console/api/checkout/findByCity"),
|
||||
dataType: 'json',
|
||||
data: JSON.stringify(x),
|
||||
// data: { "idList": idList, "typeList": typeList },
|
||||
// data: JSON.stringify(formData),
|
||||
|
||||
success: (data) => {
|
||||
$scope.tableData = data.data;
|
||||
$scope.tableParams.settings({
|
||||
dataset: $scope.tableData
|
||||
});
|
||||
|
||||
},
|
||||
error: (data) => {
|
||||
Configs.customAlert("提示", "请求失败!", '', null, 0, "error");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//$scope.countries=[];
|
||||
//$scope.y = "all";
|
||||
$scope.tableData = null;
|
||||
$scope.checkboxes = {
|
||||
checked: false,
|
||||
items: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$scope.countrySelect = (y) => {
|
||||
if (y != 'all') {
|
||||
var result = [];
|
||||
angular.forEach($scope.tableData, (item) => {
|
||||
if (item.districtName == y)
|
||||
result.push(item);
|
||||
});
|
||||
$scope.tableParams.settings({
|
||||
dataset: $scope.tableData
|
||||
});
|
||||
}).error((data, header, config, status) => {
|
||||
throw "请求失败"
|
||||
});
|
||||
}else{
|
||||
//$scope.countries=[];
|
||||
//$scope.y = "all";
|
||||
$scope.tableData = null;
|
||||
$scope.checkboxes = {
|
||||
checked: false,
|
||||
items: {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$scope.countrySelect = (y) => {
|
||||
if(y != 'all'){
|
||||
var result = [];
|
||||
angular.forEach($scope.tableData, (item) => {
|
||||
if(item.districtName == y)
|
||||
result.push(item);
|
||||
});
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
}else{
|
||||
$scope.tableParams.settings({
|
||||
dataset: $scope.tableData
|
||||
});
|
||||
}
|
||||
dataset: result
|
||||
});
|
||||
} else {
|
||||
$scope.tableParams.settings({
|
||||
dataset: $scope.tableData
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$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;
|
||||
** 检查是否有默认标准表汇总库
|
||||
**/
|
||||
var answer = false;
|
||||
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
|
||||
if (ConfigsModel.oracleParam[i].type == 1) {
|
||||
answer = true
|
||||
break;
|
||||
}
|
||||
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 "请求失败"
|
||||
});
|
||||
}
|
||||
|
||||
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]){
|
||||
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;
|
||||
}
|
||||
}
|
||||
$scope.deleteRows = () => {
|
||||
var filter = [];
|
||||
if ($scope.tableData && $scope.tableData.length > 0) {
|
||||
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, filter, "verify");
|
||||
var message = Kubernetes.checkForMigration(KubernetesModel.replicationControllers, DataModel.transferTasks, filter, "verify");
|
||||
|
||||
if(message != ""){
|
||||
Configs.customAlert("提示", "操作失败:部分数据" + message +",无法删除", '',null, 0, "error");
|
||||
return
|
||||
}
|
||||
|
||||
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",
|
||||
data: filter
|
||||
}).success((data, header, config, status) => {
|
||||
$scope.tableData = data.data;
|
||||
var result = [];
|
||||
if($scope.y != 'all'){
|
||||
angular.forEach($scope.tableData, (item) =>{
|
||||
if(item.districtName == $scope.y)
|
||||
result.push(item);
|
||||
});
|
||||
}else{
|
||||
result = $scope.tableData;
|
||||
}
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
}).error((data, header, config, status) => {
|
||||
throw "请求失败"
|
||||
});
|
||||
}
|
||||
},
|
||||
title: '是否需要删除采集数据?',
|
||||
action: '以下采集数据文件将会被删除:',
|
||||
okText: '删除',
|
||||
okClass: 'btn-danger sj_btn_cir',
|
||||
custom: "该删除操作将会彻底删除数据文件,是否删除,请确认!",
|
||||
customClass: "alert alert-warning sj_alert-warning",
|
||||
cancelText: "取消",
|
||||
cancelClass: 'sj_btn_grey'
|
||||
}).open();
|
||||
|
||||
UI.multiItemConfirmActionDialog( < UI.MultiItemConfirmActionOptions > {
|
||||
collection: filter,
|
||||
index: 'index',
|
||||
onClose: (result: boolean) => {
|
||||
if (result) {
|
||||
$http({
|
||||
url: "/java/console/api/checkout/deleteList",
|
||||
method: "POST",
|
||||
data: filter
|
||||
}).success((data, header, config, status) => {
|
||||
$scope.tableData = data.data;
|
||||
var result = [];
|
||||
if ($scope.y != 'all') {
|
||||
angular.forEach($scope.tableData, (item) => {
|
||||
if (item.districtName == $scope.y)
|
||||
result.push(item);
|
||||
});
|
||||
} else {
|
||||
result = $scope.tableData;
|
||||
}
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
}).error((data, header, config, status) => {
|
||||
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 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){
|
||||
//var sqlServerDB = [];
|
||||
var oracleDB = [];
|
||||
var selectedItems = [];
|
||||
/**
|
||||
提示没有配置标准表汇总库
|
||||
**/
|
||||
Configs.customAlert("提示", "操作失败:没有配置默认的标准表汇总库", '',null, 0, "error");
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
** 检查是否有默认标准表汇总库
|
||||
**/
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
此处需要检查数据是否已挂载、正在迁移。
|
||||
*/
|
||||
/*if(item.payResultLast == 1){
|
||||
Configs.customAlert("提示", "操作失败:选择的系统存在不需要校验的系统", '',null, 0, "error");
|
||||
return;
|
||||
var exited = Kubernetes.checkForCreateOracle(DataModel.transferTasks, selectedItems);
|
||||
if (exited.length > 0) {
|
||||
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能执行校验操作!", '', null, 0, "error");
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
检查数据是否在热区
|
||||
*/
|
||||
|
||||
if(item.mark == 1 && item.dataBaseType == 'ORACLE'){
|
||||
Configs.customAlert("提示", "操作失败:选择的系统的数据存储在冷区,请先将数据迁移到热区再检验!", '',null, 0, "error");
|
||||
return
|
||||
/*
|
||||
如果是Oracle数据,先启动oracle数据
|
||||
*/
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
$http({
|
||||
url: "/java/console/api/checkout/checkList",
|
||||
method: "POST",
|
||||
data: selectedItems
|
||||
}).success((data, header, config, status) => {
|
||||
$scope.tableData = data.data;
|
||||
var result = [];
|
||||
if ($scope.y != 'all') {
|
||||
angular.forEach($scope.tableData, (item) => {
|
||||
if (item.districtName == $scope.y)
|
||||
result.push(item);
|
||||
});
|
||||
} else {
|
||||
result = $scope.tableData;
|
||||
}
|
||||
|
||||
/*
|
||||
如果是Oracle数据,先启动oracle数据
|
||||
*/
|
||||
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: selectedItems
|
||||
}).success((data, header, config, status) => {
|
||||
$scope.tableData = data.data;
|
||||
var result = [];
|
||||
if($scope.y != 'all'){
|
||||
angular.forEach($scope.tableData, (item) =>{
|
||||
if(item.districtName == $scope.y)
|
||||
result.push(item);
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
}).error((data, header, config, status) => {
|
||||
throw "请求失败"
|
||||
});
|
||||
}else{
|
||||
result = $scope.tableData;
|
||||
}
|
||||
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
}).error((data, header, config, status) => {
|
||||
throw "请求失败"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// watch for check all checkbox
|
||||
$scope.$watch(function() {
|
||||
return $scope.checkboxes.checked;
|
||||
return $scope.checkboxes.checked;
|
||||
}, function(value) {
|
||||
angular.forEach($scope.tableData, function(item) {
|
||||
$scope.checkboxes.items[item.id] = value;
|
||||
});
|
||||
angular.forEach($scope.tableData, function(item) {
|
||||
$scope.checkboxes.items[item.id] = value;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// watch for data checkboxes
|
||||
$scope.$watch(function() {
|
||||
return $scope.checkboxes.items;
|
||||
return $scope.checkboxes.items;
|
||||
}, function(values) {
|
||||
$scope.checkable = false;
|
||||
for(var index in values){
|
||||
if(values[index] == true){
|
||||
$scope.checkable = true;
|
||||
break;
|
||||
$scope.checkable = false;
|
||||
for (var index in values) {
|
||||
if (values[index] == true) {
|
||||
$scope.checkable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
var checked = 0, unchecked = 0, total = -1;
|
||||
if($scope.tableData && ($scope.tableData instanceof Array))
|
||||
total = $scope.tableData.length;
|
||||
angular.forEach($scope.tableData, function(item) {
|
||||
checked += ($scope.checkboxes.items[item.id]) || 0;
|
||||
unchecked += Number(!$scope.checkboxes.items[item.id]) || 0;
|
||||
});
|
||||
var checked = 0,
|
||||
unchecked = 0,
|
||||
total = -1;
|
||||
if ($scope.tableData && ($scope.tableData instanceof Array))
|
||||
total = $scope.tableData.length;
|
||||
angular.forEach($scope.tableData, 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);
|
||||
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);
|
||||
|
||||
$scope.update = (entity) => {
|
||||
ngDialog.open({
|
||||
template: 'sysVerificationUpdate.html',
|
||||
controller: 'Configs.sysVerUpdateController',
|
||||
width: 900,
|
||||
height: 600,
|
||||
closeByDocument: false,
|
||||
data: entity,
|
||||
scope: $scope,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
ngDialog.open({
|
||||
template: 'sysVerificationUpdate.html',
|
||||
controller: 'Configs.sysVerUpdateController',
|
||||
width: 900,
|
||||
height: 600,
|
||||
closeByDocument: false,
|
||||
data: entity,
|
||||
scope: $scope,
|
||||
className: 'ngdialog-theme-default'
|
||||
});
|
||||
}
|
||||
|
||||
$scope.$on('updateRow', (event, data) => {
|
||||
$http({
|
||||
url: "/java/console/api/checkout/update",
|
||||
method:'POST',
|
||||
data: JSON.stringify(data)
|
||||
}).success(function(data,header,config,status){
|
||||
if(header == 200){
|
||||
Configs.customAlert("提示", "操作成功!", '',null, 0, "success");
|
||||
var result = [];
|
||||
if($scope.y != 'all'){
|
||||
angular.forEach(data.data, (item) => {
|
||||
if($scope.y == item.districtName)
|
||||
result.push(item);
|
||||
})
|
||||
}else
|
||||
result = data.data;
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
}
|
||||
else
|
||||
Configs.customAlert("提示", "操作失败!", '',null, 0, "error");
|
||||
}).error(function(data,header,config,status){
|
||||
Configs.customAlert("提示", "操作失败:发生请求失败,不能删除!", '',null, 0, "error");
|
||||
});
|
||||
});
|
||||
$http({
|
||||
url: "/java/console/api/checkout/update",
|
||||
method: 'POST',
|
||||
data: JSON.stringify(data)
|
||||
}).success(function(data, header, config, status) {
|
||||
if (header == 200) {
|
||||
Configs.customAlert("提示", "操作成功!", '', null, 0, "success");
|
||||
var result = [];
|
||||
if ($scope.y != 'all') {
|
||||
angular.forEach(data.data, (item) => {
|
||||
if ($scope.y == item.districtName)
|
||||
result.push(item);
|
||||
})
|
||||
} else
|
||||
result = data.data;
|
||||
$scope.tableParams.settings({
|
||||
dataset: result
|
||||
});
|
||||
} else
|
||||
Configs.customAlert("提示", "操作失败!", '', null, 0, "error");
|
||||
}).error(function(data, header, config, status) {
|
||||
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')));
|
||||
$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…
Reference in New Issue