///
///
///
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, 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;
}
}