任务页面

This commit is contained in:
wu ming 2016-09-13 10:22:02 +08:00
parent 85a9d2dfae
commit 3ac5b5516e
16 changed files with 3387 additions and 3271 deletions

View File

@ -1,5 +1,5 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="configPlugin.d.ts" />
declare module Configs {
var EableEdit: ng.IModule;
var TableEdit: ng.IModule;
}

View File

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

View File

@ -1,5 +1,7 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="developerPlugin.d.ts" />
/// <reference path="dataManagerModel.d.ts" />
/// <reference path="dataManagerHelper.d.ts" />
declare module Developer {
var KubeTaskController: ng.IModule;
}

View File

@ -6,4 +6,5 @@ declare module Kubernetes {
var DataLabels: ng.IModule;
var Labels: ng.IModule;
var Status: ng.IModule;
var TaskEdit: ng.IModule;
}

44
defs.d.ts vendored
View File

@ -7,33 +7,11 @@
/// <reference path="d.ts/configs/ts/glusterfsSetting.d.ts"/>
/// <reference path="d.ts/configs/ts/kubeClusterSetting.d.ts"/>
/// <reference path="d.ts/configs/ts/shareController.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerHelper.d.ts"/>
/// <reference path="d.ts/developer/ts/developerHelpers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesInterfaces.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/utilHelpers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/readPlacedivision.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesHelpers.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerModel.d.ts"/>
/// <reference path="d.ts/developer/ts/developerEnrichers.d.ts"/>
/// <reference path="d.ts/developer/ts/environmentPanel.d.ts"/>
/// <reference path="d.ts/developer/ts/fileMigrationTask.d.ts"/>
/// <reference path="d.ts/developer/ts/home.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJob.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJobs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesPlugin.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/kubernetesModel.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsLog.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsMetrics.d.ts"/>
/// <reference path="d.ts/developer/ts/navbar.d.ts"/>
/// <reference path="d.ts/developer/ts/pipeline.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelineDirective.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelines.d.ts"/>
/// <reference path="d.ts/developer/ts/project.d.ts"/>
/// <reference path="d.ts/developer/ts/projectSelector.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/workspaces.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/build.d.ts"/>
@ -46,6 +24,7 @@
/// <reference path="d.ts/kubernetes/ts/deploymentConfig.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/kubernetesModel.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/host.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/hosts.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/imageRepositories.d.ts"/>
@ -77,3 +56,24 @@
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/developerHelpers.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerHelper.d.ts"/>
/// <reference path="d.ts/developer/ts/developerPlugin.d.ts"/>
/// <reference path="d.ts/developer/ts/dataManagerModel.d.ts"/>
/// <reference path="d.ts/developer/ts/developerEnrichers.d.ts"/>
/// <reference path="d.ts/developer/ts/environmentPanel.d.ts"/>
/// <reference path="d.ts/developer/ts/fileMigrationTask.d.ts"/>
/// <reference path="d.ts/developer/ts/home.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJob.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsJobs.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsLog.d.ts"/>
/// <reference path="d.ts/developer/ts/jenkinsMetrics.d.ts"/>
/// <reference path="d.ts/developer/ts/navbar.d.ts"/>
/// <reference path="d.ts/developer/ts/pipeline.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelineDirective.d.ts"/>
/// <reference path="d.ts/developer/ts/pipelines.d.ts"/>
/// <reference path="d.ts/developer/ts/project.d.ts"/>
/// <reference path="d.ts/developer/ts/projectSelector.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/workspaces.d.ts"/>

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<script type="text/ng-template" id="tableEdit.html" >
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Configs.EableEdit">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Configs.TableEdit">
<button class="btn sj_btn" ng-click="editRow(entity)">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;编辑
</button>

View File

@ -1,7 +1,7 @@
/// <reference path="../../includes.ts"/>
/// <reference path="configPlugin.ts"/>
module Configs{
export var EableEdit = controller('EableEdit', ['$scope', ($scope) => {
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
$scope.editRow = (entity)=>{
$scope.$emit('editRow', entity);
}
@ -9,5 +9,5 @@ module Configs{
$scope.deleteRow = (entity) =>{
$scope.$emit('deleteRow', entity);
}
}]);
}]);
}

View File

@ -6,10 +6,10 @@
<div hawtio-tabs></div>
</div>
<div class="container-content ">
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
<div class="row align-center mb10" ng-hide="true">
<p class="alert alert-info">当前没有可以查看的任务列表!</p>
</div>
<div class="row mb10" ng-show="model.oracleParam.length">
<div class="row mb10" ng-show="model.data.length">
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
</div>
</div>

View File

@ -1,5 +1,6 @@
/// <reference path="../../includes.ts"/>
/// <reference path="developerNavigation.ts"/>
/// <reference path="developerHelpers.ts"/>
module Developer{
var log = Logger.get('developer-navigation');
export function createCurrentSubNavBar($scope, $location, $routeParams){
@ -43,7 +44,12 @@ module Developer{
label: "社保",
title: "社保数据"
}]
}
},
{
href: UrlHelpers.join(context,"Overview/","task"),
label: "任务",
title: "任务查看"
}
]);
}
}

View File

@ -12,7 +12,8 @@ module Developer {
.when("/data-manager", route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/all'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/financial'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/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, 'Overview/task'), route('fileMigrationTask.html', false))
.otherwise(context);
}]);

View File

@ -1,7 +1,65 @@
/// <reference path="../../includes.ts"/>
/// <reference path="developerPlugin.ts"/>
/// <reference path="dataManagerModel.ts"/>
/// <reference path="dataManagerHelper.ts"/>
module Developer {
export var KubeTaskController = controller("KubeTaskController", ["$scope", ($scope) => {
export var KubeTaskController = controller("KubeTaskController", ["$scope", "$location", "$routeParams", "DataModel", "$templateCache", ($scope, $location, $routeParams, DataModel, $templateCache) => {
$scope.model = DataModel;
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
$scope.model.data = [{_key: 2, name: "南京市-玄武区", labels:{system: 34, batch: 2}, status: 1, process:75},
{_key: 4, name: "南京市-雨花区", labels:{system: 14, batch: 1}, status: 0, process:0},
{_key: 5, name: "南京市-六合区", labels:{system: 76, batch: 1}, status: 2, process:100},
{_key: 6, name: "南京市-浦口区", labels:{system: 76, batch: 1}, status: 3, process:97}];
$scope.tableConfig = {
data: 'model.data',
showSelectionCheckbox: false,
enableRowClickSelection: false,
multiSelect: true,
selectedItems: [],
filterOptions: {
filterText: $location.search()["q"] || ''
},
columnDefs: [{
field: "_key",
displayName: '编码',
customSortField: (field) =>{
return field.id;
}
},
{
field: "name",
displayName: '市-区/县'
},
{
field: "systemName",
displayName: '系统名称'
},
{
field: "labels",
displayName: '数据标签',
cellTemplate: $templateCache.get("dataLabelsTemplate.html")
},
{
field: "status",
displayName: '迁移状态',
cellTemplate: $templateCache.get("taskStatus.html")
},
{
field: "process",
displayName: '迁移进度',
cellTemplate: $templateCache.get("taskProcess.html")
},
{
field: "entity",
displayName: '操作',
cellTemplate: $templateCache.get("taskEdit.html")
}
]};
$scope.$on("deleteRow", (event, data) =>{
console.log("删除任务");
});
}]);
}

View File

@ -1,16 +0,0 @@
<div ng-controller="Developer.KubeTaskController">
<div class="row">
<div hawtio-breadcrumbs></div>
</div>
<div class="row">
<div hawtio-tabs></div>
</div>
<div class="container-content ">
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
<p class="alert alert-info">当前没有可以查看的任务列表!</p>
</div>
<div class="row mb10" ng-show="model.oracleParam.length">
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
</div>
</div>
</div>

View File

@ -1,145 +1,117 @@
<script type="text/ng-template" id="runButton.html">
<button ng-show="model.showRunButton"
class="btn btn-success pull-right"
ng-click="viewTemplates()"
title="Run an application from a template">
<i class="fa fa-play-circle"></i> Run ...
</button>
<button ng-show="model.showRunButton" class="btn btn-success pull-right" ng-click="viewTemplates()" title="Run an application from a template">
<i class="fa fa-play-circle"></i> Run ...
</button>
</script>
<script type="text/ng-template" id="idTemplate.html">
<div class="ngCellText nowrap">
<a href=""
title="View details for {{row.entity.metadata.name || row.entity.name}}">
<!--<img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}" ng-show="row.entity.$iconUrl">-->
<strong>{{row.entity.$oracleName || row.entity.name}}</strong></a>
</div>
<div class="ngCellText nowrap">
<a href="" title="View details for {{row.entity.metadata.name || row.entity.name}}">
<!--<img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}" ng-show="row.entity.$iconUrl">-->
<strong>{{row.entity.$oracleName || row.entity.name}}</strong></a>
</div>
</script>
<script type="text/ng-template" id="selectorTemplate.html">
<div class="ngCellText">
<span ng-repeat="(name, value) in row.entity.spec.selector track by $index">
<div class="ngCellText">
<span ng-repeat="(name, value) in row.entity.spec.selector track by $index">
<strong>{{name}}</strong>: {{value}}
</span>
</div>
</div>
</script>
<script type="text/ng-template" id="podCountsAndLinkTemplate.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.Status">
<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.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>
</a>
</div>
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.Status">
<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.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>
</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-include = "'oracleLogTemplate.html'"></span>
</div>
</a>
</div>
<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-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>
</div>
<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>
</div>
</script>
<script type="text/ng-template" id="eventSourceTemplate.html">
<div class="ngCellText" ng-init="labels=row.entity.source">
<p ng-show="data"><strong>Labels</strong></p>
<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>
<div class="ngCellText" ng-init="labels=row.entity.source">
<p ng-show="data"><strong>Labels</strong></p>
<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" >
<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>
<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">
<div class="ngCellText" ng-init="host=row.entity.$host">
<span class="pod-label badge background-light-grey mouse-pointer"
ng-click="$emit('labelFilterUpdate', 'host=' + host)">{{host}}</span>
</div>
<div class="ngCellText" ng-init="host=row.entity.$host">
<span class="pod-label badge background-light-grey mouse-pointer" ng-click="$emit('labelFilterUpdate', 'host=' + host)">{{host}}</span>
</div>
</script>
<script type="text/ng-template" id="portalAddress.html">
<div class="ngCellText">
<div ng-repeat="port in row.entity.$ports track by $index">
<a target="_blank" href="{{row.entity.$connectUrl}}"
ng-show="row.entity.$connectUrl && row.entity.$podCounters.ready"
title="Protocol {{row.entity.spec.protocol}}">
<div class="ngCellText">
<div ng-repeat="port in row.entity.$ports track by $index">
<a target="_blank" href="{{row.entity.$connectUrl}}" ng-show="row.entity.$connectUrl && row.entity.$podCounters.ready" title="Protocol {{row.entity.spec.protocol}}">
{{row.entity.$host}}
</a>
<span ng-hide="row.entity.$connectUrl && row.entity.$podCounters.ready">{{row.entity.spec.portalIP || row.entity.spec.clusterIP}}:{{port}}</span>
<span ng-hide="row.entity.$connectUrl && row.entity.$podCounters.ready">{{row.entity.spec.portalIP || row.entity.spec.clusterIP}}:{{port}}</span>
</div>
</div>
</div>
</script>
<script type="text/ng-template" id="iconCellTemplate.html">
<div class="ngCellText">
<img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}">
</div>
<div class="ngCellText">
<img class="app-icon-small" ng-src="{{row.entity.$iconUrl}}">
</div>
</script>
<script type="text/ng-template" id="ageTemplate.html">
<div class="ngCellText " ng-model="row.entity.$pods[0].$age">
{{row.entity.$pods[0].$age}}
</div>
<div class="ngCellText " ng-model="row.entity.$pods[0].$age">
{{row.entity.$pods[0].$age}}
</div>
</script>
<script type="text/ng-template" id="firstTimestampTemplate.html">
<div class="ngCellText" title="{{row.entity.$firstTimestamp}}">
{{row.entity.$firstTimestamp | relativeTime}}
</div>
<div class="ngCellText" title="{{row.entity.$firstTimestamp}}">
{{row.entity.$firstTimestamp | relativeTime}}
</div>
</script>
<script type="text/ng-template" id="lastTimestampTemplate.html">
<div class="ngCellText" title="{{row.entity.$lastTimestamp}}">
{{row.entity.$lastTimestamp | relativeTime}}
</div>
<div class="ngCellText" title="{{row.entity.$lastTimestamp}}">
{{row.entity.$lastTimestamp | relativeTime}}
</div>
</script>
<script type="text/ng-template" id="eventKindTemplate.html">
<div class="ngCellText" ng-init="kind=row.entity.involvedObject.kind">
<span class="pod-label badge"
class="background-light-grey mouse-pointer"
ng-click="$emit('labelFilterUpdate', 'kind=' + kind)">{{kind}}</span>
</div>
<div class="ngCellText" ng-init="kind=row.entity.involvedObject.kind">
<span class="pod-label badge" class="background-light-grey mouse-pointer" ng-click="$emit('labelFilterUpdate', 'kind=' + kind)">{{kind}}</span>
</div>
</script>
<script type="text/ng-template" id="eventNameTemplate.html">
<div class="ngCellText" ng-init="name=row.entity.involvedObject.name">
<span class="pod-label badge"
class="background-light-grey mouse-pointer"
ng-click="$emit('labelFilterUpdate', 'name=' + name)">{{name}}</span>
</div>
<div class="ngCellText" ng-init="name=row.entity.involvedObject.name">
<span class="pod-label badge" class="background-light-grey mouse-pointer" ng-click="$emit('labelFilterUpdate', 'name=' + name)">{{name}}</span>
</div>
</script>
<script type="text/ng-template" id="eventSummaryTemplate.html">
<div class="ngCellText" title="Number of events on this resource">
<a ng-show="row.entity.$pods[0].$eventsLink" href="{{row.entity.$pods[0].$eventsLink}}">
<span class="badge">{{row.entity.$pods[0].$events.length}}</span>
</a>
</div>
<div class="ngCellText" title="Number of events on this resource">
<a ng-show="row.entity.$pods[0].$eventsLink" href="{{row.entity.$pods[0].$eventsLink}}">
<span class="badge">{{row.entity.$pods[0].$events.length}}</span>
</a>
</div>
</script>
<script type="text/ng-template" id="connectTemplate.html">
<span ng-show="entity.$jolokiaUrl && entity.$ready" ng-controller="Kubernetes.ConnectController">
@ -158,61 +130,54 @@
</span>
</script>
<script type="text/ng-template" id="logIconTemplate.html">
<span ng-show="entity.status.phase === 'Running'" ng-controller="Kubernetes.PodLogLinkController">
<span ng-show="entity.status.phase === 'Running'" ng-controller="Kubernetes.PodLogLinkController">
<i class="fa fa-file-text" title="Open up the logs for {{entity.metadata.name}}" ng-click="openLogs(entity)"></i>
</span>
</script>
<script type="text/ng-template" id="oracleLogTemplate.html">
<span ng-controller="Kubernetes.PodLogLinkController">
<span ng-controller="Kubernetes.PodLogLinkController">
<i class="fa fa-file-text" title="打开{{entity.$oracleName}}的汇总日志" ng-click="openLogs(entity)"></i>
</span>
</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>
<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>
</script>
<script type="text/ng-template" id="statusTemplate.html">
<div class="ngCellText nowrap" ng-init="entity=row.entity" ng-controller="Kubernetes.PodStatus"
title="Pod {{entity.metadata.name}} is {{entity.status.phase}}">
<!-- in detail view -->
<p ng-show="data"><strong>Status: </strong></p>
<i class="fa {{entity.$statusCss}}"></i>
<span ng-show="data">{{data}}</span>
<!-- in table -->
<span ng-include="'connectTemplate.html'"></span>
<span ng-include="'termTemplate.html'"></span>
<span ng-include="'logIconTemplate.html'"></span>
</div>
<div class="ngCellText nowrap" ng-init="entity=row.entity" ng-controller="Kubernetes.PodStatus" title="Pod {{entity.metadata.name}} is {{entity.status.phase}}">
<!-- in detail view -->
<p ng-show="data"><strong>Status: </strong></p>
<i class="fa {{entity.$statusCss}}"></i>
<span ng-show="data">{{data}}</span>
<!-- in table -->
<span ng-include="'connectTemplate.html'"></span>
<span ng-include="'termTemplate.html'"></span>
<span ng-include="'logIconTemplate.html'"></span>
</div>
</script>
<script type="text/ng-template" id="resizeDialog.html">
<div modal="resizeDialog.dialog.show">
<form class="form-horizontal" ng-submit="resizeDialog.onOk()">
<div class="modal-header"><h4>Scale {{resizeDialog.controller.metadata.name}}</h4></div>
<div class="modal-body">
<div class="control-group">
<label class="control-label" for="replicas">Number of pods you would like to scale to?</label>
<div class="controls">
<input type="number" min="0" id="replicas" ng-model="resizeDialog.newReplicas">
</div>
</div>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit"
ng-disabled="resizeDialog.newReplicas === resizeDialog.controller.status.replicas"
value="Resize">
<button class="btn btn-warning cancel sj_btn_grey" type="button" ng-click="resizeDialog.close()">取消</button>
</div>
</form>
</div>
<div modal="resizeDialog.dialog.show">
<form class="form-horizontal" ng-submit="resizeDialog.onOk()">
<div class="modal-header">
<h4>Scale {{resizeDialog.controller.metadata.name}}</h4></div>
<div class="modal-body">
<div class="control-group">
<label class="control-label" for="replicas">Number of pods you would like to scale to?</label>
<div class="controls">
<input type="number" min="0" id="replicas" ng-model="resizeDialog.newReplicas">
</div>
</div>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit" ng-disabled="resizeDialog.newReplicas === resizeDialog.controller.status.replicas" value="Resize">
<button class="btn btn-warning cancel sj_btn_grey" type="button" ng-click="resizeDialog.close()">取消</button>
</div>
</form>
</div>
</script>
<script type="text/ng-template" id="namespaceSelector.html">
<span ng-controller="Kubernetes.NamespaceController">
<span ng-controller="Kubernetes.NamespaceController">
namespace:
<select ng-model="namespace" ng-options="namespace for namespace in namespaces"
title="choose the namespace - which is a selection of resources in kubernetes">
@ -220,37 +185,62 @@
</span>
</script>
<script type="text/ng-template" id="pendingPipelines.html">
<div class="row" ng-controller="Developer.PipelinesController">
<div class="row">
<div class="col-md-12">
<div ng-hide="model.fetched">
<div class="align-center">
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
<div ng-show="model.fetched">
<div ng-hide="model.job.builds.length" class="align-center">
<p class="alert alert-info">There are no pipelines for this job.</p>
</div>
<div ng-show="model.job.builds.length">
<div class="pipeline-build-block" ng-repeat="build in model.job.builds | filter:model.filterText track by $index">
<div pipeline-view></div>
<div class="row" ng-controller="Developer.PipelinesController">
<div class="row">
<div class="col-md-12">
<div ng-hide="model.fetched">
<div class="align-center">
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
<div ng-show="model.fetched">
<div ng-hide="model.job.builds.length" class="align-center">
<p class="alert alert-info">There are no pipelines for this job.</p>
</div>
<div ng-show="model.job.builds.length">
<div class="pipeline-build-block" ng-repeat="build in model.job.builds | filter:model.filterText track by $index">
<div pipeline-view></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</script>
<script type="text/ng-template" id="taskEdit.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskEdit">
<button class="btn sj_btn" ng-click="deleteRow(entity)">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;删除
</button>
</div>
</script>
<!-- 迁移进度条 -->
<script type="text/ng-template" id="taskProcess.html">
<div class="ngCellText progress" ng-init="entity=row.entity">
<div ng-show="entity.status!==3" class="progress-bar progress-bar-success active" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sr-only">{{entity.process}}</span>
</div>
<div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="width: {{entity.process}}%">
<span class="sr-only">{{entity.process}}</span>
</div>
</div>
</script>
<!--迁移状态显示 -->
<script type="text/ng-template" id="taskStatus.html">
<div class="ngCellText" ng-init="entity=row.entity">
<span ng-show="entity.status===0" class="glyphicon glyphicon-minus"></span>
<span ng-show="entity.status===1" class="glyphicon glyphicon-transfer"></span>
<span ng-show="entity.status===2" class="glyphicon glyphicon-ok"></span>
<span ng-show="entity.status===3" class="glyphicon glyphicon-remove"></span>
</div>
</script>
<script type="text/ng-template" id="creationTimeTemplate.html">
<div class="ngCellText" title="created at: {{row.entity.$creationDate | date : 'h:mm:ss a, EEE MMM yyyy'}}">
{{row.entity.$creationDate.relative()}}
</div>
<div class="ngCellText" title="created at: {{row.entity.$creationDate | date : 'h:mm:ss a, EEE MMM yyyy'}}">
{{row.entity.$creationDate.relative()}}
</div>
</script>
<div ng-controller="Kubernetes.TopLevel">
<div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over
uploader="uploader" over-class="ready-drop">
<div class="row kubernetes-view" ng-view></div>
</div>
<div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over uploader="uploader" over-class="ready-drop">
<div class="row kubernetes-view" ng-view></div>
</div>
</div>

View File

@ -113,4 +113,10 @@ module Kubernetes {
console.log(newValue);
},true);*/
}]);
export var TaskEdit = controller('TaskEdit', ['$scope', ($scope) => {
$scope.deleteRow = (entity) =>{
$scope.$emit('deleteRow', entity);
}
}]);
}

View File

@ -209,7 +209,7 @@ module Navigation {
</ul>
</div>
<div ng-hide="subTab.items.length" class="sj_menu_nav" >
<i class=" sj_menu_02" ></i><a href="{{subTab.href}}">{{subTab.label}}</a>
<i class=" sj_menu_02" ></i><a href="{{subTab.href}}">{{subTab.label}}</a>
</div>
</li>
</ul>