Browse Source

new tables

master
gsd 1 year ago
parent
commit
8c43653a2a
  1. 2
      src/components/ActionDialogs/FindPlayer.vue
  2. 3
      src/components/ActionDialogs/Tables/BanListDialog.vue
  3. 5
      src/components/ActionDialogs/Tables/GametimeDialog.vue
  4. 0
      src/components/ActionDialogs/Tables/GametimeTagsDialog.vue
  5. 123
      src/components/ActionDialogs/Tables/KillAssistDeadDialog.vue
  6. 96
      src/components/ActionDialogs/Tables/LoveWeapons.vue
  7. 7
      src/components/ActionDialogs/Tables/MessagesDialog.vue
  8. 15
      src/components/TabsMenuElements/ProfileView/Components/ProfileContainer.vue
  9. 2
      src/components/TabsMenuElements/RulesView/RulesView.vue
  10. 2
      src/components/TabsMenuElements/ServersView/Components/ServerFullInfo.vue
  11. 11
      src/components/TabsMenuElements/ServersView/ServersView.vue

2
src/components/ActionDialogs/FindPlayer.vue

@ -1,5 +1,5 @@
<template>
<md-dialog :md-active.sync="showFindPlayerDialog" @close="showFindPlayerDialog=false">
<md-dialog :md-active.sync="showFindPlayerDialog" @close="showFindPlayerDialog=false" v-on:keyup.esc="showFindPlayerDialog=false" v-on:keyup.enter="foundPlayer()">
<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">
<h5 style="text-align: center; padding-left: 5%; padding-right: 5%;">Введи что-то из предложенного</h5>

3
src/components/ActionDialogs/BanListDialog.vue → src/components/ActionDialogs/Tables/BanListDialog.vue

@ -4,7 +4,7 @@
<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">
<h5 style="padding-left: 5%; padding-right: 5%">Быстрее иди играть чтоб оказаться тут!</h5>
<md-table v-model="banlist.mdData" md-card class="api-table">
<md-table v-if="banlist.mdData.length>0" v-model="banlist.mdData" md-card class="api-table">
<md-table-row class="clickable" slot="md-table-row" slot-scope="{ item }" v-on:click="$refs.bld_bvd.showMe(true, item)">
<md-table-cell md-label="#Id" md-numeric>{{ item.id }}</md-table-cell>
<md-table-cell md-label="Имя игрока">{{ item.player_name }}</md-table-cell>
@ -21,6 +21,7 @@
:md-separator="'из'"
style="font-family: tf2build"/>
</md-table>
<h4 v-else style="text-align: center">Пусто</h4>
<md-button style="float: right" class="btn-colored" v-on:click="showMe(false)">Закрыть</md-button>
</div>
</div>

5
src/components/ActionDialogs/GametimeDialog.vue → src/components/ActionDialogs/Tables/GametimeDialog.vue

@ -3,7 +3,7 @@
<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">
<md-table v-model="gametime.mdData" md-card class="api-table">
<md-table v-if="gametime.mdData.length>0" v-model="gametime.mdData" md-card class="api-table">
<md-table-row slot="md-table-row" slot-scope="{ item }">
<md-table-cell md-label="Никнейм">{{ item.player_name }}</md-table-cell>
<md-table-cell md-label="Карта">{{ item.map }}</md-table-cell>
@ -21,6 +21,7 @@
:md-separator="'из'"
style="font-family: tf2build"/>
</md-table>
<h4 v-else style="text-align: center">Пусто</h4>
<md-button style="float: left" class="btn-boss" v-if="gt_total!=null" v-on:click="$refs.gd_gtd.showMe(true, gt_total)">Узнать свой РАНГ</md-button>
<md-button style="float: right" class="btn-colored" v-on:click="showMe(false)">Закрыть</md-button>
</div>
@ -40,7 +41,7 @@
<script>
import axios from "axios";
import Random from "@/api/Random";
import GametimeTabsDialog from "@/components/ActionDialogs/GametimeTagsDialog.vue";
import GametimeTabsDialog from "@/components/ActionDialogs/Tables/GametimeTagsDialog.vue";
export default {
name: "GametimeDialog",

0
src/components/ActionDialogs/GametimeTagsDialog.vue → src/components/ActionDialogs/Tables/GametimeTagsDialog.vue

123
src/components/ActionDialogs/Tables/KillAssistDeadDialog.vue

@ -0,0 +1,123 @@
<template>
<div>
<md-dialog :md-active.sync="show" @close="show=false" v-on:keyup.esc="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">
<md-table v-if="mykills.mdData.length>0" v-model="mykills.mdData" md-card class="api-table" style="max-height: 666px; overflow-y: auto;">
<md-table-row slot="md-table-row" slot-scope="{ item }" :class="steam64 === null?'':'clickable'" v-on:click="$refs.mkd_fp.showFPD(type===0?item.victim_name:type===1?item.attacker_name:item.victim_name)">
<md-table-cell md-label="Время">{{ new Date(item.utime*1000).toLocaleString() }}</md-table-cell>
<md-table-cell v-if="type!==1" md-label="Жертва">{{ item.victim_name }}</md-table-cell>
<md-table-cell v-if="type!==0" md-label="Убийца">{{ item.attacker_name }}</md-table-cell>
<md-table-cell v-if="type!==2" md-label="Помог">{{ item.assister_name }}</md-table-cell>
<md-table-cell md-label="Оружие">{{ prepareWeaponName(item.weapon_name) }}</md-table-cell>
<md-table-cell md-label="Сервер">{{ $API.getHumanServerName(item.server_id) }}</md-table-cell>
</md-table-row>
<md-table-pagination ref="md_p"
:md-page-size="rowsPerPage"
:md-page-options="[5, 10, 15]"
:md-update="update"
:md-data.sync="mykills"
:md-label="type===0?'Твои убийства':type===1?'Твои смерти':'Твоя помощь другим'"
:md-separator="'из'"
style="font-family: tf2build"/>
</md-table>
<h4 v-else style="text-align: center">Пусто</h4>
<div style="padding-right: 2.5%; padding-left: 2.5%">
<md-field style="margin: 0% 0%;" v-if="srv_setted===false">
<label style="font-family: tf2secondary">Выбрать сервер</label>
<md-select v-model="srv" :mdClass="'ssm'">
<md-option :value="''">Выбрать все</md-option>
<md-option v-for="srv in $API.getServers4Selector()" :key="srv['srv']" :value="srv['srv']">{{srv['name']}}</md-option>
</md-select>
</md-field>
</div>
<md-button style="float: left;" class="btn-hand" v-on:click="update(1, rowsPerPage)">Искать</md-button>
<md-button style="float:left;" class="btn-unusual" v-if="type===0" v-on:click="$refs.mkd_lw.showMe(true, steam64, srv)">Любимые оружия</md-button>
<md-button style="float: right;" class="btn-colored" v-on:click="showMe(false)">Закрыть</md-button>
</div>
</div>
</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>
<FindPlayer_MKD ref="mkd_fp"/>
<LoveWeapons ref="mkd_lw"/>
</div>
</template>
<script>
import axios from "axios";
import Random from "@/api/Random";
import LoveWeapons from "@/components/ActionDialogs/Tables/LoveWeapons.vue";
export default {
name: "MyKillsDialog",
components: {LoveWeapons, FindPlayer_MKD: () => import("@/components/ActionDialogs/FindPlayer.vue")},
data: () => ({
show: false,
loading: false,
rowsPerPage: 5,
filter: "",
steam64: null,
srv: null,
srv_setted: false,
type: 0,
mykills: {
mdCount: 1,
mdPage: 1,
mdData: []
},
}),
methods: {
showMe(b, steam64, srv, type) {
if (steam64 !== undefined) this.steam64 = steam64;
if (srv !== undefined) {
this.srv_setted = true;
this.srv = srv;
}
if (type !== undefined) this.type = type;
if (b===true) this.update(1, this.rowsPerPage)
else this.show = b;
},
update(page, limit) {
if (this.loading === true) return;
console.log(page, limit, this.rowsPerPage);
const offset = Math.abs((page - 1) * limit);
this.loading = true;
let method;
switch (this.type) {
case 0: {method = "get";break;}
case 1: {method = "delete"; break;}
case 2: {method = "put"; break;}
}
axios[method](`api/profile/killfeed?${this.steam64 === null?'':`steam64=${this.steam64}&`}${this.srv===null?'':`srv=${this.srv}&`}limit=${Math.abs(limit)}&offset=${offset}` + Random.getRndWebAppend()).then(
(response) => {
if (response.status === 200) {
this.mykills.mdData = response.data['result'];
this.mykills.mdCount = response.data['count'];
this.mykills.mdPage = page;
} else {
console.log("cannot get mykills list, method: " + method);
}
this.show = true;
if (this.$refs.md_p !== undefined)
this.$refs.md_p.updatePage();
}
).catch((e) => {console.log(e)}).finally(() => this.loading = false)
},
prepareWeaponName(wp_name) {
//text-transform: capitalize;
if (wp_name.indexOf("TF_WEAPON_") !== -1) {
const string = wp_name.replace("TF_WEAPON_", "").toLowerCase();
return string[0].toUpperCase() + string.slice(1);
}
return wp_name;
}
}
}
</script>

96
src/components/ActionDialogs/Tables/LoveWeapons.vue

@ -0,0 +1,96 @@
<template>
<div>
<md-dialog :md-active.sync="show" @close="show=false" v-on:keyup.esc="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">
<md-table v-if="loveweapons.mdData.length>0" v-model="loveweapons.mdData" md-card class="" style="max-height: 666px; overflow-y: auto;">
<md-table-row slot="md-table-row" slot-scope="{ item }">
<md-table-cell md-label="Убито">{{ item.count }}</md-table-cell>
<md-table-cell md-label="Оружие">{{ prepareWeaponName(item.name) }}</md-table-cell>
<!--<md-table-cell md-label="Сервер">{{ $API.getHumanServerName(item.server_id) }}</md-table-cell>-->
</md-table-row>
</md-table>
<h4 v-else style="text-align: center">Пусто</h4>
<div style="padding-right: 2.5%; padding-left: 2.5%">
<md-field style="margin: 0% 0%;">
<label style="font-family: tf2secondary">Выбрать сервер</label>
<md-select v-model="srv" :mdClass="'ssm'">
<md-option :value="''">Выбрать все</md-option>
<md-option v-for="srv in $API.getServers4Selector()" :key="srv['srv']" :value="srv['srv']">{{srv['name']}}</md-option>
</md-select>
</md-field>
</div>
<md-button style="float: left" class="btn-hand" v-on:click="update(1, rowsPerPage)">Искать</md-button>
<md-button style="float: right" class="btn-colored" v-on:click="showMe(false)">Закрыть</md-button>
</div>
</div>
</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>
import axios from "axios";
import Random from "@/api/Random";
export default {
name: "LoveWeapons",
data: () => ({
show: false,
loading: false,
rowsPerPage: 10,
filter: "",
steam64: null,
srv: '',
//srv_setted: false,
loveweapons: {
mdCount: 1,
mdPage: 1,
mdData: []
},
}),
methods: {
showMe(b, steam64, srv) {
if (steam64 !== undefined) this.steam64 = steam64;
if (srv !== undefined) {
//this.srv_setted = true;
this.srv = srv;
}
if (b===true) this.update(1, this.rowsPerPage)
else this.show = b;
},
update(page, limit) {
if (this.loading === true) return;
console.log(page, limit, this.rowsPerPage);
const offset = Math.abs((page - 1) * limit);
this.loading = true;
axios.get(`api/profile/killfeed/weapons?${this.steam64 === null?'':`steam64=${this.steam64}&`}${this.srv===null?'':`srv=${this.srv}&`}limit=${Math.abs(limit)}&offset=${offset}` + Random.getRndWebAppend()).then(
(response) => {
if (response.status === 200) {
this.loveweapons.mdData = response.data['result'];
this.loveweapons.mdCount = response.data['count'];
this.loveweapons.mdPage = page;
} else {
console.log("cannot get weapons list");
}
this.show = true;
}
).catch((e) => {console.log(e)}).finally(() => this.loading = false)
},
prepareWeaponName(wp_name) {
//text-transform: capitalize;
if (wp_name.indexOf("TF_WEAPON_") !== -1) {
const string = wp_name.replace("TF_WEAPON_", "").toLowerCase().replace("_"," ");
return string[0].toUpperCase() + string.slice(1);
}
return wp_name;
}
}
}
</script>

7
src/components/ActionDialogs/MessagesDialog.vue → src/components/ActionDialogs/Tables/MessagesDialog.vue

@ -1,9 +1,9 @@
<template>
<div>
<md-dialog :md-active.sync="show" @close="show=false">
<md-dialog :md-active.sync="show" @close="show=false" v-on:keyup.esc="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">
<md-table v-model="messages.mdData" md-card class="api-table">
<md-table v-if="messages.mdData.length>0" v-model="messages.mdData" md-card class="api-table" style="max-height: 666px; overflow-y: auto;">
<md-table-row slot="md-table-row" slot-scope="{ item }" v-on:click="steam64 !== null?'':$refs.md_fp.showFPD(item.account_name)" :class="steam64 !== null?'':'clickable'">
<md-table-cell md-label="Никнейм" v-if="steam64 === null">{{ item.account_name }}</md-table-cell>
<md-table-cell md-label="Время">{{ new Date(item.utime*1000).toLocaleString() }}</md-table-cell>
@ -20,6 +20,7 @@
:md-separator="'из'"
style="font-family: tf2build"/>
</md-table>
<h4 v-else style="text-align: center">Пусто</h4>
<div style="padding-right: 2.5%; padding-left: 2.5%">
<md-field style="margin: 0% 0%;" v-if="srv_setted===false">
<label style="font-family: tf2secondary">Выбрать сервер</label>
@ -30,7 +31,7 @@
</md-field>
<md-field style="margin: 0% 0%">
<label style="font-family: tf2secondary">Фильтр сообщений</label>
<md-input v-model="filter"></md-input>
<md-input v-model="filter" v-on:keyup.enter="update(1, rowsPerPage)"></md-input>
</md-field>
</div>
<md-button style="float: left" class="btn-hand" v-on:click="update(1, rowsPerPage)">Искать</md-button>

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

@ -87,13 +87,14 @@
</div>
<p class="profile-text" style="text-align: right; cursor: pointer;" v-if="this.player['play_on'] !== null && 'ip' in this.player['play_on']" v-on:click="showIP()">IP : {{player_ip}}</p>
<p class="profile-text" style="text-align: right; cursor: pointer;" v-if="this.player['play_on'] !== null && 'country' in this.player['play_on']">Страна : {{this.player['play_on']['country']}}</p>
<p class="profile-text" style="text-align: right" v-if="this.player['killfeed'] !== null && 'kills' in this.player['killfeed']">Убийств : {{this.player['killfeed']['kills']}}</p>
<p class="profile-text" style="text-align: right" v-if="this.player['killfeed'] !== null && 'assists' in this.player['killfeed']">Помощи : {{this.player['killfeed']['assists']}}</p>
<p class="profile-text" style="text-align: right" v-if="this.player['killfeed'] !== null && 'deads' in this.player['killfeed']">Смертей : {{this.player['killfeed']['deads']}}</p>
<p class="profile-text clickable" style="text-align: right" v-if="this.player['killfeed'] !== null && 'kills' in this.player['killfeed']" v-on:click="$refs.pc_mkd.showMe(true, player['steamids']['steam64'], undefined, 0)">Убийств : {{this.player['killfeed']['kills']}}</p>
<p class="profile-text clickable" style="text-align: right" v-if="this.player['killfeed'] !== null && 'assists' in this.player['killfeed']" v-on:click="$refs.pc_mkd.showMe(true, player['steamids']['steam64'], undefined, 2)">Помощи : {{this.player['killfeed']['assists']}}</p>
<p class="profile-text clickable" style="text-align: right" v-if="this.player['killfeed'] !== null && 'deads' in this.player['killfeed']" v-on:click="$refs.pc_mkd.showMe(true, player['steamids']['steam64'], undefined, 1)">Смертей : {{this.player['killfeed']['deads']}}</p>
<p class="profile-text" style="text-align: right" v-if="this.player['killfeed'] !== null && 'suicides' in this.player['killfeed']">Суицидов : {{this.player['killfeed']['suicides']}}</p>
<MyKillsDialog ref="pc_mkd"/>
<MessagesDialog ref="pc_md"/>
<p class="profile-text clickable" style="text-align: right" v-if="'messages' in this.player" v-on:click="$refs.pc_md.showMe(true, player['steamids']['steam64'])">Сообщений : {{this.player['messages']}}</p>
<p class="profile-text" style="text-align: right; cursor: pointer" v-on:click="loadingUserTime()">Наиграно : {{usertime.total}}</p>
<p class="profile-text" style="text-align: right;" :class="usertime.total==='Показать'?'clickable':''" v-on:click="loadingUserTime()">Наиграно : {{usertime.total}}</p>
<div style="justify-content: right; display: flex">
<DiscordSvg :h="'10%'" :w="'40'" style="margin-left: 5%" v-if="this.player['attached_discords'].filter(v => v['active'] === 1).length>0" :url="`https://discord.com/channels/@me/${this.player['attached_discords'].filter(v => v['active'] === 1)[0]['discord_id']}`"/>
<SteamSvg :h="'10%'" :w="'40'" style="margin-left: 5%;" :url="this.player['steamids']['community_url']"/>
@ -112,12 +113,14 @@ import axios from "axios";
import SnackLoader from "@/components/Others/Loader/SnackLoader.vue";
import Random from "@/api/Random";
import BanViewDialog from "@/components/ActionDialogs/BanViewDialog.vue";
import GametimeDialog from "@/components/ActionDialogs/GametimeDialog.vue";
import MessagesDialog from "@/components/ActionDialogs/MessagesDialog.vue";
import GametimeDialog from "@/components/ActionDialogs/Tables/GametimeDialog.vue";
import MessagesDialog from "@/components/ActionDialogs/Tables/MessagesDialog.vue";
import MyKillsDialog from "@/components/ActionDialogs/Tables/KillAssistDeadDialog.vue";
export default {
name: "ProfileContainer",
components: {
MyKillsDialog,
MessagesDialog,
GametimeDialog,
BanViewDialog,

2
src/components/TabsMenuElements/RulesView/RulesView.vue

@ -32,7 +32,7 @@
<script>
import CharacterImage from "@/components/Others/Images/CharacterImage.vue";
import RuleCard from "@/components/TabsMenuElements/RulesView/Components/RuleCard.vue";
import BanListDialog from "@/components/ActionDialogs/BanListDialog.vue";
import BanListDialog from "@/components/ActionDialogs/Tables/BanListDialog.vue";
export default {
name: 'RulesView',

2
src/components/TabsMenuElements/ServersView/Components/ServerFullInfo.vue

@ -61,7 +61,7 @@
import SteamSvg from "@/components/Others/CustomSvg/SteamSvg.vue";
import TerminalSvg from "@/components/Others/CustomSvg/TerminalSvg.vue";
import PlayerExtendedInfo from "@/components/TabsMenuElements/ServersView/Components/PlayerExtendedInfo.vue";
import MessagesDialog from "@/components/ActionDialogs/MessagesDialog.vue";
import MessagesDialog from "@/components/ActionDialogs/Tables/MessagesDialog.vue";
export default {
name: "ServerFullInfo",

11
src/components/TabsMenuElements/ServersView/ServersView.vue

@ -5,12 +5,15 @@
</div>
<div class="md-layout md-alignment-bottom-center" v-on:click="updateServers()">
<div class="md-layout-item md-size-25 md-small-size-100 md-alignment-bottom-center rounded-and-colored clickable" style="z-index: 1">
<h3 class="txt-innert" style="text-align: center; margin: 4% 0%; line-height: 1em">Список серверов</h3>
<h3 class="txt-innert" style="text-align: center; margin: 4% 0%; line-height: 1em">Список серверов
<md-tooltip class="tooltip" md-direction="top">Нажми чтоб обновить его</md-tooltip>
</h3>
</div>
</div>
<div class="md-layout md-alignment-bottom-center" style="margin-top: -1.5%">
<div class="md-layout-item md-size-50 md-small-size-100 md-alignment-bottom-center rounded-only">
<h4 style="text-align: center">Для подключения к серверу нажми на него</h4>
<h4 style="text-align: center; margin-top: 5%; margin-bottom: 0%">Для подключения к серверу нажми на него</h4>
<p class="p-server clickable" v-if="this.$API.player.auth('steam') === true" v-on:click="$refs.sv_md.showMe(true)">Чаты серверов</p>
<hr>
<h5 style="text-align: center" v-if="this.$API.stats.servers['w'].length>0">где сейчас играют карлики</h5>
<ServerCard v-for="srv in this.$API.stats.servers['w']" :key="srv['name']" :server-name="srv['name']" :server-image="srv['preview']" :server-current-player="srv['player_count']" :server-max-player="srv['max_players']" :server-data="srv" :last_play="getLastPlay(srv['key'])"/>
@ -21,6 +24,7 @@
</div>
</div>
<SnackLoader ref="s_loader" s_text="Обновление списка серверов"/>
<MessagesDialog ref="sv_md"/>
</md-tab>
</template>
@ -28,9 +32,10 @@
import CharacterImage from "@/components/Others/Images/CharacterImage.vue";
import ServerCard from "@/components/TabsMenuElements/ServersView/Components/ServerCard.vue";
import SnackLoader from "@/components/Others/Loader/SnackLoader.vue";
import MessagesDialog from "@/components/ActionDialogs/Tables/MessagesDialog.vue";
export default {
name: 'ServersView',
components: {SnackLoader, ServerCard, CharacterImage},
components: {MessagesDialog, SnackLoader, ServerCard, CharacterImage},
data:() => ({
servers: {'w':[], 'n':[], 'e':[]},
lp_cache: null

Loading…
Cancel
Save