feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
<script setup lang="ts">
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
|
import type { Report, ReportType } from '~/types/game'
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
|
2026-10-28 23:38:54 +00:00
|
|
|
|
definePageMeta({ layout: 'game' })
|
|
|
|
|
|
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
const worldId = Number(route.params.worldId)
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
|
const { page, type, error, busy, load, remove, readAll } = useReports(worldId)
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
useCurrentWorld().enter(worldId)
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
const clock = useNow()
|
|
|
|
|
|
|
2026-10-29 00:26:08 +00:00
|
|
|
|
// The kind of reports comes from the URL, so the menu's dropdown and the side menu link here.
|
|
|
|
|
|
const KINDS = ['attack', 'defense', 'support'] as const
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => route.query.type,
|
|
|
|
|
|
(q) => {
|
|
|
|
|
|
type.value = KINDS.includes(q as ReportType) ? (q as ReportType) : null
|
|
|
|
|
|
load(Number(route.query.page) || 1)
|
|
|
|
|
|
},
|
|
|
|
|
|
{ immediate: true },
|
|
|
|
|
|
)
|
|
|
|
|
|
const kinds = computed(() =>
|
|
|
|
|
|
(['all', ...KINDS] as const).map((k) => ({
|
|
|
|
|
|
key: k,
|
|
|
|
|
|
label: t(`reports.kinds.${k}`),
|
|
|
|
|
|
to: k === 'all' ? `/reports/${worldId}` : { path: `/reports/${worldId}`, query: { type: k } },
|
|
|
|
|
|
active: (type.value ?? 'all') === k,
|
|
|
|
|
|
count: k === 'all' ? page.value?.unread : undefined,
|
|
|
|
|
|
})),
|
|
|
|
|
|
)
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
|
|
|
|
|
|
const selected = ref<number[]>([])
|
|
|
|
|
|
watch(page, () => (selected.value = []))
|
|
|
|
|
|
const allSelected = computed(() => !!page.value?.reports.length && selected.value.length === page.value.reports.length)
|
|
|
|
|
|
function toggleAll() {
|
|
|
|
|
|
selected.value = allSelected.value ? [] : (page.value?.reports.map((r) => r.id) ?? [])
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function subject(r: Report) {
|
|
|
|
|
|
if (r.type === 'support') return t('reports.title_support', { from: villageLabel(r.payload.from), to: villageLabel(r.payload.to) })
|
|
|
|
|
|
return t('reports.title_attack', { from: villageLabel(r.payload.attacker.village), to: villageLabel(r.payload.defender.village) })
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const DOT = { won: 'bg-moss-600', losses: 'bg-gold-500', lost: 'bg-blood-700', info: 'bg-iron-400' }
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<!-- The report list, like Die Stämme's: kinds on the left; a dot for the outcome, unread in bold, newest first; act on checked rows. -->
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
<template>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<div class="space-y-2 p-2.5">
|
2026-10-29 14:59:48 +00:00
|
|
|
|
<div class="grid gap-2 @2xl:grid-cols-[10rem_minmax(0,1fr)]">
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<UiSideMenu :items="kinds" class="self-start" />
|
|
|
|
|
|
|
|
|
|
|
|
<section class="panel min-w-0">
|
|
|
|
|
|
<p v-if="error" class="alert m-2" role="alert">{{ error }}</p>
|
2026-10-29 13:09:03 +00:00
|
|
|
|
<p v-if="!page" class="py-6 text-center text-sm text-ink-500">{{ $t('common.loading') }}</p>
|
|
|
|
|
|
<p v-else-if="!page.reports.length" class="py-6 text-center text-sm text-ink-500">{{ $t('reports.none') }}</p>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
<template v-else>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<table class="grid-table">
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
<thead>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<tr>
|
|
|
|
|
|
<th class="w-6"><input type="checkbox" :checked="allSelected" :aria-label="$t('reports.select_all')" @change="toggleAll" /></th>
|
|
|
|
|
|
<th>{{ $t('reports.subject') }}</th>
|
|
|
|
|
|
<th class="text-right">{{ $t('reports.received') }}</th>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
</thead>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<tbody>
|
|
|
|
|
|
<tr v-for="r in page.reports" :key="r.id" class="hover:bg-parchment-100">
|
|
|
|
|
|
<td><input v-model="selected" type="checkbox" :value="r.id" :aria-label="$t('reports.select', { subject: subject(r) })" /></td>
|
|
|
|
|
|
<td>
|
|
|
|
|
|
<NuxtLink :to="`/reports/${worldId}/${r.id}`" class="flex items-center gap-1.5 hover:text-blood-700 hover:underline" :class="r.read ? '' : 'font-bold'">
|
|
|
|
|
|
<span class="size-2 shrink-0 rounded-full" :class="DOT[reportTone(r)]" :title="$t(`reports.tone.${reportTone(r)}`)" />
|
|
|
|
|
|
<IconUi :name="r.type === 'support' ? 'support' : 'attack'" class="size-3.5 shrink-0 text-ink-500" />
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
<span class="min-w-0">{{ subject(r) }}</span>
|
|
|
|
|
|
<span v-if="!r.read" class="sr-only">({{ $t('reports.unread') }})</span>
|
|
|
|
|
|
</NuxtLink>
|
|
|
|
|
|
</td>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<td class="text-right whitespace-nowrap text-ink-700 tabular-nums">{{ formatArrival(Date.parse(r.happened_at), clock, t) }}</td>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<div class="flex flex-wrap items-center gap-2 bg-parchment-200 px-1.5 py-1">
|
2026-10-29 13:09:03 +00:00
|
|
|
|
<label class="flex items-center gap-1 text-sm">
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<input type="checkbox" :checked="allSelected" @change="toggleAll" />
|
|
|
|
|
|
{{ $t('reports.select_all') }}
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<button type="button" class="btn btn-primary" :disabled="busy || !selected.length" @click="remove(selected)">{{ $t('reports.delete') }}</button>
|
|
|
|
|
|
<button v-if="page.unread" type="button" class="btn btn-outline" :disabled="busy" @click="readAll()">{{ $t('reports.read_all') }}</button>
|
2026-10-29 13:09:03 +00:00
|
|
|
|
<div v-if="page.pages > 1" class="ml-auto flex items-center gap-1 text-sm">
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<button type="button" class="btn btn-ghost" :disabled="busy || page.page <= 1" @click="load(page.page - 1)">‹ {{ $t('reports.prev') }}</button>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
<span class="tabular-nums text-ink-700">{{ $t('reports.page', { page: page.page, pages: page.pages }) }}</span>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<button type="button" class="btn btn-ghost" :disabled="busy || page.page >= page.pages" @click="load(page.page + 1)">{{ $t('reports.next') }} ›</button>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
</section>
|
|
|
|
|
|
</div>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|