diff --git a/src/App.js b/src/App.js index 7d94762..d1aee91 100644 --- a/src/App.js +++ b/src/App.js @@ -108,20 +108,28 @@ class App extends Component { * also updates the favicon */ checkApiEndpoint = () => { - if (API.getEndpointStatus() !== this.state.endPointAvailable) { + const status = API.getEndpointStatus() + if (status !== this.state.endPointAvailable) { this.setState({ endPointAvailable: !this.state.endPointAvailable }) const link = document.querySelectorAll("link[rel~='icon']"); link.forEach(v => { let segments = v.href.split(".") - if (this.state.endPointAvailable) { + if (status) { segments[0] = segments[0].substring(0, segments[0].length - 3) } else { segments[0] += "-gs" } v.href = segments.join(".") }) + + // get info after api recovers + if (status) { + this.fetchRemotes() + this.fetchMounts() + this.fetchVersionInfo() + } } } @@ -282,6 +290,7 @@ class App extends Component { >

{v.name}

{v.type}

+ {/* add EDIT button */} )) @@ -296,6 +305,7 @@ class App extends Component {

{v.Fs}

{v.MountPoint}

+ {/* add DELETE button */}
)) } @@ -394,12 +404,12 @@ class App extends Component { -

Remotes

+

Remotes

{/* add NEW button */} { this.renderRemotes() }
-

Mounts

+

Mounts

{/* add NEW button */} { this.renderMounts() }