From 26295dfa33861b207177954a3f335fb0f964fc75 Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Thu, 27 Feb 2025 13:25:04 +0100 Subject: [PATCH 1/3] feat: project compute type --- common/src/models/project.rs | 32 +++++++++++++++++++++++++++++++- common/types.ts | 10 +++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/common/src/models/project.rs b/common/src/models/project.rs index 249ebb230..828320164 100644 --- a/common/src/models/project.rs +++ b/common/src/models/project.rs @@ -27,7 +27,8 @@ pub struct ProjectResponse { pub team_id: Option, pub created_at: DateTime, pub compute_tier: Option, - /// State of the current deployment if one exists (something has been deployed). + pub compute_type: Option, + /// State of the current deployment if one exists (something has been deployed) pub deployment_state: Option, /// URIs where running deployments can be reached pub uris: Vec, @@ -47,6 +48,24 @@ impl ProjectResponse { self.team_id.as_deref().unwrap_or("N/A") ) .unwrap(); + writeln!( + &mut s, + " Compute type: {}", + self.compute_type + .clone() + .map(|c| c.to_string()) + .unwrap_or("N/A".to_owned()) + ) + .unwrap(); + writeln!( + &mut s, + " Compute tier: {}", + self.compute_tier + .clone() + .map(|c| c.to_string()) + .unwrap_or("N/A".to_owned()) + ) + .unwrap(); writeln!( &mut s, " Created: {}", @@ -83,6 +102,8 @@ pub struct ProjectUpdateRequest { pub remove_from_team: Option, /// Change compute tier pub compute_tier: Option, + /// Change compute type + pub compute_type: Option, } #[derive( @@ -100,3 +121,12 @@ pub enum ComputeTier { XL, XXL, } + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Display, Serialize, Deserialize, EnumString)] +#[serde(rename_all = "lowercase")] +#[strum(serialize_all = "lowercase")] +#[typeshare::typeshare] +pub enum ComputeType { + Fargate, + FargateSpot, +} diff --git a/common/types.ts b/common/types.ts index 05a080f06..81f46732e 100644 --- a/common/types.ts +++ b/common/types.ts @@ -175,6 +175,11 @@ export enum ComputeTier { XXL = "xxl", } +export enum ComputeType { + Fargate = "fargate", + FargateSpot = "fargatespot", +} + export interface ProjectResponse { id: string; /** Display name */ @@ -185,7 +190,8 @@ export interface ProjectResponse { team_id?: string; created_at: string; compute_tier?: ComputeTier; - /** State of the current deployment if one exists (something has been deployed). */ + compute_type?: ComputeType; + /** State of the current deployment if one exists (something has been deployed) */ deployment_state?: DeploymentState; /** URIs where running deployments can be reached */ uris: string[]; @@ -207,6 +213,8 @@ export interface ProjectUpdateRequest { remove_from_team?: boolean; /** Change compute tier */ compute_tier?: ComputeTier; + /** Change compute type */ + compute_type?: ComputeType; } export enum ResourceType { From cb84614523f5fdb7929ca6efb9fa64c139cfa052 Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Sat, 1 Mar 2025 01:20:33 +0100 Subject: [PATCH 2/3] less clone --- common/src/models/project.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/src/models/project.rs b/common/src/models/project.rs index 828320164..4587ac326 100644 --- a/common/src/models/project.rs +++ b/common/src/models/project.rs @@ -52,7 +52,6 @@ impl ProjectResponse { &mut s, " Compute type: {}", self.compute_type - .clone() .map(|c| c.to_string()) .unwrap_or("N/A".to_owned()) ) @@ -61,7 +60,6 @@ impl ProjectResponse { &mut s, " Compute tier: {}", self.compute_tier - .clone() .map(|c| c.to_string()) .unwrap_or("N/A".to_owned()) ) From d39e557b3d7b49e374efac2c00dc26c7addbe6ec Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Sat, 1 Mar 2025 01:51:15 +0100 Subject: [PATCH 3/3] feat: proxy type --- common/src/models/project.rs | 22 +++++++++++++++++++++- common/types.ts | 16 ++++++++++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/common/src/models/project.rs b/common/src/models/project.rs index 4587ac326..26b810d8d 100644 --- a/common/src/models/project.rs +++ b/common/src/models/project.rs @@ -26,8 +26,9 @@ pub struct ProjectResponse { /// Team project belongs to pub team_id: Option, pub created_at: DateTime, - pub compute_tier: Option, pub compute_type: Option, + pub compute_tier: Option, + pub proxy_type: Option, /// State of the current deployment if one exists (something has been deployed) pub deployment_state: Option, /// URIs where running deployments can be reached @@ -64,6 +65,14 @@ impl ProjectResponse { .unwrap_or("N/A".to_owned()) ) .unwrap(); + writeln!( + &mut s, + " Proxy type: {}", + self.proxy_type + .map(|c| c.to_string()) + .unwrap_or("N/A".to_owned()) + ) + .unwrap(); writeln!( &mut s, " Created: {}", @@ -102,6 +111,8 @@ pub struct ProjectUpdateRequest { pub compute_tier: Option, /// Change compute type pub compute_type: Option, + /// Change proxy type + pub proxy_type: Option, } #[derive( @@ -128,3 +139,12 @@ pub enum ComputeType { Fargate, FargateSpot, } + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Display, Serialize, Deserialize, EnumString)] +#[serde(rename_all = "lowercase")] +#[strum(serialize_all = "lowercase")] +#[typeshare::typeshare] +pub enum ProxyType { + ShuttleProxy, + AwsAlb, +} diff --git a/common/types.ts b/common/types.ts index 81f46732e..b5cd32d17 100644 --- a/common/types.ts +++ b/common/types.ts @@ -166,6 +166,11 @@ export interface ProjectCreateRequest { name: string; } +export enum ComputeType { + Fargate = "fargate", + FargateSpot = "fargatespot", +} + export enum ComputeTier { XS = "xs", S = "s", @@ -175,9 +180,9 @@ export enum ComputeTier { XXL = "xxl", } -export enum ComputeType { - Fargate = "fargate", - FargateSpot = "fargatespot", +export enum ProxyType { + ShuttleProxy = "shuttleproxy", + AwsAlb = "awsalb", } export interface ProjectResponse { @@ -189,8 +194,9 @@ export interface ProjectResponse { /** Team project belongs to */ team_id?: string; created_at: string; - compute_tier?: ComputeTier; compute_type?: ComputeType; + compute_tier?: ComputeTier; + proxy_type?: ProxyType; /** State of the current deployment if one exists (something has been deployed) */ deployment_state?: DeploymentState; /** URIs where running deployments can be reached */ @@ -215,6 +221,8 @@ export interface ProjectUpdateRequest { compute_tier?: ComputeTier; /** Change compute type */ compute_type?: ComputeType; + /** Change proxy type */ + proxy_type?: ProxyType; } export enum ResourceType {