mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
switch all FE to camelCase (#2576)
* switch all fe to camelCase * switch to camelCase on backend --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -26,7 +26,7 @@ pub struct ActionResultV0 {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum DockerStatus {
|
||||
Running,
|
||||
Stopped,
|
||||
@@ -48,7 +48,7 @@ pub fn display_action_result(params: WithIoFormat<ActionParams>, result: ActionR
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ActionParams {
|
||||
#[arg(id = "id")]
|
||||
|
||||
@@ -127,7 +127,7 @@ fn gen_pwd() {
|
||||
)
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliLoginParams {
|
||||
password: Option<PasswordType>,
|
||||
@@ -179,7 +179,7 @@ pub fn check_password_against_db(db: &DatabaseModel, password: &str) -> Result<(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct LoginParams {
|
||||
password: Option<PasswordType>,
|
||||
@@ -220,7 +220,7 @@ pub async fn login_impl(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct LogoutParams {
|
||||
session: InternedString,
|
||||
@@ -236,7 +236,7 @@ pub async fn logout(
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Session {
|
||||
pub logged_in: DateTime<Utc>,
|
||||
pub last_active: DateTime<Utc>,
|
||||
@@ -245,7 +245,7 @@ pub struct Session {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SessionList {
|
||||
current: InternedString,
|
||||
sessions: Sessions,
|
||||
@@ -305,7 +305,7 @@ fn display_sessions(params: WithIoFormat<ListParams>, arg: SessionList) {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ListParams {
|
||||
#[arg(skip)]
|
||||
@@ -340,7 +340,7 @@ impl AsLogoutSessionId for KillSessionId {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct KillParams {
|
||||
ids: Vec<String>,
|
||||
@@ -353,12 +353,10 @@ pub async fn kill(ctx: RpcContext, KillParams { ids }: KillParams) -> Result<(),
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ResetPasswordParams {
|
||||
#[arg(name = "old-password")]
|
||||
old_password: Option<PasswordType>,
|
||||
#[arg(name = "new-password")]
|
||||
new_password: Option<PasswordType>,
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ use crate::util::serde::IoFormat;
|
||||
use crate::version::VersionT;
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct BackupParams {
|
||||
target_id: BackupTargetId,
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::service::service_map::DownloadInstallFuture;
|
||||
use crate::util::serde::IoFormat;
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct RestorePackageParams {
|
||||
pub ids: Vec<PackageId>,
|
||||
|
||||
@@ -36,7 +36,7 @@ impl Map for CifsTargets {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CifsBackupTarget {
|
||||
hostname: String,
|
||||
path: PathBuf,
|
||||
@@ -68,7 +68,7 @@ pub fn cifs() -> ParentHandler {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct AddParams {
|
||||
pub hostname: String,
|
||||
@@ -122,7 +122,7 @@ pub async fn add(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UpdateParams {
|
||||
pub id: BackupTargetId,
|
||||
@@ -186,7 +186,7 @@ pub async fn update(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct RemoveParams {
|
||||
pub id: BackupTargetId,
|
||||
|
||||
@@ -34,9 +34,9 @@ pub mod cifs;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum BackupTarget {
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Disk {
|
||||
vendor: Option<String>,
|
||||
model: Option<String>,
|
||||
@@ -109,7 +109,7 @@ impl Serialize for BackupTargetId {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum BackupTargetFS {
|
||||
Disk(BlockDev<PathBuf>),
|
||||
Cifs(Cifs),
|
||||
@@ -190,7 +190,7 @@ pub async fn list(ctx: RpcContext) -> Result<BTreeMap<BackupTargetId, BackupTarg
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BackupInfo {
|
||||
pub version: Version,
|
||||
pub timestamp: Option<DateTime<Utc>>,
|
||||
@@ -198,7 +198,7 @@ pub struct BackupInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PackageBackupInfo {
|
||||
pub title: String,
|
||||
pub version: Version,
|
||||
@@ -243,7 +243,7 @@ fn display_backup_info(params: WithIoFormat<InfoParams>, info: BackupInfo) {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct InfoParams {
|
||||
target_id: BackupTargetId,
|
||||
@@ -277,7 +277,7 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct MountParams {
|
||||
target_id: BackupTargetId,
|
||||
@@ -312,7 +312,7 @@ pub async fn mount(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UmountParams {
|
||||
target_id: Option<BackupTargetId>,
|
||||
|
||||
@@ -9,14 +9,14 @@ use crate::prelude::*;
|
||||
use crate::status::health_check::HealthCheckId;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ConfigRes {
|
||||
pub config: Option<Config>,
|
||||
pub spec: ConfigSpec,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetResult {
|
||||
pub depends_on: BTreeMap<PackageId, BTreeSet<HealthCheckId>>,
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ pub enum MatchError {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ConfigParams {
|
||||
pub id: PackageId,
|
||||
@@ -157,7 +157,7 @@ pub async fn get(ctx: RpcContext, _: Empty, id: PackageId) -> Result<ConfigRes,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetParams {
|
||||
#[arg(long = "timeout")]
|
||||
pub timeout: Option<crate::util::serde::Duration>,
|
||||
|
||||
@@ -28,7 +28,7 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetupResult {
|
||||
pub tor_address: String,
|
||||
pub lan_address: String,
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::prelude::*;
|
||||
use crate::Error;
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ControlParams {
|
||||
pub id: PackageId,
|
||||
|
||||
@@ -183,7 +183,7 @@ pub enum RevisionsRes {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliDumpParams {
|
||||
#[arg(long = "include-private", short = 'p')]
|
||||
@@ -216,7 +216,7 @@ async fn cli_dump(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct DumpParams {
|
||||
#[arg(long = "include-private", short = 'p')]
|
||||
@@ -272,7 +272,7 @@ async fn cli_apply(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ApplyParams {
|
||||
expr: String,
|
||||
@@ -310,7 +310,7 @@ pub fn put() -> ParentHandler {
|
||||
)
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UiParams {
|
||||
pointer: JsonPointer,
|
||||
|
||||
@@ -20,7 +20,7 @@ pub mod private;
|
||||
pub mod public;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct Database {
|
||||
pub public: Public,
|
||||
|
||||
@@ -35,7 +35,7 @@ pub enum ManifestPreference {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(tag = "state")]
|
||||
#[model = "Model<Self>"]
|
||||
pub enum PackageState {
|
||||
@@ -257,14 +257,14 @@ impl Model<PackageState> {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct InstallingState {
|
||||
pub installing_info: InstallingInfo,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct UpdatingState {
|
||||
pub manifest: Manifest,
|
||||
@@ -272,14 +272,14 @@ pub struct UpdatingState {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct InstalledState {
|
||||
pub manifest: Manifest,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct InstallingInfo {
|
||||
pub new_manifest: Manifest,
|
||||
@@ -287,7 +287,7 @@ pub struct InstallingInfo {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct PackageDataEntry {
|
||||
pub state_info: PackageState,
|
||||
@@ -405,7 +405,7 @@ impl Map for CurrentDependencies {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct StaticDependencyInfo {
|
||||
pub title: String,
|
||||
@@ -413,11 +413,11 @@ pub struct StaticDependencyInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(tag = "kind")]
|
||||
pub enum CurrentDependencyInfo {
|
||||
Exists,
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Running {
|
||||
#[serde(default)]
|
||||
health_checks: BTreeSet<HealthCheckId>,
|
||||
@@ -438,7 +438,7 @@ impl Map for InterfaceAddressMap {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct InterfaceAddresses {
|
||||
pub tor_address: Option<String>,
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::ssh::SshKeys;
|
||||
use crate::util::serde::Pem;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct Private {
|
||||
pub key_store: KeyStore,
|
||||
|
||||
@@ -24,7 +24,7 @@ use crate::version::{Current, VersionT};
|
||||
use crate::{ARCH, PLATFORM};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
// #[macro_debug]
|
||||
pub struct Public {
|
||||
@@ -102,7 +102,7 @@ fn get_platform() -> InternedString {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct ServerInfo {
|
||||
#[serde(default = "get_arch")]
|
||||
@@ -137,7 +137,7 @@ pub struct ServerInfo {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct IpInfo {
|
||||
pub ipv4_range: Option<Ipv4Net>,
|
||||
@@ -165,7 +165,7 @@ pub struct BackupProgress {
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct ServerStatus {
|
||||
pub backup_progress: Option<BTreeMap<PackageId, BackupProgress>>,
|
||||
@@ -178,7 +178,7 @@ pub struct ServerStatus {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct UpdateProgress {
|
||||
pub size: Option<u64>,
|
||||
@@ -186,7 +186,7 @@ pub struct UpdateProgress {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct WifiInfo {
|
||||
pub ssids: Vec<String>,
|
||||
@@ -195,7 +195,7 @@ pub struct WifiInfo {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServerSpecs {
|
||||
pub cpu: String,
|
||||
pub disk: String,
|
||||
@@ -203,7 +203,7 @@ pub struct ServerSpecs {
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ConnectionAddresses {
|
||||
pub tor: Vec<String>,
|
||||
pub clearnet: Vec<String>,
|
||||
|
||||
@@ -36,7 +36,7 @@ impl Map for Dependencies {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(tag = "type")]
|
||||
pub enum DependencyRequirement {
|
||||
OptIn { how: String },
|
||||
@@ -50,7 +50,7 @@ impl DependencyRequirement {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct DepInfo {
|
||||
pub version: VersionRange,
|
||||
@@ -61,12 +61,10 @@ pub struct DepInfo {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ConfigureParams {
|
||||
#[arg(name = "dependent-id")]
|
||||
dependent_id: PackageId,
|
||||
#[arg(name = "dependency-id")]
|
||||
dependency_id: PackageId,
|
||||
}
|
||||
pub fn configure() -> ParentHandler<ConfigureParams> {
|
||||
@@ -111,7 +109,7 @@ pub async fn configure_impl(
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ConfigDryRes {
|
||||
pub old_config: Config,
|
||||
pub new_config: Config,
|
||||
|
||||
@@ -41,7 +41,7 @@ pub fn error(ctx: DiagnosticContext) -> Result<Arc<RpcError>, Error> {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct LogsParams {
|
||||
limit: Option<usize>,
|
||||
|
||||
@@ -17,7 +17,7 @@ pub const BOOT_RW_PATH: &str = "/media/boot-rw";
|
||||
pub const REPAIR_DISK_PATH: &str = "/media/embassy/config/repair-disk";
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct OsPartitionInfo {
|
||||
pub efi: Option<PathBuf>,
|
||||
pub bios: Option<PathBuf>,
|
||||
|
||||
@@ -10,7 +10,7 @@ use super::FileSystem;
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BlockDev<LogicalName: AsRef<Path>> {
|
||||
logicalname: LogicalName,
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ pub async fn mount_cifs(
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Cifs {
|
||||
pub hostname: String,
|
||||
pub path: PathBuf,
|
||||
|
||||
@@ -22,7 +22,7 @@ pub async fn mount_httpdirfs(url: &Url, mountpoint: impl AsRef<Path>) -> Result<
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct HttpDirFS {
|
||||
url: Url,
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::prelude::*;
|
||||
use crate::util::Invoke;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct IdMapped<Fs: FileSystem> {
|
||||
filesystem: Fs,
|
||||
from_id: u32,
|
||||
|
||||
@@ -12,7 +12,7 @@ use super::FileSystem;
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct LoopDev<LogicalName: AsRef<Path>> {
|
||||
logicalname: LogicalName,
|
||||
offset: u64,
|
||||
|
||||
@@ -24,14 +24,14 @@ use crate::util::{Invoke, Version};
|
||||
use crate::{Error, ResultExt as _};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum PartitionTable {
|
||||
Mbr,
|
||||
Gpt,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DiskInfo {
|
||||
pub logicalname: PathBuf,
|
||||
pub partition_table: Option<PartitionTable>,
|
||||
@@ -43,7 +43,7 @@ pub struct DiskInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PartitionInfo {
|
||||
pub logicalname: PathBuf,
|
||||
pub label: Option<String>,
|
||||
@@ -54,7 +54,7 @@ pub struct PartitionInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EmbassyOsRecoveryInfo {
|
||||
pub version: Version,
|
||||
pub full: bool,
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::PLATFORM;
|
||||
|
||||
/// Part of the Firmware, look there for more about
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VersionMatcher {
|
||||
/// Strip this prefix on the version matcher
|
||||
semver_prefix: Option<String>,
|
||||
@@ -28,7 +28,7 @@ pub struct VersionMatcher {
|
||||
/// wanted a structure that could help decide what to do
|
||||
/// for each of the firmware versions
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Firmware {
|
||||
id: String,
|
||||
/// This is the platform(s) the firmware was built for
|
||||
|
||||
@@ -24,7 +24,7 @@ pub fn inspect() -> ParentHandler {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct HashParams {
|
||||
path: PathBuf,
|
||||
@@ -39,11 +39,11 @@ pub async fn hash(_: CliContext, HashParams { path }: HashParams) -> Result<Stri
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ManifestParams {
|
||||
path: PathBuf,
|
||||
#[arg(name = "no-verify", long = "no-verify")]
|
||||
#[arg(long = "no-verify")]
|
||||
no_verify: bool,
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ pub async fn manifest(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct InspectParams {
|
||||
path: PathBuf,
|
||||
#[arg(name = "no-verify", long = "no-verify")]
|
||||
#[arg(long = "no-verify")]
|
||||
no_verify: bool,
|
||||
}
|
||||
|
||||
@@ -89,11 +89,11 @@ pub async fn icon(
|
||||
Ok(())
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct InstructionParams {
|
||||
path: PathBuf,
|
||||
#[arg(name = "no-verify", long = "no-verify")]
|
||||
#[arg(long = "no-verify")]
|
||||
no_verify: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ pub async fn list(ctx: RpcContext) -> Result<Value, Error> {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, serde::Deserialize, serde::Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum MinMax {
|
||||
Min,
|
||||
Max,
|
||||
@@ -103,7 +103,7 @@ impl std::fmt::Display for MinMax {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct InstallParams {
|
||||
id: PackageId,
|
||||
@@ -165,7 +165,7 @@ pub async fn install(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SideloadResponse {
|
||||
pub upload: RequestGuid,
|
||||
pub progress: RequestGuid,
|
||||
@@ -275,7 +275,7 @@ pub async fn sideload(ctx: RpcContext) -> Result<SideloadResponse, Error> {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum CliInstallParams {
|
||||
Marketplace(InstallParams),
|
||||
Sideload(PathBuf),
|
||||
@@ -392,7 +392,7 @@ pub async fn cli_install(ctx: CliContext, params: CliInstallParams) -> Result<()
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UninstallParams {
|
||||
id: PackageId,
|
||||
|
||||
@@ -80,7 +80,7 @@ use crate::context::CliContext;
|
||||
use crate::util::serde::HandlerExtSerde;
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct EchoParams {
|
||||
message: String,
|
||||
|
||||
@@ -102,14 +102,14 @@ async fn ws_handler(
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct LogResponse {
|
||||
entries: Reversible<LogEntry>,
|
||||
start_cursor: Option<String>,
|
||||
end_cursor: Option<String>,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct LogFollowResponse {
|
||||
start_cursor: Option<String>,
|
||||
guid: RequestGuid,
|
||||
@@ -211,7 +211,7 @@ pub enum LogSource {
|
||||
pub const SYSTEM_UNIT: &str = "startd";
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct LogsParam {
|
||||
id: PackageId,
|
||||
|
||||
@@ -26,7 +26,7 @@ use crate::prelude::*;
|
||||
pub const LOCAL_AUTH_COOKIE_PATH: &str = "/run/embassy/rpc.authcookie";
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct LoginRes {
|
||||
pub session: InternedString,
|
||||
}
|
||||
@@ -245,7 +245,7 @@ impl Borrow<str> for HashSessionToken {
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Metadata {
|
||||
#[serde(default = "const_true")]
|
||||
authenticated: bool,
|
||||
|
||||
@@ -7,7 +7,7 @@ use serde::Deserialize;
|
||||
use crate::context::RpcContext;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Metadata {
|
||||
#[serde(default)]
|
||||
sync_db: bool,
|
||||
|
||||
@@ -61,7 +61,7 @@ pub fn dhcp() -> ParentHandler {
|
||||
)
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UpdateParams {
|
||||
interface: String,
|
||||
|
||||
@@ -29,7 +29,7 @@ use crate::SOURCE_DATE;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
||||
#[model = "Model<Self>"]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CertStore {
|
||||
pub root_key: Pem<PKey<Private>>,
|
||||
pub root_cert: Pem<X509>,
|
||||
|
||||
@@ -105,7 +105,7 @@ pub fn tor() -> ParentHandler {
|
||||
)
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ResetParams {
|
||||
#[arg(name = "wipe-state", short = 'w', long = "wipe-state")]
|
||||
@@ -143,7 +143,7 @@ pub async fn list_services(ctx: RpcContext, _: Empty) -> Result<Vec<OnionAddress
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct LogsParams {
|
||||
#[arg(short = 'l', long = "limit")]
|
||||
|
||||
@@ -88,7 +88,7 @@ pub fn country() -> ParentHandler {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct AddParams {
|
||||
ssid: String,
|
||||
@@ -139,7 +139,7 @@ pub async fn add(ctx: RpcContext, AddParams { ssid, password }: AddParams) -> Re
|
||||
Ok(())
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct SsidParams {
|
||||
ssid: String,
|
||||
@@ -217,7 +217,7 @@ pub async fn delete(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result<
|
||||
Ok(())
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct WiFiInfo {
|
||||
ssids: HashMap<Ssid, SignalStrength>,
|
||||
connected: Option<Ssid>,
|
||||
@@ -226,13 +226,13 @@ pub struct WiFiInfo {
|
||||
available_wifi: Vec<WifiListOut>,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize, Clone)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct WifiListInfo {
|
||||
strength: SignalStrength,
|
||||
security: Vec<String>,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct WifiListOut {
|
||||
ssid: Ssid,
|
||||
strength: SignalStrength,
|
||||
@@ -403,7 +403,7 @@ pub async fn get_available(ctx: RpcContext, _: Empty) -> Result<Vec<WifiListOut>
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct SetCountryParams {
|
||||
#[arg(value_parser = CountryCodeParser)]
|
||||
|
||||
@@ -49,7 +49,7 @@ pub fn notification() -> ParentHandler {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ListParams {
|
||||
before: Option<u32>,
|
||||
@@ -111,7 +111,7 @@ pub async fn list(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct DeleteParams {
|
||||
id: u32,
|
||||
@@ -126,7 +126,7 @@ pub async fn delete(ctx: RpcContext, DeleteParams { id }: DeleteParams) -> Resul
|
||||
.await
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct DeleteBeforeParams {
|
||||
before: u32,
|
||||
@@ -149,7 +149,7 @@ pub async fn delete_before(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CreateParams {
|
||||
package: Option<PackageId>,
|
||||
@@ -173,7 +173,7 @@ pub async fn create(
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum NotificationLevel {
|
||||
Success,
|
||||
Info,
|
||||
@@ -225,7 +225,7 @@ impl fmt::Display for InvalidNotificationLevel {
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Notifications(pub BTreeMap<u32, Notification>);
|
||||
impl Notifications {
|
||||
pub fn new() -> Self {
|
||||
@@ -244,7 +244,7 @@ impl Map for Notifications {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Notification {
|
||||
package_id: Option<PackageId>,
|
||||
created_at: DateTime<Utc>,
|
||||
@@ -256,7 +256,7 @@ pub struct Notification {
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct NotificationWithId {
|
||||
id: u32,
|
||||
#[serde(flatten)]
|
||||
|
||||
@@ -24,7 +24,7 @@ mod gpt;
|
||||
mod mbr;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PostInstallConfig {
|
||||
os_partitions: OsPartitionInfo,
|
||||
ethernet_interface: String,
|
||||
@@ -120,7 +120,7 @@ async fn partition(disk: &mut DiskInfo, overwrite: bool) -> Result<OsPartitionIn
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ExecuteParams {
|
||||
logicalname: PathBuf,
|
||||
|
||||
@@ -6,10 +6,10 @@ use models::PackageId;
|
||||
use rpc_toolkit::command;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::db::model::package::ExposedUI;
|
||||
use crate::context::RpcContext;
|
||||
use crate::db::model::package::{ExposedUI, StoreExposedUI};
|
||||
use crate::prelude::*;
|
||||
use crate::Error;
|
||||
use crate::{context::RpcContext, db::model::package::StoreExposedUI};
|
||||
|
||||
pub fn display_properties(response: Value) {
|
||||
println!("{}", response);
|
||||
@@ -58,7 +58,7 @@ impl IntoProperties for StoreExposedUI {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct PropertiesParam {
|
||||
id: PackageId,
|
||||
|
||||
@@ -91,7 +91,7 @@ async fn do_upload(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct PublishParams {
|
||||
location: String,
|
||||
|
||||
@@ -37,7 +37,7 @@ pub fn with_query_params(ctx: RpcContext, mut url: Url) -> Url {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct GetParams {
|
||||
url: Url,
|
||||
|
||||
@@ -13,7 +13,7 @@ use crate::util::io::from_cbor_async_reader;
|
||||
use crate::{Error, ErrorKind, ARCH};
|
||||
|
||||
#[derive(Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DockerMultiArch {
|
||||
pub default: String,
|
||||
pub available: BTreeSet<String>,
|
||||
|
||||
@@ -18,7 +18,7 @@ fn current_version() -> Version {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct Manifest {
|
||||
#[serde(default = "current_version")]
|
||||
@@ -53,7 +53,7 @@ pub struct Manifest {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Assets {
|
||||
#[serde(default)]
|
||||
pub license: Option<PathBuf>,
|
||||
|
||||
@@ -13,7 +13,7 @@ pub mod reader;
|
||||
pub const SIG_CONTEXT: &[u8] = b"s9pk";
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct VerifyParams {
|
||||
pub path: PathBuf,
|
||||
|
||||
@@ -53,7 +53,7 @@ pub struct Manifest {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct HardwareRequirements {
|
||||
#[serde(default)]
|
||||
device: BTreeMap<String, Regex>,
|
||||
@@ -85,7 +85,7 @@ impl Description {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Alerts {
|
||||
pub install: Option<String>,
|
||||
pub uninstall: Option<String>,
|
||||
|
||||
@@ -268,7 +268,7 @@ enum AllowedStatuses {
|
||||
struct ExportActionParams {
|
||||
#[ts(type = "string")]
|
||||
id: ActionId,
|
||||
metadata: ActionMetadata
|
||||
metadata: ActionMetadata,
|
||||
}
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)]
|
||||
#[ts(export)]
|
||||
@@ -349,13 +349,11 @@ async fn get_container_ip(context: EffectContext, _: Empty) -> Result<Ipv4Addr,
|
||||
Some(c) => {
|
||||
let net_service = c.persistent_container.net_service.lock().await;
|
||||
Ok(net_service.get_ip())
|
||||
},
|
||||
None => {
|
||||
Err(Error::new(
|
||||
eyre!("Upgrade on Weak<ServiceActorSeed> resulted in a None variant"),
|
||||
crate::ErrorKind::NotFound
|
||||
))
|
||||
}
|
||||
None => Err(Error::new(
|
||||
eyre!("Upgrade on Weak<ServiceActorSeed> resulted in a None variant"),
|
||||
crate::ErrorKind::NotFound,
|
||||
)),
|
||||
}
|
||||
}
|
||||
async fn get_service_port_forward(
|
||||
|
||||
@@ -100,7 +100,7 @@ async fn setup_init(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AttachParams {
|
||||
#[serde(rename = "embassy-password")]
|
||||
password: Option<EncryptedWire>,
|
||||
@@ -185,7 +185,7 @@ pub async fn attach(
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetupStatus {
|
||||
pub bytes_transferred: u64,
|
||||
pub total_bytes: Option<u64>,
|
||||
@@ -211,7 +211,7 @@ pub fn cifs() -> ParentHandler {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VerifyCifsParams {
|
||||
hostname: String,
|
||||
path: PathBuf,
|
||||
@@ -247,14 +247,14 @@ pub async fn verify_cifs(
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum RecoverySource {
|
||||
Migrate { guid: String },
|
||||
Backup { target: BackupTargetFS },
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExecuteParams {
|
||||
embassy_logicalname: PathBuf,
|
||||
embassy_password: EncryptedWire,
|
||||
|
||||
@@ -48,7 +48,7 @@ impl ValueParserFactory for SshPubKey {
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SshKeyResponse {
|
||||
pub alg: String,
|
||||
pub fingerprint: InternedString,
|
||||
@@ -103,7 +103,7 @@ pub fn ssh() -> ParentHandler {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct AddParams {
|
||||
key: SshPubKey,
|
||||
@@ -136,7 +136,7 @@ pub async fn add(ctx: RpcContext, AddParams { key }: AddParams) -> Result<SshKey
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct DeleteParams {
|
||||
fingerprint: InternedString,
|
||||
|
||||
@@ -2,7 +2,7 @@ pub use models::HealthCheckId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[serde(tag = "result")]
|
||||
pub enum HealthCheckResult {
|
||||
Success,
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::status::health_check::HealthCheckResult;
|
||||
|
||||
pub mod health_check;
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HasModel)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct Status {
|
||||
pub configured: bool,
|
||||
@@ -21,7 +21,7 @@ pub struct Status {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, HasModel, Default)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct DependencyConfigErrors(pub BTreeMap<PackageId, String>);
|
||||
impl Map for DependencyConfigErrors {
|
||||
@@ -37,7 +37,7 @@ impl Map for DependencyConfigErrors {
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
|
||||
#[serde(tag = "status")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum MainStatus {
|
||||
Stopped,
|
||||
Restarting,
|
||||
|
||||
@@ -74,7 +74,7 @@ pub async fn enable_zram() -> Result<(), Error> {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ZramParams {
|
||||
enable: bool,
|
||||
@@ -136,7 +136,7 @@ fn display_governor_info(params: WithIoFormat<GovernorParams>, result: GovernorI
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct GovernorParams {
|
||||
set: Option<Governor>,
|
||||
@@ -230,7 +230,7 @@ pub async fn time(ctx: RpcContext, _: Empty) -> Result<TimeInfo, Error> {
|
||||
})
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct LogsParams {
|
||||
#[arg(short = 'l', long = "limit")]
|
||||
@@ -314,7 +314,7 @@ pub async fn logs_follow(
|
||||
follow_logs(ctx, LogSource::System, limit).await
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct KernelLogsParams {
|
||||
#[arg(short = 'l', long = "limit")]
|
||||
@@ -509,12 +509,12 @@ impl<'de> Deserialize<'de> for GigaBytes {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MetricsGeneral {
|
||||
pub temperature: Option<Celsius>,
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MetricsMemory {
|
||||
pub percentage_used: Percentage,
|
||||
pub total: MebiBytes,
|
||||
@@ -525,7 +525,7 @@ pub struct MetricsMemory {
|
||||
pub zram_used: MebiBytes,
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MetricsCpu {
|
||||
percentage_used: Percentage,
|
||||
idle: Percentage,
|
||||
@@ -534,7 +534,7 @@ pub struct MetricsCpu {
|
||||
wait: Percentage,
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct MetricsDisk {
|
||||
percentage_used: Percentage,
|
||||
used: GigaBytes,
|
||||
@@ -542,7 +542,7 @@ pub struct MetricsDisk {
|
||||
capacity: GigaBytes,
|
||||
}
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Metrics {
|
||||
general: MetricsGeneral,
|
||||
memory: MetricsMemory,
|
||||
|
||||
@@ -35,7 +35,7 @@ lazy_static! {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UpdateSystemParams {
|
||||
marketplace_url: Url,
|
||||
@@ -60,7 +60,7 @@ pub async fn update_system(
|
||||
|
||||
/// What is the status of the updates?
|
||||
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum UpdateResult {
|
||||
NoUpdates,
|
||||
Updating,
|
||||
|
||||
@@ -8,7 +8,7 @@ const KNOWN_CLASSES: &[&str] = &["processor", "display"];
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "class")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum LshwDevice {
|
||||
Processor(LshwProcessor),
|
||||
Display(LshwDisplay),
|
||||
|
||||
@@ -111,25 +111,25 @@ pub fn cert_dir(pkg_id: &PackageId, host_id: &HostId) -> PathBuf {
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum Volume {
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Data {
|
||||
#[serde(skip)]
|
||||
readonly: bool,
|
||||
},
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Assets {},
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Pointer {
|
||||
package_id: PackageId,
|
||||
volume_id: VolumeId,
|
||||
path: PathBuf,
|
||||
readonly: bool,
|
||||
},
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Certificate { interface_id: HostId },
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Backup { readonly: bool },
|
||||
}
|
||||
impl Volume {
|
||||
|
||||
@@ -49,7 +49,7 @@ export class LogsPage {
|
||||
|
||||
private async getLogs() {
|
||||
try {
|
||||
const { 'start-cursor': startCursor, entries } = await this.api.getLogs({
|
||||
const { startCursor, entries } = await this.api.getLogs({
|
||||
cursor: this.startCursor,
|
||||
before: !!this.startCursor,
|
||||
limit: this.limit,
|
||||
|
||||
@@ -45,8 +45,8 @@ export class MockApiService implements ApiService {
|
||||
}
|
||||
return {
|
||||
entries,
|
||||
'start-cursor': 'startCursor',
|
||||
'end-cursor': 'endCursor',
|
||||
startCursor: 'start-cursor',
|
||||
endCursor: 'end-cursor',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ export class MockApiService implements ApiService {
|
||||
label: null,
|
||||
capacity: 73264762332,
|
||||
used: null,
|
||||
'embassy-os': {
|
||||
startOs: {
|
||||
version: '0.2.17',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': null,
|
||||
wrappedKey: null,
|
||||
},
|
||||
guid: null,
|
||||
},
|
||||
@@ -40,12 +40,12 @@ export class MockApiService implements ApiService {
|
||||
label: null,
|
||||
capacity: 73264762332,
|
||||
used: null,
|
||||
'embassy-os': {
|
||||
startOs: {
|
||||
version: '0.3.3',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': null,
|
||||
wrappedKey: null,
|
||||
},
|
||||
guid: null,
|
||||
},
|
||||
@@ -63,12 +63,12 @@ export class MockApiService implements ApiService {
|
||||
label: null,
|
||||
capacity: 73264762332,
|
||||
used: null,
|
||||
'embassy-os': {
|
||||
startOs: {
|
||||
version: '0.3.2',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': null,
|
||||
wrappedKey: null,
|
||||
},
|
||||
guid: 'guid-guid-guid-guid',
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</ion-item-divider>
|
||||
<ion-item lines="none" color="transparent">
|
||||
<ion-label>
|
||||
<div [innerHTML]="pkg.manifest['release-notes'] | markdown"></div>
|
||||
<div [innerHTML]="pkg.manifest.releaseNotes | markdown"></div>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-button routerLink="notes" fill="clear" strong>
|
||||
@@ -18,10 +18,7 @@
|
||||
<h2>{{ pkg.manifest.description.long }}</h2>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<div
|
||||
*ngIf="pkg.manifest['marketing-site'] as url"
|
||||
style="padding: 4px 0 10px 14px"
|
||||
>
|
||||
<div *ngIf="pkg.manifest.marketingSite as url" style="padding: 4px 0 10px 14px">
|
||||
<ion-button [href]="url" target="_blank" rel="noreferrer" color="tertiary">
|
||||
View website
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<ion-col responsiveCol sizeXs="12" sizeMd="6">
|
||||
<ion-item-group>
|
||||
<ion-item
|
||||
*ngIf="manifest['git-hash'] as gitHash; else noHash"
|
||||
*ngIf="manifest.gitHash as gitHash; else noHash"
|
||||
button
|
||||
detail="false"
|
||||
(click)="copy(gitHash)"
|
||||
@@ -64,39 +64,39 @@
|
||||
<ion-col responsiveCol sizeXs="12" sizeMd="6">
|
||||
<ion-item-group>
|
||||
<ion-item
|
||||
[href]="manifest['upstream-repo']"
|
||||
[href]="manifest.upstreamRepo"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
detail="false"
|
||||
>
|
||||
<ion-label>
|
||||
<h2>Source Repository</h2>
|
||||
<p>{{ manifest['upstream-repo'] }}</p>
|
||||
<p>{{ manifest.upstreamRepo }}</p>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
</ion-item>
|
||||
<ion-item
|
||||
[href]="manifest['wrapper-repo']"
|
||||
[href]="manifest.wrapperRepo"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
detail="false"
|
||||
>
|
||||
<ion-label>
|
||||
<h2>Wrapper Repository</h2>
|
||||
<p>{{ manifest['wrapper-repo'] }}</p>
|
||||
<p>{{ manifest.wrapperRepo }}</p>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
</ion-item>
|
||||
<ion-item
|
||||
[href]="manifest['support-site']"
|
||||
[disabled]="!manifest['support-site']"
|
||||
[href]="manifest.supportSite"
|
||||
[disabled]="!manifest.supportSite"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
detail="false"
|
||||
>
|
||||
<ion-label>
|
||||
<h2>Support Site</h2>
|
||||
<p>{{ manifest['support-site'] || 'Not provided' }}</p>
|
||||
<p>{{ manifest.supportSite || 'Not provided' }}</p>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="open-outline"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h2>
|
||||
{{ pkg['dependency-metadata'][dep.key].title }}
|
||||
{{ pkg.dependencyMetadata[dep.key].title }}
|
||||
<span *ngIf="dep.value.optional; else required">(optional)</span>
|
||||
<ng-template #required>
|
||||
<span *ngSwitchCase="'opt-in'">(optional)</span>
|
||||
<span>(Required)</span>
|
||||
</ng-template>
|
||||
</h2>
|
||||
<p>{{ dep.value.description }}</p>
|
||||
|
||||
@@ -11,6 +11,6 @@ export class DependenciesComponent {
|
||||
pkg!: MarketplacePkg
|
||||
|
||||
getImg(key: string): string {
|
||||
return this.pkg['dependency-metadata'][key].icon
|
||||
return this.pkg.dependencyMetadata[key].icon
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
<div class="text">
|
||||
<h1 ticker class="title">{{ pkg.manifest.title }}</h1>
|
||||
<p class="version">{{ pkg.manifest.version | displayEmver }}</p>
|
||||
<p class="published">
|
||||
Released: {{ pkg['published-at'] | date: 'medium' }}
|
||||
</p>
|
||||
<p class="published">Released: {{ pkg.publishedAt | date: 'medium' }}</p>
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,8 +71,7 @@ export class FilterPackagesPipe implements PipeTransform {
|
||||
.filter(p => category === 'all' || p.categories.includes(category))
|
||||
.sort((a, b) => {
|
||||
return (
|
||||
new Date(b['published-at']).valueOf() -
|
||||
new Date(a['published-at']).valueOf()
|
||||
new Date(b.publishedAt).valueOf() - new Date(a.publishedAt).valueOf()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ export interface MarketplacePkg {
|
||||
manifest: Manifest
|
||||
categories: string[]
|
||||
versions: string[]
|
||||
'dependency-metadata': {
|
||||
dependencyMetadata: {
|
||||
[id: string]: DependencyMetadata
|
||||
}
|
||||
'published-at': string
|
||||
publishedAt: string
|
||||
}
|
||||
|
||||
export interface DependencyMetadata {
|
||||
@@ -45,19 +45,19 @@ export interface Manifest {
|
||||
id: string
|
||||
title: string
|
||||
version: string
|
||||
'git-hash'?: string
|
||||
gitHash?: string
|
||||
description: {
|
||||
short: string
|
||||
long: string
|
||||
}
|
||||
replaces?: string[]
|
||||
'release-notes': string
|
||||
releaseNotes: string
|
||||
license: string // name of license
|
||||
'wrapper-repo': Url
|
||||
'upstream-repo': Url
|
||||
'support-site': Url
|
||||
'marketing-site': Url
|
||||
'donation-url': Url | null
|
||||
wrapperRepo: Url
|
||||
upstreamRepo: Url
|
||||
supportSite: Url
|
||||
marketingSite: Url
|
||||
donationUrl: Url | null
|
||||
alerts: {
|
||||
install: string | null
|
||||
uninstall: string | null
|
||||
@@ -66,8 +66,8 @@ export interface Manifest {
|
||||
stop: string | null
|
||||
}
|
||||
dependencies: Record<string, Dependency>
|
||||
'os-version': string
|
||||
'has-config': boolean
|
||||
osVersion: string
|
||||
hasConfig: boolean
|
||||
}
|
||||
|
||||
export interface Dependency {
|
||||
|
||||
@@ -61,7 +61,7 @@ export class CifsModal {
|
||||
const target: CifsBackupTarget = {
|
||||
...this.cifs,
|
||||
mountable: true,
|
||||
'embassy-os': diskInfo,
|
||||
startOs: diskInfo,
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
@@ -31,11 +31,11 @@ export class PasswordPage {
|
||||
}
|
||||
|
||||
async verifyPw() {
|
||||
if (!this.target || !this.target['embassy-os'])
|
||||
if (!this.target || !this.target.startOs)
|
||||
this.pwError = 'No recovery target' // unreachable
|
||||
|
||||
try {
|
||||
const passwordHash = this.target!['embassy-os']?.['password-hash'] || ''
|
||||
const passwordHash = this.target!.startOs?.passwordHash || ''
|
||||
|
||||
argon2.verify(passwordHash, this.password)
|
||||
this.modalController.dismiss({ password: this.password }, 'success')
|
||||
|
||||
@@ -38,10 +38,7 @@ export class LoadingPage {
|
||||
|
||||
if (!progress) return
|
||||
|
||||
const {
|
||||
'total-bytes': totalBytes,
|
||||
'bytes-transferred': bytesTransferred,
|
||||
} = progress
|
||||
const { totalBytes, bytesTransferred } = progress
|
||||
|
||||
this.progress$.next({
|
||||
totalBytes,
|
||||
|
||||
@@ -35,7 +35,7 @@ export class RecoverPage {
|
||||
}
|
||||
|
||||
driveClickable(mapped: MappedDisk) {
|
||||
return mapped.drive['embassy-os']?.full
|
||||
return mapped.drive.startOs?.full
|
||||
}
|
||||
|
||||
async getDrives() {
|
||||
@@ -53,10 +53,10 @@ export class RecoverPage {
|
||||
label: p.label,
|
||||
capacity: p.capacity,
|
||||
used: p.used,
|
||||
'embassy-os': p['embassy-os'],
|
||||
startOs: p.startOs,
|
||||
}
|
||||
this.mappedDrives.push({
|
||||
hasValidBackup: !!p['embassy-os']?.full,
|
||||
hasValidBackup: !!p.startOs?.full,
|
||||
drive,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -76,9 +76,9 @@ export class SuccessPage {
|
||||
try {
|
||||
const ret = await this.api.complete()
|
||||
if (!this.isKiosk) {
|
||||
this.torAddress = ret['tor-address'].replace(/^https:/, 'http:')
|
||||
this.lanAddress = ret['lan-address'].replace(/^https:/, 'http:')
|
||||
this.cert = ret['root-ca']
|
||||
this.torAddress = ret.torAddress.replace(/^https:/, 'http:')
|
||||
this.lanAddress = ret.lanAddress.replace(/^https:/, 'http:')
|
||||
this.cert = ret.rootCa
|
||||
|
||||
await this.api.exit()
|
||||
}
|
||||
|
||||
@@ -28,27 +28,27 @@ type Encrypted = {
|
||||
}
|
||||
|
||||
export type StatusRes = {
|
||||
'bytes-transferred': number
|
||||
'total-bytes': number | null
|
||||
bytesTransferred: number
|
||||
totalBytes: number | null
|
||||
complete: boolean
|
||||
} | null
|
||||
|
||||
export type AttachReq = {
|
||||
guid: string
|
||||
'embassy-password': Encrypted
|
||||
startOsPassword: Encrypted
|
||||
}
|
||||
|
||||
export type ExecuteReq = {
|
||||
'embassy-logicalname': string
|
||||
'embassy-password': Encrypted
|
||||
'recovery-source': RecoverySource | null
|
||||
'recovery-password': Encrypted | null
|
||||
startOsLogicalname: string
|
||||
startOsPassword: Encrypted
|
||||
recoverySource: RecoverySource | null
|
||||
recoveryPassword: Encrypted | null
|
||||
}
|
||||
|
||||
export type CompleteRes = {
|
||||
'tor-address': string
|
||||
'lan-address': string
|
||||
'root-ca': string
|
||||
torAddress: string
|
||||
lanAddress: string
|
||||
rootCa: string
|
||||
}
|
||||
|
||||
export type DiskBackupTarget = {
|
||||
@@ -58,7 +58,7 @@ export type DiskBackupTarget = {
|
||||
label: string | null
|
||||
capacity: number
|
||||
used: number | null
|
||||
'embassy-os': StartOSDiskInfo | null
|
||||
startOs: StartOSDiskInfo | null
|
||||
}
|
||||
|
||||
export type CifsBackupTarget = {
|
||||
@@ -66,7 +66,7 @@ export type CifsBackupTarget = {
|
||||
path: string
|
||||
username: string
|
||||
mountable: boolean
|
||||
'embassy-os': StartOSDiskInfo | null
|
||||
startOs: StartOSDiskInfo | null
|
||||
}
|
||||
|
||||
export type DiskRecoverySource = {
|
||||
|
||||
@@ -73,11 +73,10 @@ export class LiveApiService extends ApiService {
|
||||
}
|
||||
|
||||
async execute(setupInfo: ExecuteReq) {
|
||||
if (setupInfo['recovery-source']?.type === 'backup') {
|
||||
if (isCifsSource(setupInfo['recovery-source'].target)) {
|
||||
setupInfo['recovery-source'].target.path = setupInfo[
|
||||
'recovery-source'
|
||||
].target.path.replace('/\\/g', '/')
|
||||
if (setupInfo.recoverySource?.type === 'backup') {
|
||||
if (isCifsSource(setupInfo.recoverySource.target)) {
|
||||
setupInfo.recoverySource.target.path =
|
||||
setupInfo.recoverySource.target.path.replace('/\\/g', '/')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +94,7 @@ export class LiveApiService extends ApiService {
|
||||
|
||||
return {
|
||||
...res,
|
||||
'root-ca': encodeBase64(res['root-ca']),
|
||||
rootCa: encodeBase64(res.rootCa),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ export class MockApiService extends ApiService {
|
||||
const progress = tries > 4 ? (tries - 4) * 268435456 : 0
|
||||
|
||||
return {
|
||||
'bytes-transferred': restoreOrMigrate ? progress : 0,
|
||||
'total-bytes': restoreOrMigrate ? total : null,
|
||||
bytesTransferred: restoreOrMigrate ? progress : 0,
|
||||
totalBytes: restoreOrMigrate ? total : null,
|
||||
complete: progress === total,
|
||||
}
|
||||
}
|
||||
@@ -65,12 +65,12 @@ export class MockApiService extends ApiService {
|
||||
label: null,
|
||||
capacity: 1979120929996,
|
||||
used: null,
|
||||
'embassy-os': {
|
||||
startOs: {
|
||||
version: '0.2.17',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': null,
|
||||
wrappedKey: null,
|
||||
},
|
||||
guid: null,
|
||||
},
|
||||
@@ -88,12 +88,12 @@ export class MockApiService extends ApiService {
|
||||
label: null,
|
||||
capacity: 73264762332,
|
||||
used: null,
|
||||
'embassy-os': {
|
||||
startOs: {
|
||||
version: '0.3.3',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': null,
|
||||
wrappedKey: null,
|
||||
},
|
||||
guid: null,
|
||||
},
|
||||
@@ -111,12 +111,12 @@ export class MockApiService extends ApiService {
|
||||
label: null,
|
||||
capacity: 73264762332,
|
||||
used: null,
|
||||
'embassy-os': {
|
||||
startOs: {
|
||||
version: '0.3.2',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': null,
|
||||
wrappedKey: null,
|
||||
},
|
||||
guid: 'guid-guid-guid-guid',
|
||||
},
|
||||
@@ -132,9 +132,9 @@ export class MockApiService extends ApiService {
|
||||
return {
|
||||
version: '0.3.0',
|
||||
full: true,
|
||||
'password-hash':
|
||||
passwordHash:
|
||||
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
|
||||
'wrapped-key': '',
|
||||
wrappedKey: '',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,9 +149,9 @@ export class MockApiService extends ApiService {
|
||||
async complete(): Promise<CompleteRes> {
|
||||
await pauseFor(1000)
|
||||
return {
|
||||
'tor-address': 'https://asdafsadasdasasdasdfasdfasdf.onion',
|
||||
'lan-address': 'https://adjective-noun.local',
|
||||
'root-ca': encodeBase64(rootCA),
|
||||
torAddress: 'https://asdafsadasdasasdasdfasdfasdf.onion',
|
||||
lanAddress: 'https://adjective-noun.local',
|
||||
rootCa: encodeBase64(rootCA),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export class StateService {
|
||||
async importDrive(guid: string, password: string): Promise<void> {
|
||||
await this.api.attach({
|
||||
guid,
|
||||
'embassy-password': await this.api.encrypt(password),
|
||||
startOsPassword: await this.api.encrypt(password),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@ export class StateService {
|
||||
password: string,
|
||||
): Promise<void> {
|
||||
await this.api.execute({
|
||||
'embassy-logicalname': storageLogicalname,
|
||||
'embassy-password': await this.api.encrypt(password),
|
||||
'recovery-source': this.recoverySource || null,
|
||||
'recovery-password': this.recoveryPassword
|
||||
startOsLogicalname: storageLogicalname,
|
||||
startOsPassword: await this.api.encrypt(password),
|
||||
recoverySource: this.recoverySource || null,
|
||||
recoveryPassword: this.recoveryPassword
|
||||
? await this.api.encrypt(this.recoveryPassword)
|
||||
: null,
|
||||
})
|
||||
|
||||
@@ -6,8 +6,8 @@ export type ServerLogsReq = {
|
||||
|
||||
export type LogsRes = {
|
||||
entries: Log[]
|
||||
'start-cursor'?: string
|
||||
'end-cursor'?: string
|
||||
startCursor?: string
|
||||
endCursor?: string
|
||||
}
|
||||
|
||||
export interface Log {
|
||||
@@ -31,13 +31,13 @@ export interface PartitionInfo {
|
||||
label: string | null
|
||||
capacity: number
|
||||
used: number | null
|
||||
'embassy-os': StartOSDiskInfo | null
|
||||
startOs: StartOSDiskInfo | null
|
||||
guid: string | null
|
||||
}
|
||||
|
||||
export type StartOSDiskInfo = {
|
||||
version: string
|
||||
full: boolean
|
||||
'password-hash': string | null
|
||||
'wrapped-key': string | null
|
||||
passwordHash: string | null
|
||||
wrappedKey: string | null
|
||||
}
|
||||
|
||||
@@ -63,15 +63,6 @@ const routes: Routes = [
|
||||
m => m.AppsRoutingModule,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'developer',
|
||||
canActivate: [AuthGuard],
|
||||
canActivateChild: [AuthGuard],
|
||||
loadChildren: () =>
|
||||
import('./pages/developer-routes/developer-routing.module').then(
|
||||
m => m.DeveloperRoutingModule,
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -29,13 +29,12 @@ export class AppComponent implements OnDestroy {
|
||||
this.authService.isVerified$,
|
||||
this.connection.connected$,
|
||||
this.patch
|
||||
.watch$('server-info', 'status-info')
|
||||
.pipe(startWith({ restarting: false, 'shutting-down': false })),
|
||||
.watch$('serverInfo', 'statusInfo')
|
||||
.pipe(startWith({ restarting: false, shuttingDown: false })),
|
||||
]).pipe(
|
||||
map(
|
||||
([verified, connected, status]) =>
|
||||
verified &&
|
||||
(!connected || status.restarting || status['shutting-down']),
|
||||
verified && (!connected || status.restarting || status.shuttingDown),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { DataModel } from '../../services/patch-db/data-model'
|
||||
})
|
||||
export class FooterComponent {
|
||||
readonly progress$ = this.patch
|
||||
.watch$('server-info', 'status-info', 'update-progress')
|
||||
.watch$('serverInfo', 'statusInfo', 'updateProgress')
|
||||
.pipe(map(a => a && { ...a }))
|
||||
|
||||
readonly animation = {
|
||||
|
||||
@@ -11,9 +11,7 @@ import {
|
||||
filter,
|
||||
first,
|
||||
map,
|
||||
merge,
|
||||
Observable,
|
||||
of,
|
||||
pairwise,
|
||||
startWith,
|
||||
switchMap,
|
||||
@@ -24,14 +22,7 @@ import { DataModel, PackageState } from 'src/app/services/patch-db/data-model'
|
||||
import { SplitPaneTracker } from 'src/app/services/split-pane.service'
|
||||
import { Emver, THEME } from '@start9labs/shared'
|
||||
import { ConnectionService } from 'src/app/services/connection.service'
|
||||
import { ConfigService } from 'src/app/services/config.service'
|
||||
import {
|
||||
getManifest,
|
||||
isInstalled,
|
||||
isInstalling,
|
||||
isRestoring,
|
||||
isUpdating,
|
||||
} from 'src/app/util/get-package-data'
|
||||
import { getManifest } from 'src/app/util/get-package-data'
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
@@ -69,19 +60,19 @@ export class MenuComponent {
|
||||
]
|
||||
|
||||
readonly notificationCount$ = this.patch.watch$(
|
||||
'server-info',
|
||||
'unread-notification-count',
|
||||
'serverInfo',
|
||||
'unreadNotificationCount',
|
||||
)
|
||||
|
||||
readonly snekScore$ = this.patch.watch$('ui', 'gaming', 'snake', 'high-score')
|
||||
readonly snekScore$ = this.patch.watch$('ui', 'gaming', 'snake', 'highScore')
|
||||
|
||||
readonly showEOSUpdate$ = this.eosService.showUpdate$
|
||||
|
||||
private readonly local$ = this.connectionService.connected$.pipe(
|
||||
filter(Boolean),
|
||||
switchMap(() => this.patch.watch$('package-data').pipe(first())),
|
||||
switchMap(() => this.patch.watch$('packageData').pipe(first())),
|
||||
switchMap(outer =>
|
||||
this.patch.watch$('package-data').pipe(
|
||||
this.patch.watch$('packageData').pipe(
|
||||
pairwise(),
|
||||
filter(([prev, curr]) =>
|
||||
Object.values(prev).some(
|
||||
@@ -90,9 +81,9 @@ export class MenuComponent {
|
||||
PackageState.Installing,
|
||||
PackageState.Updating,
|
||||
PackageState.Restoring,
|
||||
].includes(p['state-info'].state) &&
|
||||
].includes(p.stateInfo.state) &&
|
||||
[PackageState.Installed, PackageState.Removing].includes(
|
||||
curr[getManifest(p).id]['state-info'].state,
|
||||
curr[getManifest(p).id].stateInfo.state,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -136,6 +127,5 @@ export class MenuComponent {
|
||||
private readonly splitPane: SplitPaneTracker,
|
||||
private readonly emver: Emver,
|
||||
private readonly connectionService: ConnectionService,
|
||||
private readonly config: ConfigService,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export class BackupService {
|
||||
}
|
||||
|
||||
hasValidBackup(target: BackupTarget): boolean {
|
||||
const backup = target['embassy-os']
|
||||
const backup = target.startOs
|
||||
return !!backup && this.emver.compare(backup.version, '0.3.0') !== -1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ const { enableWidgets } =
|
||||
})
|
||||
export class BadgeMenuComponent {
|
||||
readonly unreadCount$ = this.patch.watch$(
|
||||
'server-info',
|
||||
'unread-notification-count',
|
||||
'serverInfo',
|
||||
'unreadNotificationCount',
|
||||
)
|
||||
readonly sidebarOpen$ = this.splitPane.sidebarOpen$
|
||||
readonly widgetDrawer$ = this.clientStorageService.widgetDrawer$
|
||||
|
||||
@@ -22,8 +22,8 @@ export class ConnectionBarComponent {
|
||||
this.connectionService.networkConnected$,
|
||||
this.websocket$.pipe(startWith(false)),
|
||||
this.patch
|
||||
.watch$('server-info', 'status-info')
|
||||
.pipe(startWith({ restarting: false, 'shutting-down': false })),
|
||||
.watch$('serverInfo', 'statusInfo')
|
||||
.pipe(startWith({ restarting: false, shuttingDown: false })),
|
||||
]).pipe(
|
||||
map(([network, websocket, status]) => {
|
||||
if (!network)
|
||||
@@ -40,7 +40,7 @@ export class ConnectionBarComponent {
|
||||
icon: 'cloud-offline-outline',
|
||||
dots: true,
|
||||
}
|
||||
if (status['shutting-down'])
|
||||
if (status.shuttingDown)
|
||||
return {
|
||||
message: 'Shutting Down',
|
||||
color: 'dark',
|
||||
|
||||
@@ -78,7 +78,7 @@ export class LogsComponent {
|
||||
async ngOnInit() {
|
||||
from(this.followLogs({ limit: this.limit }))
|
||||
.pipe(
|
||||
switchMap(({ 'start-cursor': startCursor, guid }) => {
|
||||
switchMap(({ startCursor, guid }) => {
|
||||
this.startCursor = startCursor
|
||||
return this.connect$(guid)
|
||||
}),
|
||||
@@ -206,7 +206,7 @@ export class LogsComponent {
|
||||
}
|
||||
|
||||
private processRes(res: LogsRes) {
|
||||
const { entries, 'start-cursor': startCursor } = res
|
||||
const { entries, startCursor } = res
|
||||
|
||||
if (!entries.length) return
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class NotificationsToastService extends Observable<boolean> {
|
||||
private readonly stream$ = this.patch
|
||||
.watch$('server-info', 'unread-notification-count')
|
||||
.watch$('serverInfo', 'unreadNotificationCount')
|
||||
.pipe(
|
||||
pairwise(),
|
||||
map(([prev, cur]) => cur > prev),
|
||||
|
||||
@@ -8,7 +8,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class RefreshAlertService extends Observable<boolean> {
|
||||
private readonly stream$ = this.patch.watch$('server-info', 'version').pipe(
|
||||
private readonly stream$ = this.patch.watch$('serverInfo', 'version').pipe(
|
||||
map(version => !!this.emver.compare(this.config.version, version)),
|
||||
endWith(false),
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class UpdateToastService extends Observable<boolean> {
|
||||
private readonly stream$ = this.patch
|
||||
.watch$('server-info', 'status-info', 'updated')
|
||||
.watch$('serverInfo', 'statusInfo', 'updated')
|
||||
.pipe(distinctUntilChanged(), filter(Boolean), endWith(false))
|
||||
|
||||
constructor(private readonly patch: PatchDB<DataModel>) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="ion-padding" *ngIf="pkg['state-info'].manifest as manifest">
|
||||
<ion-content class="ion-padding" *ngIf="pkg.stateInfo.manifest as manifest">
|
||||
<!-- loading -->
|
||||
<text-spinner
|
||||
*ngIf="loading; else notLoading"
|
||||
@@ -82,7 +82,7 @@
|
||||
</ion-item>
|
||||
|
||||
<!-- no options -->
|
||||
<ion-item *ngIf="!hasOptions">
|
||||
<ion-item *ngIf="!hasConfig">
|
||||
<ion-label>
|
||||
<p>
|
||||
No config options for {{ manifest.title }} {{ manifest.version }}.
|
||||
@@ -111,11 +111,7 @@
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<ng-container *ngIf="!loading && !loadingError">
|
||||
<ion-buttons
|
||||
*ngIf="configForm && hasOptions"
|
||||
slot="start"
|
||||
class="ion-padding-start"
|
||||
>
|
||||
<ion-buttons *ngIf="hasConfig" slot="start" class="ion-padding-start">
|
||||
<ion-button fill="clear" (click)="resetDefaults()">
|
||||
<ion-icon slot="start" name="refresh"></ion-icon>
|
||||
Reset Defaults
|
||||
@@ -123,7 +119,7 @@
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end" class="ion-padding-end">
|
||||
<ion-button
|
||||
*ngIf="configForm"
|
||||
*ngIf="hasConfig"
|
||||
fill="solid"
|
||||
color="primary"
|
||||
[disabled]="saving"
|
||||
@@ -134,7 +130,7 @@
|
||||
Save
|
||||
</ion-button>
|
||||
<ion-button
|
||||
*ngIf="!configForm"
|
||||
*ngIf="!hasConfig"
|
||||
fill="solid"
|
||||
color="dark"
|
||||
(click)="dismiss()"
|
||||
|
||||
@@ -59,8 +59,6 @@ export class AppConfigPage {
|
||||
saving = false
|
||||
loadingError: string | IonicSafeString = ''
|
||||
|
||||
hasOptions = false
|
||||
|
||||
constructor(
|
||||
private readonly embassyApi: ApiService,
|
||||
private readonly errToast: ErrorToastService,
|
||||
@@ -71,6 +69,10 @@ export class AppConfigPage {
|
||||
private readonly patch: PatchDB<DataModel>,
|
||||
) {}
|
||||
|
||||
get hasConfig() {
|
||||
return this.pkg.stateInfo.manifest.hasConfig
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
try {
|
||||
const pkg = await getPackage(this.patch, this.pkgId)
|
||||
@@ -78,7 +80,7 @@ export class AppConfigPage {
|
||||
|
||||
this.pkg = pkg
|
||||
|
||||
if (!this.pkg['state-info'].manifest['has-config']) return
|
||||
if (!this.hasConfig) return
|
||||
|
||||
let newConfig: object | undefined
|
||||
let patch: Operation[] | undefined
|
||||
@@ -86,12 +88,12 @@ export class AppConfigPage {
|
||||
if (this.dependentInfo) {
|
||||
this.loadingText = `Setting properties to accommodate ${this.dependentInfo.title}`
|
||||
const {
|
||||
'old-config': oc,
|
||||
'new-config': nc,
|
||||
oldConfig: oc,
|
||||
newConfig: nc,
|
||||
spec: s,
|
||||
} = await this.embassyApi.dryConfigureDependency({
|
||||
'dependency-id': this.pkgId,
|
||||
'dependent-id': this.dependentInfo.id,
|
||||
dependencyId: this.pkgId,
|
||||
dependentId: this.dependentInfo.id,
|
||||
})
|
||||
this.original = oc
|
||||
newConfig = nc
|
||||
@@ -111,10 +113,6 @@ export class AppConfigPage {
|
||||
newConfig || this.original,
|
||||
)
|
||||
|
||||
this.hasOptions = !!Object.values(this.configSpec).find(
|
||||
valSpec => valSpec.type !== 'pointer',
|
||||
)
|
||||
|
||||
if (patch) {
|
||||
this.diff = this.getDiff(patch)
|
||||
this.markDirty(patch)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<ng-container
|
||||
*ngIf="packageData$ | toOptions : backupInfo['package-backups'] | async as options"
|
||||
*ngIf="packageData$ | toOptions : backupInfo.packageBackups | async as options"
|
||||
>
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
|
||||
@@ -23,7 +23,7 @@ export class AppRecoverSelectPage {
|
||||
@Input() password!: string
|
||||
@Input() oldPassword?: string
|
||||
|
||||
readonly packageData$ = this.patch.watch$('package-data').pipe(take(1))
|
||||
readonly packageData$ = this.patch.watch$('packageData').pipe(take(1))
|
||||
|
||||
hasSelection = false
|
||||
error: string | IonicSafeString = ''
|
||||
@@ -53,8 +53,8 @@ export class AppRecoverSelectPage {
|
||||
try {
|
||||
await this.embassyApi.restorePackages({
|
||||
ids,
|
||||
'target-id': this.id,
|
||||
'old-password': this.oldPassword || null,
|
||||
targetId: this.id,
|
||||
oldPassword: this.oldPassword || null,
|
||||
password: this.password,
|
||||
})
|
||||
this.modalCtrl.dismiss(undefined, 'success')
|
||||
|
||||
@@ -34,7 +34,7 @@ export class ToOptionsPipe implements PipeTransform {
|
||||
id,
|
||||
installed: !!packageData[id],
|
||||
checked: false,
|
||||
'newer-eos': this.compare(packageBackups[id]['os-version']),
|
||||
'newer-eos': this.compare(packageBackups[id].osVersion),
|
||||
}))
|
||||
.sort((a, b) =>
|
||||
b.title.toLowerCase() > a.title.toLowerCase() ? -1 : 1,
|
||||
|
||||
@@ -29,7 +29,7 @@ export class BackupSelectPage {
|
||||
|
||||
async ngOnInit() {
|
||||
this.pkgs = await firstValueFrom(
|
||||
this.patch.watch$('package-data').pipe(
|
||||
this.patch.watch$('packageData').pipe(
|
||||
map(pkgs => {
|
||||
return Object.values(pkgs)
|
||||
.map(pkg => {
|
||||
@@ -38,7 +38,7 @@ export class BackupSelectPage {
|
||||
id,
|
||||
title,
|
||||
icon: pkg.icon,
|
||||
disabled: pkg['state-info'].state !== PackageState.Installed,
|
||||
disabled: pkg.stateInfo.state !== PackageState.Installed,
|
||||
checked: false,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -200,7 +200,7 @@ export class MarketplaceSettingsPage {
|
||||
): Promise<void> {
|
||||
// Error on duplicates
|
||||
const hosts = await firstValueFrom(
|
||||
this.patch.watch$('ui', 'marketplace', 'known-hosts'),
|
||||
this.patch.watch$('ui', 'marketplace', 'knownHosts'),
|
||||
)
|
||||
const currentUrls = Object.keys(hosts).map(toUrl)
|
||||
if (currentUrls.includes(url)) throw new Error('marketplace already added')
|
||||
@@ -217,7 +217,7 @@ export class MarketplaceSettingsPage {
|
||||
loader.message = 'Saving...'
|
||||
|
||||
await this.api.setDbValue<{ name: string }>(
|
||||
['marketplace', 'known-hosts', url],
|
||||
['marketplace', 'knownHosts', url],
|
||||
{ name },
|
||||
)
|
||||
}
|
||||
@@ -229,7 +229,7 @@ export class MarketplaceSettingsPage {
|
||||
await loader.present()
|
||||
|
||||
const hosts = await firstValueFrom(
|
||||
this.patch.watch$('ui', 'marketplace', 'known-hosts'),
|
||||
this.patch.watch$('ui', 'marketplace', 'knownHosts'),
|
||||
)
|
||||
|
||||
const filtered: { [url: string]: UIStore } = Object.keys(hosts)
|
||||
@@ -244,7 +244,7 @@ export class MarketplaceSettingsPage {
|
||||
|
||||
try {
|
||||
await this.api.setDbValue<{ [url: string]: UIStore }>(
|
||||
['marketplace', 'known-hosts'],
|
||||
['marketplace', 'knownHosts'],
|
||||
filtered,
|
||||
)
|
||||
} catch (e: any) {
|
||||
|
||||
@@ -22,7 +22,7 @@ export class OSUpdatePage {
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const releaseNotes = this.eosService.eos?.['release-notes']!
|
||||
const releaseNotes = this.eosService.eos?.releaseNotes!
|
||||
|
||||
this.versions = Object.keys(releaseNotes)
|
||||
.sort()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<ion-content class="ion-padding-top with-widgets">
|
||||
<ng-container *ngIf="pkg$ | async as pkg">
|
||||
<ion-item-group *ngIf="pkg['state-info'].state === 'installed'">
|
||||
<ion-item-group *ngIf="pkg.stateInfo.state === 'installed'">
|
||||
<!-- ** standard actions ** -->
|
||||
<ion-item-divider>Standard Actions</ion-item-divider>
|
||||
<app-actions-item
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<!-- ** specific actions ** -->
|
||||
<ion-item-divider *ngIf="!(pkg.actions | empty)">
|
||||
Actions for {{ pkg['state-info'].manifest.title }}
|
||||
Actions for {{ pkg.stateInfo.manifest.title }}
|
||||
</ion-item-divider>
|
||||
<app-actions-item
|
||||
*ngFor="let action of pkg.actions | keyvalue: asIsOrder"
|
||||
|
||||
@@ -29,7 +29,7 @@ import { ActionMetadata } from '@start9labs/start-sdk/cjs/sdk/lib/types'
|
||||
})
|
||||
export class AppActionsPage {
|
||||
readonly pkgId = getPkgId(this.route)
|
||||
readonly pkg$ = this.patch.watch$('package-data', this.pkgId)
|
||||
readonly pkg$ = this.patch.watch$('packageData', this.pkgId)
|
||||
|
||||
constructor(
|
||||
private readonly route: ActivatedRoute,
|
||||
@@ -184,7 +184,7 @@ export class AppActionsPage {
|
||||
try {
|
||||
const res = await this.embassyApi.executePackageAction({
|
||||
id: this.pkgId,
|
||||
'action-id': actionId,
|
||||
actionId,
|
||||
input,
|
||||
})
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export class AppInterfacesPage {
|
||||
readonly pkgId = getPkgId(this.route)
|
||||
|
||||
readonly serviceInterfaces$ = this.patch
|
||||
.watch$('package-data', this.pkgId, 'service-interfaces')
|
||||
.watch$('packageData', this.pkgId, 'serviceInterfaces')
|
||||
.pipe(
|
||||
map(interfaces => {
|
||||
const sorted = Object.values(interfaces)
|
||||
|
||||
@@ -14,20 +14,20 @@
|
||||
<p>{{ manifest.version | displayEmver }}</p>
|
||||
<status
|
||||
[rendering]="pkg.primaryRendering"
|
||||
[installingInfo]="$any(pkg.entry['state-info'])['installing-info']"
|
||||
[installingInfo]="$any(pkg.entry.stateInfo).installingInfo"
|
||||
weight="bold"
|
||||
size="small"
|
||||
[sigtermTimeout]="sigtermTimeout"
|
||||
></status>
|
||||
</ion-label>
|
||||
<ion-button
|
||||
*ngIf="pkg.entry['service-interfaces'] | hasUi"
|
||||
*ngIf="pkg.entry.serviceInterfaces | hasUi"
|
||||
slot="end"
|
||||
fill="clear"
|
||||
color="primary"
|
||||
(click)="launchUi($event, pkg.entry['service-interfaces'])"
|
||||
(click)="launchUi($event, pkg.entry.serviceInterfaces)"
|
||||
[disabled]="
|
||||
!(pkg.entry['state-info'].state | isLaunchable: pkgMainStatus.status)
|
||||
!(pkg.entry.stateInfo.state | isLaunchable: pkgMainStatus.status)
|
||||
"
|
||||
>
|
||||
<ion-icon slot="icon-only" name="open-outline"></ion-icon>
|
||||
|
||||
@@ -32,7 +32,7 @@ export class AppListPkgComponent {
|
||||
: null
|
||||
}
|
||||
|
||||
launchUi(e: Event, interfaces: PackageDataEntry['service-interfaces']): void {
|
||||
launchUi(e: Event, interfaces: PackageDataEntry['serviceInterfaces']): void {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
this.launcherService.launch(interfaces)
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getManifest } from 'src/app/util/get-package-data'
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class AppListPage {
|
||||
readonly pkgs$ = this.patch.watch$('package-data').pipe(
|
||||
readonly pkgs$ = this.patch.watch$('packageData').pipe(
|
||||
map(pkgs => Object.values(pkgs)),
|
||||
startWith([]),
|
||||
pairwise(),
|
||||
|
||||
@@ -17,7 +17,7 @@ export class PackageInfoPipe implements PipeTransform {
|
||||
|
||||
transform(pkgId: string): Observable<PkgInfo> {
|
||||
return combineLatest([
|
||||
this.patch.watch$('package-data', pkgId).pipe(filter(Boolean)),
|
||||
this.patch.watch$('packageData', pkgId).pipe(filter(Boolean)),
|
||||
this.depErrorService.getPkgDepErrors$(pkgId),
|
||||
]).pipe(map(([pkg, depErrors]) => getPackageInfo(pkg, depErrors)))
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class AppPropertiesPage {
|
||||
unmasked: { [key: string]: boolean } = {}
|
||||
|
||||
stopped$ = this.patch
|
||||
.watch$('package-data', this.pkgId, 'status', 'main', 'status')
|
||||
.watch$('packageData', this.pkgId, 'status', 'main', 'status')
|
||||
.pipe(map(status => status === PackageMainStatus.Stopped))
|
||||
|
||||
@ViewChild(IonBackButtonDelegate, { static: false })
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user