From 1aa4a26a26c12ab8909e07c7f599f0bcb716215b Mon Sep 17 00:00:00 2001 From: Jared Date: Wed, 9 Sep 2020 13:07:22 -0700 Subject: [PATCH] Add pagination. --- Desktop.Win/Program.cs | 12 +- Desktop.Win/Services/ShutdownServiceWin.cs | 3 +- Server/Pages/_DataGrid.cshtml | 22 +- Server/wwwroot/scripts/Main/DataGrid.js | 198 +++++++++------ Server/wwwroot/scripts/Main/DataGrid.js.map | 2 +- Server/wwwroot/scripts/Main/DataGrid.ts | 228 +++++++++++------- Server/wwwroot/scripts/Main/HubConnection.js | 6 +- .../wwwroot/scripts/Main/HubConnection.js.map | 2 +- Server/wwwroot/scripts/Main/HubConnection.ts | 6 +- .../scripts/Main/InputEventHandlers.js | 198 ++++++++------- .../scripts/Main/InputEventHandlers.js.map | 2 +- .../scripts/Main/InputEventHandlers.ts | 213 ++++++++-------- Server/wwwroot/scripts/Main/UI.js | 5 + Server/wwwroot/scripts/Main/UI.js.map | 2 +- Server/wwwroot/scripts/Main/UI.ts | 7 +- 15 files changed, 549 insertions(+), 357 deletions(-) diff --git a/Desktop.Win/Program.cs b/Desktop.Win/Program.cs index cd75c0265..27361ed41 100644 --- a/Desktop.Win/Program.cs +++ b/Desktop.Win/Program.cs @@ -20,6 +20,7 @@ namespace Remotely.Desktop.Win { public class Program { + public static ManualResetEvent AppExitEvent { get; } = new ManualResetEvent(false); public static Form BackgroundForm { get; private set; } private static CasterSocket CasterSocket { get; set; } private static Conductor Conductor { get; set; } @@ -71,7 +72,16 @@ await Task.Run(async () => StartUiThreads(() => new MainWindow()); } - Thread.Sleep(Timeout.Infinite); + App.Current.Dispatcher.Invoke(() => + { + App.Current.Exit += (sender, exitArgs) => + { + AppExitEvent.Set(); + }; + }); + + + AppExitEvent.WaitOne(Timeout.Infinite); } catch (Exception ex) { diff --git a/Desktop.Win/Services/ShutdownServiceWin.cs b/Desktop.Win/Services/ShutdownServiceWin.cs index b01ea218b..ed576ed59 100644 --- a/Desktop.Win/Services/ShutdownServiceWin.cs +++ b/Desktop.Win/Services/ShutdownServiceWin.cs @@ -20,7 +20,8 @@ public async Task Shutdown() await casterSocket.DisconnectAllViewers(); System.Windows.Forms.Application.Exit(); App.Current.Shutdown(); - Environment.Exit(0); + // TODO: Still needed? + //Environment.Exit(0); } } } diff --git a/Server/Pages/_DataGrid.cshtml b/Server/Pages/_DataGrid.cshtml index 434bf19b2..1e7917c80 100644 --- a/Server/Pages/_DataGrid.cshtml +++ b/Server/Pages/_DataGrid.cshtml @@ -4,28 +4,41 @@
-
+
-
+
-
+
-
+
Filter:
+ +
+ + Page + + of + + +
@@ -52,6 +65,5 @@
-
\ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/DataGrid.js b/Server/wwwroot/scripts/Main/DataGrid.js index 07164a0f4..309d0a4ae 100644 --- a/Server/wwwroot/scripts/Main/DataGrid.js +++ b/Server/wwwroot/scripts/Main/DataGrid.js @@ -1,20 +1,27 @@ -import { Main } from "./Main.js"; -import { DeviceGrid, DevicesSelectedCount, OnlineDevicesCount, TotalDevicesCount } from "./UI.js"; +import { DeviceGrid, DevicesSelectedCount, OnlineDevicesCount, TotalDevicesCount, TotalPagesSpan, DeviceGridBody, CurrentPageInput } from "./UI.js"; import { AddConsoleOutput } from "./Console.js"; import { CreateChatWindow } from "./Chat.js"; import * as HubConnection from "./HubConnection.js"; import { ShowModal } from "../Shared/UI.js"; export const DataSource = new Array(); -export const FilterOptions = new class { +export const FilteredDevices = new Array(); +export const GridState = new class { constructor() { this.GroupFilter = ""; this.HideOffline = true; this.SearchFilter = ""; this.ShowAllGroups = true; + this.CurrentPage = 1; + this.TotalPages = 1; + } + get RowsPerPage() { + return 100; } }; export function AddOrUpdateDevices(devices) { DataSource.splice(0); + FilteredDevices.splice(0); + GridState.CurrentPage = 1; devices.sort((a, b) => { //if (a.IsOnline && !b.IsOnline) { // return -1; @@ -25,12 +32,12 @@ export function AddOrUpdateDevices(devices) { return a.DeviceName.localeCompare(b.DeviceName, [], { sensitivity: "base" }); }); devices.forEach(x => { - AddOrUpdateDevice(x); + AddOrUpdateDevice(x, false); }); - ApplyFilter(); UpdateDeviceCounts(); + RenderDeviceRows(); } -export function AddOrUpdateDevice(device) { +export function AddOrUpdateDevice(device, rerenderGrid) { var existingIndex = DataSource.findIndex(x => x.ID == device.ID); if (existingIndex > -1) { DataSource[existingIndex] = device; @@ -38,28 +45,68 @@ export function AddOrUpdateDevice(device) { else { DataSource.push(device); } - var tableBody = document.querySelector("#" + Main.UI.DeviceGrid.id + " tbody"); - var recordRow = document.getElementById(device.ID); - if (recordRow == null) { - recordRow = document.createElement("tr"); - recordRow.classList.add("record-row"); - recordRow.id = device.ID; - tableBody.appendChild(recordRow); - recordRow.addEventListener("click", (e) => { - if (!e.ctrlKey && !e.shiftKey) { - var selectedID = e.currentTarget.id; - DeviceGrid.querySelectorAll(`.record-row.row-selected:not([id='${selectedID}'])`).forEach(elem => { - elem.classList.remove("row-selected"); - }); - } - e.currentTarget.classList.toggle("row-selected"); - UpdateDeviceCounts(); - }); + ApplyFilterToDevice(device); + if (rerenderGrid) { + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} +export function ApplyFilterToAll() { + FilteredDevices.splice(0); + GridState.CurrentPage = 1; + for (var i = 0; i < DataSource.length; i++) { + ApplyFilterToDevice(DataSource[i]); + } + UpdateDeviceCounts(); + RenderDeviceRows(); +} +export function ApplyFilterToDevice(device) { + if (GridState.HideOffline && !device.IsOnline) { + return; + } + if (!GridState.ShowAllGroups && + (device.DeviceGroupID || "") != (GridState.GroupFilter || "")) { + return; } - recordRow.innerHTML = ` + if (deviceMatchesSearchFilter(device)) { + var existingIndex = FilteredDevices.findIndex(x => x.ID == device.ID); + if (existingIndex > -1) { + FilteredDevices[existingIndex] = device; + } + else { + FilteredDevices.push(device); + } + return; + } +} +export function RenderDeviceRows() { + DeviceGridBody.innerHTML = ""; + var startCurrentDevices = (GridState.CurrentPage - 1) * GridState.RowsPerPage; + var endCurrentDevices = startCurrentDevices + GridState.RowsPerPage; + var currentPageDevices = FilteredDevices.slice(startCurrentDevices, endCurrentDevices); + for (var i = 0; i < currentPageDevices.length; i++) { + var device = currentPageDevices[i]; + var recordRow = document.getElementById(device.ID); + if (recordRow == null) { + recordRow = document.createElement("tr"); + recordRow.classList.add("record-row"); + recordRow.id = device.ID; + DeviceGridBody.appendChild(recordRow); + recordRow.addEventListener("click", (e) => { + if (!e.ctrlKey && !e.shiftKey) { + var selectedID = e.currentTarget.id; + DeviceGrid.querySelectorAll(`.record-row.row-selected:not([id='${selectedID}'])`).forEach(elem => { + elem.classList.remove("row-selected"); + }); + } + e.currentTarget.classList.toggle("row-selected"); + UpdateDeviceCounts(); + }); + } + recordRow.innerHTML = ` ${String(device.IsOnline) - .replace("true", "") - .replace("false", "")} + .replace("true", "") + .replace("false", "")} ${device.DeviceName} ${device.Alias || ""} ${device.CurrentUser} @@ -77,50 +124,24 @@ export function AddOrUpdateDevice(device) { `; - recordRow.querySelector(".device-edit-button").onclick = (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - window.open(`${location.origin}/EditDevice?deviceID=${device.ID}`, "_blank"); - }; - recordRow.querySelector(".device-chat-button").onclick = (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - CreateChatWindow(device.ID, device.DeviceName); - }; - recordRow.querySelector(".device-remotecontrol-button").onclick = (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - AddConsoleOutput("Launching remote control on client device..."); - HubConnection.Connection.invoke("RemoteControl", device.ID); - }; - UpdateDeviceCounts(); -} -export function ApplyFilter() { - for (var i = 0; i < DataSource.length; i++) { - var row = document.getElementById(DataSource[i].ID); - if (FilterOptions.HideOffline && !DataSource[i].IsOnline) { - row.classList.add("hidden"); - continue; - } - if (!FilterOptions.ShowAllGroups && - (DataSource[i].DeviceGroupID || "") != (FilterOptions.GroupFilter || "")) { - row.classList.add("hidden"); - continue; - } - if (deviceMatchesSearchFilter(DataSource[i])) { - row.classList.remove("hidden"); - continue; - } - row.classList.add("hidden"); + recordRow.querySelector(".device-edit-button").onclick = (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + window.open(`${location.origin}/EditDevice?deviceID=${device.ID}`, "_blank"); + }; + recordRow.querySelector(".device-chat-button").onclick = (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + CreateChatWindow(device.ID, device.DeviceName); + }; + recordRow.querySelector(".device-remotecontrol-button").onclick = (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + AddConsoleOutput("Launching remote control on client device..."); + HubConnection.Connection.invoke("RemoteControl", device.ID); + }; } } -export function ClearAllData() { - DataSource.splice(0, DataSource.length); - DeviceGrid.querySelectorAll(".record-row").forEach(row => { - row.remove(); - }); - UpdateDeviceCounts(); -} export function GetSelectedDevices() { var devices = new Array(); DeviceGrid.querySelectorAll(".row-selected").forEach(row => { @@ -129,8 +150,34 @@ export function GetSelectedDevices() { return devices; } ; +export function GoToCurrentPage() { + var newPage = Number(CurrentPageInput.value); + if (Number.isInteger(newPage) && + newPage > 0 && + newPage < GridState.TotalPages) { + GridState.CurrentPage = newPage; + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} +export function PageDown() { + if (GridState.CurrentPage > 1) { + GridState.CurrentPage--; + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} +export function PageUp() { + if (GridState.CurrentPage < GridState.TotalPages) { + GridState.CurrentPage++; + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} export function RefreshGrid() { - ClearAllData(); + DataSource.splice(0); + DeviceGridBody.innerHTML = ""; + UpdateDeviceCounts(); var xhr = new XMLHttpRequest(); xhr.open("get", "/API/Devices"); xhr.onerror = () => { @@ -171,17 +218,20 @@ export function ToggleSelectAll() { UpdateDeviceCounts(); } export function UpdateDeviceCounts() { + GridState.TotalPages = Math.ceil(FilteredDevices.length / GridState.RowsPerPage); + TotalPagesSpan.innerHTML = String(GridState.TotalPages); + CurrentPageInput.value = String(GridState.CurrentPage); DevicesSelectedCount.innerText = DeviceGrid.querySelectorAll(".row-selected").length.toString(); - OnlineDevicesCount.innerText = DataSource.filter(x => x.IsOnline).length.toString(); - TotalDevicesCount.innerText = DataSource.length.toString(); - if (DataSource.some(x => !x.IsOnline && + OnlineDevicesCount.innerText = FilteredDevices.filter(x => x.IsOnline).length.toString(); + TotalDevicesCount.innerText = FilteredDevices.length.toString(); + if (FilteredDevices.some(x => !x.IsOnline && document.getElementById(x.ID) && document.getElementById(x.ID).classList.contains("row-selected"))) { AddConsoleOutput(`Your selection contains offline computers. Your commands will only be sent to those that are online.`); } } function deviceMatchesSearchFilter(device) { - if (!FilterOptions.SearchFilter) { + if (!GridState.SearchFilter) { return true; } for (var key in device) { @@ -189,7 +239,7 @@ function deviceMatchesSearchFilter(device) { if (!value) { continue; } - if (value.toString().toLowerCase().includes(FilterOptions.SearchFilter.toLowerCase())) { + if (value.toString().toLowerCase().includes(GridState.SearchFilter.toLowerCase())) { return true; } } diff --git a/Server/wwwroot/scripts/Main/DataGrid.js.map b/Server/wwwroot/scripts/Main/DataGrid.js.map index bbb5dc88b..128bd7344 100644 --- a/Server/wwwroot/scripts/Main/DataGrid.js.map +++ b/Server/wwwroot/scripts/Main/DataGrid.js.map @@ -1 +1 @@ -{"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["DataGrid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAC,MAAM,UAAU,GAAkB,IAAI,KAAK,EAAU,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG,IA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G,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,KAAK,EAAE;YACR,SAAS;SACZ;QACD,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,EAAE;YAC/E,OAAO,IAAI,CAAC;SACf;KACJ;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/DataGrid.ts b/Server/wwwroot/scripts/Main/DataGrid.ts index e88c370d1..39ac68a46 100644 --- a/Server/wwwroot/scripts/Main/DataGrid.ts +++ b/Server/wwwroot/scripts/Main/DataGrid.ts @@ -1,24 +1,32 @@ -import { Device } from "../Shared/Models/Device.js"; -import { Main } from "./Main.js"; -import { DeviceGrid, DevicesSelectedCount, OnlineDevicesCount, TotalDevicesCount } from "./UI.js"; +import { Main } from "./Main.js"; +import { DeviceGrid, DevicesSelectedCount, OnlineDevicesCount, TotalDevicesCount, TotalPagesSpan, DeviceGridBody, CurrentPageInput } from "./UI.js"; import { AddConsoleOutput } from "./Console.js"; import { CreateChatWindow } from "./Chat.js"; import * as HubConnection from "./HubConnection.js" import { ShowModal } from "../Shared/UI.js"; +import { Device } from "../Shared/Models/Device.js"; export const DataSource: Array = new Array(); +export const FilteredDevices: Array = new Array(); -export const FilterOptions = new class { +export const GridState = new class { GroupFilter: string = ""; HideOffline: boolean = true; SearchFilter: string = ""; ShowAllGroups: boolean = true; + CurrentPage: number = 1; + TotalPages: number = 1; + get RowsPerPage() { + return 100; + } }; export function AddOrUpdateDevices(devices: Array) { DataSource.splice(0); + FilteredDevices.splice(0); + GridState.CurrentPage = 1; devices.sort((a, b) => { //if (a.IsOnline && !b.IsOnline) { @@ -31,14 +39,14 @@ export function AddOrUpdateDevices(devices: Array) { }); devices.forEach(x => { - AddOrUpdateDevice(x); + AddOrUpdateDevice(x, false); }); - ApplyFilter(); UpdateDeviceCounts(); + RenderDeviceRows(); } -export function AddOrUpdateDevice(device: Device) { +export function AddOrUpdateDevice(device: Device, rerenderGrid: boolean) { var existingIndex = DataSource.findIndex(x => x.ID == device.ID); if (existingIndex > -1) { DataSource[existingIndex] = device; @@ -47,29 +55,83 @@ export function AddOrUpdateDevice(device: Device) { DataSource.push(device); } - var tableBody = document.querySelector("#" + Main.UI.DeviceGrid.id + " tbody"); - var recordRow = document.getElementById(device.ID); - if (recordRow == null) { - recordRow = document.createElement("tr"); - recordRow.classList.add("record-row"); - recordRow.id = device.ID; - tableBody.appendChild(recordRow); - recordRow.addEventListener("click", (e) => { - if (!e.ctrlKey && !e.shiftKey) { - var selectedID = (e.currentTarget as HTMLElement).id; - DeviceGrid.querySelectorAll(`.record-row.row-selected:not([id='${selectedID}'])`).forEach(elem => { - elem.classList.remove("row-selected"); - }); - } - (e.currentTarget as HTMLElement).classList.toggle("row-selected"); - UpdateDeviceCounts(); - }); + ApplyFilterToDevice(device); + + if (rerenderGrid) { + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} + +export function ApplyFilterToAll() { + FilteredDevices.splice(0); + GridState.CurrentPage = 1; + + for (var i = 0; i < DataSource.length; i++) { + ApplyFilterToDevice(DataSource[i]); + } + + UpdateDeviceCounts(); + RenderDeviceRows(); +} + +export function ApplyFilterToDevice(device: Device) { + + if (GridState.HideOffline && !device.IsOnline) { + return; + } + + if (!GridState.ShowAllGroups && + (device.DeviceGroupID || "") != (GridState.GroupFilter || "")) { + return; + } + + if (deviceMatchesSearchFilter(device)) { + var existingIndex = FilteredDevices.findIndex(x => x.ID == device.ID); + + if (existingIndex > -1) { + FilteredDevices[existingIndex] = device; + } + else { + FilteredDevices.push(device); + } + + return; } +} - recordRow.innerHTML = ` +export function RenderDeviceRows() { + DeviceGridBody.innerHTML = ""; + var startCurrentDevices = (GridState.CurrentPage - 1) * GridState.RowsPerPage; + var endCurrentDevices = startCurrentDevices + GridState.RowsPerPage; + + var currentPageDevices = FilteredDevices.slice(startCurrentDevices, endCurrentDevices); + + for (var i = 0; i < currentPageDevices.length; i++) { + + var device = currentPageDevices[i]; + var recordRow = document.getElementById(device.ID) as HTMLTableRowElement; + if (recordRow == null) { + recordRow = document.createElement("tr"); + recordRow.classList.add("record-row"); + recordRow.id = device.ID; + DeviceGridBody.appendChild(recordRow); + recordRow.addEventListener("click", (e) => { + if (!e.ctrlKey && !e.shiftKey) { + var selectedID = (e.currentTarget as HTMLElement).id; + DeviceGrid.querySelectorAll(`.record-row.row-selected:not([id='${selectedID}'])`).forEach(elem => { + elem.classList.remove("row-selected"); + }); + } + (e.currentTarget as HTMLElement).classList.toggle("row-selected"); + UpdateDeviceCounts(); + }); + } + + recordRow.innerHTML = ` ${String(device.IsOnline) - .replace("true", "") - .replace("false", "")} + .replace("true", "") + .replace("false", "")} ${device.DeviceName} ${device.Alias || ""} ${device.CurrentUser} @@ -80,7 +142,7 @@ export function AddOrUpdateDevice(device: Device) { ${Math.round(device.CpuUtilization * 100)}% ${Math.round(device.UsedStorage / device.TotalStorage * 100)}% ${device.TotalStorage.toLocaleString()} - ${Math.round(device.UsedMemory /device.TotalMemory * 100)}% + ${Math.round(device.UsedMemory / device.TotalMemory * 100)}% ${device.TotalMemory.toLocaleString()} @@ -89,56 +151,26 @@ export function AddOrUpdateDevice(device: Device) { `; - (recordRow.querySelector(".device-edit-button") as HTMLButtonElement).onclick = (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - window.open(`${location.origin}/EditDevice?deviceID=${device.ID}`, "_blank"); - }; - (recordRow.querySelector(".device-chat-button") as HTMLButtonElement).onclick = (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - CreateChatWindow(device.ID, device.DeviceName); - }; - (recordRow.querySelector(".device-remotecontrol-button") as HTMLButtonElement).onclick = (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - AddConsoleOutput("Launching remote control on client device..."); - HubConnection.Connection.invoke("RemoteControl", device.ID); - }; - - UpdateDeviceCounts(); -} -export function ApplyFilter() { - for (var i = 0; i < DataSource.length; i++) { - var row = document.getElementById(DataSource[i].ID); - - if (FilterOptions.HideOffline && !DataSource[i].IsOnline) { - row.classList.add("hidden"); - continue; - } - - if (!FilterOptions.ShowAllGroups && - (DataSource[i].DeviceGroupID || "") != (FilterOptions.GroupFilter || "")) { - row.classList.add("hidden"); - continue; - } - - if (deviceMatchesSearchFilter(DataSource[i])) { - row.classList.remove("hidden"); - continue; - } - - row.classList.add("hidden"); + (recordRow.querySelector(".device-edit-button") as HTMLButtonElement).onclick = (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + window.open(`${location.origin}/EditDevice?deviceID=${device.ID}`, "_blank"); + }; + (recordRow.querySelector(".device-chat-button") as HTMLButtonElement).onclick = (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + CreateChatWindow(device.ID, device.DeviceName); + }; + (recordRow.querySelector(".device-remotecontrol-button") as HTMLButtonElement).onclick = (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + AddConsoleOutput("Launching remote control on client device..."); + HubConnection.Connection.invoke("RemoteControl", device.ID); + }; } } -export function ClearAllData() { - DataSource.splice(0, DataSource.length); - DeviceGrid.querySelectorAll(".record-row").forEach(row => { - row.remove(); - }); - UpdateDeviceCounts(); -} + export function GetSelectedDevices(): Device[] { var devices = new Array(); DeviceGrid.querySelectorAll(".row-selected").forEach(row => { @@ -146,8 +178,39 @@ export function GetSelectedDevices(): Device[] { }); return devices; }; + +export function GoToCurrentPage() { + var newPage = Number(CurrentPageInput.value); + + if (Number.isInteger(newPage) && + newPage > 0 && + newPage < GridState.TotalPages) { + GridState.CurrentPage = newPage; + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} + +export function PageDown() { + if (GridState.CurrentPage > 1) { + GridState.CurrentPage--; + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} + +export function PageUp() { + if (GridState.CurrentPage < GridState.TotalPages) { + GridState.CurrentPage++; + UpdateDeviceCounts(); + RenderDeviceRows(); + } +} + export function RefreshGrid() { - ClearAllData(); + DataSource.splice(0); + DeviceGridBody.innerHTML = ""; + UpdateDeviceCounts(); var xhr = new XMLHttpRequest(); xhr.open("get", "/API/Devices"); xhr.onerror = () => { @@ -189,11 +252,14 @@ export function ToggleSelectAll() { UpdateDeviceCounts(); } export function UpdateDeviceCounts() { + GridState.TotalPages = Math.ceil(FilteredDevices.length / GridState.RowsPerPage); + TotalPagesSpan.innerHTML = String(GridState.TotalPages); + CurrentPageInput.value = String(GridState.CurrentPage); DevicesSelectedCount.innerText = DeviceGrid.querySelectorAll(".row-selected").length.toString(); - OnlineDevicesCount.innerText = DataSource.filter(x => x.IsOnline).length.toString(); - TotalDevicesCount.innerText = DataSource.length.toString(); + OnlineDevicesCount.innerText = FilteredDevices.filter(x => x.IsOnline).length.toString(); + TotalDevicesCount.innerText = FilteredDevices.length.toString(); if ( - DataSource.some(x => + FilteredDevices.some(x => !x.IsOnline && document.getElementById(x.ID) && document.getElementById(x.ID).classList.contains("row-selected")) @@ -203,7 +269,7 @@ export function UpdateDeviceCounts() { } function deviceMatchesSearchFilter(device: Device) { - if (!FilterOptions.SearchFilter) { + if (!GridState.SearchFilter) { return true; } @@ -212,7 +278,7 @@ function deviceMatchesSearchFilter(device: Device) { if (!value) { continue; } - if (value.toString().toLowerCase().includes(FilterOptions.SearchFilter.toLowerCase())) { + if (value.toString().toLowerCase().includes(GridState.SearchFilter.toLowerCase())) { return true; } } diff --git a/Server/wwwroot/scripts/Main/HubConnection.js b/Server/wwwroot/scripts/Main/HubConnection.js index 95fd2dac6..1063c0c4a 100644 --- a/Server/wwwroot/scripts/Main/HubConnection.js +++ b/Server/wwwroot/scripts/Main/HubConnection.js @@ -51,13 +51,13 @@ function applyMessageHandlers(hubConnection) { location.assign("/Identity/Account/Lockout"); }); hubConnection.on("DeviceCameOnline", (device) => { - DataGrid.AddOrUpdateDevice(device); + DataGrid.AddOrUpdateDevice(device, true); }); hubConnection.on("DeviceWentOffline", (device) => { - DataGrid.AddOrUpdateDevice(device); + DataGrid.AddOrUpdateDevice(device, true); }); hubConnection.on("DeviceHeartbeat", (device) => { - DataGrid.AddOrUpdateDevice(device); + DataGrid.AddOrUpdateDevice(device, true); }); hubConnection.on("RefreshDeviceList", () => { DataGrid.RefreshGrid(); diff --git a/Server/wwwroot/scripts/Main/HubConnection.js.map b/Server/wwwroot/scripts/Main/HubConnection.js.map index f590cbdcd..6c4e81aec 100644 --- a/Server/wwwroot/scripts/Main/HubConnection.js.map +++ b/Server/wwwroot/scripts/Main/HubConnection.js.map @@ -1 +1 @@ -{"version":3,"file":"HubConnection.js","sourceRoot":"","sources":["HubConnection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEjI,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,CAAC,IAAI,UAAe,CAAC;AAC3B,MAAM,CAAC,IAAI,SAAiB,CAAC;AAC7B,MAAM,CAAC,IAAI,SAAkB,CAAC;AAE9B,MAAM,UAAU,OAAO;IACnB,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAChC,UAAU,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE;SAC1C,OAAO,CAAC,aAAa,CAAC;SACtB,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;SAC9C,KAAK,EAAE,CAAC;IAEb,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAEjC,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QAC3B,OAAO,CA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Main/HubConnection.ts index c0b6edb78..e4afe9e46 100644 --- a/Server/wwwroot/scripts/Main/HubConnection.ts +++ b/Server/wwwroot/scripts/Main/HubConnection.ts @@ -66,13 +66,13 @@ function applyMessageHandlers(hubConnection) { }); hubConnection.on("DeviceCameOnline", (device:Device) => { - DataGrid.AddOrUpdateDevice(device); + DataGrid.AddOrUpdateDevice(device, true); }); hubConnection.on("DeviceWentOffline", (device: Device) => { - DataGrid.AddOrUpdateDevice(device); + DataGrid.AddOrUpdateDevice(device, true); }); hubConnection.on("DeviceHeartbeat", (device: Device) => { - DataGrid.AddOrUpdateDevice(device); + DataGrid.AddOrUpdateDevice(device, true); }); hubConnection.on("RefreshDeviceList", () => { diff --git a/Server/wwwroot/scripts/Main/InputEventHandlers.js b/Server/wwwroot/scripts/Main/InputEventHandlers.js index 05ee4d6e2..d4e7c5d64 100644 --- a/Server/wwwroot/scripts/Main/InputEventHandlers.js +++ b/Server/wwwroot/scripts/Main/InputEventHandlers.js @@ -17,14 +17,53 @@ export function ApplyInputEventHandlers() { deviceGroupSelectChanged(); addAlertHandlers(); hideOfflineDevicesCheckboxChanged(); + addGridPaginationHandlers(); window.addEventListener("resize", ev => { PositionCommandCompletionWindow(); }); } -function hideOfflineDevicesCheckboxChanged() { - UI.HideOfflineDevicesCheckbox.addEventListener("change", ev => { - DataGrid.FilterOptions.HideOffline = UI.HideOfflineDevicesCheckbox.checked; - DataGrid.ApplyFilter(); +function addGridPaginationHandlers() { + UI.LeftPaginationButton.addEventListener("click", (ev) => { + DataGrid.PageDown(); + }); + UI.RightPaginationButton.addEventListener("click", (ev) => { + DataGrid.PageUp(); + }); + var changePageTimeout = -1; + UI.CurrentPageInput.addEventListener("input", (ev) => { + if (changePageTimeout > 0) { + window.clearTimeout(changePageTimeout); + } + changePageTimeout = window.setTimeout(() => { + DataGrid.GoToCurrentPage(); + }, 2000); + }); +} +function addAlertHandlers() { + UI.AlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); + UI.CloseAlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); + document.querySelectorAll(".alert-dismiss-button").forEach(element => { + element.addEventListener("click", ev => { + var alertID = ev.currentTarget.getAttribute("alert"); + var xhr = new XMLHttpRequest(); + xhr.open("delete", location.origin + "/api/Alerts/Delete/" + alertID); + xhr.onload = function () { + if (xhr.status == 200) { + document.getElementById(alertID).remove(); + var currentCount = Number(UI.AlertsCount.innerText); + currentCount--; + UI.AlertsCount.innerText = String(currentCount); + } + else { + ShowModal("API Error", "There was an error deleting the alert."); + } + }; + xhr.send(); + }); }); } function arrowUpOrDownOnTextArea(e) { @@ -69,6 +108,71 @@ function arrowUpOrDownOnTextArea(e) { } } } +function clickToggleAllDevices() { + document.getElementById("toggleAllDevices").addEventListener("click", function (e) { + DataGrid.ToggleSelectAll(); + }); +} +function clickStartRemoteControlButton() { + document.getElementById("startRemoteControlButton").addEventListener("click", function (e) { + var selectedDevices = DataGrid.GetSelectedDevices(); + if (selectedDevices.length == 0) { + ShowMessage("You must select a device first."); + } + else if (selectedDevices.length > 1) { + ShowMessage("You must select only one device to control."); + } + else { + WebCommands.find(x => x.Name == "RemoteControl").Execute([]); + } + }); +} +function consoleTabSelected() { + $(UI.ConsoleTab).on("shown.bs.tab", () => { + UI.ConsoleAlert.hidden = true; + UI.ConsoleAlert.innerText = "0"; + UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; + }); +} +function deviceGroupSelectChanged() { + UI.DeviceGroupSelect.addEventListener("change", (ev) => { + DataGrid.GridState.GroupFilter = UI.DeviceGroupSelect.value; + if (UI.DeviceGroupSelect.selectedIndex == 0) { + DataGrid.GridState.ShowAllGroups = true; + } + else { + DataGrid.GridState.ShowAllGroups = false; + } + DataGrid.ApplyFilterToAll(); + }); +} +function hideOfflineDevicesCheckboxChanged() { + UI.HideOfflineDevicesCheckbox.addEventListener("change", ev => { + DataGrid.GridState.HideOffline = UI.HideOfflineDevicesCheckbox.checked; + DataGrid.ApplyFilterToAll(); + }); +} +function inputOnCommandTextArea() { + UI.ConsoleTextArea.addEventListener("input", (e) => { + var commandMode = CommandProcessor.GetCommandModeShortcut(); + if (commandMode) { + UI.CommandModeSelect.value = commandMode; + UI.ConsoleTextArea.value = ""; + UI.CommandCompletionDiv.classList.add("hidden"); + } + else { + CommandProcessor.EvaluateCurrentCommandText(); + } + UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; + }); +} +function inputOnFilterTextBox() { + UI.GridFilter.addEventListener("input", (e) => { + var currentText = e.currentTarget.value.toLowerCase(); + DataGrid.GridState.SearchFilter = currentText; + DataGrid.ApplyFilterToAll(); + }); +} function keyDownOnInputTextArea() { UI.ConsoleTextArea.addEventListener("keydown", function (e) { if (!e.shiftKey) { @@ -137,90 +241,4 @@ function keyDownOnWindow() { } }); } -function inputOnCommandTextArea() { - UI.ConsoleTextArea.addEventListener("input", (e) => { - var commandMode = CommandProcessor.GetCommandModeShortcut(); - if (commandMode) { - UI.CommandModeSelect.value = commandMode; - UI.ConsoleTextArea.value = ""; - UI.CommandCompletionDiv.classList.add("hidden"); - } - else { - CommandProcessor.EvaluateCurrentCommandText(); - } - UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; - }); -} -function inputOnFilterTextBox() { - UI.GridFilter.addEventListener("input", (e) => { - var currentText = e.currentTarget.value.toLowerCase(); - DataGrid.FilterOptions.SearchFilter = currentText; - DataGrid.ApplyFilter(); - }); -} -function consoleTabSelected() { - $(UI.ConsoleTab).on("shown.bs.tab", () => { - UI.ConsoleAlert.hidden = true; - UI.ConsoleAlert.innerText = "0"; - UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; - }); -} -function addAlertHandlers() { - UI.AlertsButton.addEventListener("click", ev => { - UI.AlertsFrame.classList.toggle("open"); - }); - UI.CloseAlertsButton.addEventListener("click", ev => { - UI.AlertsFrame.classList.toggle("open"); - }); - document.querySelectorAll(".alert-dismiss-button").forEach(element => { - element.addEventListener("click", ev => { - var alertID = ev.currentTarget.getAttribute("alert"); - var xhr = new XMLHttpRequest(); - xhr.open("delete", location.origin + "/api/Alerts/Delete/" + alertID); - xhr.onload = function () { - if (xhr.status == 200) { - document.getElementById(alertID).remove(); - var currentCount = Number(UI.AlertsCount.innerText); - currentCount--; - UI.AlertsCount.innerText = String(currentCount); - } - else { - ShowModal("API Error", "There was an error deleting the alert."); - } - }; - xhr.send(); - }); - }); -} -function clickToggleAllDevices() { - document.getElementById("toggleAllDevices").addEventListener("click", function (e) { - DataGrid.ToggleSelectAll(); - }); -} -function clickStartRemoteControlButton() { - document.getElementById("startRemoteControlButton").addEventListener("click", function (e) { - var selectedDevices = DataGrid.GetSelectedDevices(); - if (selectedDevices.length == 0) { - ShowMessage("You must select a device first."); - } - else if (selectedDevices.length > 1) { - ShowMessage("You must select only one device to control."); - } - else { - WebCommands.find(x => x.Name == "RemoteControl").Execute([]); - } - }); -} -function deviceGroupSelectChanged() { - UI.DeviceGroupSelect.addEventListener("change", (ev) => { - DataGrid.FilterOptions.GroupFilter = UI.DeviceGroupSelect.value; - if (UI.DeviceGroupSelect.selectedIndex == 0) { - DataGrid.FilterOptions.ShowAllGroups = true; - } - else { - DataGrid.FilterOptions.ShowAllGroups = false; - } - DataGrid.ApplyFilter(); - }); -} //# sourceMappingURL=InputEventHandlers.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/InputEventHandlers.js.map b/Server/wwwroot/scripts/Main/InputEventHandlers.js.map index 73d14460d..134c4aecc 100644 --- a/Server/wwwroot/scripts/Main/InputEventHandlers.js.map +++ b/Server/wwwroot/scripts/Main/InputEventHandlers.js.map @@ -1 +1 @@ -{"version":3,"file":"InputEventHandlers.js","sourceRoot":"","sources":["InputEventHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChI,OAAO,KAAK,EAAE,MAAM,SAAS,C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EAAE,EAAE;QACpD,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC,eAAe,CAAC;YACvD,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,QAAQ;YACxD,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,OAAO;YACvD,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,UAAU;YAC1D,CAAC,CAAC,CAAC,MAAM;YACT,CAAC,CAAC,CAAC,OAAO,EAAE;YACZ,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;SAC9B;QACD,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,EAAE;YACzC,EAAE,CAAC,gBAAgB,CAAC,SAAS,GAAG,EAAE,CAAC;SACtC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/InputEventHandlers.ts b/Server/wwwroot/scripts/Main/InputEventHandlers.ts index bb9f6ba8f..fce4929db 100644 --- a/Server/wwwroot/scripts/Main/InputEventHandlers.ts +++ b/Server/wwwroot/scripts/Main/InputEventHandlers.ts @@ -19,16 +19,59 @@ export function ApplyInputEventHandlers() { deviceGroupSelectChanged(); addAlertHandlers(); hideOfflineDevicesCheckboxChanged(); + addGridPaginationHandlers(); window.addEventListener("resize", ev => { PositionCommandCompletionWindow(); }); } -function hideOfflineDevicesCheckboxChanged() { - UI.HideOfflineDevicesCheckbox.addEventListener("change", ev => { - DataGrid.FilterOptions.HideOffline = UI.HideOfflineDevicesCheckbox.checked; - DataGrid.ApplyFilter(); +function addGridPaginationHandlers() { + UI.LeftPaginationButton.addEventListener("click", (ev) => { + DataGrid.PageDown(); + }); + + UI.RightPaginationButton.addEventListener("click", (ev) => { + DataGrid.PageUp(); + }); + + var changePageTimeout = -1; + UI.CurrentPageInput.addEventListener("input", (ev) => { + if (changePageTimeout > 0) { + window.clearTimeout(changePageTimeout); + } + changePageTimeout = window.setTimeout(() => { + DataGrid.GoToCurrentPage(); + }, 2000); + }); +} + +function addAlertHandlers() { + UI.AlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); + UI.CloseAlertsButton.addEventListener("click", ev => { + UI.AlertsFrame.classList.toggle("open"); + }); + + document.querySelectorAll(".alert-dismiss-button").forEach(element => { + element.addEventListener("click", ev => { + var alertID = (ev.currentTarget as HTMLButtonElement).getAttribute("alert"); + var xhr = new XMLHttpRequest(); + xhr.open("delete", location.origin + "/api/Alerts/Delete/" + alertID); + xhr.onload = function () { + if (xhr.status == 200) { + document.getElementById(alertID).remove(); + var currentCount = Number(UI.AlertsCount.innerText); + currentCount--; + UI.AlertsCount.innerText = String(currentCount); + } + else { + ShowModal("API Error", "There was an error deleting the alert."); + } + }; + xhr.send(); + }) }); } @@ -75,6 +118,78 @@ function arrowUpOrDownOnTextArea(e: KeyboardEvent) { } } +function clickToggleAllDevices() { + document.getElementById("toggleAllDevices").addEventListener("click", function (e) { + DataGrid.ToggleSelectAll(); + }) +} + +function clickStartRemoteControlButton() { + document.getElementById("startRemoteControlButton").addEventListener("click", function (e) { + var selectedDevices = DataGrid.GetSelectedDevices(); + if (selectedDevices.length == 0) { + ShowMessage("You must select a device first."); + } + else if (selectedDevices.length > 1) { + ShowMessage("You must select only one device to control."); + } + else { + WebCommands.find(x => x.Name == "RemoteControl").Execute([]); + } + }) +} + +function consoleTabSelected() { + $(UI.ConsoleTab).on("shown.bs.tab", () => { + UI.ConsoleAlert.hidden = true; + UI.ConsoleAlert.innerText = "0"; + UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; + }); +} + +function deviceGroupSelectChanged() { + UI.DeviceGroupSelect.addEventListener("change", (ev) => { + DataGrid.GridState.GroupFilter = UI.DeviceGroupSelect.value; + if (UI.DeviceGroupSelect.selectedIndex == 0) { + DataGrid.GridState.ShowAllGroups = true; + } + else { + DataGrid.GridState.ShowAllGroups = false; + } + DataGrid.ApplyFilterToAll(); + }); +} + +function hideOfflineDevicesCheckboxChanged() { + UI.HideOfflineDevicesCheckbox.addEventListener("change", ev => { + DataGrid.GridState.HideOffline = UI.HideOfflineDevicesCheckbox.checked; + DataGrid.ApplyFilterToAll(); + }); +} + +function inputOnCommandTextArea() { + UI.ConsoleTextArea.addEventListener("input", (e: KeyboardEvent) => { + var commandMode = CommandProcessor.GetCommandModeShortcut(); + if (commandMode) { + UI.CommandModeSelect.value = commandMode; + UI.ConsoleTextArea.value = ""; + UI.CommandCompletionDiv.classList.add("hidden"); + } + else { + CommandProcessor.EvaluateCurrentCommandText(); + } + UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; + }); +} + +function inputOnFilterTextBox() { + UI.GridFilter.addEventListener("input", (e) => { + var currentText = (e.currentTarget as HTMLInputElement).value.toLowerCase(); + DataGrid.GridState.SearchFilter = currentText; + DataGrid.ApplyFilterToAll(); + }) +} + function keyDownOnInputTextArea() { UI.ConsoleTextArea.addEventListener("keydown", function (e: KeyboardEvent) { if (!e.shiftKey) { @@ -143,94 +258,4 @@ function keyDownOnWindow() { UI.ConsoleOutputDiv.innerHTML = ""; } }); -} - -function inputOnCommandTextArea() { - UI.ConsoleTextArea.addEventListener("input", (e: KeyboardEvent) => { - var commandMode = CommandProcessor.GetCommandModeShortcut(); - if (commandMode) { - UI.CommandModeSelect.value = commandMode; - UI.ConsoleTextArea.value = ""; - UI.CommandCompletionDiv.classList.add("hidden"); - } - else { - CommandProcessor.EvaluateCurrentCommandText(); - } - UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; - }); -} -function inputOnFilterTextBox() { - UI.GridFilter.addEventListener("input", (e) => { - var currentText = (e.currentTarget as HTMLInputElement).value.toLowerCase(); - DataGrid.FilterOptions.SearchFilter = currentText; - DataGrid.ApplyFilter(); - }) -} -function consoleTabSelected() { - $(UI.ConsoleTab).on("shown.bs.tab", () => { - UI.ConsoleAlert.hidden = true; - UI.ConsoleAlert.innerText = "0"; - UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight; - }); -} -function addAlertHandlers() { - UI.AlertsButton.addEventListener("click", ev => { - UI.AlertsFrame.classList.toggle("open"); - }); - UI.CloseAlertsButton.addEventListener("click", ev => { - UI.AlertsFrame.classList.toggle("open"); - }); - - document.querySelectorAll(".alert-dismiss-button").forEach(element => { - element.addEventListener("click", ev => { - var alertID = (ev.currentTarget as HTMLButtonElement).getAttribute("alert"); - var xhr = new XMLHttpRequest(); - xhr.open("delete", location.origin + "/api/Alerts/Delete/" + alertID); - xhr.onload = function () { - if (xhr.status == 200) { - document.getElementById(alertID).remove(); - var currentCount = Number(UI.AlertsCount.innerText); - currentCount--; - UI.AlertsCount.innerText = String(currentCount); - } - else { - ShowModal("API Error", "There was an error deleting the alert."); - } - }; - xhr.send(); - }) - }); -} -function clickToggleAllDevices() { - document.getElementById("toggleAllDevices").addEventListener("click", function (e) { - DataGrid.ToggleSelectAll(); - }) -} - -function clickStartRemoteControlButton() { - document.getElementById("startRemoteControlButton").addEventListener("click", function (e) { - var selectedDevices = DataGrid.GetSelectedDevices(); - if (selectedDevices.length == 0) { - ShowMessage("You must select a device first."); - } - else if (selectedDevices.length > 1) { - ShowMessage("You must select only one device to control."); - } - else { - WebCommands.find(x => x.Name == "RemoteControl").Execute([]); - } - }) -} - -function deviceGroupSelectChanged() { - UI.DeviceGroupSelect.addEventListener("change", (ev) => { - DataGrid.FilterOptions.GroupFilter = UI.DeviceGroupSelect.value; - if (UI.DeviceGroupSelect.selectedIndex == 0) { - DataGrid.FilterOptions.ShowAllGroups = true; - } - else { - DataGrid.FilterOptions.ShowAllGroups = false; - } - DataGrid.ApplyFilter(); - }); } \ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/UI.js b/Server/wwwroot/scripts/Main/UI.js index 7fbba4c38..bd4a0cc2b 100644 --- a/Server/wwwroot/scripts/Main/UI.js +++ b/Server/wwwroot/scripts/Main/UI.js @@ -10,15 +10,20 @@ export var ConsoleFrame = document.getElementById("consoleFrame"); export var ConsoleOutputDiv = document.querySelector("#consoleOutputDiv"); export var ConsoleTab = document.getElementById("consoleTab"); export var ConsoleTextArea = document.querySelector("#consoleTextArea"); +export var CurrentPageInput = document.querySelector("#currentPageInput"); export var DeviceGrid = document.querySelector("#deviceGrid"); +export var DeviceGridBody = document.querySelector("#deviceGrid tbody"); export var DeviceGroupSelect = document.getElementById("deviceGroupSelect"); export var DevicesSelectedCount = document.querySelector("#devicesSelectedSpan"); export var GridFilter = document.getElementById("gridFilter"); export var HideOfflineDevicesCheckbox = document.querySelector("#hideOfflineDevicesCheckbox"); +export var LeftPaginationButton = document.querySelector("#leftPaginationButton"); export var MeasurementCanvas = document.createElement("canvas"); export var MeasurementContext = MeasurementCanvas.getContext("2d"); export var OnlineDevicesCount = document.querySelector("#onlineDevicesSpan"); +export var RightPaginationButton = document.querySelector("#rightPaginationButton"); export var TabContentWrapper = document.getElementById("tabContentWrapper"); export var ToastsWrapper = document.getElementById("toastsWrapper"); export var TotalDevicesCount = document.querySelector("#totalDevicesSpan"); +export var TotalPagesSpan = document.querySelector("#totalPagesSpan"); //# sourceMappingURL=UI.js.map \ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/UI.js.map b/Server/wwwroot/scripts/Main/UI.js.map index 47f3cd17e..77ad0a6ba 100644 --- a/Server/wwwroot/scripts/Main/UI.js.map +++ b/Server/wwwroot/scripts/Main/UI.js.map @@ -1 +1 @@ -{"version":3,"file":"UI.js","sourceRoot":"","sources":["UI.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAI,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,cAAc,CAAsB,CAAC;AACvF,MAAM,CAAC,IAAI,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAoB,CAAC;AACnF,MAAM,CAAC,IAAI,WAAW,GAAG,QAAQ,CAAC,cAAc,CAA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AAC,IAAI,qBAAqB,GAAG,QAAQ,CAAC,aAAa,CAAC,wBAAwB,CAAsB,CAAC;AACzG,MAAM,CAAC,IAAI,iBAAiB,GAAG,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAmB,CAAC;AAC9F,MAAM,CAAC,IAAI,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAmB,CAAC;AACtF,MAAM,CAAC,IAAI,iBAAiB,GAAG,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAoB,CAAC;AAC9F,MAAM,CAAC,IAAI,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAoB,CAAC"} \ No newline at end of file diff --git a/Server/wwwroot/scripts/Main/UI.ts b/Server/wwwroot/scripts/Main/UI.ts index b51bc2220..7e9a4ab7e 100644 --- a/Server/wwwroot/scripts/Main/UI.ts +++ b/Server/wwwroot/scripts/Main/UI.ts @@ -10,14 +10,19 @@ export var ConsoleFrame = document.getElementById("consoleFrame") as HTMLDivElem export var ConsoleOutputDiv = document.querySelector("#consoleOutputDiv") as HTMLDivElement; export var ConsoleTab = document.getElementById("consoleTab") as HTMLAnchorElement; export var ConsoleTextArea = document.querySelector("#consoleTextArea") as HTMLTextAreaElement; +export var CurrentPageInput = document.querySelector("#currentPageInput") as HTMLInputElement; export var DeviceGrid = document.querySelector("#deviceGrid") as HTMLTableElement; +export var DeviceGridBody = document.querySelector("#deviceGrid tbody") as HTMLBodyElement; export var DeviceGroupSelect = document.getElementById("deviceGroupSelect") as HTMLSelectElement; export var DevicesSelectedCount = document.querySelector("#devicesSelectedSpan") as HTMLSpanElement; export var GridFilter = document.getElementById("gridFilter") as HTMLInputElement; export var HideOfflineDevicesCheckbox = document.querySelector("#hideOfflineDevicesCheckbox") as HTMLInputElement; +export var LeftPaginationButton = document.querySelector("#leftPaginationButton") as HTMLButtonElement; export var MeasurementCanvas = document.createElement("canvas"); export var MeasurementContext = MeasurementCanvas.getContext("2d"); export var OnlineDevicesCount = document.querySelector("#onlineDevicesSpan") as HTMLSpanElement; +export var RightPaginationButton = document.querySelector("#rightPaginationButton") as HTMLButtonElement; export var TabContentWrapper = document.getElementById("tabContentWrapper") as HTMLDivElement; export var ToastsWrapper = document.getElementById("toastsWrapper") as HTMLDivElement; -export var TotalDevicesCount = document.querySelector("#totalDevicesSpan") as HTMLSpanElement; \ No newline at end of file +export var TotalDevicesCount = document.querySelector("#totalDevicesSpan") as HTMLSpanElement; +export var TotalPagesSpan = document.querySelector("#totalPagesSpan") as HTMLSpanElement; \ No newline at end of file