2020-05-31 20:25:39 +02:00
|
|
|
var app = new Vue({
|
2024-05-04 14:06:46 +02:00
|
|
|
el: "#app",
|
2020-05-31 20:25:39 +02:00
|
|
|
data: {
|
|
|
|
streams: [],
|
2024-05-04 14:06:46 +02:00
|
|
|
isLoading: true,
|
2020-05-31 20:25:39 +02:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
isPublishing(stream) {
|
2024-05-04 14:06:46 +02:00
|
|
|
return stream.publish_counter > 0;
|
2020-05-31 20:25:39 +02:00
|
|
|
},
|
|
|
|
detailLink(id) {
|
2024-05-04 14:06:46 +02:00
|
|
|
return `${id}/`;
|
2020-05-31 20:25:39 +02:00
|
|
|
},
|
|
|
|
deleteLink(id) {
|
2024-05-04 14:06:46 +02:00
|
|
|
return `${id}/delete`;
|
2020-05-31 20:25:39 +02:00
|
|
|
},
|
|
|
|
fetchData() {
|
2024-05-04 14:06:46 +02:00
|
|
|
axios.get("/api/v2/config/stream").then((response) => {
|
|
|
|
this.streams = response.data;
|
|
|
|
this.isLoading = false;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
axios.defaults.xsrfCookieName = "csrftoken";
|
|
|
|
axios.defaults.xsrfHeaderName = "X-CSRFTOKEN";
|
|
|
|
this.fetchData();
|
|
|
|
setInterval(
|
|
|
|
function () {
|
|
|
|
this.fetchData();
|
|
|
|
}.bind(this),
|
|
|
|
1000,
|
|
|
|
);
|
2020-05-31 20:25:39 +02:00
|
|
|
},
|
2024-05-04 14:06:46 +02:00
|
|
|
});
|