feat: set log timezone, closes #56

Implement a CLI arg, and config file setting, for changing the timezone of the Docker logs timestamp
This commit is contained in:
Jack Wills
2025-02-21 11:03:19 +00:00
parent 8305e6fda6
commit 17a5e7a258
27 changed files with 1122 additions and 163 deletions
+6
View File
@@ -7,6 +7,8 @@
"show_self": false,
"show_std_err": false,
"show_timestamp": true,
"timezone": "Etc/UTC",
"timestamp_format":"%Y-%m-%dT%H:%M:%S.%8f",
"use_cli": false,
"colors": {
"borders": {
@@ -68,6 +70,10 @@
"text": "black",
"text_selected": "gray"
},
"logs": {
"background": "reset",
"text": "reset"
},
"popup_delete": {
"background": "white",
"text": "black",
+13 -1
View File
@@ -1,7 +1,7 @@
{
// Example JSONC config file
// This needs to be renamed to "config.jsonc" ("config.json" will also work, even if the file is actually a jsonc) in order for oxker to automatically load
// oxker will also read .jsonc and .json files which use the same key/value structure & format as this file
// oxker will also read .toml and .json files which use the same key/value structure & format as this file
// Every key is optional, with defaults that oxker will choose if missing or invalid
// The `--config-file` cli argument can be used to load configuration files from any readable location
// Docker update interval in ms, minimum effectively 1000
@@ -20,6 +20,11 @@
"gui": true,
// Docker host location
"host": "/var/run/docker.sock",
// Display the timestamp in a custom format, if given option is invalid, it will default to %Y-%m-%dT%H:%M:%S.%8f -> 2025-02-18T12:34:56.01234567
// *Should* accept any valid strftime string up to 32 chars
"timestamp_format":"%Y-%m-%dT%H:%M:%S.%8f",
// Display the container logs timestamp with a given timezone, if timezone is unknown, defaults to UTC
"timezone": "Etc/UTC",
// Directory for saving exported logs, defaults to `$HOME`, this is automatically *correctly* calculated for Linux, Mac, and Windows
// "save_dir": "$HOME",
// Force use of docker cli when execing into containers, honestly mostly pointless
@@ -246,6 +251,13 @@
// Ports & IP listing text
"text": "white"
},
// The logs panel, will only be applied if color_logs is false
"logs": {
// Background color of panel
"background": "reset",
// text color
"text": "reset"
},
// The help popup
"popup_help": {
// Background color
+15 -4
View File
@@ -1,8 +1,5 @@
# Example toml config file
# This needs to be renamed to "config.toml" in order for oxker to automatically load
# oxker config file
# oxker will also read .jsonc and .json files which use the same key/value structure & format as this file
# Every key is optional, with defaults that oxker will choose if missing or invalid
# The `--config-file` cli argument can be used to load configuration files from any readable location
@@ -30,6 +27,13 @@ gui = true
# Docker host location
host = "/var/run/docker.sock"
# Display the container logs timestamp with a given timezone, if timezone is unknown, defaults to UTC
timezone = "Etc/UTC"
# Display the timestamp in a custom format, if given option is invalid, it will default to %Y-%m-%dT%H:%M:%S.%8f -> 2025-02-18T12:34:56.012345678Z
# *Should* accept any valid strftime string up to 32 chars
timestamp_format="%Y-%m-%dT%H:%M:%S.%8f"
# Directory for saving exported logs, defaults to `$HOME`, this is automatically *correctly* calculated for Linux, Mac, and Windows
# save_dir = "$HOME"
@@ -141,6 +145,13 @@ text_rx="#FFE9C1"
# Text color of the TX column
text_tx="#CD8C8C"
# The logs panel, will only be applied if color_logs is false
[colors.logs]
# Background color of panel
background = "reset"
# text color
text="reset"
# Each state of a container has a color, which is used in multiple places, i.e. chart titles, state/status/cpu/memory columns in the container section
[colors.container_state]
dead="red"