no longer manipulating props

pull/784/head
Emily Wotruba 2024-05-21 22:05:43 +02:00 committed by Bastien Wirtz
parent 5872d5fa72
commit 75d8afebe6
1 changed files with 8 additions and 5 deletions

View File

@ -36,6 +36,9 @@ export default {
status: "", status: "",
version: "", version: "",
entities: 0, entities: 0,
location_name: "",
separator: " ",
items: ["name", "version"],
}), }),
computed: { computed: {
headers: function () { headers: function () {
@ -46,8 +49,8 @@ export default {
}, },
details: function () { details: function () {
const details = []; const details = [];
const items = this.item.items; const items = this.items;
const separator = this.item.separator; const separator = this.separator;
for (const i in items) { for (const i in items) {
const key = items[i]; const key = items[i];
@ -81,9 +84,9 @@ export default {
created() { created() {
this.fetchServerStatus().then(() => { this.fetchServerStatus().then(() => {
if (!this.item.subtitle && this.status !== "dead") { if (!this.item.subtitle && this.status !== "dead") {
if (!this.item.items) this.item.items = ["name", "version"]; if (this.item.items) this.items = this.item.items;
if (!this.item.separator) this.item.separator = " "; if (this.item.separator) this.separator = this.item.separator;
if (!this.item.logo) this.item.logo = `${this.item.url}/static/icons/favicon-192x192.png`;
this.fetchServerStats(); this.fetchServerStats();
} }
}); });