1+ < div class ="l-center edit ">
2+ < div class ="l-sort clearfix ">
3+ < div class ="l-unit-toolbar__buttonstrip ">
4+ < a class ="ui-button cancel " id ="btn-back " href ="/list/firewall/ipset/ "> < i class ="fas fa-arrow-left status-icon blue "> </ i > < ?=__('Back')?> </ a >
5+ </ div >
6+ < div class ="l-unit-toolbar__buttonstrip float-right ">
7+ < a href ="# " class ="ui-button " title ="<?=__('Save')?> " data-action ="submit " data-id ="vstobjects "> < i class ="fas fa-save status-icon purple "> </ i > < ?=__('Save')?> </ a >
8+ </ div >
9+ </ div >
10+ </ div >
11+
12+ < div class ="l-separator "> </ div >
13+ <!-- /.l-separator -->
14+
15+ < div class ="l-center animated fadeIn ">
16+ < ?php
17+ $back = $_SESSION['back'];
18+ if (empty($back)) {
19+ $back = "location.href='/list/firewall/ipset/'";
20+ } else {
21+ $back = "location.href='".$back."'";
22+ }
23+ ?>
24+ < form id ="vstobjects " name ="v_add_ipset " method ="post ">
25+ < input type ="hidden " name ="token " value ="<?=$_SESSION['token']?> " />
26+ < input type ="hidden " name ="ok " value ="Add " />
27+
28+ < table class ="data mode-add ">
29+ < tr class ="data-add ">
30+ < td class ="data-dotted ">
31+ < table class ="data-col1 ">
32+ < tr > < td > </ td > </ tr >
33+ </ table >
34+ </ td >
35+ < td class ="data-dotted ">
36+ < table class ="data-col2 " width ="600px ">
37+ < tr >
38+ < td class ="step-top ">
39+ < span class ="page-title "> < ?=__('Adding Firewall Ipset List')?> </ span >
40+ </ td >
41+ </ tr >
42+ < tr >
43+ < td >
44+ < ?php
45+ if (!empty($_SESSION['error_msg'])) {
46+ echo "< span class =\ "vst-error\"> < i class =\ "fas fa-exclamation-circle status-icon red\"> </ i > ".htmlentities($_SESSION['error_msg'])."</ span > ";
47+ } else {
48+ if (!empty($_SESSION['ok_msg'])) {
49+ echo "< span class =\ "vst-ok\"> < i class =\ "fas fa-check-circle status-icon green\"> </ i > ".$_SESSION['ok_msg']."</ span > ";
50+ }
51+ }
52+ ?>
53+ </ td >
54+ </ tr >
55+ < tr >
56+ < td class ="vst-text step-top ">
57+ < ?php print __('Ip List Name') ?>
58+ </ td >
59+ </ tr >
60+ < tr >
61+ < td >
62+ < input type ="text " size ="20 " class ="vst-input " name ="v_ipname " maxlength ="255 " value ="<?=htmlentities(trim($v_ipname, "'"))?> ">
63+ </ td >
64+ </ tr >
65+ < tr >
66+ < td class ="vst-text step-top ">
67+ < ?php print __('Data Source') ?> < span class ="optional "> (< ?php print __('url, script or file');?> )</ span >
68+ </ td >
69+ </ tr >
70+ < tr >
71+ < td >
72+ < select class ="vst-list " id ="datasource_list " onchange ="this.nextElementSibling.value=this.value ">
73+ < option value =""> clear</ option >
74+ </ select >
75+ < input type ="text " size ="20 " class ="vst-input vst-list-editor " name ="v_datasource " maxlength ="255 " value ="<?=htmlentities(trim($v_datasource, "'"))?> ">
76+ </ td >
77+ </ tr >
78+ < tr >
79+ < td class ="vst-text step-top ">
80+ < ?php print __('Ip Version') ?>
81+ </ td >
82+ </ tr >
83+ < tr >
84+ < td >
85+ < select class ="vst-list " name ="v_ipver ">
86+ < option value ="v4 " < ?php if ((!empty($v_ipver)) && ( $v_ipver == "'v4'" )) echo 'selected'?> > < ?=__('ip v4')?> </ option >
87+ < option value ="v6 " < ?php if ((!empty($v_ipver)) && ( $v_ipver == "'v6'" )) echo 'selected'?> > < ?=__('ip v6')?> </ option >
88+ </ select >
89+ </ td >
90+ </ tr >
91+ < tr >
92+ < td class ="vst-text step-top ">
93+ < ?php print __('Autoupdate') ?>
94+ </ td >
95+ </ tr >
96+ < tr >
97+ < td >
98+ < select class ="vst-list " name ="v_autoupdate ">
99+ < option value ="yes " < ?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'yes'" )) echo 'selected'?> > < ?=__('yes')?> </ option >
100+ < option value ="no " < ?php if ((!empty($v_autoupdate)) && ( $v_autoupdate == "'no'" )) echo 'selected'?> > < ?=__('no')?> </ option >
101+ </ select >
102+ </ td >
103+ </ tr >
104+
105+ </ table >
106+ < table class ="data-col2 ">
107+ </ table >
108+ </ td >
109+ </ tr >
110+ </ table >
111+ </ form >
112+
113+ </ div >
114+
115+ < script >
116+ var country_iplists = [
117+ { name : "[ipv4] Country Romania" , source :"http://ipverse.net/ipblocks/data/countries/ro.zone" } ,
118+ { name : "[ipv4] Country Germany" , source :"http://ipverse.net/ipblocks/data/countries/de.zone" } ,
119+ { name : "[ipv4] Country Switzerland" , source :"http://ipverse.net/ipblocks/data/countries/ch.zone" } ,
120+ { name : "[ipv4] Country France" , source :"http://ipverse.net/ipblocks/data/countries/fr.zone" } ,
121+ { name : "[ipv4] Country Ukraine" , source :"http://ipverse.net/ipblocks/data/countries/ua.zone" } ,
122+ { name : "[ipv4] Country Russia" , source :"http://ipverse.net/ipblocks/data/countries/ru.zone" } ,
123+ { name : "[ipv4] Country Spain" , source :"http://ipverse.net/ipblocks/data/countries/es.zone" } ,
124+ { name : "[ipv4] Country United Kingdom" , source :"http://ipverse.net/ipblocks/data/countries/gb.zone" } ,
125+ { name : "[ipv4] Country United States" , source :"http://ipverse.net/ipblocks/data/countries/us.zone" } ,
126+ { name : "[ipv4] Country China" , source :"http://ipverse.net/ipblocks/data/countries/cn.zone" } ,
127+ { name : "[ipv4] Country India" , source :"http://ipverse.net/ipblocks/data/countries/in.zone" } ,
128+ /*
129+ {name: "[ipv6] Country Romania", source:"http://ipverse.net/ipblocks/data/countries/ro-ipv6.zone"},
130+ {name: "[ipv6] Country Germany", source:"http://ipverse.net/ipblocks/data/countries/de-ipv6.zone"},
131+ {name: "[ipv6] Country Switzerland", source:"http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone"},
132+ {name: "[ipv6] Country France", source:"http://ipverse.net/ipblocks/data/countries/fr-ipv6.zone"},
133+ {name: "[ipv6] Country Ukraine", source:"http://ipverse.net/ipblocks/data/countries/ua-ipv6.zone"},
134+ {name: "[ipv6] Country Russia", source:"http://ipverse.net/ipblocks/data/countries/ru-ipv6.zone"},
135+ {name: "[ipv6] Country Spain", source:"http://ipverse.net/ipblocks/data/countries/es-ipv6.zone"},
136+ {name: "[ipv6] Country United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb-ipv6.zone"},
137+ {name: "[ipv6] Country United States", source:"http://ipverse.net/ipblocks/data/countries/us-ipv6.zone"},
138+ {name: "[ipv6] Country China", source:"http://ipverse.net/ipblocks/data/countries/cn-ipv6.zone"},
139+ {name: "[ipv6] Country India", source:"http://ipverse.net/ipblocks/data/countries/in-ipv6.zone"},
140+ */
141+ ] ;
142+
143+ country_iplists . sort ( function ( a , b ) {
144+ return a . name > b . name ;
145+ } ) ;
146+
147+ $ ( function ( ) {
148+ var targetelement = document . getElementById ( 'datasource_list' ) ;
149+
150+ // IPVERSE
151+ var newEl = document . createElement ( "option" ) ;
152+ newEl . text = "IPVERSE" ;
153+ newEl . disabled = true ;
154+ targetelement . appendChild ( newEl ) ;
155+
156+ country_iplists . forEach ( iplist => {
157+ var newEl = document . createElement ( "option" ) ;
158+ newEl . text = iplist . name ;
159+ newEl . value = iplist . source ;
160+ targetelement . appendChild ( newEl ) ;
161+ } ) ;
162+ } ) ;
163+ </ script >
0 commit comments