You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.7 KiB
70 lines
1.7 KiB
/// <reference path="../../includes.ts"/>
|
|
/// <reference path="configPlugin.ts"/>
|
|
/// <reference path="../../developer/ts/developerNavigation.ts"/>
|
|
module Configs{
|
|
_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
|
|
}]);
|
|
}
|
|
|
|
export function shareInit($scope, $location, $routeParams){
|
|
$scope.subTabConfig = createConfigBreadcrumbs($scope, $location, $routeParams);
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
}
|