@@ -221,22 +226,12 @@
{:else}
{#each visibleDeployments as deployment, i (deployment.id ?? i)}
{@const prod = isProdDeployment(deployment)}
@@ -308,6 +303,34 @@
{prod ? "View" : "Preview"}
+ {#if prod && canManage && isActiveDeployment(deployment)}
+
{
+ openDropdownId = "";
+ prodSlotsModalOpen = true;
+ }}
+ >
+
+
+ Manage units
+
+
+ {/if}
+ {#if !prod && canManage && isActiveDeployment(deployment)}
+
{
+ openDropdownId = "";
+ devSlotsModalOpen = true;
+ }}
+ >
+
+
+ Manage units
+
+
+ {/if}
{#if canStart}
+
+
+
+
diff --git a/web-admin/src/features/projects/status/overview/DeploymentSection.svelte b/web-admin/src/features/projects/status/overview/DeploymentSection.svelte
index c6f3c752d5b..9e71fdca420 100644
--- a/web-admin/src/features/projects/status/overview/DeploymentSection.svelte
+++ b/web-admin/src/features/projects/status/overview/DeploymentSection.svelte
@@ -2,31 +2,18 @@
import { page } from "$app/stores";
import {
createAdminServiceGetProject,
- createAdminServiceGetBillingSubscription,
V1DeploymentStatus,
} from "@rilldata/web-admin/client";
- import {
- isFreePlan,
- isProPlan,
- isTrialPlan,
- } from "@rilldata/web-admin/features/billing/plans/utils";
import { extractBranchFromPath } from "@rilldata/web-admin/features/branches/branch-utils";
import { useDashboardsLastUpdated } from "@rilldata/web-admin/features/dashboards/listing/selectors";
import { useGithubLastSynced } from "@rilldata/web-admin/features/projects/selectors";
- import { createRuntimeServiceGetInstance } from "@rilldata/web-common/runtime-client";
import { createQueryServiceProjectStorage } from "@rilldata/web-common/runtime-client/v2/gen/query-service";
import { useRuntimeClient } from "@rilldata/web-common/runtime-client/v2";
import { formatMemorySize } from "@rilldata/web-common/lib/number-formatting/memory-size";
- import {
- useParserReconcileError,
- useProjectDeployment,
- useRuntimeVersion,
- } from "../selectors";
+ import { useParserReconcileError, useProjectDeployment } from "../selectors";
import {
formatEnvironmentName,
- formatConnectorName,
- getOlapEngineLabel,
getStatusDotClass,
getStatusLabel,
isTransitoryStatus,
@@ -72,16 +59,6 @@
);
$: lastUpdated = $githubLastSynced.data ?? $dashboardsLastUpdated;
- // Runtime
- $: runtimeVersionQuery = useRuntimeVersion(runtimeClient);
- $: version = $runtimeVersionQuery.data?.version?.match(/v[\d.]+/)?.[0] ?? "";
-
- // Connectors — sensitive: true is needed to read projectConnectors (OLAP/AI connector types)
- $: instanceQuery = createRuntimeServiceGetInstance(runtimeClient, {
- sensitive: true,
- });
- $: instance = $instanceQuery.data?.instance;
-
// Project storage (OLAP connector data size)
$: storageQuery = createQueryServiceProjectStorage(runtimeClient, {});
$: defaultOlapEntry = $storageQuery.data?.entries?.find(
@@ -105,29 +82,15 @@
$: isGithubConnected =
!!projectData?.gitRemote && !projectData?.managedGitId && !!githubUrl;
- $: olapConnector = instance?.projectConnectors?.find(
- (c) => c.name === instance?.olapConnector,
- );
- $: olapEngineLabel = getOlapEngineLabel(olapConnector);
- $: aiConnector = instance?.projectConnectors?.find(
- (c) => c.name === instance?.aiConnector,
- );
-
// Slots
- $: currentSlots = Number(projectData?.prodSlots) || 0;
-
- // Billing plan detection
- $: subscriptionQuery = createAdminServiceGetBillingSubscription(organization);
- $: planName = $subscriptionQuery?.data?.subscription?.plan?.name ?? "";
- $: showSlots =
- isTrialPlan(planName) || isFreePlan(planName) || isProPlan(planName);
+ $: currentSlots =
+ deployment?.environment === "dev"
+ ? Number(projectData?.devSlots) || 0
+ : Number(projectData?.prodSlots) || 0;
- {#if !$subscriptionQuery?.isLoading && showSlots}
-
- Cluster Size
-
-
-
-
- {/if}
+
+ Cluster Size
+
+
+
+
{#if isGithubConnected}
@@ -176,7 +137,7 @@
rel="noopener noreferrer"
class="repo-link"
>
- {githubUrl.replace("https://github.com/", "")}
+ {githubUrl?.replace("https://github.com/", "")}
@@ -189,53 +150,17 @@
{/if}
- {#if parserReconcileError}
-
-