Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tensorboard/components/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ tensorboard_html_binary(
deps = [":tensorboard"],
)

genrule(
name = "gen_tensorboard.html",
srcs = ["tensorboard.uninlined.html"],
outs = ["tensorboard.html"],
cmd = "$(execpath //tensorboard/logo:inline_favicon) $< >$@",
tools = ["//tensorboard/logo:inline_favicon"],
)

tf_web_library(
name = "analytics",
srcs = [
Expand Down
44 changes: 0 additions & 44 deletions tensorboard/components/tensorboard.html

This file was deleted.

38 changes: 38 additions & 0 deletions tensorboard/components/tensorboard.uninlined.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<!--
@license
Copyright 2016 The TensorFlow Authors. 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.
-->

<html lang="en">
<meta charset="utf-8" />
<title>TensorBoard</title>
<link rel="shortcut icon" href="%TENSORBOARD_FAVICON_URI%" />
<link rel="apple-touch-icon" href="%TENSORBOARD_FAVICON_URI%" />

<!-- Configures polymer and requires to be loaded at the top. -->
<!-- TODO(stephanwlee): Hparams (vaadin-grid) cannot support strictTemplatePolciy. Figure out
how to enable it back. -->
<!-- <link rel="import" href="security.html" /> -->

<link rel="import" href="analytics.html" />
<link rel="import" href="tf-imports/polymer.html" />
<link rel="import" href="tf-tensorboard/style.html" />
<link rel="import" href="tf-tensorboard/default-plugins.html" />
<link rel="import" href="tf-tensorboard/tf-tensorboard.html" />
<body>
<tf-tensorboard use-hash brand="TensorBoard"></tf-tensorboard>
</body>
</html>
16 changes: 16 additions & 0 deletions tensorboard/logo/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Description:
# TensorBoard logo files.

package(default_visibility = ["//tensorboard:internal"])

licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])

sh_binary(
name = "inline_favicon",
srcs = ["inline_favicon.sh"],
data = [
"favicon.png",
],
)
Binary file added tensorboard/logo/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions tensorboard/logo/inline_favicon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
# Copyright 2020 The TensorFlow Authors. 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.
# ==============================================================================

set -eu

# Replaces %TENSORBOARD_FAVICON_URI% with a data URI containing the
# image contents.
#
# Usage is like `awk(1)`: provide standard input or pass file paths as
# arguments, and expect results to stdout.

favicon_file="$0.runfiles/org_tensorflow_tensorboard/tensorboard/logo/favicon.png"
stat -- "${favicon_file}" >/dev/null # ensure exists, with nice error text

mime_type=image/png
base64_contents="$(base64 "${favicon_file}" | tr -d '\n')"
data_uri="data:${mime_type};base64,${base64_contents}"

exec awk -v data_uri="${data_uri}" \
'{ gsub("%TENSORBOARD_FAVICON_URI%", data_uri); print }' \
"$@"
8 changes: 8 additions & 0 deletions tensorboard/webapp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ tf_web_library(
],
)

genrule(
name = "gen_index.html",
srcs = ["index.uninlined.html"],
outs = ["index.html"],
cmd = "$(execpath //tensorboard/logo:inline_favicon) $< >$@",
tools = ["//tensorboard/logo:inline_favicon"],
)

# A Vulcanized html binary for the complete app (both Angular and Polymer parts)
tensorboard_html_binary(
name = "ng_index",
Expand Down
35 changes: 0 additions & 35 deletions tensorboard/webapp/index.html

This file was deleted.

29 changes: 29 additions & 0 deletions tensorboard/webapp/index.uninlined.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<!--
@license
Copyright 2019 The TensorFlow Authors. 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.
-->
<meta charset="utf-8" />
<title>TensorBoard</title>
<link rel="shortcut icon" href="%TENSORBOARD_FAVICON_URI%" />
<link rel="apple-touch-icon" href="%TENSORBOARD_FAVICON_URI%" />

<link rel="import" href="ng_polymer_lib_binary.html" />
<link rel="stylesheet" href="styles.css" />

<body>
<script jscomp-nocompile src="tb-webapp/tb_webapp_binary.js"></script>
<tb-webapp></tb-webapp>
</body>