You've already forked AstralRinth
Tweak search sorting (#5464)
* Tweak search sorting * Tweak search sorting * fix ping impl * remove port field, add server regions * fix compile * fix tests * update frontend banner upload size limit * feat: use server project region instead of country * remove java and bedrock port in frontend * add helper text * allow filtering by if server is online * add server status online offline filter * use region in instance * pre-collapse status in app discovery * pnpm prepr * remove server discovery flag * add servers into mobile nav tabs * parse port from address if present --------- Co-authored-by: tdgao <mr.trumgao@gmail.com>
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { defineMessage, useVIntl } from '../../../composables'
|
||||
import { TagItem } from '../../base'
|
||||
|
||||
const { region } = defineProps<{
|
||||
region: string
|
||||
}>()
|
||||
|
||||
const { formatMessage } = useVIntl()
|
||||
const regionNames: Record<string, string> = {
|
||||
us_east: 'US East',
|
||||
us_west: 'US West',
|
||||
europe: 'Europe',
|
||||
asia: 'Asia',
|
||||
australia: 'Australia',
|
||||
south_america: 'South America',
|
||||
middle_east: 'Middle East',
|
||||
russia: 'Russia',
|
||||
}
|
||||
|
||||
const alt = defineMessage({
|
||||
id: 'project.server.region.alt',
|
||||
defaultMessage: 'Region: {regionCode}',
|
||||
})
|
||||
|
||||
const regionLower = computed(() => region.toLowerCase())
|
||||
const regionName = computed(() => regionNames[region] ?? region)
|
||||
</script>
|
||||
<template>
|
||||
<img
|
||||
v-tooltip="`Server hosted in ${region}`"
|
||||
:src="`https://flagcdn.com/${regionLower}.svg`"
|
||||
:alt="formatMessage(alt, { regionCode: regionLower })"
|
||||
class="h-4 aspect-[3/2] border-[1px] border-surface-5 border-solid shrink-0 rounded-[3px] object-cover smart-clickable:allow-pointer-events"
|
||||
/>
|
||||
<TagItem>{{ regionName }}</TagItem>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user