Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ui/src/conversation-panel/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
width: 50px;
}

/* 对话正文:消息列表与底部输入区共用宽度和居中布局。 */
.mk-conversation-content {
margin-inline: auto;
max-width: 800px;
width: 100%;
}

/* 对话左右两侧 */
.mk-conversation-side-panel {
/* 固定侧栏内容宽度,避免展开和收起时内容变形。 */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { computed, inject, ref, type InjectionKey, type Ref } from 'vue'
import { v4 as uuidv4 } from 'uuid'
import { v7 as uuidv7 } from 'uuid'
import type { Conversation, ConversationAccount, ConversationAppInfo } from '../../core/types'

// 由 Chat / Debug 入口注入本组件需要的会话接口。
Expand Down Expand Up @@ -62,7 +62,7 @@ export function createConversationListStore(deps: ConversationListDeps) {
// 仅在需要时生成会话 ID,保证上传文件的 source_id 与发送消息使用同一 ID。
const getChatId = () => {
if (currentChatId.value) return currentChatId.value
currentChatId.value = uuidv4()
currentChatId.value = uuidv7()
return currentChatId.value
}

Expand Down
8 changes: 2 additions & 6 deletions ui/src/conversation-panel/main/chat-panel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ const handleDrop = (e: DragEvent) => input.addFiles(e.dataTransfer?.files)
<main class="mk-conversation-main" @drop.prevent="handleDrop" @dragover.prevent>
<!-- 头部可被替换(如 debug 用 debug header);默认普通 chat header -->
<slot name="header"><ChatHeader :shareable="shareable" @share="emit('share')" /></slot>
<MessageList :key="list.currentChatId.value" :app-name="list.appInfo.value?.name || 'AI 助手'" >
<template #welcome>
<MessageList :key="list.currentChatId.value" :app-name="list.appInfo.value?.name || 'AI 助手'" class="mk-conversation-content"></MessageList>

</template>
</MessageList>

<footer class="flex-center shrink-0 p-4"><MessageInput /></footer>
<footer class="mk-conversation-content flex-center shrink-0 p-4"><MessageInput /></footer>
</main>
</template>
3 changes: 3 additions & 0 deletions ui/src/styles/STYLE_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ Element Plus 覆盖、主题变量和应用样式。Chat 入口还显式引入 E
当前 `overflow: hidden` 已允许面板在 Flex 主轴上收缩,无需重复设置 `min-width: 0`;
也不额外设置 `min-height: 0`、`height: 100%` 或 `max-height: 100%`,消息列表负责内部滚动。

消息列表与底部输入区可共用 `mk-conversation-content`,在对话模块公共样式中统一设置
宽度 100%、最大宽度 800px 和水平居中。

用户提问容器使用 `mk-conversation-question-content`,在对话模块公共样式中控制靠右、
随内容收缩及最大 85% 宽度。文字气泡使用 `mk-gray-card-lg`,换行规则在模板中组合工具类。
提问附件参考输入区的卡片外观,通过 Flex 按容器宽度自动换行并靠右排列;已发送附件不展示
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/chat/login/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute, useRouter, type RouteLocationRaw } from 'vue-router'
import { v4 as uuidv4 } from 'uuid'
import { v7 as uuidv7 } from 'uuid'
import ChatAuthApi from '@/api/chat/auth'
import { CHAT_API_BASE_PATH } from '@/api/constants'
import { LOGIN_METHOD } from '@/api/enums'
Expand Down Expand Up @@ -65,7 +65,7 @@ const getExternalLoginUrl = (authType: LoginMethod): Promise<string> => {
// OAuth2 通过 state 透传 accessToken
if (!config.authEndpoint || !config.clientId) return ''
const redirectUrl = `${config.redirectUrl}${queryString ? `&${queryString}` : ''}`
const state = accessToken ? `${uuidv4()}_${accessToken}` : uuidv4()
const state = accessToken ? `${uuidv7()}_${accessToken}` : uuidv7()
let url = `${config.authEndpoint}?client_id=${config.clientId}&response_type=code&redirect_uri=${redirectUrl}&state=${state}`
if (config.scope) url += `&scope=${config.scope}`
return url
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/login/admin-login-service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Admin 登录页与外观设置登录预览使用的登录服务,对接 Admin 认证接口与 Store。 */

import { useRouter } from 'vue-router'
import { v4 as uuidv4 } from 'uuid'
import { v7 as uuidv7 } from 'uuid'
import ExternalLoginApi from '@/api/admin/auth/external-login'
import LoginApi from '@/api/admin/auth/login'
import { ADMIN_API_BASE_PATH } from '@/api/constants'
Expand Down Expand Up @@ -31,7 +31,7 @@ const getExternalLoginUrl = (authType: LoginMethod): Promise<string> => {
}
if (authType === LOGIN_METHOD.OAUTH2) {
if (!config.authEndpoint || !config.clientId) return ''
let url = `${config.authEndpoint}?client_id=${config.clientId}&response_type=code&redirect_uri=${redirectUrl}&state=${uuidv4()}`
let url = `${config.authEndpoint}?client_id=${config.clientId}&response_type=code&redirect_uri=${redirectUrl}&state=${uuidv7()}`
if (config.scope) url += `&scope=${config.scope}`
return url
}
Expand Down
8 changes: 4 additions & 4 deletions ui/src/views/trigger/trigger-form/TriggerFormDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import WorkflowApi from '@/api/admin/workspace/tool/workflow'
import RequestParameters from './request-parameters/RequestParametersTable.vue'
import { copyText } from '@/utils/clipboard'
import { MsgSuccess } from '@/utils/message'
import { v4 as uuidv4 } from 'uuid'
import { v7 as uuidv7 } from 'uuid'

const props = withDefaults(
defineProps<{
Expand All @@ -43,7 +43,7 @@ const resources = ref<Record<string, Partial<ApplicationDetail & ToolItem>>>({})

function createDefaultForm(): TriggerPayload {
return {
id: uuidv4(),
id: uuidv7(),
name: '',
desc: '',
trigger_type: TRIGGER_TYPE.SCHEDULED,
Expand All @@ -54,7 +54,7 @@ function createDefaultForm(): TriggerPayload {
days: [1],
interval_unit: 'minutes',
interval_value: 1,
token: uuidv4().replaceAll('-', ''),
token: uuidv7().replaceAll('-', ''),
body: [],
},
}
Expand Down Expand Up @@ -200,7 +200,7 @@ function handleSelectTriggerType(type: TriggerPayload['trigger_type']) {
formRef.value?.clearValidate('trigger_setting')
}
function handleRefreshToken() {
form.value.trigger_setting.token = uuidv4().replaceAll('-', '')
form.value.trigger_setting.token = uuidv7().replaceAll('-', '')
}

const rules: FormRules<TriggerPayload> = {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/workflow/tool/debug/ResultDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onBeforeUnmount, provide, ref } from 'vue'
import { cloneDeep } from 'lodash'
import { v4 as uuidv4 } from 'uuid'
import { v7 as uuidv7 } from 'uuid'
import WorkflowApi from '@/api/admin/workspace/tool/workflow'
import type { ToolExecutionRecordDetail } from '@/api/types'
import { MsgError } from '@/utils/message'
Expand Down Expand Up @@ -101,7 +101,7 @@ function open(parameters: Record<string, unknown>) {
blocks.value = []
record.value = undefined
inputParameters = cloneDeep(parameters)
recordId = uuidv4()
recordId = uuidv7()
activeTab.value = 'output'
visible.value = true
return execute()
Expand Down
Loading