mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-27 15:44:27 +02:00
Fix linting for MinecraftStatus.vue
This commit is contained in:
parent
8e4e95597a
commit
e96a8e1f6c
@ -55,7 +55,7 @@ import StatusIndicator from '@/components/LinkItems/StatusIndicator.vue';
|
|||||||
export default {
|
export default {
|
||||||
mixins: [WidgetMixin],
|
mixins: [WidgetMixin],
|
||||||
components: {
|
components: {
|
||||||
StatusIndicator
|
StatusIndicator,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -78,23 +78,23 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return this.options.title || this.options.server || this.error("options.server not set");
|
return this.options.title || this.options.server || this.error('options.server not set');
|
||||||
},
|
},
|
||||||
alt() {
|
alt() {
|
||||||
return this.title
|
return this.title;
|
||||||
},
|
},
|
||||||
icon() {
|
icon() {
|
||||||
return `https://api.mcsrvstat.us/icon/${this.server}`
|
return `https://api.mcsrvstat.us/icon/${this.server}`;
|
||||||
},
|
},
|
||||||
server() {
|
server() {
|
||||||
return this.options.server || this.error("options.server not set");
|
return this.options.server || this.error('options.server not set');
|
||||||
},
|
},
|
||||||
bedrock() {
|
bedrock() {
|
||||||
return this.options.bedrock === true;
|
return this.options.bedrock === true;
|
||||||
},
|
},
|
||||||
statusTooltip() {
|
statusTooltip() {
|
||||||
if (!this.status) {
|
if (!this.status) {
|
||||||
return "Loading...";
|
return 'Loading...';
|
||||||
}
|
}
|
||||||
if (!this.online) {
|
if (!this.online) {
|
||||||
return `${this.server} Offline`;
|
return `${this.server} Offline`;
|
||||||
@ -111,11 +111,11 @@ export default {
|
|||||||
return this.options.showPlugins && this.plugins.length > 0;
|
return this.options.showPlugins && this.plugins.length > 0;
|
||||||
},
|
},
|
||||||
endpoint() {
|
endpoint() {
|
||||||
return `${widgetApiEndpoints.minecraftStatus}${this.bedrock?'bedrock/':''}3/${this.server}`;
|
return `${widgetApiEndpoints.minecraftStatus}${this.bedrock ? 'bedrock/' : ''}3/${this.server}`;
|
||||||
},
|
},
|
||||||
serverLinkEndpoint() {
|
serverLinkEndpoint() {
|
||||||
return `${widgetApiEndpoints.minecraftServerLink}${this.server}`;
|
return `${widgetApiEndpoints.minecraftServerLink}${this.server}`;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
playerIconEndpoint(uuid) {
|
playerIconEndpoint(uuid) {
|
||||||
@ -126,7 +126,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/* Make GET request to McSrvStat.US API endpoint */
|
/* Make GET request to McSrvStat.US API endpoint */
|
||||||
fetchData() {
|
fetchData() {
|
||||||
this.startLoading()
|
this.startLoading();
|
||||||
fetch(this.endpoint)
|
fetch(this.endpoint)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
@ -146,26 +146,26 @@ export default {
|
|||||||
},
|
},
|
||||||
/* Assign data variables to the returned data */
|
/* Assign data variables to the returned data */
|
||||||
processData(data) {
|
processData(data) {
|
||||||
this.online = data.online
|
this.online = data.online;
|
||||||
this.ip = data.ip
|
this.ip = data.ip;
|
||||||
this.port = data.port
|
this.port = data.port;
|
||||||
this.hostname = data.hostname
|
this.hostname = data.hostname;
|
||||||
if (this.online) {
|
if (this.online) {
|
||||||
this.version = data.version
|
this.version = data.version;
|
||||||
this.iconData = data.icon
|
this.iconData = data.icon;
|
||||||
this.software = data.software
|
this.software = data.software;
|
||||||
this.gamemode = data.gamemode
|
this.gamemode = data.gamemode;
|
||||||
this.motd = data.motd.clean || []
|
this.motd = data.motd.clean || [];
|
||||||
this.players = data.players.list || []
|
this.players = data.players.list || [];
|
||||||
this.onlinePlayers = data.players.online
|
this.onlinePlayers = data.players.online;
|
||||||
this.maxPlayers = data.players.max
|
this.maxPlayers = data.players.max;
|
||||||
this.mods = data.mods || []
|
this.mods = data.mods || [];
|
||||||
this.plugins = data.plugins || []
|
this.plugins = data.plugins || [];
|
||||||
}
|
}
|
||||||
this.status = true
|
this.status = true;
|
||||||
},
|
},
|
||||||
update() {
|
update() {
|
||||||
this.fetchData()
|
this.fetchData();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user