feat: 添加告警画面截图相关设置
- 配置告警画面截图保留天数 - 是否自动获取告警画面截图
This commit is contained in:
1
src/apis/request/biz/upper-ndm/index.ts
Normal file
1
src/apis/request/biz/upper-ndm/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './upper-ndm';
|
||||
20
src/apis/request/biz/upper-ndm/upper-ndm.ts
Normal file
20
src/apis/request/biz/upper-ndm/upper-ndm.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ndmClient, userClient, type Station } from '@/apis';
|
||||
import { unwrapResponse } from '@/utils';
|
||||
|
||||
export async function snapStatusApi(method: 'get', options?: { stationCode?: Station['code']; signal?: AbortSignal }): Promise<boolean>;
|
||||
export async function snapStatusApi(method: 'post', options: { doSnap: boolean; stationCode?: Station['code']; signal?: AbortSignal }): Promise<boolean>;
|
||||
export async function snapStatusApi(method: 'get' | 'post', options?: { doSnap?: boolean; stationCode?: Station['code']; signal?: AbortSignal }) {
|
||||
const { doSnap, stationCode, signal } = options ?? {};
|
||||
const client = stationCode ? ndmClient : userClient;
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const endpoint = `${prefix}/api/ndm/anyTenant/snapStatus`;
|
||||
if (method === 'get') {
|
||||
const resp = await client.get<boolean>(endpoint, { signal });
|
||||
const data = unwrapResponse(resp);
|
||||
return data;
|
||||
} else {
|
||||
const resp = await client.post<boolean>(endpoint, doSnap, { signal });
|
||||
const data = unwrapResponse(resp);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user