diff --git a/src/apis/rtsp/api.js b/src/apis/rtsp/api.js index 7898334..7e40583 100644 --- a/src/apis/rtsp/api.js +++ b/src/apis/rtsp/api.js @@ -1,5 +1,4 @@ // 開關 RTSP(啟用/停用) export const POST_SET_RTSP_ENABLE = `/api/rtsp/set-rtsp-enable`; -// 設定 SAMBA 儲存目錄 -export const POST_SET_SAMBA_DIRECTORY = `/api/rtsp/set-samba-directory`; +export const POST_GET_RTSP_DEVICE = `/api/rtsp/get-rtsp-device`; \ No newline at end of file diff --git a/src/apis/rtsp/index.js b/src/apis/rtsp/index.js index 9e11747..443e888 100644 --- a/src/apis/rtsp/index.js +++ b/src/apis/rtsp/index.js @@ -1,6 +1,8 @@ +// src/apis/rtsp/index.js import { POST_SET_RTSP_ENABLE, POST_SET_SAMBA_DIRECTORY, + POST_GET_RTSP_DEVICE, } from "./api"; import instance from "@/util/request"; import apihandler from "@/util/apihandler"; @@ -16,14 +18,16 @@ export const setRtspEnable = async ({ main_id, enable }) => { }; /** - * 設定 SAMBA 儲存目錄 - * Swagger: POST /api/rtsp/set-samba-directory - * body: { main_id: number, directory: string } + * 取得 RTSP 裝置清單 + * Swagger: POST /api/rtsp/get-rtsp-device + * body: 可為空物件 {} 或依後端需求帶 building_guid 等參數 + * response.data: [ + * { main_id, device_number, full_name, device_ip, device_port, rtsp_url, + * enable_traffic, start_btn_enable, stop_btn_enable, alarm_message } + * ] */ -export const setSambaDirectory = async ({ main_id, directory }) => { - const res = await instance.post(POST_SET_SAMBA_DIRECTORY, { - main_id, - directory, - }); +export const getRtspDevices = async (payload = {}) => { + const res = await instance.post(POST_GET_RTSP_DEVICE, payload); + // 後端回傳格式如題:{ code, msg, data: [...] } return apihandler(res.code, res.data, { msg: res.msg, code: res.code }); }; diff --git a/src/config/tw.json b/src/config/tw.json index 5e79ae1..577485c 100644 --- a/src/config/tw.json +++ b/src/config/tw.json @@ -432,7 +432,7 @@ "selectPathFirst": "請先選擇儲存資料夾", "startSuccess": "已開始偵測…", "startFail": "開始偵測失敗,請稍後再試", - "stopSuccess": "已請求結束偵測…", + "stopSuccess": "結束偵測", "stopFail": "結束偵測失敗,請稍後再試", "noPermission": "沒有取得寫入權限,請重新選擇資料夾並允許", "selectFolderSuccess": "已選擇資料夾:{name}", diff --git a/src/views/alert/components/AlertQuery/AlertTableModal.vue b/src/views/alert/components/AlertQuery/AlertTableModal.vue index 7e933f9..777b737 100644 --- a/src/views/alert/components/AlertQuery/AlertTableModal.vue +++ b/src/views/alert/components/AlertQuery/AlertTableModal.vue @@ -1,5 +1,13 @@