mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
addHealthCheck instead of additionalHealthChecks for Daemons (#2962)
* addHealthCheck on Daemons * fix bug that prevents domains without protocols from being deleted * fixes from testing * version bump * add sdk version to UI * fix useEntrypoint * fix dependency health check error display * minor fixes * beta.29 * fixes from testing * beta.30 * set /etc/os-release (#2918) * remove check-monitor from kiosk (#2059) * add units for progress (#2693) * use new progress type * alpha.7 * fix up pwa stuff * fix wormhole-squashfs and prune boot (#2964) * don't exit on expected errors * use bash --------- Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -89,7 +89,7 @@ use crate::context::{
|
||||
use crate::disk::fsck::RequiresReboot;
|
||||
use crate::registry::context::{RegistryContext, RegistryUrlParams};
|
||||
use crate::system::kiosk;
|
||||
use crate::util::serde::{HandlerExtSerde, WithIoFormat};
|
||||
use crate::util::serde::{display_serializable, HandlerExtSerde, WithIoFormat};
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -201,15 +201,6 @@ pub fn main_api<C: Context>() -> ParentHandler<C> {
|
||||
if &*PLATFORM != "raspberrypi" {
|
||||
api = api.subcommand("kiosk", kiosk::<C>());
|
||||
}
|
||||
#[cfg(feature = "dev")]
|
||||
{
|
||||
api = api.subcommand(
|
||||
"lxc",
|
||||
lxc::dev::lxc::<C>().with_about(
|
||||
"Commands related to lxc containers i.e. create, list, remove, connect",
|
||||
),
|
||||
);
|
||||
}
|
||||
api
|
||||
}
|
||||
|
||||
@@ -220,7 +211,7 @@ pub fn server<C: Context>() -> ParentHandler<C> {
|
||||
from_fn_async(system::time)
|
||||
.with_display_serializable()
|
||||
.with_custom_display_fn(|handle, result| {
|
||||
Ok(system::display_time(handle.params, result))
|
||||
system::display_time(handle.params, result)
|
||||
})
|
||||
.with_about("Display current time and server uptime")
|
||||
.with_call_remote::<CliContext>()
|
||||
@@ -416,6 +407,46 @@ pub fn package<C: Context>() -> ParentHandler<C> {
|
||||
.with_about("Rebuild service container")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand(
|
||||
"stats",
|
||||
from_fn_async(lxc::stats)
|
||||
.with_display_serializable()
|
||||
.with_custom_display_fn(|args, res| {
|
||||
if let Some(format) = args.params.format {
|
||||
return display_serializable(format, res);
|
||||
}
|
||||
|
||||
use prettytable::*;
|
||||
let mut table = table!([
|
||||
"Name",
|
||||
"Container ID",
|
||||
"Memory Usage",
|
||||
"Memory Limit",
|
||||
"Memory %"
|
||||
]);
|
||||
for (id, stats) in res {
|
||||
if let Some(stats) = stats {
|
||||
table.add_row(row![
|
||||
&*id,
|
||||
&*stats.container_id,
|
||||
stats.memory_usage,
|
||||
stats.memory_limit,
|
||||
format!(
|
||||
"{:.2}",
|
||||
stats.memory_usage.0 as f64 / stats.memory_limit.0 as f64
|
||||
* 100.0
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
table.add_row(row![&*id, "N/A", "0 MiB", "0 MiB", "0"]);
|
||||
}
|
||||
}
|
||||
table.print_tty(false)?;
|
||||
Ok(())
|
||||
})
|
||||
.with_about("List information related to the lxc containers i.e. CPU, Memory, Disk")
|
||||
.with_call_remote::<CliContext>(),
|
||||
)
|
||||
.subcommand("logs", logs::package_logs())
|
||||
.subcommand(
|
||||
"logs",
|
||||
|
||||
Reference in New Issue
Block a user