Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
b3f71086
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,发现更多精彩内容 >>
提交
b3f71086
编写于
11月 04, 2015
作者:
P
Przemek Więch
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #43 from kubernetes/add-service-and-zerostate-views
Add service list and zero state views
上级
d089523a
beaebeb4
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
226 addition
and
54 deletion
+226
-54
src/app/frontend/chrome/chrome.controller.js
src/app/frontend/chrome/chrome.controller.js
+1
-1
src/app/frontend/chrome/chrome.directive.js
src/app/frontend/chrome/chrome.directive.js
+1
-1
src/app/frontend/chrome/chrome.html
src/app/frontend/chrome/chrome.html
+16
-0
src/app/frontend/chrome/chrome.module.js
src/app/frontend/chrome/chrome.module.js
+2
-1
src/app/frontend/chrome/chrome.scss
src/app/frontend/chrome/chrome.scss
+1
-1
src/app/frontend/index.config.js
src/app/frontend/index.config.js
+2
-2
src/app/frontend/index.html
src/app/frontend/index.html
+16
-0
src/app/frontend/index.module.js
src/app/frontend/index.module.js
+6
-4
src/app/frontend/index.route.js
src/app/frontend/index.route.js
+2
-2
src/app/frontend/index.scss
src/app/frontend/index.scss
+2
-2
src/app/frontend/main/main.html
src/app/frontend/main/main.html
+0
-5
src/app/frontend/servicelist/servicelist.controller.js
src/app/frontend/servicelist/servicelist.controller.js
+9
-8
src/app/frontend/servicelist/servicelist.html
src/app/frontend/servicelist/servicelist.html
+21
-0
src/app/frontend/servicelist/servicelist.module.js
src/app/frontend/servicelist/servicelist.module.js
+28
-0
src/app/frontend/servicelist/servicelist.state.js
src/app/frontend/servicelist/servicelist.state.js
+31
-0
src/app/frontend/zerostate/zerostate.controller.js
src/app/frontend/zerostate/zerostate.controller.js
+8
-3
src/app/frontend/zerostate/zerostate.html
src/app/frontend/zerostate/zerostate.html
+21
-0
src/app/frontend/zerostate/zerostate.module.js
src/app/frontend/zerostate/zerostate.module.js
+28
-0
src/app/frontend/zerostate/zerostate.state.js
src/app/frontend/zerostate/zerostate.state.js
+7
-5
src/test/frontend/.eslintrc
src/test/frontend/.eslintrc
+6
-1
src/test/frontend/zerostate/zerostate.controller.test.js
src/test/frontend/zerostate/zerostate.controller.test.js
+6
-7
src/test/integration/zerostate.po.js
src/test/integration/zerostate.po.js
+6
-5
src/test/integration/zerostate.test.js
src/test/integration/zerostate.test.js
+6
-6
未找到文件。
src/app/frontend/chrome/chrome.controller.js
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
src/app/frontend/chrome/chrome.directive.js
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
src/app/frontend/chrome/chrome.html
浏览文件 @
b3f71086
<!--
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.
-->
<md-content>
<md-toolbar>
<div
class=
"md-toolbar-tools"
>
...
...
src/app/frontend/chrome/chrome.module.js
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
@@ -22,5 +22,6 @@ export default angular.module(
'
kubernetesDashboard.chrome
'
,
[
'
ngMaterial
'
,
'
ui.router
'
,
])
.
directive
(
'
chrome
'
,
chromeDirective
);
src/app/frontend/chrome/chrome.scss
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
src/app/frontend/index.config.js
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
src/app/frontend/index.html
浏览文件 @
b3f71086
<!--
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.
-->
<!doctype html>
<html
ng-app=
"kubernetesDashboard"
>
<!-- TODO(bryk): Add ng-strict-di setting for production builds. -->
...
...
src/app/frontend/index.module.js
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
@@ -17,9 +17,10 @@
* to bootstrap the application.
*/
import
chromeModule
from
'
./chrome/chrome.module
'
;
import
mainModule
from
'
./main/main.module
'
;
import
indexConfig
from
'
./index.config
'
;
import
routeConfig
from
'
./index.route
'
;
import
serviceListModule
from
'
./servicelist/servicelist.module
'
;
import
zerostateModule
from
'
./zerostate/zerostate.module
'
;
export
default
angular
.
module
(
...
...
@@ -33,7 +34,8 @@ export default angular.module(
'
ngSanitize
'
,
'
ui.router
'
,
chromeModule
.
name
,
mainModule
.
name
,
serviceListModule
.
name
,
zerostateModule
.
name
,
])
.
config
(
indexConfig
)
.
config
(
routeConfig
);
src/app/frontend/index.route.js
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
src/app/frontend/index.scss
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
src/app/frontend/main/main.html
已删除
100644 → 0
浏览文件 @
d089523a
<div
layout=
"vertical"
layout-fill
>
<header>
Page content goes here.
</header>
</div>
src/
test/integration/main.po
.js
→
src/
app/frontend/servicelist/servicelist.controller
.js
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
@@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview This file uses the Page Object pattern to define the main page for tests
* https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ
* Controller for the service list view.
*
* @final
*/
export
default
class
MainPage
{
export
default
class
ServiceListController
{
constructor
()
{
this
.
header
=
element
(
by
.
css
(
'
header
'
));
/** @export {!Array<string>} */
this
.
testServices
=
[
'
srvc1
'
,
'
srvc2
'
];
}
}
src/app/frontend/servicelist/servicelist.html
0 → 100644
浏览文件 @
b3f71086
<!--
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.
-->
<div
layout=
"vertical"
layout-fill
>
<header>
Service page. {{ctrl.testServices}}
</header>
</div>
src/app/frontend/servicelist/servicelist.module.js
0 → 100644
浏览文件 @
b3f71086
// 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
stateConfig
from
'
./servicelist.state
'
;
/**
* Angular module for the service list view.
*
* The view shows services running in the cluster and allows to manage them.
*/
export
default
angular
.
module
(
'
kubernetesDashboard.serviceList
'
,
[
'
ui.router
'
,
])
.
config
(
stateConfig
);
src/app/frontend/servicelist/servicelist.state.js
0 → 100644
浏览文件 @
b3f71086
// 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
ServiceListController
from
'
./servicelist.controller
'
;
/**
* Configures states for the service view.
*
* @param {!ui.router.$stateProvider} $stateProvider
* @ngInject
*/
export
default
function
stateConfig
(
$stateProvider
)
{
$stateProvider
.
state
(
'
servicelist
'
,
{
url
:
'
/servicelist
'
,
templateUrl
:
'
servicelist/servicelist.html
'
,
controller
:
ServiceListController
,
controllerAs
:
'
ctrl
'
,
});
}
src/app/frontend/
main/main
.controller.js
→
src/app/frontend/
zerostate/zerostate
.controller.js
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
@@ -13,13 +13,18 @@
// limitations under the License.
export
default
class
MainController
{
/**
* Controller for the zero state view.
*
* @final
*/
export
default
class
ZeroStateController
{
/**
* @param {!angular.$timeout} $timeout
* @ngInject
*/
constructor
(
$timeout
)
{
/** @export */
/** @export
{number}
*/
this
.
testValue
=
7
;
$timeout
(()
=>
{
...
...
src/app/frontend/zerostate/zerostate.html
0 → 100644
浏览文件 @
b3f71086
<!--
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.
-->
<div
layout=
"vertical"
layout-fill
>
<header>
Zero state page.
<a
ui-sref=
"servicelist"
>
Go to services page
</a>
</header>
</div>
src/app/frontend/zerostate/zerostate.module.js
0 → 100644
浏览文件 @
b3f71086
// 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
stateConfig
from
'
./zerostate.state
'
;
/**
* Angular module for the zero state view.
*
* The view is active on the first launch of the application and is used for onboarding new users.
*/
export
default
angular
.
module
(
'
kubernetesDashboard.zerostate
'
,
[
'
ui.router
'
,
])
.
config
(
stateConfig
);
src/app/frontend/
main/main
.state.js
→
src/app/frontend/
zerostate/zerostate
.state.js
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
@@ -12,18 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
MainController
from
'
./main
.controller
'
;
import
ZeroStateController
from
'
./zerostate
.controller
'
;
/**
* Configures states for the zero state view.
*
* @param {!ui.router.$stateProvider} $stateProvider
* @ngInject
*/
export
default
function
stateConfig
(
$stateProvider
)
{
$stateProvider
.
state
(
'
main
'
,
{
$stateProvider
.
state
(
'
zero
'
,
{
url
:
'
/
'
,
templateUrl
:
'
main/main
.html
'
,
controller
:
Main
Controller
,
templateUrl
:
'
zerostate/zerostate
.html
'
,
controller
:
ZeroState
Controller
,
controllerAs
:
'
ctrl
'
,
});
}
src/test/frontend/.eslintrc
浏览文件 @
b3f71086
{
"env": {
"jasmine": true,
}
},
"globals": {
// Define missing global Angular variables.
"inject": true,
"module": true,
},
}
src/test/frontend/
main/main
.controller.test.js
→
src/test/frontend/
zerostate/zerostate
.controller.test.js
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
@@ -12,18 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
ZerostateController
from
'
zerostate/zerostate.controller
'
;
import
{
MainController
}
from
'
main/main.controller
'
;
describe
(
'
Main controller
'
,
()
=>
{
let
vm
;
beforeEach
(
(
)
=>
{
vm
=
new
MainController
(
);
});
beforeEach
(
inject
((
$timeout
)
=>
{
vm
=
new
ZerostateController
(
$timeout
);
})
)
;
it
(
'
should do something
'
,
()
=>
{
expect
(
vm
.
testValue
).
toEqual
(
7
);
});
});
src/
app/frontend/main/main.module
.js
→
src/
test/integration/zerostate.po
.js
浏览文件 @
b3f71086
...
...
@@ -4,7 +4,7 @@
// 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
// 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,
...
...
@@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
stateConfig
from
'
./main.state
'
;
export
default
angular
.
module
(
'
kubernetesDashboard.main
'
,
[])
.
config
(
stateConfig
);
export
default
class
ZeroStatePageObject
{
constructor
()
{
this
.
header
=
element
(
by
.
css
(
'
header
'
));
}
}
src/test/integration/
main
.test.js
→
src/test/integration/
zerostate
.test.js
浏览文件 @
b3f71086
// Copyright 2015 Google Inc.
// 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
// 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,
...
...
@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
MainPage
from
'
./main
.po
'
;
import
PageObject
from
'
./zerostate
.po
'
;
describe
(
'
The main
view
'
,
function
()
{
describe
(
'
Zero state
view
'
,
function
()
{
let
page
;
beforeEach
(
function
()
{
browser
.
get
(
'
/index.html
'
);
page
=
new
MainPage
();
page
=
new
PageObject
();
});
it
(
'
should do something
'
,
function
()
{
expect
(
page
.
header
.
getText
()).
to
Be
(
'
Page content goes here.
'
);
expect
(
page
.
header
.
getText
()).
to
Contain
(
'
page
'
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录