diff --git a/src/components/home.vue b/src/components/home.vue index d7f7384..80a0f90 100644 --- a/src/components/home.vue +++ b/src/components/home.vue @@ -85,7 +85,7 @@ }, methods: { async fetchPlayers() { - const data = await getRequest('https://api.altv.mp/servers/'); + const data = await getRequest('https://api.alt-mp.com/servers/info'); if (!data) { return; diff --git a/src/components/server/server-modal.vue b/src/components/server/server-modal.vue index c1e6546..6381978 100644 --- a/src/components/server/server-modal.vue +++ b/src/components/server/server-modal.vue @@ -23,23 +23,15 @@ Players - {{ server.players }} / {{ server.maxPlayers }} + {{ server.playersCount }} / {{ server.maxPlayersCount }} Language {{ this.getLanguage(server.language) }} - - IP - {{ server.host }} - - - Port - {{ server.port }} - - - Host - {{ server.cdnUrl }} + + Address + {{ server.address }} Gamemode @@ -47,7 +39,7 @@ Website - {{ server.website }} + {{ server.website }} Description @@ -92,8 +84,7 @@
- Connect - Connect + Connect
@@ -211,7 +202,7 @@ export default { getPlayerData: async function () { this.playerData = null; - const playerData = await getRequest(`https://api.alt-mp.com/${this.type}/${this.server.id}/${this.period}`); + const playerData = await getRequest(`https://api.alt-mp.com/servers/${this.server.publicId}/${this.type}/${this.period}`); if (!playerData) { return; @@ -513,6 +504,10 @@ div.connect a:active { border-spacing: 10px; } +.modal-container .information table a { + color: white !important; +} + .modal-container .information table tr td:first-child { /* display: block; */ text-transform: uppercase; diff --git a/src/components/server/servers.vue b/src/components/server/servers.vue index 59b785f..f2c40c8 100644 --- a/src/components/server/servers.vue +++ b/src/components/server/servers.vue @@ -37,7 +37,7 @@
- Players online: {{ servers.reduce((a, b) => a + (b.players || 0), 0) }} + Players online: {{ servers.reduce((a, b) => a + (b.playersCount || 0), 0) }} Servers online: {{ servers.length }} @@ -68,18 +68,17 @@
- +
- {{ server.players }} / - {{ server.maxPlayers }} + {{ server.playersCount }} / + {{ server.maxPlayersCount }} {{ server.gameMode }} {{ getLanguage(server.language) }} - Connect - Connect + Connect @@ -139,7 +138,7 @@ getLanguage: getLanguage, fetchServers: async function () { console.log("Fetch servers from the API..."); - const data = await getRequest('https://api.alt-mp.com/servers/list'); + const data = await getRequest('https://api.alt-mp.com/servers'); if (!data) { return; @@ -234,7 +233,7 @@ return this.servers.filter(server => { if (!server.players && this.filter.empty) return false; if ((server.players === server.maxPlayers) && this.filter.full) return false; - if (server.locked && this.filter.locked) return false; + if (server.passworded && this.filter.locked) return false; if (!this.filter.name) return true; var filter = this.filter.name.toLowerCase();