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 @@
+
+
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 @@
+
-
-