Repository navigation
Expand file tree
/
Copy pathaddNode.blade.php
More file actions
687 lines (672 loc) · 51.1 KB
/
Copy pathaddNode.blade.php
File metadata and controls
687 lines (672 loc) · 51.1 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
@extends('admin.layouts')
@section('css')
<link href="/assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
<link href="/assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
@endsection
@section('content')
<!-- BEGIN CONTENT BODY -->
<div class="page-content" style="padding-top:0;">
<!-- BEGIN PAGE BASE CONTENT -->
<div class="row">
<div class="col-md-12">
<div class="tab-pane active">
<div class="portlet light bordered">
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form action="{{url('admin/addNode')}}" method="post" class="form-horizontal" onsubmit="return do_submit();">
<div class="form-body">
<div class="alert alert-danger">
<strong>注意:</strong> 添加节点后自动生成的<code>ID</code>,即为该节点部署SSR后端时<code>usermysql.json</code>中的<code>node_id</code>的值;同时也是部署V2Ray后端时的<code>nodeId</code>的值;
V2Ray GO版节点部署<a href="https://github.com/ssrpanel/SSRPanel/wiki/V2Ray%E5%AE%8C%E6%95%B4%E9%85%8D%E7%BD%AE%E7%A4%BA%E4%BE%8B%EF%BC%88Go%E7%89%88%EF%BC%89" target="_blank">教程</a>;
更改服务器的SSH端口<a href="https://github.com/ssrpanel/SSRPanel/wiki/%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%A6%81%E6%AD%A2PING%E3%80%81%E6%94%B9SSH%E7%AB%AF%E5%8F%A3%E5%8F%B7" target="_blank">教程</a>;
</div>
<div class="row">
<div class="col-md-6">
<!-- BEGIN SAMPLE FORM PORTLET-->
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption">
<span class="caption-subject font-dark bold uppercase">基础信息</span>
</div>
</div>
<div class="portlet-body">
<div class="form-group">
<label for="is_nat" class="col-md-3 control-label">NAT</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="is_nat" value="1"> 是
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="is_nat" value="0" checked> 否
<span></span>
</label>
</div>
<span class="help-block"> NAT机需要<a href="https://github.com/ssrpanel/SSRPanel/wiki/NAT-VPS%E9%85%8D%E7%BD%AE%E6%95%99%E7%A8%8B" target="_blank">配置DDNS</a>,TCP阻断检测无效,务必填写域名 </span>
</div>
</div>
<div class="form-group">
<label for="name" class="col-md-3 control-label"> 节点名称 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="name" id="name" placeholder="" autofocus required>
</div>
</div>
<div class="form-group">
<label for="server" class="col-md-3 control-label"> 域名 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="server" id="server" placeholder="服务器域名地址,填则优先取域名地址">
</div>
</div>
<div class="form-group">
<label for="ip" class="col-md-3 control-label"> IPV4地址 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="ip" id="ip" placeholder="服务器IPV4地址" required>
</div>
</div>
<div class="form-group">
<label for="ipv6" class="col-md-3 control-label"> IPV6地址 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="ipv6" id="ipv6" placeholder="服务器IPV6地址,填写则用户可见,域名无效">
</div>
</div>
<div class="form-group">
<label for="ssh_port" class="col-md-3 control-label"> SSH端口 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="ssh_port" value="22" id="ssh_port" placeholder="服务器SSH端口" required>
<span class="help-block">请务必正确填写此值,否则TCP阻断检测可能误报</span>
</div>
</div>
<div class="form-group">
<label for="traffic_rate" class="col-md-3 control-label"> 流量比例 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="traffic_rate" value="1.0" id="traffic_rate" placeholder="" required>
<span class="help-block"> 举例:0.1用100M结算10M,5用100M结算500M </span>
</div>
</div>
<div class="form-group">
<label for="labels" class="col-md-3 control-label">标签</label>
<div class="col-md-8">
<select id="labels" class="form-control select2-multiple" name="labels[]" multiple>
@foreach($label_list as $label)
<option value="{{$label->id}}">{{$label->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="group_id" class="col-md-3 control-label"> 所属分组 </label>
<div class="col-md-8">
<select class="form-control" name="group_id" id="group_id">
<option value="0">请选择</option>
@if(!$group_list->isEmpty())
@foreach($group_list as $group)
<option value="{{$group->id}}">{{$group->name}}</option>
@endforeach
@endif
</select>
<span class="help-block">订阅时分组展示</span>
</div>
</div>
<div class="form-group">
<label for="country_code" class="col-md-3 control-label"> 国家/地区 </label>
<div class="col-md-8">
<select class="form-control" name="country_code" id="country_code">
<option value="">请选择</option>
@if(!$country_list->isEmpty())
@foreach($country_list as $country)
<option value="{{$country->country_code}}">{{$country->country_code}} - {{$country->country_name}}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="form-group">
<label for="desc" class="col-md-3 control-label"> 描述 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="desc" id="desc" placeholder="简单描述">
</div>
</div>
<div class="form-group">
<label for="sort" class="col-md-3 control-label">排序</label>
<div class="col-md-8">
<input type="text" class="form-control" name="sort" value="1" id="sort" placeholder="">
<span class="help-block"> 值越大排越前 </span>
</div>
</div>
<div class="form-group">
<label for="status" class="col-md-3 control-label">状态</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="status" value="1" checked> 正常
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="status" value="0"> 维护
<span></span>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="is_subscribe" class="col-md-3 control-label">订阅</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="is_subscribe" value="1" checked> 允许
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="is_subscribe" value="0"> 不允许
<span></span>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="is_tcp_check" class="col-md-3 control-label">TCP阻断检测</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="is_tcp_check" value="1" checked> 开启
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="is_tcp_check" value="0"> 关闭
<span></span>
</label>
</div>
<span class="help-block"> 每30~60分钟随机进行TCP阻断检测 </span>
</div>
</div>
<!--
<div class="form-group">
<label for="bandwidth" class="col-md-3 control-label">出口带宽</label>
<div class="col-md-8">
<div class="input-group">
<input type="text" class="form-control" name="bandwidth" value="1000" id="bandwidth" placeholder="" required>
<span class="input-group-addon">M</span>
</div>
</div>
</div>
<div class="form-group">
<label for="traffic" class="col-md-3 control-label">每月可用流量</label>
<div class="col-md-8">
<div class="input-group">
<input type="text" class="form-control right" name="traffic" value="1000" id="traffic" placeholder="" required>
<span class="input-group-addon">G</span>
</div>
</div>
</div>
<div class="form-group">
<label for="monitor_url" class="col-md-3 control-label">监控地址</label>
<div class="col-md-8">
<input type="text" class="form-control right" name="monitor_url" value="" id="monitor_url" placeholder="节点实时监控地址">
<span class="help-block"> 例如:http://us1.ssrpanel.com/api/monitor </span>
</div>
</div>
-->
</div>
</div>
<!-- END SAMPLE FORM PORTLET-->
</div>
<div class="col-md-6">
<!-- BEGIN SAMPLE FORM PORTLET-->
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption">
<span class="caption-subject font-dark bold">扩展信息</span>
</div>
</div>
<div class="portlet-body">
<div class="form-group">
<label for="service" class="col-md-3 control-label">类型</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="service" value="1" checked> Shadowsocks(R)
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="service" value="2"> V2Ray
<span></span>
</label>
</div>
</div>
</div>
<hr />
<!-- SS/SSR 设置部分 -->
<div class="ssr-setting">
<div class="form-group">
<label for="method" class="col-md-3 control-label">加密方式</label>
<div class="col-md-8">
<select class="form-control" name="method" id="method">
@foreach ($method_list as $method)
<option value="{{$method->name}}" @if($method->is_default) selected @endif>{{$method->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="protocol" class="col-md-3 control-label">协议</label>
<div class="col-md-8">
<select class="form-control" name="protocol" id="protocol">
@foreach ($protocol_list as $protocol)
<option value="{{$protocol->name}}" @if($protocol->is_default) selected @endif>{{$protocol->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="protocol_param" class="col-md-3 control-label"> 协议参数 </label>
<div class="col-md-8">
<input type="text" class="form-control" name="protocol_param" id="protocol_param" placeholder="">
</div>
</div>
<div class="form-group">
<label for="obfs" class="col-md-3 control-label">混淆</label>
<div class="col-md-8">
<select class="form-control" name="obfs" id="obfs">
@foreach ($obfs_list as $obfs)
<option value="{{$obfs->name}}" @if($obfs->is_default) selected @endif>{{$obfs->name}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="obfs_param" class="col-md-3 control-label"> 混淆参数 </label>
<div class="col-md-8">
<textarea class="form-control" rows="5" name="obfs_param" id="obfs_param"></textarea>
</div>
</div>
<div class="form-group">
<label for="compatible" class="col-md-3 control-label">兼容SS</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="compatible" value="1"> 是
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="compatible" value="0" checked> 否
<span></span>
</label>
</div>
<span class="help-block"> 如果兼容请在服务端配置协议和混淆时加上<span style="color:red">_compatible</span> </span>
</div>
</div>
<hr />
<div class="form-group">
<label for="single" class="col-md-3 control-label">单端口</label>
<div class="col-md-8">
<select class="form-control" name="single" id="single">
<option value="0" selected>关闭</option>
<option value="1">启用</option>
</select>
<span class="help-block"> 如果启用请配置服务端的<span style="color:red"> <a href="javascript:showTnc();">additional_ports</a> </span>信息 </span>
</div>
</div>
<div class="form-group hidden single-setting">
<label for="single_force" class="col-md-3 control-label">[单] 模式</label>
<div class="col-md-8">
<select class="form-control" name="single_force" id="single_force">
<option value="0" selected>兼容模式</option>
<option value="1">严格模式</option>
</select>
<span class="help-block"> 严格模式:用户的端口无法连接,只能通过以下指定的端口进行连接(<a href="javascript:showPortsOnlyConfig();">如何配置</a>)</span>
</div>
</div>
<div class="form-group hidden single-setting">
<label for="single_port" class="col-md-3 control-label">[单] 端口</label>
<div class="col-md-8">
<input type="text" class="form-control" name="single_port" value="" id="single_port" placeholder="443">
<span class="help-block"> 推荐80或443,后端需要配置 </span>
</div>
</div>
<div class="form-group hidden single-setting">
<label for="single_passwd" class="col-md-3 control-label">[单] 密码</label>
<div class="col-md-8">
<input type="text" class="form-control" name="single_passwd" value="" id="single_passwd" placeholder="password">
<span class="help-block"> 展示和生成配置用,后端配置注意保持一致 </span>
</div>
</div>
<div class="form-group hidden single-setting">
<label for="single_method" class="col-md-3 control-label">[单] 加密方式</label>
<div class="col-md-8">
<select class="form-control" name="single_method" id="single_method">
@foreach ($method_list as $method)
<option value="{{$method->name}}" @if($method->is_default) selected @endif>{{$method->name}}</option>
@endforeach
</select>
<span class="help-block"> 展示和生成配置用,后端配置注意保持一致 </span>
</div>
</div>
<div class="form-group hidden single-setting">
<label for="single_protocol" class="col-md-3 control-label">[单] 协议</label>
<div class="col-md-8">
<select class="form-control" name="single_protocol" id="single_protocol">
<option value="origin">origin</option>
<option value="verify_deflate">verify_deflate</option>
<option value="auth_sha1_v4">auth_sha1_v4</option>
<option value="auth_aes128_md5">auth_aes128_md5</option>
<option value="auth_aes128_sha1">auth_aes128_sha1</option>
<option value="auth_chain_a" selected>auth_chain_a</option>
</select>
<span class="help-block"> 展示和生成配置用,后端配置注意保持一致 </span>
</div>
</div>
<div class="form-group hidden single-setting">
<label for="single_obfs" class="col-md-3 control-label">[单] 混淆</label>
<div class="col-md-8">
<select class="form-control" name="single_obfs" id="single_obfs">
<option value="plain">plain</option>
<option value="http_simple">http_simple</option>
<option value="random_head">random_head</option>
<option value="tls1.2_ticket_auth" selected>tls1.2_ticket_auth</option>
</select>
<span class="help-block"> 展示和生成配置用,后端配置注意保持一致 </span>
</div>
</div>
</div>
<!-- V2ray 设置部分 -->
<div class="v2ray-setting hidden">
<div class="form-group">
<label for="v2_alter_id" class="col-md-3 control-label">额外ID</label>
<div class="col-md-8">
<input type="text" class="form-control" name="v2_alter_id" value="16" id="v2_alter_id" placeholder="16">
</div>
</div>
<div class="form-group">
<label for="v2_port" class="col-md-3 control-label">端口</label>
<div class="col-md-8">
<input type="text" class="form-control" name="v2_port" value="10087" id="v2_port" placeholder="10087">
</div>
</div>
<div class="form-group">
<label for="v2_net" class="col-md-3 control-label">传输协议</label>
<div class="col-md-8">
<select class="form-control" name="v2_net" id="v2_net">
<option value="tcp" selected>TCP</option>
<option value="kcp">mKCP</option>
<option value="ws">WebSocket</option>
<option value="h2">HTTP/2</option>
</select>
</div>
</div>
<div class="form-group">
<label for="v2_type" class="col-md-3 control-label">伪装类型</label>
<div class="col-md-8">
<select class="form-control" name="v2_type" id="v2_type">
<option value="none" selected>无伪装</option>
<option value="http">HTTP数据流</option>
<option value="srtp">视频通话数据 (SRTP)</option>
<option value="utp">BT下载数据 (uTP)</option>
<option value="wechat-video">微信视频通话</option>
<option value="dtls">DTLS1.2数据包</option>
<option value="wireguard">WireGuard数据包</option>
</select>
</div>
</div>
<div class="form-group">
<label for="v2_host" class="col-md-3 control-label">伪装域名</label>
<div class="col-md-8">
<input type="text" class="form-control" name="v2_host" id="v2_host">
<span class="help-block"> 伪装类型为http时多个伪装域名逗号隔开,ws只允许单个 </span>
</div>
</div>
<div class="form-group">
<label for="v2_path" class="col-md-3 control-label">WS/H2路径</label>
<div class="col-md-8">
<input type="text" class="form-control" name="v2_path" id="v2_path">
</div>
</div>
<div class="form-group">
<label for="v2_tls" class="col-md-3 control-label">TLS</label>
<div class="col-md-8">
<div class="mt-radio-inline">
<label class="mt-radio">
<input type="radio" name="v2_tls" value="1"> 是
<span></span>
</label>
<label class="mt-radio">
<input type="radio" name="v2_tls" value="0" checked> 否
<span></span>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END SAMPLE FORM PORTLET-->
</div>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-12">
<button type="submit" class="btn green">提 交</button>
</div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
<!-- END PAGE BASE CONTENT -->
</div>
<!-- END CONTENT BODY -->
@endsection
@section('script')
<script src="/assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
<script type="text/javascript">
// 用户标签选择器
$('#labels').select2({
theme: 'bootstrap',
placeholder: '设置后则可见相同标签的节点',
allowClear: true,
width:'100%'
});
// ajax同步提交
function do_submit() {
var name = $('#name').val();
var labels = $("#labels").val();
var group_id = $("#group_id option:selected").val();
var country_code = $("#country_code option:selected").val();
var server = $('#server').val();
var ip = $('#ip').val();
var ipv6 = $('#ipv6').val();
var desc = $('#desc').val();
var method = $('#method').val();
var traffic_rate = $('#traffic_rate').val();
var protocol = $('#protocol').val();
var protocol_param = $('#protocol_param').val();
var obfs = $('#obfs').val();
var obfs_param = $('#obfs_param').val();
var bandwidth = $('#bandwidth').val();
var traffic = $('#traffic').val();
var monitor_url = $('#monitor_url').val();
var is_subscribe = $("input:radio[name='is_subscribe']:checked").val();
var is_nat = $("input:radio[name='is_nat']:checked").val();
var ssh_port = $('#ssh_port').val();
var compatible = $("input:radio[name='compatible']:checked").val();
var single = $('#single').val();
var single_force = $('#single_force').val();
var single_port = $('#single_port').val();
var single_passwd = $('#single_passwd').val();
var single_method = $('#single_method').val();
var single_protocol = $('#single_protocol').val();
var single_obfs = $('#single_obfs').val();
var sort = $('#sort').val();
var status = $("input:radio[name='status']:checked").val();
var is_tcp_check = $("input:radio[name='is_tcp_check']:checked").val();
var service = $("input:radio[name='service']:checked").val();
var v2_alter_id = $('#v2_alter_id').val();
var v2_port = $('#v2_port').val();
var v2_net = $('#v2_net').val();
var v2_type = $('#v2_type').val();
var v2_host = $('#v2_host').val();
var v2_path = $('#v2_path').val();
var v2_tls = $("input:radio[name='v2_tls']:checked").val();
$.ajax({
type: "POST",
url: "{{url('admin/addNode')}}",
async: false,
data: {
_token: '{{csrf_token()}}',
name: name,
labels: labels,
group_id: group_id,
country_code: country_code,
server: server,
ip: ip,
ipv6: ipv6,
desc: desc,
method: method,
traffic_rate: traffic_rate,
protocol: protocol,
protocol_param: protocol_param,
obfs: obfs,
obfs_param: obfs_param,
bandwidth: bandwidth,
traffic: traffic,
monitor_url: monitor_url,
is_subscribe: is_subscribe,
is_nat: is_nat,
ssh_port: ssh_port,
compatible: compatible,
single: single,
single_force: single_force,
single_port: single_port,
single_passwd: single_passwd,
single_method: single_method,
single_protocol: single_protocol,
single_obfs: single_obfs,
sort: sort,
status: status,
is_tcp_check: is_tcp_check,
type: service,
v2_alter_id: v2_alter_id,
v2_port: v2_port,
v2_net: v2_net,
v2_type: v2_type,
v2_host: v2_host,
v2_path: v2_path,
v2_tls: v2_tls
},
dataType: 'json',
success: function (ret) {
layer.msg(ret.message, {time:1000}, function() {
if (ret.status == 'success') {
window.location.href = '{{url('admin/nodeList')}}';
}
});
}
});
return false;
}
// 设置单端口多用户
$("#single").on('change', function() {
var single = parseInt($(this).val());
if (single) {
$(".single-setting").removeClass('hidden');
} else {
$(".single-setting").removeClass('hidden');
$(".single-setting").addClass('hidden');
}
});
// 设置服务类型
$("input:radio[name='service']").on('change', function() {
var service = parseInt($(this).val());
if (service === 1) {
$(".ssr-setting").removeClass('hidden');
$(".v2ray-setting").addClass('hidden');
} else {
$(".ssr-setting").addClass('hidden');
$(".v2ray-setting").removeClass('hidden');
}
});
// 设置是否为NAT
$("input:radio[name='is_nat']").on('change', function() {
var is_nat = parseInt($(this).val());
if (is_nat === 1) {
$("#ip").val("1.1.1.1").attr("readonly", "readonly");
$("#server").attr("required", "required");
} else {
$("#ip").val("").removeAttr("readonly");
$("#server").removeAttr("required");
}
});
// 服务条款
function showTnc() {
var content = '1.请勿直接复制黏贴以下配置,SSR(R)会报错的;'
+ '<br>2.确保服务器时间为CST;'
+ '<br>3.具体请看<a href="https://github.com/ssrpanel/SSRPanel/wiki/%E5%8D%95%E7%AB%AF%E5%8F%A3%E5%A4%9A%E7%94%A8%E6%88%B7%E7%9A%84%E5%9D%91" target="_blank">WIKI</a>;'
+ '<br>'
+ '<br>additional_ports" : {'
+ '<br>    "80": {'
+ '<br>        "passwd": "password",'
+ '<br>        "method": "aes-128-ctr",'
+ '<br>        "protocol": "auth_aes128_md5",'
+ '<br>        "protocol_param": "#",'
+ '<br>        "obfs": "tls1.2_ticket_auth",'
+ '<br>        "obfs_param": ""'
+ '<br>    },'
+ '<br>    "443": {'
+ '<br>        "passwd": "password",'
+ '<br>        "method": "aes-128-ctr",'
+ '<br>        "protocol": "auth_aes128_sha1",'
+ '<br>        "protocol_param": "#",'
+ '<br>        "obfs": "tls1.2_ticket_auth",'
+ '<br>        "obfs_param": ""'
+ '<br>    }'
+ '<br>},';
layer.open({
type: 1
,title: '[节点 user-config.json 配置示例]'
,closeBtn: false
,area: '400px;'
,shade: 0.8
,id: 'tnc' //设定一个id,防止重复弹出
,resize: false
,btn: ['确定']
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 20px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">' + content + '</div>'
,success: function(layero){
//
}
});
}
// 模式提示
function showPortsOnlyConfig() {
var content = '严格模式:'
+ '<br>'
+ '"additional_ports_only": "true"'
+ '<br><br>'
+ '兼容模式:'
+ '<br>'
+ '"additional_ports_only": "false"';
layer.open({
type: 1
,title: '[节点 user-config.json 配置示例]'
,closeBtn: false
,area: '400px;'
,shade: 0.8
,id: 'po-cfg' //设定一个id,防止重复弹出
,resize: false
,btn: ['确定']
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 20px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">' + content + '</div>'
,success: function(layero){
//
}
});
}
</script>
@endsection