diff --git a/.travis.yml b/.travis.yml index 922b7cbad9eeb79f277eb2af1a646ba2ee256ab3..475cc08ea93899fcb77acf10d48f9acf07122b69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,10 @@ # Explicitly set the environment to be container-based. This makes the builds faster. sudo: false +# Cache downloaded Node.JS modules in the node_modules directory for faster builds. +cache: + directories: + - node_modules # Use Node.js as primary language because Gulp is the build system used in the project. language: node_js before_script: diff --git a/README.md b/README.md index fa3c04c261a589b77dafad21f7d4fb35d463d151..63c618765b1b8181e41f0fa2f83d23f0450e0726 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,19 @@ -# Kubernetes Console +# Kubernetes Dashboard [![Build Status](https://travis-ci.org/kubernetes/console.svg?branch=master)](https://travis-ci.org/kubernetes/console) -Kubernetes Console is a general purpose, web-based UI for Kubernetes clusters. It allows to manage applications running in the cluster, troubleshoot them, as well as, manage the cluster itself. +Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows to +manage applications running in the cluster, troubleshoot them, as well as, manage the cluster +itself. -The console is currently under active development and is not ready for production use (yet!). +The dashboard is currently under active development and is not ready for production use (yet!). # Contribute -Wish to contribute !! Great start [here](https://github.com/kubernetes/console/blob/master/CONTRIBUTING.md). +Wish to contribute !! Great start [here](CONTRIBUTING.md). # License -The work done has been licensed under Apache License 2.0.The license file can be found [here](https://github.com/kubernetes/console/blob/master/LICENSE). You can find out more about license,at +The work done has been licensed under Apache License 2.0. The license file can be found +[here](LICENSE). You can find out more about the license at: http://www.apache.org/licenses/LICENSE-2.0 diff --git a/bower.json b/bower.json index bd0c8d815a13abb9b5fe34c3034f58f365015ce7..9f886fe9fd3371d77060c84469ad2c854a3eb701 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,7 @@ "//": "Specification of this file can be found at:", "//": "https://github.com/bower/spec/blob/master/json.md", - "name": "kubernetes-console", + "name": "kubernetes-dashboard", "version": "0.0.1", "dependencies": { "angular": "~1.4.2", @@ -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": { diff --git a/build/backend.js b/build/backend.js index 80291c86f5ed9745ff2d835178fae2292bd17d72..f60404fbe7e9b63d56e4f1dcc39310c374f168bd 100644 --- a/build/backend.js +++ b/build/backend.js @@ -69,27 +69,27 @@ function spawnGoProcess(args, doneFn, opt_env) { /** - * Compiles backend application in development mode and places 'console' binary in the serve + * Compiles backend application in development mode and places the binary in the serve * directory. */ gulp.task('backend', ['backend-dependencies'], function(doneFn) { spawnGoProcess([ 'build', - '-o', path.join(conf.paths.serve, 'console'), - path.join(conf.paths.backendSrc, 'console.go'), + '-o', path.join(conf.paths.serve, 'dashboard'), + path.join(conf.paths.backendSrc, 'dashboard.go'), ], doneFn); }); /** - * Compiles backend application in production mode and places 'console' binary in the dist + * Compiles backend application in production mode and places the binary in the dist * directory. * * The production binary difference from development binary is only that it contains all * dependencies inside it and is targeted for Linux. */ gulp.task('backend:prod', ['backend-dependencies'], function(doneFn) { - let outputBinaryPath = path.join(conf.paths.dist, 'console'); + let outputBinaryPath = path.join(conf.paths.dist, 'dashboard'); // Delete output binary first. This is required because prod build does not override it. del(outputBinaryPath) .then(function() { @@ -98,7 +98,7 @@ gulp.task('backend:prod', ['backend-dependencies'], function(doneFn) { '-a', '-installsuffix', 'cgo', '-o', outputBinaryPath, - path.join(conf.paths.backendSrc, 'console.go'), + path.join(conf.paths.backendSrc, 'dashboard.go'), ], doneFn, { // Disable cgo package. Required to run on scratch docker image. CGO_ENABLED: '0', diff --git a/build/conf.js b/build/conf.js index c95cd8452f465a44c599d31f0c75ec4538a84438..61de6ceb98cc727f2e90abb5af1be8b68c703641 100644 --- a/build/conf.js +++ b/build/conf.js @@ -35,7 +35,7 @@ export default { /** * The name of the Docker image with the application. */ - imageName: 'kubernetes/console', + imageName: 'kubernetes/dashboard', }, /** @@ -45,7 +45,7 @@ export default { /** * The name of the root Angular module, i.e., the module that bootstraps the application. */ - rootModuleName: 'kubernetesConsole', + rootModuleName: 'kubernetesDashboard', }, /** diff --git a/build/script.js b/build/script.js index e8418742a7363009e3ee582ccd2bd2e6d8a91cb4..0418462401e48b9dc78b6ba6a8ee135e3eaa5532 100644 --- a/build/script.js +++ b/build/script.js @@ -20,59 +20,32 @@ import gulpAngularTemplatecache from 'gulp-angular-templatecache'; import gulpClosureCompiler from 'gulp-closure-compiler'; import gulpEslint from 'gulp-eslint'; import gulpMinifyHtml from 'gulp-minify-html'; -import lodash from 'lodash'; import path from 'path'; +import webpackStream from 'webpack-stream'; import conf from './conf'; -/** - * Base Closure Compiler config to be extended in, e.g., prod or dev config. - */ -const closureCompilerBaseConfig = { - // "foo_flag: null" means that a flag is enabled. - compilerFlags: { - angular_pass: null, - closure_entry_point: 'module$src$app$frontend$index_module', - export_local_property_definitions: null, - generate_exports: null, - js_module_root: conf.paths.frontendSrc, - language_in: 'ECMASCRIPT6_STRICT', - language_out: 'ECMASCRIPT3', - manage_closure_dependencies: true, - }, - compilerPath: path.join(conf.paths.nodeModules, 'google-closure-compiler/compiler.jar'), - // This makes the compiler faster. Requires Java 7+. - tieredCompilation: true, -}; - - /** * Compiles frontend JavaScript files into development bundle located in {conf.paths.serve} * directory. This has to be done because currently browsers do not handle ES6 syntax and * modules correctly. * - * Note that 'create-serve-folders' task is required because closure compiler source maps function - * requires the folders to exist upfront. + * Only dependencies of root application module are included in the bundle. */ gulp.task('scripts', ['create-serve-folders'], function() { - let bundleBaseName = 'app-dev'; - let closureCompilerConfig = lodash.merge({ - fileName: `${bundleBaseName}.js`, - compilerFlags: { - // WHITESPACE_ONLY is not an option because it leaves ES6 modules unmodified. ES6 modules - // arent handled by browsers correctly (yet). - compilation_level: 'SIMPLE_OPTIMIZATIONS', - create_source_map: path.join(conf.paths.serve, `${bundleBaseName}.js.map`), - // Make source map URLs relative to frontend source directory. - source_map_location_mapping: path.relative(conf.paths.base, conf.paths.frontendSrc) + '|', - // Include source map in the output bundle. - output_wrapper: '%output%\n//# sourceMappingURL=' + `${bundleBaseName}.js.map`, - }, - }, closureCompilerBaseConfig); - - return gulp.src(path.join(conf.paths.frontendSrc, '**/*.js')) - .pipe(gulpClosureCompiler(closureCompilerConfig)) + let webpackOptions = { + devtool: 'inline-source-map', + module: { + // ES6 modules have to be preprocessed with Babel loader to work in browsers. + loaders: [{test: /\.js$/, exclude: /node_modules/, loaders: ['babel-loader']}], + }, + output: {filename: 'app-dev.js'}, + quiet: true, + }; + + return gulp.src(path.join(conf.paths.frontendSrc, 'index.module.js')) + .pipe(webpackStream(webpackOptions)) .pipe(gulp.dest(conf.paths.serve)) }); @@ -82,31 +55,47 @@ gulp.task('scripts', ['create-serve-folders'], function() { * directory. */ gulp.task('scripts:prod', ['angular-templates'], function() { - let closureCompilerConfig = lodash.merge({ - fileName: 'app.js', - compilerFlags: { - compilation_level: 'ADVANCED_OPTIMIZATIONS', - externs: [ - path.join(conf.paths.nodeModules, - 'google-closure-compiler/contrib/externs/angular-1.4.js'), - path.join(conf.paths.nodeModules, - '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.externs, '**/*.js'), - ], - // Enable all compiler checks by default and make them errors. - jscomp_error: '*', - // Disable checks that are not applicable to the project. - jscomp_off: [ - // This check does not work correctly with ES6. - 'inferredConstCheck', - // Let ESLint handle all lint checks. - 'lintChecks', - ], - use_types_for_optimization: null, - }, - }, closureCompilerBaseConfig); + let closureCompilerConfig = { + fileName: 'app.js', + // "foo_flag: null" means that a flag is enabled. + compilerFlags: { + angular_pass: null, + closure_entry_point: 'module$src$app$frontend$index_module', + compilation_level: 'ADVANCED_OPTIMIZATIONS', + export_local_property_definitions: null, + externs: [ + path.join(conf.paths.nodeModules, + 'google-closure-compiler/contrib/externs/angular-1.4.js'), + path.join(conf.paths.nodeModules, + '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-material.js'), + path.join(conf.paths.nodeModules, + 'google-closure-compiler/contrib/externs/angular_ui_router.js'), + path.join(conf.paths.externs, '**/*.js'), + ], + generate_exports: null, + js_module_root: conf.paths.frontendSrc, + // Enable all compiler checks by default and make them errors. + jscomp_error: '*', + // Disable checks that are not applicable to the project. + jscomp_off: [ + // This check does not work correctly with ES6. + 'inferredConstCheck', + // Let ESLint handle all lint checks. + 'lintChecks', + ], + language_in: 'ECMASCRIPT6_STRICT', + language_out: 'ECMASCRIPT3', + manage_closure_dependencies: true, + use_types_for_optimization: null, + }, + compilerPath: path.join(conf.paths.nodeModules, 'google-closure-compiler/compiler.jar'), + // This makes the compiler faster. Requires Java 7+. + tieredCompilation: true, + }; return gulp.src([ // Application source files. diff --git a/package.json b/package.json index ce7f5c882bbc07aa78486f8c3c5ea101fbd24c72..bfe85f7173a85cc10334a612ab6cb10dc202bb92 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "//": "Specification of this file can be found at: https://docs.npmjs.com/files/package.json", "//": "When a dependency is not needed it should be removed from the list.", - - "name": "kubernetes-console", + "name": "kubernetes-dashboard", "version": "0.0.1", "devDependencies": { "babel": "~5.8.23", "babel-core": "~5.8.25", + "babel-loader": "~5.3.2", "babelify": "~6.3.0", "browserify": "~11.2.0", "browser-sync": "~2.9.2", @@ -49,6 +49,7 @@ "karma-sourcemap-loader": "~0.3.6", "lodash": "~3.10.1", "uglify-save-license": "~0.4.1", + "webpack-stream": "~2.1.1", "wiredep": "~2.2.2", "wrench": "~1.5.8" }, diff --git a/src/app/assets/images/kubernetes-logo.svg b/src/app/assets/images/kubernetes-logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..a1f72108cda3f8cc09116258fba062b258580735 --- /dev/null +++ b/src/app/assets/images/kubernetes-logo.svg @@ -0,0 +1,67 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/app/assets/images/yeoman.png b/src/app/assets/images/yeoman.png deleted file mode 100644 index 92497addf96c5c009ac24007f55eb989f3bf74c6..0000000000000000000000000000000000000000 Binary files a/src/app/assets/images/yeoman.png and /dev/null differ diff --git a/src/app/backend/console.go b/src/app/backend/dashboard.go similarity index 54% rename from src/app/backend/console.go rename to src/app/backend/dashboard.go index 76d88c732130e72afa6a18900bbe9f7adaca5c56..2c950a97bfbd0c82e5e8794d0f0c89a83cfeecec 100644 --- a/src/app/backend/console.go +++ b/src/app/backend/dashboard.go @@ -15,26 +15,26 @@ package main import ( - "flag" - "fmt" - "net/http" + "flag" + "fmt" + "net/http" - "github.com/golang/glog" - "github.com/spf13/pflag" + "github.com/golang/glog" + "github.com/spf13/pflag" ) var ( - argPort = pflag.Int("port", 8080, "The port to listen to for incomming HTTP requests") + argPort = pflag.Int("port", 8080, "The port to listen to for incomming HTTP requests") ) func main() { - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - glog.Info("Starting HTTP server on port ", *argPort) - defer glog.Flush(); + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + glog.Info("Starting HTTP server on port ", *argPort) + defer glog.Flush() - // Run a HTTP server that serves static files from current directory. - // TODO(bryk): Disable directory listing. - http.Handle("/", http.FileServer(http.Dir("./"))) - glog.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *argPort), nil)) + // Run a HTTP server that serves static files from current directory. + // TODO(bryk): Disable directory listing. + http.Handle("/", http.FileServer(http.Dir("./"))) + glog.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *argPort), nil)) } diff --git a/src/app/deploy/Dockerfile b/src/app/deploy/Dockerfile index 49d2009a5a2229c6bc2de4a40020961f1bb3ed30..bb111019e16b04b2c206e6575ac5101ba6cb8e6d 100644 --- a/src/app/deploy/Dockerfile +++ b/src/app/deploy/Dockerfile @@ -27,4 +27,4 @@ ADD . / # The port that the application listens on. # TODO(bryk): Parametrize this argument so that other build tools are aware of the exposed port. EXPOSE 8080 -ENTRYPOINT ["/console"] +ENTRYPOINT ["/dashboard"] diff --git a/src/app/frontend/chrome/chrome.controller.js b/src/app/frontend/chrome/chrome.controller.js new file mode 100644 index 0000000000000000000000000000000000000000..e837cffd8ff0b8d9de94ace206373529b93d075b --- /dev/null +++ b/src/app/frontend/chrome/chrome.controller.js @@ -0,0 +1,27 @@ +// 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'; + } +} diff --git a/src/app/frontend/chrome/chrome.directive.js b/src/app/frontend/chrome/chrome.directive.js new file mode 100644 index 0000000000000000000000000000000000000000..ff456e3b3c5de010752c7c6308835ef740023986 --- /dev/null +++ b/src/app/frontend/chrome/chrome.directive.js @@ -0,0 +1,31 @@ +// 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, + }; +} diff --git a/src/app/frontend/chrome/chrome.html b/src/app/frontend/chrome/chrome.html new file mode 100644 index 0000000000000000000000000000000000000000..049c3b2e766dc78d91f87ffb15d0a0fc576cdc04 --- /dev/null +++ b/src/app/frontend/chrome/chrome.html @@ -0,0 +1,17 @@ + + +
+ + + +

+ kubernetes +

+ + + more_vert + +
+
+
+
diff --git a/src/app/frontend/chrome/chrome.module.js b/src/app/frontend/chrome/chrome.module.js new file mode 100644 index 0000000000000000000000000000000000000000..c14b812889efb28d968db84984615ed6d89a00c6 --- /dev/null +++ b/src/app/frontend/chrome/chrome.module.js @@ -0,0 +1,26 @@ +// 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 chromeDirective from './chrome.directive'; + + +/** + * Angular module containing navigation chrome for the application. + */ +export default angular.module( + 'kubernetesDashboard.chrome', + [ + 'ngMaterial', + ]) + .directive('chrome', chromeDirective); diff --git a/src/app/frontend/main/main.scss b/src/app/frontend/chrome/chrome.scss similarity index 84% rename from src/app/frontend/main/main.scss rename to src/app/frontend/chrome/chrome.scss index 437b7963cab034cb23f350f944cde854c973348a..7cb342374c025dd8467a3a83d1e649e06f6259a6 100644 --- a/src/app/frontend/main/main.scss +++ b/src/app/frontend/chrome/chrome.scss @@ -1,4 +1,4 @@ -// 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,7 @@ // See the License for the specific language governing permissions and // limitations under the License. - -body { - background-color: gray; +.kd-toolbar-logo { + height: 42px; + width: 42px; } - diff --git a/src/app/frontend/index.config.js b/src/app/frontend/index.config.js index 351031e14210a161b2ce3d8666b2de76f70b7af8..91f75017dad01cc92614dd6c8fc88c2d4722b6a2 100644 --- a/src/app/frontend/index.config.js +++ b/src/app/frontend/index.config.js @@ -14,7 +14,17 @@ /** + * @param {!md.$mdThemingProvider} $mdThemingProvider * @ngInject */ -export function config() { +export default function config($mdThemingProvider) { + // Create a color palette that uses Kubernetes colors. + let kubernetesColorPaletteName = 'kubernetesColorPalette'; + let kubernetesColorPalette = $mdThemingProvider.extendPalette('blue', { + '500': '326de6', + }); + + // Use the palette as default one. + $mdThemingProvider.definePalette(kubernetesColorPaletteName, kubernetesColorPalette); + $mdThemingProvider.theme('default').primaryPalette(kubernetesColorPaletteName); } diff --git a/src/app/frontend/index.html b/src/app/frontend/index.html index 7e2580c664731caad5f1dc2d8b0ff9a1be08af4d..0459a5caa1911e723563dce27b8089e3628ca144 100644 --- a/src/app/frontend/index.html +++ b/src/app/frontend/index.html @@ -1,18 +1,19 @@ - + + - Kubernetes Console + Kubernetes Dashboard - + - + @@ -26,16 +27,17 @@ experience.

-
- - + +
+
+ - + diff --git a/src/app/frontend/index.module.js b/src/app/frontend/index.module.js index 38483a3c9ef827015acbbbf9ea579ecdd9eb6918..b41ba20113b95cf57ce1646c934d48c158997cb0 100644 --- a/src/app/frontend/index.module.js +++ b/src/app/frontend/index.module.js @@ -16,19 +16,24 @@ * @fileoverview Entry point module to the application. Loads and configures other modules needed * to bootstrap the application. */ -import routeConfig from './index.route'; +import chromeModule from './chrome/chrome.module'; import mainModule from './main/main.module'; +import indexConfig from './index.config'; +import routeConfig from './index.route'; + export default angular.module( - 'kubernetesConsole', + 'kubernetesDashboard', [ 'ngAnimate', 'ngAria', 'ngMaterial', 'ngMessages', 'ngResource', - 'ngRoute', 'ngSanitize', + 'ui.router', + chromeModule.name, mainModule.name, ]) + .config(indexConfig) .config(routeConfig); diff --git a/src/app/frontend/index.route.js b/src/app/frontend/index.route.js index 27b4af917fe91f5281dc627d3c0b5f8174d44814..13d3732ac4c009da32ae40855399a2dd655bea42 100644 --- a/src/app/frontend/index.route.js +++ b/src/app/frontend/index.route.js @@ -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('/'); } diff --git a/src/app/frontend/index.scss b/src/app/frontend/index.scss index 89d5bb53849e2b59968f45c94f591490a10157f9..2d2226a6ac0961ddc088a6fb8ae603145c7a079f 100644 --- a/src/app/frontend/index.scss +++ b/src/app/frontend/index.scss @@ -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; +} diff --git a/src/app/frontend/main/main.controller.js b/src/app/frontend/main/main.controller.js index 88c78cd7178c1e68d2218e10156a3f4ea44c3788..b5e424348c4ba787a6e36b6c6e51c3ff3c601ec9 100644 --- a/src/app/frontend/main/main.controller.js +++ b/src/app/frontend/main/main.controller.js @@ -1,4 +1,4 @@ -// 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. diff --git a/src/app/frontend/main/main.html b/src/app/frontend/main/main.html index 6868f149885be40c9ef2672ec430db9fb13649ba..aea01a916c89025b240b87aaa1cfb3fde225eaa6 100644 --- a/src/app/frontend/main/main.html +++ b/src/app/frontend/main/main.html @@ -1,14 +1,5 @@
- -
- Hello world! {{ctrl.testValue}} -
- -
-

'Allo, 'Allo!

-

- I'm Yeoman
-

-
-
+
+ Page content goes here. +
diff --git a/src/app/frontend/main/main.module.js b/src/app/frontend/main/main.module.js index 2db1118c2c26dfc8a6008647a17765618b861181..39a3074ad0b68a6b36c9eda24ca2f2f0bd2be2a1 100644 --- a/src/app/frontend/main/main.module.js +++ b/src/app/frontend/main/main.module.js @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import routeConfig from './main.route'; +import stateConfig from './main.state'; -export default angular.module('kubernetesConsole.main', []) - .config(routeConfig); +export default angular.module('kubernetesDashboard.main', []) + .config(stateConfig); diff --git a/src/app/frontend/main/main.route.js b/src/app/frontend/main/main.state.js similarity index 83% rename from src/app/frontend/main/main.route.js rename to src/app/frontend/main/main.state.js index 63c51805ebc5c6191ca3cd67bf4e452a364d7954..83e7fb6c11104dee94bdca78947c661468ad96f1 100644 --- a/src/app/frontend/main/main.route.js +++ b/src/app/frontend/main/main.state.js @@ -16,11 +16,12 @@ import MainController from './main.controller'; /** - * @param {!angular.$routeProvider} $routeProvider + * @param {!ui.router.$stateProvider} $stateProvider * @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', diff --git a/src/test/integration/main.po.js b/src/test/integration/main.po.js index 86815b459a383cc5cff8f3194eda85e12cfa4c94..98e3a4ccfcbf1451012e503ce6daed7de21ff75f 100644 --- a/src/test/integration/main.po.js +++ b/src/test/integration/main.po.js @@ -18,9 +18,8 @@ */ -export class MainPage { +export default class MainPage { constructor() { - this.jumbEl = element(by.css('.jumbotron')); - this.h1El = this.jumbEl.element(by.css('h1')); + this.header = element(by.css('header')); } } diff --git a/src/test/integration/main.test.js b/src/test/integration/main.test.js index de1ec3c9f47f70fef3fb26afc0cc6635ad7fb2e2..0bd0991797ae1060b4128660fe76a6d255b44fd0 100644 --- a/src/test/integration/main.test.js +++ b/src/test/integration/main.test.js @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {MainPage} from './main.po'; +import MainPage from './main.po'; describe('The main view', function () { @@ -24,7 +24,7 @@ describe('The main view', function () { }); it('should do something', function() { - expect(page.h1El.getText()).toBe('\'Allo, \'Allo!'); + expect(page.header.getText()).toBe('Page content goes here.'); }); });