diff --git a/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs b/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs index ea17216..7397b26 100644 --- a/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs +++ b/FrontendWebApi/ApiControllers/EmergencyDeviceController.cs @@ -132,18 +132,15 @@ namespace FrontendWebApi.ApiControllers if (selectdevice.select_disasters == null || selectdevice.select_disasters.Count == 0) selectdevice.select_disasters = new List(); - var sqlString = $@"SELECT system_key as 'Name', system_value as 'Value' FROM variable where system_type = 'website_config' AND deleted = 0"; - List webSiteConfig = await backendRepository.GetAllAsync(sqlString); - deviceQue += $" AND d.device_building_tag in @building_tag "; disasQue = " where dd.device_system_value IN @disasters "; - sqlString = @$"select + var sqlString = @$"select d.device_guid, d.device_number, d.full_name AS device_name, d.device_building_tag AS building_tag, b.full_name AS building_name, - CONCAT(@niagara_http, '://',b.ip_address , ':', b.ip_port,'/file/',@niagaraRootName) AS ip_address, + CONCAT(b.ip_http, '://',b.ip_address , ':', b.ip_port,'/file/',b.niagara_root_name) AS ip_address, v.layer2, v.layer2_name, v.system_value AS layer3, @@ -181,9 +178,7 @@ namespace FrontendWebApi.ApiControllers disasters = selectdevice.select_disasters, building_tag = selectdevice.selectbuilding, floor = selectdevice.select_Floors, - layer3 = selectdevice.select_Layer3, - niagaraRootName = webSiteConfig.FirstOrDefault(w => w.Name == "frontend_niagara_root_name")?.Value, - niagara_http = webSiteConfig.FirstOrDefault(w => w.Name == "frontend_http")?.Value, + layer3 = selectdevice.select_Layer3 }); apiResult.Code = "0000"; diff --git a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml index e31a844..9fe73ab 100644 --- a/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml +++ b/FrontendWebApi/Views/EmergencyDeviceMenu/Index.cshtml @@ -53,6 +53,12 @@
+
+
+ Loading... +
+ 正在取得即時異常設備 +
@@ -365,7 +371,6 @@ if (!enable_alarm_timer) { return; } - GetAlarmFromObix((data) => { var is_diff = false; if (Object.keys(temp_alarm_device).length == Object.keys(data.alarmorion).length) { @@ -395,6 +400,7 @@ //data.buildingAlarmDeviceAmount.forEach(function (item) { // $(`#${item.building_tag}_device_amount`).html(item.device_amount); //}); + setNiagaraLoading(true); ResetDeviceTable(); } }) @@ -729,7 +735,7 @@ return []; } - + setNiagaraLoading(false); return data; } @@ -851,6 +857,15 @@ }); //#endregion + function setNiagaraLoading(isShow = true,text = "更新列表中") { + if(isShow) { + $("#getNiagaraLoadingText").text(text); + $("#getNiagaraLoading").animate({opacity:1},500); + } else { + $("#getNiagaraLoading").animate({opacity:0},500); + } + } + function GetAlarmFromObix(callback = null){ let url = "/api/Alarm/GetAlarmFromObix" $.ajax({ diff --git a/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml b/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml index 9688bed..2b5bda3 100644 --- a/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml +++ b/FrontendWebApi/Views/EmergencyHardwareMenu/Index.cshtml @@ -577,7 +577,7 @@ `;*@ var html = ` - + ${data} `;