change order of elements in server list

This commit is contained in:
2023-05-06 13:12:48 +02:00
parent 6c7a502785
commit 76db4c262d
3 changed files with 7 additions and 8 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 KiB

After

Width:  |  Height:  |  Size: 512 KiB

+1 -1
View File
@@ -7,7 +7,7 @@
<meta content="Servers : Tone API" property="og:title" /> <meta content="Servers : Tone API" property="og:title" />
<meta content="Northstar servers kills statistics" property="og:description" /> <meta content="Northstar servers kills statistics" property="og:description" />
<meta content="https://toneapi.github.io/ToneAPI_webclient/servers" property="og:url" /> <meta content="https://toneapi.github.io/ToneAPI_webclient/servers" property="og:url" />
<meta content="https://toneapi.github.io/ToneAPI_webclient/server_og_image.png" property="og:image" /> <meta content="https://toneapi.github.io/ToneAPI_webclient/server_og_image.png?" property="og:image" />
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary_large_image">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
+6 -7
View File
@@ -6,28 +6,27 @@
<div class="serverList"> <div class="serverList">
<div class="serverHeaders"> <div class="serverHeaders">
<span></span> <span></span>
<span>Server name</span>
<span>Map</span> <span>Map</span>
<span>Server name</span>
<span>Players</span>
<span>Kills</span> <span>Kills</span>
<span>Max distance</span> <span>Max distance</span>
<span>Average distance</span> <span>Average distance</span>
<span>Players</span>
</div> </div>
<VirtualList :list="serverList" :row-height="100" v-slot="slotProps"> <VirtualList :list="serverList" :row-height="100" v-slot="slotProps">
<div <div
:class="'serverRow ' + (!nsServersByName[slotProps.data.name] ? 'offline ' : '') + (!nsServersByName[slotProps.data.name]?.playerCount ? 'inactive ' : '') + ((slotProps.index + 1) % 2 ? 'odd ' : 'uneven ')"> :class="'serverRow ' + (!nsServersByName[slotProps.data.name] ? 'offline ' : '') + (!nsServersByName[slotProps.data.name]?.playerCount ? 'inactive ' : '') + ((slotProps.index + 1) % 2 ? 'odd ' : 'uneven ')">
<div><span>{{ slotProps.index + 1 }}</span></div> <div><span>{{ slotProps.index + 1 }}</span></div>
<div><span>{{ slotProps.data.name + (!nsServersByName[slotProps.data.name] ? ' (offline)' : '') }}</span></div>
<img v-if="nsServersByName[slotProps.data.name]" <img v-if="nsServersByName[slotProps.data.name]"
:src="`${publicPath}maps/${nsServersByName[slotProps.data.name].map}_lobby.png`" /> :src="`${publicPath}maps/${nsServersByName[slotProps.data.name].map}_lobby.png`" />
<div v-if="!nsServersByName[slotProps.data.name]"></div> <div v-if="!nsServersByName[slotProps.data.name]"></div>
<div><span>{{ slotProps.data.name + (!nsServersByName[slotProps.data.name] ? ' (offline)' : '') }}</span></div>
<div><span>{{ nsServersByName[slotProps.data.name] ? nsServersByName[slotProps.data.name]?.playerCount
+ '/' + nsServersByName[slotProps.data.name]?.maxPlayers : '' }}</span></div>
<div><span>{{ slotProps.data._value.deaths }}</span></div> <div><span>{{ slotProps.data._value.deaths }}</span></div>
<div><span>{{ slotProps.data._value.max_distance }}</span></div> <div><span>{{ slotProps.data._value.max_distance }}</span></div>
<div><span>{{ Math.round(((slotProps.data._value.total_distance / slotProps.data._value.kills) || 0) * 100) / <div><span>{{ Math.round(((slotProps.data._value.total_distance / slotProps.data._value.kills) || 0) * 100) /
100 }}</span></div> 100 }}</span></div>
<div><span>{{ nsServersByName[slotProps.data.name] ? nsServersByName[slotProps.data.name]?.playerCount
+ '/' + nsServersByName[slotProps.data.name]?.maxPlayers : '' }}</span></div>
</div> </div>
</VirtualList> </VirtualList>
@@ -102,7 +101,7 @@ export default defineComponent({
.serverHeaders { .serverHeaders {
box-sizing: border-box; box-sizing: border-box;
display: grid; display: grid;
grid-template-columns: 4ch 20ch 178px 8ch 8ch 8ch 1fr; grid-template-columns: 4ch 178px 20ch 8ch 8ch 8ch 1fr;
background: var(--bg-color); background: var(--bg-color);
text-align: left; text-align: left;
cursor: pointer; cursor: pointer;