From f4a56efec24d8ecfc0c6f3c025f658017f7ca1d0 Mon Sep 17 00:00:00 2001 From: zwangsheng <2213335496@qq.com> Date: Thu, 20 Apr 2023 17:57:22 +0800 Subject: [PATCH] [KYUUBI #3652][UI] Add Kyuubi Server Management page ### _Why are the changes needed?_ Close #3652 Add Kyuubi Server Management page ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request ![popo_2023-04-18 14-41-43](https://user-images.githubusercontent.com/52876270/232692881-4f1228df-ccc7-4cfb-8dfb-33ff00f3a194.jpg) Closes #4726 from zwangsheng/KYUUBI_3652. Closes #3652 702bb5505 [zwangsheng] remvoe usless code 15f8214f2 [zwangsheng] [KYUUBI #3652][UI] Add Kyuubi Server Manangement page Authored-by: zwangsheng <2213335496@qq.com> Signed-off-by: Cheng Pan --- kyuubi-server/web-ui/src/api/server/index.ts | 25 +++++++++ .../web-ui/src/locales/en_US/index.ts | 1 + .../web-ui/src/locales/zh_CN/index.ts | 3 +- kyuubi-server/web-ui/src/router/index.ts | 2 + .../web-ui/src/router/server/index.ts | 26 ++++++++++ .../views/layout/components/aside/types.ts | 10 ++++ .../views/server/server-statistics/index.vue | 52 +++++++++++++++++++ 7 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 kyuubi-server/web-ui/src/api/server/index.ts create mode 100644 kyuubi-server/web-ui/src/router/server/index.ts create mode 100644 kyuubi-server/web-ui/src/views/server/server-statistics/index.vue diff --git a/kyuubi-server/web-ui/src/api/server/index.ts b/kyuubi-server/web-ui/src/api/server/index.ts new file mode 100644 index 000000000..e2d74d7db --- /dev/null +++ b/kyuubi-server/web-ui/src/api/server/index.ts @@ -0,0 +1,25 @@ +/* + * 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 '@/utils/request' + +export function getAllServer() { + return request({ + url: 'api/v1/admin/server', + method: 'get' + }) +} diff --git a/kyuubi-server/web-ui/src/locales/en_US/index.ts b/kyuubi-server/web-ui/src/locales/en_US/index.ts index dc1986939..0501078d0 100644 --- a/kyuubi-server/web-ui/src/locales/en_US/index.ts +++ b/kyuubi-server/web-ui/src/locales/en_US/index.ts @@ -19,6 +19,7 @@ export default { test: 'test', user: 'User', client_ip: 'Client IP', + server_ip: 'Server IP', kyuubi_instance: 'Kyuubi Instance', session_id: 'Session ID', operation_id: 'Operation ID', diff --git a/kyuubi-server/web-ui/src/locales/zh_CN/index.ts b/kyuubi-server/web-ui/src/locales/zh_CN/index.ts index 87b15cc4d..0e7521794 100644 --- a/kyuubi-server/web-ui/src/locales/zh_CN/index.ts +++ b/kyuubi-server/web-ui/src/locales/zh_CN/index.ts @@ -19,7 +19,8 @@ export default { test: '测试', user: '用户', client_ip: '客户端地址', - kyuubi_instance: '服务端地址', + server_ip: '服务端地址', + kyuubi_instance: '服务端实例', session_id: 'Session ID', operation_id: 'Operation ID', create_time: '创建时间', diff --git a/kyuubi-server/web-ui/src/router/index.ts b/kyuubi-server/web-ui/src/router/index.ts index 241cdf506..ce9960ba6 100644 --- a/kyuubi-server/web-ui/src/router/index.ts +++ b/kyuubi-server/web-ui/src/router/index.ts @@ -22,6 +22,7 @@ import operationRoutes from './operation' import contactRoutes from './contact' import sessionRoutes from './session' import engineRoutes from './engine' +import serverRoutes from './server' const routes = [ { @@ -42,6 +43,7 @@ const routes = [ ...workloadRoutes, ...operationRoutes, ...engineRoutes, + ...serverRoutes, ...contactRoutes ] } diff --git a/kyuubi-server/web-ui/src/router/server/index.ts b/kyuubi-server/web-ui/src/router/server/index.ts new file mode 100644 index 000000000..c06240485 --- /dev/null +++ b/kyuubi-server/web-ui/src/router/server/index.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. + */ + +const router = [ + { + path: '/server/server-statistics', + name: 'server-statistics', + component: () => import('@/views/server/server-statistics/index.vue') + } +] + +export default router diff --git a/kyuubi-server/web-ui/src/views/layout/components/aside/types.ts b/kyuubi-server/web-ui/src/views/layout/components/aside/types.ts index 72b150fa8..46ea825a9 100644 --- a/kyuubi-server/web-ui/src/views/layout/components/aside/types.ts +++ b/kyuubi-server/web-ui/src/views/layout/components/aside/types.ts @@ -41,6 +41,16 @@ export const MENUS = [ } ] }, + { + label: 'Server Management', + icon: 'List', + children: [ + { + label: 'Server Statistics', + router: '/server/server-statistics' + } + ] + }, { label: 'Workload', icon: 'List', diff --git a/kyuubi-server/web-ui/src/views/server/server-statistics/index.vue b/kyuubi-server/web-ui/src/views/server/server-statistics/index.vue new file mode 100644 index 000000000..266c833d7 --- /dev/null +++ b/kyuubi-server/web-ui/src/views/server/server-statistics/index.vue @@ -0,0 +1,52 @@ + + + + + +