Rename :orgId to :instanceId in metrics graph url

- Renames placeholders `:orgId` to `:instanceId` in
  `--app.metrics-graph`
- Adjusts frontend client to use the provided instanceId by its host
  application (Weave Cloud)
This commit is contained in:
Roland Schilter
2018-12-14 10:23:00 -08:00
parent a721b49885
commit f8412c3204
5 changed files with 9 additions and 9 deletions

View File

@@ -91,9 +91,9 @@ export function basePathSlash(urlPath) {
// i.e. in this case Weave Cloud, rather than being hardcoded here.
export function getApiPath(pathname = window.location.pathname) {
if (process.env.SCOPE_API_PREFIX) {
// Extract the instance name (pathname in WC context is of format '/:orgId/explore').
const orgId = pathname.split('/')[1];
return basePath(`${process.env.SCOPE_API_PREFIX}/app/${orgId}`);
// Extract the instance name (pathname in WC context is of format '/:instanceId/explore').
const instanceId = pathname.split('/')[1];
return basePath(`${process.env.SCOPE_API_PREFIX}/app/${instanceId}`);
}
return basePath(pathname);