-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworked webui reader #156
Conversation
WalkthroughThe changes made enhance debugging capabilities and improve the user interface for log management. Key updates include enabling debug mode, adjusting RTSP settings for better network streaming, adding log file reading functionality, creating a new endpoint for log display, optimizing routes, and enhancing the log viewing page. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (2)
views/logs.html (2)
33-33
: Consider providing a more informative error message than "It didn't work" to enhance user understanding in case logs cannot be displayed.
47-49
: Consider using a more universally understood method for date formatting or add a comment explaining why the 'sv' locale is used here fortoLocaleString
.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- .gitignore (1 hunks)
- internal/conf/config.yaml (2 hunks)
- internal/httpcontroller/fileserver.go (2 hunks)
- internal/httpcontroller/handlers.go (1 hunks)
- internal/httpcontroller/routes.go (2 hunks)
- views/logs.html (1 hunks)
Files skipped from review due to trivial changes (2)
- .gitignore
- internal/conf/config.yaml
Additional comments not posted (3)
internal/httpcontroller/fileserver.go (1)
Line range hint
10-37
: The custom file server setup is correctly implemented and effectively uses Echo's capabilities to serve files with appropriate MIME types.internal/httpcontroller/routes.go (1)
69-69
: The addition of the/logs
route is correctly implemented and aligns with the PR's objectives to enhance log reading functionality.internal/httpcontroller/handlers.go (1)
391-405
: The implementation ofgetLogsHandler
is robust, correctly handling the reading of log files and rendering the logs view appropriately.
// It returns an error if there is an issue opening or reading the file. | ||
func readWebLog() (string, error) { | ||
// Open the web.log file | ||
file, err := os.Open("webui.log") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making the file path for webui.log
configurable to enhance flexibility and maintainability.
The webui doesn't have much going on, but the basis is there to read the other logfile too. Might add two links under logs. Or just paste all logs to webui.log and have a single one? |
.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not include this in in pull request, this is unnecessary change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry my bad.
Removed forgotten parts
removed forgotten modifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- internal/conf/config.yaml (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- internal/conf/config.yaml
reverted to base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- internal/conf/config.yaml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- internal/conf/config.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's going on here.
abdandoning this for now |
Reworked the webui.log reader. Placed the functions it what seems the right folders. #153 & #138
Couldn't for the life of me get the templating working like settings, just created a work around in logs.html. Pretty much just index.html copied and removed some parts.
Need to work on making it dynamic as it depends on refreshing the browser.
Being a gitnoob i commited my changes to config, can ignore them.
Might need to be carefull about CSS attacks cus the function reads the webui log and posts as is, if someones puts some code in there ? I think code rabbit will flag it up again.