From 5beae596655fd227518e44c39fd3ef7aba9a700b Mon Sep 17 00:00:00 2001 From: Tanishq Gandhi Date: Thu, 27 Aug 2026 22:04:18 -0700 Subject: [PATCH 1/2] feat(frontend): add the Models page --- frontend/proxy.config.json | 5 + frontend/src/app/app-routing.constant.ts | 1 + frontend/src/app/app-routing.module.ts | 5 + frontend/src/app/common/type/gui-config.ts | 1 + frontend/src/app/common/type/model.ts | 32 ++ .../settings/admin-settings.component.html | 9 + .../settings/admin-settings.component.spec.ts | 6 +- .../settings/admin-settings.component.ts | 1 + .../component/dashboard.component.html | 12 + .../component/dashboard.component.spec.ts | 7 +- .../component/dashboard.component.ts | 3 + .../user/filters/filters.component.ts | 42 +- .../card-item/card-item.component.ts | 125 ++--- .../list-item/list-item.component.spec.ts | 9 +- .../user/list-item/list-item.component.ts | 117 ++--- .../user-model-creator.component.html | 70 +++ .../user-model-creator.component.scss | 75 +++ .../user-model-creator.component.spec.ts | 188 ++++++++ .../user-model-creator.component.ts | 187 ++++++++ .../user/user-model/user-model.component.html | 101 ++++ .../user/user-model/user-model.component.scss | 22 + .../user-model/user-model.component.spec.ts | 438 ++++++++++++++++++ .../user/user-model/user-model.component.ts | 247 ++++++++++ .../service/user/model/model.service.spec.ts | 164 +++++++ .../service/user/model/model.service.ts | 97 ++++ .../service/user/model/stub-model.service.ts | 47 ++ .../dataset-resource.descriptor.ts | 47 ++ .../file-resource.descriptor.ts | 33 ++ .../model-resource.descriptor.ts | 44 ++ .../project-resource.descriptor.ts | 35 ++ .../resource-registry.service.spec.ts | 176 +++++++ .../resource-registry.service.ts | 77 +++ .../workflow-resource.descriptor.ts | 51 ++ .../src/app/dashboard/type/dashboard-entry.ts | 29 ++ .../type/dashboard-model.interface.ts | 28 ++ .../app/dashboard/type/resource-descriptor.ts | 50 ++ .../src/app/dashboard/type/search-result.ts | 4 +- .../src/app/dashboard/type/type-predicates.ts | 5 + .../app/hub/component/hub.component.spec.ts | 1 + frontend/src/app/hub/service/hub.service.ts | 1 + 40 files changed, 2377 insertions(+), 215 deletions(-) create mode 100644 frontend/src/app/common/type/model.ts create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.html create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.scss create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.spec.ts create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model-creator/user-model-creator.component.ts create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model.component.html create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model.component.scss create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model.component.spec.ts create mode 100644 frontend/src/app/dashboard/component/user/user-model/user-model.component.ts create mode 100644 frontend/src/app/dashboard/service/user/model/model.service.spec.ts create mode 100644 frontend/src/app/dashboard/service/user/model/model.service.ts create mode 100644 frontend/src/app/dashboard/service/user/model/stub-model.service.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/dataset-resource.descriptor.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/file-resource.descriptor.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/model-resource.descriptor.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/project-resource.descriptor.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/resource-registry.service.spec.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/resource-registry.service.ts create mode 100644 frontend/src/app/dashboard/service/user/resource-registry/workflow-resource.descriptor.ts create mode 100644 frontend/src/app/dashboard/type/dashboard-model.interface.ts create mode 100644 frontend/src/app/dashboard/type/resource-descriptor.ts diff --git a/frontend/proxy.config.json b/frontend/proxy.config.json index bc33371071e..7801e0c256f 100755 --- a/frontend/proxy.config.json +++ b/frontend/proxy.config.json @@ -35,6 +35,11 @@ "secure": false, "changeOrigin": true }, + "/api/model/**": { + "target": "http://localhost:9092", + "secure": false, + "changeOrigin": true + }, "/api/access/dataset/**": { "target": "http://localhost:9092", "secure": false, diff --git a/frontend/src/app/app-routing.constant.ts b/frontend/src/app/app-routing.constant.ts index 53cc71d79cc..3882984dd9b 100644 --- a/frontend/src/app/app-routing.constant.ts +++ b/frontend/src/app/app-routing.constant.ts @@ -35,6 +35,7 @@ export const USER_WORKSPACE = `${USER}/workflow`; export const USER_WORKFLOW = `${USER}/workflow`; export const USER_DATASET = `${USER}/dataset`; export const USER_DATASET_CREATE = `${USER_DATASET}/create`; +export const USER_MODEL = `${USER}/model`; export const USER_COMPUTING_UNIT = `${USER}/compute`; export const USER_PYTHON_VENV = `${USER}/python-venv`; export const USER_QUOTA = `${USER}/quota`; diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index e255fe16710..6acbccebf1e 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -39,6 +39,7 @@ import { FeedbackComponent } from "./dashboard/component/user/feedback/feedback. import { AdminGmailComponent } from "./dashboard/component/admin/gmail/admin-gmail.component"; import { DatasetDetailComponent } from "./dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component"; import { UserDatasetComponent } from "./dashboard/component/user/user-dataset/user-dataset.component"; +import { UserModelComponent } from "./dashboard/component/user/user-model/user-model.component"; import { HubWorkflowDetailComponent } from "./hub/component/workflow/detail/hub-workflow-detail.component"; import { LandingPageComponent } from "./hub/component/landing-page/landing-page.component"; import { USER_WORKFLOW } from "./app-routing.constant"; @@ -135,6 +136,10 @@ routes.push({ path: "dataset/create", component: DatasetDetailComponent, }, + { + path: "model", + component: UserModelComponent, + }, { path: "compute", component: UserComputingUnitComponent, diff --git a/frontend/src/app/common/type/gui-config.ts b/frontend/src/app/common/type/gui-config.ts index d9750d7d3b1..cf36f046eed 100644 --- a/frontend/src/app/common/type/gui-config.ts +++ b/frontend/src/app/common/type/gui-config.ts @@ -57,6 +57,7 @@ export interface SidebarTabs { workflows_enabled: boolean; compute_enabled: boolean; datasets_enabled: boolean; + models_enabled: boolean; quota_enabled: boolean; forum_enabled: boolean; about_enabled: boolean; diff --git a/frontend/src/app/common/type/model.ts b/frontend/src/app/common/type/model.ts new file mode 100644 index 00000000000..05e979249d9 --- /dev/null +++ b/frontend/src/app/common/type/model.ts @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export interface Model { + mid: number | undefined; + ownerUid: number | undefined; + name: string; + repositoryName: string | undefined; + isPublic: boolean; + isDownloadable: boolean; + description: string; + creationTime: number | undefined; + coverImage: string | undefined; + framework: string | undefined; + format: string | undefined; +} diff --git a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html index fd2fea7f753..2bfc1daaf00 100644 --- a/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html +++ b/frontend/src/app/dashboard/component/admin/settings/admin-settings.component.html @@ -190,6 +190,15 @@

General Settings

+ +