You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by mi...@apache.org on 2018/11/30 09:25:24 UTC

[incubator-dubbo-ops] branch metadata updated: add tag route by application

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

min pushed a commit to branch metadata
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-ops.git


The following commit(s) were added to refs/heads/metadata by this push:
     new ad13409  add tag route by application
ad13409 is described below

commit ad134093112bb3156d0d8c35c648daf5e1f957a5
Author: nzomkxia <z8...@gmail.com>
AuthorDate: Fri Nov 30 17:25:12 2018 +0800

    add tag route by application
---
 .../src/components/governance/TagRule.vue          | 41 ++++++++--------------
 1 file changed, 15 insertions(+), 26 deletions(-)

diff --git a/dubbo-admin-frontend/src/components/governance/TagRule.vue b/dubbo-admin-frontend/src/components/governance/TagRule.vue
index 90412db..96eaae7 100644
--- a/dubbo-admin-frontend/src/components/governance/TagRule.vue
+++ b/dubbo-admin-frontend/src/components/governance/TagRule.vue
@@ -38,8 +38,7 @@
             class="elevation-0"
           >
             <template slot="items" slot-scope="props">
-              <td class="text-xs-left">{{ props.item.service }}</td>
-              <td class="text-xs-left">{{ props.item.group }}</td>
+              <td class="text-xs-left">{{ props.item.application }}</td>
               <td class="text-xs-left">{{ props.item.priority }}</td>
               <td class="text-xs-left">{{ props.item.enabled }}</td>
               <td class="text-xs-center px-0">
@@ -63,11 +62,6 @@
         </v-card-title>
         <v-card-text >
           <v-text-field
-            label="Service Unique ID"
-            hint="A service ID in form of group/service:version, group and version are optional"
-            v-model="service"
-          ></v-text-field>
-          <v-text-field
             label="Application Name"
             hint="Application name the service belongs to"
             v-model="application"
@@ -120,7 +114,6 @@
       warn: false,
       updateId: '',
       application: '',
-      service: '',
       warnTitle: '',
       warnText: '',
       warnStatus: {},
@@ -182,7 +175,6 @@
       closeDialog: function () {
         this.ruleText = this.template
         this.updateId = ''
-        this.service = ''
         this.application = ''
         this.dialog = false
         this.readonly = false
@@ -202,10 +194,9 @@
       },
       saveItem: function () {
         let rule = yaml.safeLoad(this.ruleText)
-        if (this.service === '' && this.application === '') {
+        if (this.application === '') {
           return
         }
-        rule.service = this.service
         rule.application = this.application
         if (this.updateId !== '') {
           if (this.updateId === 'close') {
@@ -215,7 +206,7 @@
             this.$axios.put('/rules/route/tag/' + rule.id, rule)
               .then(response => {
                 if (response.status === 200) {
-                  this.search(this.service, true)
+                  this.search(this.application, true)
                   this.closeDialog()
                   this.$notify.success('Update success')
                 }
@@ -225,8 +216,8 @@
           this.$axios.post('/rules/route/tag/', rule)
             .then(response => {
               if (response.status === 201) {
-                this.search(this.service, true)
-                this.filter = this.service
+                this.search(this.application, true)
+                this.filter = this.application
                 this.closeDialog()
                 this.$notify.success('Create success')
               }
@@ -258,30 +249,28 @@
               })
             break
           case 'block':
-            this.openWarn(' Are you sure to block Routing Rule', 'service: ' + item.service)
+            this.openWarn(' Are you sure to block Routing Rule', 'application: ' + item.application)
             this.warnStatus.operation = 'disable'
             this.warnStatus.id = itemId
             break
           case 'check_circle_outline':
-            this.openWarn(' Are you sure to enable Routing Rule', 'service: ' + item.service)
+            this.openWarn(' Are you sure to enable Routing Rule', 'application: ' + item.application)
             this.warnStatus.operation = 'enable'
             this.warnStatus.id = itemId
             break
           case 'delete':
-            this.openWarn(' Are you sure to Delete Routing Rule', 'service: ' + item.service)
+            this.openWarn(' Are you sure to Delete Routing Rule', 'application: ' + item.application)
             this.warnStatus.operation = 'delete'
             this.warnStatus.id = itemId
         }
       },
-      handleBalance: function (conditionRoute, readonly) {
-        this.service = conditionRoute.service
-        this.application = conditionRoute.application
-        delete conditionRoute.service
-        delete conditionRoute.id
-        delete conditionRoute.app
-        delete conditionRoute.group
-        delete conditionRoute.application
-        this.ruleText = yaml.safeDump(conditionRoute)
+      handleBalance: function (tagRoute, readonly) {
+        this.application = tagRoute.application
+        delete tagRoute.id
+        delete tagRoute.app
+        delete tagRoute.group
+        delete tagRoute.application
+        this.ruleText = yaml.safeDump(tagRoute)
         this.readonly = readonly
         this.dialog = true
       },