(
))}
{r.columns
- .filter((col) => !col.isHidden)
+ .filter((col) => ("isHidden" in col ? !col.isHidden : true))
.map((col) => extractColumnInfo(col))
.join(", ")}
|
diff --git a/dashboard/lib/extractInfo.ts b/dashboard/lib/extractInfo.ts
index fc6eccf669eed..2ae779eb44887 100644
--- a/dashboard/lib/extractInfo.ts
+++ b/dashboard/lib/extractInfo.ts
@@ -15,8 +15,14 @@
*
*/
-import { ColumnCatalog } from "../proto/gen/plan_common"
+import { ColumnCatalog, Field } from "../proto/gen/plan_common"
-export default function extractColumnInfo(col: ColumnCatalog) {
- return `${col.columnDesc?.name} (${col.columnDesc?.columnType?.typeName})`
+export default function extractColumnInfo(col: ColumnCatalog | Field) {
+ if ("columnDesc" in col) {
+ // ColumnCatalog
+ return `${col.columnDesc?.name} (${col.columnDesc?.columnType?.typeName})`
+ } else {
+ // Field
+ return `${col.name} (${col.dataType?.typeName})`
+ }
}
diff --git a/dashboard/pages/api/streaming.ts b/dashboard/pages/api/streaming.ts
index 879c02a5ccfcd..67e43ffc858ca 100644
--- a/dashboard/pages/api/streaming.ts
+++ b/dashboard/pages/api/streaming.ts
@@ -17,9 +17,9 @@
import _ from "lodash"
import sortBy from "lodash/sortBy"
-import { Sink, Source, Table } from "../../proto/gen/catalog"
+import { Sink, Source, Table, View } from "../../proto/gen/catalog"
import { ActorLocation, TableFragments } from "../../proto/gen/meta"
-import { ColumnCatalog } from "../../proto/gen/plan_common"
+import { ColumnCatalog, Field } from "../../proto/gen/plan_common"
import api from "./api"
export async function getActors(): Promise {
@@ -38,7 +38,7 @@ export interface Relation {
id: number
name: string
owner: number
- columns: ColumnCatalog[]
+ columns: (ColumnCatalog | Field)[]
properties: { [key: string]: string }
}
@@ -67,7 +67,7 @@ export async function getRelations() {
await getTables(),
await getIndexes(),
await getSinks(),
- await getDataSources()
+ await getSources()
)
relations = sortBy(relations, (x) => x.id)
return relations
@@ -103,10 +103,16 @@ export async function getSinks() {
return sinkList
}
-export async function getDataSources() {
+export async function getSources() {
let sourceList: Source[] = (await api.get("/api/sources")).map(
Source.fromJSON
)
sourceList = sortBy(sourceList, (x) => x.id)
return sourceList
}
+
+export async function getViews() {
+ let views: View[] = (await api.get("/api/views")).map(View.fromJSON)
+ views = sortBy(views, (x) => x.id)
+ return views
+}
diff --git a/dashboard/pages/data_sources.tsx b/dashboard/pages/sources.tsx
similarity index 90%
rename from dashboard/pages/data_sources.tsx
rename to dashboard/pages/sources.tsx
index 568d2da9dcc75..f86a11815e835 100644
--- a/dashboard/pages/data_sources.tsx
+++ b/dashboard/pages/sources.tsx
@@ -22,7 +22,7 @@ import {
Relations,
} from "../components/Relations"
import { Source } from "../proto/gen/catalog"
-import { getDataSources } from "./api/streaming"
+import { getSources } from "./api/streaming"
export default function DataSources() {
const rowFormatColumn: Column