fc894a7f77
GUI desktop app (egui/eframe) that manages the openfut-core and openfut-bridge services with a single window. - Dashboard: start/stop each service independently or together; live status indicators; quick-status for cert and hosts - Logs: real-time stdout/stderr from both processes, colour-coded by level, follow mode and manual clear - Setup: add/remove EA hostname redirects in /etc/hosts (pkexec/sudo); install the bridge TLS cert into the system CA store - Config: all binary paths and env vars editable in-app; persisted to ~/.config/openfut-launcher/config.json Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
702 B
Rust
35 lines
702 B
Rust
use std::collections::VecDeque;
|
|
|
|
const MAX_LINES: usize = 2000;
|
|
|
|
pub struct LogBuffer {
|
|
lines: VecDeque<String>,
|
|
pub dirty: bool,
|
|
}
|
|
|
|
impl LogBuffer {
|
|
pub fn new() -> Self {
|
|
Self {
|
|
lines: VecDeque::with_capacity(MAX_LINES),
|
|
dirty: false,
|
|
}
|
|
}
|
|
|
|
pub fn push(&mut self, line: String) {
|
|
if self.lines.len() >= MAX_LINES {
|
|
self.lines.pop_front();
|
|
}
|
|
self.lines.push_back(line);
|
|
self.dirty = true;
|
|
}
|
|
|
|
pub fn lines(&self) -> impl Iterator<Item = &str> {
|
|
self.lines.iter().map(String::as_str)
|
|
}
|
|
|
|
pub fn clear(&mut self) {
|
|
self.lines.clear();
|
|
self.dirty = true;
|
|
}
|
|
}
|