reprocess rework

This commit is contained in:
Sirttas
2026-06-19 23:05:42 +02:00
parent 981045da2f
commit 6dac42bbbe
6 changed files with 43 additions and 65 deletions
+16 -11
View File
@@ -1,31 +1,36 @@
<script setup lang="ts">
import { ReprocessInput, ReprocessItemValues, ReprocessResultTable, reprocess } from '@/reprocess';
import { useCharactersStore } from '@/characters';
import { ReprocessItemValues, ReprocessResultTable, reprocess } from '@/reprocess';
import { useStorage } from '@vueuse/core';
import { ref } from 'vue';
const items = ref("");
const materials = ref("");
const efficiency = useStorage('reprocess-efficiency', 0.55);
const charactersStore = useCharactersStore();
const characterId = useStorage<number | undefined>('reprocess-character', undefined);
const items = ref('');
const result = ref<ReprocessItemValues[]>([]);
const send = async () => result.value = await reprocess(items.value, materials.value, efficiency.value);
const send = async () => result.value = await reprocess(characterId.value, items.value);
</script>
<template>
<div class="grid mb-2 mt-4">
<div class="justify-self-end">
<span>Reprocess efficiency: </span>
<input type="number" min="0" max="1" step="0.05" v-model="efficiency" />
<span>Character: </span>
<select v-model="characterId">
<option v-for="character in charactersStore.characters" :key="character.characterId" :value="character.characterId">{{ character.name }}</option>
</select>
</div>
</div>
<div class="flex items-stretch">
<ReprocessInput name="Item JSON" v-model="items" />
<ReprocessInput name="Materials JSON" v-model="materials" />
<div class="flex-1 mx-1">
<span>Items</span>
<textarea class="mt-1" v-model="items" placeholder="Paste an EVE inventory listing" />
</div>
</div>
<div class="grid my-2">
<button class="justify-self-end" @click="send">Send</button>
<button class="justify-self-end" @click="send" :disabled="!characterId || !items.trim()">Send</button>
</div>
<template v-if="result.length > 0">
<hr />