Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add id param to document/_bach endpoint #1551

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion ui/src/api/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ const getChatOpen: (application_id: String) => Promise<Result<any>> = (applicati
* data
*/
const postChatMessage: (chat_id: string, data: any) => Promise<any> = (chat_id, data) => {
return postStream(`/api${prefix}/chat_message/${chat_id}`, data)
const server=import.meta.env.VITE_API_BASE_URL || '/api';
return postStream(`${server}${prefix}/chat_message/${chat_id}`, data)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ui/src/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import router from '@/router'
import { ref, type WritableComputedRef } from 'vue'

const axiosConfig = {
baseURL: '/api',
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
withCredentials: false,
timeout: 600000,
headers: {}
Expand Down
13 changes: 7 additions & 6 deletions ui/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { hasPermission } from '@/utils/permission/index'
import {hasPermission} from '@/utils/permission/index'
import {
createRouter,
createWebHistory,
createWebHashHistory,
type NavigationGuardNext,
type RouteLocationNormalized,
type RouteRecordRaw,
type RouteRecordName
type RouteRecordName,
type RouteRecordRaw
} from 'vue-router'
import useStore from '@/stores'
import { routes } from '@/router/routes'
import {routes} from '@/router/routes'

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: routes
})

Expand Down
4 changes: 4 additions & 0 deletions ui/src/utils/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ export function isAppIcon(url: string | undefined) {
export function isWorkFlow(type: string | undefined) {
return type === 'WORK_FLOW'
}

export function isDepartment(type: string | undefined) {
return type === 'DEPARTMENT'
}
5 changes: 4 additions & 1 deletion ui/src/views/application-workflow/component/DropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
<el-tag type="warning" v-if="isWorkFlow(item.type)" style="height: 22px"
>高级编排</el-tag
>
<el-tag type="warning" v-else-if="isDepartment(item.type)" style="height: 22px"
>部门机构</el-tag
>
<el-tag class="blue-tag" v-else style="height: 22px">简单配置</el-tag>
</div>
</div>
Expand All @@ -97,7 +100,7 @@ import { ref, onMounted, computed } from 'vue'
import { menuNodes, functionLibNode, functionNode, applicationNode } from '@/workflow/common/data'
import { iconComponent } from '@/workflow/icons/utils'
import applicationApi from '@/api/application'
import { isWorkFlow } from '@/utils/application'
import {isDepartment, isWorkFlow} from '@/utils/application'
const search_text = ref<string>('')
const props = defineProps({
show: {
Expand Down
12 changes: 12 additions & 0 deletions ui/src/views/application/component/CreateApplicationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@
</el-radio>
</el-card>
</el-col>
<el-col :span="12">
<el-card
shadow="never"
class="mb-16"
:class="isWorkFlow(applicationForm.type) ? 'active' : ''"
>
<el-radio value="DEPARTMENT" size="large">
<p class="mb-4">部门机构</p>
<el-text type="info">适合特定的知识领域场景</el-text>
</el-radio>
</el-card>
</el-col>
</el-row>
</el-radio-group>
</el-form-item>
Expand Down
7 changes: 3 additions & 4 deletions ui/src/views/application/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@
</el-text>
</template>
<div class="status-tag">
<el-tag type="warning" v-if="isWorkFlow(item.type)" style="height: 22px"
>高级编排</el-tag
>
<el-tag type="warning" v-if="isWorkFlow(item.type)" style="height: 22px">高级编排</el-tag>
<el-tag type="warning" v-if="isDepartment(item.type)" style="height: 22px">部门机构</el-tag>
<el-tag class="blue-tag" v-else style="height: 22px">简单配置</el-tag>
</div>

Expand Down Expand Up @@ -153,7 +152,7 @@ import applicationApi from '@/api/application'
import CreateApplicationDialog from './component/CreateApplicationDialog.vue'
import CopyApplicationDialog from './component/CopyApplicationDialog.vue'
import { MsgSuccess, MsgConfirm, MsgAlert } from '@/utils/message'
import { isAppIcon } from '@/utils/application'
import {isAppIcon, isDepartment} from '@/utils/application'
import { useRouter } from 'vue-router'
import { isWorkFlow } from '@/utils/application'
import { ValidType, ValidCount } from '@/enums/common'
Expand Down
1 change: 1 addition & 0 deletions ui/src/views/dataset/UploadDocumentDataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function submit() {
})
}
documents.push({
id: item.id,
name: item.name,
paragraphs: item.content
})
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/hit-test/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ const paragraphDetail = ref<any[]>([])
const title = ref('')
const inputValue = ref('')
const formInline = ref({
similarity: 0.6,
top_number: 5,
similarity: 0.0,
top_number: 10,
search_mode: 'embedding'
})

Expand Down
3 changes: 3 additions & 0 deletions ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import DefineOptions from 'unplugin-vue-define-options/vite'
const envDir = './env'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
console.log('Current Mode:', mode);
console.log('Loading Environment Variables from:', process.cwd());
const ENV = loadEnv(mode, envDir)
console.log('Loaded ENV:', ENV);
const prefix = process.env.VITE_DYNAMIC_PREFIX || ENV.VITE_BASE_PATH;
const proxyConf: Record<string, string | ProxyOptions> = {}
proxyConf['/api'] = {
Expand Down
Loading