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: 7 additions & 1 deletion tensorboard/components/tf_backend/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export interface Router {
runs: () => string;
runsForExperiment: (id: ExperimentId) => string;
}

/**
* Save the initial URL query params, before the AppRoutingEffects initialize,
* and before creating the router.
*/
const initialURLSearchParams = new URLSearchParams(window.location.search);
let _router: Router = createRouter();

/**
Expand All @@ -39,7 +45,7 @@ let _router: Router = createRouter();
*/
export function createRouter(
dataDir = 'data',
urlSearchParams = new URLSearchParams(window.location.search)
urlSearchParams = initialURLSearchParams
): Router {
if (dataDir[dataDir.length - 1] === '/') {
dataDir = dataDir.slice(0, dataDir.length - 1);
Expand Down
7 changes: 6 additions & 1 deletion tensorboard/plugins/projector/vz_projector/vz-projector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const THRESHOLD_DIM_NORMALIZE = 50;
const POINT_COLOR_MISSING = 'black';
const INDEX_METADATA_FIELD = '__index__';

/**
* Save the initial URL query params, before the AppRoutingEffects initialize.
*/
const initialURLQueryString = window.location.search;

@customElement('vz-projector')
class Projector
extends LegacyElementMixin(PolymerElement)
Expand Down Expand Up @@ -440,7 +445,7 @@ class Projector
if (this.servingMode === 'demo') {
let projectorConfigUrl: string;
// Only in demo mode do we allow the config being passed via URL.
let urlParams = util.getURLParams(window.location.search);
let urlParams = util.getURLParams(initialURLQueryString);
if ('config' in urlParams) {
projectorConfigUrl = urlParams['config'];
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ import {DEFAULT_TOOLTIP_COLUMNS} from '../../../components/vz_line_chart2/vz-lin

type RunTagItem = {run: string; tag: string};

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

/**
* A card that handles loading data (at the right times), rendering a scalar
* chart, and providing UI affordances (such as buttons) for scalar data.
Expand Down Expand Up @@ -265,9 +270,7 @@ export class TfScalarCard extends PolymerElement {
onLoad,
onFinish
) => {
const inColab =
new URLSearchParams(window.location.search).get('tensorboardColab') ===
'true';
const inColab = initialURLSearchParams.get('tensorboardColab') === 'true';
if (inColab) {
// Google-internal Colab doesn't support HTTP POST requests, so we fall
// back to HTTP GET (even though public Colab supports POST).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ import {Injectable} from '@angular/core';

import {TBFeatureFlagDataSource} from './tb_feature_flag_data_source_types';

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

const util = {
getParams() {
return new URLSearchParams(window.location.search);
return initialURLSearchParams;
},
};

Expand Down