feat(redesign): re-skin plugin-config editors + Loot Builder to DS (Phase D batch 3)
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
10 plugin-config views (LootBuilder, RaidableBases, Teleport, Kits, Gather, AutoDoors, FurnaceSplitter, BetterChat, TimedExecute, PluginConfigs landing) + 5 child components (loot sidebar/item-editor/group-editor/item-picker, teleport PermissionGroupEditor) re-skinned onto DS components + tokens. All config logic preserved (path-traversal get/set, apply-to-server, import-from-server, CRUD, multiplier logic, per-store status derivation). Presentation-only. Build green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useGatherStore } from '@/stores/gather'
|
||||
import {
|
||||
Save,
|
||||
Play,
|
||||
Download,
|
||||
Plus,
|
||||
Trash2,
|
||||
Pickaxe,
|
||||
Settings as SettingsIcon,
|
||||
} from 'lucide-vue-next'
|
||||
import Panel from '@/components/ds/data/Panel.vue'
|
||||
import Button from '@/components/ds/core/Button.vue'
|
||||
import Icon from '@/components/ds/core/Icon.vue'
|
||||
import Tabs from '@/components/ds/navigation/Tabs.vue'
|
||||
import EmptyState from '@/components/ds/feedback/EmptyState.vue'
|
||||
|
||||
const store = useGatherStore()
|
||||
|
||||
@@ -20,51 +16,51 @@ const newConfigName = ref('')
|
||||
const newConfigDesc = ref('')
|
||||
const importConfigName = ref('')
|
||||
|
||||
const tabs = [
|
||||
{ key: 'resources', label: 'Resource Rates', icon: Pickaxe },
|
||||
{ key: 'advanced', label: 'Advanced', icon: SettingsIcon },
|
||||
const tabItems = [
|
||||
{ value: 'resources', label: 'Resource rates', icon: 'pickaxe' },
|
||||
{ value: 'advanced', label: 'Advanced', icon: 'settings' },
|
||||
]
|
||||
|
||||
// Resource definitions for the main gather tab
|
||||
const gatherResources = [
|
||||
{ key: 'Wood', label: 'Wood' },
|
||||
{ key: 'Stones', label: 'Stones' },
|
||||
{ key: 'Metal Ore', label: 'Metal Ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur Ore' },
|
||||
{ key: 'HQM Ore', label: 'HQM Ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur ore' },
|
||||
{ key: 'HQM Ore', label: 'HQM ore' },
|
||||
{ key: 'Cloth', label: 'Cloth' },
|
||||
{ key: 'Leather', label: 'Leather' },
|
||||
{ key: 'Animal Fat', label: 'Animal Fat' },
|
||||
{ key: 'Bone Fragments', label: 'Bone Fragments' },
|
||||
{ key: 'Animal Fat', label: 'Animal fat' },
|
||||
{ key: 'Bone Fragments', label: 'Bone fragments' },
|
||||
]
|
||||
|
||||
// Advanced resource categories
|
||||
const pickupResources = [
|
||||
{ key: 'Wood', label: 'Wood' },
|
||||
{ key: 'Stones', label: 'Stones' },
|
||||
{ key: 'Metal Ore', label: 'Metal Ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur Ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur ore' },
|
||||
]
|
||||
|
||||
const quarryResources = [
|
||||
{ key: 'HQM Ore', label: 'HQM Ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal Ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur Ore' },
|
||||
{ key: 'HQM Ore', label: 'HQM ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur ore' },
|
||||
{ key: 'Stones', label: 'Stones' },
|
||||
]
|
||||
|
||||
const excavatorResources = [
|
||||
{ key: 'HQM Ore', label: 'HQM Ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal Ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur Ore' },
|
||||
{ key: 'HQM Ore', label: 'HQM ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur ore' },
|
||||
{ key: 'Stones', label: 'Stones' },
|
||||
]
|
||||
|
||||
const surveyResources = [
|
||||
{ key: 'Metal Ore', label: 'Metal Ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur Ore' },
|
||||
{ key: 'Metal Ore', label: 'Metal ore' },
|
||||
{ key: 'Sulfur Ore', label: 'Sulfur ore' },
|
||||
{ key: 'Stones', label: 'Stones' },
|
||||
{ key: 'HQM Ore', label: 'HQM Ore' },
|
||||
{ key: 'HQM Ore', label: 'HQM ore' },
|
||||
]
|
||||
|
||||
const presets = [
|
||||
@@ -167,368 +163,428 @@ async function handleImport() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="p-6 space-y-6">
|
||||
<!-- Header -->
|
||||
<div class="flex items-center justify-between">
|
||||
<h1 class="text-2xl font-bold text-white">Gather Rates</h1>
|
||||
<div class="flex items-center gap-3">
|
||||
<button
|
||||
@click="showCreateModal = true"
|
||||
class="flex items-center gap-2 px-3 py-2 bg-neutral-800 text-neutral-300 rounded-lg hover:bg-neutral-700 text-sm"
|
||||
>
|
||||
<Plus class="w-4 h-4" />
|
||||
New Config
|
||||
</button>
|
||||
<div class="gv">
|
||||
<!-- Page head -->
|
||||
<div class="gv__head">
|
||||
<div class="gv__head-id">
|
||||
<div class="gv__head-chip">
|
||||
<Icon name="pickaxe" :size="20" :stroke-width="2" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="t-eyebrow">Plugin config</div>
|
||||
<h1 class="gv__title">Gather rates</h1>
|
||||
</div>
|
||||
</div>
|
||||
<Button size="sm" icon="plus" @click="showCreateModal = true">New config</Button>
|
||||
</div>
|
||||
|
||||
<!-- Config Selector + Action Bar -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-4">
|
||||
<div class="flex items-center gap-3 flex-wrap">
|
||||
<!-- Config Selector -->
|
||||
<!-- Config action bar -->
|
||||
<Panel>
|
||||
<div class="gv__bar">
|
||||
<select
|
||||
v-if="store.configs.length > 0"
|
||||
:value="store.currentConfig?.id || ''"
|
||||
:value="store.currentConfig?.id ?? ''"
|
||||
class="gv__config-select"
|
||||
@change="handleConfigChange(($event.target as HTMLSelectElement).value)"
|
||||
class="bg-neutral-800 border border-neutral-700 text-neutral-200 rounded-lg px-3 py-2 text-sm min-w-[200px]"
|
||||
>
|
||||
<option v-for="c in store.configs" :key="c.id" :value="c.id">
|
||||
{{ c.config_name }}
|
||||
<template v-if="c.is_active"> (Active)</template>
|
||||
{{ c.config_name }}{{ c.is_active ? ' (Active)' : '' }}
|
||||
</option>
|
||||
</select>
|
||||
<span v-else class="text-neutral-500 text-sm">No configs yet</span>
|
||||
<span v-else class="gv__no-configs">No configs yet</span>
|
||||
|
||||
<!-- Save -->
|
||||
<button
|
||||
@click="store.saveCurrentConfig()"
|
||||
<Button
|
||||
icon="save"
|
||||
size="sm"
|
||||
:disabled="!store.currentConfig || !store.isDirty || store.isSaving"
|
||||
class="flex items-center gap-2 px-3 py-2 bg-oxide-500 text-white rounded-lg hover:bg-oxide-600 disabled:opacity-50 disabled:cursor-not-allowed text-sm"
|
||||
>
|
||||
<Save class="w-4 h-4" />
|
||||
{{ store.isSaving ? 'Saving...' : 'Save' }}
|
||||
</button>
|
||||
:loading="store.isSaving"
|
||||
@click="store.saveCurrentConfig()"
|
||||
>{{ store.isSaving ? 'Saving…' : 'Save' }}</Button>
|
||||
|
||||
<!-- Apply to Server -->
|
||||
<button
|
||||
@click="handleApply"
|
||||
<Button
|
||||
variant="outline"
|
||||
icon="play"
|
||||
size="sm"
|
||||
:disabled="!store.currentConfig || store.isApplying"
|
||||
class="flex items-center gap-2 px-3 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed text-sm"
|
||||
>
|
||||
<Play class="w-4 h-4" />
|
||||
{{ store.isApplying ? 'Applying...' : 'Apply to Server' }}
|
||||
</button>
|
||||
:loading="store.isApplying"
|
||||
@click="handleApply"
|
||||
>{{ store.isApplying ? 'Applying…' : 'Apply to server' }}</Button>
|
||||
|
||||
<!-- Import from Server -->
|
||||
<button
|
||||
<Button
|
||||
variant="secondary"
|
||||
icon="download"
|
||||
size="sm"
|
||||
@click="showImportModal = true"
|
||||
class="flex items-center gap-2 px-3 py-2 bg-neutral-800 text-neutral-300 rounded-lg hover:bg-neutral-700 text-sm"
|
||||
>
|
||||
<Download class="w-4 h-4" />
|
||||
Import from Server
|
||||
</button>
|
||||
>Import from server</Button>
|
||||
|
||||
<!-- Delete -->
|
||||
<button
|
||||
@click="handleDeleteConfig"
|
||||
<Button
|
||||
variant="danger-soft"
|
||||
icon="trash-2"
|
||||
size="sm"
|
||||
:disabled="!store.currentConfig"
|
||||
class="flex items-center gap-2 px-3 py-2 bg-red-500/10 text-red-400 rounded-lg hover:bg-red-500/20 disabled:opacity-50 text-sm ml-auto"
|
||||
>
|
||||
<Trash2 class="w-4 h-4" />
|
||||
Delete
|
||||
</button>
|
||||
class="gv__bar-delete"
|
||||
@click="handleDeleteConfig"
|
||||
>Delete</Button>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Loading -->
|
||||
<div v-if="store.isLoading" class="gv__loading">
|
||||
<span class="gv__spinner" />
|
||||
</div>
|
||||
|
||||
<!-- Loading State -->
|
||||
<div v-if="store.isLoading" class="flex items-center justify-center py-20">
|
||||
<div class="animate-spin w-8 h-8 border-2 border-oxide-500 border-t-transparent rounded-full" />
|
||||
</div>
|
||||
|
||||
<!-- No Config Selected -->
|
||||
<div v-else-if="!store.currentConfig" class="bg-neutral-900 border border-neutral-800 rounded-xl p-12 text-center">
|
||||
<Pickaxe class="w-12 h-12 text-neutral-600 mx-auto mb-4" />
|
||||
<h2 class="text-lg font-semibold text-neutral-300 mb-2">No Gather Config Selected</h2>
|
||||
<p class="text-neutral-500 mb-4">Create a new config, import from server, or select one from the dropdown above.</p>
|
||||
<button
|
||||
@click="showCreateModal = true"
|
||||
class="px-4 py-2 bg-oxide-500 text-white rounded-lg hover:bg-oxide-600"
|
||||
<!-- Empty state -->
|
||||
<Panel v-else-if="!store.currentConfig">
|
||||
<EmptyState
|
||||
icon="pickaxe"
|
||||
title="No gather config selected"
|
||||
description="Create a new config, import from server, or select one from the dropdown above."
|
||||
>
|
||||
Create First Config
|
||||
</button>
|
||||
</div>
|
||||
<template #action>
|
||||
<Button icon="plus" @click="showCreateModal = true">Create first config</Button>
|
||||
</template>
|
||||
</EmptyState>
|
||||
</Panel>
|
||||
|
||||
<!-- Config Editor -->
|
||||
<div v-else class="space-y-6">
|
||||
<!-- Tab Bar -->
|
||||
<div class="flex border-b border-neutral-800">
|
||||
<button
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
@click="activeTab = tab.key as typeof activeTab"
|
||||
class="flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors"
|
||||
:class="activeTab === tab.key
|
||||
? 'border-oxide-500 text-oxide-400'
|
||||
: 'border-transparent text-neutral-500 hover:text-neutral-300'"
|
||||
>
|
||||
<component :is="tab.icon" class="w-4 h-4" />
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
<!-- Config editor -->
|
||||
<template v-else>
|
||||
<Tabs v-model="activeTab" :items="tabItems" variant="line" />
|
||||
|
||||
<!-- Resource Rates Tab -->
|
||||
<div v-if="activeTab === 'resources'" class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Gather Resource Modifiers</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs text-neutral-500 mr-2">Presets:</span>
|
||||
<!-- Resource rates tab -->
|
||||
<Panel v-if="activeTab === 'resources'" title="Gather resource modifiers">
|
||||
<template #actions>
|
||||
<div class="gv__presets">
|
||||
<span class="gv__presets-label">Presets:</span>
|
||||
<button
|
||||
v-for="preset in presets"
|
||||
:key="preset.value"
|
||||
class="gv__preset-btn"
|
||||
@click="applyPreset(preset.value)"
|
||||
class="px-3 py-1 text-xs bg-neutral-800 text-neutral-300 rounded-lg hover:bg-neutral-700 hover:text-white transition-colors"
|
||||
>
|
||||
{{ preset.label }}
|
||||
</button>
|
||||
>{{ preset.label }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div class="gv__rate-list">
|
||||
<div
|
||||
v-for="resource in gatherResources"
|
||||
:key="resource.key"
|
||||
class="flex items-center gap-4"
|
||||
class="gv__rate-row"
|
||||
>
|
||||
<label class="text-sm text-neutral-200 w-32 flex-shrink-0">{{ resource.label }}</label>
|
||||
<label class="gv__rate-label">{{ resource.label }}</label>
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue(`GatherResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`GatherResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="100"
|
||||
step="0.1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="gv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue(`GatherResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue(`GatherResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`GatherResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="1000"
|
||||
step="0.1"
|
||||
class="w-20 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input gv__rate-num"
|
||||
@input="setConfigValue(`GatherResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500 w-4">x</span>
|
||||
<span class="gv__rate-unit">x</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Advanced Tab -->
|
||||
<div v-else-if="activeTab === 'advanced'" class="space-y-6">
|
||||
<!-- Pickup Resource Modifiers -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Pickup Resource Modifiers</h3>
|
||||
<p class="text-xs text-neutral-500">Modify rates for resources picked up from the ground (small rocks, wood piles).</p>
|
||||
<div class="space-y-4">
|
||||
<!-- Advanced tab -->
|
||||
<template v-else-if="activeTab === 'advanced'">
|
||||
<!-- Pickup -->
|
||||
<Panel title="Pickup resource modifiers" subtitle="Modify rates for resources picked up from the ground (small rocks, wood piles).">
|
||||
<div class="gv__rate-list">
|
||||
<div
|
||||
v-for="resource in pickupResources"
|
||||
:key="resource.key"
|
||||
class="flex items-center gap-4"
|
||||
class="gv__rate-row"
|
||||
>
|
||||
<label class="text-sm text-neutral-200 w-32 flex-shrink-0">{{ resource.label }}</label>
|
||||
<label class="gv__rate-label">{{ resource.label }}</label>
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue(`PickupResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`PickupResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="100"
|
||||
step="0.1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="gv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue(`PickupResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue(`PickupResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`PickupResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="1000"
|
||||
step="0.1"
|
||||
class="w-20 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input gv__rate-num"
|
||||
@input="setConfigValue(`PickupResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500 w-4">x</span>
|
||||
<span class="gv__rate-unit">x</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Quarry Resource Modifiers -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Quarry Resource Modifiers</h3>
|
||||
<p class="text-xs text-neutral-500">Scale resource output from Mining Quarries.</p>
|
||||
<div class="space-y-4">
|
||||
<!-- Quarry -->
|
||||
<Panel title="Quarry resource modifiers" subtitle="Scale resource output from mining quarries.">
|
||||
<div class="gv__rate-list">
|
||||
<div
|
||||
v-for="resource in quarryResources"
|
||||
:key="resource.key"
|
||||
class="flex items-center gap-4"
|
||||
class="gv__rate-row"
|
||||
>
|
||||
<label class="text-sm text-neutral-200 w-32 flex-shrink-0">{{ resource.label }}</label>
|
||||
<label class="gv__rate-label">{{ resource.label }}</label>
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue(`QuarryResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`QuarryResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="100"
|
||||
step="0.1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="gv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue(`QuarryResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue(`QuarryResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`QuarryResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="1000"
|
||||
step="0.1"
|
||||
class="w-20 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input gv__rate-num"
|
||||
@input="setConfigValue(`QuarryResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500 w-4">x</span>
|
||||
<span class="gv__rate-unit">x</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Excavator Resource Modifiers -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Excavator Resource Modifiers</h3>
|
||||
<p class="text-xs text-neutral-500">Scale resource output from the Giant Excavator.</p>
|
||||
<div class="space-y-4">
|
||||
<!-- Excavator -->
|
||||
<Panel title="Excavator resource modifiers" subtitle="Scale resource output from the giant excavator.">
|
||||
<div class="gv__rate-list">
|
||||
<div
|
||||
v-for="resource in excavatorResources"
|
||||
:key="resource.key"
|
||||
class="flex items-center gap-4"
|
||||
class="gv__rate-row"
|
||||
>
|
||||
<label class="text-sm text-neutral-200 w-32 flex-shrink-0">{{ resource.label }}</label>
|
||||
<label class="gv__rate-label">{{ resource.label }}</label>
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue(`ExcavatorResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`ExcavatorResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="100"
|
||||
step="0.1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="gv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue(`ExcavatorResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue(`ExcavatorResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`ExcavatorResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="1000"
|
||||
step="0.1"
|
||||
class="w-20 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input gv__rate-num"
|
||||
@input="setConfigValue(`ExcavatorResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500 w-4">x</span>
|
||||
<span class="gv__rate-unit">x</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Survey Resource Modifiers -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-4">
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Survey Charge Resource Modifiers</h3>
|
||||
<p class="text-xs text-neutral-500">Modify resource amounts from Survey Charge grenades.</p>
|
||||
<div class="space-y-4">
|
||||
<!-- Survey -->
|
||||
<Panel title="Survey charge resource modifiers" subtitle="Modify resource amounts from survey charge grenades.">
|
||||
<div class="gv__rate-list">
|
||||
<div
|
||||
v-for="resource in surveyResources"
|
||||
:key="resource.key"
|
||||
class="flex items-center gap-4"
|
||||
class="gv__rate-row"
|
||||
>
|
||||
<label class="text-sm text-neutral-200 w-32 flex-shrink-0">{{ resource.label }}</label>
|
||||
<label class="gv__rate-label">{{ resource.label }}</label>
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue(`SurveyResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`SurveyResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="100"
|
||||
step="0.1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="gv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue(`SurveyResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue(`SurveyResourceModifiers.${resource.key}`, 1)"
|
||||
@input="setConfigValue(`SurveyResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
min="0.1"
|
||||
max="1000"
|
||||
step="0.1"
|
||||
class="w-20 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input gv__rate-num"
|
||||
@input="setConfigValue(`SurveyResourceModifiers.${resource.key}`, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500 w-4">x</span>
|
||||
<span class="gv__rate-unit">x</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- Create Config Modal -->
|
||||
<div v-if="showCreateModal" class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4" @click.self="showCreateModal = false">
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 w-full max-w-md">
|
||||
<h2 class="text-lg font-semibold text-neutral-100 mb-4">New Gather Config</h2>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-400 mb-1">Config Name</label>
|
||||
<!-- Create config modal -->
|
||||
<div v-if="showCreateModal" class="gv__modal-backdrop" @click.self="showCreateModal = false">
|
||||
<div class="gv__modal">
|
||||
<h2 class="gv__modal-title">New gather config</h2>
|
||||
<div class="gv__modal-body">
|
||||
<div class="gv__field">
|
||||
<label class="gv__field-label">Config name</label>
|
||||
<input
|
||||
v-model="newConfigName"
|
||||
placeholder="e.g. 3x Gather Rates"
|
||||
class="w-full bg-neutral-800 border border-neutral-700 rounded-lg px-3 py-2 text-neutral-200 text-sm"
|
||||
type="text"
|
||||
class="cc-text-input"
|
||||
placeholder="e.g. 3x gather rates"
|
||||
@keydown.enter="handleCreateConfig"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-400 mb-1">Description (optional)</label>
|
||||
<div class="gv__field">
|
||||
<label class="gv__field-label">Description (optional)</label>
|
||||
<textarea
|
||||
v-model="newConfigDesc"
|
||||
rows="2"
|
||||
class="cc-textarea"
|
||||
placeholder="What is this config for?"
|
||||
class="w-full bg-neutral-800 border border-neutral-700 rounded-lg px-3 py-2 text-neutral-200 text-sm resize-none"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2">
|
||||
<button @click="showCreateModal = false" class="px-4 py-2 text-sm text-neutral-400 hover:text-neutral-200">Cancel</button>
|
||||
<button
|
||||
@click="handleCreateConfig"
|
||||
:disabled="!newConfigName.trim()"
|
||||
class="px-4 py-2 bg-oxide-500 text-white rounded-lg hover:bg-oxide-600 disabled:opacity-50 text-sm"
|
||||
>
|
||||
Create
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gv__modal-footer">
|
||||
<Button variant="ghost" @click="showCreateModal = false">Cancel</Button>
|
||||
<Button :disabled="!newConfigName.trim()" @click="handleCreateConfig">Create</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import from Server Modal -->
|
||||
<div v-if="showImportModal" class="fixed inset-0 bg-black/60 z-50 flex items-center justify-center p-4" @click.self="showImportModal = false">
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 w-full max-w-md">
|
||||
<h2 class="text-lg font-semibold text-neutral-100 mb-4">Import from Server</h2>
|
||||
<p class="text-sm text-neutral-400 mb-4">
|
||||
Import the current GatherManager config from your live server. This will create a new config profile.
|
||||
</p>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-400 mb-1">Config Name</label>
|
||||
<!-- Import from server modal -->
|
||||
<div v-if="showImportModal" class="gv__modal-backdrop" @click.self="showImportModal = false">
|
||||
<div class="gv__modal">
|
||||
<h2 class="gv__modal-title">Import from server</h2>
|
||||
<p class="gv__modal-desc">Import the current GatherManager config from your live server. This will create a new config profile.</p>
|
||||
<div class="gv__modal-body">
|
||||
<div class="gv__field">
|
||||
<label class="gv__field-label">Config name</label>
|
||||
<input
|
||||
v-model="importConfigName"
|
||||
placeholder="e.g. Imported Server Config"
|
||||
class="w-full bg-neutral-800 border border-neutral-700 rounded-lg px-3 py-2 text-neutral-200 text-sm"
|
||||
type="text"
|
||||
class="cc-text-input"
|
||||
placeholder="e.g. Imported server config"
|
||||
@keydown.enter="handleImport"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2">
|
||||
<button @click="showImportModal = false" class="px-4 py-2 text-sm text-neutral-400 hover:text-neutral-200">Cancel</button>
|
||||
<button
|
||||
@click="handleImport"
|
||||
:disabled="!importConfigName.trim()"
|
||||
class="px-4 py-2 bg-oxide-500 text-white rounded-lg hover:bg-oxide-600 disabled:opacity-50 text-sm"
|
||||
>
|
||||
Import
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gv__modal-footer">
|
||||
<Button variant="ghost" @click="showImportModal = false">Cancel</Button>
|
||||
<Button :disabled="!importConfigName.trim()" @click="handleImport">Import</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.gv { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
|
||||
|
||||
/* Page head */
|
||||
.gv__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
|
||||
.gv__head-id { display: flex; align-items: center; gap: 12px; }
|
||||
.gv__head-chip {
|
||||
width: 40px; height: 40px; flex: none; border-radius: var(--radius-md);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
color: var(--accent); background: var(--accent-soft);
|
||||
box-shadow: inset 0 0 0 1px var(--accent-border);
|
||||
}
|
||||
.gv__title {
|
||||
font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em;
|
||||
color: var(--text-primary); margin-top: 3px;
|
||||
}
|
||||
|
||||
/* Config action bar */
|
||||
.gv__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
||||
.gv__config-select {
|
||||
appearance: none; height: var(--control-h-md); padding: 0 11px;
|
||||
background: var(--surface-inset); color: var(--text-primary); border: 0;
|
||||
border-radius: var(--radius-md); box-shadow: var(--ring-default);
|
||||
font-family: var(--font-sans); font-size: var(--text-sm); cursor: pointer;
|
||||
min-width: 200px;
|
||||
}
|
||||
.gv__config-select:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent), var(--glow-accent-sm); }
|
||||
.gv__no-configs { font-size: var(--text-sm); color: var(--text-muted); }
|
||||
.gv__bar-delete { margin-left: auto; }
|
||||
|
||||
/* Loading */
|
||||
.gv__loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
|
||||
.gv__spinner {
|
||||
width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent);
|
||||
border-top-color: transparent; animation: gv-spin 0.6s linear infinite;
|
||||
}
|
||||
@keyframes gv-spin { to { transform: rotate(360deg); } }
|
||||
|
||||
/* Presets */
|
||||
.gv__presets { display: flex; align-items: center; gap: 6px; }
|
||||
.gv__presets-label { font-size: var(--text-xs); color: var(--text-tertiary); }
|
||||
.gv__preset-btn {
|
||||
height: 26px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
|
||||
background: var(--surface-raised-2); color: var(--text-secondary);
|
||||
font-size: var(--text-xs); font-weight: 600; cursor: pointer;
|
||||
box-shadow: var(--ring-default); transition: var(--transition-colors);
|
||||
}
|
||||
.gv__preset-btn:hover { background: var(--surface-active); color: var(--text-primary); }
|
||||
|
||||
/* Rate rows */
|
||||
.gv__rate-list { display: flex; flex-direction: column; gap: 12px; }
|
||||
.gv__rate-row { display: flex; align-items: center; gap: 12px; }
|
||||
.gv__rate-label { font-size: var(--text-sm); color: var(--text-primary); width: 120px; flex: none; }
|
||||
.gv__slider { flex: 1; cursor: pointer; }
|
||||
.gv__rate-num {
|
||||
width: 72px; height: var(--control-h-sm); flex: none;
|
||||
text-align: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.gv__rate-unit { font-size: var(--text-xs); color: var(--text-tertiary); width: 12px; flex: none; }
|
||||
|
||||
/* Shared token inputs */
|
||||
.cc-textarea {
|
||||
width: 100%; background: var(--surface-inset); color: var(--text-primary);
|
||||
border: 0; border-radius: var(--radius-md); box-shadow: var(--ring-default);
|
||||
padding: 9px 11px; font-family: var(--font-sans); font-size: var(--text-sm);
|
||||
resize: none; outline: 0; line-height: 1.5;
|
||||
}
|
||||
.cc-textarea:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), var(--glow-accent-sm); }
|
||||
.cc-text-input {
|
||||
width: 100%; height: var(--control-h-md); background: var(--surface-inset); color: var(--text-primary);
|
||||
border: 0; border-radius: var(--radius-md); box-shadow: var(--ring-default);
|
||||
padding: 0 11px; font-family: var(--font-sans); font-size: var(--text-sm); outline: 0;
|
||||
}
|
||||
.cc-text-input:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), var(--glow-accent-sm); }
|
||||
.cc-num-input {
|
||||
width: 100%; height: var(--control-h-md); background: var(--surface-inset); color: var(--text-primary);
|
||||
border: 0; border-radius: var(--radius-md); box-shadow: var(--ring-default);
|
||||
padding: 0 11px; font-family: var(--font-sans); font-size: var(--text-sm); outline: 0;
|
||||
}
|
||||
.cc-num-input:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), var(--glow-accent-sm); }
|
||||
|
||||
/* Fields */
|
||||
.gv__field { display: flex; flex-direction: column; gap: 6px; }
|
||||
.gv__field-label { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }
|
||||
|
||||
/* Modal */
|
||||
.gv__modal-backdrop {
|
||||
position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 50;
|
||||
display: flex; align-items: center; justify-content: center; padding: 16px;
|
||||
}
|
||||
.gv__modal {
|
||||
background: var(--surface-base); border-radius: var(--radius-lg); box-shadow: var(--ring-default);
|
||||
width: 100%; max-width: 440px; padding: 24px; display: flex; flex-direction: column; gap: 16px;
|
||||
}
|
||||
.gv__modal-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
|
||||
.gv__modal-desc { font-size: var(--text-sm); color: var(--text-tertiary); line-height: 1.5; }
|
||||
.gv__modal-body { display: flex; flex-direction: column; gap: 12px; }
|
||||
.gv__modal-footer { display: flex; justify-content: flex-end; gap: 8px; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user