feat: Refactor service management scripts to use a unified dev script

- Added package.json to manage development scripts.
- Updated restart-services.ps1 to call the new dev script for starting services.
- Refactored start-admin.ps1, start-backend.ps1, start-frontend.ps1, and start-mcp.ps1 to utilize the dev script for starting respective services.
- Enhanced stop-services.ps1 to improve process termination logic by matching command patterns.
This commit is contained in:
2026-03-29 21:36:13 +08:00
parent 84f82c2a7e
commit 92a85eef20
137 changed files with 14181 additions and 2691 deletions

View File

@@ -1,48 +1,48 @@
- id: 1
pid: 1
author: "Alice"
email: "alice@example.com"
content: "Great introduction! Looking forward to more content."
author: "林川"
email: "linchuan@example.com"
content: "这篇做长文测试很合适,段落密度和古文节奏都不错。"
approved: true
- id: 2
pid: 1
author: "Bob"
email: "bob@example.com"
content: "The terminal UI looks amazing. Love the design!"
author: "阿青"
email: "aqing@example.com"
content: "建议后面再加几篇山水游记,方便测试问答检索是否能区分不同山名。"
approved: true
- id: 3
pid: 2
author: "Charlie"
email: "charlie@example.com"
content: "Thanks for the Rust tips! The ownership concept finally clicked for me."
author: "周宁"
email: "zhouling@example.com"
content: "这一段关于南岩和琼台的描写很好,适合测试段落评论锚点。"
approved: true
- id: 4
pid: 3
author: "Diana"
email: "diana@example.com"
content: "Astro is indeed fast. I've been using it for my personal blog too."
author: "顾远"
email: "guyuan@example.com"
content: "悬空寺这一段信息量很大,拿来测试 AI 摘要应该很有代表性。"
approved: true
- id: 5
pid: 4
author: "Eve"
email: "eve@example.com"
content: "The color palette you shared is perfect. Using it for my terminal theme now!"
author: "清嘉"
email: "qingjia@example.com"
content: "黄山记的序文很适合测试首屏摘要生成。"
approved: true
- id: 6
pid: 5
author: "Frank"
email: "frank@example.com"
content: "Loco.rs looks promising. Might use it for my next project."
author: "石霁"
email: "shiji@example.com"
content: "想看看评测页和文章页共存时,搜索能不能把这类古文结果排在前面。"
approved: false
- id: 7
pid: 2
author: "Grace"
email: "grace@example.com"
content: "Would love to see more advanced Rust patterns in future posts."
pid: 3
author: "江禾"
email: "jianghe@example.com"
content: "如果后续要做段落评论,这篇恒山记很适合,因为章节分段比较清晰。"
approved: true

View File

@@ -1,38 +1,38 @@
- id: 1
site_name: "Tech Blog Daily"
site_url: "https://techblog.example.com"
avatar_url: "https://techblog.example.com/avatar.png"
description: "Daily tech news and tutorials"
category: "tech"
site_name: "山中札记"
site_url: "https://mountain-notes.example.com"
avatar_url: "https://mountain-notes.example.com/avatar.png"
description: "记录古籍、游记与自然地理的中文内容站。"
category: "文化"
status: "approved"
- id: 2
site_name: "Rustacean Station"
site_url: "https://rustacean.example.com"
avatar_url: "https://rustacean.example.com/logo.png"
description: "All things Rust programming"
category: "tech"
site_name: "旧书与远方"
site_url: "https://oldbooks.example.com"
avatar_url: "https://oldbooks.example.com/logo.png"
description: "分享古典文学、读书笔记和旅行随笔。"
category: "阅读"
status: "approved"
- id: 3
site_name: "Design Patterns"
site_url: "https://designpatterns.example.com"
avatar_url: "https://designpatterns.example.com/icon.png"
description: "UI/UX design inspiration"
category: "design"
site_name: "山海数据局"
site_url: "https://shanhai-data.example.com"
avatar_url: "https://shanhai-data.example.com/icon.png"
description: "偏技术向的中文站点,关注搜索、知识库与可视化。"
category: "技术"
status: "approved"
- id: 4
site_name: "Code Snippets"
site_url: "https://codesnippets.example.com"
description: "Useful code snippets for developers"
category: "dev"
site_name: "风物手册"
site_url: "https://fengwu.example.com"
description: "整理地方风物、古迹与旅行地图。"
category: "旅行"
status: "pending"
- id: 5
site_name: "Web Dev Weekly"
site_url: "https://webdevweekly.example.com"
avatar_url: "https://webdevweekly.example.com/favicon.png"
description: "Weekly web development newsletter"
category: "dev"
site_name: "慢读周刊"
site_url: "https://slowread.example.com"
avatar_url: "https://slowread.example.com/favicon.png"
description: "每周推荐中文长文、读书摘录与站点发现。"
category: "内容"
status: "pending"

View File

@@ -1,191 +1,109 @@
- id: 1
pid: 1
title: "Welcome to Termi Blog"
title: "徐霞客游记·游太和山日记(上)"
slug: "welcome-to-termi"
content: |
# Welcome to Termi Blog
# 徐霞客游记·游太和山日记(上)
This is the first post on our new blog built with Astro and Loco.rs backend.
登仙猿岭。十馀里,有枯溪小桥,为郧县境,乃河南、湖广界。东五里,有池一泓,曰青泉,上源不见所自来,而下流淙淙,地又属淅川。
## Features
自此连逾山岭,桃李缤纷,山花夹道,幽艳异常。山坞之中,居庐相望,沿流稻畦,高下鳞次,不似山、陕间矣。
- 🚀 Fast performance with Astro
- 🎨 Terminal-style UI design
- 💬 Comments system
- 🔗 Friend links
- 🏷️ Tags and categories
## Code Example
```rust
fn main() {
println!("Hello, Termi!");
}
```
Stay tuned for more posts!
excerpt: "Welcome to our new blog built with Astro and Loco.rs backend."
category: "general"
骑而南趋,石道平敞。三十里,越一石梁,有溪自西东注,即太和下流入汉者。越桥为迎恩宫,西向。前有碑大书“第一山”三字,乃米襄阳笔。
excerpt: "《徐霞客游记》太和山上篇,适合作为中文长文测试样本。"
category: "古籍游记"
published: true
pinned: true
tags:
- welcome
- astro
- loco-rs
- 徐霞客
- 游记
- 太和山
- 长文测试
- id: 2
pid: 2
title: "Rust Programming Tips"
slug: "rust-programming-tips"
title: "徐霞客游记·游太和山日记(下)"
slug: "building-blog-with-astro"
content: |
# Rust Programming Tips
# 徐霞客游记·游太和山日记(下)
Here are some essential tips for Rust developers:
更衣上金顶。瞻叩毕,天宇澄朗,下瞰诸峰,近者鹄峙,远者罗列,诚天真奥区也。
## 1. Ownership and Borrowing
遂从三天门之右小径下峡中。此径无级无索,乱峰离立,路穿其间,迥觉幽胜。三里馀,抵蜡烛峰右,泉涓涓溢出路旁,下为蜡烛涧。
Understanding ownership is crucial in Rust. Every value has an owner, and there can only be one owner at a time.
## 2. Pattern Matching
Use `match` expressions for exhaustive pattern matching:
```rust
match result {
Ok(value) => println!("Success: {}", value),
Err(e) => println!("Error: {}", e),
}
```
## 3. Error Handling
Use `Result` and `Option` types effectively with the `?` operator.
Happy coding!
excerpt: "Essential tips for Rust developers including ownership, pattern matching, and error handling."
category: "tech"
从宫左趋雷公洞。洞在悬崖间。乃从北天门下,一径阴森,滴水、仙侣二岩,俱在路左,飞崖上突,泉滴沥于中。
excerpt: "《徐霞客游记》太和山下篇,包含琼台、南岩与五龙宫等段落。"
category: "古籍游记"
published: true
pinned: false
tags:
- rust
- programming
- tips
- 徐霞客
- 游记
- 太和山
- 长文测试
- id: 3
pid: 3
title: "Building a Blog with Astro"
slug: "building-blog-with-astro"
title: "徐霞客游记·游恒山日记"
slug: "rust-programming-tips"
content: |
# Building a Blog with Astro
# 徐霞客游记·游恒山日记
Astro is a modern static site generator that delivers lightning-fast performance.
出南山。大溪从山中俱来者,别而西去。余北驰平陆中,望外界之山,高不及台山十之四,其长缭绕如垣。
## Why Astro?
余溯西涧入,又一涧自北来,遂从其西登岭,道甚峻。北向直上者六七里,西转,又北跻而上者五六里,登峰两重,造其巅,是名箭筸岭。
- **Zero JavaScript by default**: Ships less JavaScript to the client
- **Island Architecture**: Hydrate only interactive components
- **Framework Agnostic**: Use React, Vue, Svelte, or vanilla JS
- **Great DX**: Excellent developer experience with hot module replacement
## Getting Started
```bash
npm create astro@latest
cd my-astro-project
npm install
npm run dev
```
## Conclusion
Astro is perfect for content-focused websites like blogs.
excerpt: "Learn why Astro is the perfect choice for building fast, content-focused blogs."
category: "tech"
三转,峡愈隘,崖愈高。西崖之半,层楼高悬,曲榭斜倚,望之如蜃吐重台者,悬空寺也。
excerpt: "游恒山、悬空寺与北岳登顶的古文纪行,适合做中文长文测试。"
category: "古籍游记"
published: true
pinned: false
tags:
- astro
- web-dev
- static-site
- 徐霞客
- 恒山
- 悬空寺
- 长文测试
- id: 4
pid: 4
title: "Terminal UI Design Principles"
title: "游黄山记(上)"
slug: "terminal-ui-design"
content: |
# Terminal UI Design Principles
# 游黄山记(上)
Terminal-style interfaces are making a comeback in modern web design.
辛巳春,余与程孟阳订黄山之游,约以梅花时相寻于武林之西溪。徐维翰书来劝驾,读之两腋欲举,遂挟吴去尘以行。
## Key Elements
黄山耸秀峻极,作镇一方。江南诸山,天台、天目为最,以地形准之,黄山之趾与二山齐。
1. **Monospace Fonts**: Use fonts like Fira Code, JetBrains Mono
2. **Dark Themes**: Black or dark backgrounds with vibrant text colors
3. **Command Prompts**: Use `$` or `>` as visual indicators
4. **ASCII Art**: Decorative elements using text characters
5. **Blinking Cursor**: The iconic terminal cursor
## Color Palette
- Background: `#0d1117`
- Text: `#c9d1d9`
- Accent: `#58a6ff`
- Success: `#3fb950`
- Warning: `#d29922`
- Error: `#f85149`
## Implementation
Use CSS to create the terminal aesthetic while maintaining accessibility.
excerpt: "Learn the key principles of designing beautiful terminal-style user interfaces."
category: "design"
自山口至汤口,山之麓也,登山之径于是始。汤泉之流,自紫石峰六百仞县布,其下有香泉溪。
excerpt: "钱谦益《游黄山记》上篇,包含序、记之一与记之二。"
category: "古籍游记"
published: true
pinned: false
tags:
- design
- terminal
- ui
- 钱谦益
- 黄山
- 游记
- 长文测试
- id: 5
pid: 5
title: "Loco.rs Backend Framework"
title: "游黄山记(中)"
slug: "loco-rs-framework"
content: |
# Introduction to Loco.rs
# 游黄山记(中)
Loco.rs is a web and API framework for Rust inspired by Rails.
由祥符寺度石桥而北,逾慈光寺,行数里,径朱砂庵而上。过此取道钵盂、老人两峰之间,峰趾相并,两崖合遝,弥望削成。
## Features
憩桃源庵,指天都为诸峰之中峰,山形络绎,未有以殊异也。云生峰腰,层叠如裼衣焉。
- **MVC Architecture**: Model-View-Controller pattern
- **SeaORM Integration**: Powerful ORM for database operations
- **Background Jobs**: Built-in job processing
- **Authentication**: Ready-to-use auth system
- **CLI Generator**: Scaffold resources quickly
## Quick Start
```bash
cargo install loco
loco new myapp
cd myapp
cargo loco start
```
## Why Loco.rs?
- Opinionated but flexible
- Production-ready defaults
- Excellent documentation
- Active community
Perfect for building APIs and web applications in Rust.
excerpt: "An introduction to Loco.rs, the Rails-inspired web framework for Rust."
category: "tech"
清晓,出文殊院,神鸦背行而先。避莲华沟险,从支径右折,险益甚。上平天矼,转始信峰,经散花坞,看扰龙松。
excerpt: "钱谦益《游黄山记》中篇,适合测试中文长文、检索与段落锚点。"
category: "古籍游记"
published: true
pinned: false
tags:
- rust
- loco-rs
- backend
- api
- 钱谦益
- 黄山
- 游记
- 长文测试

View File

@@ -1,59 +1,59 @@
- id: 1
title: "塞尔达传说:王国之泪"
review_type: "game"
rating: 5
review_date: "2024-03-20"
status: "completed"
description: "开放世界的巅峰之作,究极手能力带来无限创意空间"
tags: ["Switch", "开放世界", "冒险"]
cover: "🎮"
- id: 2
title: "进击的巨人"
review_type: "anime"
rating: 5
review_date: "2023-11-10"
status: "completed"
description: "史诗级完结,剧情反转令人震撼"
tags: ["热血", "悬疑", "神作"]
cover: "🎭"
- id: 3
title: "赛博朋克 2077"
review_type: "game"
rating: 4
review_date: "2024-01-15"
status: "completed"
description: "夜之城的故事,虽然首发有问题但后续更新很棒"
tags: ["PC", "RPG", "科幻"]
cover: "🎮"
- id: 4
title: "三体"
review_type: "book"
rating: 5
review_date: "2023-08-05"
status: "completed"
description: "硬科幻巅峰,宇宙社会学的黑暗森林法则"
tags: ["科幻", "经典", "雨果奖"]
cover: "📚"
- id: 5
title: "星际穿越"
title: "《漫长的季节》"
review_type: "movie"
rating: 5
review_date: "2024-02-14"
status: "completed"
description: "诺兰神作,五维空间和黑洞的视觉奇观"
tags: ["科幻", "IMAX", "诺兰"]
cover: "🎬"
review_date: "2024-03-20"
status: "published"
description: "极有质感的中文悬疑剧,人物命运与时代氛围都很扎实。"
tags: ["国产剧", "悬疑", "年度推荐"]
cover: "/review-covers/the-long-season.svg"
- id: 6
title: "博德之门3"
- id: 2
title: "《十三邀》"
review_type: "movie"
rating: 4
review_date: "2024-01-10"
status: "published"
description: "更像一组人物观察样本,适合慢慢看,不适合倍速。"
tags: ["访谈", "人文", "纪实"]
cover: "/review-covers/thirteen-invites.svg"
- id: 3
title: "《黑神话:悟空》"
review_type: "game"
rating: 5
review_date: "2024-04-01"
status: "in-progress"
description: "CRPG的文艺复兴骰子决定命运"
tags: ["PC", "CRPG", "多人"]
cover: "🎮"
review_date: "2024-08-25"
status: "published"
description: "美术和演出都很强,战斗手感也足够扎实,是非常好的中文游戏样本。"
tags: ["国产游戏", "动作", "神话"]
cover: "/review-covers/black-myth-wukong.svg"
- id: 4
title: "《置身事内》"
review_type: "book"
rating: 5
review_date: "2024-02-18"
status: "published"
description: "把很多宏观经济问题讲得非常清楚,适合做深阅读测试。"
tags: ["经济", "非虚构", "中国"]
cover: "/review-covers/placed-within.svg"
- id: 5
title: "《宇宙探索编辑部》"
review_type: "movie"
rating: 4
review_date: "2024-04-12"
status: "published"
description: "荒诞和真诚并存,气质很特别,很适合作为中文评论内容。"
tags: ["电影", "科幻", "荒诞"]
cover: "/review-covers/journey-to-the-west-editorial.svg"
- id: 6
title: "《疲惫生活中的英雄梦想》"
review_type: "music"
rating: 4
review_date: "2024-05-01"
status: "draft"
description: "适合深夜循环,文字和旋律都带一点诚恳的钝感。"
tags: ["音乐", "中文", "独立"]
cover: "/review-covers/hero-dreams-in-tired-life.svg"

View File

@@ -0,0 +1,55 @@
- id: 1
site_name: "InitCool"
site_short_name: "Termi"
site_url: "https://init.cool"
site_title: "InitCool · 中文长文与 AI 搜索实验站"
site_description: "一个偏终端审美的中文内容站用来测试文章检索、AI 问答、段落评论与后台工作流。"
hero_title: "欢迎来到我的中文内容实验站"
hero_subtitle: "这里有长文章、评测、友链,以及逐步打磨中的 AI 搜索体验"
owner_name: "InitCool"
owner_title: "Rust / Go / Python Developer · Builder @ init.cool"
owner_bio: "InitCoolGitHub 用户名 limitcool。坚持不要重复造轮子当前在维护 starter平时主要写 Rust、Go、Python 相关项目,也在持续学习 AI 与 Web3。"
owner_avatar_url: "https://github.com/limitcool.png"
social_github: "https://github.com/limitcool"
social_twitter: ""
social_email: "mailto:initcoool@gmail.com"
location: "中国香港"
tech_stack:
- "Rust"
- "Go"
- "Python"
- "Svelte"
- "Astro"
- "Loco.rs"
music_playlist:
- title: "山中来信"
artist: "InitCool Radio"
album: "站点默认歌单"
url: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
cover_image_url: "https://images.unsplash.com/photo-1510915228340-29c85a43dcfe?auto=format&fit=crop&w=600&q=80"
accent_color: "#2f6b5f"
description: "适合文章阅读时循环播放的轻氛围曲。"
- title: "风吹松声"
artist: "InitCool Radio"
album: "站点默认歌单"
url: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3"
cover_image_url: "https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=600&q=80"
accent_color: "#8a5b35"
description: "偏木质感的器乐氛围,适合深夜浏览。"
- title: "夜航小记"
artist: "InitCool Radio"
album: "站点默认歌单"
url: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-3.mp3"
cover_image_url: "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?auto=format&fit=crop&w=600&q=80"
accent_color: "#375a7f"
description: "节奏更明显一点,适合切换阅读状态。"
ai_enabled: false
paragraph_comments_enabled: true
ai_provider: "newapi"
ai_api_base: "https://91code.jiangnight.com/v1"
ai_api_key: "sk-5a5e27db9fb8f8ee7e1d8e3c6a44638c2e50cdb0a0cf9d926fefb5418ff62571"
ai_chat_model: "gpt-5.4"
ai_embedding_model: "fastembed / local all-MiniLM-L6-v2"
ai_system_prompt: "你是这个博客的站内 AI 助手。请优先依据检索到的站内内容回答问题,回答保持准确、简洁、清晰;如果上下文不足,请明确说明,不要编造。"
ai_top_k: 4
ai_chunk_size: 1200

View File

@@ -27,6 +27,7 @@
<option value="dropped" {% if create_form.status == "dropped" %}selected{% endif %}>已弃坑</option>
</select>
<input type="text" name="cover" value="{{ create_form.cover }}" placeholder="封面图标或 emoji">
<input type="url" name="link_url" value="{{ create_form.link_url }}" placeholder="跳转链接,可选">
<input type="text" name="tags" value="{{ create_form.tags }}" placeholder="标签,逗号分隔">
<textarea name="description" placeholder="评价描述">{{ create_form.description }}</textarea>
</div>
@@ -78,11 +79,15 @@
<option value="dropped" {% if row.status == "dropped" %}selected{% endif %}>已弃坑</option>
</select>
<input type="text" name="cover" value="{{ row.cover }}" placeholder="封面图标或 emoji">
<input type="url" name="link_url" value="{{ row.link_url }}" placeholder="跳转链接,可选">
<input type="text" name="tags" value="{{ row.tags_input }}" placeholder="标签,逗号分隔">
<textarea name="description" placeholder="评价描述">{{ row.description }}</textarea>
</div>
<div class="compact-actions">
<button type="submit" class="btn btn-success">保存</button>
{% if row.link_url %}
<a href="{{ row.link_url }}" class="btn btn-ghost" target="_blank" rel="noreferrer noopener">跳转</a>
{% endif %}
<a href="{{ row.api_url }}" class="btn btn-ghost" target="_blank" rel="noreferrer noopener">API</a>
</div>
</form>

View File

@@ -88,12 +88,12 @@
</div>
<div class="field">
<label>聊天 API Base</label>
<input name="ai_api_base" value="{{ form.ai_api_base }}" placeholder="http://localhost:8317/v1">
<input name="ai_api_base" value="{{ form.ai_api_base }}" placeholder="https://91code.jiangnight.com/v1">
</div>
<div class="field field-wide">
<label>聊天 API Key</label>
<input name="ai_api_key" value="{{ form.ai_api_key }}" placeholder="your-api-key-1">
<div class="field-hint">这里只保存在后端数据库里,前台公开接口不会返回这个字段。当前默认接入本地 NewAPI 网关,未配置时前台仍可做本地检索,但不会生成完整聊天回答。</div>
<input name="ai_api_key" value="{{ form.ai_api_key }}" placeholder="sk-...">
<div class="field-hint">这里只保存在后端数据库里,前台公开接口不会返回这个字段。当前默认接入 91code.jiangnight.com 的 NewAPI 兼容接口,未配置时前台仍可做本地检索,但不会生成完整聊天回答。</div>
</div>
<div class="field">
<label>聊天模型</label>