You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by ku...@apache.org on 2021/11/22 10:54:00 UTC

[submarine] branch master updated: SUBMARINE-1049. Static registered model information page

This is an automated email from the ASF dual-hosted git repository.

kuanhsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 9f018fa  SUBMARINE-1049. Static registered model information page
9f018fa is described below

commit 9f018fa3d3f5066d4a97873070d25d640afa2b84
Author: 傅譽的MacBook <b0...@ntu.edu.tw>
AuthorDate: Sat Nov 20 21:44:00 2021 +0800

    SUBMARINE-1049. Static registered model information page
    
    ### What is this PR for?
    Static registered model information page
    
    ### What type of PR is it?
    Feature
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/browse/SUBMARINE-1049
    
    ### How should this be tested?
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: 傅譽的MacBook <b0...@ntu.edu.tw>
    Author: Richie FY <59...@users.noreply.github.com>
    
    Signed-off-by: jingch1213717 <ku...@apache.org>
    
    Closes #791 from FYRichie/SUBMARINE-1049 and squashes the following commits:
    
    8bcf830d [傅譽的MacBook] SUBMARINE-1049. Static registered model information page
    c435d24d [Richie FY] Merge branch 'apache:master' into SUBMARINE-1049
    9c20bfef [傅譽的MacBook] SUBMARINE-1049. Static registered model information page
    103e4314 [傅譽的MacBook] SUBMARINE-1049. change input text to textarea
    d8ce43aa [傅譽的MacBook] SUBMARINE-1049. change input text to textarea
    7d1cda41 [傅譽的MacBook] SUBMARINE-1049. simplify class
    70ca1591 [傅譽的MacBook] SUBMARINE-1049. Static registered model information page
    159b9dd0 [傅譽的MacBook] SUBMARINE-1049. Static registered model information page
    1dc4cfae [傅譽的MacBook] SUBMARINE-1049 add register model
    b0e4b588 [傅譽的MacBook] SUBMARINE-1049 add register model
    6bb0be4c [傅譽的MacBook] SUBMARINE-1049 add register model
---
 .../pages/workbench/model/model-routing.module.ts  |  5 ++
 .../src/app/pages/workbench/model/model.module.ts  |  2 +
 .../registered-model.component.html                | 71 +++++++++++++++++++
 .../registered-model.component.scss                | 79 ++++++++++++++++++++++
 .../registered-model.component.ts}                 | 43 +++++-------
 5 files changed, 173 insertions(+), 27 deletions(-)

diff --git a/submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts b/submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts
index 5ee877c..6b0ff8e 100644
--- a/submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts
+++ b/submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts
@@ -22,6 +22,7 @@ import { RouterModule, Routes } from '@angular/router';
 import { ModelComponent } from './model.component';
 import { ModelVersionComponent } from './model-version/model-version.component';
 import { ModelHomeComponent } from './model-home/model-home.component';
+import { RegisteredModelComponent } from './registered-model/registered-model.component';
 
 const routes: Routes = [
   {
@@ -37,6 +38,10 @@ const routes: Routes = [
         path: ':name/:version',
         component: ModelVersionComponent,
       },
+      {
+        path: ':name',
+        component: RegisteredModelComponent,
+      },
     ],
   },
 ];
diff --git a/submarine-workbench/workbench-web/src/app/pages/workbench/model/model.module.ts b/submarine-workbench/workbench-web/src/app/pages/workbench/model/model.module.ts
index 6f9e7ac..9a8f5d2 100644
--- a/submarine-workbench/workbench-web/src/app/pages/workbench/model/model.module.ts
+++ b/submarine-workbench/workbench-web/src/app/pages/workbench/model/model.module.ts
@@ -30,6 +30,7 @@ import { ModelHomeComponent } from './model-home/model-home.component';
 import { ModelCardsComponent } from './model-home/model-cards/model-cards.component';
 import { ModelCardComponent } from './model-home/model-cards/model-card/model-card.component';
 import { ModelTagComponent } from './model-home/model-cards/model-card/model-tag/model-tag.component';
+import { RegisteredModelComponent } from './registered-model/registered-model.component';
 
 @NgModule({
   declarations: [
@@ -39,6 +40,7 @@ import { ModelTagComponent } from './model-home/model-cards/model-card/model-tag
     ModelCardsComponent,
     ModelCardComponent,
     ModelTagComponent,
+    RegisteredModelComponent,
   ],
   imports: [
     CommonModule,
diff --git a/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.html b/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.html
new file mode 100644
index 0000000..f342450
--- /dev/null
+++ b/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.html
@@ -0,0 +1,71 @@
+<!--
+  ~ Licensed to tde Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See tde NOTICE file
+  ~ distributed witd tdis work for additional information
+  ~ regarding copyright ownership.  tde ASF licenses tdis file
+  ~ to you under tde Apache License, Version 2.0 (tde
+  ~ "License"); you may not use tdis file except in compliance
+  ~ witd tde License.  You may obtain a copy of tde License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under tde License is distributed on an
+  ~ "AS IS" BASIS, WItdOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, eitder express or implied.  See tde License for tde
+  ~ specific language governing permissions and limitations
+  ~ under tde License.
+  -->
+<div class="container">
+  <div>
+    <h1>{{ modelName }}</h1>
+  </div>
+  <div>
+    <div class="discription">Description: This is a description.</div>
+    <div class="basic-box">
+      <div class="tags-basic">Tags:</div>
+      <div class="tags-basic tags">image</div>
+    </div>
+    <div class="basic-box">Created: 2021-09-01 07:57</div>
+    <div class="basic-box">Updated: 2021-09-21 03:00</div>
+  </div>
+  <div class="info-container">
+    <div class="info">Model versions info</div>
+    <div class="info-tag">
+      <div class="info-box">Tags:</div>
+      <div class="info-box">
+        <textarea type="text" class="info-text" placeholder="Model Version tags..."></textarea>
+      </div>
+    </div>
+  </div>
+  <table>
+    <thead>
+      <tr>
+        <td>Version</td>
+        <td>Stage</td>
+        <td>Tags</td>
+        <td>Description</td>
+        <td>Created</td>
+        <td>Updated</td>
+      </tr>
+    </thead>
+    <tbody>
+      <tr>
+        <td><a [routerLink]="1">1</a></td>
+        <td></td>
+        <td></td>
+        <td>...</td>
+        <td>2021-09-01 07:57</td>
+        <td>2021-09-01 07:57</td>
+      </tr>
+      <tr>
+        <td><a [routerLink]="2">2</a></td>
+        <td></td>
+        <td></td>
+        <td>...</td>
+        <td>2021-09-30 07:09</td>
+        <td>2021-09-30 09:57</td>
+      </tr>
+    </tbody>
+  </table>
+</div>
diff --git a/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.scss b/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.scss
new file mode 100644
index 0000000..4bc5b74
--- /dev/null
+++ b/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.scss
@@ -0,0 +1,79 @@
+/*!
+ * 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.
+ */
+.basic-box {
+  margin-bottom: 5px;
+  font-size: 17px;
+  font-family: Arial;
+}
+td {
+  border: 1px solid black;
+  width: 200px;
+  height: 35px;
+  padding-left: 5px;
+}
+::placeholder {
+  font-size: 17px;
+}
+.info-box {
+  margin-bottom: 5px;
+  font-size: 17px;
+  font-family: Arial;
+  display: inline-block;
+}
+.container {
+  margin: 15px;
+  padding: 15px;
+  background-color: white;
+}
+.discription {
+  margin: 5px 0px 5px 0px;
+  font-size: 17px;
+  font-family: Arial, Helvetica, sans-serif;
+}
+.tags-basic {
+  display: inline-block;
+}
+.tags {
+  background-color: #53c653;
+  margin: 3px;
+  padding: 3px;
+}
+.info-container {
+  margin-top: 20px;
+  display: flex;
+  align-items: center;
+}
+.info {
+  margin-bottom: 5px;
+  font-size: 17px;
+  font-family: Arial, Helvetica, sans-serif;
+  font-weight: bold;
+  display: inline-block;
+}
+.info-tag {
+  margin-left: 30px;
+  display: flex;
+  align-items: center;
+}
+.info-text {
+  height: 35px;
+  width: 250px;
+  border: 1px solid black;
+  font-size: 17px;
+}
diff --git a/submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts b/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.ts
similarity index 53%
copy from submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts
copy to submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.ts
index 5ee877c..a405b4d 100644
--- a/submarine-workbench/workbench-web/src/app/pages/workbench/model/model-routing.module.ts
+++ b/submarine-workbench/workbench-web/src/app/pages/workbench/model/registered-model/registered-model.component.ts
@@ -17,32 +17,21 @@
  * under the License.
  */
 
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { ModelComponent } from './model.component';
-import { ModelVersionComponent } from './model-version/model-version.component';
-import { ModelHomeComponent } from './model-home/model-home.component';
+import { Component, Input, OnInit } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
+import { ModelInfo } from '@submarine/interfaces/model-info';
 
-const routes: Routes = [
-  {
-    path: '',
-    component: ModelComponent,
-    children: [
-      {
-        path: '',
-        pathMatch: 'full',
-        component: ModelHomeComponent,
-      },
-      {
-        path: ':name/:version',
-        component: ModelVersionComponent,
-      },
-    ],
-  },
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule],
+@Component({
+  selector: 'app-registered-model',
+  templateUrl: './registered-model.component.html',
+  styleUrls: ['./registered-model.component.scss'],
 })
-export class ModelRoutingModule {}
+export class RegisteredModelComponent implements OnInit {
+  modelName;
+
+  constructor(private router: Router, private route: ActivatedRoute) {}
+
+  ngOnInit(): void {
+    this.modelName = this.route.snapshot.params.name;
+  }
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org