diff --git a/ui-vue3/src/api/mock/mockService.ts b/ui-vue3/src/api/mock/mockService.ts new file mode 100644 index 000000000..f5e975eb6 --- /dev/null +++ b/ui-vue3/src/api/mock/mockService.ts @@ -0,0 +1,86 @@ +/* + * 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. + */ + +import Mock from 'mockjs' + +Mock.mock('/mock/service/search', 'get', { + code: 200, + message: 'success', + data: { + total: 8, + curPage: 1, + pageSize: 1, + data: [ + { + serviceName: 'org.apache.dubbo.samples.UserService', + interfaceNum: 4, + avgQPS: 6, + avgRT: '194ms', + requestTotal: 200 + }, + { + serviceName: 'org.apache.dubbo.samples.OrderService', + interfaceNum: 12, + avgQPS: 13, + avgRT: '189ms', + requestTotal: 164 + }, + { + serviceName: 'org.apache.dubbo.samples.DetailService', + interfaceNum: 14, + avgQPS: 0.5, + avgRT: '268ms', + requestTotal: 1324 + }, + { + serviceName: 'org.apache.dubbo.samples.PayService', + interfaceNum: 8, + avgQPS: 9, + avgRT: '346ms', + requestTotal: 189 + }, + { + serviceName: 'org.apache.dubbo.samples.CommentService', + interfaceNum: 9, + avgQPS: 8, + avgRT: '936ms', + requestTotal: 200 + }, + { + serviceName: 'org.apache.dubbo.samples.RepayService', + interfaceNum: 16, + avgQPS: 17, + avgRT: '240ms', + requestTotal: 146 + }, + { + serviceName: 'org.apche.dubbo.samples.TransportService', + interfaceNum: 5, + avgQPS: 43, + avgRT: '89ms', + requestTotal: 367 + }, + { + serviceName: 'org.apche.dubbo.samples.DistributionService', + interfaceNum: 5, + avgQPS: 4, + avgRT: '78ms', + requestTotal: 145 + } + ] + } +}) diff --git a/ui-vue3/src/api/service/service.ts b/ui-vue3/src/api/service/service.ts new file mode 100644 index 000000000..225f86ec2 --- /dev/null +++ b/ui-vue3/src/api/service/service.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +import request from '@/base/http/request' + +export const searchService = (params: any): Promise => { + return request({ + url: '/service/search', + method: 'get', + params + }) +} diff --git a/ui-vue3/src/base/i18n/en.ts b/ui-vue3/src/base/i18n/en.ts index 5cd220d50..d1c1a9e01 100644 --- a/ui-vue3/src/base/i18n/en.ts +++ b/ui-vue3/src/base/i18n/en.ts @@ -274,7 +274,17 @@ const words: I18nType = { }, backHome: 'Back Home', noPageTip: 'Sorry, the page you visited does not exist.', - globalSearchTip: 'Search ip, application, instance, service' + globalSearchTip: 'Search ip, application, instance, service', + + details: 'Details', + debug: 'Debug', + distribution: 'Distribution', + monitor: 'Monitor', + tracing: 'Tracing', + event: 'Event', + + provideService: 'Provide Service', + dependentService: 'Dependent Service' } export default words diff --git a/ui-vue3/src/base/i18n/zh.ts b/ui-vue3/src/base/i18n/zh.ts index 37ae274a5..f154284f8 100644 --- a/ui-vue3/src/base/i18n/zh.ts +++ b/ui-vue3/src/base/i18n/zh.ts @@ -272,8 +272,17 @@ const words: I18nType = { }, backHome: '回到首页', noPageTip: '抱歉,你访问的页面不存在', + globalSearchTip: '搜索ip,应用,实例,服务', - globalSearchTip: '搜索ip,应用,实例,服务' + details: '详情', + debug: '调试', + distribution: '分布', + monitor: '监控', + tracing: '链路追踪', + event: '事件', + + provideService: '提供服务', + dependentService: '依赖服务' } export default words diff --git a/ui-vue3/src/router/defaultRoutes.ts b/ui-vue3/src/router/defaultRoutes.ts index a23635391..1cb640a57 100644 --- a/ui-vue3/src/router/defaultRoutes.ts +++ b/ui-vue3/src/router/defaultRoutes.ts @@ -97,8 +97,69 @@ export const routes: Readonly = [ { path: '/services', name: 'services', + redirect: 'search', component: () => import('../views/resources/services/index.vue'), - meta: {} + meta: { + tab_parent: true + }, + children: [ + { + path: '/search', + name: 'search', + component: () => import('../views/resources/services/search.vue'), + meta: { + hidden: true + } + }, + { + path: '/detail/:serviceName', + name: 'detail', + component: () => import('../views/resources/services/tabs/detail.vue'), + meta: { + tab: true + } + }, + { + path: '/debug/:serviceName', + name: 'debug', + component: () => import('../views/resources/services/tabs/debug.vue'), + meta: { + tab: true + } + }, + { + path: '/distribution/:serviceName', + name: 'distribution', + component: () => import('../views/resources/services/tabs/distribution.vue'), + meta: { + tab: true + } + }, + { + path: '/monitor/:serviceName', + name: 'monitor', + component: () => import('../views/resources/services/tabs/monitor.vue'), + meta: { + tab: true + } + }, + { + path: '/tracing/:serviceName', + name: 'tracing', + component: () => import('../views/resources/services/tabs/tracing.vue'), + meta: { + tab: true + } + }, + { + path: '/event/:serviceName', + name: 'event', + component: () => import('../views/resources/services/tabs/event.vue'), + meta: { + tab: true + } + } + ] } ] }, diff --git a/ui-vue3/src/views/resources/services/index.vue b/ui-vue3/src/views/resources/services/index.vue index d7a299942..2764e2a15 100644 --- a/ui-vue3/src/views/resources/services/index.vue +++ b/ui-vue3/src/views/resources/services/index.vue @@ -15,8 +15,33 @@ ~ limitations under the License. --> - - + + diff --git a/ui-vue3/src/views/resources/services/search.vue b/ui-vue3/src/views/resources/services/search.vue new file mode 100644 index 000000000..9d36ebfa1 --- /dev/null +++ b/ui-vue3/src/views/resources/services/search.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/ui-vue3/src/views/resources/services/tabs/debug.vue b/ui-vue3/src/views/resources/services/tabs/debug.vue new file mode 100644 index 000000000..553507491 --- /dev/null +++ b/ui-vue3/src/views/resources/services/tabs/debug.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/ui-vue3/src/views/resources/services/tabs/detail.vue b/ui-vue3/src/views/resources/services/tabs/detail.vue new file mode 100644 index 000000000..1a260631e --- /dev/null +++ b/ui-vue3/src/views/resources/services/tabs/detail.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/ui-vue3/src/views/resources/services/tabs/distribution.vue b/ui-vue3/src/views/resources/services/tabs/distribution.vue new file mode 100644 index 000000000..9a402e689 --- /dev/null +++ b/ui-vue3/src/views/resources/services/tabs/distribution.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/ui-vue3/src/views/service/index.vue b/ui-vue3/src/views/resources/services/tabs/event.vue similarity index 79% rename from ui-vue3/src/views/service/index.vue rename to ui-vue3/src/views/resources/services/tabs/event.vue index c97d82189..d9a86c051 100644 --- a/ui-vue3/src/views/service/index.vue +++ b/ui-vue3/src/views/resources/services/tabs/event.vue @@ -15,15 +15,8 @@ ~ limitations under the License. --> - + diff --git a/ui-vue3/src/views/resources/services/tabs/monitor.vue b/ui-vue3/src/views/resources/services/tabs/monitor.vue new file mode 100644 index 000000000..baa40c4ab --- /dev/null +++ b/ui-vue3/src/views/resources/services/tabs/monitor.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/ui-vue3/src/views/resources/services/tabs/tracing.vue b/ui-vue3/src/views/resources/services/tabs/tracing.vue new file mode 100644 index 000000000..ca3bc5119 --- /dev/null +++ b/ui-vue3/src/views/resources/services/tabs/tracing.vue @@ -0,0 +1,22 @@ + + + + +