@h-ai/cli 0.1.0-alpha5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +167 -0
- package/dist/chunk-2H7UOFLK.js +10 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-LANIDJC7.js +659 -0
- package/dist/chunk-LANIDJC7.js.map +1 -0
- package/dist/chunk-YV7WPUI6.js +206 -0
- package/dist/chunk-YV7WPUI6.js.map +1 -0
- package/dist/config-templates-S5RI2MC6.js +5 -0
- package/dist/config-templates-S5RI2MC6.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1645 -0
- package/dist/index.js.map +1 -0
- package/dist/skill-templates-N5DU5FNX.js +5 -0
- package/dist/skill-templates-N5DU5FNX.js.map +1 -0
- package/dist/src-XJ6YXNAF.js +15030 -0
- package/dist/src-XJ6YXNAF.js.map +1 -0
- package/package.json +59 -0
- package/templates/README.md +126 -0
- package/templates/apps/admin/messages/en-US.json +33 -0
- package/templates/apps/admin/messages/zh-CN.json +33 -0
- package/templates/apps/admin/src/routes/+layout.svelte.hbs +30 -0
- package/templates/apps/admin/src/routes/+page.svelte.hbs +35 -0
- package/templates/apps/admin/src/routes/admin/+layout.svelte.hbs +44 -0
- package/templates/apps/admin/src/routes/admin/+page.svelte.hbs +45 -0
- package/templates/apps/admin/src/routes/admin/settings/+page.svelte.hbs +37 -0
- package/templates/apps/admin/src/routes/api/health/+server.ts +12 -0
- package/templates/apps/android-app/.env.hbs +3 -0
- package/templates/apps/android-app/capacitor.config.ts.hbs +12 -0
- package/templates/apps/android-app/messages/en-US.json +24 -0
- package/templates/apps/android-app/messages/zh-CN.json +24 -0
- package/templates/apps/android-app/src/lib/api.ts.hbs +30 -0
- package/templates/apps/android-app/src/lib/capacitor.ts +21 -0
- package/templates/apps/android-app/src/routes/+layout.svelte.hbs +42 -0
- package/templates/apps/android-app/src/routes/+layout.ts +7 -0
- package/templates/apps/android-app/src/routes/+page.svelte.hbs +27 -0
- package/templates/apps/api/src/routes/+layout.svelte +14 -0
- package/templates/apps/api/src/routes/+page.svelte +11 -0
- package/templates/apps/api/src/routes/api/v1/health/+server.ts +14 -0
- package/templates/apps/api/src/routes/api/v1/items/+server.ts +37 -0
- package/templates/apps/api/src/routes/api/v1/items/[id]/+server.ts +30 -0
- package/templates/apps/h5/messages/en-US.json +37 -0
- package/templates/apps/h5/messages/zh-CN.json +37 -0
- package/templates/apps/h5/src/routes/+layout.svelte.hbs +57 -0
- package/templates/apps/h5/src/routes/+page.svelte.hbs +27 -0
- package/templates/apps/h5/src/routes/discover/+page.svelte.hbs +27 -0
- package/templates/apps/h5/src/routes/profile/+page.svelte.hbs +27 -0
- package/templates/apps/website/messages/en-US.json +32 -0
- package/templates/apps/website/messages/zh-CN.json +32 -0
- package/templates/apps/website/src/routes/+layout.svelte.hbs +66 -0
- package/templates/apps/website/src/routes/+page.svelte.hbs +33 -0
- package/templates/apps/website/src/routes/about/+page.svelte.hbs +27 -0
- package/templates/apps/website/src/routes/api/health/+server.ts +12 -0
- package/templates/apps/website/src/routes/contact/+page.svelte.hbs +59 -0
- package/templates/apps/website/src/routes/services/+page.svelte.hbs +63 -0
- package/templates/base/e2e/helpers.ts +49 -0
- package/templates/base/package.json.hbs +67 -0
- package/templates/base/playwright.config.ts +32 -0
- package/templates/base/src/app.css +2 -0
- package/templates/base/src/app.d.ts.hbs +18 -0
- package/templates/base/src/app.html.hbs +16 -0
- package/templates/base/src/hooks.server.ts.hbs +123 -0
- package/templates/base/src/lib/server/init.ts.hbs +190 -0
- package/templates/base/svelte.config.js.hbs +30 -0
- package/templates/base/tsconfig.json +8 -0
- package/templates/base/vite.config.ts.hbs +27 -0
- package/templates/features/ai/routes/api/chat/+server.ts +26 -0
- package/templates/features/datapipe/routes/api/datapipe/pipeline/+server.ts +41 -0
- package/templates/features/iam/routes-admin/(auth)/+layout.svelte.hbs +21 -0
- package/templates/features/iam/routes-admin/(auth)/auth/login/+page.svelte.hbs +98 -0
- package/templates/features/iam/routes-admin/(auth)/auth/register/+page.svelte.hbs +124 -0
- package/templates/features/iam/routes-h5/auth/login/+page.svelte.hbs +98 -0
- package/templates/features/iam/routes-h5/auth/register/+page.svelte.hbs +114 -0
- package/templates/features/iam/routes-shared/api/auth/login/+server.ts +32 -0
- package/templates/features/iam/routes-shared/api/auth/logout/+server.ts +15 -0
- package/templates/features/iam/routes-shared/api/auth/me/+server.ts +12 -0
- package/templates/features/iam/routes-shared/api/auth/register/+server.ts +26 -0
- package/templates/features/payment/routes/api/v1/payment/create/+server.ts +30 -0
- package/templates/features/payment/routes/api/v1/payment/notify/[provider]/+server.ts +42 -0
- package/templates/features/payment/routes/api/v1/payment/query/[orderNo]/+server.ts +25 -0
- package/templates/features/storage/routes/api/upload/+server.ts +35 -0
- package/templates/features/vecdb/routes/api/vecdb/search/+server.ts +36 -0
- package/templates/i18n/project.inlang/settings.json +11 -0
- package/templates/skills/AGENTS.md +26 -0
- package/templates/skills/CLAUDE.md +12 -0
- package/templates/skills/copilot-instructions.md +61 -0
- package/templates/skills/hai-ai/SKILL.md +659 -0
- package/templates/skills/hai-api-client/SKILL.md +346 -0
- package/templates/skills/hai-app-create/SKILL.md +371 -0
- package/templates/skills/hai-app-review/SKILL.md +156 -0
- package/templates/skills/hai-app-tests/SKILL.md +468 -0
- package/templates/skills/hai-audit/SKILL.md +141 -0
- package/templates/skills/hai-build/SKILL.md +319 -0
- package/templates/skills/hai-cache/SKILL.md +184 -0
- package/templates/skills/hai-capacitor/SKILL.md +389 -0
- package/templates/skills/hai-core/SKILL.md +544 -0
- package/templates/skills/hai-crypto/SKILL.md +183 -0
- package/templates/skills/hai-datapipe/SKILL.md +214 -0
- package/templates/skills/hai-deploy/SKILL.md +210 -0
- package/templates/skills/hai-iam/SKILL.md +355 -0
- package/templates/skills/hai-kit/SKILL.md +319 -0
- package/templates/skills/hai-payment/SKILL.md +289 -0
- package/templates/skills/hai-reach/SKILL.md +325 -0
- package/templates/skills/hai-reldb/SKILL.md +459 -0
- package/templates/skills/hai-scheduler/SKILL.md +242 -0
- package/templates/skills/hai-storage/SKILL.md +230 -0
- package/templates/skills/hai-ui/SKILL.md +275 -0
- package/templates/skills/hai-vecdb/SKILL.md +273 -0
- package/templates/skills/opencode.json +11 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svelte:head>
|
|
2
|
+
<title>API Service</title>
|
|
3
|
+
</svelte:head>
|
|
4
|
+
|
|
5
|
+
<main class='min-h-screen flex items-center justify-center font-mono'>
|
|
6
|
+
<div class='text-center'>
|
|
7
|
+
<h1 class='text-3xl font-bold mb-4'>API Service</h1>
|
|
8
|
+
<p class='text-gray-600 mb-4'>RESTful API Service</p>
|
|
9
|
+
<p class='text-sm text-gray-400'>GET /api/v1/health — 健康检查</p>
|
|
10
|
+
</div>
|
|
11
|
+
</main>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 健康检查端点
|
|
3
|
+
*/
|
|
4
|
+
import type { RequestHandler } from './$types'
|
|
5
|
+
import { kit } from '@h-ai/kit'
|
|
6
|
+
|
|
7
|
+
export const GET: RequestHandler = async ({ locals }) => {
|
|
8
|
+
return kit.response.ok({
|
|
9
|
+
status: 'ok',
|
|
10
|
+
service: 'api-service',
|
|
11
|
+
version: '0.0.1',
|
|
12
|
+
timestamp: new Date().toISOString(),
|
|
13
|
+
}, locals.requestId)
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Items API — 列表与创建
|
|
3
|
+
*/
|
|
4
|
+
import type { RequestHandler } from './$types'
|
|
5
|
+
import { kit } from '@h-ai/kit'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* GET /api/v1/items — 获取列表
|
|
9
|
+
*/
|
|
10
|
+
export const GET: RequestHandler = async ({ url, locals }) => {
|
|
11
|
+
const page = Number(url.searchParams.get('page') || '1')
|
|
12
|
+
const pageSize = Number(url.searchParams.get('pageSize') || '20')
|
|
13
|
+
|
|
14
|
+
return kit.response.ok({
|
|
15
|
+
items: [],
|
|
16
|
+
total: 0,
|
|
17
|
+
page,
|
|
18
|
+
pageSize,
|
|
19
|
+
}, locals.requestId)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* POST /api/v1/items — 创建
|
|
24
|
+
*/
|
|
25
|
+
export const POST: RequestHandler = async ({ request, locals }) => {
|
|
26
|
+
const body = await request.json()
|
|
27
|
+
|
|
28
|
+
if (!body.name) {
|
|
29
|
+
return kit.response.badRequest('name is required')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return kit.response.ok({
|
|
33
|
+
id: '1',
|
|
34
|
+
...body,
|
|
35
|
+
createdAt: new Date().toISOString(),
|
|
36
|
+
}, locals.requestId)
|
|
37
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Items API — 单项操作
|
|
3
|
+
*/
|
|
4
|
+
import type { RequestHandler } from './$types'
|
|
5
|
+
import { kit } from '@h-ai/kit'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* GET /api/v1/items/:id — 获取详情
|
|
9
|
+
*/
|
|
10
|
+
export const GET: RequestHandler = async ({ params, locals }) => {
|
|
11
|
+
const { id } = params
|
|
12
|
+
return kit.response.ok({ id, name: 'Example Item' }, locals.requestId)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* PUT /api/v1/items/:id — 更新
|
|
17
|
+
*/
|
|
18
|
+
export const PUT: RequestHandler = async ({ params, request, locals }) => {
|
|
19
|
+
const { id } = params
|
|
20
|
+
const body = await request.json()
|
|
21
|
+
return kit.response.ok({ id, ...body, updatedAt: new Date().toISOString() }, locals.requestId)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* DELETE /api/v1/items/:id — 删除
|
|
26
|
+
*/
|
|
27
|
+
export const DELETE: RequestHandler = async ({ params, locals }) => {
|
|
28
|
+
const { id } = params
|
|
29
|
+
return kit.response.ok({ id, deleted: true }, locals.requestId)
|
|
30
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_title": "H5 App",
|
|
3
|
+
"app_description": "H5 mobile app built with hai Agent Framework",
|
|
4
|
+
"nav_home": "Home",
|
|
5
|
+
"nav_discover": "Discover",
|
|
6
|
+
"nav_profile": "Profile",
|
|
7
|
+
"page_home_search": "Search...",
|
|
8
|
+
"page_home_feature1": "Feature 1",
|
|
9
|
+
"page_home_feature2": "Feature 2",
|
|
10
|
+
"page_home_feature3": "Feature 3",
|
|
11
|
+
"page_home_feature4": "Feature 4",
|
|
12
|
+
"page_home_latest": "Latest",
|
|
13
|
+
"page_home_welcome": "Welcome to H5 App",
|
|
14
|
+
"page_discover_title": "Discover",
|
|
15
|
+
"page_discover_desc": "Explore more content.",
|
|
16
|
+
"page_profile_title": "Profile",
|
|
17
|
+
"page_profile_username": "Username",
|
|
18
|
+
"page_profile_login_hint": "Tap to login",
|
|
19
|
+
"page_profile_info": "Personal Info",
|
|
20
|
+
"page_profile_settings": "Settings",
|
|
21
|
+
"page_profile_about": "About",
|
|
22
|
+
"auth_login_title": "Login",
|
|
23
|
+
"auth_login_submit": "Login",
|
|
24
|
+
"auth_login_loading": "Logging in...",
|
|
25
|
+
"auth_login_failed": "Login failed",
|
|
26
|
+
"auth_login_to_register": "No account? Register now",
|
|
27
|
+
"auth_register_title": "Register",
|
|
28
|
+
"auth_register_submit": "Register",
|
|
29
|
+
"auth_register_loading": "Registering...",
|
|
30
|
+
"auth_register_failed": "Registration failed",
|
|
31
|
+
"auth_register_to_login": "Already have an account? Login now",
|
|
32
|
+
"auth_label_username": "Username",
|
|
33
|
+
"auth_label_password": "Password",
|
|
34
|
+
"auth_label_confirm_password": "Confirm Password",
|
|
35
|
+
"auth_error_network": "Network error",
|
|
36
|
+
"auth_error_password_mismatch": "Passwords do not match"
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_title": "H5 应用",
|
|
3
|
+
"app_description": "基于 hai Agent Framework 构建的移动端 H5 应用",
|
|
4
|
+
"nav_home": "首页",
|
|
5
|
+
"nav_discover": "发现",
|
|
6
|
+
"nav_profile": "我的",
|
|
7
|
+
"page_home_search": "搜索...",
|
|
8
|
+
"page_home_feature1": "功能一",
|
|
9
|
+
"page_home_feature2": "功能二",
|
|
10
|
+
"page_home_feature3": "功能三",
|
|
11
|
+
"page_home_feature4": "功能四",
|
|
12
|
+
"page_home_latest": "最新内容",
|
|
13
|
+
"page_home_welcome": "欢迎使用 H5 应用",
|
|
14
|
+
"page_discover_title": "发现",
|
|
15
|
+
"page_discover_desc": "探索更多精彩内容。",
|
|
16
|
+
"page_profile_title": "我的",
|
|
17
|
+
"page_profile_username": "用户名",
|
|
18
|
+
"page_profile_login_hint": "点击登录",
|
|
19
|
+
"page_profile_info": "个人信息",
|
|
20
|
+
"page_profile_settings": "设置",
|
|
21
|
+
"page_profile_about": "关于",
|
|
22
|
+
"auth_login_title": "登录",
|
|
23
|
+
"auth_login_submit": "登录",
|
|
24
|
+
"auth_login_loading": "登录中...",
|
|
25
|
+
"auth_login_failed": "登录失败",
|
|
26
|
+
"auth_login_to_register": "没有账号?立即注册",
|
|
27
|
+
"auth_register_title": "注册",
|
|
28
|
+
"auth_register_submit": "注册",
|
|
29
|
+
"auth_register_loading": "注册中...",
|
|
30
|
+
"auth_register_failed": "注册失败",
|
|
31
|
+
"auth_register_to_login": "已有账号?立即登录",
|
|
32
|
+
"auth_label_username": "用户名",
|
|
33
|
+
"auth_label_password": "密码",
|
|
34
|
+
"auth_label_confirm_password": "确认密码",
|
|
35
|
+
"auth_error_network": "网络错误",
|
|
36
|
+
"auth_error_password_mismatch": "密码不一致"
|
|
37
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{{!-- H5 应用根布局 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* H5 应用根布局
|
|
5
|
+
*/
|
|
6
|
+
import type { Snippet } from 'svelte'
|
|
7
|
+
import '../app.css'
|
|
8
|
+
{{#if hasI18n}}
|
|
9
|
+
import { browser } from '$app/environment'
|
|
10
|
+
import { setGlobalLocale } from '@h-ai/ui'
|
|
11
|
+
import { getLocale } from '$lib/paraglide/runtime.js'
|
|
12
|
+
import * as m from '$lib/paraglide/messages'
|
|
13
|
+
{{/if}}
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
children: Snippet
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { children }: Props = $props()
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
|
|
22
|
+
if (browser) {
|
|
23
|
+
const paraglideLocale = getLocale()
|
|
24
|
+
setGlobalLocale(paraglideLocale)
|
|
25
|
+
}
|
|
26
|
+
{{/if}}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div class="min-h-screen flex flex-col bg-base-200">
|
|
30
|
+
<main class="flex-1 pb-16">
|
|
31
|
+
{@render children()}
|
|
32
|
+
</main>
|
|
33
|
+
|
|
34
|
+
<nav class="btm-nav btm-nav-sm">
|
|
35
|
+
<a href="/" class="text-primary">
|
|
36
|
+
{{#if hasI18n}}
|
|
37
|
+
<span class="btm-nav-label">{m.nav_home()}</span>
|
|
38
|
+
{{else}}
|
|
39
|
+
<span class="btm-nav-label">首页</span>
|
|
40
|
+
{{/if}}
|
|
41
|
+
</a>
|
|
42
|
+
<a href="/discover">
|
|
43
|
+
{{#if hasI18n}}
|
|
44
|
+
<span class="btm-nav-label">{m.nav_discover()}</span>
|
|
45
|
+
{{else}}
|
|
46
|
+
<span class="btm-nav-label">发现</span>
|
|
47
|
+
{{/if}}
|
|
48
|
+
</a>
|
|
49
|
+
<a href="/profile">
|
|
50
|
+
{{#if hasI18n}}
|
|
51
|
+
<span class="btm-nav-label">{m.nav_profile()}</span>
|
|
52
|
+
{{else}}
|
|
53
|
+
<span class="btm-nav-label">我的</span>
|
|
54
|
+
{{/if}}
|
|
55
|
+
</a>
|
|
56
|
+
</nav>
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{{!-- H5 首页 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* H5 首页
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.app_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>H5 应用</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="p-4">
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
<h1 class="text-2xl font-bold mb-4">{m.page_home_title()}</h1>
|
|
22
|
+
<p class="text-gray-600">{m.page_home_desc()}</p>
|
|
23
|
+
{{else}}
|
|
24
|
+
<h1 class="text-2xl font-bold mb-4">首页</h1>
|
|
25
|
+
<p class="text-gray-600">欢迎使用 H5 应用</p>
|
|
26
|
+
{{/if}}
|
|
27
|
+
</section>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{{!-- 发现页面 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 发现页面
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.page_discover_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>发现</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="p-4">
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
<h1 class="text-2xl font-bold mb-4">{m.page_discover_title()}</h1>
|
|
22
|
+
<p class="text-gray-600">{m.page_discover_desc()}</p>
|
|
23
|
+
{{else}}
|
|
24
|
+
<h1 class="text-2xl font-bold mb-4">发现</h1>
|
|
25
|
+
<p class="text-gray-600">探索更多精彩内容</p>
|
|
26
|
+
{{/if}}
|
|
27
|
+
</section>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{{!-- 个人中心页面 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 个人中心页面
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.page_profile_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>我的</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="p-4">
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
<h1 class="text-2xl font-bold mb-4">{m.page_profile_title()}</h1>
|
|
22
|
+
<p class="text-gray-600">{m.page_profile_desc()}</p>
|
|
23
|
+
{{else}}
|
|
24
|
+
<h1 class="text-2xl font-bold mb-4">我的</h1>
|
|
25
|
+
<p class="text-gray-600">管理您的个人信息</p>
|
|
26
|
+
{{/if}}
|
|
27
|
+
</section>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_title": "Corporate Website",
|
|
3
|
+
"app_description": "Corporate official website",
|
|
4
|
+
"meta_description": "Corporate official website",
|
|
5
|
+
"nav_home": "Home",
|
|
6
|
+
"nav_about": "About",
|
|
7
|
+
"nav_services": "Services",
|
|
8
|
+
"nav_contact": "Contact",
|
|
9
|
+
"page_home_title": "Welcome",
|
|
10
|
+
"page_home_subtitle": "Professional and reliable enterprise services",
|
|
11
|
+
"page_home_cta": "Contact Us",
|
|
12
|
+
"page_home_advantages": "Our Advantages",
|
|
13
|
+
"page_home_team": "Professional Team",
|
|
14
|
+
"page_home_team_desc": "A team with years of industry experience.",
|
|
15
|
+
"page_home_service": "Quality Service",
|
|
16
|
+
"page_home_service_desc": "Comprehensive premium service support.",
|
|
17
|
+
"page_home_tech": "Innovative Technology",
|
|
18
|
+
"page_home_tech_desc": "Industry-leading innovative technology solutions.",
|
|
19
|
+
"page_about_title": "About Us",
|
|
20
|
+
"page_about_desc": "Company information and development history.",
|
|
21
|
+
"page_services_title": "Our Services",
|
|
22
|
+
"page_services_item1": "Service One",
|
|
23
|
+
"page_services_item2": "Service Two",
|
|
24
|
+
"page_services_desc": "Service description content.",
|
|
25
|
+
"page_contact_title": "Contact Us",
|
|
26
|
+
"page_contact_desc": "Have any questions? Feel free to contact us.",
|
|
27
|
+
"page_contact_name": "Name",
|
|
28
|
+
"page_contact_email": "Email",
|
|
29
|
+
"page_contact_message": "Message",
|
|
30
|
+
"page_contact_submit": "Send",
|
|
31
|
+
"footer_copyright": "Copyright © {year}. All rights reserved."
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_title": "企业官网",
|
|
3
|
+
"app_description": "企业官方网站",
|
|
4
|
+
"meta_description": "企业官方网站",
|
|
5
|
+
"nav_home": "首页",
|
|
6
|
+
"nav_about": "关于我们",
|
|
7
|
+
"nav_services": "服务",
|
|
8
|
+
"nav_contact": "联系我们",
|
|
9
|
+
"page_home_title": "欢迎",
|
|
10
|
+
"page_home_subtitle": "专业、可靠的企业服务",
|
|
11
|
+
"page_home_cta": "联系我们",
|
|
12
|
+
"page_home_advantages": "我们的优势",
|
|
13
|
+
"page_home_team": "专业团队",
|
|
14
|
+
"page_home_team_desc": "拥有多年行业经验的专业团队。",
|
|
15
|
+
"page_home_service": "优质服务",
|
|
16
|
+
"page_home_service_desc": "提供全方位的优质服务支持。",
|
|
17
|
+
"page_home_tech": "创新技术",
|
|
18
|
+
"page_home_tech_desc": "引领行业的创新技术解决方案。",
|
|
19
|
+
"page_about_title": "关于我们",
|
|
20
|
+
"page_about_desc": "在此介绍公司信息和发展历程。",
|
|
21
|
+
"page_services_title": "我们的服务",
|
|
22
|
+
"page_services_item1": "服务一",
|
|
23
|
+
"page_services_item2": "服务二",
|
|
24
|
+
"page_services_desc": "服务描述内容。",
|
|
25
|
+
"page_contact_title": "联系我们",
|
|
26
|
+
"page_contact_desc": "有任何疑问?欢迎联系我们。",
|
|
27
|
+
"page_contact_name": "姓名",
|
|
28
|
+
"page_contact_email": "邮箱",
|
|
29
|
+
"page_contact_message": "留言",
|
|
30
|
+
"page_contact_submit": "发送",
|
|
31
|
+
"footer_copyright": "Copyright © {year}. All rights reserved."
|
|
32
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{{!-- 官网根布局 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 官网根布局
|
|
5
|
+
*/
|
|
6
|
+
import type { Snippet } from 'svelte'
|
|
7
|
+
import '../app.css'
|
|
8
|
+
{{#if hasI18n}}
|
|
9
|
+
import { browser } from '$app/environment'
|
|
10
|
+
import { setGlobalLocale } from '@h-ai/ui'
|
|
11
|
+
import { getLocale } from '$lib/paraglide/runtime.js'
|
|
12
|
+
import * as m from '$lib/paraglide/messages'
|
|
13
|
+
{{/if}}
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
children: Snippet
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { children }: Props = $props()
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
|
|
22
|
+
if (browser) {
|
|
23
|
+
const paraglideLocale = getLocale()
|
|
24
|
+
setGlobalLocale(paraglideLocale)
|
|
25
|
+
}
|
|
26
|
+
{{/if}}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div class="min-h-screen flex flex-col">
|
|
30
|
+
<header class="navbar bg-base-100 shadow-sm">
|
|
31
|
+
<div class="flex-1">
|
|
32
|
+
{{#if hasI18n}}
|
|
33
|
+
<a href="/" class="btn btn-ghost text-xl">{m.app_title()}</a>
|
|
34
|
+
{{else}}
|
|
35
|
+
<a href="/" class="btn btn-ghost text-xl">官网</a>
|
|
36
|
+
{{/if}}
|
|
37
|
+
</div>
|
|
38
|
+
<nav class="flex-none">
|
|
39
|
+
<ul class="menu menu-horizontal px-1">
|
|
40
|
+
{{#if hasI18n}}
|
|
41
|
+
<li><a href="/">{m.nav_home()}</a></li>
|
|
42
|
+
<li><a href="/about">{m.nav_about()}</a></li>
|
|
43
|
+
<li><a href="/services">{m.nav_services()}</a></li>
|
|
44
|
+
<li><a href="/contact">{m.nav_contact()}</a></li>
|
|
45
|
+
{{else}}
|
|
46
|
+
<li><a href="/">首页</a></li>
|
|
47
|
+
<li><a href="/about">关于</a></li>
|
|
48
|
+
<li><a href="/services">服务</a></li>
|
|
49
|
+
<li><a href="/contact">联系我们</a></li>
|
|
50
|
+
{{/if}}
|
|
51
|
+
</ul>
|
|
52
|
+
</nav>
|
|
53
|
+
</header>
|
|
54
|
+
|
|
55
|
+
<main class="flex-1">
|
|
56
|
+
{@render children()}
|
|
57
|
+
</main>
|
|
58
|
+
|
|
59
|
+
<footer class="footer footer-center p-4 bg-base-300 text-base-content">
|
|
60
|
+
{{#if hasI18n}}
|
|
61
|
+
<p>{m.footer_copyright()}</p>
|
|
62
|
+
{{else}}
|
|
63
|
+
<p>Copyright © 2025 - All rights reserved</p>
|
|
64
|
+
{{/if}}
|
|
65
|
+
</footer>
|
|
66
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{{!-- 官网首页 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 官网首页
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.app_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>官网</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="hero min-h-[60vh] bg-base-200">
|
|
20
|
+
<div class="hero-content text-center">
|
|
21
|
+
<div class="max-w-md">
|
|
22
|
+
{{#if hasI18n}}
|
|
23
|
+
<h1 class="text-5xl font-bold">{m.page_home_title()}</h1>
|
|
24
|
+
<p class="py-6">{m.page_home_subtitle()}</p>
|
|
25
|
+
<a href="/about" class="btn btn-primary">{m.page_home_cta()}</a>
|
|
26
|
+
{{else}}
|
|
27
|
+
<h1 class="text-5xl font-bold">欢迎</h1>
|
|
28
|
+
<p class="py-6">基于 hai Agent Framework 构建</p>
|
|
29
|
+
<a href="/about" class="btn btn-primary">了解更多</a>
|
|
30
|
+
{{/if}}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</section>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{{!-- 关于页面 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 关于页面
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.page_about_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>关于我们</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="py-16 px-4 max-w-4xl mx-auto">
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
<h1 class="text-3xl font-bold mb-8">{m.page_about_title()}</h1>
|
|
22
|
+
<p class="text-lg text-gray-600">{m.page_about_desc()}</p>
|
|
23
|
+
{{else}}
|
|
24
|
+
<h1 class="text-3xl font-bold mb-8">关于我们</h1>
|
|
25
|
+
<p class="text-lg text-gray-600">了解我们的团队与使命。</p>
|
|
26
|
+
{{/if}}
|
|
27
|
+
</section>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 健康检查端点
|
|
3
|
+
*/
|
|
4
|
+
import type { RequestHandler } from './$types'
|
|
5
|
+
import { kit } from '@h-ai/kit'
|
|
6
|
+
|
|
7
|
+
export const GET: RequestHandler = async ({ locals }) => {
|
|
8
|
+
return kit.response.ok({
|
|
9
|
+
status: 'ok',
|
|
10
|
+
timestamp: new Date().toISOString(),
|
|
11
|
+
}, locals.requestId)
|
|
12
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{{!-- 联系页面 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 联系我们页面
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.page_contact_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>联系我们</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="py-16 px-4 max-w-2xl mx-auto">
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
<h1 class="text-3xl font-bold mb-8">{m.page_contact_title()}</h1>
|
|
22
|
+
<p class="text-lg text-gray-600 mb-8">{m.page_contact_desc()}</p>
|
|
23
|
+
{{else}}
|
|
24
|
+
<h1 class="text-3xl font-bold mb-8">联系我们</h1>
|
|
25
|
+
<p class="text-lg text-gray-600 mb-8">有任何疑问?欢迎联系我们。</p>
|
|
26
|
+
{{/if}}
|
|
27
|
+
|
|
28
|
+
<form class="space-y-4">
|
|
29
|
+
<div class="form-control">
|
|
30
|
+
{{#if hasI18n}}
|
|
31
|
+
<label class="label" for="name"><span class="label-text">{m.page_contact_name()}</span></label>
|
|
32
|
+
{{else}}
|
|
33
|
+
<label class="label" for="name"><span class="label-text">姓名</span></label>
|
|
34
|
+
{{/if}}
|
|
35
|
+
<input id="name" type="text" class="input input-bordered w-full" />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="form-control">
|
|
38
|
+
{{#if hasI18n}}
|
|
39
|
+
<label class="label" for="email"><span class="label-text">{m.page_contact_email()}</span></label>
|
|
40
|
+
{{else}}
|
|
41
|
+
<label class="label" for="email"><span class="label-text">邮箱</span></label>
|
|
42
|
+
{{/if}}
|
|
43
|
+
<input id="email" type="email" class="input input-bordered w-full" />
|
|
44
|
+
</div>
|
|
45
|
+
<div class="form-control">
|
|
46
|
+
{{#if hasI18n}}
|
|
47
|
+
<label class="label" for="message"><span class="label-text">{m.page_contact_message()}</span></label>
|
|
48
|
+
{{else}}
|
|
49
|
+
<label class="label" for="message"><span class="label-text">留言</span></label>
|
|
50
|
+
{{/if}}
|
|
51
|
+
<textarea id="message" class="textarea textarea-bordered w-full" rows="4"></textarea>
|
|
52
|
+
</div>
|
|
53
|
+
{{#if hasI18n}}
|
|
54
|
+
<button type="submit" class="btn btn-primary w-full">{m.page_contact_submit()}</button>
|
|
55
|
+
{{else}}
|
|
56
|
+
<button type="submit" class="btn btn-primary w-full">发送</button>
|
|
57
|
+
{{/if}}
|
|
58
|
+
</form>
|
|
59
|
+
</section>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{{!-- 服务页面 --}}
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
/**
|
|
4
|
+
* 服务页面
|
|
5
|
+
*/
|
|
6
|
+
{{#if hasI18n}}
|
|
7
|
+
import * as m from '$lib/paraglide/messages'
|
|
8
|
+
{{/if}}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<svelte:head>
|
|
12
|
+
{{#if hasI18n}}
|
|
13
|
+
<title>{m.page_services_title()}</title>
|
|
14
|
+
{{else}}
|
|
15
|
+
<title>服务</title>
|
|
16
|
+
{{/if}}
|
|
17
|
+
</svelte:head>
|
|
18
|
+
|
|
19
|
+
<section class="py-16 px-4 max-w-4xl mx-auto">
|
|
20
|
+
{{#if hasI18n}}
|
|
21
|
+
<h1 class="text-3xl font-bold mb-8">{m.page_services_title()}</h1>
|
|
22
|
+
<p class="text-lg text-gray-600 mb-12">{m.page_services_desc()}</p>
|
|
23
|
+
{{else}}
|
|
24
|
+
<h1 class="text-3xl font-bold mb-8">我们的服务</h1>
|
|
25
|
+
<p class="text-lg text-gray-600 mb-12">我们提供以下专业服务。</p>
|
|
26
|
+
{{/if}}
|
|
27
|
+
|
|
28
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
|
29
|
+
<div class="card bg-base-100 shadow">
|
|
30
|
+
<div class="card-body">
|
|
31
|
+
{{#if hasI18n}}
|
|
32
|
+
<h2 class="card-title">{m.page_services_item1()}</h2>
|
|
33
|
+
<p>{m.page_services_desc()}</p>
|
|
34
|
+
{{else}}
|
|
35
|
+
<h2 class="card-title">咨询服务</h2>
|
|
36
|
+
<p>提供专业的技术咨询与解决方案。</p>
|
|
37
|
+
{{/if}}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="card bg-base-100 shadow">
|
|
41
|
+
<div class="card-body">
|
|
42
|
+
{{#if hasI18n}}
|
|
43
|
+
<h2 class="card-title">{m.page_services_item2()}</h2>
|
|
44
|
+
<p>{m.page_services_desc()}</p>
|
|
45
|
+
{{else}}
|
|
46
|
+
<h2 class="card-title">定制开发</h2>
|
|
47
|
+
<p>根据需求定制开发高质量应用。</p>
|
|
48
|
+
{{/if}}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="card bg-base-100 shadow">
|
|
52
|
+
<div class="card-body">
|
|
53
|
+
{{#if hasI18n}}
|
|
54
|
+
<h2 class="card-title">{m.page_services_item1()}</h2>
|
|
55
|
+
<p>{m.page_services_desc()}</p>
|
|
56
|
+
{{else}}
|
|
57
|
+
<h2 class="card-title">运维支持</h2>
|
|
58
|
+
<p>提供全方位的系统运维与技术支持。</p>
|
|
59
|
+
{{/if}}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</section>
|