Fix up action commands for port forwarding and printers

This commit is contained in:
Brian Read 2024-12-16 13:55:52 +00:00
parent dfda47882d
commit 34e7331845
2 changed files with 23 additions and 5 deletions

View File

@ -93,7 +93,15 @@
%= t td => (class => 'sme-border') => $allow
%= t td => (class => 'sme-border') => $cmmnt
<td class='sme-border'>
<a href="portforwardingd?CsrfDef=TOKEN&trt=DEL&sport=<%= $sport%>&proto=<%= $proto%>"><button class='sme-remove-button' title="<%=l('REMOVE')%>"><%=l('REMOVE') %></button></a>
%my $remove_text = l('REMOVE'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $actionRemove = qq{
% <button type='button' class='sme-remove-button' title='$remove_text'
% onclick="window.location.href='portforwardingd?CsrfDef=$csrf_token&trt=DEL&sport=$sport&proto=$proto'">
% $remove_text
% </button>
%};
<%= $c->render_to_string(inline => $actionRemove) %>
</td>
</tr>
% }
@ -104,5 +112,4 @@
</table>
%= hidden_field 'trt' => $pf_datas->{trt}
</div>
</div>

View File

@ -57,7 +57,18 @@
%= t td => (class => 'sme-border') => $printer->prop('Location')
%= t td => (class => 'sme-border') => $address
%= t td => (class => 'sme-border') => $remoteName
<td class='sme-border'><a href="printers2?CsrfDef=TOKEN&trt=DEL&printer=<%= $printer->key%>"><button class='sme-remove-button' title="<%=l('REMOVE')%>"><%=l('REMOVE') %></button></a></td>
<td class='sme-border'>
%my $remove_text = l('REMOVE'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $printer_name = $printer->key;
%my $actionRemove = qq{
% <button type='button' class='sme-remove-button' title='$remove_text'
% onclick="window.location.href='printers2?CsrfDef=$csrf_token&trt=DEL&&printer=$printer_name'">
% $remove_text
% </button>
%};
<%= $c->render_to_string(inline => $actionRemove) %>
</td>
</tr>
% }
</tbody>
@ -66,4 +77,4 @@
</p>
</div>
</div>