Spaces:
Running
Running
File size: 9,371 Bytes
d0dd276 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
<template>
<div class="user-guide" v-if="showGuide">
<div class="guide-overlay" @click="closeGuide"></div>
<div class="guide-content">
<div class="guide-header">
<h3>🎯 多后端实例使用指南</h3>
<button @click="closeGuide" class="close-btn">×</button>
</div>
<div class="guide-body">
<div class="guide-section">
<h4>📚 什么是多后端实例?</h4>
<p>多后端实例功能允许您同时管理和切换多个 Hajimi 服务器,比如:</p>
<ul>
<li>本地开发环境</li>
<li>生产服务器</li>
<li>测试环境</li>
<li>不同地区的部署</li>
</ul>
</div>
<div class="guide-section">
<h4>🚀 快速开始</h4>
<div class="guide-steps">
<div class="step">
<div class="step-number">1</div>
<div class="step-content">
<h5>添加后端实例</h5>
<p>点击"添加实例"按钮,输入服务器地址和访问密码</p>
</div>
</div>
<div class="step">
<div class="step-number">2</div>
<div class="step-content">
<h5>测试连接</h5>
<p>添加后自动测试连接,确保服务器可正常访问</p>
</div>
</div>
<div class="step">
<div class="step-number">3</div>
<div class="step-content">
<h5>切换实例</h5>
<p>在顶部下拉菜单中选择要使用的后端实例</p>
</div>
</div>
</div>
</div>
<div class="guide-section">
<h4>💡 使用技巧</h4>
<div class="tips">
<div class="tip">
<span class="tip-icon">🔧</span>
<div class="tip-content">
<strong>管理实例:</strong>在后端管理页面可以编辑、删除、测试连接
</div>
</div>
<div class="tip">
<span class="tip-icon">💾</span>
<div class="tip-content">
<strong>配置保存:</strong>所有配置自动保存到本地存储,刷新页面不会丢失
</div>
</div>
<div class="tip">
<span class="tip-icon">📊</span>
<div class="tip-content">
<strong>实时状态:</strong>顶部显示当前连接的后端实例和连接状态
</div>
</div>
<div class="tip">
<span class="tip-icon">📁</span>
<div class="tip-content">
<strong>导入导出:</strong>支持配置的导入导出,方便在不同设备间同步
</div>
</div>
</div>
</div>
<div class="guide-section">
<h4>⚠️ 注意事项</h4>
<div class="warnings">
<div class="warning">
<span class="warning-icon">🔒</span>
<span>访问密码将保存在本地浏览器中,请确保设备安全</span>
</div>
<div class="warning">
<span class="warning-icon">🌐</span>
<span>跨域访问可能需要后端服务器配置 CORS 支持</span>
</div>
<div class="warning">
<span class="warning-icon">📡</span>
<span>建议定期测试连接,确保后端服务正常运行</span>
</div>
</div>
</div>
</div>
<div class="guide-footer">
<label class="dont-show-again">
<input type="checkbox" v-model="dontShowAgain" />
<span>不再显示此指南</span>
</label>
<button @click="closeGuide" class="btn btn-primary">
开始使用
</button>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
const emit = defineEmits(['close'])
const showGuide = ref(false)
const dontShowAgain = ref(false)
// 检查是否需要显示指南
onMounted(() => {
const hasShownGuide = localStorage.getItem('hajimi_guide_shown')
if (!hasShownGuide) {
showGuide.value = true
}
})
// 关闭指南
function closeGuide() {
if (dontShowAgain.value) {
localStorage.setItem('hajimi_guide_shown', 'true')
}
showGuide.value = false
emit('close')
}
// 显示指南(外部调用)
function show() {
showGuide.value = true
}
// 重置指南状态
function reset() {
localStorage.removeItem('hajimi_guide_shown')
dontShowAgain.value = false
}
defineExpose({
show,
reset
})
</script>
<style scoped>
.user-guide {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
box-sizing: border-box;
}
.guide-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(5px);
}
.guide-content {
position: relative;
background: white;
border-radius: 16px;
width: 100%;
max-width: 700px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: scale(0.9) translateY(20px);
}
to {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.guide-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24px 24px 16px 24px;
border-bottom: 1px solid #e9ecef;
}
.guide-header h3 {
margin: 0;
color: #333;
font-size: 20px;
font-weight: 600;
}
.close-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #666;
padding: 4px;
border-radius: 6px;
transition: all 0.2s ease;
}
.close-btn:hover {
background: #f8f9fa;
color: #333;
}
.guide-body {
padding: 24px;
}
.guide-section {
margin-bottom: 32px;
}
.guide-section:last-child {
margin-bottom: 0;
}
.guide-section h4 {
margin: 0 0 16px 0;
color: #333;
font-size: 16px;
font-weight: 600;
}
.guide-section p {
margin: 0 0 12px 0;
color: #666;
line-height: 1.6;
}
.guide-section ul {
margin: 0 0 12px 0;
padding-left: 20px;
color: #666;
}
.guide-section li {
margin-bottom: 8px;
}
.guide-steps {
display: flex;
flex-direction: column;
gap: 20px;
}
.step {
display: flex;
gap: 16px;
align-items: flex-start;
}
.step-number {
width: 32px;
height: 32px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 14px;
flex-shrink: 0;
}
.step-content h5 {
margin: 0 0 8px 0;
color: #333;
font-size: 14px;
font-weight: 600;
}
.step-content p {
margin: 0;
color: #666;
font-size: 14px;
}
.tips {
display: flex;
flex-direction: column;
gap: 16px;
}
.tip {
display: flex;
gap: 12px;
align-items: flex-start;
padding: 16px;
background: #f8f9fa;
border-radius: 8px;
border-left: 4px solid #28a745;
}
.tip-icon {
font-size: 20px;
flex-shrink: 0;
}
.tip-content {
color: #666;
font-size: 14px;
line-height: 1.5;
}
.tip-content strong {
color: #333;
}
.warnings {
display: flex;
flex-direction: column;
gap: 12px;
}
.warning {
display: flex;
gap: 12px;
align-items: center;
padding: 12px 16px;
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 6px;
color: #856404;
font-size: 14px;
}
.warning-icon {
font-size: 16px;
flex-shrink: 0;
}
.guide-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 24px 24px 24px;
border-top: 1px solid #e9ecef;
}
.dont-show-again {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
color: #666;
font-size: 14px;
user-select: none;
}
.dont-show-again input[type="checkbox"] {
margin: 0;
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* 移动端优化 */
@media (max-width: 768px) {
.user-guide {
padding: 10px;
}
.guide-content {
max-width: 100%;
max-height: 95vh;
}
.guide-header {
padding: 20px 20px 12px 20px;
}
.guide-header h3 {
font-size: 18px;
}
.guide-body {
padding: 20px;
}
.guide-section {
margin-bottom: 24px;
}
.guide-steps {
gap: 16px;
}
.step {
gap: 12px;
}
.step-number {
width: 28px;
height: 28px;
font-size: 12px;
}
.tips {
gap: 12px;
}
.tip {
padding: 12px;
}
.guide-footer {
padding: 12px 20px 20px 20px;
flex-direction: column;
gap: 16px;
align-items: stretch;
}
.btn {
width: 100%;
justify-content: center;
}
}
</style> |