Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
5a108bbc
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,发现更多精彩内容 >>
提交
5a108bbc
编写于
10月 28, 2015
作者:
M
Mateusz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #30 from kubernetes/simple-chrome
Implement simple chrome operating on ui.router
上级
dbea8e18
4c37e879
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
128 addition
and
32 deletion
+128
-32
bower.json
bower.json
+1
-1
build/script.js
build/script.js
+2
-0
src/app/frontend/chrome/chrome.controller.js
src/app/frontend/chrome/chrome.controller.js
+27
-0
src/app/frontend/chrome/chrome.directive.js
src/app/frontend/chrome/chrome.directive.js
+31
-0
src/app/frontend/chrome/chrome.html
src/app/frontend/chrome/chrome.html
+20
-0
src/app/frontend/chrome/chrome.module.js
src/app/frontend/chrome/chrome.module.js
+11
-4
src/app/frontend/index.html
src/app/frontend/index.html
+3
-2
src/app/frontend/index.module.js
src/app/frontend/index.module.js
+4
-2
src/app/frontend/index.route.js
src/app/frontend/index.route.js
+6
-3
src/app/frontend/index.scss
src/app/frontend/index.scss
+7
-3
src/app/frontend/main/main.controller.js
src/app/frontend/main/main.controller.js
+1
-1
src/app/frontend/main/main.html
src/app/frontend/main/main.html
+9
-11
src/app/frontend/main/main.module.js
src/app/frontend/main/main.module.js
+2
-2
src/app/frontend/main/main.state.js
src/app/frontend/main/main.state.js
+4
-3
未找到文件。
bower.json
浏览文件 @
5a108bbc
...
...
@@ -10,8 +10,8 @@
"angular-aria"
:
"~1.4.2"
,
"angular-material"
:
"~0.10.1"
,
"angular-messages"
:
"~1.4.2"
,
"angular-ui-router"
:
"~0.2.15"
,
"angular-resource"
:
"~1.4.2"
,
"angular-route"
:
"~1.4.2"
,
"angular-sanitize"
:
"~1.4.2"
},
"devDependencies"
:
{
...
...
build/script.js
浏览文件 @
5a108bbc
...
...
@@ -93,6 +93,8 @@ gulp.task('scripts', ['create-serve-folders'], function() {
'
google-closure-compiler/contrib/externs/angular-1.4-http-promise_templated.js
'
),
path
.
join
(
conf
.
paths
.
nodeModules
,
'
google-closure-compiler/contrib/externs/angular-1.4-q_templated.js
'
),
path
.
join
(
conf
.
paths
.
nodeModules
,
'
google-closure-compiler/contrib/externs/angular_ui_router.js
'
),
path
.
join
(
conf
.
paths
.
externs
,
'
**/*.js
'
),
],
// Enable all compiler checks by default and make them errors.
...
...
src/app/frontend/chrome/chrome.controller.js
0 → 100644
浏览文件 @
5a108bbc
// 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.
/**
* Controller for the chrome directive.
*
* @final
*/
export
default
class
ChromeController
{
constructor
()
{
// TODO(bryk): This is for tests only, change to something meaningful later.
/** @export {string} */
this
.
clusterName
=
'
ClusterName
'
;
}
}
src/app/frontend/chrome/chrome.directive.js
0 → 100644
浏览文件 @
5a108bbc
// 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
ChromeController
from
'
./chrome.controller
'
;
/**
* Returns directive definition object for the chrome directive.
*
* @return {!angular.Directive}
*/
export
default
function
chromeDirective
()
{
return
{
bindToController
:
true
,
controller
:
ChromeController
,
controllerAs
:
'
ctrl
'
,
templateUrl
:
'
chrome/chrome.html
'
,
transclude
:
true
,
};
}
src/app/frontend/chrome/chrome.html
0 → 100644
浏览文件 @
5a108bbc
<div>
<md-content>
<md-toolbar>
<div
class=
"md-toolbar-tools"
>
<md-button
class=
"md-icon-button"
aria-label=
"Settings"
>
<md-icon
md-font-library=
"material-icons"
>
menu
</md-icon>
</md-button>
<h2>
<span>
Kubernetes cluster: {{ctrl.clusterName}}
</span>
</h2>
<span
flex
></span>
<md-button
class=
"md-icon-button"
aria-label=
"Favorite"
>
<md-icon
md-font-library=
"material-icons"
>
more_vert
</md-icon>
</md-button>
</div>
</md-toolbar>
<div
ng-transclude
></div>
</md-content>
</div>
src/app/frontend/
main/main.scs
s
→
src/app/frontend/
chrome/chrome.module.j
s
浏览文件 @
5a108bbc
// 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.
...
...
@@ -12,8 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
chromeDirective
from
'
./chrome.directive
'
;
body
{
background-color
:
gray
;
}
/**
* Angular module containing navigation chrome for the application.
*/
export
default
angular
.
module
(
'
kubernetesConsole.chrome
'
,
[
'
ngMaterial
'
,
])
.
directive
(
'
chrome
'
,
chromeDirective
);
src/app/frontend/index.html
浏览文件 @
5a108bbc
...
...
@@ -26,8 +26,9 @@
experience.</p>
<![endif]-->
<div
ng-view
>
<!-- Application content is inserted here. -->
</div>
<chrome>
<div
ui-view
>
<!-- Application content is inserted here. -->
</div>
</chrome>
<!-- build:js console/vendor.js -->
<!-- bower:js -->
<!-- Bower JS dependencies are populated here (dev build) and compiled
...
...
src/app/frontend/index.module.js
浏览文件 @
5a108bbc
...
...
@@ -16,8 +16,9 @@
* @fileoverview Entry point module to the application. Loads and configures other modules needed
* to bootstrap the application.
*/
import
routeConfig
from
'
./index.rout
e
'
;
import
chromeModule
from
'
./chrome/chrome.modul
e
'
;
import
mainModule
from
'
./main/main.module
'
;
import
routeConfig
from
'
./index.route
'
;
export
default
angular
.
module
(
'
kubernetesConsole
'
,
...
...
@@ -27,8 +28,9 @@ export default angular.module(
'
ngMaterial
'
,
'
ngMessages
'
,
'
ngResource
'
,
'
ngRoute
'
,
'
ngSanitize
'
,
'
ui.router
'
,
chromeModule
.
name
,
mainModule
.
name
,
])
.
config
(
routeConfig
);
src/app/frontend/index.route.js
浏览文件 @
5a108bbc
...
...
@@ -14,9 +14,12 @@
/**
* @param {!angular.$routeProvider} $routeProvider
* Global route configuration for the application.
*
* @param {!ui.router.$urlRouterProvider} $urlRouterProvider
* @ngInject
*/
export
default
function
routeConfig
(
$routeProvider
)
{
// TODO(bryk): Configure 'otherwise' route here.
export
default
function
routeConfig
(
$urlRouterProvider
)
{
// When no state is matched by an URL, redirect to default one.
$urlRouterProvider
.
otherwise
(
''
);
}
src/app/frontend/index.scss
浏览文件 @
5a108bbc
...
...
@@ -12,8 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Robo Slab font.
@import
url(//fonts.googleapis.com/css?family=Roboto+Slab:400,700|Roboto:400,700,700italic,400italic)
;
body
{
border
:
1px
solid
red
;
}
// Angular Material icon font. It allows to use the icons as fonts.
@import
url(//fonts.googleapis.com/icon?family=Material+Icons)
;
html
{
font-family
:
'Roboto Slab'
,
serif
;
}
src/app/frontend/main/main.controller.js
浏览文件 @
5a108bbc
// 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.
...
...
src/app/frontend/main/main.html
浏览文件 @
5a108bbc
<div
layout=
"vertical"
layout-fill
>
<md-content>
<header>
Hello world! {{ctrl.testValue}}
</header>
<header>
Hello world! {{ctrl.testValue}}
</header>
<section
class=
"jumbotron"
>
<h1>
'Allo, 'Allo!
</h1>
<p
class=
"lead"
>
<img
src=
"assets/images/yeoman.png"
alt=
"I'm Yeoman"
><br>
</p>
</section>
</md-content>
<section
class=
"jumbotron"
>
<h1>
'Allo, 'Allo!
</h1>
<p
class=
"lead"
>
<img
src=
"assets/images/yeoman.png"
alt=
"I'm Yeoman"
><br>
</p>
</section>
</div>
src/app/frontend/main/main.module.js
浏览文件 @
5a108bbc
...
...
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import
routeConfig
from
'
./main.rou
te
'
;
import
stateConfig
from
'
./main.sta
te
'
;
export
default
angular
.
module
(
'
kubernetesConsole.main
'
,
[])
.
config
(
rou
teConfig
);
.
config
(
sta
teConfig
);
src/app/frontend/main/main.
rou
te.js
→
src/app/frontend/main/main.
sta
te.js
浏览文件 @
5a108bbc
...
...
@@ -16,11 +16,12 @@ import MainController from './main.controller';
/**
* @param {!
angular.$routeProvider} $rou
teProvider
* @param {!
ui.router.$stateProvider} $sta
teProvider
* @ngInject
*/
export
default
function
routeConfig
(
$routeProvider
)
{
$routeProvider
.
when
(
'
/
'
,
{
export
default
function
stateConfig
(
$stateProvider
)
{
$stateProvider
.
state
(
'
main
'
,
{
url
:
''
,
templateUrl
:
'
main/main.html
'
,
controller
:
MainController
,
controllerAs
:
'
ctrl
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录