Kkdjskjd
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import CardGraphEditor from '../components/CardGraphEditor.vue'
|
||||
import PseudoGuide from '../components/PseudoGuide.vue'
|
||||
import SourceGuide from '../components/SourceGuide.vue'
|
||||
|
||||
type Status = 'supported' | 'partial' | 'unsupported'
|
||||
|
||||
const statusLabels: Record<Status, string> = {
|
||||
supported: 'Supported',
|
||||
partial: 'Partial',
|
||||
unsupported: 'Unsupported',
|
||||
}
|
||||
|
||||
interface CardSummary {
|
||||
oracle_id: string
|
||||
name: string
|
||||
@@ -87,7 +92,6 @@ const rarityOptions = ['common', 'uncommon', 'rare', 'mythic', 'special', 'bonus
|
||||
const cmcOptions = ['0', '1', '2', '3', '4', '5', '6', '7+']
|
||||
|
||||
const view = ref<'editor' | 'guide'>('editor')
|
||||
const editorMode = ref<'text' | 'visual'>('text')
|
||||
const search = ref('')
|
||||
const statusFilter = ref('needs-work')
|
||||
const formatFilter = ref('')
|
||||
@@ -217,7 +221,7 @@ async function translate() {
|
||||
|
||||
async function reset() {
|
||||
if (!detail.value || saving.value) return
|
||||
if (!window.confirm('Delete the manual implementation and restore the generated one?')) return
|
||||
if (!window.confirm('Delete the verified implementation and restore the generated one?')) return
|
||||
saving.value = true
|
||||
editorError.value = ''
|
||||
try {
|
||||
@@ -269,7 +273,7 @@ onMounted(() => {
|
||||
{{ stats.supported.toLocaleString() }} supported ·
|
||||
{{ stats.partial.toLocaleString() }} partial ·
|
||||
{{ stats.unsupported.toLocaleString() }} unsupported ·
|
||||
{{ stats.manual.toLocaleString() }} manual
|
||||
{{ stats.manual.toLocaleString() }} verified
|
||||
</template>
|
||||
<template v-else>Loading stats…</template>
|
||||
</p>
|
||||
@@ -292,7 +296,7 @@ onMounted(() => {
|
||||
<option value="unsupported">Not implemented</option>
|
||||
<option value="partial">Partial</option>
|
||||
<option value="supported">Supported</option>
|
||||
<option value="manual">Manual</option>
|
||||
<option value="manual">Verified</option>
|
||||
<option value="all">All cards</option>
|
||||
</select>
|
||||
<button type="submit">Search</button>
|
||||
@@ -353,8 +357,16 @@ onMounted(() => {
|
||||
v-if="card.implementation"
|
||||
class="badge"
|
||||
:class="card.implementation.status"
|
||||
>{{ card.implementation.status }}</span>
|
||||
<span v-if="card.implementation?.manual" class="badge manual">manual</span>
|
||||
:title="statusLabels[card.implementation.status]"
|
||||
:aria-label="statusLabels[card.implementation.status]"
|
||||
>{{ card.implementation.status[0] }}</span>
|
||||
<span
|
||||
v-if="card.implementation"
|
||||
class="badge"
|
||||
:class="card.implementation.manual ? 'verified' : 'generated'"
|
||||
:title="card.implementation.manual ? 'Verified' : 'Generated'"
|
||||
:aria-label="card.implementation.manual ? 'Verified' : 'Generated'"
|
||||
>{{ card.implementation.manual ? 'V' : 'G' }}</span>
|
||||
</span>
|
||||
</button>
|
||||
</CardHover>
|
||||
@@ -381,8 +393,18 @@ onMounted(() => {
|
||||
</p>
|
||||
</div>
|
||||
<div class="badges">
|
||||
<span class="badge" :class="detail.compiled.status">{{ detail.compiled.status }}</span>
|
||||
<span v-if="detail.manual" class="badge manual">manual</span>
|
||||
<span
|
||||
class="badge"
|
||||
:class="detail.compiled.status"
|
||||
:title="statusLabels[detail.compiled.status]"
|
||||
:aria-label="statusLabels[detail.compiled.status]"
|
||||
>{{ detail.compiled.status[0] }}</span>
|
||||
<span
|
||||
class="badge"
|
||||
:class="detail.manual ? 'verified' : 'generated'"
|
||||
:title="detail.manual ? 'Verified' : 'Generated'"
|
||||
:aria-label="detail.manual ? 'Verified' : 'Generated'"
|
||||
>{{ detail.manual ? 'V' : 'G' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -402,23 +424,15 @@ onMounted(() => {
|
||||
</p>
|
||||
<p v-else-if="editorError" class="error">{{ editorError }}</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="tabs">
|
||||
<button type="button" :class="{ active: editorMode === 'text' }" @click="editorMode = 'text'">Text</button>
|
||||
<button type="button" :class="{ active: editorMode === 'visual' }" @click="editorMode = 'visual'">Visual</button>
|
||||
</div>
|
||||
<span class="muted grow">{{ editorMode === 'text' ? 'Pseudocode' : 'Node graph' }}</span>
|
||||
</div>
|
||||
<span class="muted">Card source</span>
|
||||
|
||||
<textarea
|
||||
v-if="editorMode === 'text'"
|
||||
v-model="source"
|
||||
spellcheck="false"
|
||||
aria-label="Card implementation"
|
||||
@keydown.ctrl.s.prevent="save"
|
||||
@keydown.meta.s.prevent="save"
|
||||
/>
|
||||
<CardGraphEditor v-else :key="detail.card.oracle_id" v-model="source" />
|
||||
|
||||
<div class="actions">
|
||||
<button type="button" class="primary" :disabled="saving || !dirty" @click="save">
|
||||
@@ -439,7 +453,7 @@ onMounted(() => {
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<PseudoGuide v-else />
|
||||
<SourceGuide v-else />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user