Refactor(ip-infos): drop the default map images

A card only shows its map once location data has landed, so the bundled
placeholder maps were never meant to be seen, and their labels sat in one
language among many. An empty map URL now renders a same-sized muted box,
which also covers a payload with a country but no coordinates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jason5ng32andClaude Opus 5.5 committed 2026-10-17 09:35:31 +08:00
1 parent 6e40a611d3
commit b84a1d3764
4 files changed
+10 -4

No files matched your search

+2 -2
View File
@@ -70,8 +70,8 @@ const createDefaultCard = () => ({
isp: "",
asn: "",
asnlink: "",
mapUrl: '/res/defaultMap.webp',
mapUrl_dark: '/res/defaultMap_dark.webp',
mapUrl: "",
mapUrl_dark: "",
});
// IP data cards
@@ -10,21 +10,27 @@
<span class="font-mono shrink-0 truncate whitespace-nowrap">{{ data.longitude }}, {{ data.latitude
}}</span>
</div>
<!-- No map URL (no coordinates, or the card is reloading): a same-sized
muted box instead of a broken image. -->
<span>
<img :src="isDarkMode ? data.mapUrl_dark : data.mapUrl"
<img v-if="mapSrc" :src="mapSrc"
class="w-full rounded-md border bg-muted aspect-2/1 object-cover" alt="Map">
<span v-else class="block w-full rounded-md border bg-muted aspect-2/1" aria-hidden="true"></span>
</span>
</template>
<script setup>
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { Earth } from '@lucide/vue';
const { t } = useI18n();
defineProps({
const props = defineProps({
// The IP payload — coordinates / mapUrl(_dark).
data: { type: Object, required: true },
isDarkMode: { type: Boolean, required: true },
});
const mapSrc = computed(() => (props.isDarkMode ? props.data.mapUrl_dark : props.data.mapUrl));
</script>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB