Add spinner for database maintenance

This commit is contained in:
Mashintime 2023-07-04 13:49:23 -04:00
parent b4c658165d
commit 31be9a66bc
4 changed files with 13 additions and 1 deletions

View file

@ -416,6 +416,11 @@ ipcMain.on("request-clear-chat-connected", () => {
chat.webContents.send("action-clear-reception-status");
});
ipcMain.on("request-update-dbclean-spinner", () => {
//Turn off dbclean spinner
win.webContents.send("action-update-dbclean-spinner");
});
// UPDATE TNC CONNECTION
ipcMain.on("request-update-tnc-ip", (event, data) => {
win.webContents.send("action-update-tnc-ip", data);

View file

@ -2913,4 +2913,5 @@ async function dbClean() {
itemCount +
" items removed from database. It's recommended you now restart the GUI."
);
ipcRenderer.send("request-update-dbclean-spinner");
}

View file

@ -1657,6 +1657,7 @@ window.addEventListener("DOMContentLoaded", () => {
// btnCleanDB button clicked
document.getElementById("btnCleanDB").addEventListener("click", () => {
document.getElementById("divCleanDBSpinner").classList.remove("invisible");
ipcRenderer.send("request-clean-db");
});
@ -1855,6 +1856,10 @@ function connectedStation(data) {
prefix + data.dxcallsign;
}
//Called by chat to turn off db clean spinner
ipcRenderer.on("action-update-dbclean-spinner",() =>{
document.getElementById("divCleanDBSpinner").classList.add("invisible");
});
//Listen for events caused by tnc 'tnc-message' rx
ipcRenderer.on("action-update-reception-status", (event, arg) => {
var data = arg["data"][0];

View file

@ -3830,7 +3830,8 @@
type="button"
>
Clean
</button>
</button>&nbsp;
<div class="spinner-border text-warning invisible" role="status" id="divCleanDBSpinner"></div>
</label>
</div>
<div class="center">