FEAT: всплывающее сообщение при копировании конфига
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,6 +10,7 @@ const KB_UNIT_MAP = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const toast = useToast()
|
||||||
|
|
||||||
const tab = ref('0')
|
const tab = ref('0')
|
||||||
const tabs = ref([
|
const tabs = ref([
|
||||||
@@ -121,12 +122,27 @@ const formatValue = (value) => {
|
|||||||
// return formatted
|
// return formatted
|
||||||
return `${result.value}${result.unit}`
|
return `${result.value}${result.unit}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onCopyConfig = () => {
|
||||||
|
copy(config)
|
||||||
|
toast.add({
|
||||||
|
title: 'Скопировано',
|
||||||
|
description: 'Конфигурация скопирована успешно',
|
||||||
|
duration: 7500,
|
||||||
|
icon: 'lucide:copy',
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="space-y-4 min-w-0 w-full">
|
<section class="space-y-4 min-w-0 w-full">
|
||||||
<UTabs v-model="tab" :content="false" :items="tabs" class="w-full" />
|
<UTabs v-model="tab" :content="false" :items="tabs" class="w-full" />
|
||||||
<pre class="w-full overflow-x-auto whitespace-pre">{{ config }}</pre>
|
<pre class="w-full overflow-x-auto whitespace-pre">{{ config }}</pre>
|
||||||
<UButton label="Copy config" block @click="copy(config)" />
|
<UButton
|
||||||
|
label="Копировать конфигурацию"
|
||||||
|
block
|
||||||
|
icon="lucide:copy"
|
||||||
|
@click="onCopyConfig"
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user