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 master v1.5 #8265

Merged
merged 2 commits into from
Nov 28, 2024
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
3 changes: 3 additions & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3655,5 +3655,8 @@
"全站搜索,支持多对象,Shift + Enter 换行,Enter键开启搜索": "全站搜索,支持多对象,Shift + Enter 换行,Enter键开启搜索",
"全站搜索,支持多对象,Enter开启搜索": "全站搜索,支持多对象,Enter开启搜索",
"同主机关联的其他集群,勾选后一并添加": "同主机关联的其他集群,勾选后一并添加",
"点击上传": "点击上传",
"请选择本地 SQL 文件": "请选择本地 SQL 文件",
"这行勿动!新增翻译请在上一行添加!": ""

}
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/types/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@
watch(
filenameList,
() => {
localList.value = filenameList.value.map((fileName) => ({
id: fileName,
name: fileName,
}));
if (filenameList.value.length) {
localList.value = filenameList.value.map((fileName) => ({
id: fileName,
name: fileName,
}));
}
},
{
immediate: true,
Expand All @@ -182,6 +184,7 @@
};

const handleRemove = (filename: string) => {
modelValue.value = filename;
const lastesfilenameList = [...filenameList.value];
_.remove(lastesfilenameList, (item) => item === filename);
filenameList.value = lastesfilenameList;
Expand All @@ -208,18 +211,18 @@

.sql-execute-render-file-list {
height: 100%;
border-right: 1px solid #3d3d40;
background: #2e2e2e;
border-right: 1px solid #3d3d40;

.file-list-header {
display: flex;
height: 40px;
padding: 0 16px;
margin-bottom: 16px;
font-weight: bold;
line-height: 16px;
color: #fff;
display: flex;
align-items: center;
margin-bottom: 16px;
}

.file-list-wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@
}

isInnerChange = true;
modelValue.value = uploadFileNameList.value.map(
(localFileName) => uploadFileDataMap.value[localFileName].realFilePath,
);
if (uploadFileNameList.value.length) {
modelValue.value = uploadFileNameList.value.map(
(localFileName) => uploadFileDataMap.value[localFileName].realFilePath,
);
}

emits('grammar-check', true, true);
};
Expand Down Expand Up @@ -279,7 +281,7 @@
delete lastUploadFileDataMap[fileName];
uploadFileDataMap.value = lastUploadFileDataMap;

// 如果删除的是当前选中的文件,则重新选择第一个文件
// // 如果删除的是当前选中的文件,则重新选择第一个文件
if (fileName === selectFileName.value && uploadFileNameList.value.length > 0) {
[selectFileName.value] = uploadFileNameList.value;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@
is_safe: true,
infos: [
{
cluster_id: props.data.source_cluster.id,
cluster_id: props.data.cluster_id,
switch_instances: [
{
dumper_instance_id: props.data.id,
host: props.data.source_cluster.master_ip,
port: props.data.source_cluster.master_port,
host: props.data.ip,
port: props.data.listen_port,
repl_binlog_file: formModel.binlog_file,
repl_binlog_pos: formModel.binlog_pos,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
active: fileItemData.name === modelValue,
}"
@click="handleClick(fileItemData.name)">
<span v-overflow-tips>{{ getSQLFilename(fileItemData.name) }}</span>
<span
v-overflow-tips
class="file-name">
{{ getSQLFilename(fileItemData.name) }}
</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -84,10 +88,13 @@
}

.sql-execute-sql-file-list {
display: flex;
width: 238px;
height: 500px;
height: calc(100vh - 120px);
padding-top: 18px;
overflow-y: auto;
border-right: 1px solid #3d3d40;
flex-direction: column;

.file-list-title {
padding: 0 16px;
Expand Down Expand Up @@ -131,6 +138,13 @@
& ~ .file-item {
margin-top: 8px;
}

.file-name {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
Expand Down