浏览代码

HUE-8758 [connector] Add a spinner when performing test connection

Romain 5 年之前
父节点
当前提交
8f29487358
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      desktop/core/src/desktop/js/apps/about/components/ko.connectorsConfig.js

+ 5 - 1
desktop/core/src/desktop/js/apps/about/components/ko.connectorsConfig.js

@@ -168,7 +168,8 @@ const TEMPLATE = `
       ${ I18n('Test connection') }
       ${ I18n('Test connection') }
     </a>
     </a>
     <span>
     <span>
-      <i class="fa fa-question" data-bind="visible: !$parent.testConnectionExecuted()"></i>
+      <i class="fa fa-spinner fa-spin" data-bind="visible: $parent.testConnectionExecuting()"></i>
+      <i class="fa fa-question" data-bind="visible: !$parent.testConnectionExecuted() && !$parent.testConnectionExecuting()"></i>
       <i class="fa fa-check" data-bind="visible: $parent.testConnectionExecuted() && !$parent.testConnectionErrors().length"></i>
       <i class="fa fa-check" data-bind="visible: $parent.testConnectionExecuted() && !$parent.testConnectionErrors().length"></i>
       <i class="fa fa-exclamation" data-bind="visible: $parent.testConnectionExecuted() && $parent.testConnectionErrors().length"></i>
       <i class="fa fa-exclamation" data-bind="visible: $parent.testConnectionExecuted() && $parent.testConnectionErrors().length"></i>
       <span data-bind="visible: $parent.testConnectionExecuted() && $parent.testConnectionErrors().length, text: $parent.testConnectionErrors">
       <span data-bind="visible: $parent.testConnectionExecuted() && $parent.testConnectionErrors().length, text: $parent.testConnectionErrors">
@@ -229,6 +230,7 @@ class ConnectorsConfig extends DisposableComponent {
     this.connectorsFilter = ko.observable();
     this.connectorsFilter = ko.observable();
 
 
     this.testConnectionExecuted = ko.observable(false);
     this.testConnectionExecuted = ko.observable(false);
+    this.testConnectionExecuting = ko.observable(false);
     this.testConnectionErrors = ko.observable('');
     this.testConnectionErrors = ko.observable('');
 
 
     // Handle two types of objects are being listed: connector instances and types
     // Handle two types of objects are being listed: connector instances and types
@@ -377,6 +379,7 @@ class ConnectorsConfig extends DisposableComponent {
 
 
   testConnector(connector) {
   testConnector(connector) {
     this.testConnectionExecuted(false);
     this.testConnectionExecuted(false);
+    this.testConnectionExecuting(true);
     this.testConnectionErrors('');
     this.testConnectionErrors('');
 
 
     simplePost(
     simplePost(
@@ -387,6 +390,7 @@ class ConnectorsConfig extends DisposableComponent {
       {
       {
         successCallback: data => {
         successCallback: data => {
           this.testConnectionExecuted(true);
           this.testConnectionExecuted(true);
+          this.testConnectionExecuting(false);
           this.testConnectionErrors(data.warnings);
           this.testConnectionErrors(data.warnings);
         }
         }
       }
       }