Browse Source

общая стата

master
gsd 1 year ago
parent
commit
abcd455b41
  1. 5
      public/index.html
  2. 4
      src/api/GlobalApi.js
  3. 19
      src/assets/flags/Flag_of_Belarus.svg
  4. 1
      src/assets/flags/Flag_of_Kazakhstan.svg
  5. 1
      src/assets/flags/Flag_of_Russia.svg
  6. 4
      src/assets/flags/Flag_of_Shit.svg
  7. 18
      src/assets/flags/Flag_of_SoyGoys.svg
  8. 4
      src/components/ActionDialogs/ServerStatsDialog.vue
  9. 103
      src/components/ActionDialogs/SummaryStatsDialog.vue
  10. 1
      src/components/TabsMenuElements/ServersView/Components/ServerFullInfo.vue
  11. 10
      src/components/TabsMenuElements/ServersView/ServersView.vue

5
public/index.html

@ -4,8 +4,11 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="Team Fortress 2 Community server">
<meta name="keywords" content="TF2, Facti13, MVM, Team Fortress 2, тф2, факты13, факты 13, тип фортрес 2, мге, mge">
<meta name="author" content="Facti13">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Ебло тупое</title>
<title>Факты13 \ Facti13</title>
</head>
<body>
<noscript>

4
src/api/GlobalApi.js

@ -19,7 +19,7 @@ export default class GlobalApi {
"e":[],
"n":[]
},
'uniq': null,
'uniq': {"uniq":{"total":0,"month":0,"year":0,"day":0}},
'builddate':0,
'ban_count':0,
"donate":{
@ -141,7 +141,7 @@ export default class GlobalApi {
document.title = `Загрузка - Факты 13`;
let need2load = [
this.fillThis('statistic'),
this.fillThis('uniq'),
//this.fillThis('uniq'),
this.fillThis('donate'),
this.fillServers(),
this.vip.getVipPrices(this.load_stages),

19
src/assets/flags/Flag_of_Belarus.svg

@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1200" height="600" viewBox="0 0 378 189">
<title>Flag of Belarus</title>
<defs>
<clipPath id="p">
<path d="m0 0h200v608h8v284l-8 8H0z"/>
</clipPath>
</defs>
<path fill="#ce1720" d="m0 0h378v189H0z"/>
<g transform="matrix(.21,0,0,.21,2,0)" clip-path="url(#p)" fill="#fff">
<g id="b">
<path id="a" d="m36 0v14h-9v14H16v16H8v13H-8V24H8V6H-8V0zm26 77v15h-8v12h-8V92h-8V77h-8V57h8V42h8V30h8v12h8v15h8v20zm-17-1h10V58H45zM19 183h8v-18h-8zm54 0h8v-18h-8zM-8 305H6v13h6v16h9v15h12v-15h9v-16h8v-13H38v-15h21v10h13v17h11v19h-8v14h-7v13h-6v14h-9v12h-7v11h-9v14H24v-15h-9v-14H8v-9H-8v-23H8v-20H-8z"/>
<use xlink:href="#a" transform="matrix(-1,0,0,1,200,0)"/>
<path d="m96 0v32h8V0h32v14h-8v14h-12v16h-8v13H92V44h-8V28H72V14h-8V0zm-2 274v-11h-6v-13h-7v-14h-8v-14h-8v-10h-9v-14H44v14h-9v10h-7v14h-8v14h-6v13H8v17H-8v-44H8v-20H-8v-33H8v14h10v14h10v-14h10v-14h8v-18h-8v-14H28v-14H18v14H8v14H-8v-41H8v-19H-8V77H8v13h8v16h11v13h9v15h7v12h14v-12h7v-15h9v-13h11V90h8V77h16v13h8v16h11v13h9v15h7v12h14v-12h7v-15h9v-13h11V90h8V77h16v28h-16v19h16v41h-16v-14h-10v-14h-10v14h-10v14h-8v18h8v14h10v14h10v-14h10v-14h16v33h-16v20h16v44h-16v-17h-6v-13h-6v-14h-8v-14h-7v-10h-9v-14h-12v14h-9v10h-8v14h-8v14h-7v13h-6v11zm2-167v27h8v-27zm-4 58v-14H82v-14H72v14H62v14h-8v18h8v14h10v14h10v-14h10v-14h16v14h10v14h10v-14h10v-14h8v-18h-8v-14h-10v-14h-10v14h-10v14zm4 46v27h8v-27z"/>
</g>
<use xlink:href="#b" transform="matrix(1,0,0,-1,0,900)"/>
<path d="m-8 408H8v14h7v8h8v14h7v12h-7v14h-8v8H8v14H-8zm216 0v84h-16v-14h-7v-8h-8v-14h-7v-12h7v-14h8v-8h7v-14zM62 459h8v-18h-8zm76 0v-18h-8v18zm-42-59h8v-18h-8zm0 100v18h8v-18zm-50-75h14v-11h10v-10h5v-10h6v-14h8v-14h4v-13h14v13h4v14h8v14h6v10h5v10h10v11h14v50h-14v11h-10v10h-5v10h-6v14h-8v14h-4v13H93v-13h-4v-14h-8v-14h-6v-10h-5v-10H60v-11H46zm50 9v-15h-8v-10h-8v25h8v9h5v14h-5v9h-8v25h8v-10h8v-15h8v15h8v10h8v-25h-8v-9h-5v-14h5v-9h8v-25h-8v10h-8v15z"/>
</g>
<path fill="#007c30" d="m44 126h334v63H44z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

1
src/assets/flags/Flag_of_Kazakhstan.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.4 KiB

1
src/assets/flags/Flag_of_Russia.svg

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 6" width="900" height="600"><rect fill="#fff" width="9" height="3"/><rect fill="#d52b1e" y="3" width="9" height="3"/><rect fill="#0039a6" y="2" width="9" height="2"/></svg>

After

Width:  |  Height:  |  Size: 265 B

4
src/assets/flags/Flag_of_Shit.svg

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800">
<rect width="1200" height="800" fill="#0057B7"/>
<rect width="1200" height="400" y="400" fill="#FFD700"/>
</svg>

After

Width:  |  Height:  |  Size: 179 B

18
src/assets/flags/Flag_of_SoyGoys.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 33 KiB

4
src/components/ActionDialogs/ServerStatsDialog.vue

@ -31,7 +31,9 @@
<p>За текущий год {{uniq.year}} игроков</p>
<p>За все существование {{uniq.total}} игроков</p>
</div>
<md-button class="btn-boss" v-on:click="show=false">Ясно понятно, пойду посру</md-button>
<div style="text-align: center">
<md-button class="btn-boss" v-on:click="show=false">Ясно понятно, пойду посру</md-button>
</div>
</div>
</div>
</md-dialog>

103
src/components/ActionDialogs/SummaryStatsDialog.vue

@ -0,0 +1,103 @@
<template>
<md-dialog :md-active.sync="show" @close="show=false" :mdClickOutsideToClose="true">
<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">
<div style="padding: 0% 5%; min-width: 450px; max-width: 450px">
<h5 style="text-align: center">Статистика за все серверы</h5>
<p>Статистика с учетом игры более 5 минут, уникальностью являются разные ip адреса, данные со всех серверов начиная с 2018 года</p>
</div>
<div style="padding: 0% 5%; min-width: 450px; max-width: 450px">
<h5 style="text-align: center">Игроки по странам</h5>
<div class="md-layout md-alignment-bottom-center">
<div class="md-layout-item md-size-20" style="text-align: center">
<img style="height: 32px" :src="require('/src/assets/flags/Flag_of_Russia.svg')" alt="Русские">
<p>{{this.countries.Russia}}</p>
</div>
<div class="md-layout-item md-size-20" style="text-align: center">
<img style="height: 32px" :src="require('/src/assets/flags/Flag_of_Belarus.svg')" alt="Белоруссы">
<p>{{this.countries.Belarus}}</p>
</div>
<div class="md-layout-item md-size-20" style="text-align: center">
<img style="height: 32px" :src="require('/src/assets/flags/Flag_of_Kazakhstan.svg')" alt="Казахи">
<p>{{this.countries.Kazakhstan}}</p>
</div>
<div class="md-layout-item md-size-20" style="text-align: center">
<img style="height: 32px" :src="require('/src/assets/flags/Flag_of_Shit.svg')" alt="Хохлы">
<p>{{this.countries.Ukraine}}</p>
</div>
<div class="md-layout-item md-size-20" style="text-align: center">
<img style="height: 32px" :src="require('/src/assets/flags/Flag_of_SoyGoys.svg')" alt="Скот">
<p>{{this.countries.OtherGoys}}</p>
</div>
</div>
</div>
<div style="padding: 1% 5%; min-width: 450px; max-width: 450px">
<h5 style="text-align: center; margin: 0 0">Уникальные игроки</h5>
<p>За текущий день {{uniq.day}} игроков</p>
<p>За текущий месяц {{uniq.month}} игроков</p>
<p>За текущий год {{uniq.year}} игроков</p>
<p>За все существование {{uniq.total}} игроков</p>
</div>
<div style="text-align: center">
<md-button class="btn-boss" v-on:click="show=false">А вот у куплинова больше</md-button>
</div>
</div>
</div>
</md-dialog>
</template>
<script>
import axios from "axios";
import Random from "@/api/Random";
export default {
name: "SummaryStatsDialog",
data: () => ({
show: false,
countries: {"Russia":0, "Ukraine": 0, "Belarus":0, "Kazakhstan":0, "OtherGoys":0},
uniq: {"total":0,"month":0,"year":0,"day":0}
}),
methods: {
showMe(b) {
if (b === true) this.preShow();
//this.show = b;
},
preShow(){
let countries_load = false;
let uniq_load = false;
axios.get(`/api/stats?filter=countries` + Random.getRndWebAppend())
.then(response => response.data)
.then(response => {
countries_load = true;
this.countries = response['countries'];
this.countries["OtherGoys"] = 0;
for (const country in response["countries"]) {
if (["Russia", "Ukraine", "Belarus", "Kazakhstan", "OtherGoys"].indexOf(country) !== -1) continue;
this.countries["OtherGoys"] += response["countries"][country];
}
})
.catch(err => {
console.log(`[API] cannot request country stats, err: ${err}`);
}).finally(() => {
this.show = countries_load && uniq_load;
});
axios.get(`/api/stats?filter=uniq` + Random.getRndWebAppend())
.then(response => response.data)
.then(response => {
uniq_load = true;
this.uniq = response['uniq'];
})
.catch(err => {
console.log(`[API] cannot request uniq stats, err: ${err}`);
}).finally(() => {
this.show = countries_load && uniq_load;
});
}
}
}
</script>

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

@ -61,6 +61,7 @@
</md-table>
<PlayerExtendedInfo ref="pei" :player="selected_player"/>
</div>
<p class="p-server" style="text-align: center; margin: 2.5% 0;">Обновлен: {{(new Date(serverInfo['last_update']*1000)).toLocaleString()}}</p>
</div>
</div>
</md-dialog>

10
src/components/TabsMenuElements/ServersView/ServersView.vue

@ -21,7 +21,11 @@
<p class="p-server clickable" style="display: inline" v-on:click="$refs.sv_kdt.showMe(true, 2)">Топ смертей</p>
</div>
<hr>
<h5 style="text-align: center; margin: 0% 0%" class="clickable" v-on:click="$refs.sv_wwm.showMe(true)">Карта серверов</h5>
<div style="text-align: center">
<h5 style="margin: 0% 0%; display: inline" class="clickable" v-on:click="$refs.sv_wwm.showMe(true)">Карта серверов</h5>
<h5 style="margin: 0% 0%; display: inline"> | </h5>
<h5 style="margin: 0% 0%; display: inline" class="clickable" v-on:click="$refs.sv_ssd.showMe(true)">Статистика</h5>
</div>
<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'])"/>
@ -35,6 +39,7 @@
<MessagesDialog ref="sv_md"/>
<KillDeadTop ref="sv_kdt"/>
<WorldwideMap ref="sv_wwm"/>
<SummaryStatsDialog ref="sv_ssd"/>
</md-tab>
</template>
@ -45,9 +50,10 @@ import SnackLoader from "@/components/Others/Loader/SnackLoader.vue";
import MessagesDialog from "@/components/ActionDialogs/Tables/MessagesDialog.vue";
import KillDeadTop from "@/components/ActionDialogs/Tables/KillDeadTop.vue";
import WorldwideMap from "@/components/ActionDialogs/WorldwideMap.vue";
import SummaryStatsDialog from "@/components/ActionDialogs/SummaryStatsDialog.vue";
export default {
name: 'ServersView',
components: {WorldwideMap, KillDeadTop, MessagesDialog, SnackLoader, ServerCard, CharacterImage},
components: {SummaryStatsDialog, WorldwideMap, KillDeadTop, MessagesDialog, SnackLoader, ServerCard, CharacterImage},
data:() => ({
servers: {'w':[], 'n':[], 'e':[]},
lp_cache: null

Loading…
Cancel
Save