@orsetra/shared-ui 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/ui/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { ImageCropDialog } from './image-crop-dialog'
|
|
|
18
18
|
// Note: The following components are not exported as they depend on app-specific services or models:
|
|
19
19
|
// - CertificateEditor, EnvironmentSettings, EnvironmentVariablesConfig
|
|
20
20
|
// - FileImport, ProcessStatus, ResourceSettings, SecretExplorer, SecretPropertiesEditor, SelectedAsset
|
|
21
|
+
export { ResourceSettings } from './resource-settings'
|
|
21
22
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './accordion'
|
|
22
23
|
export { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from './alert-dialog'
|
|
23
24
|
export { Alert, AlertTitle, AlertDescription } from './alert'
|
|
@@ -4,20 +4,37 @@ import { Label } from "./label"
|
|
|
4
4
|
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "./select"
|
|
5
5
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion"
|
|
6
6
|
import { Cpu, MemoryStick } from "lucide-react"
|
|
7
|
-
import {
|
|
7
|
+
import type { ResourceConfig, ScalabilityConfig } from "@orsetra/shared-types"
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
cpu: string
|
|
11
|
-
memory: string
|
|
12
|
-
}
|
|
9
|
+
export type { ResourceConfig, ScalabilityConfig } from "@orsetra/shared-types"
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
scalingStrategy: "manual" | "auto"
|
|
11
|
+
interface ResourceOption {
|
|
12
|
+
value: string
|
|
13
|
+
label: string
|
|
14
|
+
description: string
|
|
19
15
|
}
|
|
20
16
|
|
|
17
|
+
const cpuOptions: ResourceOption[] = [
|
|
18
|
+
{ value: "250m", label: "0.25 vCPU", description: "Light workloads" },
|
|
19
|
+
{ value: "500m", label: "0.5 vCPU", description: "Standard workloads" },
|
|
20
|
+
{ value: "1000m", label: "1 vCPU", description: "High workloads" },
|
|
21
|
+
{ value: "2000m", label: "2 vCPU", description: "Very high workloads" },
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const memoryOptions: ResourceOption[] = [
|
|
25
|
+
{ value: "512Mi", label: "512 MiB", description: "Light workloads" },
|
|
26
|
+
{ value: "1Gi", label: "1 GiB", description: "Standard workloads" },
|
|
27
|
+
{ value: "2Gi", label: "2 GiB", description: "High workloads" },
|
|
28
|
+
{ value: "4Gi", label: "4 GiB", description: "Very high workloads" },
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const replicasOptions: Array<{ value: number; label: string }> = [
|
|
32
|
+
{ value: 1, label: "1" },
|
|
33
|
+
{ value: 2, label: "2" },
|
|
34
|
+
{ value: 3, label: "3" },
|
|
35
|
+
{ value: 4, label: "4" },
|
|
36
|
+
]
|
|
37
|
+
|
|
21
38
|
interface ResourceSettingsProps {
|
|
22
39
|
resources: ResourceConfig
|
|
23
40
|
onResourcesChange: (config: ResourceConfig) => void
|
|
@@ -163,7 +180,7 @@ export function ResourceSettings({
|
|
|
163
180
|
<SelectValue />
|
|
164
181
|
</SelectTrigger>
|
|
165
182
|
<SelectContent>
|
|
166
|
-
{replicasOptions.map((option
|
|
183
|
+
{replicasOptions.map((option) => (
|
|
167
184
|
<SelectItem key={option.value} value={option.value.toString()}>
|
|
168
185
|
{option.label}
|
|
169
186
|
</SelectItem>
|
|
@@ -188,7 +205,7 @@ export function ResourceSettings({
|
|
|
188
205
|
<SelectValue />
|
|
189
206
|
</SelectTrigger>
|
|
190
207
|
<SelectContent>
|
|
191
|
-
{replicasOptions.map((option
|
|
208
|
+
{replicasOptions.map((option) => (
|
|
192
209
|
<SelectItem key={option.value} value={option.value.toString()}>
|
|
193
210
|
{option.label}
|
|
194
211
|
</SelectItem>
|
|
@@ -207,7 +224,7 @@ export function ResourceSettings({
|
|
|
207
224
|
<SelectValue />
|
|
208
225
|
</SelectTrigger>
|
|
209
226
|
<SelectContent>
|
|
210
|
-
{replicasOptions.map((option
|
|
227
|
+
{replicasOptions.map((option) => (
|
|
211
228
|
<SelectItem key={option.value} value={option.value.toString()}>
|
|
212
229
|
{option.label}
|
|
213
230
|
</SelectItem>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orsetra/shared-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "Shared UI components for Orsetra platform",
|
|
5
5
|
"main": "./index.ts",
|
|
6
6
|
"types": "./index.ts",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@hookform/resolvers": "^3.9.1",
|
|
44
|
+
"@orsetra/shared-types": "^1.0.2",
|
|
44
45
|
"@radix-ui/react-accordion": "1.2.2",
|
|
45
46
|
"@radix-ui/react-alert-dialog": "1.1.4",
|
|
46
47
|
"@radix-ui/react-aspect-ratio": "1.1.1",
|