功能调整和完善--9.20

Web_Manager_Develope
wu ming 8 years ago
parent e76717783e
commit 25d67ad44e

@ -10,12 +10,14 @@ declare module Developer {
currentPageNum: number;
totalSize: any;
priorTableSize: number;
keyQuery: any;
createParamData(): {
currentPageNum: number;
dataType: any;
submittedBatch: any;
limit: number;
priorTableSize: number;
keyQuery: any;
};
getPageSizeNum(): number;
}

File diff suppressed because one or more lines are too long

@ -82,7 +82,7 @@ a:hover.sj_btn_grey{ background-image:-webkit-linear-gradient(top, #eeeeee,#d3d3
.sj_table_bottom{ height:30px; line-height:30px; }
.sj_table_bottom li{ float:left;}
.sj_table_select{ background:#fff; border:1px solid #b1b1b1; height:25px; margin:0 5px;}
.badge{ font-weight: normal; text-shadow:none; background-color: #a1a1a1;}
.badge{ font-weight: normal; text-shadow:none; /*background-color: #a1a1a1*/;}
.simple-table-checkbox{ text-align: center;}
.table{ margin-bottom: 10px;}
.sj_nav_taps{ border-bottom: none;}

@ -59,7 +59,7 @@ module Configs{
}
export function shareInit($scope, $location, $routeParams){
$scope. subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
$scope. subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
}
export function createNewObejct(array:Array<any>, obj){
@ -86,35 +86,27 @@ module Configs{
export function oracleInfoOperate($http, url:string, operate:string, resource, fn?: (data, status)=>void ){
if(resource === null)
throw "不能操作空资源对象";
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
throw "不能操作空资源对象";
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
var RESTfulUrl=url;
if(id===undefined){
if(id == "undefined"){
RESTfulUrl = UrlHelpers.join(url, operate);
}else{
RESTfulUrl = UrlHelpers.join(url, resource.id+"", operate);
}
RESTfulUrl = UrlHelpers.join(url, id+"", operate);
}
$http({
method: "POST",
url: RESTfulUrl,
params: resource,
transformRequest: function(obj) {
var str = [];
for(var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
}).success(function(data, status, headers, config) {
//成功之后做一些事情
if(angular.isFunction(fn))
fn(data, status);
}).error(function(data, status, headers, config) {
if(angular.isFunction(fn))
fn(data, status);
});
method: "POST",
dataType: 'json',
url: RESTfulUrl,
data: 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 createConfigHelperNavBar($scope, $location, $routeParams){

@ -7,7 +7,10 @@ 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= ConfigsModel;
$scope.model.updateOracleParam();
$scope.tableConfig={
data: 'model.oracleParam',
selectedItems: [],
@ -101,6 +104,7 @@ module Configs{
$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 "资源请求失败";

@ -8,8 +8,8 @@
<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" />
<a href="#" class="sj_search_btn"></a>
<input type="text" class="sj_search_input" ng-model="keyQuery" placeholder="请选择或输入关键字,多关键字请用空格隔开"/>
<a href="#" class="sj_search_btn" ng-click="search()"></a>
</div>
</div>
<div ng-hide="model.data.length" class="align-center">

@ -51,5 +51,5 @@ module Developer{
title: "任务查看"
}
]);
}
}
}

@ -9,7 +9,8 @@ module Developer{
public labels={};
public currentPageNum=1;
public totalSize=null;
public priorTableSize = 20;
public priorTableSize = 20;
public keyQuery=null;
public createParamData(){
var extendValue =["cityName", "districtName", "dataVersion", "systemName", "dataYear"];
@ -18,7 +19,8 @@ module Developer{
dataType: this.dataType,
submittedBatch: this.dataBatch,
limit: this.currentTableSize,
priorTableSize: this.priorTableSize
priorTableSize: this.priorTableSize,
keyQuery: this.keyQuery
}
angular.forEach(this.labels,(value, key) =>{

@ -15,7 +15,7 @@ module Developer {
init($scope, $location, $routeParams);
$scope.options = DataModel.paramOptions;
$scope.pageSizeChoses = DataModel.paramOptions.pagerSizeOption;
$scope.options.dataType = getDataType($location);
$scope.options.dataType = getDataType($location);
$scope.treeOptions = {
nodeChildren: "childNodes",
@ -79,15 +79,17 @@ module Developer {
]
};
$scope.$on("dataLabelFilterUpdate", ($event, text, key) => {
$scope.keyQuery += " " + text;
})
$scope.selectBatchItem = (item)=> {
$scope.navbarItems.forEach((nav) =>{
nav.class="";
});
item.class="active";
if(item.label === "全部")
$scope.model.updateParamOption("dataBatch", null);
else
$scope.model.updateParamOption("dataBatch", item.alias);
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
$scope.model.updateParamOption("dataBatch", item.alias);
}
$scope.isEmptyOrFirst = () => {
@ -129,18 +131,22 @@ module Developer {
$scope.model.updateParamOption("currentPageNum", idx+1);
}
$scope.$watch('options', (newValue, oldValue) => {
if(newValue && newValue !== oldValue){
$scope.$watch('options', (newValue, oldValue) => {
if(newValue){
if(newValue.currentTableSize !== oldValue.currentTableSize)
$scope.options.priorTableSize = oldValue.currentTableSize;
else
$scope.options.priorTableSize = newValue.currentTableSize;
$scope.options.priorTableSize = newValue.currentTableSize;
DataModel.updateModel();
}
}, true);
$scope.search = () => {
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
}
$scope.deletePrompt = (selected) => {
if (angular.isString(selected)) {
selected = [{
@ -154,8 +160,7 @@ module Developer {
var idColl = [];
if (result) {
angular.forEach(selected, (select) => {
idColl.push(select.id);
console.log(select.id);
idColl.push(select.id);
});
$http({
method: "POST",
@ -185,9 +190,7 @@ module Developer {
selectedItem: {"name": "当前没有可以迁移的集群"},
dialog: new UI.Dialog(),
onOk: () => {
var migrationClick = $scope.migrationClick;
console.log($scope.tableConfig.selectedItems);
console.log($scope.selectNode);
var migrationClick = $scope.migrationClick;
Configs.oracleInfoOperate($http, "/java/console/api/volume", Configs.OperateType.MOVE,
{
"name": migrationClick.selectedItem.name,
@ -214,8 +217,8 @@ module Developer {
}
};
$scope.createOracleService = (items) =>{
angular.forEach(items,(item)=>{
$scope.createOracleService = (items) =>{
angular.forEach(items,(item)=>{
Kubernetes.createRC({
name: item._key,
labels: {
@ -229,7 +232,8 @@ module Developer {
systemName: item.systemName
},
path: item.dataPath+"app/",
isTarget: "false"
isTarget: "false",
isExtract: item.extractStatus
}, (rc) =>{
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", rc, 0);
});
@ -241,7 +245,9 @@ module Developer {
}
function init($scope,$location,$routeParams){
$scope.model.updateModel();
//$scope.model.updateModel();
$scope.keyQuery = "";
$scope.model.updateParamOption("keyQuery", $scope.keyQuery);
if(ConfigsModel.cluster!=null)
$scope.volumes = ConfigsModel.cluster;
@ -276,10 +282,10 @@ module Developer {
var subPath = path.split("/");
switch (subPath[subPath.length -1]) {
case "financial":
result = "财政"
result = "财政";
break;
case "social-security":
result = "社保"
result = "社保";
break;
default:
result = null;

@ -22,31 +22,32 @@
<a ng-show="row.entity.$podCounters.podsLink" title="pods status">
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===2)" class="badge badge-success"> 启动</span>
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===0)" class="badge badge-info"> 等待</span>
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===1)" class="badge badge-warning "> 失败</span>
<span ng-show="row.entity.$podCounters.ready && (row.entity.$oracleStatus===1)" class="badge badge-important "> 失败</span>
<span ng-show="row.entity.$podCounters.valid || row.entity.$podCounters.waiting" class="badge badge-info"> 等待</span>
<span ng-show="!(row.entity.$podCounters.waiting || row.entity.$podCounters.ready || row.entity.$podCounters.valid || row.entity.$podCounters.error)" class="badge"> 停止</span>
<span ng-show="row.entity.$podCounters.error" class="badge badge-warning"> 失败</span>
<span ng-show="row.entity.$podCounters.error" class="badge badge-important"> 失败</span>
</a>
</div>
</script>
<script type="text/ng-template" id="dataSummaryTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity">
<a ng-show="row.entity.$podCounters.podsLink" title="pods status">
<span ng-show="row.entity.$extractStatus === 0" class="badge badge-info" href=""> 未汇总</span>
<span ng-show="row.entity.$extractStatus === 1" class="badge badge-success" href=""> 正在汇总</span>
<span ng-show="row.entity.$extractStatus === 2" class="badge" href=""> 已完成</span>
<span ng-show="row.entity.$extractStatus === 3" class="badge badge-warning" href=""> 失败</span>
<div ng-show="row.entity.$extractStatus === 10">
<span class="badge badge-remind"> 汇总数据库</span>
<span ng-show="row.entity.$extractStatus === 0" class="badge badge-info"> 待汇总</span>
<div ng-show="row.entity.$extractStatus === 1">
<span class="badge badge-success" > 汇总中</span>
<span ng-include="'oracleLogTemplate.html'"></span>
</div>
<div ng-show="row.entity.$extractStatus === 2">
<span class="badge" > 已完成</span>
<span ng-include="'oracleLogTemplate.html'"></span>
</div>
</a>
</div>
</script>
<script type="text/ng-template" id="labelTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.Labels">
<p ng-show="data"><strong>Labels</strong></p>
<span ng-repeat="label in labels track by $index" class="pod-label badge" ng-class="labelClass(label.key)" ng-click="handleClick(entity, label.key, label)" title="{{label.key}}">{{label.title}}</span>
<span ng-repeat="label in labels track by $index" class="pod-label badge" ng-class="labelClass(label.key)" ng-click="handleClick(entity, label.key, label)" title="{{label.key}}"><span class="glyphicon glyphicon-tag"/> {{label.title}}</span>
</div>
</script>
<script type="text/ng-template" id="eventSourceTemplate.html">
@ -55,10 +56,10 @@
<span ng-repeat="(key, value) in labels track by $index" class="pod-label badge" class="background-light-grey mouse-pointer" title="{{key}}" ng-click="$emit('labelFilterUpdate', key + '=' + value)">{{value}}</span>
</div>
</script>
<script type="text/ng-template" id="dataLabelsTemplate.html" ng-controller="Kubernetes.DataLabels">
<div class="ngCellText" ng-init="labels=row.entity.labels">
<script type="text/ng-template" id="dataLabelsTemplate.html">
<div class="ngCellText" ng-init="labels=row.entity.labels" ng-controller="Kubernetes.DataLabels">
<p ng-show="data"><strong>Labels</strong></p>
<span ng-repeat="(key, value) in labels track by $index" class="pod-label badge" ng-class="labelClass(label.key)" ng-click="labelClick(entity, label.key, label.value)" title="{{label.key}}">{{value}}</span>
<span ng-repeat="(key, value) in labels track by $index" class="pod-label badge" ng-class="labelClass(key)" ng-click="labelClick(entity, key, value)" title="{{key}}"><span class="glyphicon glyphicon-tag"/> {{value}}</span>
</div>
</script>
<script type="text/ng-template" id="hostTemplate.html">
@ -141,7 +142,10 @@
</script>
<script type="text/ng-template" id="connectParamTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity">
<p ng-show="row.entity.$pods.length"><strong>{{row.entity.$pods[0].$host}}:{{row.entity.$pods[0].spec.containers[0].ports[0].hostPort}}/orcl</strong></p>
<div ng-show="row.entity.$pods.length && row.entity.$pods[0].$host && row.entity.$pods[0].spec.containers[0].ports[0].hostPort"><strong>{{row.entity.$pods[0].$host}}:{{row.entity.$pods[0].spec.containers[0].ports[0].hostPort}}/orcl</strong>
<button class="btn" zero-clipboard data-clipboard-text="{{row.entity.$pods[0].$host}}:{{row.entity.$pods[0].spec.containers[0].ports[0].hostPort}}/orcl" title="点击复制">
<i class="fa fa-copy"></i></button>
</div>
</div>
</script>
<script type="text/ng-template" id="statusTemplate.html">
@ -215,7 +219,7 @@
<div hawtio-confirm-dialog="showDeleteOne.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showDeleteOne.onCancelled()" on-ok="showDeleteOne.onOk()">
<div class="dialog-body">
<p>
Are you sure you want to delete all the stuff?
是否删除:{{entity.name}}-{{entity.systemName}} 任务?
</p>
</div>
</div>

@ -1550,15 +1550,13 @@ module Kubernetes {
}
var labelColors = {
'batch': 'k8s-badge-batch',
'region': 'k8s-badge-region',
'type': 'k8s-badge-type',
var labelColors = {
'region': 'k8s-badge-region',
'system': 'k8s-badge-system',
'isTarget': 'k8s-badge-target'
'isTarget': 'k8s-badge-target',
};
export function containerLabelClass(labelType:string) {
export function containerLabelClass(labelType:string) {
if (!(labelType in labelColors)) {
return 'mouse-pointer';
}

@ -154,8 +154,7 @@ module Kubernetes {
link: (scope:any, element, attr) => {
addWindowActions(scope, element, TerminalService);
scope.atBottom = true;
scope.$watch('atBottom', (val) => {
console.log("atBottom: ", val);
scope.$watch('atBottom', (val) => {
});
}
};

@ -43,11 +43,7 @@ module Kubernetes {
{ field: '$pods',
displayName: '连接参数',
cellTemplate: $templateCache.get("connectParamTemplate.html")
},
{ field: '$pods[0].$eventCount',
displayName: '服务启动日志',
cellTemplate: $templateCache.get("eventSummaryTemplate.html")
},
},
{ field: '$podCounters',
displayName: '服务状态',
cellTemplate: $templateCache.get("podCountsAndLinkTemplate.html"),

@ -24,12 +24,9 @@ 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)
export var DataLabels = controller("DataLabels",['$scope','$location', ($scope, $location) =>{
$scope.labelClick = (entity, key:string, value:string) => {
$scope.$emit('dataLabelFilterUpdate', value, key)
}
$scope.labelClass = containerLabelClass;
}]);

@ -300,15 +300,18 @@ module Kubernetes {
};
});
function getLogs(rc, scope){
console.log(scope);
function getLogs(rc, scope){
var xhr= new XMLHttpRequest();
xhr.onreadystatechange = () => {
if(xhr.readyState == 4){
if (xhr.status == 200){
var obj=JSON.parse(xhr.responseText);
var text = obj.logContent.replace(/\\n/gmi, '\r\n');
scope.logs = text;
if(xhr.responseText !="" && xhr.responseText !=null){
var logObject = JSON.parse(xhr.responseText);
scope.logs = logObject[getName(rc)];
}else{
scope.logs = "当前没有可以查看的日志信息";
}
//return ({text: "aaaaaa"});
}else{
@ -316,7 +319,7 @@ module Kubernetes {
}
}
}
xhr.open("POST", "/oracleExtractLog?rcName=" + getName(rc),false);
xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false);
xhr.send(null);
}
}

@ -53,7 +53,7 @@ module Kubernetes {
var labels = {
"style": "oracle",
"status": "0",
"isExtract": "0",
"isExtract": Obj.isExtract+"" || "0",
"isTarget": Obj.isTarget
};
for(var item in Obj.labels)

Loading…
Cancel
Save