Browse Source

new desing

master
gsd 1 year ago
parent
commit
d9a74b7827
  1. 2
      src/api/GlobalApi.js
  2. 44
      src/components/ActionDialogs/AdminDialog.vue
  3. 3
      src/components/ActionDialogs/BanListDialog.vue
  4. 5
      src/components/ActionDialogs/BanViewDialog.vue
  5. 0
      src/components/ActionDialogs/FindPlayer.vue
  6. 3
      src/components/ActionDialogs/GametimeDialog.vue
  7. 36
      src/components/Others/Loader/ProfileViewer.vue
  8. 4
      src/components/TabsMenu.vue
  9. 6
      src/components/TabsMenuElements/AboutView/AboutView.vue
  10. 15
      src/components/TabsMenuElements/BackendStatus/BackendStatus.vue
  11. 13
      src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue
  12. 13
      src/components/TabsMenuElements/ProfileView/ProfileView.vue
  13. 12
      src/css/baseui.css

2
src/api/GlobalApi.js

@ -37,7 +37,7 @@ export default class GlobalApi {
builddate = VERSION * 1000;
current_window = location.hash.length > 1?location.hash.slice(1):'mainView';
current_window = location.hash.length > 1?location.hash.slice(1)==="backendView"?"profileView":location.hash.slice(1):'mainView';
load_stages = new Stages();

44
src/components/ActionDialogs/AdminDialog.vue

@ -1,5 +1,5 @@
<template>
<md-dialog :md-active.sync="active" @close="active=false" v-if="steam64!==null">
<md-dialog :md-active.sync="active" @close="active=false" v-if="s64!==null">
<div class="md-layout md-alignment-bottom-center rounded-only">
<md-card class="md-layout-item md-small-size-100" v-if="current_mode===1">
<md-card-header>
@ -25,7 +25,7 @@
</div>
</div>
<p v-if="response.length>0" style="font-family: tf2secondary; color: black">Ответ: {{response}}</p>
<md-button v-on:click="toBan()" style="float: left;" class="btn-collect">Забанить</md-button>
<md-button v-on:click="toBan(s64)" style="float: left;" class="btn-collect">Забанить</md-button>
<md-button v-on:click="payload.ban_length = 0" style="float: left;" class="btn-unusual">Навсегда</md-button>
<md-button v-on:click="showMe(false)" style="float: right;" class="btn-colored">Закрыть</md-button>
</md-card-content>
@ -37,7 +37,7 @@
</md-card-header>
<md-card-content>
<p v-if="response.length>0" style="font-family: tf2secondary; color: black">Ответ: {{response}}</p>
<md-button v-on:click="toUnBan()" style="float: left;" class="btn-hand">Разбанить</md-button>
<md-button v-on:click="toUnBan(s64)" style="float: left;" class="btn-hand">Разбанить</md-button>
<md-button v-on:click="showMe(false)" style="float: right;" class="btn-colored">Закрыть</md-button>
</md-card-content>
</md-card>
@ -57,7 +57,7 @@
</div>
</div>
<p v-if="response.length>0" style="font-family: tf2secondary; color: black">Ответ: {{response}}</p>
<md-button v-on:click="toKick()" style="float: left" class="btn-high">Кикнуть</md-button>
<md-button v-on:click="toKick(s64)" style="float: left" class="btn-high">Кикнуть</md-button>
<md-button v-on:click="showMe(false)" style="float: right;" class="btn-colored">Закрыть</md-button>
</md-card-content>
</md-card>
@ -72,8 +72,13 @@ export default {
name: "AdminDialog",
props: {
steam64: String,
any: {
type: String,
default: null
}
},
data: () => ({
s64: null,
active: false,
payload: {
ban_length:0,
@ -84,11 +89,19 @@ export default {
current_mode: 0
}),
methods: {
showMe(b, m) {this.response="";this.active = b;this.current_mode =m},
toBan() {
showMe(b, m) {
if (b===true) {
this.s64 = this.steam64;
this.foundOfAny();
}
this.response="";
this.active = b;
this.current_mode =m;
},
toBan(steam64) {
this.sending = true;
this.response = "Отправляем...";
axios.post(`/api/admin/ban?steam64=${this.steam64}&ban_length=${this.payload.ban_length}&ban_reason=${this.payload.ban_reason}` + Random.getRndWebAppend())
axios.post(`/api/admin/ban?steam64=${steam64}&ban_length=${this.payload.ban_length}&ban_reason=${this.payload.ban_reason}` + Random.getRndWebAppend())
.then((response) => {
switch (response.status) {
case 201: {this.response=`Успешно забанен, ид #${response.data}`;break;}
@ -99,10 +112,10 @@ export default {
}).catch(()=>{})
.finally(()=>{this.sending = false;})
},
toUnBan(){
toUnBan(steam64){
this.sending = true;
this.response = "Отправляем...";
axios.post(`/api/admin/unban?steam64=${this.steam64}` + Random.getRndWebAppend())
axios.delete(`/api/admin/ban?steam64=${steam64}` + Random.getRndWebAppend())
.then((response) => {
switch (response.status) {
case 200: {this.response=`Игрок разбанен!`;break;}
@ -113,10 +126,10 @@ export default {
}).catch(()=>{})
.finally(()=>{this.sending = false;})
},
toKick(){
toKick(steam64){
this.sending = true;
this.response = "Отправляем...";
axios.post(`/api/admin/kick?steam64=${this.steam64}&reason=${this.payload.ban_reason}` + Random.getRndWebAppend())
axios.post(`/api/admin/kick?steam64=${steam64}&reason=${this.payload.ban_reason}` + Random.getRndWebAppend())
.then((response) => {
switch (response.status) {
case 200: {this.response=`Игрок был кикнут!`;break;}
@ -125,6 +138,15 @@ export default {
}
}).catch(()=>{})
.finally(()=>{this.sending = false;})
},
foundOfAny() {
if (this.s64 !== null) return null;
axios.post("/api/profile/steam/web" + Random.getRndWebNew(), {"any":this.any})
.then(response => {
if (response.status === 200 && response.data && 'steam64' in response.data) {
this.s64 = response.data['steam64'];
}
}).catch(()=>{})
}
},
}

3
src/components/ActionDialogs/BanListDialog.vue

@ -29,7 +29,7 @@
<md-dialog :md-active.sync="loading">
<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">
<h3 class="pidoras" style="text-align: center; padding: 2% 5%">Загрузка</h3>
<h3 class="tf2rainbow" style="text-align: center; padding: 2% 5%">Загрузка</h3>
</div>
</div>
</md-dialog>
@ -70,6 +70,7 @@ export default {
this.banlist.mdData = []
},
update(page, limit) {
if (this.loading === true) return;
const offset = Math.abs((page-1) * limit);
this.loading = true;
axios.get(`api/web/banlist?limit=${Math.abs(limit)}&offset=${offset}` + Random.getRndWebAppend()).then(

5
src/components/ActionDialogs/BanViewDialog.vue

@ -22,9 +22,11 @@
<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 v-if="this.$API.admin.permition.ban && ban['active'] === true" class="md-raised btn-hand" v-on:click="$refs.ad_bvd.showMe(true, 2)">Разбанить</md-button>
<md-button style="float: right" class="btn-colored" v-on:click="show=false">Закрыть</md-button>
</div>
<AdminInfoDialog ref="aid_bvd" />
<AdminDialog :steam64 = "null" :any="ban['steam_id']" ref="ad_bvd"/>
</div>
</md-dialog>
</template>
@ -33,10 +35,11 @@
import AdminInfoDialog from "@/components/ActionDialogs/AdminInfoDialog.vue";
import axios from "axios";
import Random from "@/api/Random";
import AdminDialog from "@/components/ActionDialogs/AdminDialog.vue";
export default {
name: "BanViewDialog",
components: {AdminInfoDialog},
components: {AdminDialog, AdminInfoDialog},
data: () => ({
show: false,
ban: null,

0
src/components/TabsMenuElements/BackendStatus/Components/FindPlayer.vue → src/components/ActionDialogs/FindPlayer.vue

3
src/components/ActionDialogs/GametimeDialog.vue

@ -28,7 +28,7 @@
<md-dialog :md-active.sync="loading">
<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">
<h3 class="pidoras" style="text-align: center; padding: 2% 5%">Загрузка</h3>
<h3 class="tf2rainbow" style="text-align: center; padding: 2% 5%">Загрузка</h3>
</div>
</div>
</md-dialog>
@ -67,6 +67,7 @@ export default {
this.gametime.mdData = []
},
update(page, limit) {
if (this.loading === true) return;
console.log(page, limit, this.rowsPerPage);
const offset = Math.abs((page-1) * limit);
this.loading = true;

36
src/components/Others/Loader/ProfileViewer.vue

@ -1,19 +1,27 @@
<template>
<md-dialog :md-active.sync="showProfileDialog" @close="showProfileDialog=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">
<h1 v-if="loading">Загрузка</h1>
<ProfileContainer v-else :player="player"/>
<hr width="100%" v-if="!loading">
<md-button v-if="!loading && this.$API.admin.permition.kick && player!==null && 'play_on' in player && player['play_on'] !== null" class="md-raised btn-high" v-on:click="$refs.ad.showMe(true, 3)">кикнуть</md-button>
<md-button v-if="!loading && this.$API.admin.permition.ban && player!==null && 'ban' in player && player['ban'] === null" class="md-raised btn-collect" v-on:click="$refs.ad.showMe(true, 1)">забанить</md-button>
<md-button v-if="!loading && this.$API.admin.permition.ban && player!==null && 'ban' in player && player['ban'] !== null" class="md-raised btn-hand" v-on:click="$refs.ad.showMe(true, 2)">разбанить</md-button>
<!--<md-button v-if="!loading && this.$API.admin.permition.mute" style="color: #131213; font-family: tf2build; background: lightgreen">замьютить</md-button>-->
<md-button v-if="!loading" v-on:click="showProfileDialog=false" style="float: right" class="btn-uniq">Закрыть</md-button>
<div>
<md-dialog :md-active.sync="showProfileDialog" @close="showProfileDialog=false" v-if="!loading">
<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">
<ProfileContainer :player="player"/>
<hr width="100%" v-if="!loading">
<md-button v-if="!loading && this.$API.admin.permition.kick && player!==null && 'play_on' in player && player['play_on'] !== null" class="md-raised btn-high" v-on:click="$refs.ad.showMe(true, 3)">кикнуть</md-button>
<md-button v-if="!loading && this.$API.admin.permition.ban && player!==null && 'ban' in player && player['ban'] === null" class="md-raised btn-collect" v-on:click="$refs.ad.showMe(true, 1)">забанить</md-button>
<md-button v-if="!loading && this.$API.admin.permition.ban && player!==null && 'ban' in player && player['ban'] !== null" class="md-raised btn-hand" v-on:click="$refs.ad.showMe(true, 2)">разбанить</md-button>
<!--<md-button v-if="!loading && this.$API.admin.permition.mute" style="color: #131213; font-family: tf2build; background: lightgreen">замьютить</md-button>-->
<md-button v-if="!loading" v-on:click="showProfileDialog=false" style="float: right" class="btn-uniq">Закрыть</md-button>
</div>
</div>
</div>
<AdminDialog :steam64 = "steam64" ref="ad"/>
</md-dialog>
<AdminDialog :steam64 = "steam64" ref="ad"/>
</md-dialog>
<md-dialog :md-active.sync="loading">
<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">
<h3 class="tf2rainbow" style="text-align: center; padding: 2% 5%">Загрузка</h3>
</div>
</div>
</md-dialog>
</div>
</template>
<script>

4
src/components/TabsMenu.vue

@ -10,7 +10,6 @@
<EmptyTab lb=""/>
<EmptyTab lb=""/>
<ProfileView/>
<BackendStatus/>
</md-tabs>
</div>
</template>
@ -23,12 +22,11 @@ import VipView from "@/components/TabsMenuElements/VipView/VipView.vue";
import AboutView from "@/components/TabsMenuElements/AboutView/AboutView.vue";
import EmptyTab from "@/components/TabsMenuElements/EmptyTab.vue";
import MainView from "@/components/TabsMenuElements/MainView/MainView.vue";
import BackendStatus from "@/components/TabsMenuElements/BackendStatus/BackendStatus.vue";
import BackgroundImage from "@/components/Others/Images/BackgroundImage.vue";
export default {
name: 'TabsMenu',
components: {BackendStatus, MainView, EmptyTab, RulesView, ServersView, ProfileView, VipView, AboutView, BackgroundImage},
components: {MainView, EmptyTab, RulesView, ServersView, ProfileView, VipView, AboutView, BackgroundImage},
data: () => ({
current_tab: ""
})

6
src/components/TabsMenuElements/AboutView/AboutView.vue

@ -34,6 +34,12 @@
</div>
<hr width="50%" align="right">
<p class="about-p">Зачем ждать? Заходи сейчас! Если админ не разлил пиво на сервера</p>
<hr width="50%" align="right">
<p style="text-align: right">
<a class="about-a" href="https://git.pblr-nyk.pro/gsd/Facti13.Frontend.VueMaterial">Сборка Frontend от {{this.$API.builddate !== null ? new Date(this.$API.builddate).toLocaleString() : 'Dev Build'}}</a>
<br>
<a class="about-a" href="https://git.pblr-nyk.pro/gsd/Facti13.Web.Backend.Java.V2">Сборка Backend от {{this.$API.stats["builddate"] !== null ? new Date(parseInt(this.$API.stats["builddate"])*1000).toLocaleString() : 'Dev Build'}}</a>
</p>
</div>
</div>
<hr width="80%">

15
src/components/TabsMenuElements/BackendStatus/BackendStatus.vue

@ -7,27 +7,19 @@
</div>
<div class="md-layout md-alignment-bottom-center" style="margin-top: -1.5%">
<div class="md-layout-item md-size-60 md-small-size-100 md-alignment-bottom-center rounded-only">
<h5 style="padding: 0% 3%">Сборка Frontend от {{this.$API.builddate !== null ? new Date(this.$API.builddate).toLocaleString() : 'Dev Build'}}</h5>
<h5 style="padding: 0% 3%">Сборка Backend от {{this.$API.stats["builddate"] !== null ? new Date(parseInt(this.$API.stats["builddate"])*1000).toLocaleString() : 'Dev Build'}}</h5>
<h5 v-if="this.$API.player.success_auth === false" style="text-align: center; cursor: pointer; text-decoration-line: underline" v-on:click="openAW()">Ты можешь искать других игроков здесь, но сначала надо авторизоваться!</h5>
<md-button v-else v-on:click="showFP()" class="btn-gosty">Найти игрока</md-button>
<FindPlayer ref="fp"/>
<h5 v-if="this.$API.player.success_auth === false" style="text-align: center; cursor: pointer; text-decoration-line: underline" v-on:click="openAW()">Ты можешь искать других игроков, но сначала надо авторизоваться! Зайтем перейти к себе в профиль и жамкнуть кнопку!</h5>
<AuthWindow ref="aw" />
<md-button v-on:click="openDW()" class="btn-old">Привязать стим к дискорду</md-button>
<DiscordWindow ref="dw"/>
</div>
</div>
</md-tab>
</template>
<script>
import FindPlayer from "@/components/TabsMenuElements/BackendStatus/Components/FindPlayer.vue";
import AuthWindow from "@/components/Others/Auth/AuthWindow.vue";
import DiscordWindow from "@/components/Others/Auth/DiscordWindow.vue";
export default {
name: "BackendStatus",
components: {DiscordWindow, AuthWindow, FindPlayer},
components: {AuthWindow},
props: {
s_icon: {
type: String,
@ -35,9 +27,6 @@ export default {
}
},
methods: {
showFP(){
this.$refs.fp.showFPD();
},
openAW() {
this.$refs.aw.openAW();
},

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

@ -176,9 +176,6 @@ export default {
.then(response => {
this.donates.store = response.data['donates'];
this.donates.loaded = true;
if (this.donates.store.length === 0) {
this.donates.store.push({"utime":Date.now()/1000, "status":"Пока тут пусто"})
}
})
.catch(() => this.donates.loaded = false)
.finally(() => this.donates.loading = false)
@ -191,9 +188,6 @@ export default {
.then(response => {
this.ban_list.store = response.data['ban_list'];
this.ban_list.loaded = true;
if (this.ban_list.store.length === 0) {
this.ban_list.store.push({"ban_utime":Date.now()/1000, "id":"Пока тут пусто, надеюсь", "ban_length":0})
}
})
.catch(() => this.ban_list.loaded = false)
.finally(() => this.ban_list.loading = false)
@ -207,10 +201,6 @@ export default {
this.usertime.store = this.$API.player.getGametime(this.$API, response.data['gametime']);
this.usertime.total = this.timeFormat(this.$API.player.getGametimeTotal(response.data['gametime']));
this.usertime.loaded = true;
if (this.usertime.store.length === 0) {
this.usertime.store.push(["Не играл ни где", 0]);
this.usertime.total = "отсутствует";
}
})
.catch(() => this.usertime.loaded = false)
.finally(() => this.usertime.loading = false)
@ -223,9 +213,6 @@ export default {
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)

13
src/components/TabsMenuElements/ProfileView/ProfileView.vue

@ -13,14 +13,21 @@
<hr width="50%">
<div v-if="this.$API.player.auth('steam') === false" class="clickable">
<h2 class="auth-button" v-on:click="openAW()">АВТОРИЗОВАТЬСЯ</h2>
<p style="text-align: center">Зачем это делать?</p>
<p style="text-align: center">Ты можешь смотреть статистику своего профиля или других игроков, отправлять репорты и узнавать сразу о своем бане.</p>
<p style="text-align: center">Так-же если ты горишь желанием зайти в наш уютненький дискордик, то на этой странице можно будет привязать дискорд к стиму чтоб зайти.</p>
</div>
<div v-else>
<ProfileContainer :player="$API.player.store"/>
<md-button class="btn-boss" v-on:click="logout()" style="float: left">Выйти</md-button>
<md-button v-on:click="$refs.pv_fp.showFPD()" class="btn-gosty" style="float: right; margin: 3% 5%">Найти игрока</md-button>
<md-button v-on:click="$refs.pv_dw.openDW()" class="btn-old" style="float: right; margin: 3% 0%">Привязать стим к дискорду</md-button>
<md-button class="btn-boss" v-on:click="logout()" style="float: left; margin: 3% 5%">Выйти</md-button>
</div>
</div>
</div>
<FindPlayer ref="pv_fp"/>
<AuthWindow ref="aw"/>
<DiscordWindow ref="pv_dw"/>
</md-tab>
</template>
@ -28,6 +35,8 @@
import CharacterImage from "@/components/Others/Images/CharacterImage.vue";
import AuthWindow from "@/components/Others/Auth/AuthWindow.vue";
import ProfileContainer from "@/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue";
import FindPlayer from "@/components/ActionDialogs/FindPlayer.vue";
import DiscordWindow from "@/components/Others/Auth/DiscordWindow.vue";
export default {
name: 'ProfileView',
props: {
@ -35,7 +44,7 @@ export default {
type: String
}
},
components: {ProfileContainer, AuthWindow, CharacterImage},
components: {DiscordWindow, FindPlayer, ProfileContainer, AuthWindow, CharacterImage},
methods: {
openAW() {
console.log('open auth window');

12
src/css/baseui.css

@ -13,4 +13,16 @@
@keyframes pidoras_key {
to {background-position:0 -200%}
}
.tf2rainbow {
background: linear-gradient(#FFD700 0%, #476291 10%, #4D7455 20%, #CF6A32 30%, #8650AC 40%, #38F3AB 50%, #AA0000 60%, #FAFAFA 70%, #70B04A 80%, #A50F79 90%, #B2B2B2 100%)
0 0/100% 200%;
animation: tf2rainbow_key 2s linear infinite;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
@keyframes tf2rainbow_key {
to {background-position:0 -200%}
}
Loading…
Cancel
Save