feat: Remove Dashboard and Workspace views, set CharactersView as the root route, and add a deploy script.
This commit is contained in:
7
deploy.sh
Executable file
7
deploy.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
|
||||
ssh root@31.59.58.220 "
|
||||
cd /root/ai/ai-service-front &&
|
||||
git pull &&
|
||||
npm run build &&
|
||||
cp -r dist/* /var/www/ai.luminic.space/
|
||||
"
|
||||
@@ -12,28 +12,18 @@ const router = createRouter({
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'dashboard',
|
||||
component: DashboardView
|
||||
name: 'characters',
|
||||
component: () => import('../views/CharactersView.vue')
|
||||
},
|
||||
{
|
||||
path: '/assets',
|
||||
name: 'assets',
|
||||
component: () => import('../views/AssetsView.vue')
|
||||
},
|
||||
{
|
||||
path: '/characters',
|
||||
name: 'characters',
|
||||
component: () => import('../views/CharactersView.vue')
|
||||
},
|
||||
{
|
||||
path: '/characters/:id',
|
||||
name: 'character-detail',
|
||||
component: () => import('../views/CharacterDetailView.vue')
|
||||
},
|
||||
{
|
||||
path: '/workspace/:id',
|
||||
name: 'workspace',
|
||||
component: () => import('../views/WorkspaceView.vue')
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
@@ -20,29 +20,26 @@ onMounted(async () => {
|
||||
}
|
||||
})
|
||||
|
||||
const goBack = () => {
|
||||
router.push('/')
|
||||
}
|
||||
|
||||
const goToDetail = (id) => {
|
||||
router.push(`/characters/${id}`)
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem('auth_code')
|
||||
router.push('/login')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-screen bg-slate-900 overflow-hidden">
|
||||
<div class="flex h-screen bg-slate-900 overflow-hidden text-slate-100">
|
||||
<!-- Sidebar -->
|
||||
<nav class="glass-panel w-20 m-4 flex flex-col items-center py-6 rounded-3xl z-10">
|
||||
<div class="mb-12 cursor-pointer" @click="goBack">
|
||||
<nav class="glass-panel w-20 m-4 flex flex-col items-center py-6 rounded-3xl z-10 border border-white/5">
|
||||
<div class="mb-12">
|
||||
<div
|
||||
class="w-10 h-10 bg-white/10 rounded-xl flex items-center justify-center font-bold text-white text-xl transition-all duration-300 hover:bg-white/20">
|
||||
←
|
||||
class="w-10 h-10 bg-gradient-to-br from-violet-600 to-cyan-500 rounded-xl flex items-center justify-center font-bold text-white text-xl shadow-lg shadow-violet-500/20">
|
||||
AI
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 flex flex-col gap-6 w-full items-center">
|
||||
<div class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/10 hover:text-slate-50"
|
||||
@click="router.push('/')">
|
||||
<div
|
||||
class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 bg-white/10 text-slate-50 shadow-inner">
|
||||
<span class="text-2xl">🏠</span>
|
||||
</div>
|
||||
<div class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/10 hover:text-slate-50"
|
||||
@@ -50,10 +47,22 @@ const goToDetail = (id) => {
|
||||
<span class="text-2xl">📂</span>
|
||||
</div>
|
||||
<div
|
||||
class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 bg-white/10 text-slate-50">
|
||||
class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/10 hover:text-slate-50">
|
||||
<span class="text-2xl">👥</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-auto flex flex-col items-center gap-4">
|
||||
<div @click="handleLogout"
|
||||
class="w-10 h-10 rounded-xl bg-red-500/10 text-red-400 flex items-center justify-center cursor-pointer hover:bg-red-500/20 transition-all font-bold"
|
||||
title="Logout">
|
||||
<i class="pi pi-power-off"></i>
|
||||
</div>
|
||||
<div class="w-10 h-10 rounded-full bg-slate-800 border-2 border-violet-600 flex items-center justify-center font-bold text-slate-50 cursor-pointer hover:scale-105 transition-all"
|
||||
title="Profile">
|
||||
U
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Main Content -->
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
import Button from 'primevue/button'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const aiModels = [
|
||||
{
|
||||
id: 'chatgpt',
|
||||
name: 'ChatGPT',
|
||||
provider: 'OpenAI',
|
||||
description: 'Advanced conversational AI for coding, writing, and analysis.',
|
||||
icon: '🤖',
|
||||
color: '#10a37f'
|
||||
},
|
||||
{
|
||||
id: 'gemini',
|
||||
name: 'Gemini',
|
||||
provider: 'Google',
|
||||
description: 'Multimodal AI model with reasoning and coding capabilities.',
|
||||
icon: '✨',
|
||||
color: '#4285f4'
|
||||
},
|
||||
{
|
||||
id: 'nana-banana',
|
||||
name: 'Nana Banana',
|
||||
provider: 'Custom',
|
||||
description: 'Specialized creative assistant for unique tasks.',
|
||||
icon: '🍌',
|
||||
color: '#eab308'
|
||||
},
|
||||
{
|
||||
id: 'kling',
|
||||
name: 'Kling',
|
||||
provider: 'Kling AI',
|
||||
description: 'Next-generation video generation and processing.',
|
||||
icon: '🎥',
|
||||
color: '#ef4444'
|
||||
}
|
||||
]
|
||||
|
||||
const selectModel = (id) => {
|
||||
console.log(`Selected model: ${id}`)
|
||||
router.push(`/workspace/${id}`)
|
||||
}
|
||||
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem('auth_code')
|
||||
router.push('/login')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-screen bg-slate-900 overflow-hidden text-slate-100">
|
||||
<!-- Sidebar -->
|
||||
<nav class="glass-panel w-20 m-4 flex flex-col items-center py-6 rounded-3xl z-10 border border-white/5">
|
||||
<div class="mb-12">
|
||||
<div
|
||||
class="w-10 h-10 bg-gradient-to-br from-violet-600 to-cyan-500 rounded-xl flex items-center justify-center font-bold text-white text-xl shadow-lg shadow-violet-500/20">
|
||||
AI
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 flex flex-col gap-6 w-full items-center">
|
||||
<div
|
||||
class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 bg-white/10 text-slate-50 shadow-inner">
|
||||
<span class="text-2xl">🏠</span>
|
||||
</div>
|
||||
<div class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/10 hover:text-slate-50"
|
||||
@click="router.push('/assets')">
|
||||
<span class="text-2xl">📂</span>
|
||||
</div>
|
||||
<div class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/10 hover:text-slate-50"
|
||||
@click="router.push('/characters')">
|
||||
<span class="text-2xl">👥</span>
|
||||
</div>
|
||||
|
||||
<div class="w-10 h-px bg-white/10 my-2"></div>
|
||||
|
||||
<div v-for="model in aiModels" :key="model.id"
|
||||
class="w-12 h-12 flex items-center justify-center rounded-xl cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/10"
|
||||
:style="{ '--model-color': model.color }" @click="selectModel(model.id)" :title="model.name">
|
||||
<span class="text-2xl">{{ model.icon }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-auto flex flex-col items-center gap-4">
|
||||
<div @click="handleLogout"
|
||||
class="w-10 h-10 rounded-xl bg-red-500/10 text-red-400 flex items-center justify-center cursor-pointer hover:bg-red-500/20 transition-all"
|
||||
title="Logout">
|
||||
<i class="pi pi-power-off"></i>
|
||||
</div>
|
||||
<div class="w-10 h-10 rounded-full bg-slate-800 border-2 border-violet-600 flex items-center justify-center font-bold text-slate-50 cursor-pointer hover:scale-105 transition-all"
|
||||
title="Profile">
|
||||
U
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 p-8 overflow-y-auto flex flex-col">
|
||||
<!-- Top Bar -->
|
||||
<header class="flex justify-between items-end mb-12">
|
||||
<div>
|
||||
<h1
|
||||
class="text-5xl font-bold m-0 italic tracking-tight bg-gradient-to-r from-white to-slate-500 bg-clip-text text-transparent">
|
||||
Workspace</h1>
|
||||
<p class="mt-2 mb-0 text-slate-400 font-medium tracking-wide">Welcome back to your controlled
|
||||
environment</p>
|
||||
</div>
|
||||
<div>
|
||||
<Button label="New Project" icon="pi pi-plus" class="btn-secondary" outlined />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Models Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2 gap-8">
|
||||
<div v-for="model in aiModels" :key="model.id"
|
||||
class="glass-panel p-8 relative overflow-hidden cursor-pointer transition-all duration-300 flex flex-col h-60 rounded-2xl border border-white/5 hover:-translate-y-2 hover:border-white/20"
|
||||
@click="selectModel(model.id)" :style="{ '--accent-color': model.color }">
|
||||
<div class="flex justify-between items-start mb-6">
|
||||
<span class="text-5xl">{{ model.icon }}</span>
|
||||
<span
|
||||
class="text-xs px-3 py-1 bg-white/10 rounded-full text-slate-400 font-bold tracking-wider uppercase">
|
||||
{{ model.provider }}
|
||||
</span>
|
||||
</div>
|
||||
<h3 class="text-2xl font-bold mb-2">{{ model.name }}</h3>
|
||||
<p class="text-slate-400 text-sm leading-relaxed mb-auto">
|
||||
{{ model.description }}
|
||||
</p>
|
||||
<div class="mt-6">
|
||||
<button
|
||||
class="bg-transparent border-none font-bold p-0 cursor-pointer transition-all duration-300 flex items-center gap-2 group"
|
||||
:style="{ color: model.color }">
|
||||
Initialize Workspace <i
|
||||
class="pi pi-arrow-right text-xs transition-transform group-hover:translate-x-1"></i>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Glow Effect -->
|
||||
<div class="absolute top-0 right-0 w-38 h-38 opacity-10 transition-opacity duration-300 pointer-events-none blur-3xl"
|
||||
:style="{ background: `radial-gradient(circle, ${model.color} 0%, transparent 70%)` }"></div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.model-nav-item:hover {
|
||||
box-shadow: 0 0 10px var(--model-color);
|
||||
}
|
||||
</style>
|
||||
@@ -1,215 +0,0 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, computed, nextTick } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { aiService } from '../services/aiService'
|
||||
import Button from 'primevue/button'
|
||||
import Textarea from 'primevue/textarea'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const modelId = route.params.id
|
||||
|
||||
// Mock data for models - in a real app this might come from a store or config
|
||||
const models = {
|
||||
'chatgpt': { name: 'ChatGPT', provider: 'OpenAI', icon: '🤖', color: '#10a37f' },
|
||||
'gemini': { name: 'Gemini', provider: 'Google', icon: '✨', color: '#4285f4' },
|
||||
'nana-banana': { name: 'Nana Banana', provider: 'Custom', icon: '🍌', color: '#eab308' },
|
||||
'kling': { name: 'Kling', provider: 'Kling AI', icon: '🎥', color: '#ef4444' }
|
||||
}
|
||||
|
||||
const currentModel = computed(() => models[modelId] || { name: 'Unknown', color: '#888' })
|
||||
|
||||
const messages = ref([
|
||||
{ id: 1, role: 'assistant', content: `Hello! I'm ${currentModel.value.name}. How can I help you today?`, timestamp: new Date() }
|
||||
])
|
||||
|
||||
const userInput = ref('')
|
||||
const isTyping = ref(false)
|
||||
const chatContainer = ref(null)
|
||||
|
||||
const scrollToBottom = async () => {
|
||||
await nextTick()
|
||||
if (chatContainer.value) {
|
||||
chatContainer.value.scrollTop = chatContainer.value.scrollHeight
|
||||
}
|
||||
}
|
||||
|
||||
const sendMessage = async () => {
|
||||
if (!userInput.value.trim()) return
|
||||
|
||||
// Add user message
|
||||
const userMsg = {
|
||||
id: Date.now(),
|
||||
role: 'user',
|
||||
content: userInput.value,
|
||||
timestamp: new Date()
|
||||
}
|
||||
messages.value.push(userMsg)
|
||||
|
||||
const msgContent = userInput.value
|
||||
userInput.value = ''
|
||||
scrollToBottom()
|
||||
|
||||
// Simulate API call/Typing
|
||||
isTyping.value = true
|
||||
|
||||
try {
|
||||
const response = await aiService.sendMessage(modelId, msgContent, messages.value)
|
||||
messages.value.push(response)
|
||||
} catch (error) {
|
||||
console.error('Failed to get response:', error)
|
||||
messages.value.push({
|
||||
id: Date.now(),
|
||||
role: 'system',
|
||||
content: 'Error: Could not connect to AI service.',
|
||||
timestamp: new Date()
|
||||
})
|
||||
} finally {
|
||||
isTyping.value = false
|
||||
scrollToBottom()
|
||||
}
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
router.push('/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex h-screen bg-slate-900 text-slate-50 overflow-hidden">
|
||||
<!-- Sidebar -->
|
||||
<aside class="glass-panel w-70 m-4 flex flex-col rounded-2xl overflow-hidden">
|
||||
<div class="p-6 border-b border-white/5 flex items-center gap-4">
|
||||
<button @click="goBack"
|
||||
class="bg-white/10 border-none text-slate-50 w-8 h-8 rounded-full cursor-pointer flex items-center justify-center transition-all duration-300 hover:bg-white/20"
|
||||
title="Back to Dashboard">
|
||||
←
|
||||
</button>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-10 h-10 rounded-xl flex items-center justify-center text-xl"
|
||||
:style="{ background: currentModel.color }">
|
||||
{{ currentModel.icon }}
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-base m-0">{{ currentModel.name }}</h2>
|
||||
<span class="text-xs text-green-400 flex items-center gap-1">
|
||||
<span class="w-1.5 h-1.5 bg-green-400 rounded-full"></span>
|
||||
Online
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 p-6 overflow-y-auto">
|
||||
<div class="text-xs uppercase tracking-wider text-slate-400 mb-4">History</div>
|
||||
<div class="space-y-1">
|
||||
<div
|
||||
class="flex items-center gap-3 px-4 py-3 rounded-lg cursor-pointer transition-all duration-300 bg-white/10 text-slate-50">
|
||||
<span>💬</span>
|
||||
<span class="text-sm">New Conversation</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center gap-3 px-4 py-3 rounded-lg cursor-pointer transition-all duration-300 text-slate-400 hover:bg-white/5 hover:text-slate-50">
|
||||
<span>📅</span>
|
||||
<span class="text-sm">Previous Session</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 border-t border-white/5">
|
||||
<button
|
||||
class="w-full bg-transparent border-none text-slate-400 px-3 py-3 cursor-pointer flex items-center gap-3 transition-all duration-300 hover:text-slate-50">
|
||||
<span>⚙️</span>
|
||||
<span>Settings</span>
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Chat Area -->
|
||||
<main class="flex-1 flex flex-col relative mr-4 my-4">
|
||||
<div ref="chatContainer" class="flex-1 overflow-y-auto p-8 flex flex-col gap-6 scroll-smooth">
|
||||
<div v-for="msg in messages" :key="msg.id"
|
||||
:class="['flex gap-4 max-w-4/5', msg.role === 'user' ? 'ml-auto flex-row-reverse' : '']">
|
||||
<div v-if="msg.role === 'assistant'"
|
||||
class="w-9 h-9 rounded-full flex items-center justify-center flex-shrink-0 text-base"
|
||||
:style="{ background: currentModel.color }">
|
||||
{{ currentModel.icon }}
|
||||
</div>
|
||||
<div :class="[
|
||||
'px-6 py-4 rounded-xl relative',
|
||||
msg.role === 'user'
|
||||
? 'bg-violet-600 rounded-tr-sm border-none'
|
||||
: 'glass-panel rounded-tl-sm'
|
||||
]">
|
||||
<p class="m-0 leading-relaxed">{{ msg.content }}</p>
|
||||
<span class="text-xs opacity-50 mt-2 block">
|
||||
{{ msg.timestamp.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isTyping" class="flex gap-4 max-w-4/5">
|
||||
<div class="w-9 h-9 rounded-full flex items-center justify-center flex-shrink-0 text-base"
|
||||
:style="{ background: currentModel.color }">
|
||||
{{ currentModel.icon }}
|
||||
</div>
|
||||
<div class="glass-panel px-5 py-5 flex gap-1 rounded-tl-sm rounded-xl">
|
||||
<span class="w-1.5 h-1.5 bg-white/50 rounded-full animate-bounce"
|
||||
style="animation-delay: -0.32s;"></span>
|
||||
<span class="w-1.5 h-1.5 bg-white/50 rounded-full animate-bounce"
|
||||
style="animation-delay: -0.16s;"></span>
|
||||
<span class="w-1.5 h-1.5 bg-white/50 rounded-full animate-bounce"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="glass-panel mx-8 mb-8 p-2 rounded-2xl">
|
||||
<div class="flex items-end gap-2 bg-black/20 rounded-xl p-2">
|
||||
<Textarea v-model="userInput" @keydown.enter.prevent="sendMessage" placeholder="Type a message..."
|
||||
rows="1" auto-resize
|
||||
class="flex-1 bg-transparent border-none p-3 text-slate-50 resize-none max-h-30 focus:outline-none focus:shadow-none" />
|
||||
<Button @click="sendMessage" :disabled="!userInput.trim()"
|
||||
class="bg-violet-600 text-white border-none w-10 h-10 rounded-lg flex items-center justify-center cursor-pointer transition-all duration-300 hover:bg-violet-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
icon="pi pi-send" text />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* Custom scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
@apply bg-white/10 rounded;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
@apply bg-white/20;
|
||||
}
|
||||
|
||||
/* Typing animation */
|
||||
@keyframes bounce {
|
||||
|
||||
0%,
|
||||
80%,
|
||||
100% {
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.animate-bounce {
|
||||
animation: bounce 1.4s infinite ease-in-out both;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user