mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
mvc/view: Create layout_partials/base_apply_button to centralize design of the standard Apply button (#8297)
* mvc/view: Create layout_partials/base_apply_button to centralize design of the standard Apply button * dhcp/kea: Example implementation of layout_partials/base_apply_button * mvc/view: Change edit_alert_id to global static default, add data-grid-reload and dynamic ids to base_apply_button partial
This commit is contained in:
parent
769fa742f7
commit
24a61420cf
1
plist
1
plist
@ -975,6 +975,7 @@
|
||||
/usr/local/opnsense/mvc/app/views/OPNsense/Unbound/stats.volt
|
||||
/usr/local/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt
|
||||
/usr/local/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt
|
||||
/usr/local/opnsense/mvc/app/views/layout_partials/base_apply_button.volt
|
||||
/usr/local/opnsense/mvc/app/views/layout_partials/base_bootgrid_table.volt
|
||||
/usr/local/opnsense/mvc/app/views/layout_partials/base_dialog.volt
|
||||
/usr/local/opnsense/mvc/app/views/layout_partials/base_dialog_processing.volt
|
||||
|
||||
@ -290,7 +290,7 @@ class ControllerBase extends ControllerRoot
|
||||
return [
|
||||
'table_id' => $basename,
|
||||
'edit_dialog_id' => 'dialog_' . $basename,
|
||||
'edit_alert_id' => $edit_alert_id == null ? 'change_message_' . $basename : $edit_alert_id,
|
||||
'edit_alert_id' => $edit_alert_id == null ? 'change_message_base_form' : $edit_alert_id,
|
||||
'fields' => array_values($all_data)
|
||||
];
|
||||
}
|
||||
|
||||
@ -52,13 +52,13 @@ class DhcpController extends \OPNsense\Base\IndexController
|
||||
$this->view->formGeneralSettings = $this->getForm("generalSettings4");
|
||||
|
||||
$this->view->formDialogSubnet = $this->getForm("dialogSubnet4");
|
||||
$this->view->formGridSubnet = $this->getFormGrid("dialogSubnet4", null, "keaChangeMessage");
|
||||
$this->view->formGridSubnet = $this->getFormGrid("dialogSubnet4");
|
||||
|
||||
$this->view->formDialogReservation = $this->getForm("dialogReservation4");
|
||||
$this->view->formGridReservation = $this->getFormGrid("dialogReservation4", null, "keaChangeMessage");
|
||||
$this->view->formGridReservation = $this->getFormGrid("dialogReservation4");
|
||||
|
||||
$this->view->formDialogPeer = $this->getForm("dialogPeer4");
|
||||
$this->view->formGridPeer = $this->getFormGrid("dialogPeer4", null, "keaChangeMessage");
|
||||
$this->view->formGridPeer = $this->getFormGrid("dialogPeer4");
|
||||
}
|
||||
|
||||
public function leases4Action()
|
||||
|
||||
@ -158,23 +158,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="page-content-main">
|
||||
<div class="content-box">
|
||||
<div class="col-md-12">
|
||||
<br/>
|
||||
<div id="keaChangeMessage" class="alert alert-info" style="display: none" role="alert">
|
||||
{{ lang._('After changing settings, please remember to apply them.') }}
|
||||
</div>
|
||||
<button class="btn btn-primary" id="reconfigureAct"
|
||||
data-endpoint='/api/kea/service/reconfigure'
|
||||
data-label="{{ lang._('Apply') }}"
|
||||
data-error-title="{{ lang._('Error reconfiguring DHCPv4') }}"
|
||||
type="button"
|
||||
></button>
|
||||
<br/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ partial('layout_partials/base_apply_button', {'data_endpoint': '/api/kea/service/reconfigure'}) }}
|
||||
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogSubnet,'id':formGridSubnet['edit_dialog_id'],'label':lang._('Edit Subnet')])}}
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogReservation,'id':formGridReservation['edit_dialog_id'],'label':lang._('Edit Reservation')])}}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
<section class="page-content-main">
|
||||
<div class="content-box">
|
||||
<div class="col-md-12">
|
||||
<br/>
|
||||
<div id="{{ message_id|default('change_message_base_form') }}" class="alert alert-info" style="display: none" role="alert">
|
||||
{{ lang._('After changing settings, please remember to apply them.') }}
|
||||
</div>
|
||||
<button class="btn btn-primary" id="{{ button_id|default('reconfigureAct') }}"
|
||||
data-endpoint="{{ data_endpoint }}"
|
||||
data-label="{{ lang._(data_label|default('Apply')) }}"
|
||||
data-error-title="{{ lang._(data_error_title|default('Error reconfiguring service.')) }}"
|
||||
{% if data_service_widget %}
|
||||
data-service-widget="{{ data_service_widget }}"
|
||||
{% endif %}
|
||||
{% if data_grid_reload %}
|
||||
data-grid-reload="{{ data_grid_reload }}"
|
||||
{% endif %}
|
||||
type="button">
|
||||
</button>
|
||||
<br/><br/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Loading…
x
Reference in New Issue
Block a user