Repository navigation
Expand file tree
/
Copy pathui.html
More file actions
127 lines (111 loc) · 3.48 KB
/
Copy pathui.html
File metadata and controls
127 lines (111 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html>
<head>
<title>{{ i18n "UI_TITLE" }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base href={{.Root}}>
<script type="text/javascript" src="static/js/jquery-1.12.3.min.js"></script>
</head>
<body>
<p>
<h1>{{ .Version }}</h1>
</p>
<p>
<img src="static/icons/128.ico" alt="Firefly"></img>
</p>
<div id="alert"></div>
<h2>{{ i18n "UI_LANG" }}</h2>
<ul style="list-style: none;">
<li><select id="locale">
{{ range $key, $value := .Locales }}
<option value="{{ $key }}"{{ if eq $.CurrentLocale $key }} selected {{ end }}>
{{ $value }}</option>
{{ end }}
</select></li>
</ul>
<h2>{{ i18n "UI_ADDR" }}</h2>
<ul style="list-style: none;">
<li>{{ i18n "UI_HTTPADDR" }}: {{ .HTTPProxyAddr }}</li>
<li>{{ i18n "UI_SOCKSADDR" }}: {{ .SocksProxyAddr }}</li>
</ul>
<h2>{{ i18n "UI_SETTINGS" }}</h2>
<ul style="list-style: none;">
<li><label><input type="checkbox" id="tunnellingAll"{{ if .TunnellingAll }} checked {{ end }}>
{{ i18n "UI_PROXY_ALL" | unescaped }} </label>
<ul style="list-style: none;">
<li>
<p>
{{ i18n "UI_ADDITIONAL_DOMAINS" }}: <br>
<textarea rows="8" cols="50" id="customTunnellingDomains">{{ .CustomTunnellingDomains }}</textarea> <br>
<input type="submit" id="updateCustomTunnellingDomains" value='{{ i18n "UI_UPDATE" }}'>
</p>
</li>
</ul>
</li>
<li><label>
<input type="checkbox" id="openSettingsPage"{{ if .OpenSettingsPage }} checked {{ end }}> {{ i18n "UI_SETTINGS_PAGE" }}
</label></li>
<li><label>
<input type="checkbox" id="openLandingPage"{{ if .OpenLandingPage }} checked {{ end }}>
{{ i18n "UI_LANDING_PAGE" }}: <a href="{{ .LandingPage }}" target="_blank">{{ .LandingPage }}</a>
</label></li>
<li><label>
<input type="checkbox" id="setPAC"{{ if .SetPAC }} checked {{ end }}>
{{ i18n "UI_SET_PAC" }}
</label></li>
<li><label>
<input type="checkbox" id="stopAutoUpdate"{{ if .StopAutoUpdate }} checked {{ end }}>
{{ i18n "UI_STOP_AUTOUPDATE" }}
</label></li>
</ul>
<h2>{{ i18n "UI_FEEDBACK" }}</h2>
<ul style="list-style: none;">
<li>{{ i18n "UI_CLICK_LINK" }}: <a href="https://github.com/yinghuocho/firefly-proxy/issues" target="_blank">
https://github.com/yinghuocho/firefly-proxy/issues</a>
</li>
</ul>
<script>
$(document).ready(function(e) {
if ( /firefox/.test(navigator.userAgent.toLowerCase()) ) {
$("#alert").append("<h3><strong>{{ i18n "UI_FIREFOXHELP" }}</strong></h3>")
}
if ( $('#tunnellingAll').is(':checked') ) {
$("#customTunnellingDomains, #updateCustomTunnellingDomains").attr("disabled","disabled");
}
});
$("input:checkbox").change(function() {
var isChecked = $(this).is(":checked") ? 1:0;
$.ajax({
url: 'settings',
type: 'POST',
data: { id:$(this).attr("id"), state:isChecked },
success: function() {
window.location.reload(true);
},
});
});
$('#updateCustomTunnellingDomains').on("click",function() {
var domains = $("textarea#customTunnellingDomains").val();
$.ajax({
url: 'settings',
type: 'POST',
data: { id:$(this).attr("id"), state:domains },
success: function() {
window.location.reload(true);
},
});
});
$('select').on('change', function() {
var state = this.value;
$.ajax({
url: 'settings',
type: 'POST',
data: { id:$(this).attr("id"), state:state },
success: function() {
window.location.reload(true);
},
});
});
</script>
</body>
</html>