aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/gulpfile.js
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-01-06 17:04:33 -0800
committerGravatar Vijay Vasudevan <vrv@google.com>2016-01-06 17:04:33 -0800
commit816adeef1c6e9c48b31d3426b565a7851f7f8e39 (patch)
tree55948d81b1f596ffcae6f0f506d1d09a51ee57e0 /tensorflow/tensorboard/gulpfile.js
parent7b00fe3f2605491cf62d4e1b2818f375e79c8b8c (diff)
Refactor how TensorBoard url overwriting works.
Currently TensorBoard urls are changed by modifying a global variable (TF.Urls). This creates racyness where we need to ensure that that global variable changes before the TensorBoard instantiates. It also makes it impossible e.g. to have multiple TensorBoards on the same page using different url schemes. This CL changes TensorBoard so it takes in a "router" object which specifies what the routes are. It also adds a tf-tensorboard-demo component which is just like a TensorBoard, except it has a "dataDir" property that determines where to look for demo data. Change: 111558450
Diffstat (limited to 'tensorflow/tensorboard/gulpfile.js')
-rw-r--r--tensorflow/tensorboard/gulpfile.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/tensorflow/tensorboard/gulpfile.js b/tensorflow/tensorboard/gulpfile.js
index 867fc2f5ef..8f3a3dc6df 100644
--- a/tensorflow/tensorboard/gulpfile.js
+++ b/tensorflow/tensorboard/gulpfile.js
@@ -138,13 +138,13 @@ gulp.task('server', function() {
* directory, i.e. components that don't begin with 'tf-'.
*/
function getNonTensorBoardComponents() {
- return fs.readdirSync("components").filter(function(file) {
- var filePrefix = file.slice(0, TF_COMPONENTS_PREFIX.length);
- return fs.statSync(path.join("components", file)).isDirectory()
- && filePrefix !== TF_COMPONENTS_PREFIX;
- }).map(function(dir) {
- return '/' + dir + '/';
- });
+ return fs.readdirSync('components')
+ .filter(function(file) {
+ var filePrefix = file.slice(0, TF_COMPONENTS_PREFIX.length);
+ return fs.statSync(path.join('components', file)).isDirectory() &&
+ filePrefix !== TF_COMPONENTS_PREFIX;
+ })
+ .map(function(dir) { return '/' + dir + '/'; });
}
@@ -167,13 +167,14 @@ gulp.task('vulcanize', ['compile.all', 'tslint-strict'], function() {
.pipe(gulp.dest('../opensource_only/tensorboard'));
- gulp.src('app/tf-tensorboard-demo.html')
- .pipe(vulcanize({
- inlineScripts: true,
- inlineCss: true,
- stripComments: true,
- }))
- .pipe(gulp.dest('dist'));
+ gulp.src('components/tf-tensorboard/tf-tensorboard-demo.html')
+ .pipe(vulcanize({
+ inlineScripts: true,
+ inlineCss: true,
+ stripComments: true,
+ }))
+ .pipe(header('// AUTOGENERATED FILE - DO NOT MODIFY \n'))
+ .pipe(gulp.dest('dist'));
});
gulp.task('serve', ['server']); // alias