|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <!DOCTYPE html>
- <html lang="en">
-
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Monitoring Tool</title>
- <style>
- body {
- font-family: Arial, sans-serif;
- margin: 20px;
- }
-
- table {
- width: 100%;
- max-width: 600px;
- margin: 20px auto;
- border-collapse: collapse;
- }
-
- td {
- padding: 10px;
- }
-
- label {
- font-weight: bold;
- }
-
- button {
- display: block;
- margin: 20px auto;
- padding: 10px 20px;
- font-size: 16px;
- cursor: pointer;
- background-color: #007bff;
- color: white;
- border: none;
- border-radius: 5px;
- }
-
- button:hover {
- background-color: #0056b3;
- }
-
- textarea {
- width: 100%;
- min-height: 60px;
- }
-
- input, select {
- width: 100%;
- }
-
- h1 {
- text-align: center;
- color: #333;
- }
-
- .section {
- margin: 40px 0;
- }
- </style>
- </head>
-
- <body>
- <!-- Token Saving Section -->
- <div class="section">
- <h1>Save Token</h1>
- <form id="tokenForm">
- <table>
- <tr>
- <td>
- <label for="token">Token:</label>
- </td>
- <td>
- <input type="text" id="token" placeholder="Enter your token" required />
- </td>
- </tr>
- </table>
- <button type="submit">Save Token</button>
- </form>
- </div>
-
- <!-- Check-Out Form Section -->
- <div class="section">
- <h1>Check Out Form</h1>
- <form id="taskForm">
- <table>
- <tr>
- <td>
- <label for="tasks">Tasks:</label>
- </td>
- <td>
- <textarea id="tasks" placeholder="Describe your tasks..." required></textarea>
- </td>
- </tr>
- </table>
- <button type="submit">Submit Check-Out</button>
- </form>
- </div>
-
- <script>
- // Handle token saving
- const tokenForm = document.getElementById('tokenForm');
- const tokenInput = document.getElementById('token');
- if (localStorage.token) {
- tokenInput.value = localStorage.token;
- }
-
- tokenForm.addEventListener('submit', (e) => {
- e.preventDefault();
- const token = tokenInput.value.trim();
- if (token) {
- localStorage.token = token;
- alert('Token saved successfully!');
- } else {
- alert('Please enter a valid token.');
- }
- });
-
- // Handle check-out form submission
- const taskForm = document.getElementById('taskForm');
- taskForm.addEventListener('submit', (e) => {
- e.preventDefault();
- const project = document.getElementById('project').value;
- const tasks = document.getElementById('tasks').value;
- const token = localStorage.token || '';
-
- if (!token) {
- alert('Please save your token first.');
- return;
- }
-
- // Send data to Electron main process
- window.electronAPI.submitCheckout({ project, tasks, token });
-
- // Display success message
- alert('Check-Out submitted successfully!');
- });
- </script>
- </body>
-
- </html>
|