From 1adee44ad9fcbda9722b82611c6c2dad5cd6fc1a Mon Sep 17 00:00:00 2001 From: xxhZs <1060434431@qq.com> Date: Tue, 14 May 2024 16:17:01 +0800 Subject: [PATCH] fix fix ci --- dashboard/components/Relations.tsx | 4 +++- dashboard/lib/api/api.ts | 4 +--- dashboard/lib/api/streaming.ts | 13 ++++++----- dashboard/pages/subscriptions.tsx | 35 +++++++++++++++--------------- src/meta/src/controller/catalog.rs | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/dashboard/components/Relations.tsx b/dashboard/components/Relations.tsx index 988cd7be4f8c6..49161feea908b 100644 --- a/dashboard/components/Relations.tsx +++ b/dashboard/components/Relations.tsx @@ -186,7 +186,9 @@ export function Relations( {r.columns && r.columns.length > 0 && ( {r.columns - .filter((col) => ("isHidden" in col ? !col.isHidden : true)) + .filter((col) => + "isHidden" in col ? !col.isHidden : true + ) .map((col) => extractColumnInfo(col)) .join(", ")} diff --git a/dashboard/lib/api/api.ts b/dashboard/lib/api/api.ts index 6c5d885542454..af0116e31f3bb 100644 --- a/dashboard/lib/api/api.ts +++ b/dashboard/lib/api/api.ts @@ -26,9 +26,7 @@ export const PREDEFINED_API_ENDPOINTS = [ ] export const DEFAULT_API_ENDPOINT: string = - process.env.NODE_ENV === "production" - ? PROD_API_ENDPOINT - : MOCK_API_ENDPOINT; // EXTERNAL_META_NODE_API_ENDPOINT to debug with RisingWave servers + process.env.NODE_ENV === "production" ? PROD_API_ENDPOINT : MOCK_API_ENDPOINT // EXTERNAL_META_NODE_API_ENDPOINT to debug with RisingWave servers export const API_ENDPOINT_KEY = "risingwave.dashboard.api.endpoint" diff --git a/dashboard/lib/api/streaming.ts b/dashboard/lib/api/streaming.ts index 2470aabc44e81..948cd567d3f2b 100644 --- a/dashboard/lib/api/streaming.ts +++ b/dashboard/lib/api/streaming.ts @@ -22,9 +22,9 @@ import { Schema, Sink, Source, + Subscription, Table, View, - Subscription, } from "../../proto/gen/catalog" import { ListObjectDependenciesResponse_ObjectDependencies as ObjectDependencies, @@ -67,10 +67,9 @@ export function relationType(x: Relation) { return "SINK" } else if ((x as Source).info !== undefined) { return "SOURCE" - } else if ((x as Subscription).dependentTableId !== undefined) { + } else if ((x as Subscription).dependentTableId !== undefined) { return "SUBSCRIPTION" - } - else { + } else { return "UNKNOWN" } } @@ -103,7 +102,7 @@ export async function getRelations() { await getIndexes(), await getSinks(), await getSources(), - await getSubscriptions(), + await getSubscriptions() ) relations = sortBy(relations, (x) => x.id) return relations @@ -156,7 +155,9 @@ export async function getViews() { } export async function getSubscriptions() { - let subscriptions: Subscription[] = (await api.get("/subscriptions")).map(Subscription.fromJSON) + let subscriptions: Subscription[] = (await api.get("/subscriptions")).map( + Subscription.fromJSON + ) subscriptions = sortBy(subscriptions, (x) => x.id) return subscriptions } diff --git a/dashboard/pages/subscriptions.tsx b/dashboard/pages/subscriptions.tsx index 238a8f1f7f5ae..b2daa38c3f95c 100644 --- a/dashboard/pages/subscriptions.tsx +++ b/dashboard/pages/subscriptions.tsx @@ -15,25 +15,24 @@ * */ -import { Column, Relations} from "../components/Relations" +import { Column, Relations } from "../components/Relations" import { getSubscriptions } from "../lib/api/streaming" -import { - Subscription as RwSubscription - } from "../proto/gen/catalog" +import { Subscription as RwSubscription } from "../proto/gen/catalog" export default function Subscriptions() { - const subscriptionRetentionSeconds: Column = { - name: "Retention Seconds", - width: 3, - content: (r) => r.retentionSeconds ?? "unknown", - } + const subscriptionRetentionSeconds: Column = { + name: "Retention Seconds", + width: 3, + content: (r) => r.retentionSeconds ?? "unknown", + } - const subscriptionDependentTableId: Column = { - name: "Dependent Table Id", - width: 3, - content: (r) => r.dependentTableId ?? "unknown", - } - return Relations("Subscriptions", getSubscriptions, [ - subscriptionRetentionSeconds, - subscriptionDependentTableId,]) -} \ No newline at end of file + const subscriptionDependentTableId: Column = { + name: "Dependent Table Id", + width: 3, + content: (r) => r.dependentTableId ?? "unknown", + } + return Relations("Subscriptions", getSubscriptions, [ + subscriptionRetentionSeconds, + subscriptionDependentTableId, + ]) +} diff --git a/src/meta/src/controller/catalog.rs b/src/meta/src/controller/catalog.rs index 8a7d38d6eb08f..13917b3132564 100644 --- a/src/meta/src/controller/catalog.rs +++ b/src/meta/src/controller/catalog.rs @@ -581,7 +581,7 @@ impl CatalogController { } })); - let subscription_dependencies: Vec<(SubscriptionId, TableId)> = Sink::find() + let subscription_dependencies: Vec<(SubscriptionId, TableId)> = Subscription::find() .select_only() .columns([ subscription::Column::SubscriptionId,