-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e6a349
commit 614a7ab
Showing
16 changed files
with
1,094 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 部署api前端项目 | ||
|
||
# 只有master分支发生push主分支或pull_request关闭后事件时,才会触发workflow | ||
on: | ||
push: | ||
branches: | ||
# 你的主分支名 | ||
- master | ||
pull_request: | ||
branches: | ||
# 你的主分支名 | ||
- master | ||
types: | ||
- closed | ||
jobs: | ||
build: | ||
# runs-on 指定job任务运行所需要的虚拟机环境(必填字段) | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 获取源码 | ||
- name: 迁出代码 | ||
# 使用action库 actions/checkout获取源码 | ||
uses: actions/checkout@v3 | ||
|
||
# 安装Node10 | ||
- name: 安装node.js | ||
# 使用action库 actions/setup-node安装node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
|
||
# 安装依赖 | ||
- name: 安装依赖 | ||
run: npm install | ||
|
||
# 打包 | ||
- name: 打包 | ||
run: npm run build | ||
|
||
# 上传阿里云 | ||
- name: 发布项目 | ||
uses: easingthemes/ssh-deploy@main | ||
with: | ||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ARGS: "-rlgoDzvc -i --delete" | ||
SOURCE: "dist/" | ||
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | ||
REMOTE_USER: ${{ secrets.REMOTE_USER }} | ||
TARGET: ${{ secrets.REMOTE_TARGET }} | ||
# 排除项 | ||
EXCLUDE: "/dist/, /node_modules/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { PageContainer } from '@ant-design/pro-components'; | ||
import '@umijs/max'; | ||
import React, {useEffect, useState} from 'react'; | ||
import ReactECharts from 'echarts-for-react'; | ||
import {listTopInvokeInterfaceInfoUsingGet} from "@/services/linger-api-backend/analysisController"; | ||
|
||
/** | ||
* 接口分析 | ||
* @constructor | ||
*/ | ||
const InterfaceAnalysis: React.FC = () => { | ||
|
||
const [data, setData] = useState<API.InterfaceInfoVO[]>([]); | ||
|
||
useEffect(() => { | ||
try { | ||
listTopInvokeInterfaceInfoUsingGet().then(res => { | ||
if (res.data) { | ||
setData(res.data); | ||
} | ||
}) | ||
} catch (e: any) { | ||
|
||
} | ||
// todo 从远程获取数据 | ||
}, []) | ||
|
||
// 映射:{ value: 1048, name: 'Search Engine' }, | ||
const chartData = data.map(item => { | ||
return { | ||
value: item.totalNum, | ||
name: item.name, | ||
} | ||
}) | ||
|
||
const option = { | ||
title: { | ||
text: '调用次数最多的接口TOP3', | ||
left: 'center', | ||
}, | ||
tooltip: { | ||
trigger: 'item', | ||
}, | ||
legend: { | ||
orient: 'vertical', | ||
left: 'left', | ||
}, | ||
series: [ | ||
{ | ||
name: 'Access From', | ||
type: 'pie', | ||
radius: '50%', | ||
data: chartData, | ||
emphasis: { | ||
itemStyle: { | ||
shadowBlur: 10, | ||
shadowOffsetX: 0, | ||
shadowColor: 'rgba(0, 0, 0, 0.5)', | ||
}, | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
return ( | ||
<PageContainer> | ||
<ReactECharts option={option} /> | ||
</PageContainer> | ||
); | ||
}; | ||
export default InterfaceAnalysis; |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.