4 changed files with 152 additions and 8 deletions
@ -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> |
@ -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> |
@ -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> |
Loading…
Reference in new issue