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