]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/panel/ACMEAccount.js
1 Ext
.define('Proxmox.panel.ACMEAccounts', {
2 extend
: 'Ext.grid.Panel',
3 xtype
: 'pmxACMEAccounts',
5 title
: gettext('Accounts'),
10 xclass
: 'Ext.app.ViewController',
12 addAccount: function() {
14 let view
= me
.getView();
15 let defaultExists
= view
.getStore().findExact('name', 'default') !== -1;
16 Ext
.create('Proxmox.window.ACMEAccountCreate', {
18 acmeUrl
: view
.acmeUrl
,
19 taskDone: function() {
25 viewAccount: function() {
27 let view
= me
.getView();
28 let selection
= view
.getSelection();
29 if (selection
.length
< 1) return;
30 Ext
.create('Proxmox.window.ACMEAccountView', {
31 url
: `${view.acmeUrl}/account/${selection[0].data.name}`,
37 let view
= me
.getView();
38 view
.getStore().rstore
.load();
41 showTaskAndReload: function(options
, success
, response
) {
45 let upid
= response
.result
.data
;
46 Ext
.create('Proxmox.window.TaskProgress', {
48 taskDone: function() {
56 emptyText
: gettext('No Accounts configured'),
61 text
: gettext('Name'),
62 renderer
: Ext
.String
.htmlEncode
,
68 itemdblclick
: 'viewAccount',
74 autoDestroyRstore
: true,
77 storeid
: 'proxmox-acme-accounts',
78 model
: 'proxmox-acme-accounts',
84 initComponent: function() {
88 throw "no acmeUrl given";
94 xtype
: 'proxmoxButton',
97 handler
: 'addAccount',
100 xtype
: 'proxmoxButton',
101 text
: gettext('View'),
102 handler
: 'viewAccount',
106 xtype
: 'proxmoxStdRemoveButton',
107 baseurl
: `${me.acmeUrl}/account`,
108 callback
: 'showTaskAndReload',
114 me
.store
.rstore
.proxy
.setUrl(`/api2/json/${me.acmeUrl}/account`);