From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 34D1C1FF0B3 for ; Thu, 26 Nov 2026 14:43:04 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 47AD6216FC; Thu, 26 Nov 2026 14:42:27 +0100 (CET) From: Jonas Theisen To: pve-devel@lists.proxmox.com Subject: [PATCH widget-toolkit 09/16] node: time: add button to open the NTP service log Date: Thu, 26 Nov 2026 14:40:06 +0100 Message-ID: <20261126134128.316681-10-j.theisen@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261126134128.316681-1-j.theisen@proxmox.com> References: <20261126134128.316681-1-j.theisen@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795700517043 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.068 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: SRKFN2L2EPLLE4C7OLB4IHKAES3RBYPF X-Message-ID-Hash: SRKFN2L2EPLLE4C7OLB4IHKAES3RBYPF X-MailFrom: j.theisen@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Allow opening the log of the active NTP service directly from the time view, for example to check why the clock is not synchronized after changing the NTP servers, without having to look up the service in the service list first. The button is only shown if the API reports a supported NTP service, as the view is shared with products whose time API does not provide it. Like the service view, the time view can be configured to use the journal instead of the syslog API endpoint. Double clicking or pressing enter on the NTP service row opens the log as well, as the edit window does not allow changing the service. Signed-off-by: Jonas Theisen --- src/node/TimeView.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/node/TimeView.js b/src/node/TimeView.js index ca08f98..b2c4d68 100644 --- a/src/node/TimeView.js +++ b/src/node/TimeView.js @@ -2,6 +2,9 @@ Ext.define('Proxmox.node.TimeView', { extend: 'Proxmox.grid.ObjectGrid', alias: ['widget.proxmoxNodeTimeView'], + // show the NTP service log from the journal API endpoint instead of the syslog one + useJournalLog: false, + initComponent: function () { let me = this; @@ -26,14 +29,32 @@ Ext.define('Proxmox.node.TimeView', { let get_ntp_service = () => me.rstore.getById('ntp-service')?.data.value; - // the rows with read-only status information have no action + let view_service_log = () => + Ext.create('Proxmox.window.ServiceLog', { + nodename: me.nodename, + service: get_ntp_service(), + useJournalLog: me.useJournalLog, + autoShow: true, + }); + + // double click or enter on the NTP service row shows its log instead of the editor, the rows + // with read-only status information have no action let run_row_action = () => { let key = me.getSelectionModel().getSelection()[0]?.data.key; - if (key !== 'localtime' && key !== 'ntp-synchronized') { + if (key === 'ntp-service') { + view_service_log(); + } else if (key !== 'localtime' && key !== 'ntp-synchronized') { run_editor(); } }; + // only shown if the API reports a supported NTP service + let syslog_btn = new Ext.Button({ + text: gettext('Service System Log'), + hidden: true, + handler: view_service_log, + }); + let rows = { timezone: { header: gettext('Time zone'), @@ -92,6 +113,7 @@ Ext.define('Proxmox.node.TimeView', { text: gettext('Edit'), handler: run_editor, }, + syslog_btn, ], listeners: { itemdblclick: run_row_action, @@ -106,6 +128,8 @@ Ext.define('Proxmox.node.TimeView', { }), ); + me.mon(me.rstore, 'load', () => syslog_btn.setVisible(!!get_ntp_service())); + me.on('activate', me.rstore.startUpdate); me.on('deactivate', me.rstore.stopUpdate); me.on('destroy', me.rstore.stopUpdate); -- 2.47.3