reprocess rework
This commit is contained in:
+16
-11
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user