feat(admin): telegram settings improvements (#63)
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
This commit is contained in:
@@ -1,7 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<SettingsItem :label="label">
|
<SettingsItem :label="label">
|
||||||
<template #default>
|
<template #default>
|
||||||
|
<InputGroup v-if="allowCopy && isSupported">
|
||||||
|
<Button
|
||||||
|
:key="copied ? 'copied' : 'copy'"
|
||||||
|
:icon="copied ? 'fa fa-check' : 'fa fa-copy'"
|
||||||
|
severity="secondary"
|
||||||
|
v-tooltip.top="{ value: copied ? 'Скопировано' : 'Скопировать' }"
|
||||||
|
@click="copyToClipboard"
|
||||||
|
/>
|
||||||
|
<InputText
|
||||||
|
:type="type"
|
||||||
|
v-model="model"
|
||||||
|
class="form-control"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:readonly="readonly"
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
|
||||||
<InputText
|
<InputText
|
||||||
|
v-else
|
||||||
:type="type"
|
:type="type"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
@@ -18,6 +36,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import SettingsItem from "@/components/SettingsItem.vue";
|
import SettingsItem from "@/components/SettingsItem.vue";
|
||||||
import InputText from 'primevue/inputtext';
|
import InputText from 'primevue/inputtext';
|
||||||
|
import InputGroup from 'primevue/inputgroup';
|
||||||
|
import Button from 'primevue/button';
|
||||||
|
import { useClipboard } from '@vueuse/core';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
label: {
|
label: {
|
||||||
@@ -36,10 +57,16 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
allowCopy: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const model = defineModel();
|
const model = defineModel();
|
||||||
|
|
||||||
|
const { copy, copied, isSupported } = useClipboard({ source: model })
|
||||||
|
|
||||||
|
function copyToClipboard() {
|
||||||
|
copy();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
type="text"
|
type="text"
|
||||||
:readonly="true"
|
:readonly="true"
|
||||||
:modelValue="model"
|
:modelValue="model"
|
||||||
|
:allowCopy="true"
|
||||||
>
|
>
|
||||||
Токен, полученный при создании бота через @BotFather.
|
Ссылка на сайт с TeleCart витриной, которую нужно указывать в настройках MiniApp в @BotFather.<br>
|
||||||
Он используется для взаимодействия модуля с Telegram API.
|
Подробная инструкция по настройке в
|
||||||
Подробная инструкция доступна в
|
<a href="https://docs.telecart.pro/telegram/telegram/" target="_blank">
|
||||||
<a href="https://nikitakiselev.github.io/telecart-docs/#telegram" target="_blank">
|
|
||||||
документации <i class="fa fa-external-link"></i>
|
документации <i class="fa fa-external-link"></i>
|
||||||
</a>.
|
</a>.
|
||||||
</ItemInput>
|
</ItemInput>
|
||||||
|
|||||||
Reference in New Issue
Block a user