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 { useAutoDoorsStore } from '@/stores/autodoors'
|
||||
import {
|
||||
Save,
|
||||
Play,
|
||||
Download,
|
||||
Plus,
|
||||
Trash2,
|
||||
DoorOpen,
|
||||
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 Switch from '@/components/ds/forms/Switch.vue'
|
||||
import EmptyState from '@/components/ds/feedback/EmptyState.vue'
|
||||
|
||||
const store = useAutoDoorsStore()
|
||||
|
||||
@@ -21,13 +17,13 @@ const importConfigName = ref('')
|
||||
|
||||
// Door types from the AutoDoors plugin
|
||||
const doorTypes = [
|
||||
{ key: 'door.hinged.wood', label: 'Wooden Door', displayName: 'Wooden Door' },
|
||||
{ key: 'door.hinged.metal', label: 'Sheet Metal Door', displayName: 'Sheet Metal Door' },
|
||||
{ key: 'door.hinged.toptier', label: 'Armored Door', displayName: 'Armored Door' },
|
||||
{ key: 'door.double.hinged.wood', label: 'Double Wooden Door', displayName: 'Double Wooden Door' },
|
||||
{ key: 'door.double.hinged.metal', label: 'Double Sheet Metal Door', displayName: 'Double Sheet Metal Door' },
|
||||
{ key: 'door.double.hinged.toptier', label: 'Double Armored Door', displayName: 'Double Armored Door' },
|
||||
{ key: 'floor.ladder.hatch', label: 'Ladder Hatch', displayName: 'Ladder Hatch' },
|
||||
{ key: 'door.hinged.wood', label: 'Wooden door', displayName: 'Wooden Door' },
|
||||
{ key: 'door.hinged.metal', label: 'Sheet metal door', displayName: 'Sheet Metal Door' },
|
||||
{ key: 'door.hinged.toptier', label: 'Armored door', displayName: 'Armored Door' },
|
||||
{ key: 'door.double.hinged.wood', label: 'Double wooden door', displayName: 'Double Wooden Door' },
|
||||
{ key: 'door.double.hinged.metal', label: 'Double sheet metal door', displayName: 'Double Sheet Metal Door' },
|
||||
{ key: 'door.double.hinged.toptier', label: 'Double armored door', displayName: 'Double Armored Door' },
|
||||
{ key: 'floor.ladder.hatch', label: 'Ladder hatch', displayName: 'Ladder Hatch' },
|
||||
]
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -154,442 +150,472 @@ async function handleImport() {
|
||||
importConfigName.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
// Helper: coerce getConfigValue result to boolean for Switch
|
||||
function getBool(path: string, def: boolean): boolean {
|
||||
return !!getConfigValue(path, def)
|
||||
}
|
||||
</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">Auto Doors</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="adv">
|
||||
<!-- Page head -->
|
||||
<div class="adv__head">
|
||||
<div class="adv__head-id">
|
||||
<div class="adv__head-chip">
|
||||
<Icon name="door-open" :size="20" :stroke-width="2" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="t-eyebrow">Plugin config</div>
|
||||
<h1 class="adv__title">Auto doors</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="adv__bar">
|
||||
<select
|
||||
v-if="store.configs.length > 0"
|
||||
:value="store.currentConfig?.id || ''"
|
||||
:value="store.currentConfig?.id ?? ''"
|
||||
class="adv__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="adv__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="adv__bar-delete"
|
||||
@click="handleDeleteConfig"
|
||||
>Delete</Button>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Loading -->
|
||||
<div v-if="store.isLoading" class="adv__loading">
|
||||
<span class="adv__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">
|
||||
<DoorOpen class="w-12 h-12 text-neutral-600 mx-auto mb-4" />
|
||||
<h2 class="text-lg font-semibold text-neutral-300 mb-2">No AutoDoors 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="door-open"
|
||||
title="No AutoDoors 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">
|
||||
<!-- Settings Section -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-6">
|
||||
<div class="flex items-center gap-2">
|
||||
<SettingsIcon class="w-4 h-4 text-neutral-400" />
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Global Settings</h3>
|
||||
</div>
|
||||
|
||||
<!-- Delay Settings -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-200 mb-1">Default Delay (seconds)</label>
|
||||
<p class="text-xs text-neutral-500 mb-2">Time before door auto-closes</p>
|
||||
<div class="flex items-center gap-3">
|
||||
<!-- Config editor -->
|
||||
<template v-else>
|
||||
<!-- Global settings -->
|
||||
<Panel title="Global settings">
|
||||
<!-- Delay sliders -->
|
||||
<div class="adv__delay-grid">
|
||||
<div class="adv__field">
|
||||
<div class="adv__field-label">Default delay (seconds)</div>
|
||||
<div class="adv__field-hint">Time before door auto-closes</div>
|
||||
<div class="adv__slider-row">
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue('DefaultDelay', 5)"
|
||||
@input="setConfigValue('DefaultDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="30"
|
||||
step="1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="adv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue('DefaultDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue('DefaultDelay', 5)"
|
||||
min="1"
|
||||
max="30"
|
||||
class="cc-num-input adv__delay-num"
|
||||
@input="setConfigValue('DefaultDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="30"
|
||||
class="w-16 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500">sec</span>
|
||||
<span class="adv__unit">sec</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-200 mb-1">Minimum Delay (seconds)</label>
|
||||
<p class="text-xs text-neutral-500 mb-2">Lowest delay a player can set</p>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="adv__field">
|
||||
<div class="adv__field-label">Minimum delay (seconds)</div>
|
||||
<div class="adv__field-hint">Lowest delay a player can set</div>
|
||||
<div class="adv__slider-row">
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue('MinimumDelay', 5)"
|
||||
@input="setConfigValue('MinimumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="30"
|
||||
step="1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="adv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue('MinimumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue('MinimumDelay', 5)"
|
||||
@input="setConfigValue('MinimumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="30"
|
||||
class="w-16 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input adv__delay-num"
|
||||
@input="setConfigValue('MinimumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500">sec</span>
|
||||
<span class="adv__unit">sec</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-200 mb-1">Maximum Delay (seconds)</label>
|
||||
<p class="text-xs text-neutral-500 mb-2">Highest delay a player can set</p>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="adv__field">
|
||||
<div class="adv__field-label">Maximum delay (seconds)</div>
|
||||
<div class="adv__field-hint">Highest delay a player can set</div>
|
||||
<div class="adv__slider-row">
|
||||
<input
|
||||
type="range"
|
||||
:value="getConfigValue('MaximumDelay', 30)"
|
||||
@input="setConfigValue('MaximumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="60"
|
||||
step="1"
|
||||
class="flex-1 accent-oxide-500"
|
||||
class="adv__slider"
|
||||
style="accent-color: var(--accent)"
|
||||
@input="setConfigValue('MaximumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="getConfigValue('MaximumDelay', 30)"
|
||||
@input="setConfigValue('MaximumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="60"
|
||||
class="w-16 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-1 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input adv__delay-num"
|
||||
@input="setConfigValue('MaximumDelay', Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500">sec</span>
|
||||
<span class="adv__unit">sec</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Global Toggles -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<!-- Global toggles -->
|
||||
<div class="adv__toggles adv__mt">
|
||||
<div class="adv__toggle-row">
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">Default Enabled</label>
|
||||
<p class="text-xs text-neutral-500">Auto-close enabled for new players by default</p>
|
||||
<div class="adv__toggle-label">Default enabled</div>
|
||||
<div class="adv__toggle-sub">Auto-close enabled for new players by default</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue('GlobalSettings.defaultEnabled', !getConfigValue('GlobalSettings.defaultEnabled', true))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue('GlobalSettings.defaultEnabled', true) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue('GlobalSettings.defaultEnabled', true) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool('GlobalSettings.defaultEnabled', true)"
|
||||
@update:model-value="v => setConfigValue('GlobalSettings.defaultEnabled', v)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="adv__toggle-row">
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">Allow Unowned Doors</label>
|
||||
<p class="text-xs text-neutral-500">Auto-close doors that the player does not own</p>
|
||||
<div class="adv__toggle-label">Allow unowned doors</div>
|
||||
<div class="adv__toggle-sub">Auto-close doors that the player does not own</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue('GlobalSettings.useUnownedDoor', !getConfigValue('GlobalSettings.useUnownedDoor', false))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue('GlobalSettings.useUnownedDoor', false) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue('GlobalSettings.useUnownedDoor', false) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool('GlobalSettings.useUnownedDoor', false)"
|
||||
@update:model-value="v => setConfigValue('GlobalSettings.useUnownedDoor', v)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="adv__toggle-row">
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">Exclude Door Controller</label>
|
||||
<p class="text-xs text-neutral-500">Skip doors that have a Code Lock or Key Lock</p>
|
||||
<div class="adv__toggle-label">Exclude door controller</div>
|
||||
<div class="adv__toggle-sub">Skip doors that have a code lock or key lock</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue('GlobalSettings.excludeDoorController', !getConfigValue('GlobalSettings.excludeDoorController', false))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue('GlobalSettings.excludeDoorController', false) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue('GlobalSettings.excludeDoorController', false) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool('GlobalSettings.excludeDoorController', false)"
|
||||
@update:model-value="v => setConfigValue('GlobalSettings.excludeDoorController', v)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="adv__toggle-row">
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">Cancel on Player Death</label>
|
||||
<p class="text-xs text-neutral-500">Cancel auto-close if the player dies</p>
|
||||
<div class="adv__toggle-label">Cancel on player death</div>
|
||||
<div class="adv__toggle-sub">Cancel auto-close if the player dies</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue('GlobalSettings.cancelOnKill', !getConfigValue('GlobalSettings.cancelOnKill', false))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue('GlobalSettings.cancelOnKill', false) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue('GlobalSettings.cancelOnKill', false) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool('GlobalSettings.cancelOnKill', false)"
|
||||
@update:model-value="v => setConfigValue('GlobalSettings.cancelOnKill', v)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="adv__toggle-row">
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">Use Permissions</label>
|
||||
<p class="text-xs text-neutral-500">Require Oxide permission to use auto-close</p>
|
||||
<div class="adv__toggle-label">Use permissions</div>
|
||||
<div class="adv__toggle-sub">Require Oxide permission to use auto-close</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue('UsePermissions', !getConfigValue('UsePermissions', false))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue('UsePermissions', false) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue('UsePermissions', false) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool('UsePermissions', false)"
|
||||
@update:model-value="v => setConfigValue('UsePermissions', v)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="adv__toggle-row">
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">Clear Data on Map Wipe</label>
|
||||
<p class="text-xs text-neutral-500">Reset all player preferences on map wipe</p>
|
||||
<div class="adv__toggle-label">Clear data on map wipe</div>
|
||||
<div class="adv__toggle-sub">Reset all player preferences on map wipe</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue('ClearDataOnWipe', !getConfigValue('ClearDataOnWipe', false))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue('ClearDataOnWipe', false) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue('ClearDataOnWipe', false) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool('ClearDataOnWipe', false)"
|
||||
@update:model-value="v => setConfigValue('ClearDataOnWipe', v)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Door Types Section -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<DoorOpen class="w-4 h-4 text-neutral-400" />
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Door Types</h3>
|
||||
</div>
|
||||
<p class="text-xs text-neutral-500">Enable or disable auto-close for each door type.</p>
|
||||
|
||||
<div class="space-y-3">
|
||||
<!-- Door types -->
|
||||
<Panel title="Door types" subtitle="Enable or disable auto-close for each door type.">
|
||||
<div class="adv__toggles">
|
||||
<div
|
||||
v-for="door in doorTypes"
|
||||
:key="door.key"
|
||||
class="flex items-center justify-between py-2 border-b border-neutral-800 last:border-0"
|
||||
class="adv__toggle-row"
|
||||
>
|
||||
<div>
|
||||
<label class="text-sm text-neutral-200">{{ door.label }}</label>
|
||||
<p class="text-xs text-neutral-500 font-mono">{{ door.key }}</p>
|
||||
<div class="adv__toggle-label">{{ door.label }}</div>
|
||||
<div class="adv__toggle-sub adv__mono">{{ door.key }}</div>
|
||||
</div>
|
||||
<button
|
||||
@click="setConfigValue(`DoorSettings.${door.key}.enabled`, !getConfigValue(`DoorSettings.${door.key}.enabled`, true))"
|
||||
class="relative w-11 h-6 rounded-full transition-colors"
|
||||
:class="getConfigValue(`DoorSettings.${door.key}.enabled`, true) ? 'bg-oxide-500' : 'bg-neutral-700'"
|
||||
>
|
||||
<span
|
||||
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform"
|
||||
:class="getConfigValue(`DoorSettings.${door.key}.enabled`, true) ? 'translate-x-5' : 'translate-x-0'"
|
||||
/>
|
||||
</button>
|
||||
<Switch
|
||||
:model-value="getBool(`DoorSettings.${door.key}.enabled`, true)"
|
||||
@update:model-value="v => setConfigValue(`DoorSettings.${door.key}.enabled`, v)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<!-- Permission Groups Section -->
|
||||
<div class="bg-neutral-900 border border-neutral-800 rounded-xl p-6 space-y-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<SettingsIcon class="w-4 h-4 text-neutral-400" />
|
||||
<h3 class="text-sm font-semibold text-neutral-300 uppercase tracking-wider">Permission Group Overrides</h3>
|
||||
</div>
|
||||
<button
|
||||
@click="addPermissionGroup"
|
||||
class="flex items-center gap-1 px-3 py-1 bg-neutral-800 text-neutral-300 rounded-lg hover:bg-neutral-700 text-sm"
|
||||
>
|
||||
<Plus class="w-3 h-3" />
|
||||
Add Group
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-xs text-neutral-500">Override the default delay for specific Oxide permission groups.</p>
|
||||
<!-- Permission group overrides -->
|
||||
<Panel title="Permission group overrides" subtitle="Override the default delay for specific Oxide permission groups.">
|
||||
<template #actions>
|
||||
<Button size="sm" icon="plus" variant="secondary" @click="addPermissionGroup">Add group</Button>
|
||||
</template>
|
||||
|
||||
<div v-if="getPermissionGroups().length === 0" class="text-sm text-neutral-500 text-center py-4">
|
||||
<div v-if="getPermissionGroups().length === 0" class="adv__perm-empty">
|
||||
No permission group overrides configured.
|
||||
</div>
|
||||
|
||||
<div v-else class="space-y-3">
|
||||
<div v-else class="adv__perm-list">
|
||||
<div
|
||||
v-for="(group, index) in getPermissionGroups()"
|
||||
:key="index"
|
||||
class="flex items-center gap-3"
|
||||
class="adv__perm-row"
|
||||
>
|
||||
<input
|
||||
:value="group.name"
|
||||
@input="updatePermissionGroupName(group.name, ($event.target as HTMLInputElement).value)"
|
||||
type="text"
|
||||
class="cc-text-input adv__perm-name"
|
||||
placeholder="Group name (e.g. vip)"
|
||||
class="flex-1 bg-neutral-800 border border-neutral-700 rounded-lg px-3 py-2 text-neutral-200 text-sm"
|
||||
@input="updatePermissionGroupName(group.name, ($event.target as HTMLInputElement).value)"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
:value="group.delay"
|
||||
@input="updatePermissionGroupDelay(group.name, Number(($event.target as HTMLInputElement).value))"
|
||||
min="1"
|
||||
max="60"
|
||||
class="w-20 bg-neutral-800 border border-neutral-700 rounded-lg px-2 py-2 text-neutral-200 text-sm text-center"
|
||||
class="cc-num-input adv__perm-delay"
|
||||
@input="updatePermissionGroupDelay(group.name, Number(($event.target as HTMLInputElement).value))"
|
||||
/>
|
||||
<span class="text-xs text-neutral-500">sec</span>
|
||||
<button
|
||||
@click="removePermissionGroup(group.name)"
|
||||
class="p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors"
|
||||
>
|
||||
<Trash2 class="w-4 h-4" />
|
||||
<span class="adv__unit">sec</span>
|
||||
<button class="adv__del-btn" title="Remove group" @click="removePermissionGroup(group.name)">
|
||||
<Icon name="trash-2" :size="15" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
</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 AutoDoors 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="adv__modal-backdrop" @click.self="showCreateModal = false">
|
||||
<div class="adv__modal">
|
||||
<h2 class="adv__modal-title">New AutoDoors config</h2>
|
||||
<div class="adv__modal-body">
|
||||
<div class="adv__field">
|
||||
<label class="adv__field-label">Config name</label>
|
||||
<input
|
||||
v-model="newConfigName"
|
||||
placeholder="e.g. 5 Second Close"
|
||||
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. 5 second close"
|
||||
@keydown.enter="handleCreateConfig"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-neutral-400 mb-1">Description (optional)</label>
|
||||
<div class="adv__field">
|
||||
<label class="adv__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="adv__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 AutoDoors 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="adv__modal-backdrop" @click.self="showImportModal = false">
|
||||
<div class="adv__modal">
|
||||
<h2 class="adv__modal-title">Import from server</h2>
|
||||
<p class="adv__modal-desc">Import the current AutoDoors config from your live server. This will create a new config profile.</p>
|
||||
<div class="adv__modal-body">
|
||||
<div class="adv__field">
|
||||
<label class="adv__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="adv__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>
|
||||
.adv { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
|
||||
|
||||
/* Page head */
|
||||
.adv__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
|
||||
.adv__head-id { display: flex; align-items: center; gap: 12px; }
|
||||
.adv__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);
|
||||
}
|
||||
.adv__title {
|
||||
font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em;
|
||||
color: var(--text-primary); margin-top: 3px;
|
||||
}
|
||||
|
||||
/* Config action bar */
|
||||
.adv__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
||||
.adv__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;
|
||||
}
|
||||
.adv__config-select:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent), var(--glow-accent-sm); }
|
||||
.adv__no-configs { font-size: var(--text-sm); color: var(--text-muted); }
|
||||
.adv__bar-delete { margin-left: auto; }
|
||||
|
||||
/* Loading */
|
||||
.adv__loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
|
||||
.adv__spinner {
|
||||
width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent);
|
||||
border-top-color: transparent; animation: adv-spin 0.6s linear infinite;
|
||||
}
|
||||
@keyframes adv-spin { to { transform: rotate(360deg); } }
|
||||
|
||||
/* Delay grid */
|
||||
.adv__delay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
|
||||
@media (max-width: 700px) { .adv__delay-grid { grid-template-columns: 1fr; } }
|
||||
.adv__slider-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
|
||||
.adv__slider { flex: 1; cursor: pointer; }
|
||||
.adv__delay-num { width: 60px; flex: none; text-align: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
|
||||
.adv__unit { font-size: var(--text-xs); color: var(--text-tertiary); flex: none; }
|
||||
.adv__mt { margin-top: 20px; }
|
||||
|
||||
/* Fields */
|
||||
.adv__field { display: flex; flex-direction: column; gap: 4px; }
|
||||
.adv__field-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
|
||||
.adv__field-hint { font-size: var(--text-xs); color: var(--text-tertiary); }
|
||||
|
||||
/* Toggle rows */
|
||||
.adv__toggles { display: flex; flex-direction: column; }
|
||||
.adv__toggle-row {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
|
||||
}
|
||||
.adv__toggle-row:last-child { border-bottom: 0; padding-bottom: 0; }
|
||||
.adv__toggle-row:first-child { padding-top: 0; }
|
||||
.adv__toggle-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
|
||||
.adv__toggle-sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
|
||||
.adv__mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* Permission groups */
|
||||
.adv__perm-empty { font-size: var(--text-sm); color: var(--text-tertiary); text-align: center; padding: 20px 0; }
|
||||
.adv__perm-list { display: flex; flex-direction: column; gap: 8px; }
|
||||
.adv__perm-row { display: flex; align-items: center; gap: 8px; }
|
||||
.adv__perm-name { flex: 1; }
|
||||
.adv__perm-delay { width: 72px; flex: none; text-align: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
|
||||
.adv__del-btn {
|
||||
width: 34px; height: 34px; border-radius: var(--radius-sm); border: none; background: transparent;
|
||||
color: var(--danger); display: flex; align-items: center; justify-content: center;
|
||||
cursor: pointer; transition: var(--transition-colors); flex: none;
|
||||
}
|
||||
.adv__del-btn:hover { background: var(--status-offline-soft); }
|
||||
|
||||
/* 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); }
|
||||
|
||||
/* Modal */
|
||||
.adv__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;
|
||||
}
|
||||
.adv__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;
|
||||
}
|
||||
.adv__modal-title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
|
||||
.adv__modal-desc { font-size: var(--text-sm); color: var(--text-tertiary); line-height: 1.5; }
|
||||
.adv__modal-body { display: flex; flex-direction: column; gap: 12px; }
|
||||
.adv__modal-footer { display: flex; justify-content: flex-end; gap: 8px; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user