-
@@ -151,7 +129,7 @@ export default function DataStatistics() {
justifyContent: 'space-between',
lineHeight: '50px'
}}>
- 今天请求总量 0
+ 今天请求总量 {dayRequestCount.requestCount}
- 今天4xx错误数量 0
+ 今天4xx错误数量 {dayRequestCount.error4xxCount}
- 今天5xx错误数量 0
+ 今天5xx错误数量 {dayRequestCount.error5xxCount}
@@ -176,7 +154,7 @@ export default function DataStatistics() {
justifyContent: 'space-between',
lineHeight: '50px'
}}>
- 请求总量 0
+ 请求总量 {totalRequestCount.requestCount}
- 4xx错误数量 0
+ 4xx错误数量 {totalRequestCount.error4xxCount}
- 5xx错误数量 0
+ 5xx错误数量 {totalRequestCount.error5xxCount}
diff --git a/web/src/pages/http-proxy/features/UpdateHttpProxy.tsx b/web/src/pages/http-proxy/features/UpdateHttpProxy.tsx
index 9fe672f..4b79e82 100644
--- a/web/src/pages/http-proxy/features/UpdateHttpProxy.tsx
+++ b/web/src/pages/http-proxy/features/UpdateHttpProxy.tsx
@@ -1,6 +1,6 @@
import { Button, Col, Collapse, Divider, Form, InputGroup, Modal, Notification, Row } from "@douyinfe/semi-ui";
import { LoadType, LocationInput, Service, ServiceInput } from "../../../module";
-import { CheckDirecotryExistence, CreateApiService } from "../../../services/ApiServiceService";
+import { CheckDirecotryExistence, CreateApiService, UpdateApiService } from "../../../services/ApiServiceService";
interface IUpdateHttpProxyProps {
visible: boolean;
@@ -35,11 +35,11 @@ export default function UpdateHttpProxy({
labelCol={{ span: 4 }}
initValues={values}
onSubmit={(values: ServiceInput) => {
- CreateApiService(values)
+ UpdateApiService(values.id as string, values)
.then((res: any) => {
Notification.success({
- title: '创建成功',
- content: '创建成功',
+ title: '修改成功',
+ content: '修改成功',
});
onOk();
})
@@ -74,7 +74,6 @@ export default function UpdateHttpProxy({
allowCreate={true}
multiple={true}
filter={true}
- onChange={v => console.log(v)}
defaultActiveFirstOption
>
@@ -184,6 +183,27 @@ export default function UpdateHttpProxy({
>
+ {
+ values.isHttps && (
+
+
+ {
+ values.enableHttp3 = v;
+ formApi.setValues(values);
+ }}
+ style={{
+ marginTop: '5px',
+ marginLeft: '10px',
+ }}
+ >
+
+
+ )
+ }
{
arrayField.type = v;
formApi.setValues(values);
diff --git a/web/src/services/QpsService.ts b/web/src/services/QpsService.ts
index 7c33197..2cabcec 100644
--- a/web/src/services/QpsService.ts
+++ b/web/src/services/QpsService.ts
@@ -9,7 +9,7 @@ export async function getQpsChart(serviceId?: string) {
method: 'GET',
headers: {
'Content-Type': 'application/json',
- 'Authorization': "Bearer" + localStorage.getItem('token') || ''
+ 'Authorization': "Bearer " + localStorage.getItem('token') || ''
}
});
diff --git a/web/src/services/StatisticRequestService.ts b/web/src/services/StatisticRequestService.ts
new file mode 100644
index 0000000..3e1147f
--- /dev/null
+++ b/web/src/services/StatisticRequestService.ts
@@ -0,0 +1,15 @@
+import { get } from "../utils/fetch";
+
+/**
+ * 获取今日请求数
+ */
+export function DayRequestCount(){
+ return get('/api/v1/Statistic/DayRequestCount');
+}
+
+/**
+ * 获取总请求数
+ */
+export function TotalRequestCount(){
+ return get('/api/v1/Statistic/TotalRequestCount');
+}
\ No newline at end of file