增加获取服务文件列表功能

This commit is contained in:
wu ming 2016-09-06 19:03:43 +08:00
parent 7073155320
commit 3a86521e19
19 changed files with 506 additions and 711 deletions

View File

@ -94,5 +94,7 @@ declare module Kubernetes {
interface KubePod { interface KubePod {
id: string; id: string;
namespace: string; namespace: string;
metadata: any;
$replicas: number;
} }
} }

View File

@ -1,4 +1,16 @@
declare module Kubernetes { declare module Kubernetes {
var system_arr: {
"sys_name": string;
"sys_id": string;
}[];
var origin_place_arr: {
"city_code": string;
"city": string;
"county": string;
"county_code": string;
"sys_name": string;
"sys_code": string;
}[];
function getCountyByCode(code: any): any; function getCountyByCode(code: any): any;
function getCodeByCounty(place: any): any; function getCodeByCounty(place: any): any;
function getSystemNameById(id: any): any; function getSystemNameById(id: any): any;

View File

@ -3,6 +3,7 @@
/// <reference path="kubernetesPlugin.d.ts" /> /// <reference path="kubernetesPlugin.d.ts" />
declare module Kubernetes { declare module Kubernetes {
var PodStatus: ng.IModule; var PodStatus: ng.IModule;
var DataLabels: ng.IModule;
var Labels: ng.IModule; var Labels: ng.IModule;
var Status: ng.IModule; var Status: ng.IModule;
} }

3
defs.d.ts vendored
View File

@ -25,6 +25,7 @@
/// <reference path="d.ts/developer/ts/projects.d.ts"/> /// <reference path="d.ts/developer/ts/projects.d.ts"/>
/// <reference path="d.ts/developer/ts/workspace.d.ts"/> /// <reference path="d.ts/developer/ts/workspace.d.ts"/>
/// <reference path="d.ts/developer/ts/workspaces.d.ts"/> /// <reference path="d.ts/developer/ts/workspaces.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/apps.d.ts"/> /// <reference path="d.ts/kubernetes/ts/apps.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/build.d.ts"/> /// <reference path="d.ts/kubernetes/ts/build.d.ts"/>
@ -34,7 +35,6 @@
/// <reference path="d.ts/kubernetes/ts/buildLogs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/buildLogs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/builds.d.ts"/> /// <reference path="d.ts/kubernetes/ts/builds.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/connect.d.ts"/> /// <reference path="d.ts/kubernetes/ts/connect.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/dataInfnModel.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/deploymentConfig.d.ts"/> /// <reference path="d.ts/kubernetes/ts/deploymentConfig.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/deploymentConfigs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/deploymentConfigs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/events.d.ts"/> /// <reference path="d.ts/kubernetes/ts/events.d.ts"/>
@ -70,4 +70,3 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/> /// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/> /// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/> /// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<head>
<title>数据管理平台</title> <title>数据管理平台</title>
<base href='/'></base> <base href='/'></base>
<meta charset="UTF8" /> <meta charset="UTF8" />
<link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.css" /> <link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="libs/patternfly/dist/css/patternfly.css" /> <link rel="stylesheet" href="libs/patternfly/dist/css/patternfly.css" />
<link rel="stylesheet" href="libs/patternfly/dist/css/patternfly-additions.css" /> <link rel="stylesheet" href="libs/patternfly/dist/css/patternfly-additions.css" />
@ -24,9 +24,7 @@
<link rel="stylesheet" href="libs/kubernetes-container-terminal/dist/container-terminal.css" /> <link rel="stylesheet" href="libs/kubernetes-container-terminal/dist/container-terminal.css" />
<!-- endbower --> <!-- endbower -->
<link rel="stylesheet" type="text/css" href="libs/angular-tree-control/css/tree-control-attribute.css"> <link rel="stylesheet" type="text/css" href="libs/angular-tree-control/css/tree-control-attribute.css">
<link rel="stylesheet" href="dist/hawtio-kubernetes.css" /> <link rel="stylesheet" href="dist/hawtio-kubernetes.css" />
<!-- bower:js --> <!-- bower:js -->
<script src="libs/jquery/dist/jquery.js"></script> <script src="libs/jquery/dist/jquery.js"></script>
<script src="libs/angular/angular.js"></script> <script src="libs/angular/angular.js"></script>
@ -78,7 +76,6 @@
<script src="libs/hawtio-kubernetes-api/dist/hawtio-kubernetes-api.js"></script> <script src="libs/hawtio-kubernetes-api/dist/hawtio-kubernetes-api.js"></script>
<script src="libs/js-yaml/dist/js-yaml.js"></script> <script src="libs/js-yaml/dist/js-yaml.js"></script>
<!-- endbower --> <!-- endbower -->
<script type="text/javascript" src="libs/codemirror/addon/edit/closetag.js"></script> <script type="text/javascript" src="libs/codemirror/addon/edit/closetag.js"></script>
<script type="text/javascript" src="libs/codemirror/addon/edit/continuelist.js"></script> <script type="text/javascript" src="libs/codemirror/addon/edit/continuelist.js"></script>
<script type="text/javascript" src="libs/codemirror/addon/edit/matchbrackets.js"></script> <script type="text/javascript" src="libs/codemirror/addon/edit/matchbrackets.js"></script>
@ -97,54 +94,56 @@
<!-- link for js when using the tree as --> <!-- link for js when using the tree as -->
<script type="text/javascript" src="libs/angular-tree-control/angular-tree-control.js"></script> <script type="text/javascript" src="libs/angular-tree-control/angular-tree-control.js"></script>
<script type="text/javascript" src="resumable.js"></script> <script type="text/javascript" src="resumable.js"></script>
<script src="libs/bootstrap/dist/js/bootstrap.js"></script> <script src="libs/bootstrap/dist/js/bootstrap.js"></script>
<script src="libs/patternfly/dist/js/patternfly.js"></script> <script src="libs/patternfly/dist/js/patternfly.js"></script>
<script src="libs/hawtio-extension-service/dist/hawtio-extension-service.js"></script> <script src="libs/hawtio-extension-service/dist/hawtio-extension-service.js"></script>
<script src="libs/hawtio-preferences/dist/hawtio-preferences.js"></script> <script src="libs/hawtio-preferences/dist/hawtio-preferences.js"></script>
<!-- NOTE we need to make sure this is loaded much later than d3.js! --> <!-- NOTE we need to make sure this is loaded much later than d3.js! -->
<script src="libs/nvd3/build/nv.d3.js"></script> <script src="libs/nvd3/build/nv.d3.js"></script>
<style> <style>
.navbar-brand > img { .navbar-brand > img {
height: 20px; height: 20px;
margin-top: -5px; margin-top: -5px;
margin-bottom: -5px; margin-bottom: -5px;
} }
body { body {
/* overwrite a top-padding from site-base.css in hawtio-ui */ /* overwrite a top-padding from site-base.css in hawtio-ui */
padding-top: inherit; padding-top: inherit;
} }
.breadcrumb {
.breadcrumb {
/* overwrite the bottom padding from pf's breadcrumb class */ /* overwrite the bottom padding from pf's breadcrumb class */
margin-bottom: 0; margin-bottom: 0;
} }
.wiki-icon-view {
.wiki-icon-view {
border-radius: 0; border-radius: 0;
border: none; border: none;
} }
.kubernetes-view .row.filter-header {
.kubernetes-view .row.filter-header {
margin-top: 1em; margin-top: 1em;
} }
</style> </style>
</head>
</head> <body style="padding-top: 75px;">
<body style="padding-top: 75px;">
<nav class="navbar navbar-fixed-top navbar-pf" role="navigation"> <nav class="navbar navbar-fixed-top navbar-pf" role="navigation">
<a href="/" class="log fl"><img src="/" class="log-img"></a> <a href="/" class="log fl"><img src="/" class="log-img"></a>
<ul class="nav navbar-nav navbar-primary" hawtio-main-nav></ul> <ul class="nav navbar-nav navbar-primary" hawtio-main-nav></ul>
</nav> </nav>
<platform-sub-tabs-outlet></platform-sub-tabs-outlet> <platform-sub-tabs-outlet></platform-sub-tabs-outlet>
<div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet> <div id="main" class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary content-margin" ng-controller="HawtioNav.ViewController" hawtio-main-outlet>
<div class="row" ng-class="getClass()"> <div class="row">
<hawtio-breadcrumbs-outlet></hawtio-breadcrumbs-outlet> <hawtio-breadcrumbs-outlet></hawtio-breadcrumbs-outlet>
<div ng-include src="viewPartial"></div> </div>
<div class="row" ng-class="getClass()">
<div ng-include src="viewPartial">
</div>
</div> </div>
</div> </div>
<script src="dist/hawtio-kubernetes.js"></script> <script src="dist/hawtio-kubernetes.js"></script>
</body> </body>
</html> </html>

View File

@ -23,18 +23,19 @@
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<a class="btn btn-default pull-right" title="启动oracle服务" href="/kubernetes/replicationControllers" ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)"><i class="fa fa-plus"></i> 启动服务</a> <a class="btn btn-default pull-right" title="启动oracle服务" href="/kubernetes/replicationControllers" ng-disabled="!id && tableConfig.selectedItems.length == 0" ng-click="createOracleService(id || tableConfig.selectedItems)"><i class="fa fa-plus"></i> 启动服务</a>
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<a class="btn btn-default pull-right" title="迁移数据" " ng-disabled="!id && tableConfig.selectedItems.length==0 " ng-click="migrationClick.open(id || tableConfig.selectedItems) "><i class="fa fa-plus "></i> 数据迁移</a>
</div> </div>
<div class="col-md-6 col-md-offset-9"> <div class="col-md-6 col-md-offset-9 ">
每页显示&nbsp 每页显示&nbsp
<select ng-options="value for value in pageSizeChoses" ng-change="selectAction()" ng-model="options.currentTableSize"></select> <select ng-options="value for value in pageSizeChoses " ng-change="selectAction() " ng-model="options.currentTableSize "></select>
&nbsp&nbsp当前页码 &nbsp&nbsp当前页码
<div class="hawtio-pager clearfix"> <div class="hawtio-pager clearfix ">
<label>{{options.currentPageNum}} / {{options.getPageSizeNum()}}</label> <label>{{options.currentPageNum}} / {{options.getPageSizeNum()}}</label>
<div class=btn-group> <div class=btn-group>
<button class="btn" ng-disabled="isEmptyOrFirst()" ng-click="first()"><i class="fa fa-fast-backward"></i></button> <button class="btn " ng-disabled="isEmptyOrFirst() " ng-click="first() "><i class="fa fa-fast-backward "></i></button>
<button class="btn" ng-disabled="isEmptyOrFirst()" ng-click="previous()"><i class="fa fa-step-backward"></i></button> <button class="btn " ng-disabled="isEmptyOrFirst() " ng-click="previous() "><i class="fa fa-step-backward "></i></button>
<button class="btn" ng-disabled="isEmptyOrLast()" ng-click="next()"><i class="fa fa-step-forward"></i></button> <button class="btn " ng-disabled="isEmptyOrLast() " ng-click="next() "><i class="fa fa-step-forward "></i></button>
<button class="btn" ng-disabled="isEmptyOrLast()" ng-click="last()"><i class="fa fa-fast-forward"></i></button> <button class="btn " ng-disabled="isEmptyOrLast() " ng-click="last() "><i class="fa fa-fast-forward "></i></button>
</div> </div>
</div> </div>
</div> </div>
@ -42,5 +43,25 @@
</div> </div>
</div> </div>
</div> </div>
<div class="prettify"></div> <div modal="migrationClick.dialog.show ">
<form name="selectFolder " class=" " ng-submit="migrationClick.onOk() ">
<div class="modal-header "><h4>数据迁移</h4></div>
<div class="modal-body">
<div class="row">
<label class="col-sm-3 control-label" for="selectedItem ">
请选择迁移集群
</label>
<select ng-model="migrationClick.selectedItem " class="col-sm-3" title="name of the new namespace " id ="selectedItem " ng-options="x.$oracleName for x in filterReplicationControllers " />
</div>
<div>
</div>
</div>
<div class="modal-footer ">
<input class="btn btn-primary " type="submit" ng-disabled="false" value="确定">
<button class="btn btn-warning cancel " type="button" ng-click="migrationClick.close()">取消</button>
</div>
</form>
</div>
<div class="prettify "></div>
</div> </div>

View File

@ -4,29 +4,44 @@ module Developer{
export function createCurrentSubNavBar($scope, $location, $routeParams){ export function createCurrentSubNavBar($scope, $location, $routeParams){
return activateCurrent([ return activateCurrent([
{ {
href: "#", href: UrlHelpers.join(context,"Overview","hot/data-type/all"),
label: "数据查看", label: "热区数据管理",
title: "查看所有数据", title: "查看所有数据",
items: [{ items: [{
href: UrlHelpers.join(context,"Overview/data-type/all"), href: UrlHelpers.join(context,"Overview","hot/data-type/all"),
label: "全部", label: "全部",
title: "全部数据" title: "全部数据"
}, },
{ {
href: UrlHelpers.join(context,"Overview/data-type/financial"), href: UrlHelpers.join(context,"Overview","hot/data-type/financial"),
label: "财政", label: "财政",
title: "财政数据" title: "财政数据"
}, },
{ {
href: UrlHelpers.join(context,"Overview/data-type/social-security"), href: UrlHelpers.join(context,"Overview/","hot/data-type/social-security"),
label: "社保", label: "社保",
title: "社保数据" title: "社保数据"
}] }]
}, },
{ {
href: UrlHelpers.join(context, "task"), href: UrlHelpers.join(context,"Overview","cold/data-type/all"),
label: "任务", label: "冷区数据管理",
title: "数据汇总任务", title: "数据汇总任务",
items: [{
href: UrlHelpers.join(context,"Overview","cold/data-type/all"),
label: "全部",
title: "全部数据"
},
{
href: UrlHelpers.join(context,"Overview","cold/data-type/financial"),
label: "财政",
title: "财政数据"
},
{
href: UrlHelpers.join(context,"Overview/","cold/data-type/social-security"),
label: "社保",
title: "社保数据"
}]
} }
]); ]);
} }

View File

@ -36,6 +36,14 @@ module Developer{
return num; return num;
} }
} }
function createLabel(cityName:string, districtName:string, systemName:string, version:string){
return{
cityName: cityName,
districtName: districtName,
systemName: systemName,
version: "版本"+version
}
}
function createKey(regionalismCode, systemId, version){ function createKey(regionalismCode, systemId, version){
return regionalismCode + "-" + systemId + "-" + version; return regionalismCode + "-" + systemId + "-" + version;
@ -47,11 +55,26 @@ module Developer{
return result; return result;
} }
function populateLabel(item){
var result = item
result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion);
return result;
}
function populateLabels(items:Array<any>){
var result = [];
angular.forEach(items, (item) => {
result.push(populateLabel(item));
});
return result;
}
function populateKeys(items:Array<any>){ function populateKeys(items:Array<any>){
var result =[]; var result =[];
angular.forEach(items, (item) =>{ angular.forEach(items, (item) =>{
result.push(populateKey(item)); result.push(populateKey(item));
}); });
return result;
} }
function createName(cityName, districtName){ function createName(cityName, districtName){
@ -66,9 +89,10 @@ module Developer{
function populateNames(items:Array<any>){ function populateNames(items:Array<any>){
var result = []; var result = [];
angular.forEach(items, (item) =>{ angular.forEach(items, (item) =>{
result.push(populateName(item)); result.push(populateName(item));
}); });
return result;
} }
function createParamData(options: OptionsParams){ function createParamData(options: OptionsParams){
@ -115,8 +139,9 @@ module Developer{
//格式数据模型中的每个单条记录 //格式数据模型中的每个单条记录
public maybeFormat(){ public maybeFormat(){
populateKeys(this.data); this.data = populateKeys(this.data);
populateNames(this.data); this.data = populateNames(this.data);
this.data = populateLabels(this.data);
} }
//更新用户选择参数 //更新用户选择参数

View File

@ -132,10 +132,10 @@ module Developer {
* Returns the name of the given environment namespace * Returns the name of the given environment namespace
*/ */
function environmentName(workspaceName, environment) { function environmentName(workspaceName, environment) {
var model = Kubernetes.getKubernetesModel(); /*var model = Kubernetes.getKubernetesModel();
if (model) { if (model) {
return model.environmentName(workspaceName, environment); return model.environmentName(workspaceName, environment);
} }*/
return environment; return environment;
} }

View File

@ -10,9 +10,9 @@ module Developer {
_module.config(['$routeProvider', ($routeProvider:ng.route.IRouteProvider) => { _module.config(['$routeProvider', ($routeProvider:ng.route.IRouteProvider) => {
$routeProvider.when(context, route('workspaces.html', false)) $routeProvider.when(context, route('workspaces.html', false))
.when("/data-manager", route('workspaces.html', false)) .when("/data-manager", route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/data-type/all'), route('workspaces.html', false)) .when(UrlHelpers.join(context, 'Overview/:type/data-type/all'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/data-type/financial'), route('workspaces.html', false)) .when(UrlHelpers.join(context, 'Overview/:type/data-type/financial'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/data-type/social-security'), route('workspaces.html', false)) .when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'task'), route('apps.html', false)) .when(UrlHelpers.join(context, 'task'), route('apps.html', false))
.otherwise(context); .otherwise(context);

View File

@ -22,9 +22,9 @@ module Developer {
//配置数据表格需要显示的内容及显示格式 //配置数据表格需要显示的内容及显示格式
$scope.tableConfig = { $scope.tableConfig = {
data: 'model.data', data: 'model.data',
enableRowClickSelection: true,
showSelectionCheckbox: true, showSelectionCheckbox: true,
multiSelect: true, enableRowClickSelection: false,
multiSelect: true,
selectedItems: [], selectedItems: [],
filterOptions: { filterOptions: {
filterText: $location.search()["q"] || '' filterText: $location.search()["q"] || ''
@ -34,8 +34,7 @@ module Developer {
field: "_key", field: "_key",
displayName: '编码', displayName: '编码',
customSortField: (field) =>{ customSortField: (field) =>{
return field.id; return field.id;
//console.log(field);
} }
}, },
{ {
@ -46,6 +45,11 @@ module Developer {
field: "systemName", field: "systemName",
displayName: '系统名称' displayName: '系统名称'
}, },
{
field: "labels",
displayName: '数据标签',
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
},
{ {
field: "collectingTime", field: "collectingTime",
displayName: '采集时间' displayName: '采集时间'
@ -53,11 +57,7 @@ module Developer {
{ {
field: "collectorName", field: "collectorName",
displayName: '汇总状态' displayName: '汇总状态'
}, }
{
field: "collectorContacts",
displayName: '联系方式'
}
] ]
}; };
@ -141,8 +141,34 @@ module Developer {
}); });
} }
$scope.createOracleService = (items) =>{ $scope.migrationClick = {
angular.forEach(items,(item)=>{ items:null,
selectedItem: $scope.tableConfig.selectedItems,
dialog: new UI.Dialog(),
onOk: () => {
},
open: (selected) =>{
var migrationClick = $scope.migrationClick;
migrationClick.dialog.open();
$http({
url: "/java/console/api/getFolder",
method:'POST',
params:{oracleName: selected}
}).success(function(data,header,config,status){
$scope.treeData = data;
console.log("success");
}).error(function(data,header,config,status){
//log.warn("Failed to connect " + connectParam + " " + data + " " + status);
});
},
close: () => {
$scope.migrationClick.dialog.close();
}
};
$scope.createOracleService = (items) =>{
console.log(items);
/*angular.forEach(items,(item)=>{
console.log(item); console.log(item);
Kubernetes.createRC({ Kubernetes.createRC({
name: item._key, name: item._key,
@ -161,7 +187,7 @@ module Developer {
}, (rc) =>{ }, (rc) =>{
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", Kubernetes.getName(rc), 0); Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", Kubernetes.getName(rc), 0);
}); });
}); });*/
} }
function init($scope,$location,$routeParams){ function init($scope,$location,$routeParams){

View File

@ -70,6 +70,18 @@
ng-click="$emit('labelFilterUpdate', key + '=' + value)">{{value}}</span> ng-click="$emit('labelFilterUpdate', key + '=' + value)">{{value}}</span>
</div> </div>
</script> </script>
<script type="text/ng-template" id="dataLabelsTemplate.html" ng-controller="Kubernetes.DataLabels">
<div class="ngCellText" ng-init="labels=row.entity.labels" >
<p ng-show="data"><strong>Labels</strong></p>
<span ng-repeat="(key, value) in labels track by $index"
class="pod-label badge"
ng-class="labelClass(label.key)"
ng-click="labelClick(entity, label.key, label.value)"
title="{{label.key}}">{{value}}</span>
</div>
</script>
<script type="text/ng-template" id="hostTemplate.html"> <script type="text/ng-template" id="hostTemplate.html">
<div class="ngCellText" ng-init="host=row.entity.$host"> <div class="ngCellText" ng-init="host=row.entity.$host">
<span class="pod-label badge background-light-grey mouse-pointer" <span class="pod-label badge background-light-grey mouse-pointer"

View File

@ -1,192 +0,0 @@
/// <reference path="../../includes.ts"/>
/// <reference path="kubernetesPlugin.ts"/>
module Kubernetes{
export class dataInfoModelService{
public serverdata = {};
public promiseobject = {};
public localdata = {};
public selectednodes = [];
public resumablejs = [];
public selecteditems = [];
public serveritems = [];
public uploadprocess ={};
public uploadedStatus = "";
public get uploadProcess():Object {
return this.uploadprocess
}
public set uploadProcess(uploadProcess:Object){
this.uploadprocess = uploadProcess;
}
public folderList = {
length:0
};
public get serverItems():Array<any> {
return this.serveritems;
}
public set serverItems(serverItems: Array<any>){
this.serveritems = serverItems;
}
public get resumableJs():Array<any> {
return this.resumableJs;
}
public set resumableJs(resumableJs: Array<any>){
this.resumablejs = resumableJs;
}
public get selectedItems():Array<any> {
return this.selecteditems;
}
public set selectedItems(selectedItems: Array<any>){
this.selecteditems = selectedItems;
}
public get selectedNodes():Array<any> {
return this.selectednodes;
}
public set selectedNodes(selectedNodes: Array<any>){
this.selectednodes = selectedNodes;
}
public isContainsNodes(node: Object){
for(var item in this.selectednodes){
if(this.selectednodes[item].id === node.id)
return true;
}
return false;
}
public findNodes(node: any) {
var id = "-1";
if(typeof(node) === "object" ){
id = node.id;
}else if(typeof(node) === "number"){
id =node.toString();
}else if(typeof(node) === "string"){
id = node;
}else{
return "-1";
}
for(var item in this.selectednodes){
if(this.selectednodes[item].id === id)
return item;
}
return "-1";
}
public findItemIndex(item: any){
var id = -1;
if(typeof(item) === "object" ){
id = item.id;
}else if(typeof(item) === "number"){
id =item.toString();
}else if(typeof(item) === "string"){
id = item;
}else{
return -1;
}
for(var it in this.selecteditems){
if(this.selecteditems[it].id === id)
return it;
}
return -1;
}
public createFolderList(files: Object ,rootPath: string){
for(var i=0; i< files.length; i++){
var relativePath = files[i].webkitRelativePath.replace(RegExp("^"+rootPath+"/"),"");
var paths=relativePath.split("/");
if(!this.folderList.hasOwnProperty(paths[0])){
this.folderList[paths[0]]={
length:0
};
this.folderList.length++;
}
var Obj = this.folderList[paths[0]];
Obj[Obj.length] = files[i];
Obj.length++;
this.folderList[paths[0]] = Obj;
}
}
public updateNodeById(nodeId,key,value){
for(var item in this.selectednodes){
var node = this.selectednodes[item];
if(node.id === nodeId){
node[key] = value;
break;
}
}
}
public get serverData():Object {
return this.serverData;
}
public set serverData(serverData:Object){
this.serverdata=serverData;
}
public get promiseObject():Object {
return this.promiseobject;
}
public set promise(promiseObject:Object){
this.promiseobject = promiseObject;
}
public get localData():Object {
return this.localdata;
}
public set localData(localData:Object){
this.localdata = localData;
}
public updataDataModel(){
this.promiseobject.success(function(data,header,config,status){
this.serverdata =data;
});
this.promiseobject.error(function(data,status,hedaers,config){
this.serverdata = {};
});
}
}
_module.factory('DataInfoModel', ['$http', ($http) => {
var $scope =new dataInfoModelService();
$scope.promiseobject=$http({
url:'/xmlformserver',
method:'POST'
});
updateDataFromServer($scope.serverdata, (data,header,config,status) => {
$scope.serverdata = data;
});
function updateDataFromServer(data,callback){
$http({
url:'/xmlformserver',
method:'POST'
}).success(function(data,header,config,status){
if(data)
callback(data,header,config,status);
}).error(function(data,header,config,status){
console.log("error");
});
};
return $scope;
}]);
}

View File

@ -1552,7 +1552,7 @@ module Kubernetes {
'region': 'k8s-badge-region', 'region': 'k8s-badge-region',
'type': 'k8s-badge-type', 'type': 'k8s-badge-type',
'system': 'k8s-badge-system', 'system': 'k8s-badge-system',
'isTarget': 'k8s-badge-target' 'isTarget': 'k8s-badge-target'
}; };
export function containerLabelClass(labelType:string) { export function containerLabelClass(labelType:string) {

View File

@ -141,6 +141,8 @@ module Kubernetes {
export interface KubePod { export interface KubePod {
id:string; id:string;
namespace:string; namespace:string;
metadata;
$replicas: number;
} }

View File

@ -3,7 +3,7 @@ read a object from jiangsu province , such as nanjing with some information
*/ */
module Kubernetes{ module Kubernetes{
public var system_arr = [{"sys_name":"部门预算","sys_id":"1"},{"sys_name":"非税收入收缴管理系统","sys_id":"2"}, export var 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":"预算执行系统","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":"用友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":"9"},{"sys_name":"财政管理一体化系统","sys_id":"10"},{"sys_name":"滨江开发区财政分局","sys_id":"11"},
@ -85,7 +85,7 @@ module Kubernetes{
{"sys_name":"盐城市_城南新区_总预算账务处理系统","sys_id":"235"},{"sys_name":"财政预算指标管理","sys_id":"236"},{"sys_name":"泰州市_市本级_行政管理系统","sys_id":"237"}, {"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"}]; {"sys_name":"新中大财务软件","sys_id":"238"},{"sys_name":"开发区新中大财务核算系统","sys_id":"239"},{"sys_name":"开发区账务系统","sys_id":"240"}];
public var origin_place_arr = [{"city_code":"3201","city":"南京市","county":"市本级","county_code":"320100","sys_name":"部门预算","sys_code":"BMYS"}, export var 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":"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":"YSZX"},
{"city_code":"3201","city":"南京市","county":"市本级","county_code":"320100","sys_name":"资产管理系统","sys_code":"ZCGL"}, {"city_code":"3201","city":"南京市","county":"市本级","county_code":"320100","sys_name":"资产管理系统","sys_code":"ZCGL"},

View File

@ -5,8 +5,8 @@
module Kubernetes { module Kubernetes {
export var ReplicationControllers = controller("ReplicationControllers", export var ReplicationControllers = controller("ReplicationControllers",
["$scope", "KubernetesModel", "DataInfoModel", "KubernetesReplicationControllers", "KubernetesPods", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL", ["$scope", "KubernetesModel", "KubernetesReplicationControllers", "KubernetesPods", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
($scope, KubernetesModel: Kubernetes.KubernetesModelService, DataInfoModel, KubernetesReplicationControllers:ng.resource.IResourceClass<any>, KubernetesPods:ng.resource.IResourceClass<any>, KubernetesState, ($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesReplicationControllers:ng.resource.IResourceClass<any>, KubernetesPods:ng.resource.IResourceClass<any>, KubernetesState,
$templateCache, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => { $templateCache, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
$scope.kubernetes = KubernetesState; $scope.kubernetes = KubernetesState;

View File

@ -24,8 +24,19 @@ module Kubernetes {
} }
}); });
export var DataLabels = controller("DataLabels",['$scope','$location', ($scope, $location) =>{
console.log($scope.labels);
$scope.labelClick = (entity, key:string, value:string) => {
// log.debug("handleClick, entity: ", entity, " key: ", labelType, " value: ", value);
console.log("cacacacac");
$scope.$emit('dataLabelFilterUpdate', value)
}
$scope.labelClass = containerLabelClass;
}]);
// controller that deals with the labels per pod // controller that deals with the labels per pod
export var Labels = controller("Labels", ["$scope", "$location", ($scope, $location) => { export var Labels = controller("Labels", ["$scope", "$location", ($scope, $location) => {
console.log($scope.entity);
$scope.labels = []; $scope.labels = [];
var labelKeyWeights = { var labelKeyWeights = {
"region": 1, "region": 1,