mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-13 20:26:46 +00:00
fix #5188: gui: add copy to clipboard on snapshots
When navigating to Datastores -> Content, it is now possible to right-click on a snapshot/group and copy the name to the clipboard. This makes the proxmox-backup-client much easier to use, especially when restoring archives. Signed-off-by: Gabriel Goller <g.goller@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
e66d75ca2f
commit
2d6413cb00
@ -546,6 +546,10 @@ Ext.define('PBS.DataStoreContent', {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCopy: async function(view, rI, cI, item, e, { data }) {
|
||||||
|
await navigator.clipboard.writeText(data.text);
|
||||||
|
},
|
||||||
|
|
||||||
onNotesEdit: function(view, data) {
|
onNotesEdit: function(view, data) {
|
||||||
let me = this;
|
let me = this;
|
||||||
|
|
||||||
@ -884,6 +888,7 @@ Ext.define('PBS.DataStoreContent', {
|
|||||||
if (record.data.ty === 'group') {
|
if (record.data.ty === 'group') {
|
||||||
menu = Ext.create('PBS.datastore.GroupCmdMenu', {
|
menu = Ext.create('PBS.datastore.GroupCmdMenu', {
|
||||||
title: gettext('Group'),
|
title: gettext('Group'),
|
||||||
|
onCopy: createControllerCallback('onCopy'),
|
||||||
onVerify: createControllerCallback('onVerify'),
|
onVerify: createControllerCallback('onVerify'),
|
||||||
onChangeOwner: createControllerCallback('onChangeOwner'),
|
onChangeOwner: createControllerCallback('onChangeOwner'),
|
||||||
onPrune: createControllerCallback('onPrune'),
|
onPrune: createControllerCallback('onPrune'),
|
||||||
@ -892,6 +897,7 @@ Ext.define('PBS.DataStoreContent', {
|
|||||||
} else if (record.data.ty === 'dir') {
|
} else if (record.data.ty === 'dir') {
|
||||||
menu = Ext.create('PBS.datastore.SnapshotCmdMenu', {
|
menu = Ext.create('PBS.datastore.SnapshotCmdMenu', {
|
||||||
title: gettext('Snapshot'),
|
title: gettext('Snapshot'),
|
||||||
|
onCopy: createControllerCallback('onCopy'),
|
||||||
onVerify: createControllerCallback('onVerify'),
|
onVerify: createControllerCallback('onVerify'),
|
||||||
onProtectionChange: createControllerCallback('onProtectionChange'),
|
onProtectionChange: createControllerCallback('onProtectionChange'),
|
||||||
onForget: createControllerCallback('onForget'),
|
onForget: createControllerCallback('onForget'),
|
||||||
@ -1284,12 +1290,21 @@ Ext.define('PBS.datastore.GroupCmdMenu', {
|
|||||||
extend: 'Ext.menu.Menu',
|
extend: 'Ext.menu.Menu',
|
||||||
mixins: ['Proxmox.Mixin.CBind'],
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
|
onCopy: undefined,
|
||||||
onVerify: undefined,
|
onVerify: undefined,
|
||||||
onChangeOwner: undefined,
|
onChangeOwner: undefined,
|
||||||
onPrune: undefined,
|
onPrune: undefined,
|
||||||
onForget: undefined,
|
onForget: undefined,
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
text: gettext('Copy name to clipboard'),
|
||||||
|
iconCls: 'fa fa-clipboard',
|
||||||
|
handler: function() { this.up('menu').onCopy(); },
|
||||||
|
cbind: {
|
||||||
|
hidden: '{!onCopy}',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: gettext('Verify'),
|
text: gettext('Verify'),
|
||||||
iconCls: 'pve-icon-verify-lettering',
|
iconCls: 'pve-icon-verify-lettering',
|
||||||
@ -1330,11 +1345,21 @@ Ext.define('PBS.datastore.SnapshotCmdMenu', {
|
|||||||
extend: 'Ext.menu.Menu',
|
extend: 'Ext.menu.Menu',
|
||||||
mixins: ['Proxmox.Mixin.CBind'],
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
|
onCopy: undefined,
|
||||||
onVerify: undefined,
|
onVerify: undefined,
|
||||||
onProtectionChange: undefined,
|
onProtectionChange: undefined,
|
||||||
onForget: undefined,
|
onForget: undefined,
|
||||||
|
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
text: gettext('Copy name to clipboard'),
|
||||||
|
iconCls: 'fa fa-clipboard',
|
||||||
|
handler: function() { this.up('menu').onCopy(); },
|
||||||
|
cbind: {
|
||||||
|
hidden: '{!onCopy}',
|
||||||
|
disabled: '{!onCopy}',
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: gettext('Verify'),
|
text: gettext('Verify'),
|
||||||
iconCls: 'pve-icon-verify-lettering',
|
iconCls: 'pve-icon-verify-lettering',
|
||||||
|
Loading…
Reference in New Issue
Block a user