├── .gitignore ├── README.md ├── doc ├── api │ ├── account.html │ ├── dhcp.html │ ├── download.html │ ├── fs.html │ ├── ftp.html │ ├── fw.html │ ├── igd.html │ ├── index.html │ ├── ipv6.html │ ├── lan.html │ ├── lcd.html │ ├── phone.html │ ├── share.html │ ├── storage.html │ ├── system.html │ ├── user.html │ └── wifi.html ├── firmware │ └── legal │ │ └── 1.1.9.1.cvs └── js │ ├── conn_config_adblock.js │ ├── conn_config_ping.js │ ├── conn_config_remote.js │ ├── conn_config_wol.js │ ├── conn_ddns_config.js │ ├── conn_ddns_state.js │ ├── conn_dsl_historic.js │ ├── conn_dsl_stats.js │ ├── conn_ftth_state.js │ ├── conn_historic.js │ ├── conn_status.js │ ├── explorer.js │ ├── json2.js │ ├── misc_lcd.js │ ├── misc_system.js │ ├── misc_testrate.js │ ├── nas_afp.js │ ├── nas_ftp.js │ ├── nas_share.js │ ├── nas_storage.js │ ├── nas_upnpav.js │ ├── net_dhcp_conf.js │ ├── net_ethsw_config.js │ ├── net_ethsw_graphs.js │ ├── net_ethsw_mactable.js │ ├── net_ethsw_state.js │ ├── net_ethsw_stats.js │ ├── net_fbxrop.js │ ├── net_igd.js │ ├── net_ipv6.js │ ├── net_lan_ip.js │ ├── net_lan_name.js │ ├── net_lanmode.js │ ├── net_lfilter_config.js │ ├── net_lfilter_entries.js │ ├── net_redirs_simple.js │ ├── phone_calls.js │ ├── phone_status.js │ ├── raw │ ├── conn_config_adblock.js │ ├── conn_config_ping.js │ ├── conn_config_remote.js │ ├── conn_config_wol.js │ ├── conn_ddns_config.js │ ├── conn_ddns_state.js │ ├── conn_dsl_historic.js │ ├── conn_dsl_stats.js │ ├── conn_ftth_state.js │ ├── conn_historic.js │ ├── conn_status.js │ ├── explorer.js │ ├── json2.js │ ├── misc_lcd.js │ ├── misc_system.js │ ├── misc_testrate.js │ ├── nas_afp.js │ ├── nas_ftp.js │ ├── nas_share.js │ ├── nas_storage.js │ ├── nas_upnpav.js │ ├── net_dhcp_conf.js │ ├── net_ethsw_config.js │ ├── net_ethsw_graphs.js │ ├── net_ethsw_mactable.js │ ├── net_ethsw_state.js │ ├── net_ethsw_stats.js │ ├── net_fbxrop.js │ ├── net_igd.js │ ├── net_ipv6.js │ ├── net_lan_ip.js │ ├── net_lan_name.js │ ├── net_lanmode.js │ ├── net_lfilter_config.js │ ├── net_lfilter_entries.js │ ├── net_redirs_simple.js │ ├── phone_calls.js │ ├── phone_status.js │ ├── settings.js │ ├── utils.js │ ├── wifi_client_aparams.js │ ├── wifi_client_params.js │ ├── wifi_client_station.js │ ├── wifi_conf.js │ └── wifi_freewifi_params.js │ ├── settings.js │ ├── utils.js │ ├── wifi_client_aparams.js │ ├── wifi_client_params.js │ ├── wifi_client_station.js │ ├── wifi_conf.js │ └── wifi_freewifi_params.js ├── extra ├── README.md └── js-beautify ├── php └── api-v1.0 │ ├── lib │ ├── CURL.php │ ├── Conn.php │ ├── Dhcp.php │ ├── Download.php │ ├── Fs.php │ ├── Ftp.php │ ├── Fw.php │ ├── Mafreebox.php │ ├── MafreeboxDocumentation.php │ ├── Misc.php │ ├── Phone.php │ ├── Rrd.php │ ├── Storage.php │ ├── System.php │ ├── Wifi.php │ └── simplehtmldom.php │ ├── test-json.php │ ├── test-mafreebox.php │ ├── test-memory.php │ └── test.php └── ruby ├── api-v1.0 ├── Mafreebox.rb ├── appel-recus-db.rb ├── appel-recus.rb ├── rrd.rb ├── test-json.rb ├── test-mafreebox.rb ├── test-parse-duration.rb ├── test-yaml.rb └── test.rb ├── api-v2.0 └── freebox-os │ ├── FreeboxOs.rb │ ├── bash │ ├── bash.sh │ ├── mafreebox.sh │ └── resty.sh │ └── hmac.php ├── api-v4.0 ├── FreeboxOS.rb └── influxdb │ ├── freebox-influx.bash │ ├── influxdb.rb │ ├── input-exec-mafreebox.conf │ ├── mafreebox.yml │ └── readme.md └── lib-extra ├── unidecoder.rb └── unidecoder ├── data ├── x00.yml ├── x01.yml ├── x02.yml ├── x03.yml ├── x04.yml ├── x05.yml ├── x06.yml ├── x07.yml ├── x09.yml ├── x0a.yml ├── x0b.yml ├── x0c.yml ├── x0d.yml ├── x0e.yml ├── x0f.yml ├── x10.yml ├── x11.yml ├── x12.yml ├── x13.yml ├── x14.yml ├── x15.yml ├── x16.yml ├── x17.yml ├── x18.yml ├── x1e.yml ├── x1f.yml ├── x20.yml ├── x21.yml ├── x22.yml ├── x23.yml ├── x24.yml ├── x25.yml ├── x26.yml ├── x27.yml ├── x28.yml ├── x2e.yml ├── x2f.yml ├── x30.yml ├── x31.yml ├── x32.yml ├── x33.yml ├── x4d.yml ├── x4e.yml ├── x4f.yml ├── x50.yml ├── x51.yml ├── x52.yml ├── x53.yml ├── x54.yml ├── x55.yml ├── x56.yml ├── x57.yml ├── x58.yml ├── x59.yml ├── x5a.yml ├── x5b.yml ├── x5c.yml ├── x5d.yml ├── x5e.yml ├── x5f.yml ├── x60.yml ├── x61.yml ├── x62.yml ├── x63.yml ├── x64.yml ├── x65.yml ├── x66.yml ├── x67.yml ├── x68.yml ├── x69.yml ├── x6a.yml ├── x6b.yml ├── x6c.yml ├── x6d.yml ├── x6e.yml ├── x6f.yml ├── x70.yml ├── x71.yml ├── x72.yml ├── x73.yml ├── x74.yml ├── x75.yml ├── x76.yml ├── x77.yml ├── x78.yml ├── x79.yml ├── x7a.yml ├── x7b.yml ├── x7c.yml ├── x7d.yml ├── x7e.yml ├── x7f.yml ├── x80.yml ├── x81.yml ├── x82.yml ├── x83.yml ├── x84.yml ├── x85.yml ├── x86.yml ├── x87.yml ├── x88.yml ├── x89.yml ├── x8a.yml ├── x8b.yml ├── x8c.yml ├── x8d.yml ├── x8e.yml ├── x8f.yml ├── x90.yml ├── x91.yml ├── x92.yml ├── x93.yml ├── x94.yml ├── x95.yml ├── x96.yml ├── x97.yml ├── x98.yml ├── x99.yml ├── x9a.yml ├── x9b.yml ├── x9c.yml ├── x9d.yml ├── x9e.yml ├── x9f.yml ├── xa0.yml ├── xa1.yml ├── xa2.yml ├── xa3.yml ├── xa4.yml ├── xac.yml ├── xad.yml ├── xae.yml ├── xaf.yml ├── xb0.yml ├── xb1.yml ├── xb2.yml ├── xb3.yml ├── xb4.yml ├── xb5.yml ├── xb6.yml ├── xb7.yml ├── xb8.yml ├── xb9.yml ├── xba.yml ├── xbb.yml ├── xbc.yml ├── xbd.yml ├── xbe.yml ├── xbf.yml ├── xc0.yml ├── xc1.yml ├── xc2.yml ├── xc3.yml ├── xc4.yml ├── xc5.yml ├── xc6.yml ├── xc7.yml ├── xc8.yml ├── xc9.yml ├── xca.yml ├── xcb.yml ├── xcc.yml ├── xcd.yml ├── xce.yml ├── xcf.yml ├── xd0.yml ├── xd1.yml ├── xd2.yml ├── xd3.yml ├── xd4.yml ├── xd5.yml ├── xd6.yml ├── xd7.yml ├── xf9.yml ├── xfa.yml ├── xfb.yml ├── xfc.yml ├── xfd.yml ├── xfe.yml └── xff.yml └── version.rb /.gitignore: -------------------------------------------------------------------------------- 1 | var 2 | var/* 3 | php/cookie.txt 4 | *cookie.txt 5 | 6 | -------------------------------------------------------------------------------- /doc/api/account.html: -------------------------------------------------------------------------------- 1 |
2 |account.unknown ()
14 | sessions 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 |dhcp.status_get ()
14 | Retourne l'état du serveur dhcp. 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 |dhcp.leases_get ()
26 | Retourne la liste des baux DHCP courants. 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 |dhcp.sleases_get ()
38 | Retourne la liste des baux statiques configurés. 39 | 40 |
41 | 42 | 43 | 44 | 45 | 46 |dhcp.config_get ()
50 | Retourne la configuration du serveur DHCP 51 | 52 |
53 | 54 | 55 | 56 | 57 | 58 |dhcp.config_set (params)
62 | Modifie la configuration du serveur DHCP 63 | 64 |
65 | 66 | 67 |
|
74 | 75 | | 76 | |
dhcp.slease_add (mac, ip, comment)
90 | Ajoute un bail statique 91 | 92 |
93 | 94 | 95 |
|
102 | 103 | | 104 | |
|
109 | 110 | | 111 | |
|
116 | 117 | | 118 | |
dhcp.slease_del (mac)
132 | Supprime un bail statique 133 | 134 |
135 | 136 | 137 |
|
144 | 145 | | 146 | |
ftp_config
|
19 | booléen | 20 |Le serveur est activé ou non. | 21 |
|
26 | booléen | 27 |Les connections anonymes sont autorisées en lecture seule. | 28 |
|
33 | booléen | 34 |De plus, les invitées ont le droit d'écrire. | 35 |
ftp.get_config ()
49 | Récupère la configuration du serveur ftp. 50 | 51 |
52 | 53 | 54 | 55 | 56 |Un objet de type ftp_config. |
ftp.set_config (cfg)
67 | Change la configuration du serveur ftp. 68 | 69 |
70 | 71 | 72 |
|
79 | ftp_config | 80 |81 | |
84 | 85 | |
igd.config_get ()
14 | Retourne la configuration courante. 15 | 16 |
17 | 18 | 19 | 20 | 21 |. |
igd.config_set (cfg)
32 | Applique la configuration. 33 | 34 |
35 | 36 | 37 |
|
44 | igd_config | 45 |46 | |
49 | 50 | |
igd.redirs_get ()
64 | Liste les redirections de ports créees par UPnP 65 | 66 |
67 | 68 | 69 | 70 | 71 | 72 |igd.redir_del (ext_src_ip, ext_port, proto)
76 | Supprime une redirection. 77 | 78 |
79 | 80 | 81 |
|
88 | 89 | | 90 | |
|
95 | 96 | | 97 | |
|
102 | 103 | | 104 | |
ipv6.config_get ()
14 | Retourne la configuration courante. 15 | 16 |
17 | 18 | 19 | 20 | 21 |. |
ipv6.config_set (cfg)
32 | Applique la configuration. 33 | 34 |
35 | 36 | 37 |
|
44 | ipv6_config | 45 |46 | |
49 | 50 | |
lan.ip_address_get ()
14 | Retourne l'ip courante sur le lan. 15 | 16 |
17 | 18 | 19 | 20 | 21 |Une chaîne de caractèresde chaîne de caractères, IP courante. |
lan.ip_address_set (ip_str)
32 | Change l'ip courante sur le lan. 33 | 34 |
35 | 36 | 37 |
|
44 | chaîne | 45 |Nouvelle IP. | 46 |
49 | 50 | |
lcd.brightness_get ()
14 | Retourne la luminosité courante (pourcentage). 15 | 16 |
17 | 18 | 19 | 20 | 21 |Un entierd'entier. |
lcd.brightness_set (value)
32 | Change la luminosité 33 | 34 |
35 | 36 | 37 |
|
44 | entier | 45 |Niveau de luminosité (pourcentage) | 46 |
49 | 50 | |
share_config
|
19 | booléen | 20 |Le partage d'imprimante est activé ou non. | 21 |
|
26 | booléen | 27 |Le partage de fichier est activé ou non. | 28 |
|
33 | booléen | 34 |L'acces requiert une authentification. | 35 |
|
40 | chaîne | 41 |Le nom d'utilisateur utilisé pour l'authentification. | 42 |
|
47 | chaîne | 48 |Le mot de passe utilisé pour l'authentification. | 49 |
|
54 | chaîne | 55 |Le groupe de travail utilisé par la Freebox. | 56 |
share.get_config ()
70 | Récupère la configuration des partages Windows. 71 | 72 |
73 | 74 | 75 | 76 | 77 |Un objet de type share_config. |
share.set_config (cfg)
88 | Change la configuration des partages Windows. 89 | 90 |
91 | 92 | 93 |
|
100 | share_config | 101 |102 | |
105 | 106 | |
system.uptime_get ()
14 | Retourne le temps écoulé depuis la mise en route de la freebox (en secondes) 15 | 16 |
17 | 18 | 19 | 20 | 21 |Un entier. |
system.mac_address_get ()
32 | Retourne l'adresse MAC de la freebox 33 | 34 |
35 | 36 | 37 | 38 | 39 |Une chaîne de caractères. |
system.serial_get ()
50 | Retourne l'adresse MAC de la freebox 51 | 52 |
53 | 54 | 55 | 56 | 57 |Une chaîne de caractères. |
system.reboot ([timeout])
68 | Redémarre la freebox 69 | 70 |
71 | 72 | 73 |
|
80 | entier | 81 |Temps d'attente en secondes avant le redémarrage. | 82 |
85 | 86 | |
system.fw_release_get ()
100 | Renvoie la version courante du firmware 101 | 102 |
103 | 104 | 105 | 106 | 107 |Une chaîne de caractères. |
/html> 3 | -------------------------------------------------------------------------------- /doc/js/conn_historic.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#form_clear_histo").formrpc({ 3 | success: function() { 4 | $("#tbl_histo tbody").empty(); 5 | return false 6 | } 7 | }) 8 | }); 9 | -------------------------------------------------------------------------------- /doc/js/conn_status.js: -------------------------------------------------------------------------------- 1 | function graph_refresh(b, a) { 2 | if (b.is(".open")) { 3 | rrdgraph_load(b, "db=fbxconnman&dir=" + a, false) 4 | } 5 | } 6 | function conn_refresh(f) { 7 | var b = $("#conn_state").attr("val"); 8 | var c = $("#conn_media").attr("val"); 9 | var e = $("#conn_type").attr("val"); 10 | var a = $("#conn_ident").attr("val"); 11 | if (!f) { 12 | return 13 | } 14 | if (f.state != b || (c && f.media != c) || (e && f.type != e) || (a && f.ident != a)) { 15 | window.location.reload(true); 16 | return 17 | } 18 | if (f.state != "up") { 19 | return 20 | } 21 | f.bytes_up = format_size(f.bytes_up); 22 | f.bytes_down = format_size(f.bytes_down); 23 | f.rate_up = format_rate(f.rate_up); 24 | f.rate_down = format_rate(f.rate_down); 25 | f.bandwidth_up = format_rate(f.bandwidth_up / 8); 26 | f.bandwidth_down = format_rate(f.bandwidth_down / 8); 27 | $("#conn_ipaddr").text(f.ip_address); 28 | $("#conn_bytes_down").text(f.bytes_down); 29 | $("#conn_bytes_up").text(f.bytes_up); 30 | $("#conn_rate_down").text(f.rate_down + " (max " + f.bandwidth_down + ")"); 31 | $("#conn_rate_up").text(f.rate_up + " (max " + f.bandwidth_up + ")") 32 | } 33 | $(document).ready(function() { 34 | var d = $("#graph_rate_down"); 35 | var a = $("#graph_rate_up"); 36 | var b = getQueryParams(document.location.search); 37 | var c = b.period; 38 | setInterval(function() { 39 | graph_refresh(a, "up&period=" + c); 40 | graph_refresh(d, "down&period=" + c) 41 | }, 5000); 42 | setInterval(function() { 43 | $.jsonrpc({ 44 | method: "conn.status", 45 | success: conn_refresh 46 | }) 47 | }, 1000) 48 | }); 49 | -------------------------------------------------------------------------------- /doc/js/misc_lcd.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#form_scroll").css({ 3 | visibility: "hidden" 4 | }); 5 | $("#screen").css({ 6 | opacity: lcd_brightness / 100 7 | }); 8 | $("#lum").slider({ 9 | value: lcd_brightness, 10 | max: 100, 11 | min: 10, 12 | slide: function(a, b) { 13 | $("#a").val(b.value); 14 | $("#percent span").html(b.value); 15 | $("#screen").css({ 16 | opacity: b.value / 100 17 | }) 18 | }, 19 | stop: function(a, b) { 20 | $("#form_scroll").submit() 21 | } 22 | }); 23 | $("#form_scroll").formrpc({ 24 | success: function(a) { 25 | $(this).resetForm() 26 | } 27 | }); 28 | $(":checkbox").checkbox(); 29 | $(":checkbox[name=forced]").bind("check", function() { 30 | $("#div_force").show() 31 | }); 32 | $(":checkbox[name=forced]").bind("uncheck", function() { 33 | $("#div_force").hide() 34 | }); 35 | $("#form_rotation").rpcform({ 36 | success: function(a) { 37 | sbar.text("Modifications effectuées") 38 | }, 39 | error: function(a) { 40 | sbar.error(null, a.error) 41 | } 42 | }) 43 | }); 44 | -------------------------------------------------------------------------------- /doc/js/misc_system.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#form_reboot").formrpc({ 3 | success: function(a) { 4 | document.location.href = "/reboot.php" 5 | } 6 | }) 7 | }); 8 | -------------------------------------------------------------------------------- /doc/js/misc_testrate.js: -------------------------------------------------------------------------------- 1 | < html > < head > < title > 404 Not Found < /title> < body bgcolor = "white" > < center > < h1 > 404 Not Found < /h1> < hr > < center > nginx < /center> 2 | < /html> 3 | -------------------------------------------------------------------------------- /doc/js/nas_afp.js: -------------------------------------------------------------------------------- 1 | function strchrs(b, a) { 2 | for (i = 0; i < a.length; ++i) { 3 | if (b.indexOf(a.charAt(i)) >= 0) { 4 | return true 5 | } 6 | } 7 | return false 8 | } 9 | function set_error(a, b) { 10 | if (a == null) { 11 | return 12 | } 13 | a[0].str = b 14 | } 15 | function check_login_name(c, b, d) { 16 | var a = ":"; 17 | if (c.length < 1) { 18 | set_error(b, d + " ne doit pas être vide."); 19 | return false 20 | } 21 | if (c.length > 128) { 22 | set_error(b, d + " ne doit pas dépasser 128 caractères."); 23 | return false 24 | } 25 | if (strchrs(c, a)) { 26 | set_error(b, d + " ne doit pas contenir le caractère :"); 27 | return false 28 | } 29 | return true 30 | } 31 | function check_login_password(b, a, c) { 32 | if (b.length > 32) { 33 | set_error(a, c + " ne doit pas faire plus de 32 caractères."); 34 | return false 35 | } 36 | return true 37 | } 38 | $(document).ready(function() { 39 | $("#form_config").rpcform({ 40 | beforeSubmit: function(d, a) { 41 | var c = {}; 42 | var b = a[0]; 43 | if (!check_login_name($("#afp_login_name").val(), [c], "Le nom d'utilisateur")) { 44 | sbar.error(null, c.str); 45 | return false 46 | } 47 | if (!check_login_password($("#afp_login_password").val(), [c], "Le mot de passe")) { 48 | sbar.error(null, c.str); 49 | return false 50 | } 51 | return true 52 | }, 53 | success: function(a) { 54 | sbar.text("Configuration appliquée") 55 | }, 56 | error: function(a) { 57 | sbar.error(null, "Impossible d'appliquer la configuration") 58 | } 59 | }); 60 | $("input:checkbox").checkbox(); 61 | $("#afp_enabled").click(function(b) { 62 | var c = b.target; 63 | var a = !c.checked; 64 | if (a) { 65 | $("#show_when_afp_enabled").show() 66 | } else { 67 | $("#show_when_afp_enabled").hide(); 68 | if (!check_login_name($("#afp_login_name").val())) { 69 | $("#afp_login_name").val("freebox") 70 | } 71 | if (!check_login_password($("#afp_login_password").val())) { 72 | $("#afp_login_password").val("") 73 | } 74 | } 75 | }); 76 | $("#afp_guest_allow").click(function(b) { 77 | var c = b.target; 78 | var a = !c.checked; 79 | if (!a) { 80 | $("#show_when_afp_guest_disallowed").show() 81 | } else { 82 | $("#show_when_afp_guest_disallowed").hide(); 83 | if (!check_login_name($("#afp_login_name").val())) { 84 | $("#afp_login_name").val("freebox") 85 | } 86 | if (!check_login_password($("#afp_login_password").val())) { 87 | $("#afp_login_password").val("") 88 | } 89 | } 90 | }) 91 | }); 92 | -------------------------------------------------------------------------------- /doc/js/nas_ftp.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#form_config").rpcform({ 4 | success: function(a) { 5 | sbar.text("Configuration appliquée") 6 | }, 7 | error: function(a) { 8 | sbar.error(null, "Impossible d'appliquer la configuration") 9 | } 10 | }); 11 | $("#allow_anonymous").click(function(b) { 12 | var c = b.target; 13 | var a = !c.checked; 14 | if (a) { 15 | $("#anon_write_fields").show() 16 | } else { 17 | $("#anon_write_fields").hide() 18 | } 19 | }) 20 | }); 21 | -------------------------------------------------------------------------------- /doc/js/nas_upnpav.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#form_config").rpcform({ 4 | success: function(a) { 5 | sbar.text("Configuration appliquée") 6 | }, 7 | error: function(a) { 8 | sbar.error(null, "Impossible d'appliquer la configuration") 9 | } 10 | }) 11 | }); 12 | -------------------------------------------------------------------------------- /doc/js/net_dhcp_conf.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $(":checkbox").checkbox(); 3 | $(":checkbox[name=enabled]").bind("check", function() { 4 | $("#div_cfg_dhcp").show() 5 | }); 6 | $(":checkbox[name=enabled]").bind("uncheck", function() { 7 | $("#div_cfg_dhcp").hide() 8 | }); 9 | $("input").tipTip(); 10 | $("#form_config").rpcform({ 11 | beforeSubmit: function(d, b) { 12 | var c = b[0]; 13 | if (ejs.trim(c.ip_start.value) || ejs.trim(c.ip_end.value)) { 14 | if (!check_ipv4(c.ip_start.value)) { 15 | sbar.error(null, "Début de la plage incorrecte"); 16 | return false 17 | } 18 | if (!check_ipv4(c.ip_end.value)) { 19 | sbar.error(null, "Fin de la plage incorrecte"); 20 | return false 21 | } 22 | } 23 | for (var a = 1; a <= 5; a++) { 24 | if (ejs.trim(c["dns" + a].value) && !check_ipv4(c["dns" + a].value)) { 25 | sbar.error(null, "DNS " + a + " incorrect"); 26 | return false 27 | } 28 | } 29 | return true 30 | }, 31 | success: function(a) { 32 | sbar.text("Modifications effectuées") 33 | }, 34 | error: function(a) { 35 | $(this).resetForm(); 36 | sbar.error(null, a.error) 37 | } 38 | }) 39 | }); 40 | -------------------------------------------------------------------------------- /doc/js/net_ethsw_config.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#form_config").rpcform({ 3 | beforeSubmit: function(b, a) { 4 | for (i = 1; i <= 4; ++i) { 5 | speed = $("#port_" + i + "_speed").val(); 6 | duplex = $("#port_" + i + "_duplex").val(); 7 | if (speed == "1000" && duplex == "half") { 8 | sbar.error(null, "Sur le port " + i + ": le mode Half-Duplex n'est pas supporté lorsque la vitesse est 1000MBits/s"); 9 | return false 10 | } 11 | } 12 | }, 13 | success: function(a) { 14 | sbar.text("Configuration appliquée") 15 | }, 16 | error: function(a) { 17 | sbar.error(null, "Impossible d'appliquer la configuration") 18 | } 19 | }) 20 | }); 21 | -------------------------------------------------------------------------------- /doc/js/net_ethsw_graphs.js: -------------------------------------------------------------------------------- 1 | var periods = [null, "hour", "hour", "hour", "hour"]; 2 | 3 | function refresh(g, b, d, a) { 4 | var f = new Date().getTime(); 5 | var c = "rrd.cgi?db=fbxios&port=" + b + "&dir=" + d + "&color1=" + a + "&w=300&h=150&period=" + periods[b] + "&ts=" + f + ""; 6 | g.attr("src", c).load() 7 | } 8 | function refresh_graphs() { 9 | var a = $("#port_graphs_accordion").accordion("option", "active") + 1; 10 | for (i = 1; i <= 4; ++i) { 11 | if (i != a) { 12 | continue 13 | } 14 | refresh($("#graph_p" + i + "_tx"), i, "tx", "00ff00"); 15 | refresh($("#graph_p" + i + "_rx"), i, "rx", "0000ff") 16 | } 17 | } 18 | function period_click(a) { 19 | var c = a.target; 20 | var b = $(c).attr("port_id"); 21 | var d = $(c).attr("period"); 22 | periods[b] = d; 23 | refresh_graphs() 24 | } 25 | $(document).ready(function() { 26 | $("#port_graphs_accordion").accordion({ 27 | collapsible: true 28 | }); 29 | $("#port_graphs_accordion").bind("accordionchange", function(a, b) { 30 | refresh_graphs() 31 | }); 32 | $(".graph_period").click(period_click); 33 | setInterval(function() { 34 | refresh_graphs() 35 | }, 5000); 36 | refresh_graphs() 37 | }); 38 | -------------------------------------------------------------------------------- /doc/js/net_ethsw_mactable.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#mac_address_table").dynamiclist({ 3 | jsonrpc: { 4 | method: "ethsw.mac_address_table", 5 | }, 6 | ejs: { 7 | url: "tpl/net_ethsw_mac_address_table_entry.ejs", 8 | data: function(a) { 9 | return { 10 | entry: a 11 | } 12 | }, 13 | }, 14 | interval: 1000, 15 | key: "mac_addr", 16 | jsonfield: function(b) { 17 | return b 18 | }, 19 | filter: function(a) { 20 | return true 21 | }, 22 | }) 23 | }); 24 | -------------------------------------------------------------------------------- /doc/js/net_ethsw_state.js: -------------------------------------------------------------------------------- 1 | counter = 0; 2 | 3 | function update_ports() { 4 | var a = []; 5 | for (index = 0; index < 4; index++) { 6 | a[index] = { 7 | method: "ethsw.port_state", 8 | data: index + 1 9 | } 10 | } 11 | $.jsonrpc({ 12 | url: "ethsw.cgi", 13 | batch: a, 14 | success: function(b) { 15 | if (!b) { 16 | return 17 | } 18 | for (i = 0; i < 4; ++i) { 19 | ejs.get("tpl/net_ethsw_port_state.ejs", { 20 | port_index: i + 1, 21 | state: b[i] 22 | }, function(c) { 23 | $("#eth_port_" + (i + 1)).html(c) 24 | }) 25 | } 26 | }, 27 | }); 28 | ++counter; 29 | setTimeout(update_ports, 1000) 30 | } 31 | $(document).ready(function() { 32 | setTimeout(update_ports, 1000) 33 | }); 34 | -------------------------------------------------------------------------------- /doc/js/net_ethsw_stats.js: -------------------------------------------------------------------------------- 1 | function update_ports_counters() { 2 | var a = []; 3 | for (index = 0; index < 4; index++) { 4 | a[index] = { 5 | method: "ethsw.port_counters", 6 | data: index + 1 7 | } 8 | } 9 | $.jsonrpc({ 10 | url: "ethsw.cgi", 11 | batch: a, 12 | success: function(b) { 13 | if (!b) { 14 | return 15 | } 16 | for (i = 0; i < 4; ++i) { 17 | ejs.get("tpl/net_ethsw_port_stats_counters.ejs", { 18 | port_id: i + 1, 19 | counter: b[i], 20 | }, function(c) { 21 | $("#port_" + (i + 1) + "_counters").html(c) 22 | }) 23 | } 24 | } 25 | }) 26 | } 27 | $(document).ready(function() { 28 | $("#port_stats_accordion").accordion({ 29 | collapsible: true 30 | }); 31 | setInterval(update_ports_counters, 5000) 32 | }); 33 | -------------------------------------------------------------------------------- /doc/js/net_fbxrop.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#form_config").rpcform({ 4 | success: function(a) { 5 | sbar.text("Configuration appliquée") 6 | }, 7 | error: function(a) { 8 | sbar.error(null, "Impossible d'appliquer la configuration") 9 | } 10 | }); 11 | $("#fbxrop_enable_knob").click(function(b) { 12 | var c = b.target; 13 | var a = !c.checked; 14 | if (a) { 15 | $("#fbxrop_mdp_div").show() 16 | } else { 17 | $("#fbxrop_mdp_div").hide() 18 | } 19 | }) 20 | }); 21 | -------------------------------------------------------------------------------- /doc/js/net_igd.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#form_config").rpcform({ 4 | success: function(a) { 5 | sbar.text("Configuration appliquée") 6 | }, 7 | error: function(a) { 8 | sbar.error(null, "Impossible d'appliquer la configuration") 9 | } 10 | }); 11 | $(".form_remove_redir").rpcform({ 12 | success: function(a) { 13 | sbar.text("Redirection supprimée") 14 | }, 15 | error: function(a) { 16 | sbar.error(null, "Impossible de supprimer la redirection") 17 | } 18 | }); 19 | $("#redirs_list tbody").dynamiclist({ 20 | jsonrpc: { 21 | method: "igd.redirs_get" 22 | }, 23 | ejs: { 24 | url: "tpl/igd_redir.ejs", 25 | data: function(a) { 26 | return { 27 | v: a 28 | } 29 | } 30 | }, 31 | interval: 5000, 32 | jsonfield: function(a) { 33 | return a 34 | }, 35 | jsonkey: function(a) { 36 | var b = ""; 37 | if (a.ext_src_ip) { 38 | b = b + a.ext_src_ip 39 | } 40 | b = b + "/" + a.int_port + "/" + a.int_ip + "/" + a.proto; 41 | return b 42 | }, 43 | }) 44 | }); 45 | -------------------------------------------------------------------------------- /doc/js/net_ipv6.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#form_config").rpcform({ 4 | success: function(a) { 5 | sbar.text("Configuration appliquée") 6 | }, 7 | error: function(a) { 8 | sbar.error(null, "Impossible d'appliquer la configuration") 9 | } 10 | }) 11 | }); 12 | -------------------------------------------------------------------------------- /doc/js/net_lan_ip.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("#form_config").rpcform({ 3 | beforeSubmit: function(c, a) { 4 | var b = a[0]; 5 | if (!check_ipv4(b.lan_ip.value)) { 6 | sbar.error(null, "Adresse IP incorrecte"); 7 | return false 8 | } 9 | return true 10 | }, 11 | success: function(a) { 12 | sbar.text("Modifications effectuées") 13 | }, 14 | error: function(a) { 15 | sbar.error(null, a.error) 16 | } 17 | }) 18 | }); 19 | -------------------------------------------------------------------------------- /doc/js/net_lanmode.js: -------------------------------------------------------------------------------- 1 | function lan_mode_to_french(b) { 2 | var a = { 3 | router: "Routeur", 4 | bridge: "Bridge", 5 | }; 6 | if (a[b]) { 7 | return a[b] 8 | } 9 | return "Routeur" 10 | } 11 | $(document).ready(function() { 12 | $("#form_config").rpcform({ 13 | beforeSubmit: function(b, a) { 14 | return true 15 | }, 16 | success: function(a) { 17 | sbar.text("Configuration appliquée"); 18 | $("#current_lan_mode").text(lan_mode_to_french($("#lan_mode").attr("value"))) 19 | }, 20 | error: function(a) { 21 | sbar.error(null, "Impossible de d'appliquer la configuration") 22 | } 23 | }) 24 | }); 25 | -------------------------------------------------------------------------------- /doc/js/net_lfilter_config.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#form_config").rpcform({ 4 | success: function(a) { 5 | sbar.text("Configuration appliquée") 6 | }, 7 | error: function(a) { 8 | sbar.error(null, "Impossible d'appliquer la configuration") 9 | } 10 | }) 11 | }); 12 | -------------------------------------------------------------------------------- /doc/js/net_lfilter_entries.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $("input:checkbox").checkbox(); 3 | $("#date_spec").hide(); 4 | $("#time_spec").hide(); 5 | $("#day_mode").change(function(b) { 6 | if ($(this).val() == "limit_mask") { 7 | $("#date_spec").show() 8 | } else { 9 | $("#date_spec").hide() 10 | } 11 | }); 12 | $("#time_mode").change(function(b) { 13 | if ($(this).val() == "limit_range") { 14 | $("#time_spec").show() 15 | } else { 16 | $("#time_spec").hide() 17 | } 18 | }); 19 | 20 | function a() { 21 | $(".form_remove_lan_filter").rpcform({ 22 | success: function(b) { 23 | sbar.text("Filtre supprimé"); 24 | $(this).parent().parent().next().remove(); 25 | $(this).parent().parent().remove() 26 | }, 27 | error: function(b) { 28 | sbar.error(null, b.errstr) 29 | } 30 | }) 31 | } 32 | a(); 33 | $("#lfilter_list").dynamiclist({ 34 | jsonrpc: { 35 | method: "fw.lfilters_get" 36 | }, 37 | ejs: { 38 | url: "tpl/lfilter_entry.ejs", 39 | data: function(b) { 40 | return { 41 | v: b 42 | } 43 | } 44 | }, 45 | key: "id", 46 | jsonfield: function(b) { 47 | return b 48 | }, 49 | interval: 0, 50 | }).bind("dynamiclist.new", function() { 51 | a() 52 | }); 53 | $("#form_add_lan_filter").rpcform({ 54 | beforeSubmit: function(d, b) { 55 | var c = b[0]; 56 | if (ejs.trim(c.src_mac.value) && !check_mac(c.src_mac.value)) { 57 | sbar.error(null, "Adresse MAC incorrecte"); 58 | return false 59 | } 60 | if (ejs.trim(c.src_ip.value)) { 61 | if (!check_ipv4(c.src_ip.value)) { 62 | sbar.error(null, "Adresse IP incorrecte"); 63 | return false 64 | } 65 | if (!check_ipv4_in_network(c.src_ip.value, c.network.value, "255.255.255.0")) { 66 | sbar.error(null, "L'adresse IP n'est pas dans votre réseau"); 67 | return false 68 | } 69 | } 70 | if (c.comment.value.length > 63) { 71 | sbar.error(null, "Commentaire trop long"); 72 | return false 73 | } 74 | return true 75 | }, 76 | success: function(b) { 77 | $(this).clearForm(); 78 | sbar.text("Filtre ajoutée"); 79 | $("#lfilter_list").dynamiclist("refresh") 80 | }, 81 | error: function(b) { 82 | sbar.error(null, b.error) 83 | } 84 | }) 85 | }); 86 | -------------------------------------------------------------------------------- /doc/js/net_redirs_simple.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | function a() { 3 | $(".form_del_wan_redir").rpcform({ 4 | success: function(b) { 5 | sbar.text("Redirection supprimée"); 6 | $(this).parent().parent().remove() 7 | }, 8 | error: function(b) { 9 | sbar.error(null, b.error) 10 | } 11 | }) 12 | } 13 | a(); 14 | $("#redirs_list tbody").dynamiclist({ 15 | jsonrpc: { 16 | method: "fw.wan_redirs_get" 17 | }, 18 | ejs: { 19 | url: "tpl/fw_wan_redir.ejs", 20 | data: function(b) { 21 | return { 22 | v: b 23 | } 24 | } 25 | }, 26 | key: "id", 27 | jsonfield: function(b) { 28 | return b 29 | }, 30 | interval: 0 31 | }).bind("dynamiclist.new", function() { 32 | a() 33 | }); 34 | $("#form_add_wan_redir").rpcform({ 35 | beforeSubmit: function(d, b) { 36 | var c = b[0]; 37 | if (!check_ipv4(c.lan_ip.value)) { 38 | sbar.error(null, "Adresse IP incorrecte"); 39 | return false 40 | } 41 | if (!check_port(c.wan_port.value)) { 42 | sbar.error(null, "Port externe incorrect"); 43 | return false 44 | } 45 | if (!check_port(c.lan_port.value)) { 46 | sbar.error(null, "Port interne incorrect"); 47 | return false 48 | } 49 | if (!check_ipv4_in_network(c.lan_ip.value, c.network.value, "255.255.255.0")) { 50 | sbar.error(null, "L'adresse IP n'est pas dans votre réseau"); 51 | return false 52 | } 53 | if (c.comment.value.length > 63) { 54 | sbar.error(null, "Commentaire trop long"); 55 | return false 56 | } 57 | return true 58 | }, 59 | success: function(b) { 60 | $(this).clearForm(); 61 | sbar.text("Redirection ajoutée"); 62 | $("#redirs_list tbody").dynamiclist("refresh") 63 | }, 64 | error: function(b) { 65 | sbar.error(null, b.error) 66 | } 67 | }) 68 | }); 69 | -------------------------------------------------------------------------------- /doc/js/phone_calls.js: -------------------------------------------------------------------------------- 1 | function delete_call(b) { 2 | var a = b; 3 | $.jsonrpc({ 4 | method: "call.del", 5 | data: b, 6 | success: function() { 7 | $("#call-" + a).fadeOut() 8 | }, 9 | error: function(c) { 10 | sbar.error(null, "Erreur lors de la suppression") 11 | } 12 | }) 13 | }; 14 | -------------------------------------------------------------------------------- /doc/js/raw/conn_config_adblock.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("input:checkbox").checkbox();$("#form_config").rpcform({success:function(a){sbar.text("Configuration appliquée")},error:function(a){sbar.error(null,"Impossible d'appliquer la configuration")}})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_config_ping.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("input:checkbox").checkbox();$("#form_config").rpcform({success:function(a){sbar.text("Configuration appliquée")},error:function(a){sbar.error(null,"Impossible d'appliquer la configuration")}})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_config_remote.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("input:checkbox").checkbox();$("#form_config").rpcform({success:function(a){sbar.text("Configuration appliquée")},error:function(a){sbar.error(null,a.error)}});$("#http_port").bind("keyup change",function(){var b=$("#http_port").val();var c=$("#ext_ip_address").val();var a="http://"+c;if(b!=80){a+=":"+b}a+="/";$("#ext_link").html(a);$("#ext_link").attr("href",a)});$("#http_enabled").click(function(b){var c=b.target;var a=!c.checked;if(a){$(".show_when_remote_access").show()}else{$(".show_when_remote_access").hide()}})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_config_wol.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("input:checkbox").checkbox();$("#form_config").rpcform({success:function(a){sbar.text("Configuration appliquée")},error:function(a){sbar.error(null,"Impossible d'appliquer la configuration")}})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_ddns_config.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("input:checkbox").checkbox();$(".ddns_provider_enabled").click(function(d){var f=d.target;var c=!f.checked;var b=$(f).attr("provider_name");var g=$("#div_provider_config_data_"+b);if(c){g.show()}else{g.hide()}});function a(b,c){if(b==null||b==""){sbar.error(null,c+" ne doit pas être vide");return false}return true}$(".form_config").rpcform({beforeSubmit:function(h,f){var g=f[0];var i=$(g).attr("provider");var e=$("#ddns_provider_enabled_"+i).is(":checked");var c=$("#ddns_provider_user_"+i).val();var d=$("#ddns_provider_password_"+i).val();var b=$("#ddns_provider_hostname_"+i).val();if(e&&(!a(c,"Le nom d'utilisateur")||!a(d,"Le mot de passe")||!a(b,"Le nom d'hôte"))){return false}return true},success:function(b){sbar.text("Configuration appliquée")},error:function(b){sbar.error(null,"Impossible d'appliquer la configuration")}})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_ddns_state.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("#providers").dynamiclist({jsonrpc:{method:"ddns.providers"},ejs:{url:"tpl/conn_ddns_provider_status.ejs",data:function(a){return{provider:a}}},filter:function(a){return a.cfg.enabled==true},interval:1000,key:"name",jsonfield:function(b){return b},ejs_update_if_present:true})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_dsl_historic.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){$("#form_clear_sync_logs").formrpc({success:function(){$("#tbl_sync_logs tbody").empty()}})}); -------------------------------------------------------------------------------- /doc/js/raw/conn_dsl_stats.js: -------------------------------------------------------------------------------- 1 | function graph_refresh(b,a){if(b.is(".open")){rrdgraph_load(b,a,false)}}$(document).ready(function(){var c=$("#graph_snr");var e=$("#graph_rate_down");var a=$("#graph_rate_up");var b=getQueryParams(document.location.search);var d=b.period;setInterval(function(){graph_refresh(c,"db=fbxdsl&type=snr&period="+d);graph_refresh(a,"db=fbxdsl&type=rate&dir=up&period="+d);graph_refresh(e,"db=fbxdsl&type=rate&dir=down&period="+d)},5000)}); -------------------------------------------------------------------------------- /doc/js/raw/conn_ftth_state.js: -------------------------------------------------------------------------------- 1 | 2 |
3 |
7 |