mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-01 06:28:06 +08:00
feat: 证书增加复制按钮
This commit is contained in:
parent
8357d536bc
commit
17f2ab6beb
@ -26,9 +26,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else-if="curr === 'ssl'">
|
<div v-else-if="curr === 'ssl'">
|
||||||
<el-input v-model="ssl.pem" :autosize="{ minRows: 10, maxRows: 15 }" type="textarea" />
|
<el-input v-model="ssl.pem" :autosize="{ minRows: 10, maxRows: 15 }" type="textarea" />
|
||||||
|
<div>
|
||||||
|
<br />
|
||||||
|
<el-button type="primary" @click="copyText(ssl.pem)">{{ $t('file.copy') }}</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-input v-model="ssl.privateKey" :autosize="{ minRows: 10, maxRows: 15 }" type="textarea" />
|
<el-input v-model="ssl.privateKey" :autosize="{ minRows: 10, maxRows: 15 }" type="textarea" />
|
||||||
|
<div>
|
||||||
|
<br />
|
||||||
|
<el-button type="primary" @click="copyText(ssl.privateKey)">{{ $t('file.copy') }}</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -37,6 +45,8 @@
|
|||||||
import { GetSSL } from '@/api/modules/website';
|
import { GetSSL } from '@/api/modules/website';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { dateFromat } from '@/utils/util';
|
import { dateFromat } from '@/utils/util';
|
||||||
|
import { ElMessage } from 'element-plus';
|
||||||
|
import i18n from '@/lang';
|
||||||
|
|
||||||
let open = ref(false);
|
let open = ref(false);
|
||||||
let id = ref(0);
|
let id = ref(0);
|
||||||
@ -60,6 +70,12 @@ const get = async () => {
|
|||||||
ssl.value = res.data;
|
ssl.value = res.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const copyText = (val: string): void => {
|
||||||
|
navigator.clipboard.writeText(val).then(() => {
|
||||||
|
ElMessage.success(i18n.global.t('commons.msg.copySuccess'));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
acceptParams,
|
acceptParams,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user