feat: 添加视频服务器双机热备状态
This commit is contained in:
@@ -1,5 +1,26 @@
|
||||
import { ndmClient, userClient, type MediaServerStatus, type SendRtpInfo, type Station } from '@/apis';
|
||||
import { unwrapResponse } from '@/utils';
|
||||
import { ndmClient, userClient, type HighAvailable, type MediaServerStatus, type SendRtpInfo, type Station } from '@/apis';
|
||||
import { unwrapNullableResponse, unwrapResponse } from '@/utils';
|
||||
import destr from 'destr';
|
||||
|
||||
// {
|
||||
// "code": 0,
|
||||
// "data": "{pyip:\"10.18.128.14\",vip:\"10.18.128.6\",changeDate:\"2026-03-23 15:55:00\"}",
|
||||
// "msg": "ok",
|
||||
// "path": null,
|
||||
// "extra": null,
|
||||
// "timestamp": "1774421387908",
|
||||
// "errorMsg": "",
|
||||
// "isSuccess": true
|
||||
// }
|
||||
export const getHighAvailableApi = async (options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||
const { stationCode, signal } = options ?? {};
|
||||
const client = stationCode ? ndmClient : userClient;
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const endpoint = `${prefix}/api/ndm/ndmServiceAvailable/highAvailable/get`;
|
||||
const resp = await client.get<string | null>(endpoint, { signal });
|
||||
const data = unwrapNullableResponse(resp);
|
||||
return destr<HighAvailable | null>(data);
|
||||
};
|
||||
|
||||
export const getAllPushApi = async (options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||
const { stationCode, signal } = options ?? {};
|
||||
|
||||
Reference in New Issue
Block a user