Local IP in Pool

This commit is contained in:
Ibnu Maksum 2024-06-10 16:53:21 +07:00
parent 29c8cb3ea1
commit 78a6708a6d
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
7 changed files with 26 additions and 6 deletions

View File

@ -330,3 +330,4 @@ ALTER TABLE `tbl_customers` ADD `status` ENUM('Active','Banned','Disabled') NOT
ALTER TABLE `tbl_customers` CHANGE `status` `status` ENUM('Active','Banned','Disabled','Inactive','Limited','Suspended') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Active'; ALTER TABLE `tbl_customers` CHANGE `status` `status` ENUM('Active','Banned','Disabled','Inactive','Limited','Suspended') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Active';
ALTER TABLE `tbl_plans` ADD `price_old` VARCHAR(40) NOT NULL DEFAULT '' AFTER `price`; ALTER TABLE `tbl_plans` ADD `price_old` VARCHAR(40) NOT NULL DEFAULT '' AFTER `price`;
ALTER TABLE `tbl_plans` ADD `device` VARCHAR(32) NOT NULL DEFAULT '' AFTER `plan_type`; ALTER TABLE `tbl_plans` ADD `device` VARCHAR(32) NOT NULL DEFAULT '' AFTER `plan_type`;
ALTER TABLE `tbl_pool` ADD `local_ip` VARCHAR(40) NOT NULL DEFAULT '' AFTER `pool_name`;

View File

@ -83,6 +83,7 @@ switch ($action) {
case 'add-post': case 'add-post':
$name = _post('name'); $name = _post('name');
$ip_address = _post('ip_address'); $ip_address = _post('ip_address');
$local_ip = _post('local_ip');
$routers = _post('routers'); $routers = _post('routers');
run_hook('add_pool'); #HOOK run_hook('add_pool'); #HOOK
$msg = ''; $msg = '';
@ -103,6 +104,7 @@ switch ($action) {
} }
$b = ORM::for_table('tbl_pool')->create(); $b = ORM::for_table('tbl_pool')->create();
$d->local_ip = $local_ip;
$b->pool_name = $name; $b->pool_name = $name;
$b->range_ip = $ip_address; $b->range_ip = $ip_address;
$b->routers = $routers; $b->routers = $routers;
@ -116,6 +118,7 @@ switch ($action) {
case 'edit-post': case 'edit-post':
$local_ip = _post('local_ip');
$ip_address = _post('ip_address'); $ip_address = _post('ip_address');
$routers = _post('routers'); $routers = _post('routers');
run_hook('edit_pool'); #HOOK run_hook('edit_pool'); #HOOK
@ -133,6 +136,7 @@ switch ($action) {
} }
if ($msg == '') { if ($msg == '') {
$d->local_ip = $local_ip;
$d->range_ip = $ip_address; $d->range_ip = $ip_address;
$d->routers = $routers; $d->routers = $routers;
$d->save(); $d->save();

View File

@ -631,5 +631,6 @@
"State_of_Resident": "State of Resident", "State_of_Resident": "State of Resident",
"Zip": "Zip", "Zip": "Zip",
"Zip_Code": "Zip Code", "Zip_Code": "Zip Code",
"Local_IP": "Local IP",
"": "" "": ""
} }

View File

@ -106,5 +106,8 @@
"2024.6.5" : [ "2024.6.5" : [
"ALTER TABLE `tbl_plans` ADD `price_old` VARCHAR(40) NOT NULL DEFAULT '' AFTER `price`;", "ALTER TABLE `tbl_plans` ADD `price_old` VARCHAR(40) NOT NULL DEFAULT '' AFTER `price`;",
"ALTER TABLE `tbl_plans` ADD `device` VARCHAR(32) NOT NULL DEFAULT '' AFTER `plan_type`;" "ALTER TABLE `tbl_plans` ADD `device` VARCHAR(32) NOT NULL DEFAULT '' AFTER `plan_type`;"
],
"2024.6.10" : [
"ALTER TABLE `tbl_pool` ADD `local_ip` VARCHAR(40) NOT NULL DEFAULT '' AFTER `pool_name`;"
] ]
} }

View File

@ -13,10 +13,16 @@
<input type="text" class="form-control" id="name" name="name"> <input type="text" class="form-control" id="name" name="name">
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Local IP')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="local_ip" name="local_ip" placeholder="192.168.88.1">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Range IP')}</label> <label class="col-md-2 control-label">{Lang::T('Range IP')}</label>
<div class="col-md-6"> <div class="col-md-6">
<input type="text" class="form-control" id="ip_address" name="ip_address" placeholder="ex: 192.168.88.2-192.168.88.254"> <input type="text" class="form-control" id="ip_address" name="ip_address" placeholder="192.168.88.2-192.168.88.254">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -31,9 +37,6 @@
{/foreach} {/foreach}
</select> </select>
</div> </div>
{if $_c['radius_enable']}
<p class="help-block col-md-4">For Radius, you need to add <b>Pool Name</b> in Mikrotik manually</p>
{/if}
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-lg-offset-2 col-lg-10"> <div class="col-lg-offset-2 col-lg-10">

View File

@ -14,6 +14,12 @@
<input type="text" class="form-control" id="name" name="name" value="{$d['pool_name']}" readonly> <input type="text" class="form-control" id="name" name="name" value="{$d['pool_name']}" readonly>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Local IP')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="local_ip" name="local_ip" value="{$d['local_ip']}" placeholder="192.168.88.1">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Range IP')}</label> <label class="col-md-2 control-label">{Lang::T('Range IP')}</label>
<div class="col-md-6"> <div class="col-md-6">

View File

@ -9,7 +9,7 @@
onclick="return confirm('This will sync/send IP Pool to Mikrotik?')"><span onclick="return confirm('This will sync/send IP Pool to Mikrotik?')"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a> class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
</div> </div>
{Lang::T('IP Pool')} {Lang::T('IP Pool')} - PPPOE
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px"> <div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
@ -37,6 +37,7 @@
<thead> <thead>
<tr> <tr>
<th>{Lang::T('Name Pool')}</th> <th>{Lang::T('Name Pool')}</th>
<th>{Lang::T('Local IP')}</th>
<th>{Lang::T('Range IP')}</th> <th>{Lang::T('Range IP')}</th>
<th>{Lang::T('Routers')}</th> <th>{Lang::T('Routers')}</th>
<th>{Lang::T('Manage')}</th> <th>{Lang::T('Manage')}</th>
@ -47,6 +48,7 @@
{foreach $d as $ds} {foreach $d as $ds}
<tr> <tr>
<td>{$ds['pool_name']}</td> <td>{$ds['pool_name']}</td>
<td>{$ds['local_ip']}</td>
<td>{$ds['range_ip']}</td> <td>{$ds['range_ip']}</td>
<td>{$ds['routers']}</td> <td>{$ds['routers']}</td>
<td align="center"> <td align="center">