fix: 增加请求超时时间并优化团队管理页面逻辑 (#49)
- 将axios请求超时时间从5000ms增加到50000ms,以应对网络不稳定的情况 - 在团队管理页面中,添加计算属性过滤可添加的用户,并优化用户选择框的显示逻辑 - 移除docker-compose文件中不必要的构建配置,简化部署流程
This commit is contained in:
parent
35bb70cee9
commit
45bd222176
|
@ -35,37 +35,6 @@ services:
|
|||
- ragflow
|
||||
restart: on-failure
|
||||
|
||||
infinity:
|
||||
container_name: ragflow-infinity
|
||||
profiles:
|
||||
- infinity
|
||||
image: infiniflow/infinity:v0.6.0-dev3
|
||||
volumes:
|
||||
- infinity_data:/var/infinity
|
||||
- ./infinity_conf.toml:/infinity_conf.toml
|
||||
command: ["-f", "/infinity_conf.toml"]
|
||||
ports:
|
||||
- ${INFINITY_THRIFT_PORT}:23817
|
||||
- ${INFINITY_HTTP_PORT}:23820
|
||||
- ${INFINITY_PSQL_PORT}:5432
|
||||
env_file: .env
|
||||
environment:
|
||||
- TZ=${TIMEZONE}
|
||||
mem_limit: ${MEM_LIMIT}
|
||||
ulimits:
|
||||
nofile:
|
||||
soft: 500000
|
||||
hard: 500000
|
||||
networks:
|
||||
- ragflow
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "http://localhost:23820/admin/node/current"]
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 120
|
||||
restart: on-failure
|
||||
|
||||
|
||||
mysql:
|
||||
# mysql:5.7 linux/arm64 image is unavailable.
|
||||
image: mysql:8.0.39
|
||||
|
|
|
@ -32,10 +32,6 @@ services:
|
|||
management-frontend:
|
||||
container_name: ragflowplus-management-frontend
|
||||
image: zstar1003/ragflowplus-management-web:v0.2.0
|
||||
# build:
|
||||
# context: .
|
||||
# dockerfile: Dockerfile
|
||||
# target: frontend
|
||||
volumes:
|
||||
- ./nginx/management_nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
|
@ -51,10 +47,6 @@ services:
|
|||
management-backend:
|
||||
container_name: ragflowplus-management-backend
|
||||
image: zstar1003/ragflowplus-management-server:v0.2.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: backend
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
|
|
|
@ -32,10 +32,6 @@ services:
|
|||
management-frontend:
|
||||
container_name: ragflowplus-management-frontend
|
||||
image: zstar1003/ragflowplus-management-web:v0.2.0
|
||||
# build:
|
||||
# context: .
|
||||
# dockerfile: Dockerfile
|
||||
# target: frontend
|
||||
volumes:
|
||||
- ./nginx/management_nginx.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
|
@ -51,10 +47,6 @@ services:
|
|||
management-backend:
|
||||
container_name: ragflowplus-management-backend
|
||||
image: zstar1003/ragflowplus-management-server:v0.2.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: backend
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
|
|
|
@ -116,7 +116,7 @@ function createRequest(instance: AxiosInstance) {
|
|||
// 请求体
|
||||
data: {},
|
||||
// 请求超时
|
||||
timeout: 5000,
|
||||
timeout: 50000,
|
||||
// 跨域请求时是否携带 Cookies
|
||||
withCredentials: false
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import type { FormInstance } from "element-plus"
|
|||
import { addTeamMemberApi, getTableDataApi, getTeamMembersApi, getUsersApi, removeTeamMemberApi } from "@@/apis/teams"
|
||||
import { usePagination } from "@@/composables/usePagination"
|
||||
import { CirclePlus, Refresh, Search, UserFilled } from "@element-plus/icons-vue"
|
||||
import { computed } from "vue" // 导入 computed
|
||||
|
||||
defineOptions({
|
||||
name: "TeamManagement"
|
||||
|
@ -95,6 +96,12 @@ const userLoading = ref<boolean>(false)
|
|||
const selectedUser = ref<number | undefined>(undefined)
|
||||
const selectedRole = ref<string>("normal")
|
||||
|
||||
// 计算属性:过滤出可添加的用户(不在当前团队成员列表中的用户)
|
||||
const availableUsers = computed(() => {
|
||||
const memberUserIds = new Set(teamMembers.value.map(member => member.userId))
|
||||
return userList.value.filter(user => !memberUserIds.has(user.id))
|
||||
})
|
||||
|
||||
function handleManageMembers(row: TeamData) {
|
||||
currentTeam.value = row
|
||||
memberDialogVisible.value = true
|
||||
|
@ -324,9 +331,15 @@ watch([() => paginationData.currentPage, () => paginationData.pageSize], getTabl
|
|||
<div v-loading="userLoading">
|
||||
<el-form label-width="80px">
|
||||
<el-form-item label="选择用户">
|
||||
<el-select v-model="selectedUser" placeholder="请选择用户" style="width: 100%">
|
||||
<!-- 修改 placeholder 属性,使其动态绑定 -->
|
||||
<el-select
|
||||
v-model="selectedUser"
|
||||
:placeholder="availableUsers.length > 0 ? '请选择用户' : '(当前无添加的用户数据)'"
|
||||
style="width: 100%"
|
||||
:disabled="availableUsers.length === 0"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
v-for="user in availableUsers"
|
||||
:key="user.id"
|
||||
:label="user.username"
|
||||
:value="user.id"
|
||||
|
@ -346,7 +359,7 @@ watch([() => paginationData.currentPage, () => paginationData.pageSize], getTabl
|
|||
<el-button @click="addMemberDialogVisible = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" @click="confirmAddMember">
|
||||
<el-button type="primary" @click="confirmAddMember" :disabled="!selectedUser">
|
||||
确认
|
||||
</el-button>
|
||||
</template>
|
||||
|
|
|
@ -11,9 +11,12 @@ declare module 'vue' {
|
|||
ElAside: typeof import('element-plus/es')['ElAside']
|
||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||
ElBacktop: typeof import('element-plus/es')['ElBacktop']
|
||||
ElBadge: typeof import('element-plus/es')['ElBadge']
|
||||
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
|
||||
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
|
@ -21,17 +24,35 @@ declare module 'vue' {
|
|||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
||||
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
|
||||
ElEmpty: typeof import('element-plus/es')['ElEmpty']
|
||||
ElForm: typeof import('element-plus/es')['ElForm']
|
||||
ElFormItem: typeof import('element-plus/es')['ElFormItem']
|
||||
ElHeader: typeof import('element-plus/es')['ElHeader']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElInput: typeof import('element-plus/es')['ElInput']
|
||||
ElMain: typeof import('element-plus/es')['ElMain']
|
||||
ElMenu: typeof import('element-plus/es')['ElMenu']
|
||||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
||||
ElOption: typeof import('element-plus/es')['ElOption']
|
||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||
ElPopover: typeof import('element-plus/es')['ElPopover']
|
||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||
ElTag: typeof import('element-plus/es')['ElTag']
|
||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
}
|
||||
export interface ComponentCustomProperties {
|
||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue