mirror of https://github.com/1Panel-dev/1Panel
parent
9435290bb6
commit
bfd857ec4b
|
@ -789,6 +789,7 @@ const message = {
|
|||
theme: 'Theme',
|
||||
language: 'Language',
|
||||
eol: 'End Of Line',
|
||||
copyDir: 'Copy Dir',
|
||||
},
|
||||
setting: {
|
||||
all: 'All',
|
||||
|
|
|
@ -796,6 +796,7 @@ const message = {
|
|||
theme: '主题',
|
||||
language: '语言',
|
||||
eol: '行尾符',
|
||||
copyDir: '复制路径',
|
||||
},
|
||||
setting: {
|
||||
all: '全部',
|
||||
|
|
|
@ -297,6 +297,18 @@ const open = async (row: File.File) => {
|
|||
}
|
||||
};
|
||||
|
||||
const copyDir = (row: File.File) => {
|
||||
if (row?.path) {
|
||||
const input = document.createElement('textarea');
|
||||
input.value = row?.path;
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
MsgSuccess('复制成功');
|
||||
}
|
||||
};
|
||||
|
||||
const handlePath = () => {
|
||||
if (breadCrumbRef.value.offsetWidth > pathWidth.value) {
|
||||
paths.value.splice(0, 1);
|
||||
|
@ -549,6 +561,10 @@ const buttons = [
|
|||
label: i18n.global.t('file.open'),
|
||||
click: open,
|
||||
},
|
||||
{
|
||||
label: i18n.global.t('file.copyDir'),
|
||||
click: copyDir,
|
||||
},
|
||||
{
|
||||
label: i18n.global.t('file.mode'),
|
||||
click: openMode,
|
||||
|
|
Loading…
Reference in New Issue