From 921c50488594814e1ed6319638459974fb514c88 Mon Sep 17 00:00:00 2001 From: gsd Date: Tue, 24 Oct 2023 23:15:54 +0300 Subject: [PATCH] alt --- src/api/AdminApi.js | 13 +++++- .../Others/Loader/ProfileViewer.vue | 6 +-- .../Components/ProfileContainer.vue | 40 +++++++++++++++++-- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/api/AdminApi.js b/src/api/AdminApi.js index 6a1b1c6..aa043b4 100644 --- a/src/api/AdminApi.js +++ b/src/api/AdminApi.js @@ -4,7 +4,8 @@ export default class AdminApi { permition = { ban:false, mute:false, - kick:false + kick:false, + alt:false } async checkPermition(name) { @@ -17,6 +18,13 @@ export default class AdminApi { }); } + async checkAltAccess(){ + return axios.options('/api/admin/db/alt').then( + response => {if (response.status === 200) this.permition.alt = true; + else this.permition.alt = false;} + ).catch(()=>this.permition.alt = false) + } + async load(stages) { console.log(`[AdminAPI] request permissions`); if (document.cookie.indexOf("steam64=") === -1) return; @@ -24,7 +32,8 @@ export default class AdminApi { await Promise.all([ this.checkPermition('ban'), this.checkPermition('mute'), - this.checkPermition('kick') + this.checkPermition('kick'), + this.checkAltAccess() ]); stages.remove("permitions"); } diff --git a/src/components/Others/Loader/ProfileViewer.vue b/src/components/Others/Loader/ProfileViewer.vue index 0f5be19..19e8182 100644 --- a/src/components/Others/Loader/ProfileViewer.vue +++ b/src/components/Others/Loader/ProfileViewer.vue @@ -34,11 +34,11 @@ export default { showProfileDialog: false }), methods: { - getPlayer() { - if (this.steam64.length === 0) return; + getPlayer(s64) { + if (this.steam64.length === 0 && s64 === undefined) return; this.showProfileDialog = true; this.loading = true; - axios.get(`/api/profile/web?steam64=${this.steam64}&requests=${PLAYER_REQUESTS}`).then(response => { + axios.get(`/api/profile/web?steam64=${s64===undefined?this.steam64:s64}&requests=${PLAYER_REQUESTS}`).then(response => { if (response.status === 200) this.player = response.data; else console.log("not permition"); }).catch((err) => { diff --git a/src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue b/src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue index b73cdd8..d25cb3d 100644 --- a/src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue +++ b/src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue @@ -36,14 +36,14 @@ {{g[0]}} - {{timeFormat(g[1])}} -
+
Последние игры {{l[0]}} - {{l[1]}} -
+
{{donates.loading?'Загрузка':'Покупки VIP'}} @@ -52,7 +52,7 @@ {{new Date(d['utime'] * 1000).toLocaleDateString()}} | {{d['status']}} -
+
{{ban_list.loading?'Загрузка':'История банов'}} @@ -61,6 +61,16 @@ #{{b['id']}} | {{new Date(b['ban_utime'] * 1000).toLocaleDateString()}} | {{b['ban_length']===0?'Навсегда':`${b['ban_length']} минут`}} +
+ + {{altaccount.loading?'Загрузка':'Альт.аккаунты'}} + + Альт.аккаунты + + {{b}} + + +
@@ -84,10 +94,11 @@ import DiscordSvg from "@/components/Others/CustomSvg/DiscordSvg.vue"; import SteamSvg from "@/components/Others/CustomSvg/SteamSvg.vue"; import axios from "axios"; +import ProfileViewer from "@/components/Others/Loader/ProfileViewer.vue"; export default { name: "ProfileContainer", - components: {SteamSvg, DiscordSvg}, + components: {ProfileViewer, SteamSvg, DiscordSvg}, props: { player: Object, f_size: { @@ -112,6 +123,11 @@ export default { loaded: false, store: [], total: "Показать" + }, + altaccount: { + loading: false, + loaded: false, + store:[] } }), methods: { @@ -189,6 +205,22 @@ export default { }) .catch(() => this.usertime.loaded = false) .finally(() => this.usertime.loading = false) + }, + loadingAltList(){ + if (this.altaccount.loading || this.altaccount.loaded) return; + this.altaccount.loading = true; + axios.get(`api/admin/db/alt?steam64=${this.player['steamids']['steam64']}`) + .then(response => { + if (response.status === 200) { + this.altaccount.store = response.data.map(url => url.split('/').pop()).filter(s64 => s64 !== this.player['steamids']['steam64']); + this.altaccount.loaded = true; + /*if (this.altaccount.store.length === 0) { + this.altaccount.store.push("Чист"); + }*/ + } + }) + .catch(() => this.altaccount.loaded = false) + .finally(() => this.altaccount.loading = false) } } }