Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
791e3f97
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,发现更多精彩内容 >>
提交
791e3f97
编写于
1月 19, 2016
作者:
P
Piotr Bryk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into show-pods-stats-desired
上级
eeffe551
148face9
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
158 addition
and
17 deletion
+158
-17
src/app/backend/replicasetdetail.go
src/app/backend/replicasetdetail.go
+4
-0
src/app/externs/backendapi.js
src/app/externs/backendapi.js
+2
-1
src/app/frontend/deploy/deploy.html
src/app/frontend/deploy/deploy.html
+1
-1
src/app/frontend/deploy/deployfromfile_controller.js
src/app/frontend/deploy/deployfromfile_controller.js
+2
-1
src/app/frontend/deploy/deployfromfile_directive.js
src/app/frontend/deploy/deployfromfile_directive.js
+2
-1
src/app/frontend/deploy/upload.html
src/app/frontend/deploy/upload.html
+6
-2
src/app/frontend/deploy/upload_controller.js
src/app/frontend/deploy/upload_controller.js
+18
-0
src/app/frontend/deploy/upload_directive.js
src/app/frontend/deploy/upload_directive.js
+1
-0
src/app/frontend/logs/logstoolbar/logstoolbar.html
src/app/frontend/logs/logstoolbar/logstoolbar.html
+9
-2
src/app/frontend/logs/logstoolbar/logstoolbar_controller.js
src/app/frontend/logs/logstoolbar/logstoolbar_controller.js
+2
-2
src/app/frontend/replicasetdetail/replicasetdetail.html
src/app/frontend/replicasetdetail/replicasetdetail.html
+35
-5
src/app/frontend/replicasetlist/logsmenu.html
src/app/frontend/replicasetlist/logsmenu.html
+7
-2
src/test/frontend/deploy/upload_controller_test.js
src/test/frontend/deploy/upload_controller_test.js
+69
-0
未找到文件。
src/app/backend/replicasetdetail.go
浏览文件 @
791e3f97
...
...
@@ -60,6 +60,9 @@ type ReplicaSetPod struct {
// Name of the Pod.
Name
string
`json:"name"`
// Status of the Pod. See Kubernetes API for reference.
PodPhase
api
.
PodPhase
`json:"podPhase"`
// Time the Pod has started. Empty if not started.
StartTime
*
unversioned
.
Time
`json:"startTime"`
...
...
@@ -155,6 +158,7 @@ func GetReplicaSetDetail(client *client.Client, namespace, name string) (*Replic
for
_
,
pod
:=
range
pods
.
Items
{
podDetail
:=
ReplicaSetPod
{
Name
:
pod
.
Name
,
PodPhase
:
pod
.
Status
.
Phase
,
StartTime
:
pod
.
Status
.
StartTime
,
PodIP
:
pod
.
Status
.
PodIP
,
NodeName
:
pod
.
Spec
.
NodeName
,
...
...
src/app/externs/backendapi.js
浏览文件 @
791e3f97
...
...
@@ -131,6 +131,7 @@ backendApi.ReplicaSetSpec;
* @typedef {{
* name: string,
* startTime: ?string,
* status: string,
* podIP: string,
* nodeName: string,
* restartCount: number
...
...
@@ -180,7 +181,7 @@ backendApi.PodContainer;
/**
* @typedef {{
* name: string,
* startTime: string,
* startTime:
?
string,
* totalRestartCount: number,
* podContainers: !Array<!backendApi.PodContainer>
* }}
...
...
src/app/frontend/deploy/deploy.html
浏览文件 @
791e3f97
...
...
@@ -34,7 +34,7 @@ limitations under the License.
<deploy-from-settings
ng-switch-when=
"Settings"
name=
"ctrl.name"
namespaces=
"ctrl.namespaces"
detail=
"ctrl.detail"
form=
"ctrl.deployForm"
>
</deploy-from-settings>
<deploy-from-file
ng-switch-when=
"File"
name=
"ctrl.name"
detail=
"ctrl.detail"
>
<deploy-from-file
ng-switch-when=
"File"
name=
"ctrl.name"
detail=
"ctrl.detail"
form=
"ctrl.deployForm"
>
</deploy-from-file>
</div>
...
...
src/app/frontend/deploy/deployfromfile_controller.js
浏览文件 @
791e3f97
...
...
@@ -30,7 +30,8 @@ export default class DeployFromFileController {
/**
* Custom file model for the selected file
*
* @export {{name:string, content:string}} */
* @export {{name:string, content:string}}
*/
this
.
file
=
{
name
:
''
,
content
:
''
};
}
}
src/app/frontend/deploy/deployfromfile_directive.js
浏览文件 @
791e3f97
...
...
@@ -19,9 +19,10 @@ export default function deployFromFileDirective() {
scope
:
{},
bindToController
:
{
'
detail
'
:
'
=
'
,
'
form
'
:
'
=
'
,
},
controller
:
DeployFromFileController
,
controllerAs
:
'
ctrl
'
,
template
:
'
<kd-upload file="ctrl.file"></kd-upload>
'
,
template
:
'
<kd-upload file="ctrl.file"
form="ctrl.form"
></kd-upload>
'
,
};
}
src/app/frontend/deploy/upload.html
浏览文件 @
791e3f97
...
...
@@ -17,10 +17,14 @@ limitations under the License.
<kd-help-section>
<div
layout=
"row"
layout-align=
"space-between start"
>
<div
flex
>
<md-input-container
class=
"md-block"
>
<md-input-container
class=
"md-block"
md-is-error=
"ctrl.isFileNameError()"
>
<label>
YAML or JSON file
</label>
<!--TODO: Browse file on focus doesn't work in Firefox. It is to be investigated.-->
<input
ng-model=
"ctrl.file.name"
ng-focus=
"ctrl.browseFile()"
ng-readonly=
"true"
/>
<input
ng-model=
"ctrl.file.name"
ng-focus=
"ctrl.browseFile()"
ng-readonly=
"true"
name=
"fileName"
required
/>
<ng-messages
for=
"ctrl.form.fileName.$error"
role=
"alert"
multiple
>
<ng-message
when=
"required"
>
File is required.
</ng-message>
</ng-message>
</ng-messages>
</md-input-container>
</div>
<md-button
type=
"button"
class=
"md-raised kd-upload-button"
ng-click=
"ctrl.browseFile()"
>
...
...
src/app/frontend/deploy/upload_controller.js
浏览文件 @
791e3f97
...
...
@@ -29,6 +29,12 @@ export default class UploadController {
* Initialized from the registerBrowseFileFunction method.
* @private {(function())|undefined} */
this
.
browseFileFunc_
;
/**
* Initialized from the scope.
* @export {!angular.FormController}
*/
this
.
form
;
}
/**
...
...
@@ -53,4 +59,16 @@ export default class UploadController {
this
.
browseFileFunc_
();
}
}
/**
* Used to deactivate the invalid file name report if the form is not submitted yet.
*
* @returns {boolean}
* @export
*/
isFileNameError
()
{
/** @type {!angular.NgModelController} */
let
fileName
=
this
.
form
[
'
fileName
'
];
return
this
.
form
.
$submitted
&&
fileName
.
$invalid
;
}
}
src/app/frontend/deploy/upload_directive.js
浏览文件 @
791e3f97
...
...
@@ -25,6 +25,7 @@ export default function uploadDirective() {
scope
:
{},
bindToController
:
{
'
file
'
:
'
=
'
,
'
form
'
:
'
=
'
,
},
controller
:
UploadController
,
controllerAs
:
'
ctrl
'
,
...
...
src/app/frontend/logs/logstoolbar/logstoolbar.html
浏览文件 @
791e3f97
...
...
@@ -35,12 +35,19 @@ limitations under the License.
</md-option>
</md-select>
</div>
<span
class=
"kd-logs-toolbar-text"
flex
>
Running since {{ctrl.podCreationTime}}
</span>
<span
class=
"kd-logs-toolbar-text"
flex
>
<span
ng-if=
"ctrl.podCreationTime"
>
Running since {{ctrl.podCreationTime | date:'short'}}
</span>
<span
ng-if=
"!ctrl.podCreationTime"
>
Not running
</span>
</span>
<span
flex
></span>
<md-button
class=
"kd-icon-button"
id=
"colorText"
ng-click=
"ctrl.onTextColorChange()"
>
<md-icon
md-font-library=
"material-icons"
ng-class=
ctrl.getStyleClass()
>
ng-class=
"ctrl.getStyleClass()"
>
format_color_text
</md-icon>
</md-button>
...
...
src/app/frontend/logs/logstoolbar/logstoolbar_controller.js
浏览文件 @
791e3f97
...
...
@@ -56,9 +56,9 @@ export default class LogsToolbarController {
/**
* Pod creation time.
* @export {string}
* @export {
?
string}
*/
this
.
podCreationTime
=
new
Date
(
Date
.
parse
(
this
.
pod
.
startTime
)).
toLocaleString
()
;
this
.
podCreationTime
=
this
.
pod
.
startTime
;
/**
* Namespace.
...
...
src/app/frontend/replicasetdetail/replicasetdetail.html
浏览文件 @
791e3f97
...
...
@@ -103,6 +103,14 @@ limitations under the License.
Pod
</kd-sorted-header>
</th>
<th
class=
"kd-replicasetdetail-table-header"
>
<kd-sorted-header
currently-selected-column=
"ctrl.sortPodsBy"
currently-selected-order=
"ctrl.podsOrder"
column-name=
"status"
tooltip=
"Status of the pod"
>
Status
</kd-sorted-header>
</th>
<th
class=
"kd-replicasetdetail-table-header"
>
<kd-sorted-header
currently-selected-column=
"ctrl.sortPodsBy"
currently-selected-order=
"ctrl.podsOrder"
...
...
@@ -162,11 +170,19 @@ limitations under the License.
<tr
ng-repeat=
"pod in ctrl.replicaSetDetail.pods | orderBy:ctrl.sortPodsBy:ctrl.podsOrder"
>
<td
class=
"kd-replicasetdetail-table-cell"
>
{{pod.name}}
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
{{
pod.restartCount}}
<!-- TODO(maciaszczykm): Add info about last restart date. -->
{{
::pod.podPhase}}
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
{{pod.startTime | relativeTime}}
<md-tooltip>
{{pod.startTime | date:'short'}}
</md-tooltip>
{{::pod.restartCount}}
<!-- TODO(maciaszczykm): Add info about last restart date. -->
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
<span
ng-if=
"::pod.startTime"
>
{{::pod.startTime | relativeTime}}
<md-tooltip>
{{::(pod.startTime | date:'short')}}
</md-tooltip>
</span>
<span
ng-if=
"::!pod.startTime"
>
-
</span>
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
0.4 CPU
<!-- TODO(maciaszczykm): Fill with data and plot. -->
...
...
@@ -174,8 +190,22 @@ limitations under the License.
<td
class=
"kd-replicasetdetail-table-cell"
>
12 MB
<!-- TODO(maciaszczykm): Fill with data and plot. -->
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
{{pod.podIP}}
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
{{pod.nodeName}}
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
<span
ng-if=
"::pod.podIP"
>
{{::pod.podIP}}
</span>
<span
ng-if=
"::!pod.podIP"
>
-
</span>
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
<span
ng-if=
"::pod.nodeName"
>
{{::pod.nodeName}}
</span>
<span
ng-if=
"::!pod.nodeName"
>
-
</span>
</td>
<td
class=
"kd-replicasetdetail-table-cell"
>
<span>
Logs
<i
class=
"material-icons kd-replicasetdetail-table-icon"
>
arrow_drop_down
</i>
...
...
src/app/frontend/replicasetlist/logsmenu.html
浏览文件 @
791e3f97
...
...
@@ -32,8 +32,13 @@ limitations under the License.
<div
class=
"kd-menu-logs-item kd-menu-logs-item-since"
>
<a
ng-href=
"{{::ctrl.getLogsHref(pod.name, pod.podContainers[0].name)}}"
ng-if=
"::ctrl.podContainerExists(pod)"
>
{{pod.startTime | date:"short"}}
<i
class=
"material-icons kd-menu-logs-link-icon"
>
open_in_new
</i>
<span
ng-if=
"::pod.startTime"
>
{{pod.startTime | date:"short"}}
</span>
<span
ng-if=
"::!pod.startTime"
>
Not running
</span>
<i
class=
"material-icons kd-menu-logs-link-icon"
>
open_in_new
</i>
</a>
<span
ng-if=
"::!ctrl.podContainerExists(pod)"
>
-
</span>
</div>
...
...
src/test/frontend/deploy/upload_controller_test.js
0 → 100644
浏览文件 @
791e3f97
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import
UploadController
from
'
deploy/upload_controller.js
'
;
describe
(
'
Upload Controller
'
,
()
=>
{
/** @type {!UploadController} */
let
ctrl
;
/** @type {!angular.FormController} */
let
form
;
beforeEach
(()
=>
{
angular
.
mock
.
inject
((
$controller
)
=>
{
form
=
{
$submitted
:
false
,
fileName
:
{
$invalid
:
false
,
$error
:
{
required
:
false
,
},
},
};
ctrl
=
$controller
(
UploadController
,
{
/* no locals */
},
{
form
:
form
});
});
});
it
(
'
should return false when the from is not submitted and there is no error
'
,
()
=>
{
// when
let
result
=
ctrl
.
isFileNameError
();
// then
expect
(
result
).
toEqual
(
false
);
});
it
(
'
should return false when the from is not submitted and there is an error
'
,
()
=>
{
// given
form
.
fileName
.
$error
.
required
=
true
;
// when
let
result
=
ctrl
.
isFileNameError
();
// then
expect
(
result
).
toEqual
(
false
);
});
it
(
'
should return true when the from is submitted and there is an error
'
,
()
=>
{
// given
form
.
fileName
.
$error
.
required
=
true
;
form
.
$submitted
=
true
;
// when
let
result
=
ctrl
.
isFileNameError
();
// then
expect
(
result
).
toEqual
(
false
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录