-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2978 from bsc7/feature/2634/Simple_HTML_NodeMonitor
Simple HTML frontend for Bisq 2 monitor
- Loading branch information
Showing
17 changed files
with
1,100 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
apps/rest-api-app/src/main/resources/node-monitor/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# Bisq Node Monitor Application | ||
|
||
## Overview | ||
|
||
The **Bisq Node Monitor** is a web application designed to monitor Bisq nodes. | ||
The application provides a user interface to input a list of hosts and ports, retrieves their status from an API, and displays the results in a structured and interactive format. | ||
|
||
## Project Structure | ||
|
||
The project is organized into different modules to ensure a clear separation of concerns and ease of maintenance. Each part of the application has a dedicated file or directory, as outlined below: | ||
|
||
``` | ||
projekt-root/ | ||
│ | ||
├── index.html # Main HTML file that defines the application's structure | ||
├── index.js # Main JavaScript file for initializing the application | ||
├── README.md # Project README file with documentation | ||
│ | ||
├── js/ # JavaScript files organized by functionality | ||
│ ├── constants.js # Global constants used throughout the application | ||
│ ├── controllers/ # Application controllers | ||
│ │ └── appController.js # Main application controller for handling user input and API calls | ||
│ ├── services/ # Application services for data and storage management | ||
│ │ ├── dataService.js # Service handling API requests and data retrieval | ||
│ │ └── storageService.js # Service for handling local storage interactions | ||
│ └── views/ # View components for different sections | ||
│ ├── settingsView.js # View handling settings display and input | ||
│ └── reportView.js # View managing the display of node reports | ||
│ | ||
└── styles/ # Directory containing CSS files for styling | ||
├── global.css # Global styles, typography, colors, and basic element styling | ||
├── page-layout.css # Layout and positioning of main areas, responsive styling | ||
├── reportView.css # Styling for the report view section | ||
└── settingsView.css # Styling for the settings view section | ||
``` |
61 changes: 61 additions & 0 deletions
61
apps/rest-api-app/src/main/resources/node-monitor/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!-- ./index.html --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Bisq Node Monitor</title> | ||
<link rel="stylesheet" href="styles/global.css"> | ||
<link rel="stylesheet" href="styles/settingsView.css"> | ||
<link rel="stylesheet" href="styles/reportView.css"> | ||
<link rel="stylesheet" href="styles/page-layout.css"> | ||
</head> | ||
<body> | ||
|
||
<h2>Bisq Node Monitor</h2> | ||
|
||
<div class="hamburger-menu" id="hamburgerButton"> | ||
☰ | ||
</div> | ||
|
||
<div id="settingsPanel" style="display: none;"> | ||
<h3>Settings</h3> | ||
<div> | ||
<label>Host List (comma or newline separated):</label> | ||
<textarea id="hostListInput" placeholder="Host:port list, separated by commas or new lines" rows="9" style="width: 100%;"></textarea> | ||
</div> | ||
<button id="fetchRemoteListButton" class="toggle-button" style="margin-top: 10px;">Fetch Remote Host List</button> | ||
<div> | ||
<label>Port List (comma or newline separated, optional):</label> | ||
<textarea id="portListInput" placeholder="Port list for filtering, separated by commas or new lines" rows="3" style="width: 100%;"></textarea> | ||
</div> | ||
<button id="saveConfigButton" class="toggle-button" style="margin-top: 10px;">Save Configuration</button> | ||
</div> | ||
|
||
<div class="button-container"> | ||
<button id="reloadButton" class="button button--green">Reload Data</button> | ||
<button id="toggleAllButton" class="button button--blue" style="display: none;">Expand All Details</button> | ||
</div> | ||
|
||
<div id="statusMessage" style="display: none; text-align: center; margin-top: 20px; color: grey;"> | ||
<!-- Dynamically generated message data will appear here --> | ||
</div> | ||
|
||
<div id="reportContainer"> | ||
<!-- Dynamically generated node data will appear here --> | ||
</div> | ||
|
||
<script> | ||
window.App = window.App || {}; | ||
</script> | ||
|
||
<script src="js/constants.js"></script> | ||
<script src="js/services/storageService.js"></script> | ||
<script src="js/services/dataService.js"></script> | ||
<script src="js/views/settingsView.js"></script> | ||
<script src="js/views/reportView.js"></script> | ||
<script src="js/controllers/appController.js"></script> | ||
<script src="index.js"></script> | ||
</body> | ||
</html> | ||
|
11 changes: 11 additions & 0 deletions
11
apps/rest-api-app/src/main/resources/node-monitor/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// index.js | ||
// Namespace for the application | ||
window.App = window.App || {}; | ||
|
||
document.addEventListener("DOMContentLoaded", () => { | ||
const dataService = new App.Services.DataService(); | ||
const storageService = new App.Services.StorageService(); | ||
|
||
const appController = new App.Controllers.AppController(dataService, storageService); | ||
appController.initApp(); | ||
}); |
15 changes: 15 additions & 0 deletions
15
apps/rest-api-app/src/main/resources/node-monitor/js/constants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// js/constants.js | ||
App.Constants = { | ||
API_URL_GET_REPORT: 'http://localhost:8082/api/v1/report/get-report', | ||
API_URL_GET_ADDRESS_LIST: 'http://localhost:8082/api/v1/report/get-address-list', | ||
STATUS_ERROR: "Failed to fetch data", | ||
STATUS_ENTER_HOSTS: "Please enter a Host:port list in the settings to start fetching data.", | ||
PLACEHOLDER_HOST_LIST: "Host:port list, separated by commas or new lines.\n# Comments and empty lines are alowed.", | ||
PLACEHOLDER_PORT_LIST: "Port list, for filtering hosts. Separated by commas or new lines.\n# Comments and empty lines are alowed.", | ||
BUTTON_EXPAND_ALL: "Expand All Details", | ||
BUTTON_COLLAPSE_ALL: "Collapse All Details", | ||
BUTTON_EXPAND_DETAILS: "Expand Details", | ||
BUTTON_COLLAPSE_DETAILS: "Collapse Details", | ||
HOSTS_COOKIE_KEY: 'hosts', | ||
PORTS_COOKIE_KEY: 'ports', | ||
}; |
Oops, something went wrong.