little-cui closed pull request #490: SCB-1025 Add Properties View in Service 
Info Page
URL: https://github.com/apache/servicecomb-service-center/pull/490
 
 
   

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/frontend/app/apiList/apiList.js b/frontend/app/apiList/apiList.js
index 2c28bace..8e36cbb3 100644
--- a/frontend/app/apiList/apiList.js
+++ b/frontend/app/apiList/apiList.js
@@ -31,6 +31,10 @@ angular.module('serviceCenter')
                 url: 
'v4/default/registry/microservices/{{consumerId}}/providers',
                 method: 'GET'
             },
+            particularService: {
+                url: 'v4/default/registry/microservices/{{serviceId}}',
+                method: 'GET'
+            },
             provider: {
                 url: 
'v4/default/registry/microservices/{{providerId}}/consumers',
                 method: 'GET'
diff --git a/frontend/app/scripts/languages/locale-en.js 
b/frontend/app/scripts/languages/locale-en.js
index ff29f355..27f43563 100644
--- a/frontend/app/scripts/languages/locale-en.js
+++ b/frontend/app/scripts/languages/locale-en.js
@@ -100,5 +100,7 @@ angular.module('serviceCenter')
             "developServiceConsumer": "How to develop service consumer?",
             "instanceUnregister": "When will the instance get unregistered 
from service center?"
         },
-        "viewMoreInfo": "View more info"
+        "viewMoreInfo": "View more info",
+        "properties" : "Meta-Data",
+        "noPropertiesFound" : "No Meta-Data Available for this Microservice"
     });
\ No newline at end of file
diff --git a/frontend/app/scripts/languages/locale-zh.js 
b/frontend/app/scripts/languages/locale-zh.js
index 7f8c6586..4dd49846 100644
--- a/frontend/app/scripts/languages/locale-zh.js
+++ b/frontend/app/scripts/languages/locale-zh.js
@@ -100,5 +100,7 @@ angular.module('serviceCenter')
             "developServiceConsumer": "如何发展服务消费者?",
             "instanceUnregister": "实例何时从服务中心注销?"
         },
-        "viewMoreInfo": "查看更多信息"
+        "viewMoreInfo": "查看更多信息",
+        "properties" : "元数据",
+        "noPropertiesFound" : "没有查询到更多信息"
     });
\ No newline at end of file
diff --git 
a/frontend/app/scripts/modules/serviceCenter/controllers/serviceInfoCtrl.js 
b/frontend/app/scripts/modules/serviceCenter/controllers/serviceInfoCtrl.js
index a92c95a9..4070bc91 100644
--- a/frontend/app/scripts/modules/serviceCenter/controllers/serviceInfoCtrl.js
+++ b/frontend/app/scripts/modules/serviceCenter/controllers/serviceInfoCtrl.js
@@ -46,6 +46,9 @@ angular.module('serviceCenter.sc')
                        var providerUrl = apiConstant.api.provider.url;
                        var providerApi = providerUrl.replace('{{providerId}}', 
serviceId);
                        apis.push(providerApi);
+                       var serviceUrl = apiConstant.api.particularService.url;
+                       var particularServiceAPI = 
serviceUrl.replace('{{serviceId}}', serviceId);
+                       apis.push(particularServiceAPI)
 
                        var promises =[];
                        for (var i = 0; i < apis.length; i++) {
@@ -59,10 +62,12 @@ angular.module('serviceCenter.sc')
                                $scope.instances = response[0].data.instances 
|| [];
                                $scope.providers = response[1].data.providers 
|| [];
                                $scope.consumers = response[2].data.consumers 
|| [];
+                               $scope.service = response[3].data.service || [];
                        },function(error){
                                $scope.instances = [];
                                $scope.providers = [];
                                $scope.consumers = [];
+                               $scope.service = [];
                        });
 
                        $scope.getInstance = function(){
@@ -81,6 +86,12 @@ angular.module('serviceCenter.sc')
                                $state.go('sc.info.schema');
                        };
 
+                       $scope.getProperties = function() {
+                               $state.go('sc.info.properties');
+                       };
+
+
+
                        $scope.convertTime = function(timestamp){
                                return commonService.timeFormat(timestamp);
                        };
@@ -98,6 +109,10 @@ angular.module('serviceCenter.sc')
                 if($state.current.name == "sc.info.schema"){
                     $scope.selectedTab = 3;
                 }
+                if($state.current.name == "sc.info.properties"){
+                    $scope.selectedTab = 4;
+                }
+
                        }
             $scope.getActiveTab();
 
diff --git a/frontend/app/scripts/modules/serviceCenter/views/serviceInfo.html 
b/frontend/app/scripts/modules/serviceCenter/views/serviceInfo.html
index dd0a4094..edf71886 100644
--- a/frontend/app/scripts/modules/serviceCenter/views/serviceInfo.html
+++ b/frontend/app/scripts/modules/serviceCenter/views/serviceInfo.html
@@ -42,6 +42,9 @@ <h1>{{serviceDetail.serviceName || "S" | limitTo : 1 : 0 
}}</h1>
 
       <md-tab label="{{ 'schema' | translate }}" ng-click="getSchema()">
       </md-tab>
+
+      <md-tab label="{{ 'properties' | translate }}" 
ng-click="getProperties()">
+      </md-tab>
     </md-tabs>
 
       <div ui-view="info"></div>
diff --git 
a/frontend/app/scripts/modules/serviceCenter/views/serviceProperties.html 
b/frontend/app/scripts/modules/serviceCenter/views/serviceProperties.html
new file mode 100644
index 00000000..be401d11
--- /dev/null
+++ b/frontend/app/scripts/modules/serviceCenter/views/serviceProperties.html
@@ -0,0 +1,27 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<table class="table table-bordered table-responsive margin20" >
+    <tbody>
+
+    <div class="well" ng-if="service.length != 0" style="margin-top: 50px">
+        <pre>{{service | json}}</pre>
+    </div>
+    <tr ng-if="service.length == 0" class="text-center">
+        <td colspan="5">{{ "noPropertiesFound" | translate }}</td>
+    </tr>
+    </tbody>
+</table>
diff --git a/frontend/app/scripts/scRouterConfig.js 
b/frontend/app/scripts/scRouterConfig.js
index b8746380..e07ea222 100644
--- a/frontend/app/scripts/scRouterConfig.js
+++ b/frontend/app/scripts/scRouterConfig.js
@@ -99,6 +99,14 @@ angular.module('serviceCenter.router', [])
                     }
                 }
             })
+            .state('sc.info.properties', {
+                url: '/properties',
+                views: {
+                    "info": {
+                        templateUrl: 
'scripts/modules/serviceCenter/views/serviceProperties.html'
+                    }
+                }
+            })
             .state('sc.info.schema', {
                 url: '/schema',
                 views: {
diff --git a/frontend/app/scripts/views/index.html 
b/frontend/app/scripts/views/index.html
index eae18ad3..d3cba18e 100644
--- a/frontend/app/scripts/views/index.html
+++ b/frontend/app/scripts/views/index.html
@@ -57,7 +57,7 @@
         <li>
             <a ui-sref="sc.allServices" ui-sref-active="active" 
ng-class="[{active: $state.current.name === 'sc.info.instance'},
             {activeProvider: $state.current.name === 'sc.info.provider'}, 
{activeConsumer: $state.current.name === 'sc.info.consumer'},
-            {schemaTab: $state.current.name === 'sc.info.schema'}]"><i 
class="fa fa-cog" aria-hidden="true"></i> {{ "services" | translate }}</a>
+            {schemaTab: $state.current.name === 
'sc.info.schema'},{activeProperties: $state.current.name === 
'sc.info.properties'}]"><i class="fa fa-cog" aria-hidden="true"></i> {{ 
"services" | translate }}</a>
         </li>
         <li>
             <a ui-sref="sc.instances" ui-sref-active="active"><i class="fa 
fa-cogs" aria-hidden="true"></i> {{ "instances" | translate }}</a>
diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css
index 49c86613..f441a685 100644
--- a/frontend/app/styles/main.css
+++ b/frontend/app/styles/main.css
@@ -105,7 +105,7 @@ body {
             color: black !important;
             background: #efefef;
             width:230px;}
-      body .sidebar-wrapper .sidebar-nav .active, body .sidebar-wrapper 
.sidebar-nav .activeProvider, body .sidebar-wrapper .sidebar-nav 
.activeConsumer, body .sidebar-wrapper .sidebar-nav .schemaTab{
+      body .sidebar-wrapper .sidebar-nav .active, body .sidebar-wrapper 
.sidebar-nav .activeProperties, body .sidebar-wrapper .sidebar-nav 
.activeProvider, body .sidebar-wrapper .sidebar-nav .activeConsumer, body 
.sidebar-wrapper .sidebar-nav .schemaTab{
         text-decoration: none;
         color: #000 !important;
         border-left: 3px solid #3c8dbc;


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to