Add sudo support and line count to log viewing commands
All checks were successful
Build and Release / build-and-release (push) Successful in 1m12s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m12s
- Add sudo to journalctl command for proper systemd log access - Add sudo to tail command for system log file access - Add -n 50 to tail command to match journalctl behavior - Both J and L keys now show last 50 lines before following Ensures consistent behavior and proper permissions for all log viewing.
This commit is contained in:
parent
3f6dffa66e
commit
6fedf4c7fc
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.49"
|
||||
version = "0.1.50"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@ -291,7 +291,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.49"
|
||||
version = "0.1.50"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -314,7 +314,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.49"
|
||||
version = "0.1.50"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"serde",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.50"
|
||||
version = "0.1.51"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.50"
|
||||
version = "0.1.51"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -289,7 +289,7 @@ ssh -tt {}@{} 'bash -ic {}'",
|
||||
// Show service logs via journalctl in tmux popup
|
||||
if let (Some(service_name), Some(hostname)) = (self.get_selected_service(), self.current_host.clone()) {
|
||||
let journalctl_command = format!(
|
||||
"ssh -tt {}@{} 'journalctl -u {}.service -f --no-pager -n 50'",
|
||||
"ssh -tt {}@{} 'sudo journalctl -u {}.service -f --no-pager -n 50'",
|
||||
self.config.ssh.rebuild_user,
|
||||
hostname,
|
||||
service_name
|
||||
@ -315,7 +315,7 @@ ssh -tt {}@{} 'bash -ic {}'",
|
||||
if let Some(host_logs) = self.config.service_logs.get(&hostname) {
|
||||
if let Some(log_config) = host_logs.iter().find(|config| config.service_name == service_name) {
|
||||
let tail_command = format!(
|
||||
"ssh -tt {}@{} 'tail -f {}'",
|
||||
"ssh -tt {}@{} 'sudo tail -n 50 -f {}'",
|
||||
self.config.ssh.rebuild_user,
|
||||
hostname,
|
||||
log_config.log_file_path
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.50"
|
||||
version = "0.1.51"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user