Skip to content

Commit

Permalink
Merge branch 'proxmox:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
wy414012 authored Nov 14, 2024
2 parents 5e55a7e + d8f672e commit c804da2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 490 deletions.
3 changes: 3 additions & 0 deletions PVE/API2/Cluster.pm
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ __PACKAGE__->register_method({
if (defined(my $mode = $info->{'cgroup-mode'})) {
$entry->{'cgroup-mode'} = int($mode);
}
if (defined(my $status = $hastatus->{node_status}->{$node})) {
$entry->{'hastate'} = $status;
}

push @$res, $entry;
}
Expand Down
10 changes: 10 additions & 0 deletions www/css/ext6-pve.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@
font-size: 0.75em;
}

/* blue wrench */
.x-tree-icon-custom.ha-maintenance:after,
.x-grid-icon-custom.ha-maintenance:after {
content: "\f0ad";
color: #3892d4;
/* make it a little bigger since the icon is very small */
font-size: 14px;
}


/* yellow ! triangle */
.x-tree-icon-custom.pending:after,
.x-grid-icon-custom.pending:after,
Expand Down
1 change: 0 additions & 1 deletion www/manager6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ JSSRC= \
ha/StatusView.js \
dc/ACLView.js \
dc/ACMEClusterView.js \
dc/ACMEPluginEdit.js \
dc/AuthEditBase.js \
dc/AuthEditAD.js \
dc/AuthEditLDAP.js \
Expand Down
204 changes: 4 additions & 200 deletions www/manager6/dc/ACMEClusterView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,204 +18,6 @@ Ext.define('pve-acme-plugins', {
idProperty: 'plugin',
});

Ext.define('PVE.dc.ACMEAccountView', {
extend: 'Ext.grid.Panel',
alias: 'widget.pveACMEAccountView',

title: gettext('Accounts'),

controller: {
xclass: 'Ext.app.ViewController',

addAccount: function() {
let me = this;
let view = me.getView();
let defaultExists = view.getStore().findExact('name', 'default') !== -1;
Ext.create('PVE.node.ACMEAccountCreate', {
defaultExists,
taskDone: function() {
me.reload();
},
}).show();
},

viewAccount: function() {
let me = this;
let view = me.getView();
let selection = view.getSelection();
if (selection.length < 1) return;
Ext.create('PVE.node.ACMEAccountView', {
accountname: selection[0].data.name,
}).show();
},

reload: function() {
let me = this;
let view = me.getView();
view.getStore().rstore.load();
},

showTaskAndReload: function(options, success, response) {
let me = this;
if (!success) return;

let upid = response.result.data;
Ext.create('Proxmox.window.TaskProgress', {
upid,
taskDone: function() {
me.reload();
},
}).show();
},
},

minHeight: 150,
emptyText: gettext('No Accounts configured'),

columns: [
{
dataIndex: 'name',
text: gettext('Name'),
renderer: Ext.String.htmlEncode,
flex: 1,
},
],

tbar: [
{
xtype: 'proxmoxButton',
text: gettext('Add'),
selModel: false,
handler: 'addAccount',
},
{
xtype: 'proxmoxButton',
text: gettext('View'),
handler: 'viewAccount',
disabled: true,
},
{
xtype: 'proxmoxStdRemoveButton',
baseurl: '/cluster/acme/account',
callback: 'showTaskAndReload',
},
],

listeners: {
itemdblclick: 'viewAccount',
},

store: {
type: 'diff',
autoDestroy: true,
autoDestroyRstore: true,
rstore: {
type: 'update',
storeid: 'pve-acme-accounts',
model: 'pve-acme-accounts',
autoStart: true,
},
sorters: 'name',
},
});

Ext.define('PVE.dc.ACMEPluginView', {
extend: 'Ext.grid.Panel',
alias: 'widget.pveACMEPluginView',

title: gettext('Challenge Plugins'),

controller: {
xclass: 'Ext.app.ViewController',

addPlugin: function() {
let me = this;
Ext.create('PVE.dc.ACMEPluginEditor', {
isCreate: true,
apiCallDone: function() {
me.reload();
},
}).show();
},

editPlugin: function() {
let me = this;
let view = me.getView();
let selection = view.getSelection();
if (selection.length < 1) return;
let plugin = selection[0].data.plugin;
Ext.create('PVE.dc.ACMEPluginEditor', {
url: `/cluster/acme/plugins/${plugin}`,
apiCallDone: function() {
me.reload();
},
}).show();
},

reload: function() {
let me = this;
let view = me.getView();
view.getStore().rstore.load();
},
},

minHeight: 150,
emptyText: gettext('No Plugins configured'),

columns: [
{
dataIndex: 'plugin',
text: gettext('Plugin'),
renderer: Ext.String.htmlEncode,
flex: 1,
},
{
dataIndex: 'api',
text: 'API',
renderer: Ext.String.htmlEncode,
flex: 1,
},
],

tbar: [
{
xtype: 'proxmoxButton',
text: gettext('Add'),
handler: 'addPlugin',
selModel: false,
},
{
xtype: 'proxmoxButton',
text: gettext('Edit'),
handler: 'editPlugin',
disabled: true,
},
{
xtype: 'proxmoxStdRemoveButton',
baseurl: '/cluster/acme/plugins',
callback: 'reload',
},
],

listeners: {
itemdblclick: 'editPlugin',
},

store: {
type: 'diff',
autoDestroy: true,
autoDestroyRstore: true,
rstore: {
type: 'update',
storeid: 'pve-acme-plugins',
model: 'pve-acme-plugins',
autoStart: true,
filters: item => !!item.data.api,
},
sorters: 'plugin',
},
});

Ext.define('PVE.dc.ACMEClusterView', {
extend: 'Ext.panel.Panel',
alias: 'widget.pveACMEClusterView',
Expand All @@ -226,12 +28,14 @@ Ext.define('PVE.dc.ACMEClusterView', {
{
region: 'north',
border: false,
xtype: 'pveACMEAccountView',
xtype: 'pmxACMEAccounts',
acmeUrl: '/cluster/acme',
},
{
region: 'center',
border: false,
xtype: 'pveACMEPluginView',
xtype: 'pmxACMEPluginView',
acmeUrl: '/cluster/acme',
},
],
});
Loading

0 comments on commit c804da2

Please sign in to comment.