other metho to make button with list

This commit is contained in:
Luiz Costa 2024-06-03 11:37:27 +01:00
parent c330dc93b3
commit 7d5a11d606

View File

@ -1,14 +1,14 @@
frappe.ui.form.on('IT Object', { frappe.ui.form.on('IT Object', {
refresh: function (frm) { refresh: function (frm) {
if (frm.doc.link) { if (frm.doc.link) {
frm.add_custom_button(__('Connect'), null, 'btn-rdp', null, 'btn-ssh'); frm.add_custom_button(__('RDP'), function () {
frm.page.add_menu_item(__('RDP'), function () {
connect_remote(frm, 'RDP'); connect_remote(frm, 'RDP');
}, 'btn-rdp'); }, '__("Connect")');
frm.page.add_menu_item(__('SSH'), function () { frm.add_custom_button(__('SSH'), function () {
connect_remote(frm, 'SSH'); connect_remote(frm, 'SSH');
}, 'btn-ssh'); }, '__("Connect")');
} }
} }
}); });