Browse Source

ban view

master
gsd 1 year ago
parent
commit
c62f2b6bfb
  1. 39
      src/components/ActionDialogs/AdminInfoDialog.vue
  2. 69
      src/components/ActionDialogs/BanViewDialog.vue
  3. 37
      src/components/ActionDialogs/DiscordLink.vue
  4. 15
      src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue

39
src/components/ActionDialogs/AdminInfoDialog.vue

@ -0,0 +1,39 @@
<template>
<div>
<md-dialog :md-active.sync="show" @close="show=false" v-if="admin_info!=null">
<div class="md-layout md-alignment-bottom-center">
<div class="md-layout-item md-size-100 md-small-size-100 md-alignment-bottom-center rounded-only">
<p style="padding-right: 5%; padding-left: 5%; text-align: center; font-family: tf2build">Способы связи с этим админом</p>
<md-button style="float: left" class="btn-old" v-on:click="goTo('vk')">Написать в ВК</md-button>
<md-button style="float: left" class="btn-default" v-on:click="goTo('steam')">Написать в стим</md-button>
<md-button style="float: left" class="btn-boss" v-on:click="goTo('discord')">Написать в Discord</md-button>
<md-button style="float: right" class="btn-colored" v-on:click="show=false">Закрыть</md-button>
</div>
</div>
</md-dialog>
<DiscordLink ref="dl" :nickname="admin_info!=null?admin_info['discord_name']:'отсутствует'" :id="admin_info!=null?parseInt(admin_info['discord_id']):0"/>
</div>
</template>
<script>
import DiscordLink from "@/components/ActionDialogs/DiscordLink.vue";
export default {
name: "AdminInfoDialog",
components: {DiscordLink},
data: () => ({
show: false,
admin_info: null
}),
methods: {
showMe(b, info) {this.admin_info = info; this.show = b;},
goTo(service) {
switch (service) {
case "vk": {window.open(`https://vk.me/id${this.admin_info['vk_id']}`, "_blank"); break;}
case "steam": {window.open(this.admin_info['steam_url'], "_blank"); break;}
case "discord": {this.$refs.dl.showMe(true); break;}
}
}
}
}
</script>

69
src/components/ActionDialogs/BanViewDialog.vue

@ -0,0 +1,69 @@
<template>
<md-dialog :md-active.sync="show" @close="show=false" v-if="ban!=null">
<div class="md-layout md-alignment-bottom-center">
<div class="md-layout-item md-size-100 md-small-size-100 md-alignment-bottom-center rounded-only">
<h4 style="text-align: center">Бан номер #{{ban['id']}}</h4>
<div style="text-align: center">
<h4 style="display: inline">Статус бана: </h4>
<h4 style="display: inline" :style="ban['active'] === true?'color: brown':'color: green'">{{ban['active'] === true?'забанен':'разбанен'}}</h4>
</div>
<h4 style="text-align: center">Длительность: {{ban['ban_length']===0?'навсегда':`${ban['ban_length']} минут`}}</h4>
<p style="text-align: center">Причина: {{ban['ban_reason']}}</p>
<p style="text-align: center" class="clickable" v-on:click="showIP()">IP: {{this.player_ip}}</p>
<div class="md-layout md-alignment-top-center">
<div class="md-layout-item md-size-45" style="text-align: center">
<p>Дата бана: {{(new Date(ban['timestamp'])).toLocaleString()}}</p>
<p>Забанил: {{ban['banned_by']}}</p>
<md-button style="" class="btn-collect" v-on:click="$refs.aid_bvd.showMe(true, ban['admin_info'])">Написать</md-button>
</div>
<div class="md-layout-item md-size-45" v-if="ban['active'] === false" style="text-align: center">
<p>Дата разбана: {{(new Date(ban['unbanned_timestamp']).toLocaleString())}}</p>
<p>Разбанил: {{ban['unbanned_by_id'] === null||ban['unbanned_by_id'] === 'STEAM_0:0:0'?'со временем':'модератор'}}</p>
<md-button v-if="!(ban['unbanned_by_id'] === null||ban['unbanned_by_id'] === 'STEAM_0:0:0')" style="" class="btn-hand" v-on:click="$refs.aid_bvd.showMe(true, ban['unbanned_admin_info'])">Написать</md-button>
</div>
</div>
<md-button style="float: right" class="btn-colored" v-on:click="show=false">Закрыть</md-button>
</div>
<AdminInfoDialog ref="aid_bvd" />
</div>
</md-dialog>
</template>
<script>
import AdminInfoDialog from "@/components/ActionDialogs/AdminInfoDialog.vue";
import axios from "axios";
import Random from "@/api/Random";
export default {
name: "BanViewDialog",
components: {AdminInfoDialog},
data: () => ({
show: false,
ban: null,
player_ip: "Показать"
}),
methods: {
showMe(b, obj) {
this.player_ip = "Показать";
this.ban = obj;
this.show = b;
},
showIP() {
if (this.player_ip.indexOf(":") !== -1) {
this.player_ip = "Показать";
return;
}
axios.options("api/crypto" + Random.getRndWebNew()).then((response) => {
this.player_ip = "ждем...";
if (response.status === 200) {
axios.post("api/crypto/decrypt" + Random.getRndWebNew(), {"ip":this.ban['ip']}).then(response => {
this.player_ip = response.data['ip'];
})
}
}).catch(() => {
this.player_ip = "хаха нет";
})
},
}
}
</script>

37
src/components/ActionDialogs/DiscordLink.vue

@ -0,0 +1,37 @@
<template>
<md-dialog :md-active.sync="show" @close="show=false">
<div class="md-layout md-alignment-bottom-center">
<div class="md-layout-item md-size-100 md-small-size-100 md-alignment-bottom-center rounded-only">
<p style="padding-right: 5%; padding-left: 5%">Никнейм в дискорде: {{this.nickname}}</p>
<p style="padding-left: 5%; padding-right: 5%">Ид в дискорде: {{this.id}}</p>
<md-button style="float: right" class="btn-boss" v-on:click="writeOnServer()">Перейти на сервер</md-button>
<md-button style="float: right" class="btn-colored" v-on:click="show=false">Закрыть</md-button>
</div>
</div>
</md-dialog>
</template>
<script>
export default {
name: "DiscordLink",
props: {
nickname: String,
id: Number,
url: {
type: String,
default: "/unban"
}
},
data: () => ({
show: false
}),
methods: {
showMe(b) {
this.show = b;
},
writeOnServer(){
window.open(this.url, "_blank");
}
}
}
</script>

15
src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue

@ -7,12 +7,7 @@
<div v-if="player['ban'] !== null"> <div v-if="player['ban'] !== null">
<p class="profile-text" style="display: inline">Статус Бана: </p> <p class="profile-text" style="display: inline">Статус Бана: </p>
<p class="profile-text" style="color: brown; display: inline">Забанен</p> <p class="profile-text" style="color: brown; display: inline">Забанен</p>
<p class="profile-text">Причина бана: {{player['ban']['ban_reason']}}</p> <p class="profile-text clickable" v-on:click="$refs.bvd_pc.showMe(true, player['ban'])">О бане...</p>
<p class="profile-text" style="display: inline">Выдал бан: {{player['ban']['banned_by']}}</p>
<!--<SteamSvg :h="'5%'" :w="'5%'" :url="player['ban']['admin_info']['steam_url']" :inline="true"/>
<DiscordSvg :h="'5%'" :w="'5%'" :url="'https://tf2.pblr-nyk.pro/unban'" :inline="true"/>-->
<p class="profile-text" v-if="player['ban']['ban_length'] > 0">Дата окончания бана: {{new Date(player['ban']['ban_utime'] * 1000 + player['ban']['ban_length'] * 60 * 1000).toLocaleString()}}</p>
<p class="profile-text">Бан навсегда</p>
</div> </div>
<div v-if="player['permition'] === null"> <div v-if="player['permition'] === null">
<p class="profile-text" style="display: inline">Статус VIP : </p> <p class="profile-text" style="display: inline">Статус VIP : </p>
@ -58,9 +53,10 @@
<md-menu v-else md-direction="bottom-start" md-size="auto"> <md-menu v-else md-direction="bottom-start" md-size="auto">
<md-button class="md-raised btn-strange" md-menu-trigger>История Банов</md-button> <md-button class="md-raised btn-strange" md-menu-trigger>История Банов</md-button>
<md-menu-content> <md-menu-content>
<md-menu-item v-for="b in ban_list.store" :key="b['id']+'b'">#{{b['id']}} | {{new Date(b['ban_utime'] * 1000).toLocaleDateString()}} | {{b['ban_length']===0?'Навсегда':`${b['ban_length']} минут`}}</md-menu-item> <md-menu-item v-on:click="$refs.bvd_pc.showMe(true, b)" v-for="b in ban_list.store" :key="b['id']+'b'">#{{b['id']}} | {{new Date(b['ban_utime'] * 1000).toLocaleDateString()}} | {{b['ban_length']===0?'Навсегда':`${b['ban_length']} минут`}}</md-menu-item>
</md-menu-content> </md-menu-content>
</md-menu> </md-menu>
<BanViewDialog ref="bvd_pc"/>
<div style="padding: 1% 0%"/> <div style="padding: 1% 0%"/>
<!--ALT ACCOUNTS--> <!--ALT ACCOUNTS-->
<md-button v-on:click="loadingAltList()" v-if="this.$API.admin.permition.alt === true && altaccount.loaded === false" class="md-raised btn-strange" style="margin: 0% 0%" md-menu-trigger>{{altaccount.loading?'Загрузка':'Альт.аккаунты'}}</md-button> <md-button v-on:click="loadingAltList()" v-if="this.$API.admin.permition.alt === true && altaccount.loaded === false" class="md-raised btn-strange" style="margin: 0% 0%" md-menu-trigger>{{altaccount.loading?'Загрузка':'Альт.аккаунты'}}</md-button>
@ -98,10 +94,13 @@ import SteamSvg from "@/components/Others/CustomSvg/SteamSvg.vue";
import axios from "axios"; import axios from "axios";
import SnackLoader from "@/components/Others/Loader/SnackLoader.vue"; import SnackLoader from "@/components/Others/Loader/SnackLoader.vue";
import Random from "@/api/Random"; import Random from "@/api/Random";
import BanViewDialog from "@/components/ActionDialogs/BanViewDialog.vue";
export default { export default {
name: "ProfileContainer", name: "ProfileContainer",
components: {SnackLoader, ProfileViewer_Internal: () => import("@/components/Others/Loader/ProfileViewer.vue"), SteamSvg, DiscordSvg}, components: {
BanViewDialog,
SnackLoader, ProfileViewer_Internal: () => import("@/components/Others/Loader/ProfileViewer.vue"), SteamSvg, DiscordSvg},
props: { props: {
player: Object, player: Object,
f_size: { f_size: {

Loading…
Cancel
Save