Compare commits

...

52 Commits

Author SHA1 Message Date
yangsy
bd7238a7f1 style: code state 2025-12-11 01:30:37 +08:00
yangsy
6c7897198c fix: alarm-query and secutiryBox switch states 2025-12-11 01:30:11 +08:00
yangsy
15a9f68db7 fix(device-alarm-history-diag-card): throw error if deviceId is undefined/null 2025-12-08 11:15:45 +08:00
yangsy
70f52eb3bb fix(use-device-selection): default select to Camera 2025-12-08 11:10:20 +08:00
yangsy
c189f79aa4 fix(security-box-info-card): access status 2025-12-07 11:05:44 +08:00
yangsy
8e9bd75067 feat: sync-camera-result-modal 2025-12-03 16:48:33 +08:00
yangsy
a215f2e391 feat: multiselect stations to export device icmp state 2025-12-03 10:44:14 +08:00
yangsy
e19fcf79a6 chore: vite proxy 2025-12-03 10:43:23 +08:00
yangsy
54591f401f refactor: remove console.log 2025-12-01 15:33:47 +08:00
yangsy
2116631ba6 fix: avoid mutation error from interrupting query 2025-12-01 15:22:50 +08:00
yangsy
b4e2926f08 fix: sync camera & channels 2025-12-01 15:20:11 +08:00
yangsy
168d11c71b style 2025-12-01 14:43:58 +08:00
yangsy
b0c0b88091 fix: /syncCamera 2025-12-01 14:43:42 +08:00
yangsy
f7d1d2d44c fix(security-box-info-card): access status 2025-12-01 11:30:08 +08:00
yangsy
de723dce00 fix: removeCameraIgnoreApi 2025-11-29 23:18:35 +08:00
yangsy
f0ab42613b refactor(enums): Tab order of DeviceTree 2025-11-28 15:03:22 +08:00
yangsy
4272cd90de fix: wait for 5s after syncCamera then refetch polling 2025-11-28 14:41:48 +08:00
yangsy
fb7657f99c feat: fold/expand menu 2025-11-28 00:13:05 +08:00
yangsy
7f9d868643 feat(statioin-page): action button group 2025-11-27 17:59:39 +08:00
yangsy
f278a690c6 refactor: move /helper 2025-11-27 16:01:50 +08:00
yangsy
d4eade65c4 refactor(station): inrerface Station 2025-11-27 15:59:15 +08:00
yangsy
dec1c4ea17 refactor(api): ndm-record-check 2025-11-27 11:49:57 +08:00
yangsy
68052f7630 feat: add alarm-host 2025-11-26 16:28:05 +08:00
yangsy
8fa904dfc0 style(station-card) 2025-11-26 15:52:48 +08:00
yangsy
05297b22cb refactor: remove /dashboard, migrate icmp-export 2025-11-26 15:52:42 +08:00
yangsy
41c9b4c5ed refactor: simplify switch port speed calculation 2025-11-26 13:38:22 +08:00
yangsy
7e007e68cf fix(user-client): no action when response 404 2025-11-26 13:17:33 +08:00
yangsy
0f578a43f0 style(station-card) 2025-11-26 11:33:47 +08:00
yangsy
68636d13a4 chore: vite proxy config 2025-11-26 10:41:09 +08:00
yangsy
3390f4806a fix(alarm-page): use getTableData if enable realtimeRefresh 2025-11-25 19:25:06 +08:00
yangsy
226d8855fd feat(alarm-page): ignore camera 2025-11-25 19:05:55 +08:00
yangsy
0e1fb75d2c fix(utils): RequestClient delete method params 2025-11-25 19:03:28 +08:00
yangsy
ffdc8b0d4b feat(alarm-page): realtime refresh 2025-11-25 17:38:16 +08:00
yangsy
3616276460 fix(device-params-config): resetMonitorScheduleApi 2025-11-25 16:57:25 +08:00
yangsy
5e464f6e80 refactor(stores): simplify stores 2025-11-25 16:51:20 +08:00
yangsy
2dd599d2eb feat(version-check): verify user token 2025-11-22 10:32:50 +08:00
yangsy
a486f76aaf refactor: reorganize files 2025-11-22 01:46:16 +08:00
yangsy
00a961c346 fix(alarm-page): disable snapshot preview 2025-11-20 17:13:51 +08:00
yangsy
b5b0c5448d feat(alarm-page): camera snapshot 2025-11-20 16:51:31 +08:00
yangsy
9b3c5c9fc3 format: remove useless console.log 2025-11-20 11:19:56 +08:00
yangsy
3ede757843 fix(station-page): keep polling when open modal 2025-11-20 11:13:40 +08:00
yangsy
c5c363d32c refactor: reorganize files 2025-11-20 10:58:19 +08:00
yangsy
cbb51aa501 refactor(security-box-circuit-card): probe after turnStatus 2025-11-19 17:34:11 +08:00
yangsy
4ab33d2021 feat(device-header-card): probe button 2025-11-19 16:31:54 +08:00
yangsy
fa9b435a0f feat(call-log-page): add searchFields 2025-11-19 14:37:18 +08:00
yangsy
dfbdc6d828 fix(version-check): clear localStorage if need 2025-11-19 13:54:41 +08:00
yangsy
5fa668acd3 fix(version-check): check version and buildTime 2025-11-19 12:17:06 +08:00
yangsy
2f06054e66 refactor(stores): rename 2025-11-19 11:59:31 +08:00
yangsy
df3888d8b5 feat(components): station-card 2025-11-19 11:55:51 +08:00
yangsy
91a665695e feat(pages): separate station-page from dashboard-page 2025-11-19 11:55:13 +08:00
yangsy
0c3e9c24f9 feat(pages): call-log-page 2025-11-18 20:22:26 +08:00
yangsy
799a5af857 fix(vimp-log-page): resetSearchFields 2025-11-18 17:38:13 +08:00
227 changed files with 3945 additions and 2268 deletions

3
.env
View File

@@ -15,5 +15,8 @@ VITE_LAMP_PASSWORD = fjoc(1KHP(Ls&Bje)C
# 如果 Authorization 已存在则会直接采用, 否则会根据 clientId 和 clientSecret 生成
VITE_LAMP_AUTHORIZATION = Y3VlZGVzX2FkbWluOmN1ZWRlc19hZG1pbl9zZWNyZXQ=
# 当需要重置localStorage时, 修改此变量
VITE_STORAGE_VERSION = 2
# 调试授权码
VITE_DEBUG_CODE = ndm_debug

View File

@@ -13,13 +13,13 @@ const GlobalFeedback = defineComponent({
<script setup lang="ts">
import { dateZhCN, NConfigProvider, NDialogProvider, NLoadingBarProvider, NMessageProvider, NNotificationProvider, useDialog, useLoadingBar, useMessage, useNotification, zhCN } from 'naive-ui';
import { defineComponent } from 'vue';
import { useThemeStore } from '@/stores/theme';
import { useSettingStore } from '@/stores';
import { storeToRefs } from 'pinia';
import { VueQueryDevtools } from '@tanstack/vue-query-devtools';
import { useVersionCheckQuery } from './composables/query';
const themeStore = useThemeStore();
const { themeMode } = storeToRefs(themeStore);
const settingStore = useSettingStore();
const { themeMode } = storeToRefs(settingStore);
useVersionCheckQuery();
</script>

2
src/apis/client/index.ts Normal file
View File

@@ -0,0 +1,2 @@
export * from './ndm-client';
export * from './user-client';

View File

@@ -1,44 +1,8 @@
import { useUserStore } from '@/stores';
import { getAppEnvConfig, RequestClient } from '@/utils';
import type { AxiosError } from 'axios';
import { Request } from '@/utils/request';
import { useUserStore } from '@/stores/user';
import { getAppEnvConfig } from '@/utils/env';
import router from '@/router';
export const userClient = new Request({
requestInterceptor: (config) => {
const userStore = useUserStore();
const { lampAuthorization, lampClientId, lampClientSecret } = getAppEnvConfig();
const newAuthorization = window.btoa(`${lampClientId}:${lampClientSecret}`);
const authorization = lampAuthorization.trim() !== '' ? lampAuthorization : newAuthorization;
config.headers.set('accept-language', 'zh-CN,zh;q=0.9');
config.headers.set('accept', 'application/json, text/plain, */*');
config.headers.set('Applicationid', '');
config.headers.set('Tenantid', '1');
config.headers.set('Authorization', authorization);
config.headers.set('token', userStore.userLoginResult?.token ?? '');
return config;
},
responseInterceptor: (response) => {
return response;
},
responseErrorInterceptor: (error) => {
const err = error as AxiosError;
if (err.response?.status === 401) {
window.$message.error('登录超时,请重新登录');
const userStore = useUserStore();
userStore.resetStore();
router.push('/login');
}
if (err.response?.status === 404) {
router.push('/404');
}
return Promise.reject(error);
},
});
export const ndmClient = new Request({
export const ndmClient = new RequestClient({
requestInterceptor: async (config) => {
const userStore = useUserStore();
const { lampAuthorization, lampClientId, lampClientSecret } = getAppEnvConfig();

View File

@@ -0,0 +1,33 @@
import router from '@/router';
import { useUserStore } from '@/stores';
import { getAppEnvConfig, RequestClient } from '@/utils';
import type { AxiosError } from 'axios';
export const userClient = new RequestClient({
requestInterceptor: (config) => {
const userStore = useUserStore();
const { lampAuthorization, lampClientId, lampClientSecret } = getAppEnvConfig();
const newAuthorization = window.btoa(`${lampClientId}:${lampClientSecret}`);
const authorization = lampAuthorization.trim() !== '' ? lampAuthorization : newAuthorization;
config.headers.set('accept-language', 'zh-CN,zh;q=0.9');
config.headers.set('accept', 'application/json, text/plain, */*');
config.headers.set('Applicationid', '');
config.headers.set('Tenantid', '1');
config.headers.set('Authorization', authorization);
config.headers.set('token', userStore.userLoginResult?.token ?? '');
return config;
},
responseInterceptor: (response) => {
return response;
},
responseErrorInterceptor: (error) => {
const err = error as AxiosError;
if (err.response?.status === 401) {
window.$message.error('登录超时,请重新登录');
const userStore = useUserStore();
userStore.resetStore();
router.push('/login');
}
return Promise.reject(error);
},
});

View File

@@ -0,0 +1,6 @@
export * from './ndm-camera-diag-info';
export * from './ndm-decoder-diag-info';
export * from './ndm-nvr-diag-info';
export * from './ndm-security-box-diag-info';
export * from './ndm-server-diag-info';
export * from './ndm-switch-diag-info';

View File

@@ -10,12 +10,12 @@ export interface NdmSwitchDiagInfo {
}
export interface NdmSwitchPortInfo {
flow: number;
inBytes: number;
inFlow: number;
lastInBytes: number;
lastOutBytes: number;
outBytes: number;
flow: number;
inFlow: number;
outFlow: number;
portName: string;
upDown: number;

View File

@@ -0,0 +1,2 @@
export * from './diag';
export * from './station';

View File

@@ -0,0 +1,18 @@
import type { DeviceType } from '@/enums';
export interface StationAlarmCounts {
[DeviceType.AlarmHost]: number;
[DeviceType.Camera]: number;
[DeviceType.Decoder]: number;
[DeviceType.Keyboard]: number;
[DeviceType.MediaServer]: number;
[DeviceType.Nvr]: number;
[DeviceType.SecurityBox]: number;
[DeviceType.Switch]: number;
[DeviceType.VideoServer]: number;
unclassified: number;
}
export interface LineAlarmCounts {
[stationCode: string]: StationAlarmCounts;
}

View File

@@ -1,4 +1,5 @@
import type {
NdmAlarmHostResultVO,
NdmCameraResultVO,
NdmDecoderResultVO,
NdmKeyboardResultVO,
@@ -7,10 +8,11 @@ import type {
NdmSecurityBoxResultVO,
NdmSwitchResultVO,
NdmVideoServerResultVO,
} from '@/apis/models';
import type { DeviceType } from '@/enums/device-type';
} from '@/apis';
import type { DeviceType } from '@/enums';
export interface StationDevices {
[DeviceType.AlarmHost]: NdmAlarmHostResultVO[];
[DeviceType.Camera]: NdmCameraResultVO[];
[DeviceType.Decoder]: NdmDecoderResultVO[];
[DeviceType.Keyboard]: NdmKeyboardResultVO[];

View File

@@ -1,2 +1,3 @@
export * from './alarm';
export * from './device';
export * from './station';

View File

@@ -2,5 +2,5 @@ export interface Station {
code: string;
name: string;
online: boolean;
ip?: string;
ip: string;
}

3
src/apis/domain/index.ts Normal file
View File

@@ -0,0 +1,3 @@
export * from './biz';
export * from './user';
export * from './version';

View File

@@ -0,0 +1 @@
export * from './version-info';

View File

@@ -1,6 +0,0 @@
export * from './diag-info/ndm-camera-diag-info';
export * from './diag-info/ndm-decoder-diag-info';
export * from './diag-info/ndm-nvr-diag-info';
export * from './diag-info/ndm-security-box-diag-info';
export * from './diag-info/ndm-server-diag-info';
export * from './diag-info/ndm-switch-diag-info';

4
src/apis/index.ts Normal file
View File

@@ -0,0 +1,4 @@
export * from './client';
export * from './domain';
export * from './model';
export * from './request';

View File

@@ -0,0 +1 @@
export * from './ndm-alarm-host';

View File

@@ -0,0 +1,38 @@
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
export interface NdmAlarmHost extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmAlarmHostResultVO = Partial<NdmAlarmHost>;
export type NdmAlarmHostSaveVO = Partial<Omit<NdmAlarmHost, ReduceForSaveVO>>;
export type NdmAlarmHostUpdateVO = Partial<Omit<NdmAlarmHost, ReduceForUpdateVO>>;
export type NdmAlarmHostPageQuery = Partial<Omit<NdmAlarmHost, ReduceForPageQuery>>;

View File

@@ -0,0 +1,19 @@
import type { NdmAlarmHost } from './alarm';
import type { NdmSecurityBox, NdmSwitch } from './other';
import type { NdmNvr } from './storage';
import type { NdmCamera, NdmDecoder, NdmKeyboard, NdmMediaServer, NdmVideoServer } from './video';
export type NdmDeviceVO = NdmAlarmHost | NdmCamera | NdmDecoder | NdmKeyboard | NdmMediaServer | NdmNvr | NdmSecurityBox | NdmSwitch | NdmVideoServer;
export type NdmDeviceResultVO = Partial<NdmDeviceVO>;
export type NdmServerVO = NdmMediaServer | NdmVideoServer;
export type NdmServerResultVO = Partial<NdmServerVO>;
export * from './alarm';
export * from './log';
export * from './other';
export * from './storage';
export * from './upper-ndm';
export * from './video';

View File

@@ -0,0 +1,6 @@
export * from './ndm-call-log';
export * from './ndm-device-alarm-log';
export * from './ndm-icmp-log';
export * from './ndm-record-check';
export * from './ndm-snmp-log';
export * from './ndm-vimp-log';

View File

@@ -0,0 +1,17 @@
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
export interface NdmCallLog extends BaseModel {
sourceGbId: string;
targetGbId: string;
method: string;
messageType: string;
cmdType: string;
}
export type NdmCallLogResultVO = Partial<NdmCallLog>;
export type NdmCallLogSaveVO = Partial<Omit<NdmCallLog, ReduceForSaveVO>>;
export type NdmCallLogUpdateVO = Partial<Omit<NdmCallLog, ReduceForUpdateVO>>;
export type NdmCallLogPageQuery = Partial<Omit<NdmCallLog, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmDeviceAlarmLogVO extends BaseModel {
export interface NdmDeviceAlarmLog extends BaseModel {
alarmNo: string;
alarmDate: string;
faultLocation: string;
@@ -18,10 +18,10 @@ export interface NdmDeviceAlarmLogVO extends BaseModel {
stationCode: string;
}
export type NdmDeviceAlarmLogResultVO = Partial<NdmDeviceAlarmLogVO>;
export type NdmDeviceAlarmLogResultVO = Partial<NdmDeviceAlarmLog>;
export type NdmDeviceAlarmLogSaveVO = Partial<Omit<NdmDeviceAlarmLogVO, ReduceForSaveVO>>;
export type NdmDeviceAlarmLogSaveVO = Partial<Omit<NdmDeviceAlarmLog, ReduceForSaveVO>>;
export type NdmDeviceAlarmLogUpdateVO = Partial<Omit<NdmDeviceAlarmLogVO, ReduceForUpdateVO>>;
export type NdmDeviceAlarmLogUpdateVO = Partial<Omit<NdmDeviceAlarmLog, ReduceForUpdateVO>>;
export type NdmDeviceAlarmLogPageQuery = Partial<Omit<NdmDeviceAlarmLogVO, ReduceForPageQuery>>;
export type NdmDeviceAlarmLogPageQuery = Partial<Omit<NdmDeviceAlarmLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,16 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmIcmpLog extends BaseModel {
deviceId: string;
name: string;
ipAddress: string;
deviceStatus: string;
}
export type NdmIcmpLogResultVO = Partial<NdmIcmpLog>;
export type NdmIcmpLogSaveVO = Partial<Omit<NdmIcmpLog, ReduceForSaveVO>>;
export type NdmIcmpLogUpdateVO = Partial<Omit<NdmIcmpLog, ReduceForUpdateVO>>;
export type NdmIcmpLogPageQuery = Partial<Omit<NdmIcmpLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,8 @@
export interface NdmRecordCheck {
gbCode: string;
parentGbCode: string;
name: string;
ipAddress: string;
diagInfo: string;
checkDate: string;
}

View File

@@ -0,0 +1,17 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmSnmpLog extends BaseModel {
deviceId: string;
name: string;
ipAddress: string;
diagInfo: string;
deviceType: string;
}
export type NdmSnmpLogResultVO = Partial<NdmSnmpLog>;
export type NdmSnmpLogSaveVO = Partial<Omit<NdmSnmpLog, ReduceForSaveVO>>;
export type NdmSnmpLogUpdateVO = Partial<Omit<NdmSnmpLog, ReduceForUpdateVO>>;
export type NdmSnmpLogPageQuery = Partial<Omit<NdmSnmpLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,25 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmVimpLog extends BaseModel {
requestIp: string;
description: string;
classPath: string;
methodName: string;
startTime: string;
endTime: string;
consumedTime: string;
params: string;
result: string;
httpMethod: string;
userId: string;
logType: number;
targetCode: string;
}
export type NdmVimpLogResultVO = Partial<NdmVimpLog>;
export type NdmVimpLogSaveVO = Partial<Omit<NdmVimpLog, ReduceForSaveVO>>;
export type NdmVimpLogUpdateVO = Partial<Omit<NdmVimpLog, ReduceForUpdateVO>>;
export type NdmVimpLogPageQuery = Partial<Omit<NdmVimpLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,2 @@
export * from './ndm-security-box';
export * from './ndm-switch';

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmSecurityBoxVO extends BaseModel {
export interface NdmSecurityBox extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -25,10 +25,10 @@ export interface NdmSecurityBoxVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmSecurityBoxResultVO = Partial<NdmSecurityBoxVO>;
export type NdmSecurityBoxResultVO = Partial<NdmSecurityBox>;
export type NdmSecurityBoxSaveVO = Partial<Omit<NdmSecurityBoxVO, ReduceForSaveVO>>;
export type NdmSecurityBoxSaveVO = Partial<Omit<NdmSecurityBox, ReduceForSaveVO>>;
export type NdmSecurityBoxUpdateVO = Partial<Omit<NdmSecurityBoxVO, ReduceForUpdateVO>>;
export type NdmSecurityBoxUpdateVO = Partial<Omit<NdmSecurityBox, ReduceForUpdateVO>>;
export type NdmSecurityBoxPageQuery = Partial<Omit<NdmSecurityBoxVO, ReduceForPageQuery>>;
export type NdmSecurityBoxPageQuery = Partial<Omit<NdmSecurityBox, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmSwitchVO extends BaseModel {
export interface NdmSwitch extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -25,10 +25,10 @@ export interface NdmSwitchVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmSwitchResultVO = Partial<NdmSwitchVO>;
export type NdmSwitchResultVO = Partial<NdmSwitch>;
export type NdmSwitchSaveVO = Partial<Omit<NdmSwitchVO, ReduceForSaveVO>>;
export type NdmSwitchSaveVO = Partial<Omit<NdmSwitch, ReduceForSaveVO>>;
export type NdmSwitchUpdateVO = Partial<Omit<NdmSwitchVO, ReduceForUpdateVO>>;
export type NdmSwitchUpdateVO = Partial<Omit<NdmSwitch, ReduceForUpdateVO>>;
export type NdmSwitchPageQuery = Partial<Omit<NdmSwitchVO, ReduceForPageQuery>>;
export type NdmSwitchPageQuery = Partial<Omit<NdmSwitch, ReduceForPageQuery>>;

View File

@@ -0,0 +1 @@
export * from './ndm-nvr';

View File

@@ -0,0 +1,45 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmNvr extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
onvifPort: number;
onvifUsername: string;
onvifPassword: string;
onvifMajorIndex: number;
onvifMinorIndex: number;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
recordCheckEnabled: boolean;
clusterList: string;
}
export type NdmNvrResultVO = Partial<NdmNvr>;
export type NdmNvrSaveVO = Partial<Omit<NdmNvr, ReduceForSaveVO>>;
export type NdmNvrUpdateVO = Partial<Omit<NdmNvr, ReduceForUpdateVO>>;
export type NdmNvrPageQuery = Partial<Omit<NdmNvr, ReduceForPageQuery>>;

View File

@@ -0,0 +1,2 @@
export * from './sync-camera-result';
export * from './sync-camera-result-detail';

View File

@@ -0,0 +1,6 @@
export interface SyncCameraResultDetail {
name: string;
deviceId: string;
ipAddress: string;
gbCode: string;
}

View File

@@ -0,0 +1,10 @@
import type { SyncCameraResultDetail } from './sync-camera-result-detail';
export interface SyncCameraResult {
stationCode: string;
startTime: string;
endTime: string;
insertList: SyncCameraResultDetail[];
updateList: SyncCameraResultDetail[];
deleteList: SyncCameraResultDetail[];
}

View File

@@ -0,0 +1,6 @@
export * from './ndm-camera';
export * from './ndm-camera-ignore';
export * from './ndm-decoder';
export * from './ndm-keyboard';
export * from './ndm-media-server';
export * from './ndm-video-server';

View File

@@ -0,0 +1,14 @@
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
export interface NdmCameraIgnore extends BaseModel {
deviceId: string;
ignoreType: string;
}
export type NdmCameraIgnoreResultVO = Partial<NdmCameraIgnore>;
export type NdmCameraIgnoreSaveVO = Partial<Omit<NdmCameraIgnore, ReduceForSaveVO>>;
export type NdmCameraIgnoreUpdateVO = Partial<Omit<NdmCameraIgnore, ReduceForUpdateVO>>;
export type NdmCameraIgnorePageQuery = Partial<Omit<NdmCameraIgnore, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmCameraVO extends BaseModel {
export interface NdmCamera extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -35,10 +35,10 @@ export interface NdmCameraVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmCameraResultVO = Partial<NdmCameraVO>;
export type NdmCameraResultVO = Partial<NdmCamera>;
export type NdmCameraSaveVO = Partial<Omit<NdmCameraVO, ReduceForSaveVO>>;
export type NdmCameraSaveVO = Partial<Omit<NdmCamera, ReduceForSaveVO>>;
export type NdmCameraUpdateVO = Partial<Omit<NdmCameraVO, ReduceForUpdateVO>>;
export type NdmCameraUpdateVO = Partial<Omit<NdmCamera, ReduceForUpdateVO>>;
export type NdmCameraPageQuery = Partial<Omit<NdmCameraVO, ReduceForPageQuery>>;
export type NdmCameraPageQuery = Partial<Omit<NdmCamera, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmDecoderVO extends BaseModel {
export interface NdmDecoder extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -32,10 +32,10 @@ export interface NdmDecoderVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmDecoderResultVO = Partial<NdmDecoderVO>;
export type NdmDecoderResultVO = Partial<NdmDecoder>;
export type NdmDecoderSaveVO = Partial<Omit<NdmDecoderVO, ReduceForSaveVO>>;
export type NdmDecoderSaveVO = Partial<Omit<NdmDecoder, ReduceForSaveVO>>;
export type NdmDecoderUpdateVO = Partial<Omit<NdmDecoderVO, ReduceForUpdateVO>>;
export type NdmDecoderUpdateVO = Partial<Omit<NdmDecoder, ReduceForUpdateVO>>;
export type NdmDecoderPageQuery = Partial<Omit<NdmDecoderVO, ReduceForPageQuery>>;
export type NdmDecoderPageQuery = Partial<Omit<NdmDecoder, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmKeyboardVO extends BaseModel {
export interface NdmKeyboard extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -25,10 +25,10 @@ export interface NdmKeyboardVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmKeyboardResultVO = Partial<NdmKeyboardVO>;
export type NdmKeyboardResultVO = Partial<NdmKeyboard>;
export type NdmKeyboardSaveVO = Partial<Omit<NdmKeyboardVO, ReduceForSaveVO>>;
export type NdmKeyboardSaveVO = Partial<Omit<NdmKeyboard, ReduceForSaveVO>>;
export type NdmKeyboardUpdateVO = Partial<Omit<NdmKeyboardVO, ReduceForUpdateVO>>;
export type NdmKeyboardUpdateVO = Partial<Omit<NdmKeyboard, ReduceForUpdateVO>>;
export type NdmKeyboardPageQuery = Partial<Omit<NdmKeyboardVO, ReduceForPageQuery>>;
export type NdmKeyboardPageQuery = Partial<Omit<NdmKeyboard, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmMediaServerVO extends BaseModel {
export interface NdmMediaServer extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -29,10 +29,10 @@ export interface NdmMediaServerVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmMediaServerResultVO = Partial<NdmMediaServerVO>;
export type NdmMediaServerResultVO = Partial<NdmMediaServer>;
export type NdmMediaServerSaveVO = Partial<Omit<NdmMediaServerVO, ReduceForSaveVO>>;
export type NdmMediaServerSaveVO = Partial<Omit<NdmMediaServer, ReduceForSaveVO>>;
export type NdmMediaServerUpdateVO = Partial<Omit<NdmMediaServerVO, ReduceForUpdateVO>>;
export type NdmMediaServerUpdateVO = Partial<Omit<NdmMediaServer, ReduceForUpdateVO>>;
export type NdmMediaServerPageQuery = Partial<Omit<NdmMediaServerVO, ReduceForPageQuery>>;
export type NdmMediaServerPageQuery = Partial<Omit<NdmMediaServer, ReduceForPageQuery>>;

View File

@@ -1,6 +1,6 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface NdmVideoServerVO extends BaseModel {
export interface NdmVideoServer extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
@@ -29,10 +29,10 @@ export interface NdmVideoServerVO extends BaseModel {
snmpEnabled: boolean;
}
export type NdmVideoServerResultVO = Partial<NdmVideoServerVO>;
export type NdmVideoServerResultVO = Partial<NdmVideoServer>;
export type NdmVideoServerSaveVO = Partial<Omit<NdmVideoServerVO, ReduceForSaveVO>>;
export type NdmVideoServerSaveVO = Partial<Omit<NdmVideoServer, ReduceForSaveVO>>;
export type NdmVideoServerUpdateVO = Partial<Omit<NdmVideoServerVO, ReduceForUpdateVO>>;
export type NdmVideoServerUpdateVO = Partial<Omit<NdmVideoServer, ReduceForUpdateVO>>;
export type NdmVideoServerPageQuery = Partial<Omit<NdmVideoServerVO, ReduceForPageQuery>>;
export type NdmVideoServerPageQuery = Partial<Omit<NdmVideoServer, ReduceForPageQuery>>;

View File

@@ -0,0 +1,4 @@
export * from './entity';
export * from './nvr';
export * from './verify';
export * from './vimp';

View File

@@ -0,0 +1,15 @@
export interface ClientChannel {
code: string;
name: string;
manufacture: string;
model: string;
owner: string;
civilCode: string;
block: string;
address: string;
parental: number;
parentId: string;
status: number;
longitude: number;
latitude: number;
}

View File

@@ -0,0 +1,3 @@
export * from './client-channel';
export * from './record-info';
export * from './record-item';

View File

@@ -0,0 +1,12 @@
import type { RecordItem } from './record-item';
export interface RecordInfo {
deviceId: string;
channelId: string;
sn: string;
name: string;
sumNum: number;
count: number;
lastTime: number;
recordList: RecordItem[];
}

View File

@@ -0,0 +1,4 @@
export interface RecordItem {
startTime: string;
endTime: string;
}

View File

@@ -0,0 +1 @@
export * from './verify-server';

View File

@@ -0,0 +1,7 @@
export interface VerifyServer {
name: string;
ipAddress: string;
stationCode: string;
verifyUrl: string;
onlineState: boolean;
}

View File

@@ -0,0 +1 @@
export * from './snap-result';

View File

@@ -0,0 +1,5 @@
export interface SnapResult {
absoluteFilePath: string;
path: string;
url: string;
}

View File

@@ -1,4 +1,3 @@
export * from './base';
export * from './device';
export * from './biz';
export * from './system';
export * from './user';

View File

@@ -0,0 +1,17 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
export interface DefParameter extends BaseModel {
key: string;
value: string;
name: string;
remarks: string;
paramType: string;
}
export type DefParameterResultVO = Partial<DefParameter>;
export type DefParameterSaveVO = Partial<Omit<DefParameter, ReduceForSaveVO>>;
export type DefParameterUpdateVO = Partial<Omit<DefParameter, ReduceForUpdateVO>>;
export type DefParameterPageQuery = Partial<Omit<DefParameter, ReduceForPageQuery>>;

View File

@@ -1,29 +0,0 @@
import type { NdmSecurityBoxVO } from './other/ndm-security-box';
import type { NdmSwitchVO } from './other/ndm-switch';
import type { NdmNvrVO } from './storage/ndm-nvr';
import type { NdmCameraVO } from './video/ndm-camera';
import type { NdmDecoderVO } from './video/ndm-decoder';
import type { NdmKeyboardVO } from './video/ndm-keyboard';
import type { NdmMediaServerVO } from './video/ndm-media-server';
import type { NdmVideoServerVO } from './video/ndm-video-server';
export * from './log/ndm-device-alarm-log';
export * from './log/ndm-icmp-log';
export * from './log/ndm-snmp-log';
export * from './log/ndm-vimp-log';
export * from './other/ndm-security-box';
export * from './other/ndm-switch';
export * from './storage/ndm-nvr';
export * from './video/ndm-camera';
export * from './video/ndm-decoder';
export * from './video/ndm-keyboard';
export * from './video/ndm-media-server';
export * from './video/ndm-video-server';
export type NdmDeviceVO = NdmSecurityBoxVO | NdmSwitchVO | NdmNvrVO | NdmCameraVO | NdmDecoderVO | NdmKeyboardVO | NdmMediaServerVO | NdmVideoServerVO;
export type NdmDeviceResultVO = Partial<NdmDeviceVO>;
export type NdmServerVO = NdmMediaServerVO | NdmVideoServerVO;
export type NdmServerResultVO = Partial<NdmServerVO>;

View File

@@ -1,16 +0,0 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
export interface NdmIcmpLogVO extends BaseModel {
deviceId: string;
name: string;
ipAddress: string;
deviceStatus: string;
}
export type NdmIcmpLogResultVO = Partial<NdmIcmpLogVO>;
export type NdmIcmpLogSaveVO = Partial<Omit<NdmIcmpLogVO, ReduceForSaveVO>>;
export type NdmIcmpLogUpdateVO = Partial<Omit<NdmIcmpLogVO, ReduceForUpdateVO>>;
export type NdmIcmpLogPageQuery = Partial<Omit<NdmIcmpLogVO, ReduceForPageQuery>>;

View File

@@ -1,17 +0,0 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
export interface NdmSnmpLogVO extends BaseModel {
deviceId: string;
name: string;
ipAddress: string;
diagInfo: string;
deviceType: string;
}
export type NdmSnmpLogResultVO = Partial<NdmSnmpLogVO>;
export type NdmSnmpLogSaveVO = Partial<Omit<NdmSnmpLogVO, ReduceForSaveVO>>;
export type NdmSnmpLogUpdateVO = Partial<Omit<NdmSnmpLogVO, ReduceForUpdateVO>>;
export type NdmSnmpLogPageQuery = Partial<Omit<NdmSnmpLogVO, ReduceForPageQuery>>;

View File

@@ -1,25 +0,0 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
export interface NdmVimpLogVO extends BaseModel {
requestIp: string;
description: string;
classPath: string;
methodName: string;
startTime: string;
endTime: string;
consumedTime: string;
params: string;
result: string;
httpMethod: string;
userId: string;
logType: number;
targetCode: string;
}
export type NdmVimpLogResultVO = Partial<NdmVimpLogVO>;
export type NdmVimpLogSaveVO = Partial<Omit<NdmVimpLogVO, ReduceForSaveVO>>;
export type NdmVimpLogUpdateVO = Partial<Omit<NdmVimpLogVO, ReduceForUpdateVO>>;
export type NdmVimpLogPageQuery = Partial<Omit<NdmVimpLogVO, ReduceForPageQuery>>;

View File

@@ -1,133 +0,0 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../../base';
export interface NdmNvrVO extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
onvifPort: number;
onvifUsername: string;
onvifPassword: string;
onvifMajorIndex: number;
onvifMinorIndex: number;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
recordCheckEnabled: boolean;
clusterList: string;
}
export type NdmNvrResultVO = Partial<NdmNvrVO>;
export type NdmNvrSaveVO = Partial<Omit<NdmNvrVO, ReduceForSaveVO>>;
export type NdmNvrUpdateVO = Partial<Omit<NdmNvrVO, ReduceForUpdateVO>>;
export type NdmNvrPageQuery = Partial<Omit<NdmNvrVO, ReduceForPageQuery>>;
export interface RecordSum {
code: string;
recordList: NdmRecordCheck[];
channel: ClientChannel;
availableRecordList: UnixRecordItem[];
unavailableRecordList: UnixRecordItem[];
}
export interface NdmRecordCheck extends BaseModel {
gbCode: string;
parentGbCode: string;
name: string;
ipAddress: string;
diagInfo: string; // RecordInfo
checkDate: string;
}
export interface ClientChannel {
code: string;
name: string;
manufacture: string;
model: string;
owner: string;
civilCode: string;
block: string;
address: string;
parental: number;
parentId: string;
status: number;
longitude: number;
latitude: number;
}
export interface RecordInfo {
deviceId: string;
channelId: string;
sn: string;
name: string;
sumNum: number;
count: number;
lastTime: number;
recordList: RecordItem[];
}
export interface RecordItem {
startTime: string;
endTime: string;
}
export interface UnixRecordItem {
startTime: number;
endTime: number;
}
export interface QueryGbRecordBody {
code: string;
start: string;
end: string;
}
export interface QueryGbDeviceBody {
code: string;
time: string;
}
export interface QueryRecordCheckBody {
parentId: string;
start: string;
end: string;
}
export interface QueryReloadCheckBody {
code: string;
name: string;
manufacture: string;
model: string;
owner: string;
civilCode: string;
block: string;
address: string;
parental: number;
parentId: string;
status: number;
longitude: number;
latitude: number;
dayOffset: number;
}

View File

@@ -1,17 +0,0 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '../base';
export interface DefParameterVO extends BaseModel {
key: string;
value: string;
name: string;
remarks: string;
paramType: string;
}
export type DefParameterResultVO = Partial<DefParameterVO>;
export type DefParameterSaveVO = Partial<Omit<DefParameterVO, ReduceForSaveVO>>;
export type DefParameterUpdateVO = Partial<Omit<DefParameterVO, ReduceForUpdateVO>>;
export type DefParameterPageQuery = Partial<Omit<DefParameterVO, ReduceForPageQuery>>;

View File

@@ -0,0 +1,39 @@
import { detailCameraApi, detailDevoderApi, detailKeyboardAPi, detailMediaServerApi, detailNvr, detailSecurityBoxApi, detailSwitchApi, detailVideoServerApi, type NdmDeviceResultVO } from '@/apis';
import { DeviceType, tryGetDeviceTypeVal } from '@/enums';
export const detailDeviceApi = async (device: NdmDeviceResultVO, options?: { stationCode?: string; signal?: AbortSignal }): Promise<NdmDeviceResultVO | undefined> => {
const { stationCode, signal } = options ?? {};
const { id, deviceType: deviceTypeCode } = device;
if (!id || !deviceTypeCode) {
throw new Error('未知的设备');
}
const deviceTypeVal = tryGetDeviceTypeVal(deviceTypeCode);
if (!deviceTypeVal) {
throw new Error('未知的设备类型');
}
if (deviceTypeVal === DeviceType.Camera) {
return await detailCameraApi(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.Decoder) {
return await detailDevoderApi(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.Keyboard) {
return await detailKeyboardAPi(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.MediaServer) {
return await detailMediaServerApi(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.Nvr) {
return await detailNvr(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.SecurityBox) {
return await detailSecurityBoxApi(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.Switch) {
return await detailSwitchApi(id, { stationCode, signal });
}
if (deviceTypeVal === DeviceType.VideoServer) {
return await detailVideoServerApi(id, { stationCode, signal });
}
return undefined;
};

View File

@@ -0,0 +1,2 @@
export * from './detail-device';
export * from './probe-device';

View File

@@ -0,0 +1,35 @@
import { probeDecoderApi, probeMediaServerApi, probeNvrApi, probeSecurityBoxApi, probeSwitchApi, probeVideoServerApi, type NdmDeviceResultVO } from '@/apis';
import { DeviceType, tryGetDeviceTypeVal } from '@/enums';
export const probeDeviceApi = async (device: NdmDeviceResultVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const deviceType = tryGetDeviceTypeVal(device.deviceType);
const deviceDbId = device.id;
if (!deviceType || !deviceDbId) {
throw new Error('未知的设备');
}
if (deviceType === DeviceType.Decoder) {
await probeDecoderApi([deviceDbId], { stationCode, signal });
return;
}
if (deviceType === DeviceType.MediaServer) {
await probeMediaServerApi([deviceDbId], { stationCode, signal });
return;
}
if (deviceType === DeviceType.Nvr) {
await probeNvrApi([deviceDbId], { stationCode, signal });
return;
}
if (deviceType === DeviceType.SecurityBox) {
await probeSecurityBoxApi([deviceDbId], { stationCode, signal });
return;
}
if (deviceType === DeviceType.Switch) {
await probeSwitchApi([deviceDbId], { stationCode, signal });
return;
}
if (deviceType === DeviceType.VideoServer) {
await probeVideoServerApi([deviceDbId], { stationCode, signal });
return;
}
};

View File

@@ -0,0 +1 @@
export * from './reset-monitor-shedule';

View File

@@ -0,0 +1,13 @@
import { ndmClient, userClient } from '@/apis';
export const resetMonitorScheduleApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmConstant/anyTenant/resetMonitorSchedule`;
const resp = await client.get<void>(endpoint, { signal });
const [err] = resp;
if (err) {
throw err;
}
};

View File

@@ -0,0 +1,12 @@
import { userClient, type VerifyServer } from '@/apis';
export const batchVerifyApi = async (options?: { signal?: AbortSignal }) => {
const { signal } = options ?? {};
const endpoint = '/api/ndm/ndmKeepAlive/batchVerify';
const resp = await userClient.post<VerifyServer[]>(endpoint, {}, { retRaw: true, timeout: 5000, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,3 @@
export * from './batch-verify';
export * from './ndm-icmp-export';
export * from './verify';

View File

@@ -1,13 +1,15 @@
import { ndmClient } from '@/apis/client';
import { userClient } from '@/apis';
export const ndmExportDevices = async (status?: string) => {
export const exportIcmpApi = async (status?: string, options?: { signal?: AbortSignal }) => {
const { signal } = options ?? {};
const endpoint = '/api/ndm/ndmIcmpExport/exportByTemplate';
const body = new URLSearchParams();
body.append('status', status ?? '');
const resp = await ndmClient.post<Blob>(endpoint, body, {
const resp = await userClient.post<Blob>(endpoint, body, {
responseType: 'blob',
retRaw: true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
signal,
});
const [err, data] = resp;
if (err || !data) {

View File

@@ -0,0 +1,13 @@
import { ndmClient, userClient } from '@/apis';
export const verifyApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmKeepAlive/verify`;
const resp = await client.post<void>(endpoint, {}, { timeout: 5000, signal });
const [err] = resp;
if (err) {
throw err;
}
};

View File

@@ -0,0 +1,7 @@
export * from './composed';
export * from './constant';
export * from './icmp';
export * from './log';
export * from './storage';
export * from './other';
export * from './video';

View File

@@ -0,0 +1,6 @@
export * from './ndm-call-log';
export * from './ndm-device-alarm-log';
export * from './ndm-icmp-log';
export * from './ndm-record-check';
export * from './ndm-snmp-log';
export * from './ndm-vimp-log';

View File

@@ -0,0 +1,27 @@
import { ndmClient, userClient, type NdmCallLogPageQuery, type NdmCallLogResultVO, type PageParams, type PageResult } from '@/apis';
export const pageCallLogApi = async (pageQuery: PageParams<NdmCallLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCallLog/page`;
const resp = await client.post<PageResult<NdmCallLogResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const exportCallLogApi = async (pageQuery: PageParams<NdmCallLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCallLog/defaultExportByTemplate`;
const resp = await client.post<Blob>(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,40 @@
import { ndmClient, userClient, type NdmDeviceAlarmLogPageQuery, type NdmDeviceAlarmLogResultVO, type NdmDeviceAlarmLogUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageDeviceAlarmLogApi = async (pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDeviceAlarmLog/page`;
const resp = await client.post<PageResult<NdmDeviceAlarmLogResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateDeviceAlarmLogApi = async (updateVO: NdmDeviceAlarmLogUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDeviceAlarmLog`;
const resp = await client.put<NdmDeviceAlarmLogResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const exportDeviceAlarmLogApi = async (pageQuery: PageParams<NdmDeviceAlarmLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDeviceAlarmLog/defaultExportByTemplate`;
const resp = await client.post<BlobPart>(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,14 @@
import { ndmClient, userClient, type NdmIcmpLogPageQuery, type NdmIcmpLogResultVO, type PageParams, type PageResult } from '@/apis';
export const pageIcmpLogApi = async (pageQuery: PageParams<NdmIcmpLogPageQuery>, options?: { stationCode: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmIcmpLog/page`;
const resp = await client.post<PageResult<NdmIcmpLogResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,59 @@
import { ndmClient, userClient, type ClientChannel, type NdmNvrResultVO, type NdmRecordCheck } from '@/apis';
import dayjs from 'dayjs';
export const getChannelListApi = async (ndmNvr: NdmNvrResultVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/getChannelList`;
const resp = await client.post<ClientChannel[]>(endpoint, { code: ndmNvr.gbCode, time: '' }, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const getRecordCheckApi = async (ndmNvr: NdmNvrResultVO, lastDays: number, gbCodeList: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/getRecordCheckByParentId`;
const endDateTime = dayjs();
const startDateTime = endDateTime.subtract(lastDays, 'day');
const start = startDateTime.format('YYYY-MM-DD');
const end = endDateTime.format('YYYY-MM-DD');
const parentId = ndmNvr.gbCode;
const resp = await client.post<NdmRecordCheck[]>(endpoint, { start, end, parentId, gbCodeList }, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const reloadRecordCheckApi = async (channel: ClientChannel, dayOffset: number, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/reloadRecordCheckByGbId`;
const resp = await client.post<boolean>(endpoint, { ...channel, dayOffset }, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const reloadAllRecordCheckApi = async (dayOffset: number, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmRecordCheck/reloadAllRecordCheck`;
const resp = await client.post<boolean>(endpoint, dayOffset, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,14 @@
import { ndmClient, userClient, type NdmSnmpLogPageQuery, type NdmSnmpLogResultVO, type PageParams, type PageResult } from '@/apis';
export const pageSnmpLogApi = async (pageQuery: PageParams<NdmSnmpLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSnmpLog/page`;
const resp = await client.post<PageResult<NdmSnmpLogResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,27 @@
import { ndmClient, userClient, type NdmVimpLogPageQuery, type NdmVimpLogResultVO, type PageParams, type PageResult } from '@/apis';
export const pageVimpLogApi = async (pageQuery: PageParams<NdmVimpLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmVimpLog/page`;
const resp = await client.post<PageResult<NdmVimpLogResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const exportVimpLogApi = async (pageQuery: PageParams<NdmVimpLogPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmVimpLog/defaultExportByTemplate`;
const resp = await client.post<Blob>(endpoint, pageQuery, { responseType: 'blob', retRaw: true, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,2 @@
export * from './ndm-security-box';
export * from './ndm-switch';

View File

@@ -0,0 +1,78 @@
import { ndmClient, userClient, type NdmSecurityBoxPageQuery, type NdmSecurityBoxResultVO, type NdmSecurityBoxUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageSecurityBoxApi = async (pageQuery: PageParams<NdmSecurityBoxPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/page`;
const resp = await client.post<PageResult<NdmSecurityBoxResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailSecurityBoxApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/detail`;
const resp = await client.get<NdmSecurityBoxResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateSecurityBoxApi = async (updateVO: NdmSecurityBoxUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSecurityBox`;
const resp = await client.put<NdmSecurityBoxResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const probeSecurityBoxApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/probeByIds`;
const resp = await client.post<void>(endpoint, ids, { signal });
const [err] = resp;
if (err) {
throw err;
}
};
export const turnCircuitStatusApi = async (ipAddress: string, circuitIndex: number, status: number, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/turnStatus`;
const resp = await client.post<boolean>(endpoint, { community: 'public', ipAddress, circuit: `${circuitIndex}`, status }, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const rebootSecurityBoxApi = async (ipAddress: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSecurityBox/reboot`;
const resp = await client.post<boolean>(endpoint, { community: 'public', ipAddress }, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,52 @@
import { ndmClient, userClient, type NdmSwitchPageQuery, type NdmSwitchResultVO, type NdmSwitchUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageSwitchApi = async (pageQuery: PageParams<NdmSwitchPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSwitch/page`;
const resp = await client.post<PageResult<NdmSwitchResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailSwitchApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSwitch/detail`;
const resp = await client.get<NdmSwitchResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateSwitchApi = async (updateVO: NdmSwitchUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSwitch`;
const resp = await client.put<NdmSwitchResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const probeSwitchApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmSwitch/probeByIds`;
const resp = await client.post<void>(endpoint, ids, { signal });
const [err] = resp;
if (err) {
throw err;
}
};

View File

@@ -0,0 +1 @@
export * from './ndm-nvr';

View File

@@ -0,0 +1,65 @@
import { ndmClient, userClient, type ClientChannel, type NdmNvrPageQuery, type NdmNvrResultVO, type NdmNvrUpdateVO, type NdmRecordCheck, type PageParams, type PageResult } from '@/apis';
import dayjs from 'dayjs';
export const pageNvrApi = async (pageQuery: PageParams<NdmNvrPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const cient = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmNvr/page`;
const resp = await cient.post<PageResult<NdmNvrResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailNvr = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const cient = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmNvr/detail`;
const resp = await cient.get<NdmNvrResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateNvr = async (updateVO: NdmNvrUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmNvr`;
const resp = await client.put<NdmNvrResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const probeNvrApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmNvr/probeByIds`;
const resp = await client.post<void>(endpoint, ids, { signal });
const [err] = resp;
if (err) {
throw err;
}
};
export const syncNvrChannelsApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmNvr/syncNvrChannels`;
const resp = await client.get<void>(endpoint, { signal });
const [err] = resp;
if (err) {
throw err;
}
};

View File

@@ -0,0 +1,6 @@
export * from './ndm-camera';
export * from './ndm-camera-ignore';
export * from './ndm-decoder';
export * from './ndm-keyboard';
export * from './ndm-media-server';
export * from './ndm-video-server';

View File

@@ -0,0 +1,66 @@
import { ndmClient, userClient, type NdmCameraIgnorePageQuery, type NdmCameraIgnoreResultVO, type NdmCameraIgnoreSaveVO, type NdmCameraIgnoreUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageCameraIgnoreApi = async (pageQuery: PageParams<NdmCameraIgnorePageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCameraIgnore/page`;
const resp = await client.post<PageResult<NdmCameraIgnoreResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailCameraIgnoreApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCameraIgnore/detail`;
const resp = await client.get<NdmCameraIgnoreResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const saveCameraIgnoreApi = async (saveVO: NdmCameraIgnoreSaveVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCameraIgnore`;
const resp = await client.post<NdmCameraIgnoreResultVO>(endpoint, saveVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateCameraIgnoreApi = async (updateVO: NdmCameraIgnoreUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCameraIgnore`;
const resp = await client.put<NdmCameraIgnoreResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const removeCameraIgnoreApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCameraIgnore`;
const resp = await client.delete<boolean>(endpoint, ids, { signal });
const [err, data] = resp;
if (err || data === null) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,64 @@
import { ndmClient, userClient, type NdmCameraPageQuery, type NdmCameraResultVO, type NdmCameraUpdateVO, type PageParams, type PageResult, type SnapResult } from '@/apis';
export const pageCameraApi = async (pageQuery: PageParams<NdmCameraPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCamera/page`;
const resp = await client.post<PageResult<NdmCameraResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailCameraApi = async (id: string, optioins?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = optioins ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCamera/detail`;
const resp = await client.get<NdmCameraResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateCameraApi = async (updateVO: NdmCameraUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCamera`;
const resp = await client.put<NdmCameraResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const getCameraSnapApi = async (deviceId: string, options?: { signal?: AbortSignal }) => {
const { signal } = options ?? {};
const endpoint = '/api/ndm/ndmCamera/getSnapByDeviceId';
const resp = await ndmClient.get<SnapResult>(endpoint, { params: { deviceId }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const syncCameraApi = async (options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmCamera/syncCamera`;
const resp = await client.get<boolean>(endpoint, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,52 @@
import { ndmClient, userClient, type NdmDecoderPageQuery, type NdmDecoderResultVO, type NdmDecoderUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageDecoderApi = async (pageQuery: PageParams<NdmDecoderPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDecoder/page`;
const resp = await client.post<PageResult<NdmDecoderResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailDevoderApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDecoder/detail`;
const resp = await client.get<NdmDecoderResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateDecoderApi = async (updateVO: NdmDecoderUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDecoder`;
const resp = await client.put<NdmDecoderResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const probeDecoderApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmDecoder/probeByIds`;
const resp = await client.post<void>(endpoint, ids, { signal });
const [err] = resp;
if (err) {
throw err;
}
};

View File

@@ -0,0 +1,40 @@
import { ndmClient, userClient, type NdmKeyboardPageQuery, type NdmKeyboardResultVO, type NdmKeyboardUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageKeyboardApi = async (pageQuery: PageParams<NdmKeyboardPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmKeyboard/page`;
const resp = await client.post<PageResult<NdmKeyboardResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailKeyboardAPi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmKeyboard/detail`;
const resp = await client.get<NdmKeyboardResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateKeyboardApi = async (updateVO: NdmKeyboardUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmKeyboard`;
const resp = await client.put<NdmKeyboardResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};

View File

@@ -0,0 +1,52 @@
import { ndmClient, userClient, type NdmMediaServerPageQuery, type NdmMediaServerResultVO, type NdmMediaServerUpdateVO, type PageParams, type PageResult } from '@/apis';
export const pageMediaServerApi = async (pageQuery: PageParams<NdmMediaServerPageQuery>, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmMediaServer/page`;
const resp = await client.post<PageResult<NdmMediaServerResultVO>>(endpoint, pageQuery, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const detailMediaServerApi = async (id: string, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmMediaServer/detail`;
const resp = await client.get<NdmMediaServerResultVO>(endpoint, { params: { id }, signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const updateMediaServerApi = async (updateVO: NdmMediaServerUpdateVO, options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmMediaServer`;
const resp = await client.put<NdmMediaServerResultVO>(endpoint, updateVO, { signal });
const [err, data] = resp;
if (err || !data) {
throw err;
}
return data;
};
export const probeMediaServerApi = async (ids: string[], options?: { stationCode?: string; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmMediaServer/probeByIds`;
const resp = await client.post<void>(endpoint, ids, { signal });
const [err] = resp;
if (err) {
throw err;
}
};

Some files were not shown because too many files have changed in this diff Show More