mirror of
https://github.com/alireza0/x-ui.git
synced 2026-06-28 03:30:48 +00:00
Some checks failed
Release X-UI / build (386) (push) Has been cancelled
Release X-UI / build (amd64) (push) Has been cancelled
Release X-UI / build (arm64) (push) Has been cancelled
Release X-UI / build (armv5) (push) Has been cancelled
Release X-UI / build (armv6) (push) Has been cancelled
Release X-UI / build (armv7) (push) Has been cancelled
Release X-UI / build (s390x) (push) Has been cancelled
Release X-UI / Build for Windows (push) Has been cancelled
54 lines
No EOL
1.6 KiB
HTML
54 lines
No EOL
1.6 KiB
HTML
{{define "textModal"}}
|
|
<a-modal id="text-modal" v-model="txtModal.visible" :title="txtModal.title"
|
|
:closable="true"
|
|
:class="themeSwitcher.currentTheme">
|
|
<template slot="footer">
|
|
<a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" icon="download"
|
|
:href="'data:application/text;charset=utf-8,' + encodeURIComponent(txtModal.content)"
|
|
:download="txtModal.fileName">[[ txtModal.fileName ]]
|
|
</a-button>
|
|
<a-button type="primary" id="copy-btn" @click="copy">{{ i18n "copy" }}</a-button>
|
|
</template>
|
|
<a-input type="textarea" v-model="txtModal.content"
|
|
:autosize="{ minRows: 10, maxRows: 20}"></a-input>
|
|
</a-modal>
|
|
|
|
<script>
|
|
|
|
const txtModal = {
|
|
title: '',
|
|
content: '',
|
|
fileName: '',
|
|
qrcode: null,
|
|
visible: false,
|
|
show: function (title = '', content = '', fileName = '') {
|
|
this.title = title;
|
|
this.content = content;
|
|
this.fileName = fileName;
|
|
this.visible = true;
|
|
},
|
|
close: function () {
|
|
this.visible = false;
|
|
},
|
|
};
|
|
|
|
const textModalApp = new Vue({
|
|
delimiters: ['[[', ']]'],
|
|
el: '#text-modal',
|
|
data: {
|
|
txtModal: txtModal,
|
|
},
|
|
methods: {
|
|
copy() {
|
|
ClipboardUtil.copyToClipboard(txtModal.content).then(success => {
|
|
if (success) {
|
|
app.$message.success('{{ i18n "copied" }}');
|
|
txtModal.close();
|
|
}
|
|
});
|
|
},
|
|
},
|
|
});
|
|
|
|
</script>
|
|
{{end}} |