完成集群管理和数据管理功能

Web_Manager_Develope
wu ming 8 years ago
parent 7efdc5d699
commit 7073155320

@ -0,0 +1,4 @@
/// <reference path="../../includes.d.ts" />
declare module Developer {
function createCurrentSubNavBar($scope: any, $location: any, $routeParams: any): any;
}

@ -0,0 +1,33 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerPlugin.d.ts" />
declare module Developer {
class OptionsParams {
pagerSizeOption: number[];
dataType: any;
currentTableSize: number;
dataBatch: any;
labels: {};
currentPageNum: number;
totalSize: any;
priorTableSize: number;
createParamData(): {
currentPageNum: number;
dataType: any;
submittedBatch: any;
limit: number;
priorTableSize: number;
};
getPageSizeNum(): number;
}
class DataModelService {
data: any[];
paramOptions: any;
constructor();
protected getDataModel(paramOptions: any): any;
initParamOptions(): void;
updateModel(): void;
maybeFormat(): void;
updateParamOption(option: string, value: any): void;
getParamOption(key: string): any;
}
}

@ -686,73 +686,6 @@ a:hover.data_file_btn {
background: url(../img/icons2.gif) -6px 9px no-repeat;
}
.layout-pf.layout-pf-fixed .container-pf-nav-pf-vertical {
margin-left: 170px;
}
.nav-pf-vertical {
width: auto;
min-width: 170px;
}
.nav-pf-vertical .list-group > .list-group-item > a {
width: auto;
}
.nav-pf-vertical > .list-group > .list-group-item > a .fa,
.nav-pf-vertical > .list-group > .list-group-item > a .glyphicon,
.nav-pf-vertical > .list-group > .list-group-item > a .pficon {
line-height: 25px;
margin-right: 3px;
}
.nav-pf-vertical > .list-group > .list-group-item > a img {
max-height: 16px;
max-width: 16px;
margin-right: 10px;
}
.navbar-tab-vertical {
height: 70px;
width: 100%;
display: block;
background: #1d1d1d;
border-color: #1d1d1d;
}
.navbar-tab-horizontal {
height: 100%;
width: 100px;
display: block;
background: #1d1d1d;
border-color: #1d1d1d;
}
.gesture {
cursor: pointer;
}
.navbar-lf {
width: 200px;
min-height: 800px;
background: #1d1d1d;
position: absolute;
left: 0;
top: 0px;
}
.navbar-lf-menu {
display: block;
text-decoration: none;
}
.log-img {
width: "66";
height: "21";
alt: "logo";
}
.fl {
float: left;
}
a.logo {
display: block;
width: 130px;
padding: 20px 0 0 40px;
}
.content-margin {
margin-left: 170px;
}
/* This is for the 'Overview' page with all the rows of boxes */
.service-view-rectangle {
position: relative;
@ -1099,3 +1032,70 @@ kubernetes-container-terminal .terminal-actions {
overflow-y: auto;
overflow-x: hidden;
}
.layout-pf.layout-pf-fixed .container-pf-nav-pf-vertical {
margin-left: 170px;
}
.nav-pf-vertical {
width: auto;
min-width: 170px;
}
.nav-pf-vertical .list-group > .list-group-item > a {
width: auto;
}
.nav-pf-vertical > .list-group > .list-group-item > a .fa,
.nav-pf-vertical > .list-group > .list-group-item > a .glyphicon,
.nav-pf-vertical > .list-group > .list-group-item > a .pficon {
line-height: 25px;
margin-right: 3px;
}
.nav-pf-vertical > .list-group > .list-group-item > a img {
max-height: 16px;
max-width: 16px;
margin-right: 10px;
}
.navbar-tab-vertical {
height: 70px;
width: 100%;
display: block;
background: #1d1d1d;
border-color: #1d1d1d;
}
.navbar-tab-horizontal {
height: 100%;
width: 100px;
display: block;
background: #1d1d1d;
border-color: #1d1d1d;
}
.gesture {
cursor: pointer;
}
.navbar-lf {
width: 200px;
min-height: 800px;
background: #1d1d1d;
position: absolute;
left: 0;
top: 0px;
}
.navbar-lf-menu {
display: block;
text-decoration: none;
}
.log-img {
width: "66";
height: "21";
alt: "logo";
}
.fl {
float: left;
}
a.logo {
display: block;
width: 130px;
padding: 20px 0 0 40px;
}
.content-margin {
margin-left: 170px;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

@ -0,0 +1,101 @@
/// <reference path="../../includes.ts"/>
module Developer{
var log = Logger.get('developer-navigation');
export function createCurrentSubNavBar($scope, $location, $routeParams){
return activateCurrent([
{
href: "#",
label: "数据查看",
title: "查看所有数据",
items: [{
href: UrlHelpers.join(context,"Overview/data-type/all"),
label: "全部",
title: "全部数据"
},
{
href: UrlHelpers.join(context,"Overview/data-type/financial"),
label: "财政",
title: "财政数据"
},
{
href: UrlHelpers.join(context,"Overview/data-type/social-security"),
label: "社保",
title: "社保数据"
}]
},
{
href: UrlHelpers.join(context, "task"),
label: "任务",
title: "数据汇总任务",
}
]);
}
function activateCurrent(navBarItems) {
navBarItems = _.compact(navBarItems);
var injector = HawtioCore.injector;
var $location = injector ? injector.get<ng.ILocationService>("$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, (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, (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;
}
function trimQuery(text) {
if (text) {
var idx = text.indexOf("?");
if (idx >= 0) {
return text.substring(0, idx);
}
}
return text;
}
}

@ -0,0 +1,141 @@
/// <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 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
}
angular.forEach(this.labels,(value, key) =>{
if(extendValue.indexOf(key))
result[key] = value;
});
return result;
}
public getPageSizeNum(){
var num = Math.ceil(this.totalSize/this.currentTableSize);
if(num < this.currentPageNum)
num = this.currentPageNum;
return num;
}
}
function createKey(regionalismCode, systemId, version){
return regionalismCode + "-" + systemId + "-" + version;
}
function populateKey(item){
var result = item;
result["_key"] = createKey(item.regionalismCode, item.systemCode, item.dataVersion);
return result;
}
function populateKeys(items:Array<any>){
var result =[];
angular.forEach(items, (item) =>{
result.push(populateKey(item));
});
}
function createName(cityName, districtName){
return cityName + "-" + districtName;
}
function populateName(item){
var result = item;
result["name"] = createName(item.cityName, item.districtName);
return result;
}
function populateNames(items:Array<any>){
var result = [];
angular.forEach(items, (item) =>{
result.push(populateName(item));
});
}
function createParamData(options: OptionsParams){
return options.createParamData();
}
export class DataModelService{
public data = [];
public paramOptions = null;
constructor(){
this.initParamOptions();
//this.updateModel();
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) {
console.log(paramOptions);
result = data.data;
paramOptions.totalSize=data.length;
}
});
return result;
}
public initParamOptions(){
this.paramOptions = new OptionsParams();
}
public updateModel(){
this.data = this.getDataModel(this.paramOptions);
this.maybeFormat();
}
//格式数据模型中的每个单条记录
public maybeFormat(){
populateKeys(this.data);
populateNames(this.data);
}
//更新用户选择参数
public updateParamOption(option:string, value:any){
this.paramOptions[option] = value;
}
//根据key获取用户选择参数
public getParamOption(key:string){
return this.paramOptions[key];
}
}
//创建数据模型服务
_module.factory("DataModel", ['$rootScope', '$http', '$location', '$resource', ($rootScope, $http, $location, $resource) => {
var $scope = new DataModelService();
return $scope;
}]);
}

@ -55,19 +55,19 @@
</button>
<span class="pull-right">&nbsp;</span>
<button ng-show="id"
<!--<button ng-show="id"
class="btn btn-primary pull-right"
ng-click="id = undefined"><i class="fa fa-list"></i></button>
<span ng-show="id" class="pull-right">&nbsp;</span>
<a class="btn btn-default pull-right"
title="Create a new replication controller"
ng-click="createRCs()"><i class="fa fa-plus"></i> 创建汇总数据库</a>
<span class="pull-right">&nbsp;</span>
<span class="pull-right">&nbsp;</span>-->
<button ng-show="model.fetched"
ng-disabled="!id && tableConfig.selectedItems.length == 0"
class="btn btn-success pull-right"
ng-click="extractData.open(id || tableConfig.selectedItems)">
<i class="fa fa-play-circle"></i> 抽取汇总数据库
<i class="fa fa-play-circle"></i> 汇总
</button>
<!--<span ng-include="'runButton.html'"></span>-->
</div>

@ -0,0 +1,78 @@
.layout-pf.layout-pf-fixed .container-pf-nav-pf-vertical {
margin-left: 170px;
}
.nav-pf-vertical {
& .list-group > .list-group-item > a {
width: auto;
}
width: auto;
min-width: 170px;
}
.nav-pf-vertical > .list-group > .list-group-item > a .fa,
.nav-pf-vertical > .list-group > .list-group-item > a .glyphicon,
.nav-pf-vertical > .list-group > .list-group-item > a .pficon {
line-height: 25px;
margin-right: 3px;
}
.nav-pf-vertical > .list-group > .list-group-item > a img {
max-height: 16px;
max-width: 16px;
margin-right: 10px;
}
.navbar-tab-vertical {
height: 70px;
width: 100%;
display: block;
background: #1d1d1d;
border-color: #1d1d1d;
}
.navbar-tab-horizontal {
height: 100%;
width: 100px;
display: block;
background: #1d1d1d;
border-color: #1d1d1d;
}
.gesture {
cursor: pointer;
}
.navbar-lf {
width: 200px;
min-height: 800px;
background: #1d1d1d;
position: absolute;
left: 0;
top: 0px;
}
.navbar-lf-menu {
display: block;
text-decoration: none;
}
.log-img {
width: "66";
height: "21";
alt: "logo";
}
.fl {
float: left;
}
a.logo {
display: block;
width: 130px;
padding: 20px 0 0 40px;
}
.content-margin {
margin-left: 170px;
}
Loading…
Cancel
Save