Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
ac2dbf17
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,发现更多精彩内容 >>
提交
ac2dbf17
编写于
11月 20, 2015
作者:
P
Piotr Bryk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into compiler-js-module-root
上级
bd231b0b
942d6c35
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
136 addition
and
21 deletion
+136
-21
src/app/backend/replicasetlist.go
src/app/backend/replicasetlist.go
+30
-7
src/app/externs/backendapi.js
src/app/externs/backendapi.js
+7
-2
src/app/frontend/deploy/deploy.controller.js
src/app/frontend/deploy/deploy.controller.js
+1
-1
src/app/frontend/replicasetlist/replicasetlist.html
src/app/frontend/replicasetlist/replicasetlist.html
+61
-5
src/app/frontend/replicasetlist/replicasetlist.scss
src/app/frontend/replicasetlist/replicasetlist.scss
+37
-6
未找到文件。
src/app/backend/replicasetlist.go
浏览文件 @
ac2dbf17
...
...
@@ -33,16 +33,29 @@ type ReplicaSet struct {
// Name of the Replica Set.
Name
string
`json:"name"`
// Human readable description of this Replica Set.
Description
string
`json:"description"`
// Label of this Replica Set.
Labels
map
[
string
]
string
`json:"labels"`
// Number of pods that are currently running.
PodsRunning
int
`json:"podsRunning"`
// Number of pods that are
desired to run in this replica s
et.
Pods
Desired
int
`json:"podsDesired
"`
// Number of pods that are
pending in this Replica S
et.
Pods
Pending
int
`json:"podsPending
"`
// Container images of the
replica s
et.
// Container images of the
Replica S
et.
ContainerImages
[]
string
`json:"containerImages"`
// TODO(bryk): Add service information here.
// Age in milliseconds of the oldest replica in the Set.
Age
uint64
`json:"age"`
// Internal endpoints of all Kubernetes services have the same label selector as this Replica Set.
InternalEndpoints
[]
string
`json:"internalEndpoints"`
// External endpoints of all Kubernetes services have the same label selector as this Replica Set.
ExternalEndpoints
[]
string
`json:"externalEndpoints"`
}
// Returns a list of all Replica Sets in the cluster.
...
...
@@ -65,9 +78,19 @@ func GetReplicaSetList(client *client.Client) (*ReplicaSetList, error) {
replicaSetList
.
ReplicaSets
=
append
(
replicaSetList
.
ReplicaSets
,
ReplicaSet
{
Name
:
replicaSet
.
ObjectMeta
.
Name
,
ContainerImages
:
containerImages
,
// TODO(bryk): This field contains test value. Implement it.
Description
:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
+
"Nulla metus nibh, iaculis a consectetur vitae, imperdiet pellentesque turpis."
,
Labels
:
replicaSet
.
ObjectMeta
.
Labels
,
PodsRunning
:
replicaSet
.
Status
.
Replicas
,
PodsDesired
:
replicaSet
.
Spec
.
Replicas
,
PodsPending
:
replicaSet
.
Spec
.
Replicas
-
replicaSet
.
Status
.
Replicas
,
ContainerImages
:
containerImages
,
// TODO(bryk): This field contains test value. Implement it.
Age
:
18
,
// TODO(bryk): This field contains test value. Implement it.
InternalEndpoints
:
[]
string
{
"webapp"
},
// TODO(bryk): This field contains test value. Implement it.
ExternalEndpoints
:
[]
string
{
"81.76.02.198:80"
},
})
}
...
...
src/app/externs/backendapi.js
浏览文件 @
ac2dbf17
...
...
@@ -59,9 +59,14 @@ backendApi.ReplicaSetList;
/**
* @typedef {{
* name: string,
* description: string,
* labels: !Object<string, string>,
* podsRunning: number,
* podsDesired: number,
* containerImages: !Array<string>
* podsPending: number,
* containerImages: !Array<string>,
* age: number,
* internalEndpoints: !Array<string>,
* externalEndpoints: !Array<string>
* }}
*/
backendApi
.
ReplicaSet
;
src/app/frontend/deploy/deploy.controller.js
浏览文件 @
ac2dbf17
...
...
@@ -84,7 +84,7 @@ export default class DeployController {
(
savedConfig
)
=>
{
this
.
isDeployInProgress_
=
false
;
this
.
log_
.
info
(
'
Successfully deployed application:
'
,
savedConfig
);
this
.
state_
.
go
(
'
service
list
'
);
this
.
state_
.
go
(
'
replicaset
list
'
);
},
(
err
)
=>
{
this
.
isDeployInProgress_
=
false
;
...
...
src/app/frontend/replicasetlist/replicasetlist.html
浏览文件 @
ac2dbf17
...
...
@@ -17,15 +17,71 @@ limitations under the License.
<div
layout=
"row"
layout-wrap
layout-margin
layout-align=
"center center"
>
<md-card
ng-repeat=
"replicaSet in ctrl.replicaSets"
>
<md-card-content
class=
"kd-replicaset-card"
>
<div
layout=
"row"
layout-align=
"space-between center"
>
<span
flex
>
{{replicaSet.name}}
</span>
<md-button
flex
class=
"md-icon-button kd-replicaset-card-menu"
>
<div
layout=
"row"
layout-align=
"space-between start"
>
<div
flex
layout=
"column"
>
<div
flex
>
{{replicaSet.name}}
</div>
<div
flex
class=
"md-caption"
>
<span
ng-repeat=
"(label, value) in replicaSet.labels"
class=
"kd-replicaset-card-label"
>
{{label}}:{{value}}
</span>
</div>
</div>
<md-button
flex=
"initial"
class=
"md-icon-button kd-replicaset-card-menu"
>
<md-icon
md-font-library=
"material-icons"
>
more_vert
</md-icon>
</md-button>
</div>
<div
class=
"md-caption"
>
<span>
{{replicaSet.podsRunning}} pods running
</span>
<div
layout=
"row"
>
<span
flex=
"60"
>
{{replicaSet.podsRunning}} pods running, {{replicaSet.podsPending}} pending
</span>
<a
flex=
"40"
href=
"#"
class=
"kd-replicaset-card-logs"
>
Logs
</a>
</div>
<hr
class=
"kd-replicaset-card-divider"
></hr>
<div
layout=
"row"
layout-wrap
>
<div
ng-if=
"replicaSet.description"
flex=
"100"
layout=
"column"
class=
"kd-replicaset-card-section"
>
<span
flex
>
Description
</span>
<div
flex
>
{{replicaSet.description}}
</div>
</div>
<div
flex=
"60"
layout=
"column"
class=
"kd-replicaset-card-section"
>
<span
flex
>
Image
</span>
<div
flex
>
<div
ng-repeat=
"image in replicaSet.containerImages"
class=
"kd-replicaset-card-section-image"
>
{{image}}
</div>
</div>
</div>
<div
flex=
"40"
layout=
"column"
class=
"kd-replicaset-card-section"
>
<span
flex=
"initial"
>
Age
</span>
<span
flex
>
{{replicaSet.age}}d
</span>
</div>
<div
flex=
"60"
layout=
"column"
class=
"kd-replicaset-card-section"
>
<span
flex=
"initial"
>
Internal Endpoint
</span>
<div
flex
>
<span
ng-repeat=
"endpoint in replicaSet.internalEndpoints"
>
{{endpoint}}
</span>
</div>
</div>
<div
flex=
"40"
layout=
"column"
class=
"kd-replicaset-card-section"
>
<span
flex=
"initial"
>
External Endpoint
</span>
<div
flex
>
<span
ng-repeat=
"endpoint in replicaSet.externalEndpoints"
>
{{endpoint}}
</span>
</div>
</div>
</div>
</div>
</md-card-content>
</md-card
>
</md-card>
</div>
src/app/frontend/replicasetlist/replicasetlist.scss
浏览文件 @
ac2dbf17
...
...
@@ -13,11 +13,42 @@
// limitations under the License.
.kd-replicaset-card
{
padding-top
:
0
;
width
:
400px
;
}
.kd-replicaset-card-menu
{
max-width
:
48px
;
.kd-replicaset-card-logs
{
color
:
inherit
;
text-decoration
:
none
;
}
.kd-replicaset-card-logs
{
color
:
inherit
;
text-decoration
:
none
;
}
.kd-replicaset-card-logs
:after
{
content
:
'\25BC'
;
}
.kd-replicaset-card-logs
:hover
{
text-decoration
:
underline
;
}
.kd-replicaset-card-divider
{
border
:
0
;
border-top
:
1px
solid
;
}
.kd-replicaset-card-section
{
margin-top
:
1em
;
}
.kd-replicaset-card-section-image
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.kd-replicaset-card-label
{
margin-right
:
1em
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录