I have another problem ;)
I tried to search lines and replace with values in a proxmox file, part of this file:
...
success: function(response, opts) {
let res = response.result;
if (res === null || res === undefined || !res || res
.data.status.toLowerCase() !== 'active') {
Ext.Msg.show({
title: gettext('No valid subscription'),
icon: Ext.Msg.WARNING,
message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
buttons: Ext.Msg.OK,
callback: function(btn) {
if (btn !== 'ok') {
....
Note that Ext.Msg.show is repeated several times in the file but I only have to change this occurrence
i need to change it by :
success: function(response, opts) {
let res = response.result;
if (res === null || res === undefined || !res || res
.data.status.toLowerCase() !== 'active') {
void{//Ext.Msg.show({
title: gettext('No valid subscription'),
icon: Ext.Msg.WARNING,
message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
buttons: Ext.Msg.OK,
callback: function(btn) {
if (btn !== 'ok') {
i try this bundle whitout success
bundle agent sys_conf_proxmox
{
methods:
pve2::
"any" usebundle => supp_message_subscription;
}
bundle agent supp_message_subscription
{
vars:
"msg_a_remplacer" string => "Ext.Msg.show({
title: gettext('No valid subscription'),";
"msg_remplacant" string => "void({ //Ext.Msg.show({
title: gettext('No valid subscription'),";
"fic_conf_pve" string => "/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js";
files:
"$(fic_conf_pve)"
edit_line => remplacement_ligne($(msg_a_remplacer),$(msg_remplacant),all),
edit_defaults => levee_limite_fic,
comment => "Supression subscription pve",
classes => if_repaired(relance_web_pve),
action => if_elapsed(60);
services:
"pveproxy.service"
service_policy => "restart";
}
body edit_defaults levee_limite_fic
{
max_file_size => "500K";
}
bundle edit_line remplacement_ligne(a_remplacer,remplacant,nb_occurences)
{
replace_patterns:
"$(a_remplacer)"
replace_with => ligne_text($(remplacant),$(nb_occurences));
}
Thanks for your replies ;)