Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Google Charts loader and not jsapi #2627

Merged
merged 1 commit into from
Jul 29, 2020
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
6 changes: 2 additions & 4 deletions cmd/internal/pages/assets/html/containers.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
<!-- Latest compiled and minified JavaScript -->
<script src="{{.Root}}static/jquery-3.5.1.min.js"></script>
<script src="{{.Root}}static/bootstrap-4.0.0-beta.2.min.js"></script>
<script type="text/javascript" src="{{.Root}}static/google-jsapi.js"></script>

<script type="text/javascript" src="{{.Root}}static/loader.js"></script>
<script type="text/javascript" src="{{.Root}}static/containers.js"></script>
<script type="text/javascript" src="{{.Root}}static/gcharts.js"></script>
</head>
<body>
<div class="container theme-showcase" >
Expand Down Expand Up @@ -263,7 +261,7 @@ <h4>Top Memory Usage:
{{end}}
</div>
<script type="text/javascript">
startPage({{.ContainerName}}, {{.CpuAvailable}}, {{.MemoryAvailable}}, {{.Root}}, {{.IsRoot}});
google.charts.setOnLoadCallback(startPage({{.ContainerName}}, {{.CpuAvailable}}, {{.MemoryAvailable}}, {{.Root}}, {{.IsRoot}}));
drawImages({{.DockerImages}});
</script>
</body>
Expand Down
2 changes: 2 additions & 0 deletions cmd/internal/pages/assets/js/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

google.charts.load('current', {packages: ['corechart', 'gauge', 'default', 'format', 'ui', 'table']});

function humanize(num, size, units) {
var unit;
for (unit = units.pop(); units.length && num >= size; unit = units.pop()) {
Expand Down
1,378 changes: 0 additions & 1,378 deletions cmd/internal/pages/assets/js/gcharts.js

This file was deleted.

39 changes: 0 additions & 39 deletions cmd/internal/pages/assets/js/google-jsapi.js

This file was deleted.

142 changes: 142 additions & 0 deletions cmd/internal/pages/assets/js/loader.js

Large diffs are not rendered by default.

178 changes: 97 additions & 81 deletions cmd/internal/pages/static/assets.go

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions cmd/internal/pages/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const StaticResource = "/static/"
var popper, _ = Asset("cmd/internal/pages/assets/js/popper.min.js")
var bootstrapJs, _ = Asset("cmd/internal/pages/assets/js/bootstrap-4.0.0-beta.2.min.js")
var containersJs, _ = Asset("cmd/internal/pages/assets/js/containers.js")
var gchartsJs, _ = Asset("cmd/internal/pages/assets/js/gcharts.js")
var googleJsapiJs, _ = Asset("cmd/internal/pages/assets/js/google-jsapi.js")
var loaderJs, _ = Asset("cmd/internal/pages/assets/js/loader.js")
var jqueryJs, _ = Asset("cmd/internal/pages/assets/js/jquery-3.5.1.min.js")

var bootstrapCss, _ = Asset("cmd/internal/pages/assets/styles/bootstrap-4.0.0-beta.2.min.css")
Expand All @@ -46,8 +45,7 @@ var staticFiles = map[string][]byte{
"bootstrap-theme-3.1.1.min.css": bootstrapThemeCss,
"containers.css": containersCss,
"containers.js": containersJs,
"gcharts.js": gchartsJs,
"google-jsapi.js": googleJsapiJs,
"loader.js": loaderJs,
"jquery-3.5.1.min.js": jqueryJs,
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/internal/pages/templates.go

Large diffs are not rendered by default.