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
+3 -8
View File
@@ -6,8 +6,8 @@ const t = i18n.t;
import moment from 'moment-timezone';
import { ref, onMounted, useTemplateRef, computed } from 'vue';
import { Button, Menu, Dialog, SingleSelect, FormGroup, TextInput, TableView, InputDialog, InputGroup } from '@cloudron/pankow';
import { prettyLongDate, copyToClipboard } from '@cloudron/pankow/utils';
import { Button, Menu, ClipboardButton, Dialog, SingleSelect, FormGroup, TextInput, TableView, InputDialog, InputGroup } from '@cloudron/pankow';
import { prettyLongDate } from '@cloudron/pankow/utils';
import Section from './Section.vue';
import AppPasswordsModel from '../models/AppPasswordsModel.js';
import AppsModel from '../models/AppsModel.js';
@@ -106,11 +106,6 @@ async function onSubmit() {
await refresh();
}
function onCopyToClipboard(password) {
copyToClipboard(password);
window.pankow.notify({ type: 'success', text: 'Password copied!' });
}
async function onRemove(appPassword) {
const yes = await inputDialog.value.confirm({
message: t('profile.removeAppPassword.title', { name: appPassword.name }),
@@ -193,7 +188,7 @@ onMounted(async () => {
<p>{{ $t('profile.createAppPassword.description') }}</p>
<InputGroup>
<TextInput v-model="addedPassword" readonly style="flex-grow: 1;"/>
<Button tool @click="onCopyToClipboard(addedPassword)" icon="fa fa-clipboard" />
<ClipboardButton :value="addedPassword" />
</InputGroup>
<p>{{ $t('profile.createAppPassword.copyNow') }}</p>
</div>