@uniai-fe/uds-templates 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniai-fe/uds-templates",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "UNIAI Design System; UI Templates Package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"react-hook-form": "^7.80.0",
|
|
68
68
|
"sass": "^1.101.0",
|
|
69
69
|
"typescript": "6.0.3",
|
|
70
|
-
"@uniai-fe/eslint-config": "0.4.0",
|
|
71
70
|
"@uniai-fe/next-devkit": "0.4.0",
|
|
72
|
-
"@uniai-fe/
|
|
73
|
-
"@uniai-fe/tsconfig": "0.2.0",
|
|
74
|
-
"@uniai-fe/uds-foundation": "0.5.0",
|
|
71
|
+
"@uniai-fe/eslint-config": "0.4.1",
|
|
75
72
|
"@uniai-fe/util-api": "0.2.1",
|
|
76
|
-
"@uniai-fe/
|
|
73
|
+
"@uniai-fe/tsconfig": "0.2.0",
|
|
74
|
+
"@uniai-fe/react-hooks": "0.3.0",
|
|
75
|
+
"@uniai-fe/util-functions": "0.4.3",
|
|
77
76
|
"@uniai-fe/util-jotai": "0.3.0",
|
|
78
|
-
"@uniai-fe/
|
|
77
|
+
"@uniai-fe/uds-foundation": "0.5.0",
|
|
78
|
+
"@uniai-fe/uds-primitives": "0.10.0",
|
|
79
79
|
"@uniai-fe/util-rtc": "0.2.0",
|
|
80
|
-
"@uniai-fe/
|
|
80
|
+
"@uniai-fe/util-next": "0.5.0"
|
|
81
81
|
},
|
|
82
82
|
"scripts": {
|
|
83
83
|
"check:pre-commit": "pnpm --dir ../../.. run check:pre-commit",
|
|
@@ -35,7 +35,7 @@ import { cctvRtcLiveRegistryAtom } from "../jotai/rtc";
|
|
|
35
35
|
* selectedCompany, // 선택된 회사 데이터
|
|
36
36
|
* selectedCam, // 선택된 카메라 데이터
|
|
37
37
|
* groups, // 회사 그룹/회사/카메라 리스트 구조 데이터
|
|
38
|
-
* companyValidList, //
|
|
38
|
+
* companyValidList, // 카메라가 하나라도 있는 회사 ID 리스트
|
|
39
39
|
* cams, // 선택된 회사의 카메라 리스트
|
|
40
40
|
* onToggleCamera(cam_id), // 카메라 선택 토글 함수
|
|
41
41
|
* onOpenCamera(cam_id), // 카메라 선택 함수
|
|
@@ -159,14 +159,12 @@ export default function useCctvContext(): UseCctvContextReturn {
|
|
|
159
159
|
[selectedCamId, selectedCompanyId, groups],
|
|
160
160
|
);
|
|
161
161
|
|
|
162
|
-
//
|
|
162
|
+
// cam_online 상태와 무관하게 카메라가 하나라도 있는 company_id를 반환한다.
|
|
163
163
|
const companyValidList = useMemo(
|
|
164
164
|
() =>
|
|
165
165
|
groups
|
|
166
166
|
.flatMap(({ list }) => list)
|
|
167
|
-
.filter(
|
|
168
|
-
({ cam_list }) => !cam_list.every(({ cam_online }) => !cam_online),
|
|
169
|
-
)
|
|
167
|
+
.filter(({ cam_list }) => cam_list.length > 0)
|
|
170
168
|
.map(({ company_id }) => company_id),
|
|
171
169
|
[groups],
|
|
172
170
|
);
|
package/src/cctv/types/api.ts
CHANGED
|
@@ -144,7 +144,7 @@ export interface API_Res_CctvCameraData
|
|
|
144
144
|
* CCTV: 업체에 설치된 카메라 목록
|
|
145
145
|
* @property {string} cam_id 카메라 id코드
|
|
146
146
|
* @property {string} cam_name 카메라 별칭
|
|
147
|
-
* @property {boolean} cam_online 카메라
|
|
147
|
+
* @property {boolean} cam_online 카메라 네트워크 연결 상태
|
|
148
148
|
* @property {string} cam_rtc 카메라 스트리밍 WebRTC 경로
|
|
149
149
|
* @property {string} cam_rtcp 카메라 RTCP 경로
|
|
150
150
|
* @property {string} cam_rtsp 카메라 RTSP 경로
|
|
@@ -156,7 +156,7 @@ export interface API_Res_CctvCameraData
|
|
|
156
156
|
export interface API_Res_CctvCompanyCameraList extends API_Res_CctvCameraData {
|
|
157
157
|
// API 응답은 데이터-only 구조이므로 UI 전용 콜백은 포함하지 않는다.
|
|
158
158
|
/**
|
|
159
|
-
* 카메라
|
|
159
|
+
* 카메라 네트워크 연결 상태
|
|
160
160
|
*/
|
|
161
161
|
cam_online: boolean;
|
|
162
162
|
}
|
package/src/cctv/types/hook.ts
CHANGED
|
@@ -195,7 +195,7 @@ export interface UseCctvCompanyDataReturn extends Omit<
|
|
|
195
195
|
* @property {CctvCompanyGroupItems | undefined} selectedCompany 선택된 업체 데이터
|
|
196
196
|
* @property {CctvCompanyCameraData | undefined} selectedCam 선택된 카메라 데이터
|
|
197
197
|
* @property {CctvCompanyGroup[]} groups 업체 그룹/업체/카메라 리스트 구조 데이터
|
|
198
|
-
* @property {string[]} companyValidList
|
|
198
|
+
* @property {string[]} companyValidList 카메라가 하나라도 있는 업체 ID 리스트
|
|
199
199
|
* @property {CctvCompanyCameraList[]} cams 선택된 업체의 카메라 리스트
|
|
200
200
|
* @property {number} liveCamCount 실시간 스트리밍 중인 카메라 수
|
|
201
201
|
* @property {(cam_id: string) => void} onToggleCamera 카메라 선택 토글 함수
|
|
@@ -244,7 +244,7 @@ export interface UseCctvContextReturn extends UseFormReturn<CctvBaseContext> {
|
|
|
244
244
|
*/
|
|
245
245
|
groups: CctvCompanyGroup[];
|
|
246
246
|
/**
|
|
247
|
-
*
|
|
247
|
+
* 카메라가 하나라도 있는 업체 목록
|
|
248
248
|
*/
|
|
249
249
|
companyValidList: string[];
|
|
250
250
|
/**
|
package/src/cctv/types/list.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
* @property {Function} [onSelect] 카메라 선택 콜백 이벤트
|
|
11
11
|
* @property {string} cam_id 카메라 id코드
|
|
12
12
|
* @property {string} cam_name 카메라 별칭
|
|
13
|
-
* @property {boolean} cam_online 카메라
|
|
13
|
+
* @property {boolean} cam_online 카메라 네트워크 연결 상태
|
|
14
14
|
* @property {string} [cam_rtc] 카메라 스트리밍 WebRTC 경로
|
|
15
15
|
* @property {string} [cam_rtcp] 카메라 RTCP 경로
|
|
16
16
|
* @property {string} [cam_rtsp] 카메라 RTSP 경로
|
|
@@ -46,7 +46,7 @@ export interface CctvCompanyCameraData extends API_Res_CctvCompanyCameraList {
|
|
|
46
46
|
* @property {Function} [onSelect] 카메라 선택 콜백 이벤트
|
|
47
47
|
* @property {string} cam_id 카메라 id코드
|
|
48
48
|
* @property {string} cam_name 카메라 별칭
|
|
49
|
-
* @property {boolean} cam_online 카메라
|
|
49
|
+
* @property {boolean} cam_online 카메라 네트워크 연결 상태
|
|
50
50
|
* @property {string} [cam_rtc] 카메라 스트리밍 WebRTC 경로
|
|
51
51
|
* @property {string} [cam_rtcp] 카메라 RTCP 경로
|
|
52
52
|
* @property {string} [cam_rtsp] 카메라 RTSP 경로
|
|
@@ -13,6 +13,7 @@ export const CCTV_MESSAGE = {
|
|
|
13
13
|
"장시간 미사용으로 연결이 종료되었습니다. 계속 확인하시려면 다시 연결해 주세요.",
|
|
14
14
|
tokenError: "토큰을 발급하지 못했습니다.",
|
|
15
15
|
offline: "CCTV 연결 오류",
|
|
16
|
+
networkDisconnected: "네트워크 연결이 끊어졌습니다.",
|
|
16
17
|
} as const;
|
|
17
18
|
|
|
18
19
|
const RTC_PREPARING_STATES = new Set<RTCPeerConnectionState>([
|
|
@@ -56,7 +57,7 @@ export function getOverlayMessage({
|
|
|
56
57
|
return isFetching ? CCTV_MESSAGE.fetching : CCTV_MESSAGE.selectCam;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
if (!cam.cam_online) return CCTV_MESSAGE.
|
|
60
|
+
if (!cam.cam_online) return CCTV_MESSAGE.networkDisconnected;
|
|
60
61
|
// 에러 상태가 준비 상태와 겹칠 때는 에러 문구가 최종 표시 계약을 우선한다.
|
|
61
62
|
if (isTokenError) return CCTV_MESSAGE.tokenError;
|
|
62
63
|
if (streamError) return streamError;
|