dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] nzomkxia closed pull request #96: Restful
Date Fri, 24 Aug 2018 10:38:09 GMT
nzomkxia closed pull request #96: Restful
URL: https://github.com/apache/incubator-dubbo-ops/pull/96
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dubbo-admin/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/governance/service/impl/ProviderServiceImpl.java
b/dubbo-admin/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/governance/service/impl/ProviderServiceImpl.java
index 64956c5..2732258 100644
--- a/dubbo-admin/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/governance/service/impl/ProviderServiceImpl.java
+++ b/dubbo-admin/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/governance/service/impl/ProviderServiceImpl.java
@@ -29,6 +29,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
diff --git a/dubbo-admin/dubbo-admin-frontend/package.json b/dubbo-admin/dubbo-admin-frontend/package.json
index 8d8342f..70c0488 100644
--- a/dubbo-admin/dubbo-admin-frontend/package.json
+++ b/dubbo-admin/dubbo-admin-frontend/package.json
@@ -12,6 +12,7 @@
   },
   "dependencies": {
     "axios": "^0.18.0",
+    "codemirror": "^5.39.2",
     "vue": "^2.5.2",
     "vue-router": "^3.0.1",
     "vuetify": "^1.0.0",
diff --git a/dubbo-admin/dubbo-admin-frontend/src/components/RoutingRule.vue b/dubbo-admin/dubbo-admin-frontend/src/components/RoutingRule.vue
index 46fe247..a91a5e7 100644
--- a/dubbo-admin/dubbo-admin-frontend/src/components/RoutingRule.vue
+++ b/dubbo-admin/dubbo-admin-frontend/src/components/RoutingRule.vue
@@ -17,59 +17,91 @@
 
 <template>
   <v-container grid-list-xl fluid >
-    <!--<v-layout row wrap>-->
-    <v-layout row wrap>
-      <!--<v-layout row>-->
-      <v-flex lg10 sm12 xs12>
-        <v-text-field
-                flat
-                v-model="filter"
-        />
-      </v-flex>
-      <v-flex lg1 sm6 xs6
-              class="pl-0 ml-0 pr-0 mr-0"
-      >
-        <v-select
-                :items="dropdown_font"
-                v-model="pattern"
-        ></v-select>
-      </v-flex>
-      <v-flex lg1 xm6 xs6
-              class="pb-0 mb-0 pl-0 ml-0 mt-2"
-      >
-        <v-btn
-                @click="search(filter, pattern, true)"
-                color="primary">
-          search
-        </v-btn>
-      </v-flex>
-    </v-layout>
-    <v-layout justify-space-between row>
-      <v-flex lg10>
-        <h3>Search Result</h3>
-      </v-flex>
-      <v-flex xs2>
-        <v-btn @click.stop="dialog = true">create Rule</v-btn>
-      </v-flex>
-    </v-layout>
-    <v-flex lg12>
+    <div>
+      <v-layout row wrap>
+        <v-flex xs12 >
+          <!--<v-form>-->
+            <!--<v-layout row wrap>-->
+              <!--<v-flex xs11>-->
+                <!--<v-text-field label="Search dubbo service"-->
+                              <!--v-model="filter"></v-text-field>-->
+              <!--</v-flex>-->
+
+              <!--<v-flex xs1>-->
+                <!--<v-btn @click="submit" color="primary" >Search</v-btn>-->
+              <!--</v-flex>-->
+            <!--</v-layout>-->
+          <!--</v-form>-->
+          <v-card flat>
+            <v-card-text>
+                <v-layout row wrap >
+                  <!--<v-flex xs10>-->
+                    <v-text-field label="Search dubbo service"
+                                  v-model="filter"></v-text-field>
+                  <!--</v-flex>-->
+
+                  <!--<v-flex xs1>-->
+                    <v-btn @click="submit" color="primary" >Search</v-btn>
+                  <!--</v-flex>-->
+                </v-layout>
+
+            </v-card-text>
+
+          </v-card>
+        </v-flex>
+      </v-layout>
+      <v-toolbar class="elevation-1" flat color="white">
+        <v-toolbar-title>Search Result</v-toolbar-title>
+        <v-spacer></v-spacer>
+        <v-btn outline color="primary" @click.stop="dialog = true" class="mb-2">CREATE</v-btn>
+      </v-toolbar>
       <v-data-table
-        class="elevation-1"
         :headers="headers"
-        :items="result"
+        :items="routingRules"
+        hide-actions
+        class="elevation-1"
       >
         <template slot="items" slot-scope="props">
-          <td>{{props.item.service}}</td>
-          <td>{{props.item.group}}</td>
-          <td>{{props.item.application}}</td>
-          <td>Details</td>
+          <td>{{ props.item.rule }}</td>
+          <td class="text-xs-left">{{ props.item.service }}</td>
+          <td class="text-xs-left">{{ props.item.priority }}</td>
+          <td class="text-xs-left">{{ props.item.status }}</td>
+          <td class="justify-center px-0">
+            <v-icon
+              small
+              class="mr-2"
+              @click="deleteItem(props.item)"
+            >
+              visibility
+            </v-icon>
+            <v-icon
+              small
+              class="mr-2"
+              @click="editItem(props.item)"
+            >
+              edit
+            </v-icon>
+            <v-icon
+              small
+              class="mr-2"
+              @click="editItem(props.item)"
+            >
+              block
+            </v-icon>
+            <v-icon
+              small
+              @click="deleteItem(props.item)"
+            >
+              delete
+            </v-icon>
+          </td>
         </template>
       </v-data-table>
-    </v-flex>
+    </div>
     <v-dialog   v-model="dialog" width="450px" persistent >
       <v-card>
         <v-card-title class="justify-center">
-          <span class="headline">Creat new Routing rule</span>
+          <span class="headline">Create new Routing rule</span>
         </v-card-title>
         <v-card-text >
           <v-textarea
@@ -92,34 +124,21 @@
 </template>
 <script>
   export default {
-    props: {
-      result: {
-        type: Array,
-        default: () => [
-          {
-            service: 'com.alibaba.dubbo.com',
-            group: 'dubbo',
-            application: 'demo-provider'
-          },
-          {
-            service: 'com.alibaba.sample',
-            group: 'dubbo',
-            application: 'demo-provider'
-          },
-          {
-            service: 'com.taobao.core.engine',
-            group: 'dubbo',
-            application: 'demo-provider'
-          }
-
-        ]
-      }
-    },
     data: () => ({
       dropdown_font: [ 'Service', 'App', 'IP' ],
       pattern: 'Service',
       filter: '',
       dialog: false,
+      selected: [],
+      routingRules: [
+        {
+          id: 0,
+          rule: 'test',
+          service: 'com.alibaba.dubbo.com',
+          priority: 0,
+          status: 'enabled'
+        }
+      ],
       placeholder: 'dataId: serviceKey + CONFIGURATORS\n' +
       '\n' +
       '%yaml 1.2\n' +
@@ -161,18 +180,23 @@
       '...\n',
       headers: [
         {
-          text: 'Service',
+          text: 'Rule Name',
+          value: 'rule',
+          class: 'font-weight-black'
+        },
+        {
+          text: 'Service Name',
           value: 'service',
           class: 'font-weight-black'
         },
         {
-          text: 'Group',
-          value: 'group',
+          text: 'Priority',
+          value: 'priority',
           class: 'font-weight-black'
         },
         {
-          text: 'Application',
-          value: 'application',
+          text: 'Status',
+          value: 'status',
           class: 'font-weight-black'
         },
         {
@@ -183,8 +207,18 @@
       ]
     }),
     methods: {
-      click: function () {
-        console.log('aaa')
+      submit () {
+        console.log('submit')
+      },
+      toggleAll () {
+        if (this.selected.length) this.selected = []
+        else this.selected = this.routingRules.slice()
+      },
+      enable: function (status) {
+        if (status === 'enabled') {
+          return 'disable'
+        }
+        return 'enable'
       },
       setHeight: function () {
         this.height = window.innerHeight * 0.65
diff --git a/dubbo-admin/dubbo-admin-frontend/src/components/ServiceDetail.vue b/dubbo-admin/dubbo-admin-frontend/src/components/ServiceDetail.vue
index 32d6776..ce3cfa8 100644
--- a/dubbo-admin/dubbo-admin-frontend/src/components/ServiceDetail.vue
+++ b/dubbo-admin/dubbo-admin-frontend/src/components/ServiceDetail.vue
@@ -106,30 +106,6 @@
   import {AXIOS} from './http-common'
 
   export default {
-    props: {
-      metadata: {
-        type: Array,
-        default: () =>
-          [
-            {
-              method: 'toString',
-              parameter: 'java.lang.String',
-              returnType: 'void'
-            },
-            {
-              method: 'queryBatch',
-              parameter: 'com.taobao.tc.domain.query.QueryBizOrderDO',
-              returnType: 'com.taobao.tc.domain.result.BatchQueryBizOrderResultDO'
-            },
-            {
-              method: 'isShowCheckcode',
-              parameter: 'long',
-              returnType: 'com.taobao.tc.domain.result.QueryTairResultDO'
-            }
-
-          ]
-      }
-    },
     data: () => ({
       metaHeaders: [
         {
@@ -189,6 +165,7 @@
       },
       providerDetails: [],
       consumerDetails: [],
+      metadata: [],
       basic: []
     }),
     methods: {
diff --git a/dubbo-admin/dubbo-admin-frontend/src/components/ServiceSearch.vue b/dubbo-admin/dubbo-admin-frontend/src/components/ServiceSearch.vue
index ec13b51..ba7020e 100644
--- a/dubbo-admin/dubbo-admin-frontend/src/components/ServiceSearch.vue
+++ b/dubbo-admin/dubbo-admin-frontend/src/components/ServiceSearch.vue
@@ -18,53 +18,63 @@
 <template>
   <v-container id="search" grid-list-xl fluid >
     <v-layout row wrap>
-      <!--<v-layout row>-->
-        <v-flex
-          lg10
-          sm12
-          xs12
-        >
-          <v-text-field
-            flat
-            v-model="filter"
-          />
-        </v-flex>
-        <v-flex lg1 sm6 xs6
-                class="pl-0 ml-0 pr-0 mr-0"
-        >
-          <v-select
-            :items="dropdown_font"
-            v-model="pattern"
-          ></v-select>
-        </v-flex>
-        <v-flex lg1 xm6 xs6
-                class="pb-0 mb-0 pl-0 ml-0 mt-2"
-        >
-          <v-btn
-            @click="search(filter, pattern, true)"
-            color="primary">
-            search
-          </v-btn>
-        </v-flex>
-      </v-layout>
-      <v-flex sm12>
-        <h3>Search Result</h3>
-      </v-flex>
-      <v-flex lg12>
-        <v-data-table
-          class="elevation-1"
-          :headers="headers"
-          :items="services"
-        >
-          <template slot="items" slot-scope="props">
-            <td>{{props.item.serviceName}}</td>
-            <td>{{props.item.group}}</td>
-            <td>{{props.item.appName}}</td>
-            <td><v-btn small color='primary' :href='getHref(props.item.serviceName,
props.item.appName)'>Detail</v-btn></td>
-          </template>
-        </v-data-table>
+      <v-flex xs12 >
+        <v-card flat>
+          <v-card-text>
+            <v-form>
+              <v-layout row wrap>
+                <!--<v-flex xs10>-->
+                  <v-text-field label="Search dubbo service"
+                                v-bind:suffix="queryBy"
+                                v-model="filter"></v-text-field>
+                <!--</v-flex>-->
+
+                <!--<v-flex xs2>-->
+                  <v-menu bottom left class="hidden-xs-only">
+                    <v-btn
+                      slot="activator"
+                      icon>
+                      <v-icon>unfold_more</v-icon>
+                    </v-btn>
+
+                    <v-list>
+                      <v-list-tile
+                        v-for="(item, i) in items"
+                        :key="i"
+                        @click="selected = i">
+                        <v-list-tile-title>{{ item.title }}</v-list-tile-title>
+                      </v-list-tile>
+                    </v-list>
+                  </v-menu>
+                  <v-btn @click="submit" color="primary"  >Search</v-btn>
+                <!--</v-flex>-->
+              </v-layout>
+            </v-form>
+
+          </v-card-text>
+        </v-card>
       </v-flex>
-    <!--</v-layout>-->
+    </v-layout>
+    <!--<v-flex sm12>-->
+      <!--<h3>Search Result</h3>-->
+    <!--</v-flex>-->
+    <v-flex lg12>
+      <v-toolbar class="elevation-1" flat color="white">
+        <v-toolbar-title>Search Result</v-toolbar-title>
+      </v-toolbar>
+      <v-data-table
+        class="elevation-1"
+        :headers="headers"
+        :items="services"
+      >
+        <template slot="items" slot-scope="props">
+          <td>{{props.item.serviceName}}</td>
+          <td>{{props.item.group}}</td>
+          <td>{{props.item.appName}}</td>
+          <td><v-btn small color='primary' :href='getHref(props.item.serviceName,
props.item.appName)'>Detail</v-btn></td>
+        </template>
+      </v-data-table>
+    </v-flex>
   </v-container>
 </template>
 <script>
@@ -72,9 +82,13 @@
 
   export default {
     data: () => ({
+      items: [
+        {title: 'service name'},
+        {title: 'IP'},
+        {title: 'application'}
+      ],
+      selected: 0,
       services: [],
-      dropdown_font: [ 'Service', 'App', 'IP' ],
-      pattern: 'Service',
       filter: '',
       headers: [
         {
@@ -99,14 +113,19 @@
         }
       ]
     }),
+    computed: {
+      queryBy () {
+        return 'by ' + this.items[this.selected].title
+      }
+    },
     methods: {
-      click: function () {
-        console.log('aaa')
-      },
       getHref: function (service, app) {
         return '/#/serviceDetail?service=' + service + '&app=' + app
       },
-
+      submit () {
+        let pattern = this.items[this.selected].title
+        this.search(this.filter, pattern, true)
+      },
       search: function (filter, pattern, rewrite) {
         AXIOS.get('service/search?' + 'filter=' + filter + '&pattern=' + pattern)
           .then(response => {
@@ -130,8 +149,6 @@
         }
       })
       if (filter !== '' && pattern !== '') {
-        this.pattern = pattern
-        this.filter = filter
         this.search(filter, pattern, false)
       }
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Mime
View raw message