diff --git a/core/gui/src/app/app-routing.constant.ts b/core/gui/src/app/app-routing.constant.ts index a22f6439e26..582f6d865b1 100644 --- a/core/gui/src/app/app-routing.constant.ts +++ b/core/gui/src/app/app-routing.constant.ts @@ -35,6 +35,7 @@ export const DASHBOARD_USER_WORKSPACE = `${DASHBOARD_USER}/workflow`; export const DASHBOARD_USER_WORKFLOW = `${DASHBOARD_USER}/workflow`; export const DASHBOARD_USER_DATASET = `${DASHBOARD_USER}/dataset`; export const DASHBOARD_USER_DATASET_CREATE = `${DASHBOARD_USER_DATASET}/create`; +export const DASHBOARD_USER_COMPUTING_UNIT = `${DASHBOARD_USER}/unit`; export const DASHBOARD_USER_QUOTA = `${DASHBOARD_USER}/quota`; export const DASHBOARD_USER_DISCUSSION = `${DASHBOARD_USER}/discussion`; diff --git a/core/gui/src/app/app-routing.module.ts b/core/gui/src/app/app-routing.module.ts index 6d7a27868c5..4f0e054b6fd 100644 --- a/core/gui/src/app/app-routing.module.ts +++ b/core/gui/src/app/app-routing.module.ts @@ -24,6 +24,7 @@ import { UserWorkflowComponent } from "./dashboard/component/user/user-workflow/ import { UserQuotaComponent } from "./dashboard/component/user/user-quota/user-quota.component"; import { UserProjectSectionComponent } from "./dashboard/component/user/user-project/user-project-section/user-project-section.component"; import { UserProjectComponent } from "./dashboard/component/user/user-project/user-project.component"; +import { UserComputingUnitComponent } from "./dashboard/component/user/user-computing-unit/user-computing-unit.component"; import { WorkspaceComponent } from "./workspace/component/workspace.component"; import { AboutComponent } from "./hub/component/about/about.component"; import { AuthGuardService } from "./common/service/user/auth-guard.service"; @@ -133,6 +134,10 @@ routes.push({ path: "dataset/create", component: DatasetDetailComponent, }, + { + path: "unit", + component: UserComputingUnitComponent, + }, { path: "quota", component: UserQuotaComponent, diff --git a/core/gui/src/app/app.module.ts b/core/gui/src/app/app.module.ts index 13759e6e55a..86334970ad0 100644 --- a/core/gui/src/app/app.module.ts +++ b/core/gui/src/app/app.module.ts @@ -172,6 +172,8 @@ import { AdminSettingsComponent } from "./dashboard/component/admin/settings/adm import { catchError, of } from "rxjs"; import { FormlyRepeatDndComponent } from "./common/formly/repeat-dnd/repeat-dnd.component"; import { NzInputNumberModule } from "ng-zorro-antd/input-number"; +import { UserComputingUnitComponent } from "./dashboard/component/user/user-computing-unit/user-computing-unit.component"; +import { UserComputingUnitListItemComponent } from "./dashboard/component/user/user-computing-unit/user-computing-unit-list-item/user-computing-unit-list-item.component"; registerLocaleData(en); @@ -264,6 +266,8 @@ registerLocaleData(en); HubSearchResultComponent, ComputingUnitSelectionComponent, AdminSettingsComponent, + UserComputingUnitComponent, + UserComputingUnitListItemComponent, ], imports: [ BrowserModule, diff --git a/core/gui/src/app/common/util/computing-unit.util.ts b/core/gui/src/app/common/util/computing-unit.util.ts new file mode 100644 index 00000000000..73eba77ca65 --- /dev/null +++ b/core/gui/src/app/common/util/computing-unit.util.ts @@ -0,0 +1,185 @@ +/** + * 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. + */ + +import { DashboardWorkflowComputingUnit } from "../../workspace/types/workflow-computing-unit"; + +export function buildComputingUnitMetadataTable(unit: DashboardWorkflowComputingUnit): string { + return ` +
| Name | ${unit.computingUnit.name} |
|---|---|
| Status | ${unit.status} |
| Type | ${unit.computingUnit.type} |
| CPU Limit | ${unit.computingUnit.resource.cpuLimit} |
| Memory Limit | ${unit.computingUnit.resource.memoryLimit} |
| GPU Limit | ${unit.computingUnit.resource.gpuLimit || "None"} |
| JVM Memory | ${unit.computingUnit.resource.jvmMemorySize} |
| Shared Memory | ${unit.computingUnit.resource.shmSize} |
| Created | ${new Date(unit.computingUnit.creationTime).toLocaleString()} |
| Access | ${unit.isOwner ? "Owner" : unit.accessPrivilege} |
Warning: All execution results in this computing unit will be lost.
", + createSuccess: "Successfully created the Kubernetes computing unit", + createFailure: "Failed to create the Kubernetes computing unit", + terminateSuccess: "Terminated Kubernetes computing unit", + terminateFailure: "Failed to terminate Kubernetes computing unit", + terminateTooltip: "Terminate this computing unit", + }, +} as const; diff --git a/core/gui/src/app/dashboard/component/dashboard.component.html b/core/gui/src/app/dashboard/component/dashboard.component.html index cf490d33043..eb93ed39903 100644 --- a/core/gui/src/app/dashboard/component/dashboard.component.html +++ b/core/gui/src/app/dashboard/component/dashboard.component.html @@ -97,6 +97,17 @@ nzType="database"> Datasets +