up frontend

This commit is contained in:
2026-04-21 03:57:59 +03:00
parent b9d1afad42
commit 82a932dd2b
14 changed files with 492 additions and 172 deletions

View File

@@ -7,32 +7,32 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z" />
</svg>
</div>
<h1 class="text-3xl font-bold text-gray-900">Create Account</h1>
<p class="text-gray-600 mt-2">Register and wait for admin approval</p>
<h1 class="text-3xl font-bold text-gray-900">{{ t('register.title') }}</h1>
<p class="text-gray-600 mt-2">{{ t('register.subtitle') }}</p>
</div>
<div class="bg-white rounded-2xl shadow-xl p-8">
<form @submit.prevent="handleRegister" class="space-y-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Username</label>
<label class="block text-sm font-medium text-gray-700 mb-2">{{ t('register.username') }}</label>
<input v-model="form.login" type="text" required minlength="3" class="input-field" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Email</label>
<label class="block text-sm font-medium text-gray-700 mb-2">{{ t('common.email') }}</label>
<input v-model="form.email" type="email" required class="input-field" />
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Password</label>
<label class="block text-sm font-medium text-gray-700 mb-2">{{ t('common.password') }}</label>
<input v-model="form.password" type="password" required minlength="6" class="input-field" />
</div>
<button type="submit" :disabled="loading" class="w-full btn-primary py-3">
<span v-if="!loading">Register</span>
<span v-if="!loading">{{ t('register.register') }}</span>
<span v-else>Loading...</span>
</button>
</form>
<p v-if="success" class="mt-4 text-green-600 text-center">Account created! Wait for admin activation.</p>
<p v-if="success" class="mt-4 text-green-600 text-center">{{ t('register.success') }}</p>
<p v-if="error" class="mt-4 text-red-600 text-center">{{ error }}</p>
<p class="mt-4 text-center text-sm text-gray-600">
Already have an account? <router-link to="/login" class="text-primary-600">Login</router-link>
{{ t('register.alreadyHaveAccount') }} <router-link to="/login" class="text-primary-600">{{ t('login.signin') }}</router-link>
</p>
</div>
</div>
@@ -41,6 +41,8 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const form = ref({ login: '', email: '', password: '' })
const loading = ref(false)
const error = ref('')