Skip to content

Commit 9912b85

Browse files
feat: user login
1 parent 75f75f0 commit 9912b85

File tree

9 files changed

+49
-351
lines changed

9 files changed

+49
-351
lines changed
18 KB
Loading

ui/src/components/ai-chat/KnowledgeSource.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="chat-knowledge-source">
3-
<div class="flex align-center mt-16" v-if="!isWorkFlow(props.type)">
3+
<div class="flex align-center mt-16">
44
<span class="mr-4 color-secondary">{{ $t('chat.KnowledgeSource.title') }}</span>
55
<el-divider direction="vertical" />
66
<el-button type="primary" class="mr-8" link @click="openParagraph(data)">
@@ -9,7 +9,7 @@
99
{{ data.paragraph_list?.length || 0 }}</el-button
1010
>
1111
</div>
12-
<div class="mt-8" v-if="!isWorkFlow(props.type)">
12+
<div class="mt-8">
1313
<el-row :gutter="8" v-if="uniqueParagraphList?.length">
1414
<template v-for="(item, index) in uniqueParagraphList" :key="index">
1515
<el-col :span="12" class="mb-8">
@@ -51,11 +51,10 @@
5151
>
5252
</div>
5353
<el-button
54-
v-if="isWorkFlow(props.type)"
5554
type="primary"
5655
link
5756
@click="openExecutionDetail(data.execution_details)"
58-
style="padding: 0;"
57+
style="padding: 0"
5958
>
6059
<el-icon class="mr-4"><Document /></el-icon>
6160
{{ $t('chat.executionDetails.title') }}</el-button
@@ -76,16 +75,16 @@ import { getImgUrl, getNormalizedUrl } from '@/utils/utils'
7675
const props = defineProps({
7776
data: {
7877
type: Object,
79-
default: () => {}
78+
default: () => {},
8079
},
8180
type: {
8281
type: String,
83-
default: ''
82+
default: '',
8483
},
8584
executionIsRightPanel: {
8685
type: Boolean,
8786
required: false,
88-
}
87+
},
8988
})
9089
9190
const emit = defineEmits(['openExecutionDetail', 'openParagraph'])
@@ -100,7 +99,7 @@ function openParagraph(row: any, id?: string) {
10099
ParagraphSourceDialogRef.value.open(row, id)
101100
}
102101
function openExecutionDetail(row: any) {
103-
if(props.executionIsRightPanel){
102+
if (props.executionIsRightPanel) {
104103
emit('openExecutionDetail')
105104
return
106105
}

ui/src/layout/login-layout/LoginContainer.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<div class="login-form-container">
33
<div class="login-title">
44
<div class="logo text-center">
5-
<LogoFull height="45px" />
5+
<slot name="logo">
6+
<LogoFull height="45px" />
7+
</slot>
68
</div>
79
<div class="sub-title text-center" v-if="subTitle">
810
<el-text type="info">{{ subTitle }}</el-text>
@@ -16,7 +18,7 @@
1618
<script setup lang="ts">
1719
defineProps({
1820
title: String,
19-
subTitle: String
21+
subTitle: String,
2022
})
2123
</script>
2224
<style lang="scss" scoped>
@@ -30,7 +32,6 @@ defineProps({
3032
}
3133
}
3234
.login-card {
33-
border-radius: 8px;
3435
padding: 18px;
3536
}
3637
}

ui/src/layout/login-layout/UserLoginLayout.vue

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,10 @@
77
</div>
88
</div>
99
</template>
10-
<script setup lang="ts">
11-
import { computed } from 'vue'
12-
import { getThemeImg } from '@/utils/theme'
13-
import useStore from '@/stores'
14-
import { useLocalStorage } from '@vueuse/core'
15-
import { langList, localeConfigKey, getBrowserLang } from '@/locales/index'
16-
defineProps({
17-
lang: {
18-
type: Boolean,
19-
default: true,
20-
},
21-
})
22-
const { user, theme } = useStore()
23-
24-
const changeLang = (lang: string) => {
25-
useLocalStorage(localeConfigKey, getBrowserLang()).value = lang
26-
window.location.reload()
27-
}
28-
29-
const currentLanguage = computed(() => {
30-
return langList.value?.filter((v: any) => v.value === user.getLanguage())?.[0]?.label
31-
})
32-
33-
const fileURL = computed(() => {
34-
if (theme.themeInfo?.loginImage) {
35-
if (typeof theme.themeInfo?.loginImage === 'string') {
36-
return theme.themeInfo?.loginImage
37-
} else {
38-
return URL.createObjectURL(theme.themeInfo?.loginImage)
39-
}
40-
} else {
41-
return ''
42-
}
43-
})
44-
45-
const loginImage = computed(() => {
46-
if (theme.themeInfo?.loginImage) {
47-
return `${fileURL.value}`
48-
} else {
49-
const imgName = getThemeImg(theme.themeInfo?.theme)
50-
const imgPath = `${window.MaxKB.prefix}/theme/${imgName}.jpg`
51-
const imageUrl = new URL(imgPath, import.meta.url).href
52-
return imageUrl
53-
}
54-
})
55-
</script>
10+
<script setup lang="ts"></script>
5611
<style lang="scss" scoped>
5712
.login-warp {
5813
height: 100vh;
14+
background: url('@/assets/chat/user-login-bg.jpg') no-repeat center;
5915
}
6016
</style>

ui/src/views/chat/pc/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
<AppIcon
231231
v-if="paginationConfig.total"
232232
iconName="app-chat-record"
233-
class="info mr-8"
233+
class="color-secondary mr-8"
234234
style="font-size: 16px"
235235
></AppIcon>
236236
<span v-if="paginationConfig.total" class="lighter">

ui/src/views/chat/user-login/ForgotPassword.vue

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)