This is an automated email from the ASF dual-hosted git repository.
liuxun 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 761f6c8 SUBMARINE-389. [WEB]Implement the home page in workbench with
Angular
761f6c8 is described below
commit 761f6c85dd4227f08f1d30fc6726e12ac1443502
Author: kevin85421 <[email protected]>
AuthorDate: Sat Feb 29 00:34:04 2020 +0800
SUBMARINE-389. [WEB]Implement the home page in workbench with Angular
### What is this PR for?
1. Implement the home page in the workbench with Angular.
2. The style configuration "workbenchContent" caused impacts on the whole
workbench, but the configuration is only for the workspace component. In
addition, the frontend of the Manager/User page is influenced. Due to this
reason, the style configuration needs to be separated from the whole workbench
to the workspace component only.
### What type of PR is it?
[Feature]
### Todos
* [ ] - Task
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-389
### How should this be tested?
https://travis-ci.org/apache/submarine/builds/656336532?utm_medium=notification&utm_source=github_status
### Screenshots (if appropriate)
case1: >= 1600px

case2: < 1600px

workspace page

Manager/User page

### Questions:
* Does the licenses files need an update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
Author: kevin85421 <[email protected]>
Closes #195 from kevin85421/SUBMARINE-389 and squashes the following
commits:
978614d [kevin85421] SUBMARINE-389. [WEB] Separate the style configuration
from whole workbench to workspace
617365c [kevin85421] SUBMARINE-389. [WEB]Implement the frontend of the home
page in workbench with Angular
---
.../org/apache/submarine/WebDriverManager.java | 2 +-
.../submarine/integration/SubmarineLogIT.java | 1 +
.../org/apache/submarine/integration/homeIT.java | 82 +++++++
.../org/apache/submarine/integration/loginIT.java | 1 +
.../apache/submarine/integration/registerIT.java | 1 +
.../apache/submarine/integration/sidebarIT.java | 2 +-
.../apache/submarine/integration/workspaceIT.java | 1 +
.../app/pages/workbench/home/home.component.html | 152 +++++++++++-
.../app/pages/workbench/home/home.component.scss | 4 +
.../src/app/pages/workbench/home/home.component.ts | 255 ++++++++++++++++++++-
.../app/pages/workbench/workbench.component.html | 2 +-
.../app/pages/workbench/workbench.component.scss | 4 -
.../workbench/workspace/workspace.component.html | 3 +-
13 files changed, 499 insertions(+), 11 deletions(-)
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
index d6abfc9..515dca2 100644
---
a/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
@@ -77,7 +77,7 @@ public class WebDriverManager {
while (System.currentTimeMillis() - start < 60 * 1000) {
// wait for page load
try {
- (new WebDriverWait(driver, 60)).until(new ExpectedCondition<Boolean>()
{
+ (new WebDriverWait(driver, 120)).until(new
ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
// return d.findElement(By.tagName("div"))
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/SubmarineLogIT.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/SubmarineLogIT.java
index 1b92880..d4447e4 100644
---
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/SubmarineLogIT.java
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/SubmarineLogIT.java
@@ -37,6 +37,7 @@ public class SubmarineLogIT extends AbstractSubmarineIT {
@Test
public void submarineLog() throws Exception {
+ LOG.info("[Testcase]: SubmarineLogIT");
printSubmarineLog();
}
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/homeIT.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/homeIT.java
new file mode 100644
index 0000000..446d8c8
--- /dev/null
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/homeIT.java
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package org.apache.submarine.integration;
+
+import org.apache.submarine.AbstractSubmarineIT;
+import org.apache.submarine.WebDriverManager;
+import org.apache.submarine.SubmarineITUtils;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.By;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+import java.util.List;
+
+public class homeIT extends AbstractSubmarineIT {
+
+ public final static Logger LOG = LoggerFactory.getLogger(homeIT.class);
+
+ @BeforeClass
+ public static void startUp(){
+ LOG.info("[Testcase]: homeIT");
+ driver = WebDriverManager.getWebDriver();
+ }
+
+ @AfterClass
+ public static void tearDown(){
+ driver.quit();
+ }
+
+ @Test
+ public void homePagination() throws Exception {
+ // Login
+ LOG.info("Login");
+ pollingWait(By.cssSelector("input[ng-reflect-name='userName']"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin");
+ pollingWait(By.cssSelector("input[ng-reflect-name='password']"),
MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin");
+ clickAndWait(By.cssSelector("button[class='login-form-button ant-btn
ant-btn-primary']"));
+ pollingWait(By.cssSelector("a[routerlink='/workbench/dashboard']"),
MAX_BROWSER_TIMEOUT_SEC);
+
+ LOG.info("Pagination");
+ List<WebElement> changePageIndexButtons =
driver.findElements(By.cssSelector("a[class='ant-pagination-item-link
ng-star-inserted']"));
+ // 0: open recent: previous page
+ // 1: open recent: next page
+ // 2: news: previous page
+ // 3: news: next page
+ changePageIndexButtons.get(1).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Project2\")]")).size(), 6);
+ changePageIndexButtons.get(1).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Project3\")]")).size(), 6);
+ changePageIndexButtons.get(0).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Project2\")]")).size(), 6);
+ changePageIndexButtons.get(0).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Project1\")]")).size(), 6);
+ changePageIndexButtons.get(3).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Submarine supports yarn 2.7.x 123\")]")).size(), 5);
+ changePageIndexButtons.get(3).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Submarine supports yarn 2.7.x 456\")]")).size(), 5);
+ changePageIndexButtons.get(2).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Submarine supports yarn 2.7.x 123\")]")).size(), 5);
+ changePageIndexButtons.get(2).click();
+ Assert.assertEquals( driver.findElements(By.xpath("//div[contains(text(),
\"Submarine supports yarn 2.7.x\")]")).size(), 5);
+ }
+}
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
index d912f17..67a86c5 100644
---
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
@@ -31,6 +31,7 @@ public class loginIT extends AbstractSubmarineIT {
@BeforeClass
public static void startUp(){
+ LOG.info("[Testcase]: loginIT");
printSubmarineLog();
driver = WebDriverManager.getWebDriver();
}
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/registerIT.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/registerIT.java
index 1e3ec91..4b357d0 100644
---
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/registerIT.java
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/registerIT.java
@@ -35,6 +35,7 @@ public class registerIT extends AbstractSubmarineIT {
@BeforeClass
public static void startUp(){
+ LOG.info("[Testcase]: registerIT");
driver = WebDriverManager.getWebDriver();
}
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/sidebarIT.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/sidebarIT.java
index dd66881..03afd7d 100644
---
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/sidebarIT.java
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/sidebarIT.java
@@ -36,6 +36,7 @@ public class sidebarIT extends AbstractSubmarineIT {
@BeforeClass
public static void startUp(){
+ LOG.info("[Testcase]: sidebarIT");
driver = WebDriverManager.getWebDriver();
}
@@ -67,7 +68,6 @@ public class sidebarIT extends AbstractSubmarineIT {
Assert.assertEquals(driver.getCurrentUrl(),
"http://localhost:8080/workbench/model");
pollingWait(By.xpath("//span[contains(text(), \"Manager\")]"),
MAX_BROWSER_TIMEOUT_SEC).click();
pollingWait(By.xpath("//a[@href='/workbench/manager/user']"),
MAX_BROWSER_TIMEOUT_SEC).click();
- SubmarineITUtils.sleep( 5000, true);
// Lazy-loading
WebDriverWait wait = new WebDriverWait( driver, 15, 5000);
diff --git
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/workspaceIT.java
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/workspaceIT.java
index f292b7c..73ce796 100644
---
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/workspaceIT.java
+++
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/workspaceIT.java
@@ -34,6 +34,7 @@ public class workspaceIT extends AbstractSubmarineIT {
@BeforeClass
public static void startUp(){
+ LOG.info("[Testcase]: workspaceIT");
driver = WebDriverManager.getWebDriver();
}
diff --git
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.html
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.html
index 7146501..6ecf4a5 100644
---
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.html
+++
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.html
@@ -17,4 +17,154 @@
~ under the License.
-->
-<p>home works!</p>
+<div>
+ <div nz-row>
+ <div nz-col nzSpan="24">
+ <div nz-col nzXl="12" nzXXl="6" style="padding-right: 4px;
padding-left: 4px; height:200px;">
+ <nz-card nzTitle="Session" [nzExtra]="sessionExplanation"
style="height:188px">
+ <nz-statistic [nzValue]="numRunningSession | number"
[nzTitle]="'Running'" [nzValueStyle]="{ color: '#1890ff' }"></nz-statistic>
+ </nz-card>
+ <ng-template #sessionExplanation>
+ <a nz-icon nzType="info-circle"></a>
+ </ng-template>
+ </div>
+ <div nz-col nzXl="12" nzXXl="6" style="padding-right: 4px;
padding-left: 4px; height:200px;">
+ <nz-card nzTitle="Job" [nzExtra]="jobExplanation"
style="height:188px">
+ <nz-statistic [nzValue]="numRunningJob | number"
[nzTitle]="'Running'" [nzValueStyle]="{ color: '#1890ff' }"></nz-statistic>
+ </nz-card>
+ <ng-template #jobExplanation>
+ <a nz-icon nzType="info-circle"></a>
+ </ng-template>
+ </div>
+ <div nz-col nzXl="12" nzXXl="6" style="padding-right: 4px;
padding-left: 4px; height:200px;">
+ <nz-card nzTitle="GPU / CPU" [nzExtra]="GpuCpuExplanation"
style="height:188px">
+ <div nz-col nzSpan="24">
+ <p>GPU</p>
+ <nz-progress [nzPercent]="usedGPUpercent"></nz-progress>
+ </div>
+ <div nz-col nzSpan="24" style="padding-top: 5px;">
+ <p>CPU</p>
+ <nz-progress [nzPercent]="usedCPUpercent"></nz-progress>
+ </div>
+ </nz-card>
+ <ng-template #GpuCpuExplanation>
+ <a nz-icon nzType="info-circle"></a>
+ </ng-template>
+ </div>
+ <div nz-col nzXl="12" nzXXl="6" style="padding-right: 4px;
padding-left: 4px; height:200px;">
+ <nz-card nzTitle="Memory(GB)" [nzExtra]="memoryExplanation"
style="height:188px">
+ <div nz-col nzSpan="24">
+ <div nz-col nzSpan="8">
+ <nz-statistic [nzValue]="usedMemory"
[nzTitle]="'Used(GB)'"></nz-statistic>
+ </div>
+ <div nz-col nzSpan="8">
+ <nz-statistic [nzValue]="totalMemory"
[nzTitle]="'Total(GB)'"></nz-statistic>
+ </div>
+ <div nz-col nzSpan="8">
+ <nz-statistic
+ [nzValue]="usedMemoryPercent | number: '1.0-1'"
+ [nzTitle]="'Used(%)'"
+ [nzSuffix]="'%'"
+ [nzValueStyle]="{ color: '#1890ff' }"
+ >
+ </nz-statistic>
+ </div>
+ </div>
+ <div nz-col nzSpan="24" style="padding-top: 5px;">
+ <nz-progress [nzPercent]="usedMemoryPercent | number:
'1.0-1'"></nz-progress>
+ </div>
+ </nz-card>
+ <ng-template #memoryExplanation>
+ <a nz-icon nzType="info-circle"></a>
+ </ng-template>
+ </div>
+ </div>
+ </div>
+</div>
+<div nz-row>
+ <div nz-col nzXl="24" nzXXl="16">
+ <div nz-col nzSpan="24" style="height: 200px; padding-left: 4px;
padding-right:4px;">
+ <nz-card nzTitle="Quick Start" style="height: 200px;">
+ <div style="padding: 10px;">
+ <div nz-col nzSpan="24" style="height: 50px; font-size: 16px;">
+ <div nz-col nzSpan="6">
+ <i nz-icon nzType="book" nzTheme="outline"></i>
+ <a> New Notebook</a>
+ </div>
+ <div nz-col nzSpan="6">
+ <i nz-icon nzType="rocket" nzTheme="outline"></i>
+ <a> New Session</a>
+ </div>
+ <div nz-col nzSpan="6">
+ <i nz-icon nzType="cluster" nzTheme="outline"></i>
+ <a> New Job</a>
+ </div>
+ <div nz-col nzSpan="6">
+ <i nz-icon nzType="bar-chart" nzTheme="outline"></i>
+ <a> New Data</a>
+ </div>
+ </div>
+ <div nz-col nzSpan="24" style="height: 50px; font-size: 16px;">
+ <div nz-col nzSpan="6">
+ <i nz-icon nzType="experiment" nzTheme="outline"></i>
+ <a> New Model</a>
+ </div>
+ <div nz-col nzSpan="6">
+ <i nz-icon nzType="calculator" nzTheme="outline"></i>
+ <a> New Experiment</a>
+ </div>
+ </div>
+ </div>
+ </nz-card>
+ </div>
+ <div nz-col nzSpan="24">
+ <div style="padding-top: 12px; padding-left: 4px; padding-right: 4px;
padding-bottom: 12px;">
+ <nz-card nzTitle="Open Recent">
+ <div nz-col nzSpan="12" style="height: 120px; padding-left: 4px;
padding-right: 4px;" *ngFor="let displayOpenRecentListItem of
displayOpenRecentList">
+ <nz-card nzHoverable style="height: 114px;">
+ <nz-card-meta
+ [nzTitle]="displayOpenRecentListItem.title"
+ [nzDescription]="displayOpenRecentListItem.description"
+ [nzAvatar]="avatarTemplate"
+ ></nz-card-meta>
+ </nz-card>
+ <ng-template #avatarTemplate>
+ <nz-avatar
[nzSrc]="displayOpenRecentListItem.avatarType"></nz-avatar>
+ </ng-template>
+ </div>
+ <div nz-col nzSpan="24" style="position: relative; padding-top:
15px;">
+ <div style="position: absolute; left: 50%; margin-right: -50%;
transform: translate(-50%, -50%)">
+ <nz-pagination [nzPageSize]="openRecentPageSize"
[nzPageIndex]="openRecentPageIndex" [nzTotal]="openRecentList.length" nzSimple
(nzPageIndexChange)="openRecentChangePage($event)"></nz-pagination>
+ </div>
+ </div>
+ </nz-card>
+ </div>
+ </div>
+ </div>
+ <div nz-col nzXl="24" nzXXl="8">
+ <div nz-col nzSpan="24" style="padding-left: 4px; padding-right: 4px;">
+ <nz-card nzTitle="What's news?" [nzExtra]="extraTemplate">
+ <div style="height: 120px;" *ngFor="let displayNewsListItem of
displayNewsList">
+ <nz-card nzHoverable style="height: 114px;">
+ <nz-card-meta
+ [nzTitle]="displayNewsListItem.title"
+ [nzDescription]="displayNewsListItem.newsTime | date: 'medium'"
+ [nzAvatar]="newsAvatarTemplate"
+ ></nz-card-meta>
+ </nz-card>
+ <ng-template #newsAvatarTemplate>
+ <nz-avatar nzIcon="user"></nz-avatar>
+ </ng-template>
+ </div>
+ <div style="position: relative; padding-top: 15px;">
+ <div style="position: absolute; left: 50%; margin-right: -50%;
transform: translate(-50%, -50%)">
+ <nz-pagination [nzPageSize]="newsPageSize"
[nzPageIndex]="newsPageIndex" [nzTotal]="newsList.length" nzSimple
(nzPageIndexChange)="newsChangePage($event)"></nz-pagination>
+ </div>
+ </div>
+ </nz-card>
+ <ng-template #extraTemplate>
+ <a>More</a>
+ </ng-template>
+ </div>
+ </div>
+</div>
diff --git
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.scss
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.scss
index 3d56d22..e233585 100644
---
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.scss
+++
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.scss
@@ -16,3 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
+p {
+ margin: 0;
+}
diff --git
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.ts
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.ts
index 6e69b43..6231fc6 100644
---
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.ts
+++
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/home/home.component.ts
@@ -18,6 +18,7 @@
*/
import { Component, OnInit } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'submarine-home',
@@ -25,10 +26,262 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
+ // TODO(kevin85421): mock data for status
+ openRecentPageIndex: number;
+ numRunningSession: number;
+ numRunningJob: number;
+ usedGPUpercent: number;
+ usedCPUpercent: number;
+ usedMemory: number;
+ totalMemory: number;
+ usedMemoryPercent: number;
- constructor() { }
+ // TODO(kevin85421): mock data for news
+ publishedTime: number = Date.now();
+ newsPageSize: number;
+ newsPageIndex: number;
+ displayNewsList = [];
+ newsList = [
+ {
+ title: 'Submarine supports yarn 2.7.x',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 123',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 123',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 123',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 123',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 123',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 456',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 456',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 456',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 456',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ },
+ {
+ title: 'Submarine supports yarn 2.7.x 456',
+ newsTime: this.publishedTime,
+ iconType: 'user'
+ }
+ ];
+
+ // TODO(kevin85421): mock data for open recent
+ openRecentList = [
+ {
+ title: 'Project1',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project1',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project1',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project1',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project1',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project1',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project2',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project2',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project2',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project2',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project2',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project2',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project3',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project3',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project3',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project3',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project3',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ },
+ {
+ title: 'Project3',
+ description: 'This is the description',
+ avatarType:
'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png'
+ }
+ ];
+
+ displayOpenRecentList = []
+ openRecentPageSize: number;
+
+ // constructor
+ constructor(private nzMessageService: NzMessageService) {
+ // open recent parameters
+ this.openRecentPageIndex = 1;
+ this.openRecentPageSize = 6;
+ const startOpenRecentIndex = (this.openRecentPageIndex - 1) *
this.openRecentPageSize;
+ const endOpenRecentIndex = this.openRecentPageIndex *
this.openRecentPageSize;
+ for (let i = startOpenRecentIndex; i < this.openRecentList.length; i++) {
+ if (i >= startOpenRecentIndex && i < endOpenRecentIndex) {
+ this.displayOpenRecentList.push(this.openRecentList[i]);
+ } else {
+ break;
+ }
+ }
+
+ // status parameters
+ this.numRunningSession = 10;
+ this.numRunningJob = 6;
+ this.usedGPUpercent = 35;
+ this.usedCPUpercent = 72;
+ this.usedMemory = 12;
+ this.totalMemory = 17;
+ this.usedMemoryPercent = (this.usedMemory * 100) / this.totalMemory;
+
+ // news parameters
+ this.newsPageIndex = 1;
+ this.newsPageSize = 5;
+ const startNewsIndex = (this.newsPageIndex - 1) * this.newsPageSize;
+ const endNewsIndex = this.newsPageIndex * this.newsPageSize;
+ for (let i = startNewsIndex; i < this.newsList.length; i++) {
+ if (i >= startNewsIndex && i < endNewsIndex) {
+ this.displayNewsList.push(this.newsList[i]);
+ } else {
+ break;
+ }
+ }
+ }
ngOnInit() {
}
+ openRecentChangePage(event: number) {
+ const pageIndex: number = event;
+ const startOpenRecentIndex = (pageIndex - 1) * this.openRecentPageSize;
+ const endOpenRecentIndex = pageIndex * this.openRecentPageSize;
+ this.displayOpenRecentList = [];
+ for (let i = startOpenRecentIndex; i < this.openRecentList.length; i++) {
+ if (i >= startOpenRecentIndex && i < endOpenRecentIndex) {
+ this.displayOpenRecentList.push(this.openRecentList[i]);
+ } else {
+ break;
+ }
+ }
+ }
+
+ newsChangePage(event: number) {
+ const pageIndex: number = event;
+ const startNewsIndex = (pageIndex - 1) * this.newsPageSize;
+ const endNewsIndex = pageIndex * this.newsPageSize;
+ this.displayNewsList = [];
+ for (let i = startNewsIndex; i < this.newsList.length; i++) {
+ if (i >= startNewsIndex && i < endNewsIndex) {
+ this.displayNewsList.push(this.newsList[i]);
+ } else {
+ break;
+ }
+ }
+ }
}
diff --git
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.html
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.html
index 36e84ba..59dd8bd 100644
---
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.html
+++
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.html
@@ -74,7 +74,7 @@
</div>
</div>
</nz-header>
- <nz-content id="workbenchContent">
+ <nz-content>
<router-outlet></router-outlet>
</nz-content>
</nz-layout>
diff --git
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.scss
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.scss
index 5755429..486c21f 100644
---
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.scss
+++
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workbench.component.scss
@@ -105,7 +105,3 @@ nz-layout {
max-width: calc(100% - 80px);
}
}
-
-#workbenchContent{
- margin: 0;
-}
diff --git
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workspace/workspace.component.html
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workspace/workspace.component.html
index 82b910f..0bc90c7 100644
---
a/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workspace/workspace.component.html
+++
b/submarine-workbench/workbench-web-ng/src/app/pages/workbench/workspace/workspace.component.html
@@ -16,8 +16,7 @@
~ specific language governing permissions and limitations
~ under the License.
-->
-
-<nz-layout>
+<nz-layout style="margin: -24px -24px 16px;">
<nz-layout class="inner-layout">
<div id="workspaceOuter">
<nz-breadcrumb>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]