Explorar el Código

Replace the tenant management page ui with element-ui (#3891)

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [Feature-3682][ui]Add form-create plug-in and alarm group management add sample demo (#3683)

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [feature][ui] Add alarm instance page

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [feature][ui]Alert plugin design (#3734)

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [Feature-3682][ui]Add form-create plug-in and alarm group management add sample demo (#3683)

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [feature][ui] Add alarm instance page

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* [Feature-3189][alert,spi,dao,plugin-api] base code of dolphinscheduler spi and alert plugin implement (#3601)

* DS SPI

* Add DolphinScheduler SPI , and rebuilt the code of the Alert plug-in based on SPI

* Add DolphinScheduler SPI , and rebuilt the code of the Alert plug-in based on SPI

* add TODO

* delete

* compile

* spi commit

* Plugin Alert

* fix some bug

* add todo

* change web ui from alpacajs to form-create

* remove module

* add plugin schema

* add license header

* update alert and spi module version

* update the alert plugin sub module version

* comment the maven.local.repository param

* move utils from spi to common module

* add license header

* add license header and delete some chinese comment

* update spi packages

* delete no use alert_xx.properties

* update mysql.connector.version back to 5.1.34

* delete no use comment in pom.xml

* update email stmp password

* add license

* add semicolon to sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql file

* format the code style

* format new clase file with checkstyle

* update plugin params to Builder model

* move JSONUtils to SPI because plugin can not dependency common module

* move JSONUtils to SPI because plugin can not dependency common module

* delete collection dependency

* replace PluginParamsTransfer to spi PluginParamsTransfer

* update dolphinscheduler-maven-plugin to 1.0.0

* update license

* update apache-rat-plugin add exclude '.iml' file

* check license

* ArtifactResolver only use in development and configPlugins is not empty

* ArtifactResolver only use in development and configPlugins is not empty

* ArtifactResolver only use in development and configPlugins is not empty

* default datasource should be postgresql

* add license files

* add license files

* postgresql port should be 5432

* postgresql test

* mv show_type to spi

add license header to AlertConstants

* check style fix

* copy check style file from branch dev

* alert show_type set by plugin

* alert show_type set by plugin

* add PluginDefineMapper to dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/registry/DependencyConfig.java

* add Bean to TaskCallbackServiceTestConfig

* add Bean to TaskCallbackServiceTestConfig

* fix check style

* check style fix

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* fix check style

* [Feature-3682][ui]Add form-create plug-in and alarm group management add sample demo (#3683)

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* check style fix

* rollback test change

* rollback test change

* rollback dao pom change

* [feature-3665][ui]Add element-ui (#3666)

* [feature-3665][ui]Add element-ui

* add license

* Add form-create plug-in and alarm group management add sample demo

* Modify node version

* fix

* fix

* add ut to pom.xml

* add upgrade schema to global schema

* fix ut failed

* fix ut failed

* fix ut failed

* fix ut failed

* add test EmailAlertPluginTest to pom.xml

* fix ut failed

* fix ut failed

* fix check style

* update license header to presto license header

* presto license header not check

* fix ut coverage

* fix ut coverage

* fix ut

* fix ut

* fix ut

* fix ut coverage

* fix ut coverage

* fix ut coverage

* fix ut coverage

* fix ut coverage

* fix ut coverage

Co-authored-by: break60 <790061044@qq.com>

* The tenant management module ui is replaced with element-ui

* fix

* fix

* fix

* fix

* fix

* modify

* fix

Co-authored-by: gaojun2048 <32193458+gaojun2048@users.noreply.github.com>
break60 hace 4 años
padre
commit
20bc747306

+ 3 - 1
dolphinscheduler-ui/src/js/conf/home/index.js

@@ -19,6 +19,7 @@
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
 import Vue from 'vue'
 import ElementUI from 'element-ui'
+import locale from 'element-ui/lib/locale/lang/en'
 import 'element-ui/lib/theme-chalk/index.css'
 import App from './App'
 import router from './router'
@@ -43,7 +44,8 @@ import formCreate, {maker} from '@form-create/element-ui'
 // Component internationalization
 const useOpt = i18n.globalScope.LOCALE === 'en_US' ? { locale: en_US } : {}
 
-Vue.use(ElementUI)
+i18n.globalScope.LOCALE === 'en_US' ? Vue.use(ElementUI, { locale }) : Vue.use(ElementUI)
+
 
 // Vue.use(ans)
 Vue.use(ans, useOpt)

+ 37 - 94
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue

@@ -17,95 +17,43 @@
 <template>
   <div class="list-model">
     <div class="table-box">
-      <table>
-        <tr>
-          <th>
-            <span>{{$t('#')}}</span>
-          </th>
-          <th>
-            <span>{{$t('Tenant Code')}}</span>
-          </th>
-          <th>
-            <span>{{$t('Tenant Name')}}</span>
-          </th>
-          <th>
-            <span>{{$t('Description')}}</span>
-          </th>
-          <th>
-            <span>{{$t('Queue')}}</span>
-          </th>
-          <th>
-            <span>{{$t('Create Time')}}</span>
-          </th>
-          <th>
-            <span>{{$t('Update Time')}}</span>
-          </th>
-          <th width="70">
-            <span>{{$t('Operation')}}</span>
-          </th>
-        </tr>
-        <tr v-for="(item, $index) in list" :key="$index">
-          <td>
-            <span>{{parseInt(pageNo === 1 ? ($index + 1) : (($index + 1) + (pageSize * (pageNo - 1))))}}</span>
-          </td>
-          <td>
-            <span>
-              {{item.tenantCode}}
-            </span>
-          </td>
-          <td>
-            <span>
-              {{item.tenantName}}
-            </span>
-          </td>
-          <td>
-            <span v-if="item.description" class="ellipsis" v-tooltip.large.top.start.light="{text: item.description, maxWidth: '500px'}">{{item.description}}</span>
-            <span v-else>-</span>
-          </td>
-          <td>
-            <span>{{item.queueName}}</span>
-          </td>
-          <td>
-            <span v-if="item.createTime">{{item.createTime | formatDate}}</span>
-            <span v-else>-</span>
-          </td>
-          <td>
-            <span v-if="item.updateTime">{{item.updateTime | formatDate}}</span>
-            <span v-else>-</span>
-          </td>
-          <td>
-            <x-button
-                    type="info"
-                    shape="circle"
-                    size="xsmall"
-                    data-toggle="tooltip"
-                    :title="$t('Edit')"
-                    @click="_edit(item)"
-                    icon="ans-icon-edit">
-            </x-button>
-            <x-poptip
-              :ref="'poptip-' + $index"
-              placement="bottom-end"
-              width="90">
-              <p>{{$t('Delete?')}}</p>
-              <div style="text-align: right; margin: 0;padding-top: 4px;">
-                <x-button type="text" size="xsmall" shape="circle" @click="_closeDelete($index)">{{$t('Cancel')}}</x-button>
-                <x-button type="primary" size="xsmall" shape="circle" @click="_delete(item,$index)">{{$t('Confirm')}}</x-button>
-              </div>
-              <template slot="reference">
-                <x-button
-                  icon="ans-icon-trash"
-                  type="error"
-                  shape="circle"
-                  size="xsmall"
-                  data-toggle="tooltip"
-                  :title="$t('delete')">
-                </x-button>
-              </template>
-            </x-poptip>
-          </td>
-        </tr>
-      </table>
+      <el-table :data="list" size="mini" style="width: 100%">
+        <el-table-column type="index" width="50"></el-table-column>
+        <el-table-column prop="tenantCode" :label="$t('Tenant Code')" width="180"></el-table-column>
+        <el-table-column prop="tenantName" :label="$t('Tenant Name')" width="180"></el-table-column>
+        <el-table-column prop="description" :label="$t('Description')" width="180"></el-table-column>
+        <el-table-column prop="queueName" :label="$t('Queue')" width="180"></el-table-column>
+        <el-table-column :label="$t('Create Time')">
+          <template slot-scope="scope">
+            <span>{{scope.row.createTime | formatDate}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('Update Time')">
+          <template slot-scope="scope">
+            <span>{{scope.row.updateTime | formatDate}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('Operation')" width="100">
+          <template slot-scope="scope">
+            <el-tooltip :content="$t('Edit')" placement="top">
+              <el-button type="primary" size="mini" icon="el-icon-edit" @click="_edit(scope.row)" circle></el-button>
+            </el-tooltip>
+            <el-tooltip :content="$t('delete')" placement="top">
+              <el-button type="danger" size="mini" icon="el-icon-delete" circle></el-button>
+              <el-popconfirm
+                :confirmButtonText="$t('Confirm')"
+                :cancelButtonText="$t('Cancel')"
+                icon="el-icon-info"
+                iconColor="red"
+                :title="$t('Delete?')"
+                @onConfirm="_delete(scope.row,scope.row.id)"
+              >
+                <el-button type="danger" size="mini" icon="el-icon-delete" circle slot="reference"></el-button>
+              </el-popconfirm>
+            </el-tooltip>
+          </template>
+        </el-table-column>
+      </el-table>
     </div>
   </div>
 </template>
@@ -127,18 +75,13 @@
     },
     methods: {
       ...mapActions('security', ['deleteQueue']),
-      _closeDelete (i) {
-        this.$refs[`poptip-${i}`][0].doClose()
-      },
       _delete (item, i) {
         this.deleteQueue({
           id: item.id
         }).then(res => {
-          this.$refs[`poptip-${i}`][0].doClose()
           this.$emit('on-update')
           this.$message.success(res.msg)
         }).catch(e => {
-          this.$refs[`poptip-${i}`][0].doClose()
           this.$message.error(e.msg || '')
         })
       },

+ 11 - 2
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/index.vue

@@ -19,7 +19,7 @@
     <template slot="conditions">
       <m-conditions @on-conditions="_onConditions">
         <template slot="button-group" v-if="isADMIN">
-          <x-button type="ghost" size="small" @click="_create('')">{{$t('Create Tenant')}}</x-button>
+          <el-button type="ghost" size="mini" @click="_create('')">{{$t('Create Tenant')}}</el-button>
         </template>
       </m-conditions>
     </template>
@@ -33,7 +33,16 @@
 
         </m-list>
         <div class="page-box">
-          <x-page :current="parseInt(searchParams.pageNo)" :total="total" :page-size="searchParams.pageSize" show-elevator @on-change="_page" show-sizer :page-size-options="[10,30,50]" @on-size-change="_pageSize"></x-page>
+          <el-pagination
+            background
+            @current-change="_page"
+            @size-change="_pageSize"
+            :page-size="searchParams.pageSize"
+            :current-page.sync="searchParams.pageNo"
+            :page-sizes="[10, 30, 50]"
+            layout="sizes, prev, pager, next, jumper"
+            :total="total">
+          </el-pagination>
         </div>
       </template>
       <template v-if="!tenementList.length && total<=0">

+ 2 - 1
dolphinscheduler-ui/src/js/conf/login/index.js

@@ -20,6 +20,7 @@
 // import $ from 'jquery'
 import Vue from 'vue'
 import ElementUI from 'element-ui'
+import locale from 'element-ui/lib/locale/lang/en'
 import 'element-ui/lib/theme-chalk/index.css'
 import App from './App'
 import i18n from '@/module/i18n'
@@ -31,7 +32,7 @@ import 'bootstrap/dist/js/bootstrap.min.js'
 
 import formCreate, {maker} from '@form-create/element-ui'
 
-Vue.use(ElementUI)
+i18n.globalScope.LOCALE === 'en_US' ? Vue.use(ElementUI, { locale }) : Vue.use(ElementUI)
 
 Vue.use(ans)
 

+ 2 - 2
dolphinscheduler-ui/src/js/module/components/popup/popup.vue

@@ -23,8 +23,8 @@
       <slot name="content"></slot>
     </div>
     <div class="bottom-p">
-      <x-button type="text" shape="circle" @click="close()" :disabled="disabled"> {{$t('Cancel')}} </x-button>
-      <x-button type="primary" shape="circle" :loading="spinnerLoading" @click="ok()" :disabled="disabled || apDisabled">{{spinnerLoading ? 'Loading...' : okText}} </x-button>
+      <el-button type="text" size="mini" round @click="close()" :disabled="disabled"> {{$t('Cancel')}} </el-button>
+      <el-button type="primary" size="mini" round :loading="spinnerLoading" @click="ok()" :disabled="disabled || apDisabled">{{spinnerLoading ? 'Loading...' : okText}} </el-button>
     </div>
   </div>
 </template>

+ 6 - 0
dolphinscheduler-ui/src/sass/common/_table.scss

@@ -174,3 +174,9 @@
 .el-table--enable-row-hover .el-table__body tr:hover>td {
   background-color: #ddecff;
 }
+.el-table th>.cell {
+  color: #555;
+}
+.el-table td div {
+  color: #666;
+}

+ 3 - 3
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TenantManageLocator.java

@@ -35,9 +35,9 @@ public class TenantManageLocator{
 
     public static final By SUBMIT_BUTTON = By.xpath("//div[3]/button[2]/span");
 
-    public static final By DELETE_TENANT_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[8]/span/button");
+    public static final By DELETE_TENANT_BUTTON = By.xpath("//table/tbody/tr[1]/td[8]/div/span/button/i");
 
-    public static final By CONFIRM_DELETE_TENANT_BUTTON = By.xpath("//div[2]/div/button[2]/span");
+    public static final By CONFIRM_DELETE_TENANT_BUTTON = By.xpath("//div[1]/div/button[2]/span");
 
-    public static final By TENANT_CODE_FIRST = By.xpath("//table/tr[2]/td[2]/span");
+    public static final By TENANT_CODE_FIRST = By.xpath("//table/tbody/tr[1]/td[2]/div");
 }