Skip to content

Commit 7314648

Browse files
authored
Merge branch 'develop' into feat/55
2 parents 3a8af65 + 6f5e12f commit 7314648

File tree

9 files changed

+3088
-61
lines changed

9 files changed

+3088
-61
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Frontend to Vercel
2+
3+
on:
4+
pull_request_target:
5+
branches: [develop]
6+
paths: ['client/**']
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'yarn'
26+
cache-dependency-path: client/yarn.lock
27+
28+
- name: Install dependencies
29+
run: |
30+
cd client
31+
yarn install --frozen-lockfile
32+
33+
- name: Build project
34+
run: |
35+
cd client
36+
yarn build
37+
38+
- name: Deploy to Vercel
39+
id: vercel-deploy
40+
uses: amondnet/vercel-action@v25
41+
with:
42+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
43+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
44+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
45+
working-directory: ./client
46+
scope: ${{ secrets.VERCEL_ORG_ID }}
47+
48+
- name: Comment PR
49+
if: github.event_name == 'pull_request_target'
50+
uses: actions/github-script@v7
51+
with:
52+
script: |
53+
const deployUrl = '${{ steps.vercel-deploy.outputs.preview-url }}';
54+
github.rest.issues.createComment({
55+
issue_number: context.issue.number,
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
body: `🚀 **Frontend deployed successfully!**\n\n📱 **Preview URL:** ${deployUrl || 'Deployment in progress...'}\n\n✅ Build completed successfully`
59+
});

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,4 @@ __debug_bin
313313
.dockerignore
314314

315315
CLAUDE.md
316+
.vercel

client/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ See [Vite Configuration Reference](https://vite.dev/config/).
1717
## Project Setup
1818

1919
```sh
20-
npm install
20+
yarn install
2121
```
2222

2323
### Compile and Hot-Reload for Development
2424

2525
```sh
26-
npm run dev
26+
yarn dev
2727
```
2828

2929
### Type-Check, Compile and Minify for Production
3030

3131
```sh
32-
npm run build
32+
yarn build
3333
```
3434

3535
### Lint with [ESLint](https://eslint.org/)
3636

3737
```sh
38-
npm run lint
38+
yarn lint
3939
```

client/src/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export const apiService = {
112112
// 获取告警详情
113113
getAlertDetail: (issueID: string) => {
114114
return api.get(`/v1/issues/${issueID}`)
115-
}
116115
}
117116

118117
export default api

client/src/mock/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export class MockApiService {
152152
}
153153
}
154154

155+
155156
// 获取告警列表
156157
static async getAlerts(start?: string, limit: number = 10, state?: string): Promise<AlertsResponse> {
157158
await delay(400) // 模拟网络延迟

client/src/mock/services.ts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,26 @@ export interface DeploymentPlansResponse {
216216
items: DeploymentPlan[]
217217
}
218218

219+
// 告警规则变更记录数据结构
220+
export interface AlertRuleChangeValue {
221+
name: string
222+
old: string
223+
new: string
224+
}
225+
226+
export interface AlertRuleChangeItem {
227+
name: string
228+
editTime: string
229+
scope: string
230+
values: AlertRuleChangeValue[]
231+
reason: string
232+
}
233+
234+
export interface AlertRuleChangelogResponse {
235+
items: AlertRuleChangeItem[]
236+
next?: string
237+
}
238+
219239
// Mock数据 - 发布计划(按服务分组)
220240
export const mockDeploymentPlans: Record<string, DeploymentPlansResponse> = {
221241
"s3": {
@@ -1616,4 +1636,66 @@ export const mockAlertDetails: Record<string, AlertDetail> = {
16161636
}
16171637
]
16181638
}
1639+
=======
1640+
// Mock数据 - 告警规则变更记录
1641+
export const mockAlertRuleChangelog: AlertRuleChangelogResponse = {
1642+
items: [
1643+
{
1644+
name: "p98_latency_too_high",
1645+
editTime: "2024-01-04T12:00:00Z",
1646+
scope: "service:stg",
1647+
values: [
1648+
{
1649+
name: "threshold",
1650+
old: "10",
1651+
new: "15"
1652+
},
1653+
{
1654+
name: "watchTimeDuration",
1655+
old: "3min",
1656+
new: "5min"
1657+
}
1658+
],
1659+
reason: "由于业务增长,系统负载增加,原有10ms的延时阈值过于严格,导致频繁告警。经过AI分析历史数据,建议将阈值调整为15ms,既能及时发现性能问题,又避免误报。"
1660+
},
1661+
{
1662+
name: "saturation_too_high",
1663+
editTime: "2024-01-03T15:00:00Z",
1664+
scope: "service:stg",
1665+
values: [
1666+
{
1667+
name: "threshold",
1668+
old: "50",
1669+
new: "45"
1670+
}
1671+
],
1672+
reason: "监控发现系统在50%饱和度时已出现性能下降,提前预警有助于避免系统过载。调整后可以更早发现资源瓶颈,确保服务稳定性。"
1673+
},
1674+
{
1675+
name: "p98_latency_too_high",
1676+
editTime: "2024-01-03T10:00:00Z",
1677+
scope: "service:mongo",
1678+
values: [
1679+
{
1680+
name: "threshold",
1681+
old: "10",
1682+
new: "5"
1683+
}
1684+
],
1685+
reason: "MongoDB服务经过优化后性能显著提升,原有10ms阈值已不适用。调整为5ms可以更精确地监控数据库性能,及时发现潜在问题。"
1686+
},
1687+
{
1688+
name: "error_rate_too_high",
1689+
editTime: "2024-01-01T15:00:00Z",
1690+
scope: "service:meta",
1691+
values: [
1692+
{
1693+
name: "threshold",
1694+
old: "10",
1695+
new: "5"
1696+
}
1697+
],
1698+
reason: "Meta服务作为核心服务,对错误率要求更加严格。将错误告警阈值从10降低到5,可以更敏感地发现服务异常,确保数据一致性。"
1699+
}
1700+
],
16191701
}

0 commit comments

Comments
 (0)