refactor: remove unused launcher code
- Remove old Server Launcher Modal from index.html (210 lines) - Remove launcher state variables and methods from app.js - Remove unused constants: LAUNCHER_PRICES, PLAN_SPECS, REGIONS, OS_LIST, PAYMENT_METHODS, DEPLOY_TIMING - Remove deprecated API methods for deleted functions - Preserve: wizard, pricing table, dashboard functionality Total reduction: ~440+ lines of unused code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
211
index.html
211
index.html
@@ -1042,217 +1042,6 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Server Launcher Modal -->
|
||||
|
||||
<div x-show="launcherOpen"
|
||||
|
||||
x-transition:enter="transition ease-out duration-300"
|
||||
|
||||
x-transition:enter-start="opacity-0"
|
||||
|
||||
x-transition:enter-end="opacity-100"
|
||||
|
||||
x-transition:leave="transition ease-in duration-200"
|
||||
|
||||
x-transition:leave-start="opacity-100"
|
||||
|
||||
x-transition:leave-end="opacity-0"
|
||||
|
||||
class="fixed inset-0 z-[100] flex items-center justify-center p-2 sm:p-4 bg-dark-900/90 backdrop-blur-sm"
|
||||
|
||||
style="display: none;">
|
||||
|
||||
|
||||
|
||||
<div @click.away="if(!launching) launcherOpen = false"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="modal-main-title"
|
||||
aria-describedby="modal-description"
|
||||
class="bg-slate-900/95 backdrop-blur-xl border border-white/10 mx-2 sm:mx-4 rounded-3xl shadow-2xl shadow-black/50 overflow-hidden flex flex-col"
|
||||
style="width: 100%; max-width: 800px; max-height: 90vh; height: 90vh;">
|
||||
|
||||
<!-- Accessibility: Hidden description -->
|
||||
<div id="modal-description" class="sr-only">
|
||||
단계별로 서버 구성을 선택하세요. 각 단계에서 옵션을 클릭하거나 Tab 키로 네비게이션할 수 있습니다. ESC 키를 누르면 닫을 수 있습니다.
|
||||
</div>
|
||||
|
||||
<!-- Modal Header -->
|
||||
<div class="px-4 py-3 border-b border-white/5 flex justify-between items-center flex-shrink-0">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-brand-500 to-purple-500 flex items-center justify-center text-sm flex-shrink-0">🚀</div>
|
||||
<div>
|
||||
<h2 id="modal-main-title" class="text-sm font-bold text-white">서버 생성 마법사</h2>
|
||||
<p class="text-[10px] text-slate-400">Anvil Forge Bot</p>
|
||||
</div>
|
||||
</div>
|
||||
<button @click="resetLauncher"
|
||||
aria-label="모달 닫기 (ESC 키 지원)"
|
||||
class="modal-close w-8 h-8 flex items-center justify-center rounded-full bg-white/5 text-slate-400 hover:bg-white/10 hover:text-white transition flex-shrink-0"
|
||||
x-show="!launching">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Chat Container -->
|
||||
<div id="chat-container" role="log" aria-live="polite" class="flex-1 overflow-y-auto px-3 sm:px-6 py-3 sm:py-4 space-y-2 sm:space-y-4" x-show="wizardStep < 5">
|
||||
<!-- Messages -->
|
||||
<template x-for="(msg, idx) in messages" :key="idx">
|
||||
<div :class="msg.type === 'bot' ? 'flex justify-start' : 'flex justify-end'"
|
||||
role="article"
|
||||
:aria-label="(msg.type === 'bot' ? 'Anvil Forge Bot' : '당신') + ': ' + msg.text">
|
||||
<div :class="msg.type === 'bot'
|
||||
? 'bg-slate-800 text-slate-200 rounded-xl sm:rounded-2xl rounded-tl-sm'
|
||||
: 'bg-brand-500 text-white rounded-xl sm:rounded-2xl rounded-tr-sm'"
|
||||
class="px-3 py-2 sm:px-4 sm:py-2.5 text-xs sm:text-sm max-w-[90%] break-words"
|
||||
role="document">
|
||||
<span x-text="msg.text"></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Current Step Options -->
|
||||
<div class="pt-2">
|
||||
<!-- Step 0: Region Selection -->
|
||||
<fieldset x-show="wizardStep === 0" role="radiogroup" aria-label="리전 선택" class="space-y-3">
|
||||
<legend class="sr-only">리전 선택 (지역 선택)</legend>
|
||||
<template x-for="r in regions" :key="r.id">
|
||||
<button @click="selectRegion(r)"
|
||||
role="radio"
|
||||
:aria-checked="config.region === r.id"
|
||||
:tabindex="config.region === r.id ? '0' : '-1'"
|
||||
class="w-full flex items-center justify-between px-5 py-4 bg-slate-800/80 hover:bg-slate-700 border-2 rounded-xl transition-all group"
|
||||
:class="config.region === r.id
|
||||
? 'border-brand-500 bg-brand-500/10'
|
||||
: 'border-slate-700/50 hover:border-brand-500/50'">
|
||||
<div class="flex items-center gap-4">
|
||||
<span class="text-3xl" x-text="r.flag"></span>
|
||||
<div class="text-left">
|
||||
<div class="font-semibold text-white text-base" x-text="r.name"></div>
|
||||
<div class="text-sm text-slate-300" x-text="r.id"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm text-slate-500 group-hover:text-brand-400 font-mono" x-text="r.ping"></div>
|
||||
</button>
|
||||
</template>
|
||||
</fieldset>
|
||||
|
||||
<!-- Step 1: Plan Selection -->
|
||||
<fieldset x-show="wizardStep === 1" class="space-y-3">
|
||||
<legend class="sr-only">플랜 선택 (서버 사양 선택)</legend>
|
||||
<template x-for="p in plans" :key="p">
|
||||
<button @click="selectPlan(p)"
|
||||
class="w-full flex items-center justify-between px-5 py-4 bg-slate-800/80 hover:bg-slate-700 border border-slate-700/50 hover:border-brand-500/50 rounded-xl transition-all">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="w-12 h-12 rounded-lg bg-slate-700/50 flex items-center justify-center text-2xl"
|
||||
x-text="p === 'Micro' ? '🔹' : p === 'Starter' ? '🔷' : p === 'Pro' ? '⭐' : '💎'"></div>
|
||||
<div class="text-left">
|
||||
<div class="font-semibold text-white text-base" x-text="p"></div>
|
||||
<div class="text-sm text-slate-400" x-text="getPlanSpec(p)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="font-bold text-brand-400 text-base" x-text="'₩' + getPrice(p)"></div>
|
||||
<div class="text-xs text-slate-500">/월</div>
|
||||
</div>
|
||||
</button>
|
||||
</template>
|
||||
</fieldset>
|
||||
|
||||
<!-- Step 2: OS Selection -->
|
||||
<fieldset x-show="wizardStep === 2" class="space-y-3">
|
||||
<legend class="sr-only">운영체제 선택</legend>
|
||||
<template x-for="os in osList" :key="os.id">
|
||||
<button @click="selectOS(os)"
|
||||
class="w-full flex items-center gap-4 px-5 py-4 bg-slate-800/80 hover:bg-slate-700 border border-slate-700/50 hover:border-purple-500/50 rounded-xl transition-all">
|
||||
<span class="text-2xl" x-text="os.icon"></span>
|
||||
<span class="font-semibold text-white text-base" x-text="os.name"></span>
|
||||
</button>
|
||||
</template>
|
||||
</fieldset>
|
||||
|
||||
<!-- Step 3: Payment Selection -->
|
||||
<fieldset x-show="wizardStep === 3" class="space-y-3">
|
||||
<legend class="sr-only">결제 방식 선택</legend>
|
||||
<template x-for="pay in paymentMethods" :key="pay.id">
|
||||
<button @click="selectPayment(pay)"
|
||||
class="w-full flex items-center justify-between px-5 py-4 bg-slate-800/80 hover:bg-slate-700 border border-slate-700/50 hover:border-green-500/50 rounded-xl transition-all">
|
||||
<div class="text-left">
|
||||
<div class="font-semibold text-white text-base" x-text="pay.name"></div>
|
||||
<div class="text-sm text-slate-400" x-text="pay.desc"></div>
|
||||
</div>
|
||||
<div x-show="pay.discount > 0" class="px-3 py-1.5 bg-green-500/20 text-green-400 text-sm font-bold rounded-full">
|
||||
-<span x-text="pay.discount"></span>%
|
||||
</div>
|
||||
</button>
|
||||
</template>
|
||||
</fieldset>
|
||||
|
||||
<!-- Step 4: Confirmation -->
|
||||
<div x-show="wizardStep === 4" class="space-y-4">
|
||||
<div class="px-5 py-4 bg-slate-800/50 border border-slate-700/50 rounded-xl space-y-3">
|
||||
<div class="flex justify-between text-base"><span class="text-slate-400">리전</span><span class="text-white font-medium" x-text="config.region"></span></div>
|
||||
<div class="flex justify-between text-base"><span class="text-slate-400">플랜</span><span class="text-white font-medium" x-text="config.plan + ' (' + getPlanSpec(config.plan) + ')'"></span></div>
|
||||
<div class="flex justify-between text-base"><span class="text-slate-400">OS</span><span class="text-white font-medium" x-text="config.os"></span></div>
|
||||
<div class="flex justify-between text-base"><span class="text-slate-400">결제</span><span class="text-white font-medium" x-text="config.payment === 'yearly' ? '연간' : '월간'"></span></div>
|
||||
<div class="border-t border-slate-700 pt-3 mt-3 flex justify-between font-bold text-lg">
|
||||
<span class="text-slate-300">월 요금</span>
|
||||
<span class="text-brand-400" x-text="'₩' + getFinalPrice().toLocaleString('ko-KR')"></span>
|
||||
</div>
|
||||
</div>
|
||||
<button @click="startLaunch"
|
||||
class="w-full py-4 bg-gradient-to-r from-brand-600 to-brand-500 hover:from-brand-500 hover:to-brand-400 text-white font-bold rounded-xl transition-all shadow-lg shadow-brand-500/25 active:scale-[0.98] text-base">
|
||||
🚀 서버 생성하기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Back Button -->
|
||||
<div x-show="wizardStep > 0 && wizardStep < 5" class="px-4 pb-3 flex-shrink-0">
|
||||
<button @click="goBack" class="text-xs text-slate-500 hover:text-slate-300 transition flex items-center gap-1">
|
||||
<svg class="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/></svg>
|
||||
이전 단계
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Deploying State -->
|
||||
<div x-show="wizardStep >= 5" class="p-4 flex flex-col min-h-[300px]">
|
||||
<!-- Progress -->
|
||||
<div class="mb-4">
|
||||
<div class="flex justify-between text-xs text-slate-400 mb-2">
|
||||
<span x-text="deployStep < 5 ? '배포 중...' : '완료'"></span>
|
||||
<span x-text="(deployStep * 20) + '%'"></span>
|
||||
</div>
|
||||
<div class="h-1.5 bg-slate-800 rounded-full overflow-hidden">
|
||||
<div class="h-full bg-gradient-to-r from-brand-500 to-purple-500 transition-all duration-500 rounded-full" :style="'width: ' + (deployStep * 20) + '%'"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Logs -->
|
||||
<div class="flex-1 bg-black/30 rounded-xl p-3 text-xs text-slate-400 overflow-y-auto border border-white/5 space-y-1 max-h-40">
|
||||
<template x-for="(log, idx) in logs" :key="idx">
|
||||
<div x-text="log"></div>
|
||||
</template>
|
||||
<div x-show="launching" class="animate-pulse text-brand-400">▋</div>
|
||||
</div>
|
||||
|
||||
<!-- Success State -->
|
||||
<div x-show="deployStep === 5" x-transition class="mt-4 p-4 bg-gradient-to-br from-brand-500/10 to-purple-500/10 border border-brand-500/20 rounded-2xl text-center">
|
||||
<div class="w-12 h-12 rounded-full bg-gradient-to-br from-brand-500 to-purple-500 flex items-center justify-center text-white text-xl mb-2 mx-auto">✓</div>
|
||||
<h4 class="text-base font-bold text-white mb-1">서버 준비 완료!</h4>
|
||||
<p class="text-slate-400 text-xs mb-3">인스턴스가 활성화되었습니다</p>
|
||||
<div class="flex gap-2">
|
||||
<button @click="resetLauncher" class="flex-1 py-2.5 bg-slate-800 hover:bg-slate-700 text-white font-semibold rounded-xl transition text-sm">닫기</button>
|
||||
<a href="https://t.me/AnvilForgeBot" target="_blank" rel="noopener noreferrer" class="flex-1 py-2.5 bg-gradient-to-r from-brand-600 to-brand-500 text-white font-semibold rounded-xl transition text-center text-sm">Console →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Server Recommendation Wizard Modal -->
|
||||
<div x-show="wizardOpen"
|
||||
x-transition:enter="transition ease-out duration-300"
|
||||
|
||||
Reference in New Issue
Block a user