Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
57c50485
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
57c50485
编写于
7月 04, 2019
作者:
M
mohamed chiheb ben jemaa
提交者:
Kubernetes Prow Robot
7月 04, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add workload statuses to workloads view (#3989)
上级
840d2806
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
223 addition
and
133 deletion
+223
-133
i18n/messages.xlf
i18n/messages.xlf
+123
-123
src/app/frontend/common/components/module.ts
src/app/frontend/common/components/module.ts
+2
-0
src/app/frontend/common/components/workloadstatus/component.spec.ts
...ontend/common/components/workloadstatus/component.spec.ts
+3
-3
src/app/frontend/common/components/workloadstatus/component.ts
...pp/frontend/common/components/workloadstatus/component.ts
+0
-0
src/app/frontend/common/components/workloadstatus/style.scss
src/app/frontend/common/components/workloadstatus/style.scss
+1
-1
src/app/frontend/common/components/workloadstatus/template.html
...p/frontend/common/components/workloadstatus/template.html
+0
-0
src/app/frontend/overview/component.spec.ts
src/app/frontend/overview/component.spec.ts
+1
-1
src/app/frontend/overview/component.ts
src/app/frontend/overview/component.ts
+1
-1
src/app/frontend/overview/module.ts
src/app/frontend/overview/module.ts
+3
-2
src/app/frontend/resource/workloads/component.ts
src/app/frontend/resource/workloads/component.ts
+87
-2
src/app/frontend/resource/workloads/template.html
src/app/frontend/resource/workloads/template.html
+2
-0
未找到文件。
i18n/messages.xlf
浏览文件 @
57c50485
...
...
@@ -279,6 +279,129 @@
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"32c4fb786d3f614318c26ef8adc8f195d581545d"
datatype=
"html"
>
<source>
Workload Status
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
20
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"c97f017e8bd3fb17065c3c94515a2cca404f0157"
datatype=
"html"
>
<source>
Cron Jobs
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
37
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/cronjob/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"d41640b21b662e4d9ee00c35239d30d15f1de9c7"
datatype=
"html"
>
<source>
Daemon Sets
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
52
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/daemonset/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"969a1d5188e9bde32221c1230eab21a3398b0cbe"
datatype=
"html"
>
<source>
Deployments
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
67
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/deployment/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"43f1cc191ebc0b8ce89f6916aa634f5a57158798"
datatype=
"html"
>
<source>
Jobs
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
82
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/job/template.html
</context>
<context
context-type=
"linenumber"
>
23
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"7357d53d819cc1f5dd329a4fff4c582461ee1317"
datatype=
"html"
>
<source>
Pods
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
97
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/creator/template.html
</context>
<context
context-type=
"linenumber"
>
64
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/daemonset/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/deployment/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/job/template.html
</context>
<context
context-type=
"linenumber"
>
87
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/pod/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/replicaset/template.html
</context>
<context
context-type=
"linenumber"
>
87
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/replicationcontroller/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/statefulset/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/resource/workloads/deployment/detail/template.html
</context>
<context
context-type=
"linenumber"
>
247
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"d9161a5f702c1f98ea34e4996c2d0b0c9eb1b66a"
datatype=
"html"
>
<source>
Replica Sets
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
112
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/replicaset/template.html
</context>
<context
context-type=
"linenumber"
>
23
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"900ec6b108c64adf2f23a3a84699be1217050001"
datatype=
"html"
>
<source>
Replication Controllers
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
127
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"0756fdca226249dcff9d05651d50b7acdade2aba"
datatype=
"html"
>
<source>
Stateful Sets
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
142
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/statefulset/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"3fb1b414b1cff52e0c83adf0e62245b77f8e6fda"
datatype=
"html"
>
<source>
Pod information
</source>
<context-group
purpose=
"location"
>
...
...
@@ -460,17 +583,6 @@
<context
context-type=
"linenumber"
>
38
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"c97f017e8bd3fb17065c3c94515a2cca404f0157"
datatype=
"html"
>
<source>
Cron Jobs
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/cronjob/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
37
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"c0adb9c346b1a2715886258558098dc32bd10c40"
datatype=
"html"
>
<source>
Items:
</source>
<context-group
purpose=
"location"
>
...
...
@@ -1166,49 +1278,6 @@
<context
context-type=
"linenumber"
>
58
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"7357d53d819cc1f5dd329a4fff4c582461ee1317"
datatype=
"html"
>
<source>
Pods
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/creator/template.html
</context>
<context
context-type=
"linenumber"
>
64
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/daemonset/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/deployment/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/job/template.html
</context>
<context
context-type=
"linenumber"
>
87
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/pod/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/replicaset/template.html
</context>
<context
context-type=
"linenumber"
>
87
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/replicationcontroller/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/statefulset/template.html
</context>
<context
context-type=
"linenumber"
>
84
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
97
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/resource/workloads/deployment/detail/template.html
</context>
<context
context-type=
"linenumber"
>
247
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"81054386839df6c7c45d298e0044956413589ef4"
datatype=
"html"
>
<source>
Age
</source>
...
...
@@ -1276,28 +1345,6 @@
<context
context-type=
"linenumber"
>
38
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"d41640b21b662e4d9ee00c35239d30d15f1de9c7"
datatype=
"html"
>
<source>
Daemon Sets
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/daemonset/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
52
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"969a1d5188e9bde32221c1230eab21a3398b0cbe"
datatype=
"html"
>
<source>
Deployments
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/deployment/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
67
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"35bc68bd793eed6ee0232bfa6c4d72bc8c07fe69"
datatype=
"html"
>
<source>
Endpoints
</source>
<context-group
purpose=
"location"
>
...
...
@@ -1398,17 +1445,6 @@
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"43f1cc191ebc0b8ce89f6916aa634f5a57158798"
datatype=
"html"
>
<source>
Jobs
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/job/template.html
</context>
<context
context-type=
"linenumber"
>
23
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
82
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"222a0537c59f20178268925dc70fb661a20dbdb7"
datatype=
"html"
>
<source>
There is nothing to display here
</source>
<context-group
purpose=
"location"
>
...
...
@@ -1851,17 +1887,6 @@
<context
context-type=
"linenumber"
>
52
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"d9161a5f702c1f98ea34e4996c2d0b0c9eb1b66a"
datatype=
"html"
>
<source>
Replica Sets
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/replicaset/template.html
</context>
<context
context-type=
"linenumber"
>
23
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
112
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"e04aa162d5c7f9cf4dde1b4a78667ca3f70da778"
datatype=
"html"
>
<source>
Replications Controllers
</source>
<context-group
purpose=
"location"
>
...
...
@@ -1894,17 +1919,6 @@
<context
context-type=
"linenumber"
>
58
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"0756fdca226249dcff9d05651d50b7acdade2aba"
datatype=
"html"
>
<source>
Stateful Sets
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/common/components/resourcelist/statefulset/template.html
</context>
<context
context-type=
"linenumber"
>
21
</context>
</context-group>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
142
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"29f86a92691ef11e87a07459d2104cab7bd91f56"
datatype=
"html"
>
<source>
Secrets
</source>
<context-group
purpose=
"location"
>
...
...
@@ -3342,20 +3356,6 @@
<context
context-type=
"linenumber"
>
151
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"32c4fb786d3f614318c26ef8adc8f195d581545d"
datatype=
"html"
>
<source>
Workload Status
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
20
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"900ec6b108c64adf2f23a3a84699be1217050001"
datatype=
"html"
>
<source>
Replication Controllers
</source>
<context-group
purpose=
"location"
>
<context
context-type=
"sourcefile"
>
../src/app/frontend/overview/workloadstatus/template.html
</context>
<context
context-type=
"linenumber"
>
127
</context>
</context-group>
</trans-unit>
<trans-unit
id=
"cd822e20f30707b670188ef04e8448f706be643d"
datatype=
"html"
>
<source>
Namespace information
</source>
<context-group
purpose=
"location"
>
...
...
src/app/frontend/common/components/module.ts
浏览文件 @
57c50485
...
...
@@ -83,6 +83,7 @@ import {CpuSparklineComponent} from './sparkline/cpu/component';
import
{
MemorySparklineComponent
}
from
'
./sparkline/memory/component
'
;
import
{
TextInputComponent
}
from
'
./textinput/component
'
;
import
{
UploadFileComponent
}
from
'
./uploadfile/component
'
;
import
{
WorkloadStatusComponent
}
from
'
./workloadstatus/component
'
;
import
{
ZeroStateComponent
}
from
'
./zerostate/component
'
;
const
components
=
[
...
...
@@ -171,6 +172,7 @@ const components = [
UploadFileComponent
,
ZeroStateComponent
,
WorkloadStatusComponent
];
@
NgModule
({
...
...
src/app/frontend/
overview
/workloadstatus/component.spec.ts
→
src/app/frontend/
common/components
/workloadstatus/component.spec.ts
浏览文件 @
57c50485
...
...
@@ -22,9 +22,9 @@ import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import
{
AppConfig
}
from
'
@api/backendapi
'
;
import
{
ResourcesRatio
}
from
'
@api/frontendapi
'
;
import
{
AllocationChartComponent
}
from
'
../../common/components/allocationchart/component
'
;
import
{
CardComponent
}
from
'
../../common/components/card
/component
'
;
import
{
C
onfigService
}
from
'
../../common/services/global/config
'
;
import
{
ConfigService
}
from
'
../../services/global/config
'
;
import
{
AllocationChartComponent
}
from
'
../allocationchart
/component
'
;
import
{
C
ardComponent
}
from
'
../card/component
'
;
import
{
WorkloadStatusComponent
}
from
'
./component
'
;
...
...
src/app/frontend/
overview
/workloadstatus/component.ts
→
src/app/frontend/
common/components
/workloadstatus/component.ts
浏览文件 @
57c50485
文件已移动
src/app/frontend/
overview
/workloadstatus/style.scss
→
src/app/frontend/
common/components
/workloadstatus/style.scss
浏览文件 @
57c50485
...
...
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
@import
'../../variables'
;
@import
'../../
../
variables'
;
.kd-graph-container
{
flex
:
auto
;
...
...
src/app/frontend/
overview
/workloadstatus/template.html
→
src/app/frontend/
common/components
/workloadstatus/template.html
浏览文件 @
57c50485
文件已移动
src/app/frontend/overview/component.spec.ts
浏览文件 @
57c50485
...
...
@@ -23,12 +23,12 @@ import {AppConfig, CronJobList, DaemonSetList, PodList,} from '@api/backendapi';
import
{
AllocationChartComponent
}
from
'
../common/components/allocationchart/component
'
;
import
{
CardComponent
}
from
'
../common/components/card/component
'
;
import
{
ListGroupIdentifiers
,
ListIdentifiers
,}
from
'
../common/components/resourcelist/groupids
'
;
import
{
emptyResourcesRatio
,
WorkloadStatusComponent
,}
from
'
../common/components/workloadstatus/component
'
;
import
{
ConfigService
}
from
'
../common/services/global/config
'
;
import
{
NotificationsService
}
from
'
../common/services/global/notifications
'
;
import
{
OverviewComponent
}
from
'
./component
'
;
import
{
Helper
,
ResourceRatioModes
}
from
'
./helper
'
;
import
{
emptyResourcesRatio
,
WorkloadStatusComponent
,}
from
'
./workloadstatus/component
'
;
const
mockDaemonSetData
:
DaemonSetList
=
{
listMeta
:
{
totalItems
:
1
},
...
...
src/app/frontend/overview/component.ts
浏览文件 @
57c50485
...
...
@@ -17,10 +17,10 @@ import {CronJobList, DaemonSetList, DeploymentList, JobList, Metric, PodList, Re
import
{
OnListChangeEvent
,
ResourcesRatio
}
from
'
@api/frontendapi
'
;
import
{
ListGroupIdentifiers
,
ListIdentifiers
,}
from
'
../common/components/resourcelist/groupids
'
;
import
{
emptyResourcesRatio
}
from
'
../common/components/workloadstatus/component
'
;
import
{
GroupedResourceList
}
from
'
../common/resources/groupedlist
'
;
import
{
Helper
,
ResourceRatioModes
}
from
'
./helper
'
;
import
{
emptyResourcesRatio
}
from
'
./workloadstatus/component
'
;
@
Component
({
selector
:
'
kd-overview
'
,
...
...
src/app/frontend/overview/module.ts
浏览文件 @
57c50485
...
...
@@ -15,14 +15,15 @@
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
ComponentsModule
}
from
'
../common/components/module
'
;
import
{
WorkloadStatusComponent
}
from
'
../common/components/workloadstatus/component
'
;
import
{
SharedModule
}
from
'
../shared.module
'
;
import
{
OverviewComponent
}
from
'
./component
'
;
import
{
OverviewRoutingModule
}
from
'
./routing
'
;
import
{
WorkloadStatusComponent
}
from
'
./workloadstatus/component
'
;
@
NgModule
({
imports
:
[
SharedModule
,
ComponentsModule
,
OverviewRoutingModule
],
declarations
:
[
OverviewComponent
,
WorkloadStatusComponent
],
declarations
:
[
OverviewComponent
],
})
export
class
OverviewModule
{
}
src/app/frontend/resource/workloads/component.ts
浏览文件 @
57c50485
...
...
@@ -13,8 +13,12 @@
// limitations under the License.
import
{
Component
}
from
'
@angular/core
'
;
import
{
OnListChangeEvent
}
from
'
@api/frontendapi
'
;
import
{
ListGroupIdentifiers
}
from
'
../../common/components/resourcelist/groupids
'
;
import
{
CronJobList
,
DaemonSetList
,
DeploymentList
,
JobList
,
Metric
,
PodList
,
ReplicaSetList
,
ReplicationControllerList
,
StatefulSetList
,}
from
'
@api/backendapi
'
;
import
{
OnListChangeEvent
,
ResourcesRatio
}
from
'
@api/frontendapi
'
;
import
{
emptyResourcesRatio
}
from
'
common/components/workloadstatus/component
'
;
import
{
Helper
,
ResourceRatioModes
}
from
'
overview/helper
'
;
import
{
ListGroupIdentifiers
,
ListIdentifiers
}
from
'
../../common/components/resourcelist/groupids
'
;
import
{
GroupedResourceList
}
from
'
../../common/resources/groupedlist
'
;
@
Component
({
...
...
@@ -22,4 +26,85 @@ import {GroupedResourceList} from '../../common/resources/groupedlist';
templateUrl
:
'
./template.html
'
,
})
export
class
WorkloadsComponent
extends
GroupedResourceList
{
resourcesRatio
:
ResourcesRatio
=
emptyResourcesRatio
;
cumulativeMetrics
:
Metric
[]
=
[];
hasWorkloads
():
boolean
{
return
this
.
isGroupVisible
(
ListGroupIdentifiers
.
workloads
);
}
hasDiscovery
():
boolean
{
return
this
.
isGroupVisible
(
ListGroupIdentifiers
.
discovery
);
}
hasConfig
():
boolean
{
return
this
.
isGroupVisible
(
ListGroupIdentifiers
.
config
);
}
updateResourcesRatio
(
event
:
OnListChangeEvent
)
{
switch
(
event
.
id
)
{
case
ListIdentifiers
.
cronJob
:
{
const
cronJobs
=
event
.
resourceList
as
CronJobList
;
this
.
resourcesRatio
.
cronJobRatio
=
Helper
.
getResourceRatio
(
cronJobs
.
status
,
cronJobs
.
listMeta
.
totalItems
,
ResourceRatioModes
.
Suspendable
);
break
;
}
case
ListIdentifiers
.
daemonSet
:
{
const
daemonSets
=
event
.
resourceList
as
DaemonSetList
;
this
.
resourcesRatio
.
daemonSetRatio
=
Helper
.
getResourceRatio
(
daemonSets
.
status
,
daemonSets
.
listMeta
.
totalItems
);
break
;
}
case
ListIdentifiers
.
deployment
:
{
const
deployments
=
event
.
resourceList
as
DeploymentList
;
this
.
resourcesRatio
.
deploymentRatio
=
Helper
.
getResourceRatio
(
deployments
.
status
,
deployments
.
listMeta
.
totalItems
);
break
;
}
case
ListIdentifiers
.
job
:
{
const
jobs
=
event
.
resourceList
as
JobList
;
this
.
resourcesRatio
.
jobRatio
=
Helper
.
getResourceRatio
(
jobs
.
status
,
jobs
.
listMeta
.
totalItems
,
ResourceRatioModes
.
Completable
);
break
;
}
case
ListIdentifiers
.
pod
:
{
const
pods
=
event
.
resourceList
as
PodList
;
this
.
resourcesRatio
.
podRatio
=
Helper
.
getResourceRatio
(
pods
.
status
,
pods
.
listMeta
.
totalItems
,
ResourceRatioModes
.
Completable
);
this
.
cumulativeMetrics
=
pods
.
cumulativeMetrics
;
break
;
}
case
ListIdentifiers
.
replicaSet
:
{
const
replicaSets
=
event
.
resourceList
as
ReplicaSetList
;
this
.
resourcesRatio
.
replicaSetRatio
=
Helper
.
getResourceRatio
(
replicaSets
.
status
,
replicaSets
.
listMeta
.
totalItems
);
break
;
}
case
ListIdentifiers
.
replicationController
:
{
const
replicationControllers
=
event
.
resourceList
as
ReplicationControllerList
;
this
.
resourcesRatio
.
replicationControllerRatio
=
Helper
.
getResourceRatio
(
replicationControllers
.
status
,
replicationControllers
.
listMeta
.
totalItems
);
break
;
}
case
ListIdentifiers
.
statefulSet
:
{
const
statefulSets
=
event
.
resourceList
as
StatefulSetList
;
this
.
resourcesRatio
.
statefulSetRatio
=
Helper
.
getResourceRatio
(
statefulSets
.
status
,
statefulSets
.
listMeta
.
totalItems
);
break
;
}
default
:
break
;
}
}
showWorkloadStatuses
():
boolean
{
return
(
Object
.
values
(
this
.
resourcesRatio
)
.
reduce
((
sum
,
ratioItems
)
=>
sum
+
ratioItems
.
length
,
0
)
!==
0
);
}
showGraphs
():
boolean
{
return
this
.
cumulativeMetrics
.
every
(
metrics
=>
metrics
.
dataPoints
&&
metrics
.
dataPoints
.
length
>
1
);
}
}
src/app/frontend/resource/workloads/template.html
浏览文件 @
57c50485
...
...
@@ -15,6 +15,8 @@ limitations under the License.
-->
<div
[hidden]=
"shouldShowZeroState()"
>
<kd-workload-statuses
*ngIf=
"showWorkloadStatuses()"
[resourcesRatio]=
"resourcesRatio"
></kd-workload-statuses>
<kd-cron-job-list
(onchange)=
"onListUpdate($event)"
[hideable]=
"true"
></kd-cron-job-list>
<kd-daemon-set-list
(onchange)=
"onListUpdate($event)"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录