Spaces:
Running
Running
ở mỗi node lúc vào chi tiết các node thì thêm nút export. Export ở đây là embed into website (sinh ra 1 đoạn mã để gửi cho khách) hay là xuất list API tích hợp - Initial Deployment
Browse files- README.md +7 -5
- index.html +807 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: manager-node
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,807 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Chatbot Node Management System</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
.node-card:hover {
|
| 11 |
+
transform: translateY(-5px);
|
| 12 |
+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
|
| 13 |
+
}
|
| 14 |
+
.sidebar {
|
| 15 |
+
transition: all 0.3s ease;
|
| 16 |
+
}
|
| 17 |
+
@media (max-width: 768px) {
|
| 18 |
+
.sidebar {
|
| 19 |
+
transform: translateX(-100%);
|
| 20 |
+
position: fixed;
|
| 21 |
+
z-index: 50;
|
| 22 |
+
height: 100vh;
|
| 23 |
+
}
|
| 24 |
+
.sidebar.active {
|
| 25 |
+
transform: translateX(0);
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
.connection-line {
|
| 29 |
+
position: relative;
|
| 30 |
+
}
|
| 31 |
+
.connection-line::after {
|
| 32 |
+
content: '';
|
| 33 |
+
position: absolute;
|
| 34 |
+
top: 50%;
|
| 35 |
+
left: -20px;
|
| 36 |
+
width: 15px;
|
| 37 |
+
height: 2px;
|
| 38 |
+
background-color: #3b82f6;
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
</head>
|
| 42 |
+
<body class="bg-gray-50">
|
| 43 |
+
<div class="flex h-screen overflow-hidden">
|
| 44 |
+
<!-- Sidebar -->
|
| 45 |
+
<div class="sidebar bg-white w-64 border-r border-gray-200 flex flex-col">
|
| 46 |
+
<div class="p-4 border-b border-gray-200">
|
| 47 |
+
<h1 class="text-xl font-bold text-blue-600 flex items-center">
|
| 48 |
+
<i class="fas fa-robot mr-2"></i> ChatNode Manager
|
| 49 |
+
</h1>
|
| 50 |
+
</div>
|
| 51 |
+
<div class="flex-1 overflow-y-auto">
|
| 52 |
+
<div class="p-4">
|
| 53 |
+
<button id="createNodeBtn" class="w-full bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded-lg flex items-center justify-center">
|
| 54 |
+
<i class="fas fa-plus mr-2"></i> Create New Node
|
| 55 |
+
</button>
|
| 56 |
+
</div>
|
| 57 |
+
<div class="px-4">
|
| 58 |
+
<h3 class="text-sm font-semibold text-gray-500 uppercase tracking-wider">Your Nodes</h3>
|
| 59 |
+
<div id="nodeList" class="mt-2 space-y-1">
|
| 60 |
+
<!-- Nodes will be added here dynamically -->
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
<div class="p-4 border-t border-gray-200">
|
| 65 |
+
<div class="flex items-center">
|
| 66 |
+
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center">
|
| 67 |
+
<i class="fas fa-user text-blue-600"></i>
|
| 68 |
+
</div>
|
| 69 |
+
<div class="ml-3">
|
| 70 |
+
<p class="text-sm font-medium">Admin User</p>
|
| 71 |
+
<p class="text-xs text-gray-500">admin@chatnode.com</p>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<!-- Main Content -->
|
| 78 |
+
<div class="flex-1 flex flex-col overflow-hidden">
|
| 79 |
+
<!-- Top Navigation -->
|
| 80 |
+
<header class="bg-white border-b border-gray-200 flex items-center justify-between p-4">
|
| 81 |
+
<button id="sidebarToggle" class="md:hidden text-gray-500">
|
| 82 |
+
<i class="fas fa-bars text-xl"></i>
|
| 83 |
+
</button>
|
| 84 |
+
<div class="flex items-center space-x-4">
|
| 85 |
+
<div class="relative">
|
| 86 |
+
<input type="text" placeholder="Search nodes..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
| 87 |
+
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
|
| 88 |
+
</div>
|
| 89 |
+
<button class="p-2 text-gray-500 hover:text-gray-700">
|
| 90 |
+
<i class="fas fa-bell"></i>
|
| 91 |
+
</button>
|
| 92 |
+
</div>
|
| 93 |
+
</header>
|
| 94 |
+
|
| 95 |
+
<!-- Content Area -->
|
| 96 |
+
<main class="flex-1 overflow-y-auto p-6 bg-gray-50">
|
| 97 |
+
<!-- Dashboard View -->
|
| 98 |
+
<div id="dashboardView">
|
| 99 |
+
<div class="flex justify-between items-center mb-6">
|
| 100 |
+
<h2 class="text-2xl font-bold text-gray-800">Chatbot Nodes Dashboard</h2>
|
| 101 |
+
<div class="flex space-x-2">
|
| 102 |
+
<button class="px-3 py-1 border border-gray-300 rounded-lg text-sm flex items-center">
|
| 103 |
+
<i class="fas fa-filter mr-1"></i> Filter
|
| 104 |
+
</button>
|
| 105 |
+
<button class="px-3 py-1 border border-gray-300 rounded-lg text-sm flex items-center">
|
| 106 |
+
<i class="fas fa-sort mr-1"></i> Sort
|
| 107 |
+
</button>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 112 |
+
<!-- Node cards will be added here dynamically -->
|
| 113 |
+
<div class="node-card bg-white p-6 rounded-xl shadow-md border border-gray-200 transition-all duration-300 cursor-pointer" onclick="showNodeDetail('customer-support')">
|
| 114 |
+
<div class="flex justify-between items-start">
|
| 115 |
+
<div>
|
| 116 |
+
<h3 class="font-bold text-lg text-gray-800">Customer Support</h3>
|
| 117 |
+
<p class="text-sm text-gray-500 mt-1">Handles customer inquiries</p>
|
| 118 |
+
</div>
|
| 119 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">Active</span>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="mt-4 flex items-center text-sm text-gray-500">
|
| 122 |
+
<i class="fas fa-plug mr-1 text-blue-500"></i>
|
| 123 |
+
<span>Connected to MySQL</span>
|
| 124 |
+
</div>
|
| 125 |
+
<div class="mt-2 flex items-center text-sm text-gray-500">
|
| 126 |
+
<i class="fas fa-brain mr-1 text-purple-500"></i>
|
| 127 |
+
<span>GPT-4</span>
|
| 128 |
+
</div>
|
| 129 |
+
<div class="mt-4 pt-4 border-t border-gray-100 flex justify-between items-center">
|
| 130 |
+
<span class="text-xs text-gray-400">Last updated: 2 hours ago</span>
|
| 131 |
+
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">Manage</button>
|
| 132 |
+
</div>
|
| 133 |
+
</div>
|
| 134 |
+
|
| 135 |
+
<div class="node-card bg-white p-6 rounded-xl shadow-md border border-gray-200 transition-all duration-300 cursor-pointer" onclick="showNodeDetail('hr-assistant')">
|
| 136 |
+
<div class="flex justify-between items-start">
|
| 137 |
+
<div>
|
| 138 |
+
<h3 class="font-bold text-lg text-gray-800">HR Assistant</h3>
|
| 139 |
+
<p class="text-sm text-gray-500 mt-1">Answers HR policies questions</p>
|
| 140 |
+
</div>
|
| 141 |
+
<span class="bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded-full">Draft</span>
|
| 142 |
+
</div>
|
| 143 |
+
<div class="mt-4 flex items-center text-sm text-gray-500">
|
| 144 |
+
<i class="fas fa-file-alt mr-1 text-blue-500"></i>
|
| 145 |
+
<span>Connected to PDF files</span>
|
| 146 |
+
</div>
|
| 147 |
+
<div class="mt-2 flex items-center text-sm text-gray-500">
|
| 148 |
+
<i class="fas fa-brain mr-1 text-purple-500"></i>
|
| 149 |
+
<span>Gemini Pro</span>
|
| 150 |
+
</div>
|
| 151 |
+
<div class="mt-4 pt-4 border-t border-gray-100 flex justify-between items-center">
|
| 152 |
+
<span class="text-xs text-gray-400">Last updated: 1 day ago</span>
|
| 153 |
+
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">Manage</button>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
|
| 157 |
+
<div class="node-card bg-white p-6 rounded-xl shadow-md border border-gray-200 transition-all duration-300 cursor-pointer" onclick="showNodeDetail('tech-support')">
|
| 158 |
+
<div class="flex justify-between items-start">
|
| 159 |
+
<div>
|
| 160 |
+
<h3 class="font-bold text-lg text-gray-800">Tech Support</h3>
|
| 161 |
+
<p class="text-sm text-gray-500 mt-1">Technical troubleshooting</p>
|
| 162 |
+
</div>
|
| 163 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">Active</span>
|
| 164 |
+
</div>
|
| 165 |
+
<div class="mt-4 flex items-center text-sm text-gray-500">
|
| 166 |
+
<i class="fas fa-database mr-1 text-blue-500"></i>
|
| 167 |
+
<span>Connected to MongoDB</span>
|
| 168 |
+
</div>
|
| 169 |
+
<div class="mt-2 flex items-center text-sm text-gray-500">
|
| 170 |
+
<i class="fas fa-brain mr-1 text-purple-500"></i>
|
| 171 |
+
<span>Llama 2</span>
|
| 172 |
+
</div>
|
| 173 |
+
<div class="mt-4 pt-4 border-t border-gray-100 flex justify-between items-center">
|
| 174 |
+
<span class="text-xs text-gray-400">Last updated: 30 minutes ago</span>
|
| 175 |
+
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">Manage</button>
|
| 176 |
+
</div>
|
| 177 |
+
</div>
|
| 178 |
+
</div>
|
| 179 |
+
</div>
|
| 180 |
+
|
| 181 |
+
<!-- Node Detail View (hidden by default) -->
|
| 182 |
+
<div id="nodeDetailView" class="hidden">
|
| 183 |
+
<div class="mb-6 flex justify-between items-center">
|
| 184 |
+
<button onclick="showDashboard()" class="flex items-center text-blue-600 hover:text-blue-800">
|
| 185 |
+
<i class="fas fa-arrow-left mr-2"></i> Back to Dashboard
|
| 186 |
+
</button>
|
| 187 |
+
<div class="flex space-x-2">
|
| 188 |
+
<button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
|
| 189 |
+
<i class="fas fa-save mr-2"></i> Save Changes
|
| 190 |
+
</button>
|
| 191 |
+
<button onclick="showExportOptions()" class="px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700">
|
| 192 |
+
<i class="fas fa-download mr-2"></i> Export
|
| 193 |
+
</button>
|
| 194 |
+
<button class="px-4 py-2 bg-red-100 text-red-600 rounded-lg hover:bg-red-200">
|
| 195 |
+
<i class="fas fa-trash mr-2"></i> Delete Node
|
| 196 |
+
</button>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
|
| 200 |
+
<div class="bg-white rounded-xl shadow-md overflow-hidden">
|
| 201 |
+
<div class="p-6 border-b border-gray-200">
|
| 202 |
+
<div class="flex justify-between items-start">
|
| 203 |
+
<div>
|
| 204 |
+
<h2 id="nodeDetailTitle" class="text-2xl font-bold text-gray-800">Customer Support</h2>
|
| 205 |
+
<p class="text-gray-600 mt-1">Node ID: <span id="nodeDetailId" class="font-mono">customer-support</span></p>
|
| 206 |
+
</div>
|
| 207 |
+
<div class="flex items-center space-x-2">
|
| 208 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded-full">Active</span>
|
| 209 |
+
<button class="p-2 text-gray-500 hover:text-gray-700">
|
| 210 |
+
<i class="fas fa-cog"></i>
|
| 211 |
+
</button>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 p-6">
|
| 217 |
+
<!-- Node Configuration -->
|
| 218 |
+
<div class="lg:col-span-2 space-y-6">
|
| 219 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 220 |
+
<h3 class="font-semibold text-lg mb-4 flex items-center">
|
| 221 |
+
<i class="fas fa-sliders-h mr-2 text-blue-500"></i> Node Configuration
|
| 222 |
+
</h3>
|
| 223 |
+
|
| 224 |
+
<div class="space-y-4">
|
| 225 |
+
<div>
|
| 226 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Node Name</label>
|
| 227 |
+
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" value="Customer Support">
|
| 228 |
+
</div>
|
| 229 |
+
|
| 230 |
+
<div>
|
| 231 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Description</label>
|
| 232 |
+
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" rows="2">Handles customer inquiries and support tickets</textarea>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
<div>
|
| 236 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
|
| 237 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
| 238 |
+
<option>Active</option>
|
| 239 |
+
<option>Inactive</option>
|
| 240 |
+
<option>Draft</option>
|
| 241 |
+
<option>Maintenance</option>
|
| 242 |
+
</select>
|
| 243 |
+
</div>
|
| 244 |
+
</div>
|
| 245 |
+
</div>
|
| 246 |
+
|
| 247 |
+
<!-- Data Source Configuration -->
|
| 248 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 249 |
+
<h3 class="font-semibold text-lg mb-4 flex items-center">
|
| 250 |
+
<i class="fas fa-database mr-2 text-blue-500"></i> Data Source
|
| 251 |
+
</h3>
|
| 252 |
+
|
| 253 |
+
<div class="space-y-4">
|
| 254 |
+
<div>
|
| 255 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Source Type</label>
|
| 256 |
+
<div class="flex space-x-4">
|
| 257 |
+
<label class="inline-flex items-center">
|
| 258 |
+
<input type="radio" name="sourceType" class="h-4 w-4 text-blue-600" checked>
|
| 259 |
+
<span class="ml-2 text-gray-700">Database</span>
|
| 260 |
+
</label>
|
| 261 |
+
<label class="inline-flex items-center">
|
| 262 |
+
<input type="radio" name="sourceType" class="h-4 w-4 text-blue-600">
|
| 263 |
+
<span class="ml-2 text-gray-700">Document Files</span>
|
| 264 |
+
</label>
|
| 265 |
+
<label class="inline-flex items-center">
|
| 266 |
+
<input type="radio" name="sourceType" class="h-4 w-4 text-blue-600">
|
| 267 |
+
<span class="ml-2 text-gray-700">API</span>
|
| 268 |
+
</label>
|
| 269 |
+
</div>
|
| 270 |
+
</div>
|
| 271 |
+
|
| 272 |
+
<div id="databaseConfig">
|
| 273 |
+
<div class="grid grid-cols-2 gap-4">
|
| 274 |
+
<div>
|
| 275 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Database Type</label>
|
| 276 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
| 277 |
+
<option>MySQL</option>
|
| 278 |
+
<option>PostgreSQL</option>
|
| 279 |
+
<option>MongoDB</option>
|
| 280 |
+
<option>SQL Server</option>
|
| 281 |
+
</select>
|
| 282 |
+
</div>
|
| 283 |
+
<div>
|
| 284 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Connection String</label>
|
| 285 |
+
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" value="mysql://user:pass@localhost:3306/customer_db">
|
| 286 |
+
</div>
|
| 287 |
+
</div>
|
| 288 |
+
|
| 289 |
+
<div class="mt-4">
|
| 290 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Tables/Collections</label>
|
| 291 |
+
<div class="flex flex-wrap gap-2">
|
| 292 |
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">customers</span>
|
| 293 |
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">tickets</span>
|
| 294 |
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">products</span>
|
| 295 |
+
<button class="text-blue-600 hover:text-blue-800">
|
| 296 |
+
<i class="fas fa-plus"></i>
|
| 297 |
+
</button>
|
| 298 |
+
</div>
|
| 299 |
+
</div>
|
| 300 |
+
</div>
|
| 301 |
+
|
| 302 |
+
<div id="documentConfig" class="hidden">
|
| 303 |
+
<div>
|
| 304 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Upload Documents</label>
|
| 305 |
+
<div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg">
|
| 306 |
+
<div class="space-y-1 text-center">
|
| 307 |
+
<div class="flex text-sm text-gray-600">
|
| 308 |
+
<label class="relative cursor-pointer bg-white rounded-md font-medium text-blue-600 hover:text-blue-500 focus-within:outline-none">
|
| 309 |
+
<span>Upload files</span>
|
| 310 |
+
<input type="file" class="sr-only" multiple>
|
| 311 |
+
</label>
|
| 312 |
+
<p class="pl-1">or drag and drop</p>
|
| 313 |
+
</div>
|
| 314 |
+
<p class="text-xs text-gray-500">PDF, DOCX, TXT up to 10MB</p>
|
| 315 |
+
</div>
|
| 316 |
+
</div>
|
| 317 |
+
</div>
|
| 318 |
+
|
| 319 |
+
<div class="mt-4">
|
| 320 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Uploaded Files</label>
|
| 321 |
+
<ul class="divide-y divide-gray-200">
|
| 322 |
+
<li class="py-3 flex justify-between items-center">
|
| 323 |
+
<div class="flex items-center">
|
| 324 |
+
<i class="fas fa-file-pdf text-red-500 mr-2"></i>
|
| 325 |
+
<span>customer_manual.pdf</span>
|
| 326 |
+
</div>
|
| 327 |
+
<button class="text-red-500 hover:text-red-700">
|
| 328 |
+
<i class="fas fa-trash"></i>
|
| 329 |
+
</button>
|
| 330 |
+
</li>
|
| 331 |
+
<li class="py-3 flex justify-between items-center">
|
| 332 |
+
<div class="flex items-center">
|
| 333 |
+
<i class="fas fa-file-word text-blue-500 mr-2"></i>
|
| 334 |
+
<span>faq.docx</span>
|
| 335 |
+
</div>
|
| 336 |
+
<button class="text-red-500 hover:text-red-700">
|
| 337 |
+
<i class="fas fa-trash"></i>
|
| 338 |
+
</button>
|
| 339 |
+
</li>
|
| 340 |
+
</ul>
|
| 341 |
+
</div>
|
| 342 |
+
</div>
|
| 343 |
+
</div>
|
| 344 |
+
</div>
|
| 345 |
+
|
| 346 |
+
<!-- LLM Configuration -->
|
| 347 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 348 |
+
<h3 class="font-semibold text-lg mb-4 flex items-center">
|
| 349 |
+
<i class="fas fa-brain mr-2 text-purple-500"></i> Language Model
|
| 350 |
+
</h3>
|
| 351 |
+
|
| 352 |
+
<div class="space-y-4">
|
| 353 |
+
<div>
|
| 354 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Model Provider</label>
|
| 355 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
| 356 |
+
<option>OpenAI</option>
|
| 357 |
+
<option>Google Gemini</option>
|
| 358 |
+
<option>Anthropic Claude</option>
|
| 359 |
+
<option>Meta Llama</option>
|
| 360 |
+
<option>Ollama</option>
|
| 361 |
+
</select>
|
| 362 |
+
</div>
|
| 363 |
+
|
| 364 |
+
<div>
|
| 365 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Model</label>
|
| 366 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
| 367 |
+
<option>GPT-4</option>
|
| 368 |
+
<option>GPT-3.5 Turbo</option>
|
| 369 |
+
<option>GPT-4 Turbo</option>
|
| 370 |
+
</select>
|
| 371 |
+
</div>
|
| 372 |
+
|
| 373 |
+
<div>
|
| 374 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">API Key</label>
|
| 375 |
+
<div class="relative">
|
| 376 |
+
<input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 pr-10" value="sk-123...456">
|
| 377 |
+
<button class="absolute inset-y-0 right-0 pr-3 flex items-center text-gray-500 hover:text-gray-700">
|
| 378 |
+
<i class="far fa-eye"></i>
|
| 379 |
+
</button>
|
| 380 |
+
</div>
|
| 381 |
+
</div>
|
| 382 |
+
|
| 383 |
+
<div>
|
| 384 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Temperature</label>
|
| 385 |
+
<input type="range" min="0" max="1" step="0.1" value="0.7" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
|
| 386 |
+
<div class="flex justify-between text-xs text-gray-500">
|
| 387 |
+
<span>Precise</span>
|
| 388 |
+
<span>Balanced</span>
|
| 389 |
+
<span>Creative</span>
|
| 390 |
+
</div>
|
| 391 |
+
</div>
|
| 392 |
+
|
| 393 |
+
<div>
|
| 394 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">System Prompt</label>
|
| 395 |
+
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" rows="4">You are a helpful customer support assistant for our company. Be polite, professional, and try to resolve customer issues efficiently. If you don't know the answer, escalate to human support.</textarea>
|
| 396 |
+
</div>
|
| 397 |
+
</div>
|
| 398 |
+
</div>
|
| 399 |
+
</div>
|
| 400 |
+
|
| 401 |
+
<!-- Node Connections -->
|
| 402 |
+
<div class="space-y-6">
|
| 403 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 404 |
+
<h3 class="font-semibold text-lg mb-4 flex items-center">
|
| 405 |
+
<i class="fas fa-project-diagram mr-2 text-green-500"></i> Node Connections
|
| 406 |
+
</h3>
|
| 407 |
+
|
| 408 |
+
<div class="space-y-3">
|
| 409 |
+
<div class="connection-line">
|
| 410 |
+
<div class="bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
|
| 411 |
+
<div class="flex justify-between items-start">
|
| 412 |
+
<div>
|
| 413 |
+
<h4 class="font-medium">HR Assistant</h4>
|
| 414 |
+
<p class="text-xs text-gray-500">For HR policy questions</p>
|
| 415 |
+
</div>
|
| 416 |
+
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded-full">Active</span>
|
| 417 |
+
</div>
|
| 418 |
+
</div>
|
| 419 |
+
</div>
|
| 420 |
+
|
| 421 |
+
<div class="connection-line">
|
| 422 |
+
<div class="bg-white p-3 rounded-lg border border-gray-200 shadow-sm">
|
| 423 |
+
<div class="flex justify-between items-start">
|
| 424 |
+
<div>
|
| 425 |
+
<h4 class="font-medium">Tech Support</h4>
|
| 426 |
+
<p class="text-xs text-gray-500">Technical issues</p>
|
| 427 |
+
</div>
|
| 428 |
+
<span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded-full">Active</span>
|
| 429 |
+
</div>
|
| 430 |
+
</div>
|
| 431 |
+
</div>
|
| 432 |
+
|
| 433 |
+
<button class="w-full mt-2 px-3 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg flex items-center justify-center">
|
| 434 |
+
<i class="fas fa-plus mr-2"></i> Add Connection
|
| 435 |
+
</button>
|
| 436 |
+
</div>
|
| 437 |
+
</div>
|
| 438 |
+
|
| 439 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 440 |
+
<h3 class="font-semibold text-lg mb-4 flex items-center">
|
| 441 |
+
<i class="fas fa-chart-line mr-2 text-yellow-500"></i> Node Analytics
|
| 442 |
+
</h3>
|
| 443 |
+
|
| 444 |
+
<div class="space-y-4">
|
| 445 |
+
<div>
|
| 446 |
+
<div class="flex justify-between text-sm mb-1">
|
| 447 |
+
<span class="font-medium">Daily Interactions</span>
|
| 448 |
+
<span class="text-blue-600">1,245</span>
|
| 449 |
+
</div>
|
| 450 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
| 451 |
+
<div class="bg-blue-600 h-2 rounded-full" style="width: 75%"></div>
|
| 452 |
+
</div>
|
| 453 |
+
</div>
|
| 454 |
+
|
| 455 |
+
<div>
|
| 456 |
+
<div class="flex justify-between text-sm mb-1">
|
| 457 |
+
<span class="font-medium">Success Rate</span>
|
| 458 |
+
<span class="text-green-600">89%</span>
|
| 459 |
+
</div>
|
| 460 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
| 461 |
+
<div class="bg-green-600 h-2 rounded-full" style="width: 89%"></div>
|
| 462 |
+
</div>
|
| 463 |
+
</div>
|
| 464 |
+
|
| 465 |
+
<div>
|
| 466 |
+
<div class="flex justify-between text-sm mb-1">
|
| 467 |
+
<span class="font-medium">Escalation Rate</span>
|
| 468 |
+
<span class="text-red-600">11%</span>
|
| 469 |
+
</div>
|
| 470 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
| 471 |
+
<div class="bg-red-600 h-2 rounded-full" style="width: 11%"></div>
|
| 472 |
+
</div>
|
| 473 |
+
</div>
|
| 474 |
+
</div>
|
| 475 |
+
</div>
|
| 476 |
+
|
| 477 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 478 |
+
<h3 class="font-semibold text-lg mb-4 flex items-center">
|
| 479 |
+
<i class="fas fa-bolt mr-2 text-purple-500"></i> Quick Actions
|
| 480 |
+
</h3>
|
| 481 |
+
|
| 482 |
+
<div class="grid grid-cols-2 gap-2">
|
| 483 |
+
<button class="p-3 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 flex flex-col items-center">
|
| 484 |
+
<i class="fas fa-play text-green-500 mb-1"></i>
|
| 485 |
+
<span class="text-xs">Test Node</span>
|
| 486 |
+
</button>
|
| 487 |
+
<button class="p-3 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 flex flex-col items-center">
|
| 488 |
+
<i class="fas fa-sync-alt text-blue-500 mb-1"></i>
|
| 489 |
+
<span class="text-xs">Refresh Data</span>
|
| 490 |
+
</button>
|
| 491 |
+
<button class="p-3 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 flex flex-col items-center">
|
| 492 |
+
<i class="fas fa-history text-yellow-500 mb-1"></i>
|
| 493 |
+
<span class="text-xs">View Logs</span>
|
| 494 |
+
</button>
|
| 495 |
+
<button class="p-3 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 flex flex-col items-center">
|
| 496 |
+
<i class="fas fa-share-alt text-purple-500 mb-1"></i>
|
| 497 |
+
<span class="text-xs">Share</span>
|
| 498 |
+
</button>
|
| 499 |
+
</div>
|
| 500 |
+
</div>
|
| 501 |
+
</div>
|
| 502 |
+
</div>
|
| 503 |
+
</div>
|
| 504 |
+
</div>
|
| 505 |
+
|
| 506 |
+
<!-- Export Options Modal -->
|
| 507 |
+
<div id="exportOptionsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 508 |
+
<div class="bg-white rounded-xl shadow-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto">
|
| 509 |
+
<div class="p-6 border-b border-gray-200">
|
| 510 |
+
<h3 class="text-xl font-bold text-gray-800 flex items-center">
|
| 511 |
+
<i class="fas fa-download mr-2 text-green-500"></i> Export Options
|
| 512 |
+
</h3>
|
| 513 |
+
</div>
|
| 514 |
+
|
| 515 |
+
<div class="p-6 space-y-6">
|
| 516 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 517 |
+
<h4 class="font-semibold text-lg mb-3 flex items-center">
|
| 518 |
+
<i class="fas fa-code mr-2 text-blue-500"></i> Embed in Website
|
| 519 |
+
</h4>
|
| 520 |
+
<p class="text-sm text-gray-600 mb-3">Copy this code to embed the chatbot in your website:</p>
|
| 521 |
+
<div class="relative">
|
| 522 |
+
<pre id="embedCode" class="bg-gray-800 text-gray-100 p-3 rounded-lg text-sm overflow-x-auto">
|
| 523 |
+
<script src="https://yourdomain.com/chatbot.js?id=<span id="nodeIdForEmbed"></span>"></script>
|
| 524 |
+
<div id="chatbot-container"></div>
|
| 525 |
+
<style>
|
| 526 |
+
#chatbot-container {
|
| 527 |
+
position: fixed;
|
| 528 |
+
bottom: 20px;
|
| 529 |
+
right: 20px;
|
| 530 |
+
width: 350px;
|
| 531 |
+
height: 500px;
|
| 532 |
+
border-radius: 10px;
|
| 533 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
| 534 |
+
}
|
| 535 |
+
</style></pre>
|
| 536 |
+
<button onclick="copyToClipboard('embedCode')" class="absolute top-2 right-2 bg-gray-700 hover:bg-gray-600 text-white px-3 py-1 rounded text-sm">
|
| 537 |
+
<i class="fas fa-copy mr-1"></i> Copy
|
| 538 |
+
</button>
|
| 539 |
+
</div>
|
| 540 |
+
</div>
|
| 541 |
+
|
| 542 |
+
<div class="bg-gray-50 p-4 rounded-lg">
|
| 543 |
+
<h4 class="font-semibold text-lg mb-3 flex items-center">
|
| 544 |
+
<i class="fas fa-plug mr-2 text-purple-500"></i> API Integration
|
| 545 |
+
</h4>
|
| 546 |
+
<p class="text-sm text-gray-600 mb-3">Use these API endpoints to integrate with your application:</p>
|
| 547 |
+
<div class="space-y-4">
|
| 548 |
+
<div>
|
| 549 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Base URL</label>
|
| 550 |
+
<div class="relative">
|
| 551 |
+
<pre class="bg-gray-800 text-gray-100 p-3 rounded-lg text-sm overflow-x-auto">https://api.yourdomain.com/v1/nodes/<span id="nodeIdForApi"></span></pre>
|
| 552 |
+
<button onclick="copyToClipboard(this.previousElementSibling)" class="absolute top-2 right-2 bg-gray-700 hover:bg-gray-600 text-white px-3 py-1 rounded text-sm">
|
| 553 |
+
<i class="fas fa-copy mr-1"></i> Copy
|
| 554 |
+
</button>
|
| 555 |
+
</div>
|
| 556 |
+
</div>
|
| 557 |
+
|
| 558 |
+
<div>
|
| 559 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Example Request</label>
|
| 560 |
+
<div class="relative">
|
| 561 |
+
<pre class="bg-gray-800 text-gray-100 p-3 rounded-lg text-sm overflow-x-auto">
|
| 562 |
+
POST /messages
|
| 563 |
+
Content-Type: application/json
|
| 564 |
+
Authorization: Bearer YOUR_API_KEY
|
| 565 |
+
|
| 566 |
+
{
|
| 567 |
+
"message": "Hello, how can I help you?",
|
| 568 |
+
"context": {}
|
| 569 |
+
}</pre>
|
| 570 |
+
<button onclick="copyToClipboard(this.previousElementSibling)" class="absolute top-2 right-2 bg-gray-700 hover:bg-gray-600 text-white px-3 py-1 rounded text-sm">
|
| 571 |
+
<i class="fas fa-copy mr-1"></i> Copy
|
| 572 |
+
</button>
|
| 573 |
+
</div>
|
| 574 |
+
</div>
|
| 575 |
+
</div>
|
| 576 |
+
</div>
|
| 577 |
+
</div>
|
| 578 |
+
|
| 579 |
+
<div class="p-4 border-t border-gray-200 flex justify-end">
|
| 580 |
+
<button onclick="document.getElementById('exportOptionsModal').classList.add('hidden')" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50">
|
| 581 |
+
Close
|
| 582 |
+
</button>
|
| 583 |
+
</div>
|
| 584 |
+
</div>
|
| 585 |
+
</div>
|
| 586 |
+
|
| 587 |
+
<!-- Create Node Modal -->
|
| 588 |
+
<div id="createNodeModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 589 |
+
<div class="bg-white rounded-xl shadow-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto">
|
| 590 |
+
<div class="p-6 border-b border-gray-200">
|
| 591 |
+
<h3 class="text-xl font-bold text-gray-800 flex items-center">
|
| 592 |
+
<i class="fas fa-plus-circle mr-2 text-blue-500"></i> Create New Chatbot Node
|
| 593 |
+
</h3>
|
| 594 |
+
</div>
|
| 595 |
+
|
| 596 |
+
<div class="p-6 space-y-6">
|
| 597 |
+
<div>
|
| 598 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Node Name</label>
|
| 599 |
+
<input type="text" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder="e.g., Customer Support Bot">
|
| 600 |
+
</div>
|
| 601 |
+
|
| 602 |
+
<div>
|
| 603 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Description</label>
|
| 604 |
+
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" rows="2" placeholder="Brief description of this chatbot's purpose"></textarea>
|
| 605 |
+
</div>
|
| 606 |
+
|
| 607 |
+
<div>
|
| 608 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Data Source</label>
|
| 609 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-3 mt-2">
|
| 610 |
+
<div class="data-source-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all">
|
| 611 |
+
<div class="flex flex-col items-center text-center">
|
| 612 |
+
<i class="fas fa-database text-3xl text-blue-500 mb-2"></i>
|
| 613 |
+
<h4 class="font-medium">Database</h4>
|
| 614 |
+
<p class="text-xs text-gray-500 mt-1">Connect to SQL or NoSQL databases</p>
|
| 615 |
+
</div>
|
| 616 |
+
</div>
|
| 617 |
+
<div class="data-source-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all">
|
| 618 |
+
<div class="flex flex-col items-center text-center">
|
| 619 |
+
<i class="fas fa-file-alt text-3xl text-blue-500 mb-2"></i>
|
| 620 |
+
<h4 class="font-medium">Documents</h4>
|
| 621 |
+
<p class="text-xs text-gray-500 mt-1">Upload PDFs, Word, or text files</p>
|
| 622 |
+
</div>
|
| 623 |
+
</div>
|
| 624 |
+
<div class="data-source-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all">
|
| 625 |
+
<div class="flex flex-col items-center text-center">
|
| 626 |
+
<i class="fas fa-plug text-3xl text-blue-500 mb-2"></i>
|
| 627 |
+
<h4 class="font-medium">API</h4>
|
| 628 |
+
<p class="text-xs text-gray-500 mt-1">Connect to external APIs</p>
|
| 629 |
+
</div>
|
| 630 |
+
</div>
|
| 631 |
+
</div>
|
| 632 |
+
</div>
|
| 633 |
+
|
| 634 |
+
<div>
|
| 635 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Language Model</label>
|
| 636 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-3 mt-2">
|
| 637 |
+
<div class="llm-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-purple-500 hover:bg-purple-50 transition-all">
|
| 638 |
+
<div class="flex items-center">
|
| 639 |
+
<i class="fas fa-robot text-2xl text-purple-500 mr-3"></i>
|
| 640 |
+
<div>
|
| 641 |
+
<h4 class="font-medium">OpenAI</h4>
|
| 642 |
+
<p class="text-xs text-gray-500">GPT-4, GPT-3.5 Turbo</p>
|
| 643 |
+
</div>
|
| 644 |
+
</div>
|
| 645 |
+
</div>
|
| 646 |
+
<div class="llm-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-purple-500 hover:bg-purple-50 transition-all">
|
| 647 |
+
<div class="flex items-center">
|
| 648 |
+
<i class="fab fa-google text-2xl text-purple-500 mr-3"></i>
|
| 649 |
+
<div>
|
| 650 |
+
<h4 class="font-medium">Google Gemini</h4>
|
| 651 |
+
<p class="text-xs text-gray-500">Gemini Pro, Gemini Ultra</p>
|
| 652 |
+
</div>
|
| 653 |
+
</div>
|
| 654 |
+
</div>
|
| 655 |
+
<div class="llm-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-purple-500 hover:bg-purple-50 transition-all">
|
| 656 |
+
<div class="flex items-center">
|
| 657 |
+
<i class="fas fa-server text-2xl text-purple-500 mr-3"></i>
|
| 658 |
+
<div>
|
| 659 |
+
<h4 class="font-medium">Ollama</h4>
|
| 660 |
+
<p class="text-xs text-gray-500">Run models locally</p>
|
| 661 |
+
</div>
|
| 662 |
+
</div>
|
| 663 |
+
</div>
|
| 664 |
+
<div class="llm-option border border-gray-200 rounded-lg p-4 cursor-pointer hover:border-purple-500 hover:bg-purple-50 transition-all">
|
| 665 |
+
<div class="flex items-center">
|
| 666 |
+
<i class="fas fa-cube text-2xl text-purple-500 mr-3"></i>
|
| 667 |
+
<div>
|
| 668 |
+
<h4 class="font-medium">Meta Llama</h4>
|
| 669 |
+
<p class="text-xs text-gray-500">Llama 2, Llama 3</p>
|
| 670 |
+
</div>
|
| 671 |
+
</div>
|
| 672 |
+
</div>
|
| 673 |
+
</div>
|
| 674 |
+
</div>
|
| 675 |
+
</div>
|
| 676 |
+
|
| 677 |
+
<div class="p-4 border-t border-gray-200 flex justify-end space-x-3">
|
| 678 |
+
<button id="cancelCreateNode" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50">
|
| 679 |
+
Cancel
|
| 680 |
+
</button>
|
| 681 |
+
<button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 flex items-center">
|
| 682 |
+
<i class="fas fa-check mr-2"></i> Create Node
|
| 683 |
+
</button>
|
| 684 |
+
</div>
|
| 685 |
+
</div>
|
| 686 |
+
</div>
|
| 687 |
+
</main>
|
| 688 |
+
</div>
|
| 689 |
+
</div>
|
| 690 |
+
|
| 691 |
+
<script>
|
| 692 |
+
// Toggle sidebar on mobile
|
| 693 |
+
document.getElementById('sidebarToggle').addEventListener('click', function() {
|
| 694 |
+
document.querySelector('.sidebar').classList.toggle('active');
|
| 695 |
+
});
|
| 696 |
+
|
| 697 |
+
// Show create node modal
|
| 698 |
+
document.getElementById('createNodeBtn').addEventListener('click', function() {
|
| 699 |
+
document.getElementById('createNodeModal').classList.remove('hidden');
|
| 700 |
+
});
|
| 701 |
+
|
| 702 |
+
// Hide create node modal
|
| 703 |
+
document.getElementById('cancelCreateNode').addEventListener('click', function() {
|
| 704 |
+
document.getElementById('createNodeModal').classList.add('hidden');
|
| 705 |
+
});
|
| 706 |
+
|
| 707 |
+
// Data source selection
|
| 708 |
+
const dataSourceOptions = document.querySelectorAll('.data-source-option');
|
| 709 |
+
dataSourceOptions.forEach(option => {
|
| 710 |
+
option.addEventListener('click', function() {
|
| 711 |
+
dataSourceOptions.forEach(opt => opt.classList.remove('border-blue-500', 'bg-blue-50'));
|
| 712 |
+
this.classList.add('border-blue-500', 'bg-blue-50');
|
| 713 |
+
});
|
| 714 |
+
});
|
| 715 |
+
|
| 716 |
+
// LLM selection
|
| 717 |
+
const llmOptions = document.querySelectorAll('.llm-option');
|
| 718 |
+
llmOptions.forEach(option => {
|
| 719 |
+
option.addEventListener('click', function() {
|
| 720 |
+
llmOptions.forEach(opt => opt.classList.remove('border-purple-500', 'bg-purple-50'));
|
| 721 |
+
this.classList.add('border-purple-500', 'bg-purple-50');
|
| 722 |
+
});
|
| 723 |
+
});
|
| 724 |
+
|
| 725 |
+
// Toggle between data source configs
|
| 726 |
+
document.querySelectorAll('input[name="sourceType"]').forEach(radio => {
|
| 727 |
+
radio.addEventListener('change', function() {
|
| 728 |
+
if (this.value === 'Database') {
|
| 729 |
+
document.getElementById('databaseConfig').classList.remove('hidden');
|
| 730 |
+
document.getElementById('documentConfig').classList.add('hidden');
|
| 731 |
+
} else if (this.value === 'Document Files') {
|
| 732 |
+
document.getElementById('databaseConfig').classList.add('hidden');
|
| 733 |
+
document.getElementById('documentConfig').classList.remove('hidden');
|
| 734 |
+
}
|
| 735 |
+
});
|
| 736 |
+
});
|
| 737 |
+
|
| 738 |
+
// Show node detail view
|
| 739 |
+
function showNodeDetail(nodeId) {
|
| 740 |
+
document.getElementById('dashboardView').classList.add('hidden');
|
| 741 |
+
document.getElementById('nodeDetailView').classList.remove('hidden');
|
| 742 |
+
|
| 743 |
+
// Update node details based on the selected node
|
| 744 |
+
// In a real app, you would fetch this data from your backend
|
| 745 |
+
const nodeDetails = {
|
| 746 |
+
'customer-support': {
|
| 747 |
+
title: 'Customer Support',
|
| 748 |
+
id: 'customer-support',
|
| 749 |
+
status: 'Active'
|
| 750 |
+
},
|
| 751 |
+
'hr-assistant': {
|
| 752 |
+
title: 'HR Assistant',
|
| 753 |
+
id: 'hr-assistant',
|
| 754 |
+
status: 'Draft'
|
| 755 |
+
},
|
| 756 |
+
'tech-support': {
|
| 757 |
+
title: 'Tech Support',
|
| 758 |
+
id: 'tech-support',
|
| 759 |
+
status: 'Active'
|
| 760 |
+
}
|
| 761 |
+
};
|
| 762 |
+
|
| 763 |
+
const node = nodeDetails[nodeId];
|
| 764 |
+
document.getElementById('nodeDetailTitle').textContent = node.title;
|
| 765 |
+
document.getElementById('nodeDetailId').textContent = node.id;
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
// Show dashboard view
|
| 769 |
+
function showDashboard() {
|
| 770 |
+
document.getElementById('dashboardView').classList.remove('hidden');
|
| 771 |
+
document.getElementById('nodeDetailView').classList.add('hidden');
|
| 772 |
+
}
|
| 773 |
+
|
| 774 |
+
// Show export options modal
|
| 775 |
+
function showExportOptions() {
|
| 776 |
+
const modal = document.getElementById('exportOptionsModal');
|
| 777 |
+
const nodeId = document.getElementById('nodeDetailId').textContent;
|
| 778 |
+
|
| 779 |
+
// Update node IDs in the export options
|
| 780 |
+
document.querySelectorAll('#nodeIdForEmbed, #nodeIdForApi').forEach(el => {
|
| 781 |
+
el.textContent = nodeId;
|
| 782 |
+
});
|
| 783 |
+
|
| 784 |
+
modal.classList.remove('hidden');
|
| 785 |
+
}
|
| 786 |
+
|
| 787 |
+
// Copy text to clipboard
|
| 788 |
+
function copyToClipboard(element) {
|
| 789 |
+
const text = element.textContent || element.innerText;
|
| 790 |
+
navigator.clipboard.writeText(text).then(() => {
|
| 791 |
+
const originalText = element.nextElementSibling.innerHTML;
|
| 792 |
+
element.nextElementSibling.innerHTML = '<i class="fas fa-check mr-1"></i> Copied!';
|
| 793 |
+
setTimeout(() => {
|
| 794 |
+
element.nextElementSibling.innerHTML = originalText;
|
| 795 |
+
}, 2000);
|
| 796 |
+
});
|
| 797 |
+
}
|
| 798 |
+
|
| 799 |
+
// Close modal when clicking outside
|
| 800 |
+
document.getElementById('createNodeModal').addEventListener('click', function(e) {
|
| 801 |
+
if (e.target === this) {
|
| 802 |
+
this.classList.add('hidden');
|
| 803 |
+
}
|
| 804 |
+
});
|
| 805 |
+
</script>
|
| 806 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=nam1608/manager-node" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 807 |
+
</html>
|