OneLauncher-Cracked/packages/oneclient_app/src/view/app/cluster/process_logs.rs
Julian Chang 29d1f1c9d2
Bugs
Fixed #492
Fixed #510
Fixed #506
Fixed #568
Fixed #582
Fixed #578
Fixed #567
Fixed #588
Fixed #585
Fixed #571
Fixed #587
Fixed #584
2026-07-15 13:41:43 -04:00

48 lines
1.2 KiB
Rust

use freya::prelude::*;
use crate::components::LogViewer;
use crate::hooks::use_game_snapshot;
use crate::layout::cluster_content;
use crate::theme::colors;
use super::{cluster_not_found, load_cluster};
#[derive(PartialEq)]
pub struct ProcessLogs {
pub cluster_id: i64,
}
impl Component for ProcessLogs {
fn render(&self) -> impl IntoElement {
let game = use_game_snapshot();
let Some(_cluster) = load_cluster(self.cluster_id) else {
return cluster_not_found();
};
let active = game.stage(self.cluster_id).is_some();
let body = if active {
LogViewer::new("Game output", game.logs_for(self.cluster_id))
.streaming(true)
.into_element()
} else {
not_running()
};
cluster_content().child(body).into_element()
}
}
fn not_running() -> Element {
rect()
.width(Size::fill())
.height(Size::fill())
.center()
.child(
label()
.text("This cluster is not running.")
.font_size(14.)
.color(colors::fg_secondary()),
)
.into_element()
}