mirror of
				https://github.com/MHSanaei/3x-ui.git
				synced 2025-11-04 06:12:52 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			52 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{{define "modals/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" @click="txtModal.copy(txtModal.content)">{{ i18n "copy" }}</a-button>
 | 
						|
    </template>
 | 
						|
    <a-input style="overflow-y: auto;" 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;
 | 
						|
        },
 | 
						|
        copy: function (content = '') {
 | 
						|
            ClipboardManager
 | 
						|
                .copyText(content)
 | 
						|
                .then(() => {
 | 
						|
                    app.$message.success('{{ i18n "copied" }}')
 | 
						|
                    this.close();
 | 
						|
                })
 | 
						|
        },
 | 
						|
        close: function () {
 | 
						|
            this.visible = false;
 | 
						|
        },
 | 
						|
    };
 | 
						|
 | 
						|
    const textModalApp = new Vue({
 | 
						|
        delimiters: ['[[', ']]'],
 | 
						|
        el: '#text-modal',
 | 
						|
        data: {
 | 
						|
            txtModal: txtModal,
 | 
						|
        },
 | 
						|
    });
 | 
						|
 | 
						|
</script>
 | 
						|
{{end}}
 |