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

pingsutw 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 d27705a  SUBMARINE-754. Add Experiment Auto Reload
d27705a is described below

commit d27705a1fcfda7c17013ffa8e3dc8edf14d6c209
Author: noidname01 <[email protected]>
AuthorDate: Sun Feb 28 10:51:54 2021 +0800

    SUBMARINE-754. Add Experiment Auto Reload
    
    ### What is this PR for?
    
    Add Experiment Auto Reload
    
    ### What type of PR is it?
    
    [Improvement]
    
    ### Todos
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/browse/SUBMARINE-754
    
    ### How should this be tested?
    
    ### Screenshots (if appropriate)
    
    ![Peek 2021-03-03 
18-00](https://user-images.githubusercontent.com/55401762/109910162-74dc9b80-7ce2-11eb-8536-1a1f1b0b7438.gif)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: noidname01 <[email protected]>
    
    Signed-off-by: Kevin <[email protected]>
    
    Closes #525 from noidname01/SUBMARINE-754 and squashes the following 
commits:
    
    d3adb4a2 [noidname01] delete comment
    13503714 [noidname01] autoreload switch
---
 .../experiment-home/experiment-home.component.html    |  5 +++++
 .../experiment-home/experiment-home.component.ts      | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.html
 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.html
index 99fb8ca..3fa8ffb 100644
--- 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.html
+++ 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.html
@@ -19,6 +19,11 @@
 
 <div style="margin: 15px; padding: 15px; background-color: white">
   <div align="right">
+    <div style="margin: 0px 4px 0px 4px; display: inline-block">
+      Auto Reload
+      <nz-switch [(ngModel)]="switchValue" 
(click)="onSwitchAutoReload()"></nz-switch>
+    </div>
+
     <nz-radio-group>
       <label nz-radio-button nzValue="All">All</label>
       <label nz-radio-button nzValue="Own">Owned By Me</label>
diff --git 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
index 919c5e8..f95304f 100644
--- 
a/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
+++ 
b/submarine-workbench/workbench-web/src/app/pages/workbench/experiment/experiment-home/experiment-home.component.ts
@@ -42,6 +42,12 @@ export class ExperimentHomeComponent implements OnInit {
   isListLoading: boolean = true;
   checkedList: boolean[];
   selectAllChecked: boolean = false;
+  switchValue: boolean = false;
+
+  // auto reload
+  reloadPeriod: number = 10000; // default 10s
+  reloadInterval = interval(this.reloadPeriod);
+  reloadSub = null;
 
   // tensorboard
   isTensorboardLoading: boolean = true;
@@ -122,6 +128,19 @@ export class ExperimentHomeComponent implements OnInit {
     this.form.initModal(obj.initMode, obj.initFormType, obj.id, obj.spec);
   }
 
+  onSwitchAutoReload() {
+    console.log(this.switchValue);
+    if (this.switchValue) {
+      this.reloadSub = this.reloadInterval.subscribe((res) => {
+        this.fetchExperimentList();
+      });
+    } else {
+      if (this.reloadSub) {
+        this.reloadSub.unsubscribe();
+      }
+    }
+  }
+
   getTensorboardInfo(period: number, due: number) {
     /*
       It will keep polling every ${period} msec, and stop polling whenever


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to