32 Commits

Author SHA1 Message Date
d3933374af refactor(middleware, monitoring, public): streamline metrics handling and remove top referers display
- Simplified MetricsMiddleware by removing unnecessary comments and focusing on essential request logging.
- Updated RequestLog structure to exclude the Referer field from JSON serialization, enhancing data privacy.
- Removed top referers tracking and associated HTML/CSS elements to declutter the user interface and improve performance.
- Cleaned up CSS styles related to referers for a more streamlined design.
2024-12-02 05:35:24 +08:00
6a0df0bdc7 feat(public): enhance system metrics display and user interface
- Added a main title to the index.html for better context.
- Introduced a new stats container to organize summary and detail statistics.
- Implemented a refresh animation for loading stats, improving user experience.
- Updated the updateStats function to streamline data handling and display.
- Enhanced the metrics section with improved formatting and error handling.
- Refined CSS styles for better visual presentation and responsiveness.
- Ensured a cleaner layout for system metrics and top referers, contributing to a more intuitive interface.
2024-12-01 02:47:23 +08:00
454fe7380f fix(public): update metrics API endpoint for consistency 2024-12-01 02:13:32 +08:00
260bddb56b refactor(public): improve metrics loading and display logic
- Updated the metrics API endpoint from '/metrics' to '/api/metrics' for better organization.
- Added data validation to ensure the metrics data received is an object, enhancing error handling.
- Refactored the updateMetricsDisplay function to dynamically create metric items, improving the display of metrics.
- Implemented HTML escaping for metric keys and values to prevent XSS vulnerabilities.
- Cleared existing content in the metrics container before updating, ensuring a clean display.
2024-12-01 01:49:50 +08:00
813d87531f refactor(monitoring, public): enhance system metrics and update display logic
- Streamlined SystemMetrics by removing unnecessary fields and focusing on essential metrics such as AverageLatency and MemoryStats.
- Updated LogRequest to improve handling of referers and average latency calculations, ensuring accurate metrics collection.
- Enhanced the HTML display to include a dedicated section for system metrics, ensuring graceful handling of undefined values.
- Improved the presentation of top referers with a time-based reset mechanism, contributing to a cleaner and more efficient user interface.
2024-12-01 01:43:54 +08:00
8d0d502910 refactor(monitoring, public): remove recent requests tracking and update metrics display
- Removed the RecentRequests field from SystemMetrics and its associated logic in LogRequest to streamline metrics collection.
- Updated the HTML to eliminate the recent requests section, focusing on the top referers display for improved performance and clarity.
- Enhanced the overall metrics presentation by ensuring only relevant data is displayed, contributing to a cleaner user interface.
2024-12-01 01:25:24 +08:00
f92b8385d8 fix(handlers, public): update timestamp logging to use Unix milliseconds
- Changed timestamp logging in the HandleAPIRequest function to use Unix milliseconds for improved precision.
- Updated the recent requests display in the HTML to correctly parse and format timestamps using the new millisecond format, enhancing readability and consistency in metrics presentation.
2024-12-01 00:55:20 +08:00
386e80914f refactor(monitoring, public): streamline latency formatting and metrics logging
- Removed the obsolete formatLatency function from metrics.go to simplify the codebase.
- Updated the HTML to utilize the new latency formatting method, ensuring consistent display of average latency metrics.
- Enhanced the LogRequest function to accurately calculate and update average latency based on request counts, improving metrics accuracy.
2024-12-01 00:46:16 +08:00
1248508302 refactor(handlers, monitoring): improve API request handling and metrics logging
- Refactored HandleAPIRequest to use a result channel for better error handling and response management.
- Updated metrics logging to directly use the full referer instead of just the main domain, enhancing data accuracy.
- Fixed recent requests display in HTML to correctly format timestamps for better readability.
2024-12-01 00:37:50 +08:00
2720f6ebf0 feat(monitoring, public): improve latency formatting and enhance metrics logging
- Updated latency formatting in Go and JavaScript to display three decimal places for improved precision.
- Enhanced LogRequest function to store only the main domain of the referer, improving data clarity.
- Added MarshalJSON method to SystemMetrics for better JSON representation of request counts.
2024-12-01 00:29:48 +08:00
83e0226e41 feat(monitoring, public): enhance metrics logging and display
- Added a new function to format latency metrics in both Go and JavaScript for improved readability.
- Updated the LogRequest function to parse and store only the domain of the referer, enhancing data clarity.
- Modified the recent requests and top referers display logic in the HTML to improve performance and maintainability.
- Ensured that the recent requests are displayed in a more user-friendly format, including formatted latency values.
2024-12-01 00:03:26 +08:00
1b2fd3ea85 feat(handlers, monitoring, public): enhance API request handling and improve metrics logging
- Implemented detailed logging for API requests, including real IP, referer, and latency metrics.
- Added dynamic routing for handling requests to /pic/ and /video/ endpoints.
- Enhanced error handling for CSV content fetching and improved response messages.
- Updated the HTML and JavaScript to load and display statistics more efficiently, including filtering based on endpoint configuration.
- Introduced new metrics collection logic to only log relevant API requests, optimizing performance and clarity.
2024-11-30 23:52:31 +08:00
e70ca4cf52 feat(docker, config, api): update docker-compose for logging, enhance app structure, and add system metrics display
- Updated docker-compose.yml to mount logs directory.
- Changed BASE_URL environment variable to point to the new API endpoint.
- Refactored main.go to implement a structured App type, improving initialization and graceful shutdown.
- Enhanced config management with JSON loading and environment variable support.
- Added monitoring capabilities in api_handler for logging request metrics.
- Introduced new metrics display in index.html with corresponding CSS styles for better visualization.
2024-11-30 23:23:58 +08:00
a4d6890a78 refactor(public, services): improve HTML structure and optimize CSV service logging 2024-11-16 05:45:24 +08:00
88986bb637 refactor: update analytics script in index.html 2024-11-15 18:29:48 +08:00
098abf86bf feat(public): add clarity analytics script 2024-11-15 15:14:14 +08:00
275190681c docs(public): Update statistics start date to 2024-11-1 2024-11-02 13:12:39 +08:00
f8f14165d2 docs: add description meta tag to index.html 2024-11-02 13:04:53 +08:00
e03550423d fix: Update start date in stats update function 2024-11-02 13:03:02 +08:00
a6cc6454f9 refactor(public): update favicon and stylesheet links, markdown-it version 2024-10-30 23:14:58 +08:00
73dfc63d36 style: Update header level in stats summary 2024-10-28 15:18:21 +08:00
abd9c75e7f style(public/css, public/index.html): Update fade class and endpoint-link color, fetch stats from local server, add view column and update interval 2024-10-27 20:57:27 +08:00
9436878ea5 refactor(index.html): optimize endpoint config loading and stats refresh handling 2024-10-27 09:17:22 +08:00
dc6cc93055 refactor(index.html): Refactor endpoint configuration and stats display logic 2024-10-27 09:07:54 +08:00
861835ef92 feat(public): update index.html, add main.css, and enhance stats display 2024-10-27 06:00:10 +08:00
09e4d8ccf7 style(public): update layout and text in index.html and index.md
Update layout and text to improve user experience
2024-10-26 15:08:00 +08:00
8c7c01032c feat(ui): update stats summary style and add refresh animation 2024-10-26 14:47:16 +08:00
ff2163b207 feat: update random-api-go service and UI with stats display 2024-10-26 14:28:04 +08:00
a3397617cc feat: Update HTML structure and add new CSS styles 2024-10-21 06:00:10 +08:00
dedc2bbc19 更新CDN链接及字体样式链接 2024-10-10 10:17:53 +08:00
cc21fd2dfa 更新CDN链接并引入新的字体样式 2024-10-09 14:55:59 +08:00
7fd2ac2283 first commit 2024-09-12 15:48:31 +08:00