modified some titles and fixed reset database I

This commit is contained in:
andrei-mihnea-cerbu
2025-02-14 12:55:04 +02:00
parent 5c7e723bdc
commit b2f1ea01d3
9 changed files with 46 additions and 88 deletions
@@ -13,7 +13,7 @@
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/helpers.js"></script>
<title>Welcome</title>
<title>Restore Backup</title>
</head>
<body onload="fadeIn()">
<div class="container">
@@ -23,7 +23,7 @@
<img src="../assets/refresh-data.webp" alt="Backup Fetcher" class="backup-img">
<div class="loading-section">
<div class="spinner"></div>
<p>Backup is not searched, please wait...</p>
<p>Backup is now searched, please wait...</p>
</div>
</div>
</body>
@@ -13,7 +13,7 @@
<script src="../js/helpers.js"></script>
<script src="../js/reset_database.js"></script>
<title>UC Not Found</title>
<title>Reset Database</title>
</head>
<body onload="fadeIn()">
<div class="container">
@@ -23,7 +23,7 @@
<img src="../assets/2581896.png" style="margin-left: 20px" alt="Connecting to server" class="server-img">
<div class="loading-section">
<div class="spinner"></div>
<p>Please wait while we reset the database.</p>
<p>Please wait while we reset the database...</p>
</div>
</div>
</body>
+8 -2
View File
@@ -11,21 +11,27 @@ document.addEventListener('DOMContentLoaded', async function () {
// Open a TCP socket to the stored IP
if (!await window.networkAPI.openUcSocket()) {
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
await window.uiAPI.changeContent('main_menu');
return;
}
if (!await window.networkAPI.sendUcMessage(codeResetDatabase)) {
await window.uiAPI.showAlert('Failed to send login request.');
await window.uiAPI.changeContent('main_menu');
await window.networkAPI.closeUcSocket();
return;
}
const response = await waitForResponse();
if (response && response.operationCode !== codeOk) {
await window.uiAPI.showAlert('Database reset failed.');
await window.uiAPI.changeContent('main_menu');
await window.networkAPI.closeUcSocket();
return;
}
await window.networkAPI.closeUcSocket();
await new Promise(resolve => setTimeout(resolve, 2000));
fadeOut('login');
await window.databaseAPI.resetInternalDatabase();
await window.uiAPI.changeContent('welcome');
});
@@ -13,7 +13,7 @@
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/helpers.js"></script>
<title>Welcome</title>
<title>Restore Backup</title>
</head>
<body onload="fadeIn()">
<div class="container">
@@ -14,12 +14,12 @@
<script src="../js/helpers.js"></script>
<script src="../js/reset_database.js"></script>
<title>Welcome</title>
<title>Reset Database</title>
</head>
<body onload="fadeIn()">
<div class="container">
<div class="header">
<h1 class="title">Welcome to TeamVault</h1>
<h1 class="title">TeamVault</h1>
</div>
<img src="../assets/2581896.png" style="margin-left: 20px" alt="Connecting to server" class="server-img">
<div class="loading-section">