Fixed snapshot loader
This commit is contained in:
parent
b40c0cde3e
commit
733b6f4b61
1 changed files with 3 additions and 2 deletions
|
|
@ -75,6 +75,7 @@ export default {
|
||||||
|
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
snapshotRule: "/api/v2/streams/snapshot",
|
||||||
snapshotSrc: "",
|
snapshotSrc: "",
|
||||||
snapshotAvailable: false,
|
snapshotAvailable: false,
|
||||||
polling: null
|
polling: null
|
||||||
|
|
@ -86,7 +87,7 @@ export default {
|
||||||
return `http://${this.hostname}:${this.port}/routes`;
|
return `http://${this.hostname}:${this.port}/routes`;
|
||||||
},
|
},
|
||||||
snapshotURL: function() {
|
snapshotURL: function() {
|
||||||
return `http://${this.hostname}:${this.port}/api/v2/streams/snapshot`;
|
return `http://${this.hostname}:${this.port}${this.snapshotRule}`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -112,7 +113,7 @@ export default {
|
||||||
.get(this.routesURL)
|
.get(this.routesURL)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// If the host has a snapshot route available
|
// If the host has a snapshot route available
|
||||||
if ("/api/v1/snapshot" in response.data) {
|
if (this.snapshotRule in response.data) {
|
||||||
// Tell the view that a snapshot is available
|
// Tell the view that a snapshot is available
|
||||||
this.snapshotAvailable = true;
|
this.snapshotAvailable = true;
|
||||||
// Update the snapshot URL
|
// Update the snapshot URL
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue