change v2 route to prod
This commit is contained in:
@@ -12,11 +12,11 @@
|
|||||||
<option v-for="weaponId in sortedWeaponList" v-bind:key="weaponId" :value="weaponId">{{ weaponId }}</option>
|
<option v-for="weaponId in sortedWeaponList" v-bind:key="weaponId" :value="weaponId">{{ weaponId }}</option>
|
||||||
</select> -->
|
</select> -->
|
||||||
|
|
||||||
<VueMultiselect selectLabel="" deselectLabel="remove" placeholder="Select server" v-model="filters.server"
|
<VueMultiselect selectLabel="" deselectLabel="remove" placeholder="Select server" v-model="model.server"
|
||||||
:options="sortedServerList" :allow-empty="true" :custom-label="((e:Server) => e)"
|
:options="groupedServers" group-values="servers" group_label="id" :group-select="false" :allow-empty="true" :multiple="false" :custom-label="((e:any) => e.name)" track-by="name" label="name"
|
||||||
></VueMultiselect>
|
></VueMultiselect>
|
||||||
|
|
||||||
<VueMultiselect selectLabel="" deselectLabel="remove" placeholder="Select weapon" v-model="filters.weapon"
|
<VueMultiselect selectLabel="" deselectLabel="remove" placeholder="Select weapon" v-model="model.weapon"
|
||||||
:options="sortedWeaponList" :allow-empty="true"
|
:options="sortedWeaponList" :allow-empty="true"
|
||||||
></VueMultiselect>
|
></VueMultiselect>
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
model: { server: undefined, weapon: undefined } as unknown as {weapon:Weapon | Weapon[], server: (Server& {name?:string}) | (Server& {name?:string})[]},
|
||||||
filters: {} as Filters,
|
filters: {} as Filters,
|
||||||
store: useKillStore(),
|
store: useKillStore(),
|
||||||
playerHighlighted: undefined
|
playerHighlighted: undefined
|
||||||
@@ -65,6 +66,14 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
|
groupedServers () {
|
||||||
|
const hosts = [] as {id:string, servers:(Server& {name?:string})[] }[]
|
||||||
|
Object.entries(this.servers).forEach((e) => {
|
||||||
|
if (!hosts.find(host => host.id === e[1].host + 'sfdsdfsd')) hosts.push({ id: e[1].host + 'sfdsdfsd', servers: [] as Server[] })
|
||||||
|
hosts.find(host => host.id === e[1].host + 'sfdsdfsd')?.servers.push({ name: e[0], ...e[1] })
|
||||||
|
})
|
||||||
|
return hosts
|
||||||
|
},
|
||||||
weapons (): { [key: string]: Weapon } {
|
weapons (): { [key: string]: Weapon } {
|
||||||
const { weapon: _, player: _1, ...withoutWeapons } = this.filters
|
const { weapon: _, player: _1, ...withoutWeapons } = this.filters
|
||||||
const data = this.store.getWeaponList(withoutWeapons)?.data
|
const data = this.store.getWeaponList(withoutWeapons)?.data
|
||||||
@@ -109,6 +118,15 @@ export default defineComponent({
|
|||||||
return 0
|
return 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
model: {
|
||||||
|
handler (newModel) {
|
||||||
|
this.filters.server = newModel.server?.name
|
||||||
|
this.filters.weapon = newModel.weapon
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user