Skip to content

Commit 4fb3619

Browse files
committed
feat: dialogs for setup and maintenance
1 parent cd2d0a1 commit 4fb3619

2 files changed

Lines changed: 29 additions & 15 deletions

File tree

‎system/cuos/dialog-maintenance.sh‎

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ diagnostics_menu() {
181181
"back" "\Z5Back\Z0")" || return 1
182182
case "$choice" in
183183
resources) check_resources ;;
184-
clogs) cuos_logs ;;
185-
logs) view_logs ;;
184+
clogs) term_all cuos_logs ;;
185+
logs) term_all view_logs ;;
186186
docker) api_stream "docker ps" docker ps ;;
187187
ping) diagnostics_ping ;;
188188
dns) diagnostics_dns ;;
@@ -199,21 +199,35 @@ check_resources() {
199199
}
200200

201201
cuos_logs() {
202-
term_all journalctl \
203-
-t cuos \
204-
--priority "emerg".."info" \
205-
--lines=2000 \
206-
--output=short \
207-
--no-hostname \
208-
--pager-end
202+
(
203+
echo -e "\033[1;36m[ Log View - Press 'Q' to quit the view ]\033[0m";
204+
SYSTEMD_COLORS=true journalctl \
205+
-t cuos \
206+
--priority "emerg".."info" \
207+
--lines=2000 \
208+
--output=short \
209+
--no-hostname \
210+
--no-pager
211+
) | \
212+
LESSSECURE=1 less \
213+
--header=1,0 \
214+
+G
209215
}
210216

211217
view_logs() {
212-
term_all journalctl \
213-
--lines=10000 \
214-
--output=short \
215-
--no-hostname \
216-
--pager-end
218+
(
219+
echo -e "\033[1;36m[ Log View - Press 'Q' to quit the view ]\033[0m";
220+
SYSTEMD_COLORS=true journalctl \
221+
--priority "emerg".."info" \
222+
--lines=10000 \
223+
--output=short \
224+
--no-hostname \
225+
--no-pager
226+
) | \
227+
LESSSECURE=1 less \
228+
--header=1,0 \
229+
-R \
230+
+G
217231
}
218232

219233
diagnostics_ping() {

‎system/cuos/dialog-reports.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ change_vt
1616

1717
tmpfile=$(mktemp)
1818

19-
journalctl -f -t abc -n 10 --output=json | jq --unbuffered -r '
19+
journalctl -f -t cuos -n 12 --output=json | jq --unbuffered -r '
2020
. as $e
2121
| (($e.__REALTIME_TIMESTAMP | tonumber) / 1000000 | strflocaltime("%Y-%m-%d %H:%M:%S")) + " [" +
2222
(["emerg","alert","crit","err","warning","notice","info","debug"][$e.PRIORITY | tonumber]) + "] " +

0 commit comments

Comments
 (0)