Skip to content

Commit f4d54e1

Browse files
committed
feat: config file, closes #47
Enable use of a config file, with custom keymap and custom colours
1 parent 4539d8a commit f4d54e1

37 files changed

+8724
-3878
lines changed

Cargo.lock

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ directories = "6.0"
3535
futures-util = "0.3"
3636
parking_lot = { version = "0.12" }
3737
ratatui = "0.29"
38+
serde = { version = "1.0", features = ["derive"] }
39+
serde_json = "1.0"
40+
serde_jsonc = "1.0"
3841
tokio = { version = "1.43", features = ["full"] }
3942
tokio-util = "0.7"
43+
toml = { version = "0.8", default-features = false, features = ["parse"] }
4044
tracing = "0.1"
4145
tracing-subscriber = "0.3"
4246
uuid = { version = "1.12", features = ["fast-rng", "v4"] }

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ docker compose -f ./docker/docker-compose.yml up -d
186186
or individually
187187

188188
```shell
189-
docker run --name redis -d redis:alpine3.19
189+
docker run --name redis -d redis:alpine3.21
190190
```
191191

192192
```shell
193-
docker run --name postgres -e POSTGRES_PASSWORD=never_use_this_password_in_production -d postgres:alpine3.19
193+
docker run --name postgres -e POSTGRES_PASSWORD=never_use_this_password_in_production -d postgres:alpine3.21
194194
```
195195

196196
```shell

example_config/example.config.json

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"color_logs": false,
3+
"docker_interval": 1000,
4+
"gui": true,
5+
"host": "/var/run/docker.sock",
6+
"raw_logs": false,
7+
"show_self": false,
8+
"show_std_err": false,
9+
"show_timestamp": true,
10+
"use_cli": false,
11+
"colors": {
12+
"borders": {
13+
"selected": "lightcyan",
14+
"unselected": "grey"
15+
},
16+
"chart_cpu": {
17+
"background": "reset",
18+
"border": "white",
19+
"max": "#FFB224",
20+
"points": "magenta",
21+
"title": "green",
22+
"y_axis": "white"
23+
},
24+
"chart_memory": {
25+
"background": "reset",
26+
"border": "white",
27+
"max": "#FFB224",
28+
"points": "cyan",
29+
"title": "green",
30+
"y_axis": "white"
31+
},
32+
"chart_ports": {
33+
"background": "reset",
34+
"border": "white",
35+
"headings": "yellow",
36+
"text": "white",
37+
"title": "green"
38+
},
39+
"commands": {
40+
"background": "reset",
41+
"delete": "gray",
42+
"pause": "yellow",
43+
"restart": "magenta",
44+
"resume": "blue",
45+
"start": "green",
46+
"stop": "red"
47+
},
48+
"container_state": {
49+
"dead": "red",
50+
"exited": "red",
51+
"paused": "yellow",
52+
"removing": "lightred",
53+
"restarting": "lightgreen",
54+
"running_healthy": "green",
55+
"running_unhealthy": "#FFB224",
56+
"unknown": "red"
57+
},
58+
"containers": {
59+
"background": "reset",
60+
"icon": "white",
61+
"text": "blue",
62+
"text_rx": "#FFE9C1",
63+
"text_tx": "#CD8C8C"
64+
},
65+
"headers_bar": {
66+
"background": "magenta",
67+
"loading_spinner": "white",
68+
"text": "black",
69+
"text_selected": "gray"
70+
},
71+
"popup_delete": {
72+
"background": "white",
73+
"text": "black",
74+
"text_highlight": "red"
75+
},
76+
"popup_error": {
77+
"background": "red",
78+
"text": "white"
79+
},
80+
"popup_help": {
81+
"background": "magenta",
82+
"text": "black",
83+
"text_highlight": "white"
84+
},
85+
"popup_info": {
86+
"background": "blue",
87+
"text": "white"
88+
}
89+
},
90+
"keymap": {
91+
"clear": [
92+
"c",
93+
"esc"
94+
],
95+
"delete_confirm": [
96+
"y"
97+
],
98+
"delete_deny": [
99+
"n"
100+
],
101+
"exec": [
102+
"e"
103+
],
104+
"filter_mode": [
105+
"/",
106+
"F1"
107+
],
108+
"quit": [
109+
"q"
110+
],
111+
"save_logs": [
112+
"s"
113+
],
114+
"scroll_down_many": [
115+
"pagedown"
116+
],
117+
"scroll_down_one": [
118+
"down",
119+
"j"
120+
],
121+
"scroll_end": [
122+
"end"
123+
],
124+
"scroll_start": [
125+
"home"
126+
],
127+
"scroll_up_many": [
128+
"pageup"
129+
],
130+
"scroll_up_one": [
131+
"up",
132+
"k"
133+
],
134+
"select_next_panel": [
135+
"tab"
136+
],
137+
"select_previous_panel": [
138+
"backtab"
139+
],
140+
"sort_by_cpu": [
141+
"4"
142+
],
143+
"sort_by_id": [
144+
"6"
145+
],
146+
"sort_by_image": [
147+
"7"
148+
],
149+
"sort_by_memory": [
150+
"5"
151+
],
152+
"sort_by_name": [
153+
"1"
154+
],
155+
"sort_by_rx": [
156+
"8"
157+
],
158+
"sort_by_state": [
159+
"2"
160+
],
161+
"sort_by_status": [
162+
"3"
163+
],
164+
"sort_by_tx": [
165+
"9"
166+
],
167+
"sort_reset": [
168+
"0"
169+
],
170+
"toggle_help": [
171+
"h"
172+
],
173+
"toggle_mouse_capture": [
174+
"m"
175+
]
176+
}
177+
}

0 commit comments

Comments
 (0)