Use ClipboardButton everywhere

This commit is contained in:
Girish Ramakrishnan
2025-10-07 13:57:16 +02:00
parent 677f11ba1a
commit 24fc480f7b
7 changed files with 15 additions and 49 deletions
+2 -8
View File
@@ -1,8 +1,7 @@
<script setup>
import { ref, onMounted, computed } from 'vue';
import { Button, FormGroup, Checkbox, PasswordInput, TextInput, InputGroup } from '@cloudron/pankow';
import { copyToClipboard } from '@cloudron/pankow/utils';
import { Button, FormGroup, ClipboardButton, Checkbox, PasswordInput, TextInput, InputGroup } from '@cloudron/pankow';
import Section from './Section.vue';
import DomainsModel from '../models/DomainsModel.js';
import DashboardModel from '../models/DashboardModel.js';
@@ -29,11 +28,6 @@ const isValid = computed(() => {
return true;
});
function onCopyToClipboard(value) {
copyToClipboard(value);
window.pankow.notify({ type: 'success', text: 'LDAP URL copied!' });
}
async function onSubmit() {
if (!isValid.value) return;
@@ -90,7 +84,7 @@ onMounted(async () => {
<label for="ldapUrlInput">{{ $t('users.exposedLdap.secret.url') }}</label>
<InputGroup>
<TextInput id="ldapUrlInput" v-model="ldapUrl" readonly style="flex-grow: 1;"/>
<Button tool @click="onCopyToClipboard(ldapUrl)" icon="fa fa-clipboard" />
<ClipboardButton :value="ldapUrl" />
</InputGroup>
<div class="warning-label" v-show="adminDomain.provider === 'cloudflare'">{{ $t('users.exposedLdap.cloudflarePortWarning') }}</div>
</FormGroup>