]>
git.proxmox.com Git - proxmox-backup.git/blob - www/window/DatastoreRepoInfo.js
1 Ext
.define('PBS.window.DatastoreRepoInfo', {
2 extend
: 'Ext.window.Window',
3 alias
: 'widget.pbsDatastoreRepoInfo',
4 mixins
: ['Proxmox.Mixin.CBind'],
6 title
: gettext('Connection Information'),
14 cbindData: function() {
16 let fingerprint
= Proxmox
.Fingerprint
;
17 let host
= window
.location
.hostname
;
19 if (window
.location
.port
.toString() !== "8007") {
20 host
+= `:${window.location.port}`;
22 let datastore
= me
.datastore
;
23 let user
= Proxmox
.UserName
;
24 let repository
= `${host}:${datastore}`;
25 let repositoryWithUser
= `${user}@${host}:${datastore}`;
37 xtype
: 'pbsCopyField',
43 fieldLabel
: gettext('Datastore'),
49 fieldLabel
: gettext('Hostname/IP'),
55 fieldLabel
: gettext('Fingerprint'),
57 value
: '{fingerprint}',
58 hidden
: '{!fingerprint}',
62 xtype
: 'displayfield',
65 fieldLabel
: gettext('Repository for CLI and API'),
69 fieldLabel
: gettext('Repository'),
71 value
: '{repository}',
75 fieldLabel
: gettext('With Current User'),
77 value
: '{repositoryWithUser}',
83 xtype
: 'proxmoxHelpButton',
84 onlineHelp
: 'client_repository',
91 this.up('window').close();
97 Ext
.define('PBS.form.CopyField', {
98 extend
: 'Ext.form.FieldContainer',
99 alias
: 'widget.pbsCopyField',
106 itemId
: 'inputField',
113 iconCls
: 'fa fa-clipboard x-btn-icon-el-default-toolbar-small',
115 cls
: 'x-btn-default-toolbar-small proxmox-inline-button',
116 handler
: async
function() {
118 let field
= me
.up('pbsCopyField');
119 let el
= field
.getComponent('inputField')?.inputEl
;
123 await navigator
.clipboard
.writeText(el
.dom
.value
);
125 text
: gettext('Copy'),
129 initComponent: function() {
132 me
.getComponent('inputField').setValue(me
.value
);