Skip to content

Commit

Permalink
dhcp/dhcrelay: Integrate layout_partials/base_apply_button (#8314)
Browse files Browse the repository at this point in the history
  • Loading branch information
Monviech authored Feb 12, 2025
1 parent ad95318 commit 79e8872
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class RelayController extends IndexController
public function indexAction()
{
$this->view->formDialogRelay = $this->getForm('dialogRelay');
$this->view->formGridRelay = $this->getFormGrid("dialogRelay", null, "relayChangeMessage");
$this->view->formGridRelay = $this->getFormGrid('dialogRelay');

$this->view->formDialogDest = $this->getForm('dialogDest');
$this->view->formGridDest = $this->getFormGrid("dialogDest", null, "relayChangeMessage");
$this->view->formGridDest = $this->getFormGrid('dialogDest');

$this->view->pick('OPNsense/DHCRelay/relay');
}
Expand Down
27 changes: 3 additions & 24 deletions src/opnsense/mvc/app/views/OPNsense/DHCRelay/relay.volt
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,12 @@ $( document ).ready(function() {
$("#reconfigureAct").SimpleActionButton();
});
</script>

<div class="content-box __mb">
{{ partial('layout_partials/base_bootgrid_table', formGridDest)}}
</div>

<div class="content-box __mb">
{{ partial('layout_partials/base_bootgrid_table', formGridRelay)}}
</div>

<section class="page-content-main">
<div class="content-box">
<div class="col-md-12">
<br/>
<button class="btn btn-primary" id="reconfigureAct"
data-endpoint='/api/dhcrelay/service/reconfigure'
data-label="{{ lang._('Apply') }}"
data-grid-reload="grid-relay"
data-error-title="{{ lang._('Error reconfiguring dhcrelay') }}"
type="button">
</button>
<br/><br/>
</div>
</div>
<div id="relayChangeMessage" class="alert alert-info" style="display: none" role="alert">
{{ lang._('After changing settings, please remember to apply them.') }}
</div>
</section>

{{ partial("layout_partials/base_dialog",['fields':formDialogRelay,'id':formGridRelay['edit_dialog_id'],'label':lang._('Edit DHCP relay')])}}
{{ partial("layout_partials/base_dialog",['fields':formDialogDest,'id':formGridDest['edit_dialog_id'],'label':lang._('Edit DHCP destination')])}}
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/dhcrelay/service/reconfigure', 'data_grid_reload': formGridRelay['table_id']}) }}
{{ partial('layout_partials/base_dialog',['fields':formDialogRelay,'id':formGridRelay['edit_dialog_id'],'label':lang._('Edit DHCP relay')])}}
{{ partial('layout_partials/base_dialog',['fields':formDialogDest,'id':formGridDest['edit_dialog_id'],'label':lang._('Edit DHCP destination')])}}

0 comments on commit 79e8872

Please sign in to comment.