fix: keep table tooltips below their triggers (#14329)

* fix: keep table tooltips below their triggers

* fix: unify tooltip placement and model list previews

---------

Co-authored-by: ssongliu <sloooop1x@gmail.com>
This commit is contained in:
王贺
2026-11-07 12:51:34 +08:00
committed by GitHub
parent 451ec3398e
commit 6fa378c13d
42 changed files with 306 additions and 131 deletions
@@ -0,0 +1,138 @@
<template>
<div class="ai-model-list" :class="{ 'ai-model-list--single': visibleCount === 1 }">
<span v-for="(model, index) in models.slice(0, visibleCount)" :key="index" class="model-preview">
<el-tag size="small" :type="tagType" class="model-tag">
<span :title="model">{{ model }}</span>
</el-tag>
<CopyButton v-if="copyable" :content="model" />
</span>
<el-popover
v-if="models.length > visibleCount"
trigger="click"
placement="bottom-start"
:width="360"
:popper-options="{ modifiers: [{ name: 'preventOverflow', options: { padding: 16, altAxis: true } }] }"
:popper-style="{ maxWidth: 'calc(100vw - 32px)', padding: '12px' }"
>
<template #reference>
<el-button
size="small"
class="model-more"
:aria-label="$t('aiTools.model.model') + ' +' + (models.length - visibleCount)"
@click.stop
>
+{{ models.length - visibleCount }}
</el-button>
</template>
<div class="model-popover" @click.stop>
<div class="model-popover__header">
<span>{{ $t('aiTools.model.model') }}</span>
<el-tag size="small" type="info" round>{{ models.length }}</el-tag>
</div>
<ul class="model-popover__list" tabindex="0" :aria-label="$t('aiTools.model.model')">
<li v-for="(model, index) in models" :key="index">
<span class="model-popover__name">{{ model }}</span>
<CopyButton v-if="copyable" :content="model" :aria-label="$t('commons.button.copy')" />
</li>
</ul>
<div v-if="$slots.footer" class="model-popover__footer"><slot name="footer" /></div>
</div>
</el-popover>
</div>
</template>
<script setup lang="ts">
import CopyButton from '@/components/copy-button/index.vue';
withDefaults(
defineProps<{
models: string[];
visibleCount?: number;
copyable?: boolean;
tagType?: 'primary' | 'success' | 'warning' | 'info' | 'danger';
}>(),
{ visibleCount: 3, copyable: false, tagType: 'primary' },
);
</script>
<style scoped lang="scss">
.ai-model-list {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
min-width: 0;
max-width: 100%;
&--single {
flex-wrap: nowrap;
}
}
.model-preview {
display: inline-flex;
align-items: center;
min-width: 0;
max-width: 100%;
}
.model-tag {
min-width: 0;
max-width: 100%;
:deep(.el-tag__content) {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
}
.model-more {
flex-shrink: 0;
margin: 0;
padding: 0 8px;
color: var(--el-color-primary);
border-color: var(--el-color-primary-light-7);
background: var(--el-color-primary-light-9);
}
.model-popover {
&__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding-bottom: 10px;
font-weight: 500;
border-bottom: 1px solid var(--el-border-color-lighter);
}
&__list {
max-height: min(320px, 50vh);
overflow-y: auto;
overscroll-behavior: contain;
margin: 8px 0 0;
padding: 0;
list-style: none;
li {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 8px;
line-height: 20px;
border-radius: 4px;
&:nth-child(odd) {
background: var(--el-fill-color-light);
}
}
}
&__name {
flex: 1;
min-width: 0;
white-space: normal;
overflow-wrap: anywhere;
}
&__footer {
margin-top: 8px;
padding-top: 10px;
border-top: 1px solid var(--el-border-color-lighter);
}
:deep(.el-button) {
flex-shrink: 0;
}
}
</style>
+3 -1
View File
@@ -1,5 +1,5 @@
<template>
<el-tooltip placement="top-start">
<el-tooltip v-bind="TABLE_TOOLTIP_OPTIONS">
<template #content>
<div class="info-break" :style="{ width: width + 'px' }">{{ info }}</div>
</template>
@@ -7,6 +7,8 @@
</el-tooltip>
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
defineProps({
width: {
type: String,
+2 -1
View File
@@ -5,7 +5,7 @@
:aria-disabled="isDisabled"
@click.capture="handlePermissionClick"
>
<el-tooltip v-if="msg && msg != ''" effect="dark" placement="bottom">
<el-tooltip v-if="msg && msg != ''" effect="dark" v-bind="TABLE_TOOLTIP_OPTIONS">
<template #content>
<div class="content">{{ msg }}</div>
</template>
@@ -40,6 +40,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, ref } from 'vue';
const props = defineProps({
@@ -170,7 +170,7 @@
import { panelCacheKey, writePanelCache } from '@/utils/panel-cache';
import { computed, onDeactivated, onMounted, ref, useAttrs } from 'vue';
import { useGlobalStore } from '@/composables/useGlobalStore';
import { flattenVNodes, type FuTableOperationButton } from '@/components/table/shared';
import { flattenVNodes, TABLE_OVERFLOW_TOOLTIP_OPTIONS, type FuTableOperationButton } from '@/components/table/shared';
import { useCardColumns } from './useCardColumns';
import { useContextMenu } from './useContextMenu';
import { useResponsivePagination } from './useResponsivePagination';
@@ -274,7 +274,7 @@ const scheduleCardContentHeightSync = () => {
});
};
const resolvedTooltipOptions = computed(() => ({
placement: 'bottom-start',
...TABLE_OVERFLOW_TOOLTIP_OPTIONS,
...((attrs.tooltipOptions ?? attrs['tooltip-options']) as Record<string, unknown> | undefined),
}));
const getRowKey = (row: any, index: number) => {
+7
View File
@@ -1,4 +1,5 @@
import type { VNode } from 'vue';
import type { UseTooltipProps } from 'element-plus';
import { hasManagePermissionAccess, hasPermissionAccess, type PermissionBindingValue } from '@/utils/permission';
export { flattenVNodes } from '@/components/shared/vnode';
@@ -28,6 +29,12 @@ export interface FuTableOperationButton<Row = any> {
export const FU_TABLE_STORAGE_PREFIX = 'FU-T-';
export const TABLE_TOOLTIP_OPTIONS: Pick<UseTooltipProps, 'placement'> = {
placement: 'bottom',
};
export const TABLE_OVERFLOW_TOOLTIP_OPTIONS = TABLE_TOOLTIP_OPTIONS;
export const isElTableColumnVNode = (vnode: VNode) => {
const type = vnode.type as any;
return type === 'el-table-column' || type?.name === 'ElTableColumn' || type?.__name === 'ElTableColumn';
+2 -1
View File
@@ -1,6 +1,6 @@
<template>
<div class="tooltip-container">
<el-tooltip :disabled="showTooltip">
<el-tooltip :disabled="showTooltip" v-bind="TABLE_TOOLTIP_OPTIONS">
<template #content>
<div :style="{ width: tootipWidth, 'word-break': 'break-all' }">{{ text }}</div>
</template>
@@ -13,6 +13,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { onMounted, ref } from 'vue';
defineOptions({ name: 'Tooltip' });
@@ -38,6 +38,7 @@
>
<el-select
v-model="form.localEngineId"
fit-input-width
filterable
:loading="loadingEngines"
@change="handleLocalEngineChange"
@@ -45,26 +46,13 @@
<el-option v-for="item in localEngines" :key="item.id" :label="item.name" :value="item.id">
<div class="local-engine-option">
<span class="local-engine-option__name" :title="item.name">{{ item.name }}</span>
<el-tag
<AiModelList
v-if="item.models.length"
size="small"
type="info"
class="local-engine-option__model"
>
<span :title="item.models[0]">{{ item.models[0] }}</span>
</el-tag>
<el-popover v-if="item.models.length > 1" trigger="click" placement="bottom" :width="320">
<template #reference>
<el-button size="small" class="local-engine-option__more" @click.stop>
+{{ item.models.length - 1 }}
</el-button>
</template>
<div class="local-engine-models">
<el-tag v-for="model in item.models.slice(1)" :key="model" size="small" type="info">
{{ model }}
</el-tag>
</div>
</el-popover>
class="local-engine-option__models"
:models="item.models"
:visible-count="1"
tag-type="info"
/>
</div>
</el-option>
</el-select>
@@ -331,6 +319,7 @@
</template>
<script setup lang="ts">
import AiModelList from '@/components/ai-model-list/index.vue';
import { computed, onMounted, reactive, ref, watch } from 'vue';
import { FormInstance } from 'element-plus';
import { AI } from '@/api/interface/ai';
@@ -992,34 +981,8 @@ defineExpose({
text-overflow: ellipsis;
}
&__model {
max-width: 55%;
min-width: 0;
:deep(.el-tag__content) {
overflow: hidden;
text-overflow: ellipsis;
}
}
&__more {
flex-shrink: 0;
}
}
.local-engine-models {
display: flex;
flex-wrap: wrap;
gap: 6px;
max-height: 240px;
overflow: auto;
.el-tag {
height: auto;
padding: 4px 6px;
white-space: normal;
overflow-wrap: anywhere;
max-width: 100%;
&__models {
max-width: 65%;
}
}
+19 -35
View File
@@ -69,7 +69,7 @@
: 'aiTools.model.cloudService',
)
"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-icon
class="service-source-icon"
@@ -115,36 +115,27 @@
</el-table-column>
<el-table-column prop="models" :label="$t('aiTools.model.model')" min-width="200">
<template #default="{ row }">
<div v-if="row.models?.length" class="model-line">
<span class="cell-ellipsis" :title="row.models[0].id">{{ row.models[0].id }}</span>
<el-button
v-if="!row.appInstallId && row.models.length > 1"
size="small"
class="model-more"
@click="poolRef.open(row)"
>
+{{ row.models.length - 1 }}
</el-button>
<el-tooltip
v-if="row.appInstallId && row.models.length > 1"
:content="
row.models
.slice(1)
.map((item) => item.id)
.join(', ')
"
placement="top"
>
<el-button size="small" class="model-more">+{{ row.models.length - 1 }}</el-button>
</el-tooltip>
</div>
<AiModelList
v-if="row.models?.length"
:models="row.models.map((item) => item.id)"
:visible-count="1"
>
<template v-if="!row.appInstallId" #footer>
<el-button link type="primary" @click="poolRef.open(row)">
{{ $t('aiTools.agents.modelPool') }}
</el-button>
</template>
</AiModelList>
<span v-if="!row.models?.length">—</span>
</template>
</el-table-column>
<el-table-column prop="verified" :label="$t('aiTools.model.connectionStatus')" min-width="130">
<template #default="{ row }">
<div class="verification-status">
<el-tooltip :disabled="!row.verifiedAt && !row.verifyError" placement="top">
<el-tooltip
:disabled="!row.verifiedAt && !row.verifyError"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<template #content>
<div v-if="row.verifiedAt">
{{ $t('aiTools.model.verifiedAt') }}:
@@ -164,7 +155,7 @@
<el-tooltip
v-if="row.validateAvailability"
:content="$t('aiTools.model.reverify')"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-button
v-permission
@@ -268,12 +259,13 @@
</template>
<script setup lang="ts">
import AiModelList from '@/components/ai-model-list/index.vue';
import { computed, reactive, ref, toRef, watch } from 'vue';
import { useRoute } from 'vue-router';
import { ElMessageBox } from 'element-plus';
import { Cloudy, Connection, Monitor, RefreshRight } from '@element-plus/icons-vue';
import type { AI } from '@/api/interface/ai';
import type { FuTableColumnConfig } from '@/components/table/shared';
import { TABLE_TOOLTIP_OPTIONS, type FuTableColumnConfig } from '@/components/table/shared';
import { deleteAgentAccount, getAgentProviders, pageAgentAccounts, verifyAgentAccount } from '@/api/modules/ai';
import { useGlobalStore } from '@/composables/useGlobalStore';
import { getAgentProviderDisplayName } from '@/utils/agent';
@@ -587,14 +579,6 @@ watch(
white-space: nowrap;
text-overflow: ellipsis;
}
.model-line {
display: flex;
align-items: center;
}
.model-more {
flex-shrink: 0;
margin-left: 8px;
}
.model-filter {
width: 220px;
}
@@ -83,14 +83,18 @@
<el-tag v-if="row.status === 'Deleted'" type="info">
{{ $t('commons.status.notfound') }}
</el-tag>
<el-tooltip v-if="row.status === 'Unknown'" :content="row.message" placement="top">
<el-tooltip
v-if="row.status === 'Unknown'"
:content="row.message"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag type="warning">{{ $t('commons.status.unknown') }}</el-tag>
</el-tooltip>
<el-tooltip
v-if="row.status === 'Canceled'"
:content="row.message"
:disabled="!row.message"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag type="danger">{{ $t('commons.status.systemrestart') }}</el-tag>
</el-tooltip>
@@ -150,6 +154,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import AddDialog from '@/views/ai/ollama/add/index.vue';
import TaskLog from '@/components/log/task/index.vue';
@@ -216,6 +216,7 @@
<el-divider class="!my-3" />
<el-table
:tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS"
v-if="composeContainers.length > 0"
:data="tableData"
size="small"
@@ -522,6 +523,7 @@
</template>
<script lang="ts" setup>
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import { computed, h, ref } from 'vue';
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
@@ -307,7 +307,7 @@
:key="item"
:hide-after="20"
:content="item"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-button
v-if="item.indexOf('->') !== -1"
@@ -447,7 +447,12 @@
<el-checkbox border v-model="showIPv6Ports">IPv6</el-checkbox>
</div>
<div v-if="filteredPorts.length" class="container-port-dialog">
<el-tooltip v-for="item in filteredPorts" :key="item" :content="item" placement="top">
<el-tooltip
v-for="item in filteredPorts"
:key="item"
:content="item"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-button
:icon="item.indexOf('->') !== -1 ? 'Position' : undefined"
plain
@@ -484,6 +489,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import PruneDialog from '@/views/container/container/prune/index.vue';
import RenameDialog from '@/views/container/container/rename/index.vue';
@@ -120,7 +120,7 @@
</el-tab-pane>
<el-tab-pane :label="$t('container.volume')" name="storage">
<el-table :data="inspectData?.Mounts" border>
<el-table :tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS" :data="inspectData?.Mounts" border>
<el-table-column :label="$t('commons.table.type')" width="100">
<template #default="{ row }">
<el-tag size="small">
@@ -169,6 +169,7 @@
</template>
<script lang="ts" setup>
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { ref } from 'vue';
import CodemirrorPro from '@/components/codemirror-pro/index.vue';
import { routerToFileWithPath } from '@/utils/router';
@@ -17,7 +17,7 @@
<template #default="{ row }">
<el-select v-if="row.type === 'volume'" filterable v-model="row.sourceDir">
<div v-for="(item, indexV) of volumeOptions" :key="indexV">
<el-tooltip :hide-after="20" :content="item.option" placement="top">
<el-tooltip :hide-after="20" :content="item.option" v-bind="TABLE_TOOLTIP_OPTIONS">
<el-option :value="item.option" :label="item.option.substring(0, 30)" />
</el-tooltip>
</div>
@@ -82,6 +82,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { Container } from '@/api/interface/container';
import { listVolume } from '@/api/modules/container';
import { ref, onMounted } from 'vue';
@@ -50,6 +50,7 @@
</el-text>
<div class="float-right">
<el-tooltip
v-bind="TABLE_TOOLTIP_OPTIONS"
:content="row.isPinned ? $t('commons.table.unpin') : $t('commons.table.pin')"
>
<el-button
@@ -161,6 +162,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import { toRef, reactive, ref, computed, watch, onActivated, onDeactivated, onBeforeUnmount } from 'vue';
import { useRoute, useRouter } from 'vue-router';
@@ -12,7 +12,7 @@
<span class="input-help">{{ $t('container.imageRemoteSearchHelper') }}</span>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="items">
<el-table :tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS" v-loading="loading" :data="items">
<el-table-column prop="name" :label="$t('container.imageName')" min-width="180" />
<el-table-column
prop="description"
@@ -42,6 +42,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { onBeforeUnmount, ref, watch } from 'vue';
import { searchRemoteImages, type RemoteImage } from '@/api/modules/container';
import { getSettingBaseInfo } from '@/api/modules/setting';
@@ -87,7 +87,7 @@
prop="mountpoint"
>
<template #default="{ row }">
<el-tooltip :content="row.mountpoint">
<el-tooltip :content="row.mountpoint" v-bind="TABLE_TOOLTIP_OPTIONS">
<el-button
v-permission:view="'host_file_view'"
type="primary"
@@ -124,6 +124,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import CreateDialog from '@/views/container/volume/create/index.vue';
import CodemirrorDrawer from '@/components/codemirror-pro/drawer.vue';
@@ -10,7 +10,11 @@
{{ $t('database.addUserAuthorization') }}
</el-button>
</div>
<el-table :data="authorizedUsers" :empty-text="$t('commons.msg.noneData')">
<el-table
:tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS"
:data="authorizedUsers"
:empty-text="$t('commons.msg.noneData')"
>
<el-table-column :label="$t('commons.table.user')" show-overflow-tooltip min-width="180">
<template #default="{ row }">{{ row.username }}@{{ row.host }}</template>
</el-table-column>
@@ -160,6 +164,7 @@
</template>
<script lang="ts" setup>
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, reactive, ref } from 'vue';
import { ElMessageBox } from 'element-plus';
import Tooltip from '@/components/tooltip/index.vue';
+4 -1
View File
@@ -130,7 +130,9 @@
<Tooltip v-if="!row.isDelete" :islink="false" :text="row.name" />
<div v-else>
<span v-if="row.name.length < 15">{{ row.name }}</span>
<el-tooltip v-else :content="row.name">{{ row.name.substring(0, 10) }}...</el-tooltip>
<el-tooltip v-else :content="row.name" v-bind="TABLE_TOOLTIP_OPTIONS">
{{ row.name.substring(0, 10) }}...
</el-tooltip>
<el-tag round type="info" class="ml-1" size="small">
{{ $t('database.isDelete') }}
</el-tag>
@@ -226,6 +228,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import BindDialog from '@/views/database/mysql/bind/index.vue';
import UserDialog from '@/views/database/mysql/user/index.vue';
@@ -51,7 +51,7 @@
v-for="item in userDatabases(row).slice(0, 1)"
:key="row.username + '@' + row.host + item"
:content="item"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag size="small">{{ item }}</el-tag>
</el-tooltip>
@@ -66,7 +66,7 @@
v-for="item in userDatabases(row)"
:key="row.username + '@' + row.host + item"
:content="item"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag size="small">{{ item }}</el-tag>
</el-tooltip>
@@ -203,6 +203,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, reactive, ref } from 'vue';
import Tooltip from '@/components/tooltip/index.vue';
import i18n from '@/lang';
@@ -104,7 +104,9 @@
<Tooltip v-if="!row.isDelete" :islink="false" :text="row.name" />
<div v-else>
<span v-if="row.name.length < 15">{{ row.name }}</span>
<el-tooltip v-else :content="row.name">{{ row.name.substring(0, 10) }}...</el-tooltip>
<el-tooltip v-else :content="row.name" v-bind="TABLE_TOOLTIP_OPTIONS">
{{ row.name.substring(0, 10) }}...
</el-tooltip>
<el-tag round type="info" class="ml-1" size="small">
{{ $t('database.isDelete') }}
</el-tag>
@@ -241,6 +243,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import BindDialog from '@/views/database/postgresql/bind/index.vue';
import OperateDialog from '@/views/database/postgresql/create/index.vue';
@@ -7,7 +7,12 @@
<el-button v-permission @click="batchDelete(null)">
{{ $t('commons.button.delete') }}
</el-button>
<el-table :data="data" class="mt-5" @selection-change="handleSelectionChange">
<el-table
:tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS"
:data="data"
class="mt-5"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" fix />
<el-table-column :label="$t('commons.table.name')" min-width="50" show-overflow-tooltip>
<template #default="{ row }">
@@ -75,6 +80,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { Command } from '@/api/interface/command';
import { deleteCommand, getCommandPage, addCommand, editCommand } from '@/api/modules/command';
import { reactive, ref } from 'vue';
+7 -1
View File
@@ -4,7 +4,12 @@
<template #header-r>
<el-popover placement="left" :width="226" trigger="click">
<el-input size="small" v-model="filter" clearable @input="loadOption()" />
<el-table :show-header="false" :data="options" max-height="150px">
<el-table
:tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS"
:show-header="false"
:data="options"
max-height="150px"
>
<el-table-column prop="key" width="120" show-overflow-tooltip />
<el-table-column prop="name">
<template #default="{ row }">
@@ -143,6 +148,7 @@
</template>
<script lang="ts" setup>
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { getAppIconUrl, installedOp } from '@/api/modules/app';
import { changeLauncherStatus, loadAppLauncher, loadAppLauncherOption } from '@/api/modules/dashboard';
import i18n from '@/lang';
@@ -93,14 +93,18 @@
></el-table-column>
<el-table-column :label="$t('commons.button.log')" prop="log" min-width="160">
<template #default="{ row }">
<el-tooltip :content="row.log" placement="top">
<el-tooltip :content="row.log" v-bind="TABLE_TOOLTIP_OPTIONS">
{{ row.log }}
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.message')" prop="status" width="100">
<template #default="{ row }">
<el-tooltip v-if="row.status === 'FAILED'" :content="row.message" placement="top">
<el-tooltip
v-if="row.status === 'FAILED'"
:content="row.message"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-button type="danger" link>
{{ $t('commons.status.' + row.status.toLowerCase()) }}
</el-button>
@@ -132,6 +136,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { readCachedPageSize } from '@/utils/panel-cache';
import i18n from '@/lang';
import { reactive, ref } from 'vue';
@@ -4,7 +4,7 @@
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
<el-table-column :label="$t('file.path')" show-overflow-tooltip prop="path">
<template #default="{ row }">
<el-tooltip class="box-item" effect="dark" :content="row.path" placement="top">
<el-tooltip class="box-item" effect="dark" :content="row.path" v-bind="TABLE_TOOLTIP_OPTIONS">
<span class="table-link text-ellipsis" @click="toFavorite(row)" type="primary">
<svg-icon v-if="row.isDir" className="table-icon" iconName="p-file-folder"></svg-icon>
<svg-icon v-else className="table-icon" iconName="p-file-normal"></svg-icon>
@@ -20,6 +20,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { readCachedPageSize } from '@/utils/panel-cache';
import { searchFavorite, removeFavorite } from '@/api/modules/files';
import i18n from '@/lang';
@@ -527,9 +527,6 @@
show-overflow-tooltip
:sortable="'custom'"
prop="name"
:tooltip-options="{
placement: 'bottom-start',
}"
>
<template #default="{ row }">
<div class="file-row">
@@ -4,7 +4,7 @@
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
<el-table-column :label="$t('file.path')" show-overflow-tooltip prop="path" min-width="250">
<template #default="{ row }">
<el-tooltip class="box-item" effect="dark" :content="row.path" placement="top">
<el-tooltip class="box-item" effect="dark" :content="row.path" v-bind="TABLE_TOOLTIP_OPTIONS">
<span class="table-link text-ellipsis" @click="viewDetail(row)" type="primary">
<svg-icon className="table-icon" iconName="p-file-normal"></svg-icon>
{{ row.fileName }}
@@ -24,6 +24,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { readCachedPageSize } from '@/utils/panel-cache';
import { removeFileShare, searchFileShare } from '@/api/modules/files';
import { File } from '@/api/interface/file';
@@ -136,7 +136,7 @@
<el-tooltip
v-if="row.observed.protected && !row.isWhitelist"
:content="$t('firewall.builtinRuleProtected')"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
:show-after="200"
:popper-style="{ maxWidth: '320px' }"
>
@@ -204,7 +204,7 @@
<div v-else class="firewall-used-cell">
<el-tooltip
:content="usageEntryLabel(usageEntriesByRow[row.rowKey][0])"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag
class="cursor-pointer firewall-used-entry"
@@ -244,7 +244,7 @@
v-for="entry in usageEntriesByRow[row.rowKey]"
:key="`${row.rowKey}:${entry.key}`"
:content="usageEntryLabel(entry)"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag
class="cursor-pointer firewall-used-popover-entry"
@@ -304,7 +304,7 @@
<script lang="ts" setup>
import { useSearchState } from '@/utils/search-reset';
import { Firewall } from '@/api/interface/firewall';
import type { FuTableOperationButton } from '@/components/table/shared';
import { TABLE_TOOLTIP_OPTIONS, type FuTableOperationButton } from '@/components/table/shared';
import { buildHostRuleExport } from './transfer';
import { Process } from '@/api/interface/process';
import {
+7 -1
View File
@@ -42,7 +42,12 @@
<el-tag type="success">{{ $t('commons.status.success') }}</el-tag>
</div>
<div v-else>
<el-tooltip class="box-item" effect="dark" :content="row.message" placement="top-start">
<el-tooltip
class="box-item"
effect="dark"
:content="row.message"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag type="danger">{{ $t('commons.status.failed') }}</el-tag>
</el-tooltip>
</div>
@@ -93,6 +98,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { dateFormatServerTimezone } from '@/utils/date';
+2 -1
View File
@@ -98,7 +98,7 @@
<el-tooltip
v-if="row.authMethod === 'api_key' && row.apiKeyID"
:content="row.apiKeyID"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-text type="info" size="small">
API Key · {{ row.apiKeyName || row.apiKeyID }}
@@ -139,6 +139,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import LogRouter from '@/views/log/router/index.vue';
@@ -44,7 +44,12 @@
:type="statusConfig(row).type"
:link="statusConfig(row).link"
>
<el-tooltip v-if="row.message" :content="row.message" placement="top" trigger="click">
<el-tooltip
v-if="row.message"
:content="row.message"
v-bind="TABLE_TOOLTIP_OPTIONS"
trigger="click"
>
{{ $t(statusConfig(row).text) }}
</el-tooltip>
<template v-else>
@@ -82,6 +87,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { toRef } from 'vue';
import { useSearchState } from '@/utils/search-reset';
import { onMounted, reactive, ref } from 'vue';
@@ -28,7 +28,7 @@
<el-tooltip
v-if="row.kind === 'legacy'"
:content="$t('apiKeyManagement.legacyHelp')"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
:trigger="isMobile ? 'click' : 'hover'"
:popper-style="{ maxWidth: 'min(360px, calc(100vw - 32px))' }"
>
@@ -198,7 +198,7 @@ import { generateApiKey, getUserInfo } from '@/api/modules/auth';
import APIKeyEditor from '@/components/api-key-management/editor.vue';
import APIKeySummary from '@/components/api-key-management/summary.vue';
import DrawerPro from '@/components/drawer-pro/index.vue';
import type { FuTableOperationButton } from '@/components/table/shared';
import { TABLE_TOOLTIP_OPTIONS, type FuTableOperationButton } from '@/components/table/shared';
import { isAnyAPIKeyIP, normalizeAPIKeyIPs } from '@/utils/api-key';
import { MsgSuccess, MsgWarning } from '@/utils/message';
import { copyText } from '@/utils/clipboard';
@@ -56,7 +56,7 @@
<el-table-column :label="$t('commons.table.type')" :min-width="100" prop="type">
<template #default="{ row }">
<el-tag>{{ $t('setting.' + row.type) }}</el-tag>
<el-tooltip v-if="hasTokenRefresh(row)">
<el-tooltip v-if="hasTokenRefresh(row)" v-bind="TABLE_TOOLTIP_OPTIONS">
<template #content>
{{ $t('setting.clickToRefresh') }}
<br />
@@ -120,6 +120,7 @@
</div>
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import { dateFormat } from '@/utils/date';
import { toRef, onMounted, ref } from 'vue';
@@ -112,7 +112,7 @@
<span>{{ $t('tool.supervisor.' + row.status[0].status) }}</span>
</el-button>
</template>
<el-table :data="row.status">
<el-table :data="row.status" :tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS">
<el-table-column
property="name"
:label="$t('commons.table.name')"
@@ -173,6 +173,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import Log from './log/index.vue';
import SuperVisorStatus from './status/index.vue';
+2 -1
View File
@@ -12,7 +12,7 @@
<div class="mb-4">
<el-button :disabled="loading" @click="search">{{ $t('commons.button.refresh') }}</el-button>
</div>
<el-table v-loading="loading" :data="items">
<el-table :tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS" v-loading="loading" :data="items">
<el-table-column prop="target" :label="$t('xpack.vm.diskTarget')" width="85" />
<el-table-column :label="$t('xpack.vm.diskSize')" width="110">
<template #default="{ row }">{{ row.capacity > 0 ? computeSize(row.capacity) : '-' }}</template>
@@ -70,6 +70,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, reactive, ref } from 'vue';
import type { FormInstance } from 'element-plus';
import DrawerPro from '@/components/drawer-pro/index.vue';
+2 -1
View File
@@ -369,7 +369,7 @@
<el-tooltip
v-if="canOpenCreateTaskLog(row)"
:content="$t('commons.button.log')"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-icon
class="vm-create-failed-log"
@@ -478,6 +478,7 @@
</template>
<script setup lang="ts">
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, reactive, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { ElMessageBox } from 'element-plus';
@@ -5,7 +5,13 @@
<span>{{ $t('xpack.vm.orphanSelected', [selected.length, computeSize(selectedSize)]) }}</span>
<el-button :loading="scanning" @click="scan">{{ $t('xpack.vm.orphanScan') }}</el-button>
</div>
<el-table v-loading="scanning" :data="items" max-height="420" @selection-change="selectionChange">
<el-table
:tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS"
v-loading="scanning"
:data="items"
max-height="420"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="48" />
<el-table-column :label="$t('commons.table.name')" min-width="280" show-overflow-tooltip>
<template #default="scope">{{ scope.row.path }}</template>
@@ -30,6 +36,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, ref } from 'vue';
import { ElMessageBox } from 'element-plus';
import i18n from '@/lang';
@@ -52,7 +52,13 @@
:closable="false"
:title="$t('runtime.envImportError', [parsed.error.line, $t('runtime.' + parsed.error.reason)])"
/>
<el-table v-else-if="parsed.entries.length" :data="parsed.entries" max-height="260" class="mt-3">
<el-table
:tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS"
v-else-if="parsed.entries.length"
:data="parsed.entries"
max-height="260"
class="mt-3"
>
<el-table-column prop="key" :label="$t('runtime.envKey')" min-width="120" show-overflow-tooltip />
<el-table-column prop="value" :label="$t('runtime.envValue')" min-width="180" show-overflow-tooltip />
</el-table>
@@ -71,6 +77,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { computed, reactive, ref } from 'vue';
import { FormRules } from 'element-plus';
import { Rules } from '@/global/form-rules';
@@ -81,7 +81,7 @@
<span>{{ $t('tool.supervisor.' + row.status[0].status) }}</span>
</el-button>
</template>
<el-table :data="row.status">
<el-table :data="row.status" :tooltip-options="TABLE_OVERFLOW_TOOLTIP_OPTIONS">
<el-table-column
property="name"
:label="$t('commons.table.name')"
@@ -129,6 +129,7 @@
</template>
<script setup lang="ts">
import { TABLE_OVERFLOW_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { ref } from 'vue';
import Create from './create/index.vue';
import File from './file/index.vue';
@@ -21,7 +21,7 @@
<el-tooltip
v-if="row.type === 'DnsPod'"
:content="$t('ssl.dnsPodRemovedTip')"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag type="danger" size="small" class="ml-2">
{{ $t('ssl.dnsPodRemoved') }}
@@ -45,6 +45,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { readCachedPageSize } from '@/utils/panel-cache';
import Create from './create/index.vue';
import { Website } from '@/api/interface/website';
+2 -1
View File
@@ -58,7 +58,7 @@
<el-tooltip
v-if="row.dnsAccount && row.dnsAccount.type === 'DnsPod'"
:content="$t('ssl.dnsPodRemovedSSLTip')"
placement="top"
v-bind="TABLE_TOOLTIP_OPTIONS"
>
<el-tag type="danger" size="small" class="ml-2">
DnsPod {{ $t('ssl.dnsPodRemoved') }}
@@ -218,6 +218,7 @@
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { useSearchState } from '@/utils/search-reset';
import { toRef, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { deleteSSL, downloadFile, pushSSLToNode, searchSSL, updateSSL } from '@/api/modules/website';
@@ -72,9 +72,6 @@
:columns="columns"
localKey="websiteColumn"
v-model:selects="selects"
:tooltip-options="{
placement: 'bottom-start',
}"
>
<el-table-column type="selection" width="32" />
<el-table-column
@@ -20,7 +20,7 @@
</el-table-column>
<el-table-column :label="$t('nginx.buildStatus')" min-width="160" align="center">
<template #default="{ row }">
<el-tooltip v-if="row.lastError" :content="row.lastError" placement="top">
<el-tooltip v-if="row.lastError" :content="row.lastError" v-bind="TABLE_TOOLTIP_OPTIONS">
<el-tag :type="statusType(row.buildStatus)">{{ $t('nginx.' + row.buildStatus) }}</el-tag>
</el-tooltip>
<el-tag v-else :type="statusType(row.buildStatus)">{{ $t('nginx.' + row.buildStatus) }}</el-tag>
@@ -47,6 +47,7 @@
</div>
</template>
<script lang="ts" setup>
import { TABLE_TOOLTIP_OPTIONS } from '@/components/table/shared';
import { getNginxModules, updateNginxModule } from '@/api/modules/nginx';
import i18n from '@/lang';
import { Nginx } from '@/api/interface/nginx';