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

Frontend dev v1.5 #6645

Merged
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: 4 additions & 3 deletions dbm-ui/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@

import { useSQLTaskNotify } from '@hooks';

import { useFunController, useUserProfile } from '@stores';
import { useUserProfile } from '@stores';

import DbRouterView from '@components/db-router-view/Index.vue';
import LocaleSwitch from '@components/locale-switch/Index.vue';
import RouterBack from '@components/router-back/Index.vue';
import SystemSearch from '@components/system-search/Index.vue';
import SystemVersionLog from '@components/system-version-log/Index.vue';

import { checkDbConsole } from '@utils';

import NoticeComponent from '@blueking/notice-component';

import Layout from './layout/Index.vue';
Expand All @@ -81,7 +83,6 @@
const userProfileStore = useUserProfile();
userProfileStore.fetchProfile();
const { t, locale } = useI18n();
const { funControllerData } = useFunController();

const documentTitles: Record<string, string> = {
en: 'DBM | Tencent BlueKing',
Expand Down Expand Up @@ -123,7 +124,7 @@
};

onMounted(() => {
if (funControllerData.getFlatData('mysql').toolbox) {
if (checkDbConsole('mysql.toolbox.sqlExecute') || checkDbConsole('tendbCluster.toolbox.sqlExecute')) {
useSQLTaskNotify();
}
});
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3461,5 +3461,6 @@
"内置策略为平台预设的审批规则,不可修改。根据业务需求,您可对全部或部分集群应用免审批策略。": "内置策略为平台预设的审批规则,不可修改。根据业务需求,您可对全部或部分集群应用免审批策略。",
"% 或 ? 不允许单独使用": "% 或 ? 不允许单独使用",
"不允许为 *": "不允许为 *",
"RedisCluster集群": "RedisCluster 集群",
"这行勿动!新增翻译请在上一行添加!": ""
}
28 changes: 16 additions & 12 deletions dbm-ui/frontend/src/views/mysql/common/hooks/useTaskCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { deleteUserSemanticTasks, getUserSemanticTasks } from '@services/source/

import { useSQLTaskCount } from '@stores';

import { checkDbConsole } from '@utils';

import { useTimeoutPoll } from '@vueuse/core';

export const useTaskCount = (clusterType: string) => {
Expand Down Expand Up @@ -60,19 +62,21 @@ export const useTaskCount = (clusterType: string) => {
};

const fetchData = () => {
getUserSemanticTasks({
cluster_type: clusterType,
}).then((data) => {
if (taskCountStore.isPolling === false) {
resume();
taskCountStore.isPolling = true;
}

taskCountStore.taskList = data;
nextTick(() => {
initPopover();
if (checkDbConsole('mysql.toolbox.sqlExecute') || checkDbConsole('tendbCluster.toolbox.sqlExecute')) {
getUserSemanticTasks({
cluster_type: clusterType,
}).then((data) => {
if (taskCountStore.isPolling === false) {
resume();
taskCountStore.isPolling = true;
}

taskCountStore.taskList = data;
nextTick(() => {
initPopover();
});
});
});
}
};

fetchData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@
action-id="mysql_webconsole"
resource={data.id}
permission={data.permission.mysql_webconsole}
disabled={data.operationDisabled}
disabled={data.isOffline}
text
theme="primary"
class="mr-8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,19 @@
const selectList = [
{
value: ClusterTypes.TWEMPROXY_REDIS_INSTANCE,
label: t('TendisCache'),
label: 'TendisCache',
},
{
value: ClusterTypes.TWEMPROXY_TENDIS_SSD_INSTANCE,
label: t('TendisSSD'),
label: 'TendisSSD',
},
{
value: ClusterTypes.PREDIXY_TENDISPLUS_CLUSTER,
label: t('Tendisplus'),
label: 'Tendisplus',
},
{
value: ClusterTypes.PREDIXY_REDIS_CLUSTER,
label: t('RedisCluster集群'),
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
<RenderText
:data="data.clusterTypeName"
:is-loading="data.isLoading"
:placeholder="$t('选择集群后自动生成')" />
:placeholder="t('选择集群后自动生成')" />
</td>
<td style="padding: 0">
<RenderText
:data="data.srcClusterType"
:is-loading="data.isLoading"
:placeholder="$t('选择集群后自动生成')" />
:placeholder="t('选择集群后自动生成')" />
</td>
<td style="padding: 0">
<RenderTargetClusterType
Expand All @@ -44,7 +44,7 @@
<RenderText
:data="data.currentSepc"
:is-loading="data.isLoading"
:placeholder="$t('选择集群后自动生成')" />
:placeholder="t('选择集群后自动生成')" />
</td>
<td style="padding: 0">
<RenderDeployPlan
Expand All @@ -57,14 +57,14 @@
<td style="padding: 0">
<RenderTargetClusterVersion
ref="versionRef"
:cluster-type="data.clusterType"
:cluster-type="selectClusterType"
:data="data.dbVersion" />
</td>
<td style="padding: 0">
<RenderText
:data="data.switchMode"
:is-loading="data.isLoading"
:placeholder="$t('选择集群后自动生成')" />
:placeholder="t('选择集群后自动生成')" />
</td>
<OperateColumn
:removeable="removeable"
Expand Down Expand Up @@ -199,6 +199,8 @@
});
</script>
<script setup lang="ts">
import { useI18n } from 'vue-i18n';

interface Props {
data: IDataRow;
removeable: boolean;
Expand All @@ -221,12 +223,24 @@

const emits = defineEmits<Emits>();

const { t } = useI18n();

const clusterRef = ref<InstanceType<typeof RenderTargetCluster>>();
const deployPlanRef = ref<InstanceType<typeof RenderDeployPlan>>();
const targetClusterTypeRef = ref<InstanceType<typeof RenderTargetClusterType>>();
const versionRef = ref<InstanceType<typeof RenderTargetClusterVersion>>();
const selectClusterType = ref('');

watch(
() => props.data.clusterType,
(clusterType) => {
selectClusterType.value = clusterType;
},
{
immediate: true,
},
);

const handleClusterTypeChange = (value: string) => {
selectClusterType.value = value;
};
Expand Down
26 changes: 11 additions & 15 deletions dbm-ui/frontend/src/views/redis/list/components/list/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -858,21 +858,17 @@
render: ({ data }: ColumnRenderData) => {
const getOperations = (theme = 'primary') => {
const baseOperations = [
<OperationBtnStatusTips
v-db-console="redis.clusterManage.webconsole"
data={data}>
<auth-button
action-id="redis_webconsole"
resource={data.id}
permission={data.permission.redis_webconsole}
disabled={data.operationDisabled}
text
theme="primary"
class="mr-8"
onClick={() => handleGoWebconsole(data.id)}>
Webconsole
</auth-button>
</OperationBtnStatusTips>,
<auth-button
action-id="redis_webconsole"
resource={data.id}
permission={data.permission.redis_webconsole}
disabled={data.isOffline}
text
theme="primary"
class="mr-8"
onClick={() => handleGoWebconsole(data.id)}>
Webconsole
</auth-button>,
<OperationBtnStatusTips
v-db-console="redis.clusterManage.backup"
data={data}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
class="text-overflow">
{{ item.name }}
</span>
<TaskCount
v-if="item.id === 'MySQLExecute'"
class="count" />
</div>
<DbIcon
v-bk-tooltips="favorMap[item.id] ? t('从导航移除') : t('收藏至导航')"
Expand Down Expand Up @@ -68,8 +65,6 @@

import { encodeRegexp, messageSuccess } from '@utils';

import TaskCount from './TaskCount.vue';

interface Props {
id: string;
draggable: boolean;
Expand Down

This file was deleted.

Loading
Loading