[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 <chengpan@apache.org>
This commit is contained in:
zwangsheng 2023-04-20 17:57:22 +08:00 committed by Cheng Pan
parent b4d67e4837
commit f4a56efec2
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D
7 changed files with 118 additions and 1 deletions

View File

@ -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'
})
}

View File

@ -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',

View File

@ -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: '创建时间',

View File

@ -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
]
}

View File

@ -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

View File

@ -41,6 +41,16 @@ export const MENUS = [
}
]
},
{
label: 'Server Management',
icon: 'List',
children: [
{
label: 'Server Statistics',
router: '/server/server-statistics'
}
]
},
{
label: 'Workload',
icon: 'List',

View File

@ -0,0 +1,52 @@
<!--
* 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.
-->
<template>
<el-card class="table-container">
<el-table v-loading="loading" :data="tableData" style="width: 100%">
<el-table-column prop="host" :label="$t('server_ip')" min-width="20%" />
<el-table-column
prop="namespace"
:label="$t('namespace')"
min-width="20%" />
<el-table-column
prop="instance"
:label="$t('kyuubi_instance')"
min-width="20%" />
<el-table-column prop="attributes.version" :label="$t('version')" />
<el-table-column prop="status" :label="$t('state')" min-width="20%" />
</el-table>
</el-card>
</template>
<script lang="ts" setup>
import { getAllServer } from '@/api/server'
import { useTable } from '@/views/common/use-table'
const { tableData, loading, getList: _getList } = useTable()
const getList = () => {
_getList(getAllServer)
}
getList()
</script>
<style scoped lang="scss">
header {
display: flex;
justify-content: flex-end;
}
</style>