* [PATCH manager v3] ui: ha: add disarm/re-arm button
@ 2026-04-16 11:20 Dominik Rusovac
2026-05-12 2:43 ` Thomas Lamprecht
2026-05-13 8:15 ` Dominik Rusovac
0 siblings, 2 replies; 4+ messages in thread
From: Dominik Rusovac @ 2026-04-16 11:20 UTC (permalink / raw)
To: pve-devel
The button to disarm HA in either of the resource modes ('freeze' or
'ignore') is disabled as long as HA is disarmed. Analogously, the button
to arm HA is disabled as long as HA is not disarmed.
For feedback, after clicking either of the buttons, icon spins as long as
(dis)arming process has not changed the armed-state of HA.
The icons ('unlink' and 'link') are chosen to emphasize that "Disarm HA"
and "Arm HA" are complements. There may be more suitable pairs of icons
though.
Signed-off-by: Dominik Rusovac <d.rusovac@proxmox.com>
---
changes since v2:
* inline setting isDisarmed flag
* use 'tbar'
* switch positions of buttons
* hook into 'hastatuschange' to provide feedback via spinning icon while
armed-state of HA changes:
- add 'isDisarmedPendingState' to controller
- on successful (dis)arm request, store expected 'isDisarmed'-value
in 'isDisarmedPendingState'
- match 'isDisarmedPendingState' on 'isDisarmed' in 'hastatuschange'
and clear 'isDisarmedPendingState'
www/manager6/ha/Status.js | 113 ++++++++++++++++++++++++++++++++++
www/manager6/ha/StatusView.js | 8 +++
2 files changed, 121 insertions(+)
diff --git a/www/manager6/ha/Status.js b/www/manager6/ha/Status.js
index b0b0feb9..42b498ef 100644
--- a/www/manager6/ha/Status.js
+++ b/www/manager6/ha/Status.js
@@ -8,6 +8,102 @@ Ext.define('PVE.ha.Status', {
align: 'stretch',
},
+ viewModel: {
+ data: {
+ haDisarmed: false,
+ },
+ },
+
+ controller: {
+ xclass: 'Ext.app.ViewController',
+
+ isDisarmedPendingState: null,
+
+ handleDisarmButton: function (menuItem) {
+ let me = this;
+ let view = me.getView();
+
+ Ext.Msg.confirm(
+ gettext('Confirm'),
+ Ext.String.format(
+ gettext("Are you sure you want to disarm HA with resource mode '{0}'?"),
+ menuItem.text,
+ ),
+ function (btn) {
+ if (btn !== 'yes') {
+ return;
+ }
+ Proxmox.Utils.API2Request({
+ url: '/cluster/ha/status/disarm-ha',
+ params: { 'resource-mode': menuItem.mode },
+ method: 'POST',
+ success: function () {
+ me.isDisarmedPendingState = true;
+ view.mask(gettext('Disarming HA...'));
+ },
+ failure: (response) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
+ });
+ },
+ );
+ },
+
+ handleArmButton: function () {
+ let me = this;
+ let view = me.getView();
+
+ Ext.Msg.confirm(
+ gettext('Confirm'),
+ gettext('Are you sure you want to arm HA?'),
+ function (btn) {
+ if (btn !== 'yes') {
+ return;
+ }
+ Proxmox.Utils.API2Request({
+ url: '/cluster/ha/status/arm-ha',
+ method: 'POST',
+ success: function () {
+ me.isDisarmedPendingState = false;
+ view.mask(gettext('Arming HA...'));
+ },
+ failure: (response) => Ext.Msg.alert(gettext('Error'), response.htmlStatus),
+ });
+ },
+ );
+ },
+ },
+
+ tbar: [
+ {
+ text: gettext('Arm HA'),
+ iconCls: 'fa fa-link',
+ bind: {
+ disabled: '{!haDisarmed}',
+ },
+ handler: 'handleArmButton',
+ },
+ {
+ text: gettext('Disarm HA'),
+ iconCls: 'fa fa-unlink',
+ bind: {
+ disabled: '{haDisarmed}',
+ },
+ menu: [
+ {
+ text: gettext('Freeze'),
+ iconCls: 'fa fa-snowflake-o',
+ mode: 'freeze',
+ handler: 'handleDisarmButton',
+ },
+ {
+ text: gettext('Ignore'),
+ iconCls: 'fa fa-eye-slash',
+ mode: 'ignore',
+ handler: 'handleDisarmButton',
+ },
+ ],
+ },
+ ],
+
initComponent: function () {
var me = this;
@@ -30,6 +126,23 @@ Ext.define('PVE.ha.Status', {
border: 0,
collapsible: true,
padding: '0 0 20 0',
+ listeners: {
+ hastatuschange: function (isDisarmed) {
+ let vm = me.getViewModel();
+ let controller = me.getController();
+
+ vm.set('haDisarmed', isDisarmed);
+
+ if (controller.isDisarmedPendingState === null) {
+ return;
+ }
+
+ if (isDisarmed === controller.isDisarmedPendingState) {
+ me.unmask();
+ controller.isDisarmedPendingState = null;
+ }
+ },
+ },
},
{
xtype: 'pveHAResourcesView',
diff --git a/www/manager6/ha/StatusView.js b/www/manager6/ha/StatusView.js
index bc2da71f..4cbe85a1 100644
--- a/www/manager6/ha/StatusView.js
+++ b/www/manager6/ha/StatusView.js
@@ -42,6 +42,13 @@ Ext.define(
},
});
+ me.rstore.on('load', function () {
+ let fencing = store.findRecord('type', 'fencing');
+ let disarmed = fencing && fencing.get('armed-state') === 'disarmed';
+
+ me.fireEvent('hastatuschange', disarmed);
+ });
+
Ext.apply(me, {
store: store,
stateful: false,
@@ -105,6 +112,7 @@ Ext.define(
return PVE.data.ResourceStore.guestName(vmid);
},
},
+ 'armed-state',
],
idProperty: 'id',
});
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH manager v3] ui: ha: add disarm/re-arm button
2026-04-16 11:20 [PATCH manager v3] ui: ha: add disarm/re-arm button Dominik Rusovac
@ 2026-05-12 2:43 ` Thomas Lamprecht
2026-05-12 6:58 ` Dominik Rusovac
2026-05-13 8:15 ` Dominik Rusovac
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Lamprecht @ 2026-05-12 2:43 UTC (permalink / raw)
To: Dominik Rusovac, pve-devel
On 16/04/2026 13:19, Dominik Rusovac wrote:
> The button to disarm HA in either of the resource modes ('freeze' or
> 'ignore') is disabled as long as HA is disarmed. Analogously, the button
> to arm HA is disabled as long as HA is not disarmed.
>
> For feedback, after clicking either of the buttons, icon spins as long as
> (dis)arming process has not changed the armed-state of HA.
>
> The icons ('unlink' and 'link') are chosen to emphasize that "Disarm HA"
> and "Arm HA" are complements. There may be more suitable pairs of icons
> though.
>
Thanks for this, works OK implementation wise.
> Signed-off-by: Dominik Rusovac <d.rusovac@proxmox.com>
> ---
> changes since v2:
> * inline setting isDisarmed flag
> * use 'tbar'
> * switch positions of buttons
> * hook into 'hastatuschange' to provide feedback via spinning icon while
> armed-state of HA changes:
Can we drop that? It's rather confusing, especially as its gone if one
switches away to another panel and then back to the HA one while disarm
is still running. And even if one could fix that by checking the status,
I'd still not mask the whole resources here, seems just a bit odd to do.
If, then I'd show a spinning icon at the end of the "fencing" status row,
but not a a must either, I just wanted to put the idea out there as a
trade to get some feedback for the user.
In the prompt's I'd find it nice if you could add another sentence for
what disarming means for each mode.
Like:
"Are you sure you want to disarm HA with resource mode 'Freeze'?
This will freeze all services allowing no change to their operational state."
and:
"Are you sure you want to disarm HA with resource mode 'Ignore'?
This will allow fully circumventing the HA stack for changing the operational state of a service during disarmament."
Maybe throw in that no service will be recovered during HA being disarmed,
albeit that is IMO a bit more intuitive than the different modes for (newer) users.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH manager v3] ui: ha: add disarm/re-arm button
2026-05-12 2:43 ` Thomas Lamprecht
@ 2026-05-12 6:58 ` Dominik Rusovac
0 siblings, 0 replies; 4+ messages in thread
From: Dominik Rusovac @ 2026-05-12 6:58 UTC (permalink / raw)
To: Thomas Lamprecht, pve-devel
thx for taking the time
I will send a v4
On Tue May 12, 2026 at 4:43 AM CEST, Thomas Lamprecht wrote:
> On 16/04/2026 13:19, Dominik Rusovac wrote:
>> The button to disarm HA in either of the resource modes ('freeze' or
>> 'ignore') is disabled as long as HA is disarmed. Analogously, the button
>> to arm HA is disabled as long as HA is not disarmed.
>>
>> For feedback, after clicking either of the buttons, icon spins as long as
>> (dis)arming process has not changed the armed-state of HA.
>>
>> The icons ('unlink' and 'link') are chosen to emphasize that "Disarm HA"
>> and "Arm HA" are complements. There may be more suitable pairs of icons
>> though.
>>
>
> Thanks for this, works OK implementation wise.
>
>> Signed-off-by: Dominik Rusovac <d.rusovac@proxmox.com>
>> ---
>> changes since v2:
>> * inline setting isDisarmed flag
>> * use 'tbar'
>> * switch positions of buttons
>> * hook into 'hastatuschange' to provide feedback via spinning icon while
>> armed-state of HA changes:
>
> Can we drop that? It's rather confusing, especially as its gone if one
> switches away to another panel and then back to the HA one while disarm
> is still running. And even if one could fix that by checking the status,
> I'd still not mask the whole resources here, seems just a bit odd to do.
sure, I wouldn't mind dropping it
>
> If, then I'd show a spinning icon at the end of the "fencing" status row,
> but not a a must either, I just wanted to put the idea out there as a
> trade to get some feedback for the user.
personally, I don't have a strong opinion on the matter. sounds like a
reasonable compromise to me
>
> In the prompt's I'd find it nice if you could add another sentence for
> what disarming means for each mode.
>
> Like:
>
> "Are you sure you want to disarm HA with resource mode 'Freeze'?
>
> This will freeze all services allowing no change to their operational state."
>
> and:
>
> "Are you sure you want to disarm HA with resource mode 'Ignore'?
>
> This will allow fully circumventing the HA stack for changing the operational state of a service during disarmament."
>
> Maybe throw in that no service will be recovered during HA being disarmed,
> albeit that is IMO a bit more intuitive than the different modes for (newer) users.
ok will do
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH manager v3] ui: ha: add disarm/re-arm button
2026-04-16 11:20 [PATCH manager v3] ui: ha: add disarm/re-arm button Dominik Rusovac
2026-05-12 2:43 ` Thomas Lamprecht
@ 2026-05-13 8:15 ` Dominik Rusovac
1 sibling, 0 replies; 4+ messages in thread
From: Dominik Rusovac @ 2026-05-13 8:15 UTC (permalink / raw)
To: Dominik Rusovac, pve-devel
Superseded-by: https://lore.proxmox.com/all/20260513081123.1042628-1-d.rusovac@proxmox.com/
On Thu Apr 16, 2026 at 1:20 PM CEST, Dominik Rusovac wrote:
> The button to disarm HA in either of the resource modes ('freeze' or
> 'ignore') is disabled as long as HA is disarmed. Analogously, the button
> to arm HA is disabled as long as HA is not disarmed.
>
> For feedback, after clicking either of the buttons, icon spins as long as
> (dis)arming process has not changed the armed-state of HA.
>
> The icons ('unlink' and 'link') are chosen to emphasize that "Disarm HA"
> and "Arm HA" are complements. There may be more suitable pairs of icons
> though.
>
> Signed-off-by: Dominik Rusovac <d.rusovac@proxmox.com>
> ---
> changes since v2:
> * inline setting isDisarmed flag
> * use 'tbar'
> * switch positions of buttons
> * hook into 'hastatuschange' to provide feedback via spinning icon while
> armed-state of HA changes:
> - add 'isDisarmedPendingState' to controller
> - on successful (dis)arm request, store expected 'isDisarmed'-value
> in 'isDisarmedPendingState'
> - match 'isDisarmedPendingState' on 'isDisarmed' in 'hastatuschange'
> and clear 'isDisarmedPendingState'
>
> www/manager6/ha/Status.js | 113 ++++++++++++++++++++++++++++++++++
> www/manager6/ha/StatusView.js | 8 +++
> 2 files changed, 121 insertions(+)
>
[snip]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-13 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 11:20 [PATCH manager v3] ui: ha: add disarm/re-arm button Dominik Rusovac
2026-05-12 2:43 ` Thomas Lamprecht
2026-05-12 6:58 ` Dominik Rusovac
2026-05-13 8:15 ` Dominik Rusovac
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.