Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ import '../tf_hparams_main/tf-hparams-main';
import * as tf_hparams_backend from '../tf_hparams_backend/tf-hparams-backend';
import {LegacyElementMixin} from '../../../components/polymer/legacy_element_mixin';

// Read URL at module import time, before AppRoutingEffects stomps it.
const inColab =
new URLSearchParams(window.location.search).get('tensorboardColab') ===
Comment on lines +24 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you leave a comment here that this is deliberately a side-effect
at module import time to work around the bug in AppRouting, as #4213
did for the scalars dashboard?

/**
* Save the initial URL query params, before the AppRoutingEffects initialize.
*/
const initialURLSearchParams = new URLSearchParams(window.location.search);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I’ve gone ahead and done this.)

'true';

const PLUGIN_NAME = 'hparams';
@customElement('tf-hparams-dashboard')
class TfHparamsDashboard extends LegacyElementMixin(PolymerElement) {
Expand All @@ -43,7 +48,7 @@ class TfHparamsDashboard extends LegacyElementMixin(PolymerElement) {
new tf_backend.RequestManager(),
/* Use GETs if we're running in colab (due to b/126387106).
Otherwise use POSTs. */
/* useHttpGet= */ !!((window as any).TENSORBOARD_ENV || {}).IN_COLAB
/* useHttpGet= */ inColab
);
// This is called by the tensorboard web framework to refresh the plugin.
reload() {
Expand Down