| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <!-- Begin toolbar -->
- <div class="l-center edit">
- <div class="l-sort clearfix">
- <div class="l-unit-toolbar__buttonstrip">
- <a class="ui-button cancel" dir="ltr" id="btn-back" href="/list/firewall/ipset/"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back');?></a>
- </div>
- <div class="l-unit-toolbar__buttonstrip float-right">
- <a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i><?=_('Save');?></a>
- </div>
- </div>
- </div>
- <!-- End toolbar -->
- <div class="l-separator"></div>
- <div class="l-center animated fadeIn">
- <form id="vstobjects" name="v_add_ipset" method="post">
- <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
- <input type="hidden" name="ok" value="Add" />
- <table class="data mode-add">
- <tr class="data-add">
- <td class="data-dotted">
- <table class="data-col1">
- <tr>
- <td></td>
- </tr>
- </table>
- </td>
- <td class="data-dotted">
- <table class="data-col2" width="600px">
- <tr>
- <td class="step-top">
- <span class="page-title"><?=_('Adding Firewall Ipset List');?></span>
- </td>
- </tr>
- <tr>
- <td>
- <?php show_error_panel($_SESSION);?>
- </td>
- </tr>
- <tr>
- <td class="vst-text step-top">
- <?=_('Ip List Name') ?>
- </td>
- </tr>
- <tr>
- <td>
- <input type="text" size="20" class="vst-input" name="v_ipname" maxlength="255" value="<?=htmlentities(trim($v_ipname, "'"))?>">
- </td>
- </tr>
- <tr>
- <td class="vst-text step-top">
- <?=_('Data Source') ?> <span class="optional">(<?=_('url, script or file');?>)</span>
- </td>
- </tr>
- <tr>
- <td>
- <select class="vst-list" tabindex="-1" id="datasource_list" onchange="this.nextElementSibling.value=this.value">
- <option value="">clear</option>
- </select>
- <input type="text" size="20" class="vst-input vst-list-editor" name="v_datasource" maxlength="255" value="<?=htmlentities(trim($v_datasource, "'"))?>">
- </td>
- </tr>
- <tr>
- <td class="vst-text step-top">
- <?=_('Ip Version') ?>
- </td>
- </tr>
- <tr>
- <td>
- <select class="vst-list" name="v_ipver">
- <option value="v4" <?php if ((!empty($v_ipver)) && ( $v_ipver == "'v4'" )) echo 'selected'?>><?=_('ip v4');?></option>
- <option value="v6" <?php if ((!empty($v_ipver)) && ( $v_ipver == "'v6'" )) echo 'selected'?>><?=_('ip v6');?></option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="vst-text step-top">
- <?=_('Autoupdate') ?>
- </td>
- </tr>
- <tr>
- <td>
- <select class="vst-list" name="v_autoupdate">
- <option value="yes" <?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'yes'" )) echo 'selected'?>><?=_('yes');?></option>
- <option value="no" <?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'no'" )) echo 'selected'?>><?=_('no');?></option>
- </select>
- </td>
- </tr>
- </table>
- <table class="data-col2"></table>
- </td>
- </tr>
- </table>
- </form>
- </div>
- <script>
- var country_iplists = [
- <?php
- $country = array('ca' => 'Canada', 'cn' => 'China', 'fr' => 'French', 'de' => 'Germany', 'in' => 'India', 'nl' => 'Netherlands', 'ro' => 'Romania', 'ru' => 'Russia', 'es' => 'Spain', 'ch' => 'Switzerland', 'tr' => 'Turkey', 'ua' => 'Ukraine', 'uk' => 'United Kingdom', 'us' => 'United States');
- foreach($country as $iso =>$name){
- echo '{name: "[IPv4] Country - '.$name.'", source:"https://raw.githubusercontent.com/ipverse/rir-ip/master/country/'.$iso.'/ipv4-aggregated.txt"},'."\n";
- }
- ?>
- // Define IPv6 country lists
- /*
- <?php
- foreach($country as $iso =>$name){
- echo '{name: "[IPv6] Country - '.$name.'", source:"https://raw.githubusercontent.com/ipverse/rir-ip/master/country/'.$iso.'/ipv6-aggregated.txt"},'."\n";
- }
- ?>
- */
- ];
- var blacklist_iplists = [
- { name: "[IPv4] Block Malicious IPs", source: "script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.sh" },
- /*
- {name: "[IPv6] Block Malicious IPs", source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.ipv6.sh"},
- */
- ];
- country_iplists.sort(function (a, b) {
- return a.name > b.name;
- });
- blacklist_iplists.sort(function (a, b) {
- return a.name > b.name;
- });
- $(function () {
- var targetelement = document.getElementById('datasource_list');
- // Blacklist
- var newEl = document.createElement("option");
- newEl.text = "<?=_('BLACKLIST') ?>";
- newEl.disabled = true;
- targetelement.appendChild(newEl);
- blacklist_iplists.forEach(iplist => {
- var newEl = document.createElement("option");
- newEl.text = iplist.name;
- newEl.value = iplist.source;
- targetelement.appendChild(newEl);
- });
- // IPVERSE
- var newEl = document.createElement("option");
- newEl.text = "<?=_('IPVERSE') ?>";
- newEl.disabled = true;
- targetelement.appendChild(newEl);
- country_iplists.forEach(iplist => {
- var newEl = document.createElement("option");
- newEl.text = iplist.name;
- newEl.value = iplist.source;
- targetelement.appendChild(newEl);
- });
- });
- </script>
|