Skip to content
Snippets Groups Projects
Commit 826807ee authored by Xiao Gui's avatar Xiao Gui
Browse files

hotfix: sapi endpoint fallback

parent e28e34fe
No related branches found
No related tags found
No related merge requests found
# v2.7.4
## Bugfix
- Properly use fallback when detecting fault
- Minor wording/cosmetic change
...@@ -33,6 +33,7 @@ nav: ...@@ -33,6 +33,7 @@ nav:
- Fetching datasets: 'advanced/datasets.md' - Fetching datasets: 'advanced/datasets.md'
- Display non-atlas volumes: 'advanced/otherVolumes.md' - Display non-atlas volumes: 'advanced/otherVolumes.md'
- Release notes: - Release notes:
- v2.7.4: 'releases/v2.7.4.md'
- v2.7.3: 'releases/v2.7.3.md' - v2.7.3: 'releases/v2.7.3.md'
- v2.7.2: 'releases/v2.7.2.md' - v2.7.2: 'releases/v2.7.2.md'
- v2.7.1: 'releases/v2.7.1.md' - v2.7.1: 'releases/v2.7.1.md'
......
{ {
"name": "interactive-viewer", "name": "interactive-viewer",
"version": "2.7.3", "version": "2.7.4",
"description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular", "description": "siibra-explorer - explore brain atlases. Based on humanbrainproject/nehuba & google/neuroglancer. Built with angular",
"scripts": { "scripts": {
"lint": "eslint src --ext .ts", "lint": "eslint src --ext .ts",
......
import { Injectable } from "@angular/core"; import { Injectable } from "@angular/core";
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { map, shareReplay } from "rxjs/operators"; import { filter, map, shareReplay, switchMap, take } from "rxjs/operators";
import { SAPIAtlas, SAPISpace } from './core' import { SAPIAtlas, SAPISpace } from './core'
import { import {
SapiAtlasModel, SapiAtlasModel,
...@@ -20,7 +20,7 @@ import { MatSnackBar } from "@angular/material/snack-bar"; ...@@ -20,7 +20,7 @@ import { MatSnackBar } from "@angular/material/snack-bar";
import { AtlasWorkerService } from "src/atlasViewer/atlasViewer.workerService.service"; import { AtlasWorkerService } from "src/atlasViewer/atlasViewer.workerService.service";
import { EnumColorMapName } from "src/util/colorMaps"; import { EnumColorMapName } from "src/util/colorMaps";
import { PRIORITY_HEADER } from "src/util/priority"; import { PRIORITY_HEADER } from "src/util/priority";
import { Observable } from "rxjs"; import { interval, Observable } from "rxjs";
import { SAPIFeature } from "./features"; import { SAPIFeature } from "./features";
import { environment } from "src/environments/environment" import { environment } from "src/environments/environment"
...@@ -52,7 +52,7 @@ export class SAPI{ ...@@ -52,7 +52,7 @@ export class SAPI{
} }
static ErrorMessage = null static ErrorMessage = null
static BsEndpoint = `https://siibra-api-rc.apps.hbp.eu/v2_0` static BsEndpoint = null
get bsEndpoint() { get bsEndpoint() {
return SAPI.BsEndpoint return SAPI.BsEndpoint
...@@ -133,12 +133,16 @@ export class SAPI{ ...@@ -133,12 +133,16 @@ export class SAPI{
) )
} }
public atlases$ = this.http.get<SapiAtlasModel[]>( public atlases$ = interval(160).pipe(
`${this.bsEndpoint}/atlases`, map(() => this.bsEndpoint),
{ filter(v => !!v),
observe: "response" take(1),
} switchMap(endpt => this.http.get<SapiAtlasModel[]>(
).pipe( `${endpt}/atlases`,
{
observe: "response"
}
)),
map(resp => { map(resp => {
const respVersion = resp.headers.get(SIIBRA_API_VERSION_HEADER_KEY) const respVersion = resp.headers.get(SIIBRA_API_VERSION_HEADER_KEY)
if (respVersion !== SIIBRA_API_VERSION) { if (respVersion !== SIIBRA_API_VERSION) {
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
color="primary"> color="primary">
<div class="fas fa-external-link-alt"></div> <div class="fas fa-external-link-alt"></div>
<span> <span>
Explore Dataset Detail
</span> </span>
</a> </a>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment