mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-24 20:47:17 +00:00
perf: 兼容luna显示智能问答
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
if(pathname.indexOf('/ui') === -1) {
|
||||
window.location.href = window.location.origin + '/ui/#' + pathname
|
||||
}
|
||||
if (pathname.startsWith('/ui/#/chat')) {
|
||||
window.location.href = window.location.origin + pathname
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id="app"></div>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="close-sidebar">
|
||||
<i class="el-icon-close" @click="onClose" />
|
||||
<i v-if="hasClose" class="el-icon-close" @click="onClose" />
|
||||
</div>
|
||||
<el-tabs v-model="active" :tab-position="'right'" @tab-click="handleClick">
|
||||
<el-tab-pane v-for="(item) in submenu" :key="item.name" :name="item.name">
|
||||
@@ -22,6 +22,10 @@ export default {
|
||||
type: String,
|
||||
default: 'chat'
|
||||
},
|
||||
hasClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
submenu: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
@@ -48,9 +52,10 @@ export default {
|
||||
height: 100%;
|
||||
background-color: #f0f1f5;
|
||||
.close-sidebar {
|
||||
height: 48px;
|
||||
padding: 12px 0;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
padding: 12px 0;
|
||||
cursor: pointer;
|
||||
i {
|
||||
font-size: 16px;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<Sidebar :active.sync="active" :submenu="submenu" />
|
||||
<Sidebar v-bind="$attrs" :active.sync="active" :submenu="submenu" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -62,11 +62,14 @@ export default {
|
||||
watch: {
|
||||
drawerPanelVisible(value) {
|
||||
if (value && !ws) {
|
||||
this.$refs.component?.init()
|
||||
this.initWebSocket()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initWebSocket() {
|
||||
this.$refs.component?.init()
|
||||
},
|
||||
onClose() {
|
||||
this.$parent.show = false
|
||||
},
|
||||
|
@@ -30,6 +30,16 @@ export default [
|
||||
component: () => import('@/views/settings/Task/CeleryTaskLog'),
|
||||
name: 'TaskLog',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('setting.ChatAI'),
|
||||
permissions: []
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/chat/chat-ai/',
|
||||
component: () => import('@/views/chat/ChatAi'),
|
||||
name: 'ChatAi',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('route.CeleryTaskLog'),
|
||||
permissions: []
|
||||
|
29
src/views/chat/ChatAi/index.vue
Normal file
29
src/views/chat/ChatAi/index.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div class="chat-container">
|
||||
<ChatAi ref="chat" :drawer-panel-visible="true" :has-close="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ChatAi from '@/components/Apps/ChatAi'
|
||||
export default {
|
||||
components: {
|
||||
ChatAi
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.chat.initWebSocket()
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chat-container {
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user