Skip to main content

systemctl_tui/
action.rs

1use crate::{
2  components::home::Mode,
3  systemd::{UnitFile, UnitId, UnitWithStatus},
4};
5
6#[derive(Debug, Clone)]
7pub enum Action {
8  Quit,
9  Resume,
10  Suspend,
11  Render,
12  DebouncedRender,
13  SpinnerTick,
14  Resize(u16, u16),
15  ToggleShowLogger,
16  RefreshServices,
17  RefreshUnitFiles,
18  SetServices(Vec<UnitWithStatus>),
19  SetUnitFiles(Vec<UnitFile>),
20  EnterMode(Mode),
21  EnterError(String),
22  CancelTask,
23  ToggleHelp,
24  SetUnitFilePath { unit: UnitId, path: Result<String, String> },
25  CopyUnitFilePath,
26  SetLogs { unit: UnitId, logs: Vec<String> },
27  AppendLogLine { unit: UnitId, line: String },
28  StartService(UnitId),
29  StopService(UnitId),
30  RestartService(UnitId),
31  ReloadService(UnitId),
32  EnableService(UnitId),
33  DisableService(UnitId),
34  KillService(UnitId, String),
35  ScrollUp(u16),
36  ScrollDown(u16),
37  ScrollToTop,
38  ScrollToBottom,
39  EditUnitFile { unit: UnitId, path: String },
40  OpenLogsInPager { logs: Vec<String> },
41  Noop,
42}