feat: add pinned inventory location enrichment

This commit is contained in:
jb
2026-09-20 12:13:51 -04:00
parent fe7d218195
commit 0c9197f841
32 changed files with 3116 additions and 55 deletions
+13
View File
@@ -2,6 +2,10 @@
import LiveCharacters from '$lib/components/LiveCharacters.svelte';
let { data } = $props();
const datasetLabel = (dataset: string) => dataset.replaceAll('_', ' ');
const assetsScope = 'esi-assets.read_assets.v1';
const structuresScope = 'esi-universe.read_structures.v1';
const locationState = (character: any) => character.authorizationStatus !== 'active' || !character.scopes.includes(assetsScope)
? 'reduced' : character.scopes.includes(structuresScope) ? 'granted' : 'missing';
</script>
<p class="eyebrow">APPLICATION-USER AGGREGATION</p><h1>Characters</h1>
<p class="muted">Connect each character explicitly. One primary character is the only signed-out login; linked characters are data-only until you switch the primary while authenticated.</p>
@@ -22,6 +26,7 @@
<p class="muted">Datasets: {character.datasets.map((dataset) => `${datasetLabel(dataset.dataset)}=${dataset.status}`).join(' · ')}</p>
{/if}
{#if character.assets.error}<p class="warning">{character.assets.error}</p>{/if}
<p class="muted">Inventory locations: <strong>{data.locationEnabled ? locationState(character) : 'unavailable'}</strong>{#if data.locationEnabled && locationState(character) === 'missing'} · Structure consent is required for private location evidence.{/if}</p>
{#if data.mode !== 'demo' && data.identityEnabled}
<div class="row">
{#if character.loginRole === 'data_only' && character.authorizationStatus === 'active'}
@@ -33,6 +38,14 @@
<input type="hidden" name="targetCharacterId" value={character.id} />
<button class="quiet">{character.authorizationStatus === 'active' ? 'Refresh authorization' : 'Reconnect'}</button>
</form>
{#if character.authorizationStatus === 'active' && data.locationEnabled && character.scopes.includes(assetsScope) && !character.scopes.includes(structuresScope)}
<form method="POST" action="/auth/eve">
<input type="hidden" name="capability" value="inventory_locations" />
<input type="hidden" name="intent" value="upgrade_dataset" />
<input type="hidden" name="targetCharacterId" value={character.id} />
<button class="quiet">Authorize private locations</button>
</form>
{/if}
{#if character.authorizationStatus === 'active' && data.walletEnabled}
<form method="POST" action="/auth/eve">
<input type="hidden" name="capability" value="wallet_balance" />