提交 83312e7f 编写于 作者: B bryk

Merge branch 'master' into travis-status

......@@ -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:
......
# 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
......@@ -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": {
......
......@@ -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',
......
......@@ -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',
},
/**
......
......@@ -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`,
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']}],
},
}, closureCompilerBaseConfig);
output: {filename: 'app-dev.js'},
quiet: true,
};
return gulp.src(path.join(conf.paths.frontendSrc, '**/*.js'))
.pipe(gulpClosureCompiler(closureCompilerConfig))
return gulp.src(path.join(conf.paths.frontendSrc, 'index.module.js'))
.pipe(webpackStream(webpackOptions))
.pipe(gulp.dest(conf.paths.serve))
});
......@@ -82,10 +55,14 @@ gulp.task('scripts', ['create-serve-folders'], function() {
* directory.
*/
gulp.task('scripts:prod', ['angular-templates'], function() {
let closureCompilerConfig = lodash.merge({
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'),
......@@ -93,8 +70,14 @@ 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-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.
......@@ -104,9 +87,15 @@ gulp.task('scripts', ['create-serve-folders'], function() {
// Let ESLint handle all lint checks.
'lintChecks',
],
language_in: 'ECMASCRIPT6_STRICT',
language_out: 'ECMASCRIPT3',
manage_closure_dependencies: true,
use_types_for_optimization: null,
},
}, closureCompilerBaseConfig);
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.
......
{
"//": "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"
},
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="138"
height="138"
viewBox="0 0 138 138"
version="1.1"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="kubernetes-logo.svg">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1302"
inkscape:window-height="986"
id="namedview10"
showgrid="false"
inkscape:zoom="4.8022216"
inkscape:cx="37.497947"
inkscape:cy="70.783482"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="svg2"
showguides="true"
inkscape:guide-bbox="true" />
<path
d="m 68.412486,0.0131505 c -1.87585,0.085749 -3.713659,0.5614659 -5.397457,1.3971207 l 0.0098,-0.015637 -44.441074,21.9162378 c -3.698096,1.82352 -6.373794,5.235066 -7.275003,9.275712 L 0.32911014,81.843412 c -0.89054164,3.994203 0.0474751,8.17939 2.55587196,11.403634 L 33.635135,132.75333 c 2.574935,3.30735 6.520072,5.24002 10.697734,5.24067 L 93.654395,138 c 4.178011,4.2e-4 8.123925,-1.93156 10.699675,-5.23872 l 30.75792,-39.498462 c 2.50976,-3.223594 3.44922,-7.408844 2.55977,-11.403634 L 126.70191,32.600267 c -0.90025,-4.04099 -3.57524,-7.453274 -7.27305,-9.277666 L 74.993613,1.396594 C 72.94982,0.3884666 70.686834,-0.08724418 68.412486,0.0131505 l 0,0 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
<path
d="m 68.632116,5.0525561 c -1.18267,0.053604 -2.341461,0.3530009 -3.403294,0.8793078 l 0.0059,-0.0078 -44.441074,21.9162381 c -2.33196,1.150361 -4.019009,3.302064 -4.586964,5.850322 L 5.2251113,82.945476 c -0.5615737,2.519474 0.030505,5.159338 1.6132119,7.192731 L 37.586533,129.64449 c 1.623995,2.08543 4.111893,3.30397 6.746336,3.30424 l 49.323469,0.006 c 2.634444,-2.7e-4 5.122342,-1.21879 6.746332,-3.30424 L 131.1606,90.153979 c 1.58271,-2.033393 2.17478,-4.673257 1.61321,-7.192731 L 121.80397,33.702332 c -0.56752,-2.547871 -2.25381,-4.699502 -4.58502,-5.850322 L 72.783707,5.9260012 C 71.494516,5.2896882 70.06692,4.9893393 68.632116,5.0525561 l 0,0 z"
id="path6"
inkscape:connector-curvature="0"
style="fill:#336ee5" />
<path
d="m 69.003349,21.741803 c -1.457274,0 -2.63629,1.345868 -2.654997,3.013092 l -0.0039,0 c 6.84e-4,0.240951 -0.01063,0.587259 -0.002,0.818732 0.03533,0.972423 0.240435,1.718234 0.363459,2.614473 0.224278,1.91671 0.412686,3.505926 0.297376,4.982739 -0.105736,0.739243 -0.519728,1.031803 -0.864915,1.373674 l 0.06609,0.04494 -0.06997,0 0,0.0039 -0.06609,1.193904 c -8.468094,0.77324 -16.320356,4.757588 -22.093162,10.981576 l -0.993194,-0.726893 -0.0447,0.05667 0.0078,-0.08402 c -0.475053,0.06591 -0.953032,0.219467 -1.578226,-0.156321 -1.190057,-0.827376 -2.275112,-1.970626 -3.587939,-3.347229 -0.600077,-0.65779 -1.035257,-1.287959 -1.749266,-1.922751 -0.155989,-0.138084 -0.389855,-0.321346 -0.569484,-0.46701 -0.0076,-0.0063 -0.01379,-0.01329 -0.02137,-0.01954 -1.276013,-1.05105 -3.054444,-0.941567 -3.970835,0.244251 -0.907968,1.175969 -0.624338,2.966234 0.623905,4.021364 l -0.002,0.0039 c 0.182976,0.150443 0.438773,0.377365 0.620018,0.51586 0.757427,0.577878 1.451079,0.875425 2.206019,1.334592 1.590226,1.014692 2.910971,1.852362 3.957227,2.86654 0.493588,0.545631 0.455729,1.063084 0.499513,1.555397 l 0.07386,-0.0254 -0.04276,0.05667 0.882408,0.814824 c -2.308424,3.53103 -4.041087,7.538026 -5.014562,11.915586 -0.965493,4.340686 -1.106105,8.682181 -0.540329,12.853514 l -1.032067,0.306781 0.01555,0.06644 -0.05636,-0.05472 c -0.246047,0.424608 -0.430146,0.907704 -1.103982,1.178271 -1.36843,0.444651 -2.910384,0.609855 -4.769665,0.810917 -0.872982,0.07503 -1.62287,0.03132 -2.548098,0.212988 -0.208741,0.04044 -0.502763,0.120542 -0.726916,0.173907 -0.0033,7.64e-4 -0.0065,0.0012 -0.0098,0.002 -0.0035,8.16e-4 -0.0063,0.0031 -0.0098,0.0039 -0.0082,0.0019 -0.01926,0.004 -0.02721,0.0059 l 0,0.002 c -1.569346,0.389003 -2.576559,1.877852 -2.252666,3.345275 0.324218,1.467109 1.856784,2.355871 3.434392,2.004819 l 0,0.002 c 0.01133,-0.0027 0.02707,-0.0051 0.03887,-0.0078 0.0041,-9.61e-4 0.0076,-0.0029 0.01166,-0.0039 0.224815,-0.05179 0.522805,-0.111588 0.726917,-0.168045 0.909304,-0.251296 1.5672,-0.623942 2.384832,-0.947698 1.759898,-0.652264 3.21757,-1.195293 4.637498,-1.406891 0.721105,-0.0591 1.089035,0.29273 1.48882,0.564711 l 0.02721,-0.07621 0.01555,0.07034 1.061222,-0.185632 c 2.562167,8.252006 7.997135,15.398189 15.385766,19.87039 l -0.443148,1.10401 0.06414,0.0312 -0.08163,0.0117 c 0.167427,0.46277 0.4199,0.91037 0.204081,1.62379 -0.516974,1.38315 -1.354557,2.73029 -2.36151,4.35746 -0.487367,0.75209 -0.985903,1.33032 -1.426623,2.19044 -0.09692,0.18947 -0.217188,0.46796 -0.314868,0.68195 -0.0036,0.008 -0.0082,0.0139 -0.01166,0.0215 -0.0039,0.008 -0.0059,0.017 -0.0098,0.0254 -0.0019,0.004 -0.004,0.01 -0.0059,0.0137 l 0.002,0 c -0.681638,1.50981 -0.184608,3.25083 1.127304,3.90412 1.323654,0.65843 2.970505,-0.0395 3.67929,-1.55735 0.0039,-0.008 0.0059,-0.017 0.0098,-0.0254 0.101145,-0.2122 0.237476,-0.48328 0.320699,-0.67805 0.376534,-0.89264 0.503276,-1.65665 0.767733,-2.51872 0.604047,-1.8278 1.102305,-3.34191 1.827012,-4.62124 0.405766,-0.61914 0.90113,-0.69504 1.356653,-0.84805 l -0.04276,-0.0723 0.06414,0.0312 0.577258,-1.07666 c 1.451782,0.5621 2.952176,1.03828 4.507275,1.40299 6.905992,1.61921 13.806806,0.96588 19.976618,-1.46552 l 0.633623,1.18413 0.0622,-0.0312 -0.04082,0.0703 c 0.455522,0.15339 0.951135,0.23089 1.356652,0.85 0.724584,1.27819 1.223338,2.79343 1.827012,4.62124 0.26483,0.86207 0.390452,1.62763 0.767733,2.51873 0.08217,0.19612 0.218256,0.46421 0.318756,0.67609 0.0039,0.008 0.0058,0.017 0.0098,0.0254 0.70779,1.51895 2.356258,2.21786 3.67929,1.5593 1.31338,-0.652 1.811998,-2.39392 1.129249,-3.90412 l 0.002,-0.002 c -0.0048,-0.0102 -0.01064,-0.0245 -0.01555,-0.0352 -9.95e-4,-0.002 -0.0029,-0.004 -0.0039,-0.006 -0.09896,-0.21526 -0.223734,-0.50493 -0.322643,-0.69954 -0.440347,-0.86052 -0.939008,-1.43848 -1.426624,-2.19044 -1.007077,-1.62688 -1.84466,-2.97546 -2.361509,-4.35746 -0.215819,-0.71342 0.03553,-1.15987 0.204081,-1.62379 l -0.07969,-0.0117 0.06414,-0.0312 -0.501456,-1.25447 C 93.610028,97.600349 99.212272,90.712584 101.89149,82.206861 l 1.13703,0.199309 0.0155,-0.06839 0.0272,0.07621 c 0.40054,-0.272365 0.76772,-0.625761 1.48881,-0.566664 1.41956,0.211597 2.87725,0.754626 4.63751,1.406891 0.81763,0.323755 1.47477,0.697585 2.38482,0.949652 0.20506,0.0557 0.50617,0.117816 0.73081,0.169999 0.003,6.29e-4 0.005,0.0013 0.008,0.002 0.003,6.26e-4 0.005,0.0013 0.008,0.002 0.009,0.002 0.0207,0.0038 0.0292,0.0059 l 0,-0.002 c 1.57732,0.353575 3.11125,-0.536988 3.43633,-2.00482 0.32389,-1.466275 -0.68368,-2.95515 -2.25266,-3.345274 l 0,-0.002 c -0.011,-0.0026 -0.0256,-0.007 -0.0369,-0.0098 -0.003,-7.77e-4 -0.006,-0.0012 -0.01,-0.002 -0.22466,-0.05433 -0.51923,-0.132746 -0.72692,-0.173907 -0.92633,-0.180892 -1.67512,-0.140042 -2.5481,-0.214942 -1.85929,-0.201833 -3.40147,-0.365881 -4.76967,-0.810917 -0.67481,-0.27031 -0.85623,-0.75158 -1.10203,-1.176317 l -0.0583,0.05667 0.0155,-0.06839 -1.07871,-0.322412 C 104.49,67.374572 102.37811,58.599254 97.790487,51.493602 l 0.829929,-0.767928 -0.04276,-0.05471 0.0758,0.0254 c 0.04342,-0.492442 0.0039,-1.009764 0.497577,-1.555395 1.045757,-1.014178 2.366627,-1.852364 3.957227,-2.866542 0.75531,-0.458525 1.4486,-0.756971 2.20601,-1.334592 0.1673,-0.1272 0.39147,-0.326327 0.56949,-0.474825 0.007,-0.0055 0.0147,-0.0082 0.0214,-0.01368 1.27615,-1.05105 1.56764,-2.864854 0.65112,-4.050674 -0.90761,-1.176519 -2.66253,-1.289664 -3.93585,-0.2677 l -0.002,-0.002 c -0.18299,0.151471 -0.45166,0.357371 -0.62196,0.509999 -0.714,0.634407 -1.15002,1.266273 -1.75122,1.924705 -1.311316,1.375833 -2.397872,2.517898 -3.58793,3.345275 -0.625193,0.376301 -1.1033,0.222228 -1.578227,0.156321 l 0.0078,0.08012 -0.04276,-0.05472 -0.903787,0.662411 c -4.52444,-4.93858 -10.466496,-8.601702 -17.383817,-10.22341 -1.610321,-0.377683 -3.219593,-0.622984 -4.8202,-0.760112 l -0.06414,-1.178271 0,-0.0039 -0.06997,0 0.06609,-0.04494 c -0.345188,-0.34187 -0.759057,-0.63443 -0.864915,-1.373673 -0.115311,-1.476813 0.07153,-3.066029 0.295432,-4.982739 0.123397,-0.896239 0.329826,-1.64205 0.365402,-2.614473 0.0087,-0.231473 -0.0025,-0.577781 -0.002,-0.818732 l -0.0039,0 c -0.01961,-1.666425 -1.197563,-3.011946 -2.654997,-3.013092 l 0,0 z m 3.327493,21.230378 c 0.935679,0.117651 1.875096,0.28384 2.814374,0.504136 5.194136,1.217722 9.705854,3.885092 13.230282,7.497558 l -11.449917,8.378818 -0.02333,-0.01173 c -0.387232,0.291765 -0.864948,0.463102 -1.38192,0.463102 -1.261584,0 -2.286889,-1.027835 -2.340129,-2.317462 l -0.05636,-0.02735 -0.793,-14.487071 0,0 z m -6.656929,0.0078 -0.794944,14.453852 -0.01166,0.0059 c -0.0204,0.49527 -0.189249,0.988296 -0.511175,1.404937 -0.786281,1.018546 -2.205943,1.205956 -3.214762,0.445516 l -0.04082,0.01954 -11.385777,-8.337784 c 4.290711,-4.378476 9.898417,-7.220393 15.959142,-7.991949 l 0,0 z m -20.099067,13.39673 10.38481,9.596169 -0.0059,0.02735 c 0.362105,0.325168 0.629721,0.767633 0.74441,1.287697 0.280255,1.270356 -0.462897,2.531816 -1.667633,2.872402 l -0.01166,0.05275 -13.399378,3.992053 c -0.286558,-3.009313 -0.121313,-6.121268 0.573371,-9.244447 0.69483,-3.124542 1.855741,-6.003276 3.381914,-8.58399 l 0,0 z m 46.925032,0.0039 c 3.066734,5.208895 4.521206,11.446159 3.838667,17.873379 l -13.327463,-3.974448 -0.0098,-0.04689 c -0.462613,-0.131044 -0.890525,-0.409136 -1.212824,-0.826549 -0.785535,-1.017775 -0.647833,-2.490683 0.295431,-3.337458 l -0.01166,-0.05667 10.427568,-9.631342 0,0 z m -25.58593,10.305477 4.180746,0 2.672489,3.444929 -0.965983,4.355501 -3.795907,1.879763 -3.795907,-1.877809 -0.965984,-4.357455 2.670546,-3.444929 0,0 z m -9.665666,11.821794 c 0.361719,-0.01033 0.731553,0.06661 1.080658,0.240344 0.121807,0.06058 0.231604,0.134794 0.338191,0.212987 l 0,0.123104 0.312925,0.154367 c 0.649744,0.684287 0.868372,1.724099 0.483963,2.64769 l 0.01749,0.02347 -5.370248,13.404547 C 48.959441,91.90408 45.09854,86.810131 43.073396,80.926971 l 13.791991,-2.411255 0.02527,0.03127 c 0.117861,-0.02248 0.237055,-0.03564 0.357628,-0.03908 l 0,0 z m 23.444051,0.05667 c 0.150919,-0.0021 0.303223,0.01183 0.456753,0.04104 l 0.02138,-0.02735 13.659823,2.391715 c -2.115344,6.059186 -6.047664,10.991651 -10.989282,14.285807 l -5.309994,-13.263857 0.03887,-0.0508 c -0.189697,-0.454542 -0.245534,-0.974758 -0.130223,-1.494822 0.245659,-1.111448 1.196232,-1.866989 2.252666,-1.881716 l 0,0 z m -11.82115,5.821011 c 0.888664,-0.05382 1.762514,0.422356 2.204074,1.275973 l 0,-0.0059 0.0059,0 6.756053,12.613168 c -4.670466,1.653416 -9.826353,2.028216 -14.993153,0.816786 -0.930489,-0.218223 -1.83986,-0.483184 -2.724967,-0.791384 l 6.771602,-12.636616 0.05247,0 c 0.226641,-0.4363 0.584084,-0.804373 1.049559,-1.035628 0.283862,-0.141226 0.582299,-0.218494 0.878521,-0.236437 l 0,0 z"
id="path8"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
</svg>
......@@ -31,7 +31,7 @@ func main() {
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
glog.Info("Starting HTTP server on port ", *argPort)
defer glog.Flush();
defer glog.Flush()
// Run a HTTP server that serves static files from current directory.
// TODO(bryk): Disable directory listing.
......
......@@ -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"]
// 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';
}
}
// 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,
};
}
<md-content>
<md-toolbar>
<div class="md-toolbar-tools">
<md-button ui-sref="main" aria-label="Kubernetes Dashboard homepage" class="md-icon-button">
<md-icon md-svg-icon="assets/images/kubernetes-logo.svg" class="kd-toolbar-logo"></md-icon>
</md-button>
<h2>
<span>kubernetes</span>
</h2>
<span flex></span>
<md-button class="md-icon-button">
<md-icon md-font-library="material-icons">more_vert</md-icon>
</md-button>
</div>
</md-toolbar>
<div ng-transclude></div>
</md-content>
// 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);
// 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;
}
......@@ -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);
}
<!doctype html>
<html ng-app="kubernetesConsole" ng-strict-di>
<html ng-app="kubernetesDashboard">
<!-- TODO(bryk): Add ng-strict-di setting for production builds. -->
<head>
<meta charset="utf-8">
<title>Kubernetes Console</title>
<title>Kubernetes Dashboard</title>
<meta name="viewport" content="width=device-width">
<!-- build:css console/vendor.css -->
<!-- build:css static/vendor.css -->
<!-- bower:css -->
<!-- Bower CSS dependencies are populated here (dev build) and compiled
into vendor.css (prod build). -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:css console/app.css -->
<!-- build:css static/app.css -->
<!-- inject:css -->
<!-- Application css files are populated here (dev build) and compiled
into app.css (prod build). -->
......@@ -26,16 +27,17 @@
experience.</p>
<![endif]-->
<div ng-view> <!-- Application content is inserted here. --> </div>
<!-- build:js console/vendor.js -->
<chrome>
<div ui-view> <!-- Application content is inserted here. --> </div>
</chrome>
<!-- build:js static/vendor.js -->
<!-- bower:js -->
<!-- Bower JS dependencies are populated here (dev build) and compiled
into vendor.js (prod build). -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:js console/app.js -->
<!-- build:js static/app.js -->
<!-- inject:js -->
<!-- Application JS files are populated here. -->
<!-- endinject -->
......
......@@ -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);
......@@ -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('/');
}
......@@ -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;
}
// 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.
......
<div layout="vertical" layout-fill>
<md-content>
<header>
Hello world! {{ctrl.testValue}}
Page content goes here.
</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>
</div>
......@@ -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);
......@@ -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',
......
......@@ -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'));
}
}
......@@ -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.');
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册