You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dg...@apache.org on 2020/05/27 07:49:43 UTC

[incubator-dlab] branch change_refreshToken_limit created (now 78d0250)

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

dgnatyshyn pushed a change to branch change_refreshToken_limit
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at 78d0250  changed token limit

This branch includes the following new commits:

     new 78d0250  changed token limit

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: changed token limit

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dgnatyshyn pushed a commit to branch change_refreshToken_limit
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 78d02505bae96325af7328aa7719a4e412512391
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Wed May 27 10:49:00 2020 +0300

    changed token limit
---
 .../src/app/core/pipes/convert-file-size/convert-file-size.pipe.ts | 7 +++++--
 .../src/app/resources/bucket-browser/bucket-browser.component.ts   | 7 +++----
 .../resources/bucket-browser/folder-tree/folder-tree.component.ts  | 4 +++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/pipes/convert-file-size/convert-file-size.pipe.ts b/services/self-service/src/main/resources/webapp/src/app/core/pipes/convert-file-size/convert-file-size.pipe.ts
index c316c0e..0bd2f61 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/pipes/convert-file-size/convert-file-size.pipe.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/pipes/convert-file-size/convert-file-size.pipe.ts
@@ -23,12 +23,15 @@ import { Pipe, PipeTransform } from '@angular/core';
 
 export class ConvertFileSizePipe implements PipeTransform {
   transform(bytes: number): any {
-      const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB'];
+      const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
+      if (bytes === 0) {
+        return '0 byte';
+      }
       for (let i = 0; i < sizes.length; i++) {
         if (bytes <= 1024) {
           return bytes + ' ' + sizes[i];
         } else {
-          bytes = Math.round(bytes / 1024);
+          bytes = parseFloat((bytes / 1024).toFixed(2));
         }
       }
       return bytes;
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts
index 80869cd..445e08b 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/bucket-browser.component.ts
@@ -56,8 +56,7 @@ export class BucketBrowserComponent implements OnInit {
   public selectedItems;
   public searchValue: string;
   public isQueueFull: boolean;
-  // public refreshTokenLimit = 300000;
-  public refreshTokenLimit = 150000;
+  public refreshTokenLimit = 300000;
   private isTokenRefreshing = false;
 
 
@@ -294,10 +293,10 @@ export class BucketBrowserComponent implements OnInit {
     const uploading = this.addedFiles.filter(v => v.status === 'uploading');
     this.isQueueFull = !!waitUploading.length;
     this.isFileUploading = !!this.addedFiles.filter(v => v.status === 'uploading').length;
-    if (this.refreshTokenLimit > this.getTokenValidTime() && !this.isTokenRefreshing) {
+    if ((this.refreshTokenLimit > this.getTokenValidTime()) && !this.isTokenRefreshing) {
       this.refreshToken();
     }
-    if (waitUploading.length && uploading.length < 10 && !this.isTokenRefreshing) {
+    if (waitUploading.length && uploading.length < 10) {
       if (!file) {
         file = waitUploading[0];
       }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts
index e8ee2b3..93dabb7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/bucket-browser/folder-tree/folder-tree.component.ts
@@ -228,7 +228,9 @@ private addNewItem(node: TodoItemFlatNode, file, isFile) {
             this.resetForm();
             this.folderCreating = false;
             this.dataSource._flattenedData.getValue()
-              .splice(this.dataSource._flattenedData.getValue().indexOf(this.dataSource._flattenedData.getValue().filter(v => v.item === '')[0]));
+              .splice(this.dataSource._flattenedData.getValue()
+                .indexOf(this.dataSource._flattenedData
+                  .getValue().filter(v => v.item === '')[0]));
           }
         }, error => {
           this.folderCreating = false;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org