system.blade.php 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
  4. <link href="/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
  5. <link href="/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css" rel="stylesheet" type="text/css" />
  6. <link href="/assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
  7. <link href="/assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
  8. @endsection
  9. @section('title', '控制面板')
  10. @section('content')
  11. <!-- BEGIN CONTENT BODY -->
  12. <div class="page-content" style="padding-top:0;">
  13. <!-- BEGIN PAGE BASE CONTENT -->
  14. <div class="row">
  15. <div class="col-md-12">
  16. <!-- BEGIN PROFILE CONTENT -->
  17. <div class="profile-content">
  18. <div class="row">
  19. <div class="col-md-12">
  20. <div class="portlet light bordered">
  21. <div class="portlet-title tabbable-line">
  22. <ul class="nav nav-tabs">
  23. <li class="active">
  24. <a href="#tab_1" data-toggle="tab"> 常规设置 </a>
  25. </li>
  26. <li>
  27. <a href="#tab_2" data-toggle="tab"> 拓展设置 </a>
  28. </li>
  29. <li>
  30. <a href="#tab_3" data-toggle="tab"> 积分设置 </a>
  31. </li>
  32. <li>
  33. <a href="#tab_4" data-toggle="tab"> 推广返利设置 </a>
  34. </li>
  35. <li>
  36. <a href="#tab_5" data-toggle="tab"> 警告提醒设置 </a>
  37. </li>
  38. <li>
  39. <a href="#tab_6" data-toggle="tab"> 自动化任务 </a>
  40. </li>
  41. <li>
  42. <a href="#tab_7" data-toggle="tab"> 有赞云设置 </a>
  43. </li>
  44. </ul>
  45. </div>
  46. <div class="portlet-body">
  47. <div class="tab-content">
  48. <div class="tab-pane active" id="tab_1">
  49. <form action="#" method="post" class="form-horizontal">
  50. <div class="portlet-body">
  51. <div class="form-group">
  52. <div class="col-md-6">
  53. <label for="website_name" class="col-md-3 control-label">网站名称</label>
  54. <div class="col-md-9">
  55. <div class="input-group">
  56. <input class="form-control" type="text" name="website_name" value="{{$website_name}}" id="website_name" />
  57. <span class="input-group-btn">
  58. <button class="btn btn-success" type="button" onclick="setWebsiteName()">修改</button>
  59. </span>
  60. </div>
  61. <span class="help-block"> 发邮件时展示 </span>
  62. </div>
  63. </div>
  64. <div class="col-md-6">
  65. <label for="website_url" class="col-md-3 control-label">网站地址</label>
  66. <div class="col-md-9">
  67. <div class="input-group">
  68. <input class="form-control" type="text" name="website_url" value="{{$website_url}}" id="website_url" />
  69. <span class="input-group-btn">
  70. <button class="btn btn-success" type="button" onclick="setWebsiteUrl()">修改</button>
  71. </span>
  72. </div>
  73. <span class="help-block"> 生成重置密码必备,示例:https://www.ssrpanel.com </span>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <div class="col-md-6">
  79. <label for="is_register" class="col-md-3 control-label">用户注册</label>
  80. <div class="col-md-9">
  81. <input type="checkbox" class="make-switch" @if($is_register) checked @endif id="is_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  82. <span class="help-block"> 关闭后无法注册 </span>
  83. </div>
  84. </div>
  85. <div class="col-md-6">
  86. <label for="is_active_register" class="col-md-3 control-label">激活账号</label>
  87. <div class="col-md-9">
  88. <input type="checkbox" class="make-switch" @if($is_active_register) checked @endif id="is_active_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  89. <span class="help-block"> 启用后用户需要通过邮件来激活账号 </span>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <div class="col-md-6">
  95. <label for="is_invite_register" class="col-md-3 control-label">邀请注册</label>
  96. <div class="col-md-9">
  97. <input type="checkbox" class="make-switch" @if($is_invite_register) checked @endif id="is_invite_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  98. <span class="help-block"> 启用后必须使用邀请码进行注册 </span>
  99. </div>
  100. </div>
  101. <div class="col-md-6">
  102. <label for="is_reset_password" class="col-md-3 control-label">重置密码</label>
  103. <div class="col-md-9">
  104. <input type="checkbox" class="make-switch" @if($is_reset_password) checked @endif id="is_reset_password" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  105. <span class="help-block"> 启用后用户可以通过邮件重置密码 </span>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <div class="col-md-6">
  111. <label for="is_captcha" class="col-md-3 control-label">验证码</label>
  112. <div class="col-md-9">
  113. <input type="checkbox" class="make-switch" @if($is_captcha) checked @endif id="is_captcha" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  114. <span class="help-block"> 启用后登录、注册需要输入验证码 </span>
  115. </div>
  116. </div>
  117. <div class="col-md-6">
  118. <label for="is_free_code" class="col-md-3 control-label">免费邀请码</label>
  119. <div class="col-md-9">
  120. <input type="checkbox" class="make-switch" @if($is_free_code) checked @endif id="is_free_code" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  121. <span class="help-block"> 关闭后免费邀请码不可见 </span>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </form>
  127. </div>
  128. <div class="tab-pane" id="tab_2">
  129. <form action="#" method="post" class="form-horizontal">
  130. <div class="portlet-body">
  131. <div class="form-group">
  132. <div class="col-md-6">
  133. <label for="is_rand_port" class="col-md-3 control-label">随机端口</label>
  134. <div class="col-md-9">
  135. <input type="checkbox" class="make-switch" @if($is_rand_port) checked @endif id="is_rand_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  136. <span class="help-block"> 注册、添加用户时随机生成端口 </span>
  137. </div>
  138. </div>
  139. <div class="col-md-6">
  140. <label class="col-md-3 control-label">端口范围</label>
  141. <div class="col-md-9">
  142. <div class="input-group input-large input-daterange">
  143. <input type="text" class="form-control" name="min_port" value="{{$min_port}}" id="min_port">
  144. <span class="input-group-addon"> ~ </span>
  145. <input type="text" class="form-control" name="max_port" value="{{$max_port}}" id="max_port">
  146. </div>
  147. <span class="help-block"> 端口范围:1000 - 65535 </span>
  148. </div>
  149. </div>
  150. </div>
  151. <!--
  152. <div class="form-group">
  153. <label for="is_user_rand_port" class="col-md-2 control-label">自定义端口</label>
  154. <div class="col-md-6">
  155. <input type="checkbox" class="make-switch" @if($is_user_rand_port) checked @endif id="is_user_rand_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  156. <span class="help-block"> 用户可以自定义端口 </span>
  157. </div>
  158. </div>
  159. -->
  160. <div class="form-group">
  161. <div class="col-md-6">
  162. <label for="default_days" class="col-md-3 control-label">初始有效期</label>
  163. <div class="col-md-9">
  164. <div class="input-group">
  165. <input class="form-control" type="text" name="default_days" value="{{$default_days}}" id="default_days" />
  166. <span class="input-group-addon">天</span>
  167. <span class="input-group-btn">
  168. <button class="btn btn-success" type="button" onclick="setDefaultDays()">修改</button>
  169. </span>
  170. </div>
  171. <span class="help-block"> 用户注册时默认SS(R)有效天数 </span>
  172. </div>
  173. </div>
  174. <div class="col-md-6">
  175. <label for="default_traffic" class="col-md-3 control-label">初始流量</label>
  176. <div class="col-md-9">
  177. <div class="input-group">
  178. <input class="form-control" type="text" name="default_traffic" value="{{$default_traffic}}" id="default_traffic" />
  179. <span class="input-group-addon">MiB</span>
  180. <span class="input-group-btn">
  181. <button class="btn btn-success" type="button" onclick="setDefaultTraffic()">修改</button>
  182. </span>
  183. </div>
  184. <span class="help-block"> 用户注册时默认可用流量 </span>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="form-group">
  189. <div class="col-md-6">
  190. <label for="invite_num" class="col-md-3 control-label">可生成邀请码数</label>
  191. <div class="col-md-9">
  192. <div class="input-group">
  193. <input class="form-control" type="text" name="invite_num" value="{{$invite_num}}" id="invite_num" />
  194. <span class="input-group-btn">
  195. <button class="btn btn-success" type="button" onclick="setInviteNum()">修改</button>
  196. </span>
  197. </div>
  198. <span class="help-block"> 用户可以生成的邀请码数 </span>
  199. </div>
  200. </div>
  201. <div class="col-md-6">
  202. <label for="reset_password_times" class="col-md-3 control-label">重置密码次数</label>
  203. <div class="col-md-9">
  204. <div class="input-group">
  205. <input class="form-control" type="text" name="reset_password_times" value="{{$reset_password_times}}" id="reset_password_times" />
  206. <span class="input-group-btn">
  207. <button class="btn btn-success" type="button" onclick="setResetPasswordTimes()">修改</button>
  208. </span>
  209. </div>
  210. <span class="help-block"> 24小时内可以通过邮件重置密码次数 </span>
  211. </div>
  212. </div>
  213. </div>
  214. <div class="form-group">
  215. <div class="col-md-6">
  216. <label for="is_forbid_robot" class="col-md-3 control-label">阻止机器人访问</label>
  217. <div class="col-md-9">
  218. <input type="checkbox" class="make-switch" @if($is_forbid_robot) checked @endif id="is_forbid_robot" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  219. <span class="help-block"> 如果是机器人、爬虫、代理访问网站则会抛出403错误 </span>
  220. </div>
  221. </div>
  222. <div class="col-md-6">
  223. <label for="active_times" class="col-md-3 control-label">激活账号次数</label>
  224. <div class="col-md-9">
  225. <div class="input-group">
  226. <input class="form-control" type="text" name="active_times" value="{{$active_times}}" id="active_times" />
  227. <span class="input-group-btn">
  228. <button class="btn btn-success" type="button" onclick="setActiveTimes()">修改</button>
  229. </span>
  230. </div>
  231. <span class="help-block"> 24小时内可以通过邮件激活账号次数 </span>
  232. </div>
  233. </div>
  234. </div>
  235. <div class="form-group">
  236. <div class="col-md-6">
  237. <label for="subscribe_domain" class="col-md-3 control-label">节点订阅地址</label>
  238. <div class="col-md-9">
  239. <div class="input-group">
  240. <input class="form-control" type="text" name="subscribe_domain" value="{{$subscribe_domain}}" id="subscribe_domain" />
  241. <span class="input-group-btn">
  242. <button class="btn btn-success" type="button" onclick="setSubscribeDomain()">修改</button>
  243. </span>
  244. </div>
  245. <span class="help-block"> (推荐)防止面板域名被投毒后无法正常订阅,需带http://或https:// </span>
  246. </div>
  247. </div>
  248. <div class="col-md-6">
  249. <label for="subscribe_max" class="col-md-3 control-label">订阅节点数</label>
  250. <div class="col-md-9">
  251. <div class="input-group">
  252. <input class="form-control" type="text" name="subscribe_max" value="{{$subscribe_max}}" id="subscribe_max" />
  253. <span class="input-group-btn">
  254. <button class="btn btn-success" type="button" onclick="setSubscribeMax()">修改</button>
  255. </span>
  256. </div>
  257. <span class="help-block"> 客户端订阅时随机取得几个节点 </span>
  258. </div>
  259. </div>
  260. </div>
  261. <div class="form-group">
  262. <div class="col-md-6">
  263. <label for="initial_labels_for_user" class="col-md-3 control-label">用户初始标签</label>
  264. <div class="col-md-9">
  265. <select id="initial_labels_for_user" class="form-control select2-multiple" name="initial_labels_for_user" multiple="multiple">
  266. @foreach($label_list as $label)
  267. <option value="{{$label->id}}"
  268. @if (in_array($label->id, explode(',', $initial_labels_for_user)))
  269. selected
  270. @endif
  271. >{{$label->name}}</option>
  272. @endforeach
  273. </select>
  274. <span class="help-block"> 注册用户时的初始标签 </span>
  275. </div>
  276. </div>
  277. <div class="col-md-6"></div>
  278. </div>
  279. </div>
  280. </form>
  281. </div>
  282. <div class="tab-pane" id="tab_3">
  283. <form action="#" method="post" class="form-horizontal">
  284. <div class="portlet-body">
  285. <div class="form-group">
  286. <div class="col-md-6">
  287. <label for="login_add_score" class="col-md-3 control-label">登录加积分</label>
  288. <div class="col-md-9">
  289. <input type="checkbox" class="make-switch" @if($login_add_score) checked @endif id="login_add_score" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  290. <span class="help-block"> 登录时将根据积分范围得到积分 </span>
  291. </div>
  292. </div>
  293. <div class="col-md-6">
  294. <label for="login_add_score_range" class="col-md-3 control-label">时间间隔</label>
  295. <div class="col-md-9">
  296. <div class="input-group">
  297. <input class="form-control" type="text" name="login_add_score_range" value="{{$login_add_score_range}}" id="login_add_score_range" />
  298. <span class="input-group-btn">
  299. <button class="btn btn-success" type="button" onclick="setLoginAddScoreRange()">修改</button>
  300. </span>
  301. </div>
  302. <span class="help-block"> 每隔多久登录才会加积分(单位分钟) </span>
  303. </div>
  304. </div>
  305. </div>
  306. <div class="form-group">
  307. <div class="col-md-6">
  308. <label class="col-md-3 control-label">积分范围</label>
  309. <div class="col-md-9">
  310. <div class="input-group input-large input-daterange">
  311. <input type="text" class="form-control" name="min_rand_score" value="{{$min_rand_score}}" id="min_rand_score">
  312. <span class="input-group-addon"> ~ </span>
  313. <input type="text" class="form-control" name="max_rand_score" value="{{$max_rand_score}}" id="max_rand_score">
  314. </div>
  315. </div>
  316. </div>
  317. <div class="col-md-6">
  318. </div>
  319. </div>
  320. </div>
  321. </form>
  322. </div>
  323. <div class="tab-pane" id="tab_4">
  324. <form action="#" method="post" class="form-horizontal">
  325. <div class="portlet-body">
  326. <div class="form-group">
  327. <div class="col-md-6">
  328. <label for="referral_status" class="col-md-3 control-label">本功能</label>
  329. <div class="col-md-9">
  330. <input type="checkbox" class="make-switch" @if($referral_status) checked @endif id="referral_status" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  331. <span class="help-block"> 关闭后用户不可见 </span>
  332. </div>
  333. </div>
  334. <div class="col-md-6">
  335. <label for="referral_traffic" class="col-md-3 control-label">注册送流量</label>
  336. <div class="col-md-9">
  337. <div class="input-group">
  338. <input class="form-control" type="text" name="referral_gift_traffic" value="{{$referral_traffic}}" id="referral_traffic" />
  339. <span class="input-group-addon">MiB</span>
  340. <span class="input-group-btn">
  341. <button class="btn btn-success" type="button" onclick="setReferralTraffic()">修改</button>
  342. </span>
  343. </div>
  344. <span class="help-block"> 根据推广链接注册则送多少流量(叠加在默认流量上) </span>
  345. </div>
  346. </div>
  347. </div>
  348. <div class="form-group">
  349. <div class="col-md-6">
  350. <label for="referral_percent" class="col-md-3 control-label">返利比例</label>
  351. <div class="col-md-9">
  352. <div class="input-group">
  353. <input class="form-control" type="text" name="referral_percent" value="{{$referral_percent * 100}}" id="referral_percent" />
  354. <span class="input-group-addon">%</span>
  355. <span class="input-group-btn">
  356. <button class="btn btn-success" type="button" onclick="setReferralPercent()">修改</button>
  357. </span>
  358. </div>
  359. <span class="help-block"> 根据推广链接注册的账号每笔消费推广人可以分成的比例 </span>
  360. </div>
  361. </div>
  362. <div class="col-md-6">
  363. <label for="referral_money" class="col-md-3 control-label">提现限制</label>
  364. <div class="col-md-9">
  365. <div class="input-group">
  366. <input class="form-control" type="text" name="referral_money" value="{{$referral_money}}" id="referral_money" />
  367. <span class="input-group-addon">元</span>
  368. <span class="input-group-btn">
  369. <button class="btn btn-success" type="button" onclick="setReferralMoney()">修改</button>
  370. </span>
  371. </div>
  372. <span class="help-block"> 满多少元才可以申请提现 </span>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </form>
  378. </div>
  379. <div class="tab-pane" id="tab_5">
  380. <form action="#" method="post" class="form-horizontal">
  381. <div class="portlet-body">
  382. <div class="form-group">
  383. <div class="col-md-6">
  384. <label for="expire_warning" class="col-md-3 control-label">用户过期警告</label>
  385. <div class="col-md-9">
  386. <input type="checkbox" class="make-switch" @if($expire_warning) checked @endif id="expire_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  387. <span class="help-block"> 启用后账号距到期还剩阈值设置的值时自动发邮件提醒用户 </span>
  388. </div>
  389. </div>
  390. <div class="col-md-6">
  391. <label for="expire_days" class="col-md-3 control-label">过期警告阈值</label>
  392. <div class="col-md-9">
  393. <div class="input-group">
  394. <input class="form-control" type="text" name="expire_days" value="{{$expire_days}}" id="expire_days" />
  395. <span class="input-group-addon">天</span>
  396. <span class="input-group-btn">
  397. <button class="btn btn-success" type="button" onclick="setExpireDays()">修改</button>
  398. </span>
  399. </div>
  400. <span class="help-block"> 账号距离过期还差多少天时发警告邮件 </span>
  401. </div>
  402. </div>
  403. </div>
  404. <div class="form-group">
  405. <div class="col-md-6">
  406. <label for="traffic_warning" class="col-md-3 control-label">用户流量警告</label>
  407. <div class="col-md-9">
  408. <input type="checkbox" class="make-switch" @if($traffic_warning) checked @endif id="traffic_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  409. <span class="help-block"> 启用后账号已使用流量超过警告阈值时自动发邮件提醒用户 </span>
  410. </div>
  411. </div>
  412. <div class="col-md-6">
  413. <label for="traffic_warning_percent" class="col-md-3 control-label">流量警告阈值</label>
  414. <div class="col-md-9">
  415. <div class="input-group">
  416. <input class="form-control" type="text" name="traffic_warning_percent" value="{{$traffic_warning_percent}}" id="traffic_warning_percent" />
  417. <span class="input-group-addon">%</span>
  418. <span class="input-group-btn">
  419. <button class="btn btn-success" type="button" onclick="setTrafficWarningPercent()">修改</button>
  420. </span>
  421. </div>
  422. <span class="help-block"> 建议设置在70%~90% </span>
  423. </div>
  424. </div>
  425. </div>
  426. <div class="form-group">
  427. <div class="col-md-6">
  428. <label for="is_node_crash_warning" class="col-md-3 control-label">节点宕机提醒</label>
  429. <div class="col-md-9">
  430. <input type="checkbox" class="make-switch" @if($is_node_crash_warning) checked @endif id="is_node_crash_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  431. <span class="help-block"> 启用后如果节点宕机则发出提醒邮件 </span>
  432. </div>
  433. </div>
  434. <div class="col-md-6">
  435. <label for="crash_warning_email" class="col-md-3 control-label">管理员收信地址</label>
  436. <div class="col-md-9">
  437. <div class="input-group">
  438. <input class="form-control" type="text" name="crash_warning_email" value="{{$crash_warning_email}}" id="crash_warning_email" placeholder="[email protected]" />
  439. <span class="input-group-btn">
  440. <button class="btn btn-success" type="button" onclick="setCrashWarningEmail()">修改</button>
  441. </span>
  442. </div>
  443. <span class="help-block"> 填写此值则节点宕机、工单回复会自动提醒 </span>
  444. </div>
  445. </div>
  446. </div>
  447. <div class="form-group">
  448. <div class="col-md-6">
  449. <label for="is_server_chan" class="col-md-3 control-label">ServerChan</label>
  450. <div class="col-md-9">
  451. <input type="checkbox" class="make-switch" @if($is_server_chan) checked @endif id="is_server_chan" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  452. <span class="help-block"> 使用ServerChan推送节点宕机提醒(<a href="http://sc.ftqq.com" target="_blank">绑定微信</a>),须先启用节点宕机警告 </span>
  453. </div>
  454. </div>
  455. <div class="col-md-6">
  456. <label for="server_chan_key" class="col-md-3 control-label">SCKEY</label>
  457. <div class="col-md-9">
  458. <div class="input-group">
  459. <input class="form-control" type="text" name="server_chan_key" value="{{$server_chan_key}}" id="server_chan_key" placeholder="请到ServerChan申请" />
  460. <span class="input-group-btn">
  461. <button class="btn btn-success" type="button" onclick="setServerChanKey()">修改</button>
  462. </span>
  463. </div>
  464. <span class="help-block"> 启用ServerChan,请务必填入本值(<a href="http://sc.ftqq.com" target="_blank">申请SCKEY</a>) </span>
  465. </div>
  466. </div>
  467. </div>
  468. </div>
  469. </form>
  470. </div>
  471. <div class="tab-pane" id="tab_6">
  472. <form action="#" method="post" class="form-horizontal">
  473. <div class="portlet-body">
  474. <div class="form-group">
  475. <div class="col-md-6">
  476. <label for="is_clear_log" class="col-md-3 control-label">自动清除日志</label>
  477. <div class="col-md-9">
  478. <input type="checkbox" class="make-switch" @if($is_clear_log) checked @endif id="is_clear_log" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  479. <span class="help-block"> (推荐)启用后自动清除无用日志 </span>
  480. </div>
  481. </div>
  482. <div class="col-md-6">
  483. <label for="reset_traffic" class="col-md-3 control-label">流量自动重置</label>
  484. <div class="col-md-9">
  485. <input type="checkbox" class="make-switch" @if($reset_traffic) checked @endif id="reset_traffic" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  486. <span class="help-block"> 用户会按其购买套餐的日期自动重置可用流量 </span>
  487. </div>
  488. </div>
  489. </div>
  490. <div class="form-group">
  491. <div class="col-md-6">
  492. <label for="is_subscribe_ban" class="col-md-3 control-label">订阅异常自动封禁</label>
  493. <div class="col-md-9">
  494. <input type="checkbox" class="make-switch" @if($is_subscribe_ban) checked @endif id="is_subscribe_ban" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  495. <span class="help-block"> 启用后用户订阅链接请求超过设定阈值则自动封禁 </span>
  496. </div>
  497. </div>
  498. <div class="col-md-6">
  499. <label for="subscribe_ban_times" class="col-md-3 control-label">订阅请求阈值</label>
  500. <div class="col-md-9">
  501. <div class="input-group">
  502. <input class="form-control" type="text" name="subscribe_ban_times" value="{{$subscribe_ban_times}}" id="subscribe_ban_times" />
  503. <span class="input-group-btn">
  504. <button class="btn btn-success" type="button" onclick="setSubscribeBanTimes()">修改</button>
  505. </span>
  506. </div>
  507. <span class="help-block"> 24小时内订阅链接请求次数限制 </span>
  508. </div>
  509. </div>
  510. </div>
  511. <div class="form-group">
  512. <div class="col-md-6">
  513. <label for="is_traffic_ban" class="col-md-3 control-label">异常自动封号</label>
  514. <div class="col-md-9">
  515. <input type="checkbox" class="make-switch" @if($is_traffic_ban) checked @endif id="is_traffic_ban" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  516. <span class="help-block"> 24小时内流量超过异常阈值则自动封号 </span>
  517. </div>
  518. </div>
  519. <div class="col-md-6">
  520. <label for="traffic_ban_value" class="col-md-3 control-label">流量异常阈值</label>
  521. <div class="col-md-9">
  522. <div class="input-group">
  523. <input class="form-control" type="text" name="traffic_ban_value" value="{{$traffic_ban_value}}" id="traffic_ban_value" />
  524. <span class="input-group-addon">GiB</span>
  525. <span class="input-group-btn">
  526. <button class="btn btn-success" type="button" onclick="setTrafficBanValue()">修改</button>
  527. </span>
  528. </div>
  529. <span class="help-block"> 24小时内超过该值,则触发自动封号 </span>
  530. </div>
  531. </div>
  532. </div>
  533. <div class="form-group">
  534. <div class="col-md-6">
  535. <label for="traffic_ban_time" class="col-md-3 control-label">封号时长</label>
  536. <div class="col-md-9">
  537. <div class="input-group">
  538. <input class="form-control" type="text" name="traffic_ban_time" value="{{$traffic_ban_time}}" id="traffic_ban_time" />
  539. <span class="input-group-addon">分钟</span>
  540. <span class="input-group-btn">
  541. <button class="btn btn-success" type="button" onclick="setTrafficBanTime()">修改</button>
  542. </span>
  543. </div>
  544. <span class="help-block"> 触发流量异常导致用户被封禁的时长,到期后自动解封 </span>
  545. </div>
  546. </div>
  547. <div class="col-md-6">
  548. <label for="auto_release_port" class="col-md-3 control-label">端口自动释放</label>
  549. <div class="col-md-9">
  550. <input type="checkbox" class="make-switch" @if($auto_release_port) checked @endif id="auto_release_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  551. <span class="help-block"> 被禁用的用户端口自动释放,重新启用用户则需要手动分配端口并手动重启一次SSR(R) </span>
  552. </div>
  553. </div>
  554. </div>
  555. </div>
  556. </form>
  557. </div>
  558. <div class="tab-pane" id="tab_7">
  559. <form action="#" method="post" class="form-horizontal">
  560. <div class="portlet-body">
  561. <div class="form-group">
  562. <div class="col-md-12">
  563. <div class="alert alert-info" style="text-align: center;">
  564. 请在<a href="https://console.youzanyun.com/login" target="_blank">有赞云</a>后台设置应用的推送网址为:{{$website_url . '/api/yzy'}}
  565. </div>
  566. </div>
  567. </div>
  568. <div class="form-group">
  569. <div class="col-md-6">
  570. <label for="is_youzan" class="col-md-3 control-label">本功能</label>
  571. <div class="col-md-9">
  572. <input type="checkbox" class="make-switch" @if($is_youzan) checked @endif id="is_youzan" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
  573. <span class="help-block"> 请先到<a href="https://console.youzanyun.com/dashboard">有赞云</a>申请client_id和client_secret并绑定店铺 </span>
  574. </div>
  575. </div>
  576. <div class="col-md-6">
  577. <label for="kdt_id" class="col-md-3 control-label">kdt_id</label>
  578. <div class="col-md-9">
  579. <div class="input-group">
  580. <input class="form-control" type="text" name="kdt_id" value="{{$kdt_id}}" id="kdt_id" />
  581. <span class="input-group-btn">
  582. <button class="btn btn-success" type="button" onclick="setKdtId()">修改</button>
  583. </span>
  584. </div>
  585. <span class="help-block"> 即:授权店铺id </span>
  586. </div>
  587. </div>
  588. </div>
  589. <div class="form-group">
  590. <div class="col-md-6">
  591. <label for="youzan_client_id" class="col-md-3 control-label">client_id</label>
  592. <div class="col-md-9">
  593. <div class="input-group">
  594. <input class="form-control" type="text" name="youzan_client_id" value="{{$youzan_client_id}}" id="youzan_client_id" />
  595. <span class="input-group-btn">
  596. <button class="btn btn-success" type="button" onclick="setYouzanClientId()">修改</button>
  597. </span>
  598. </div>
  599. </div>
  600. </div>
  601. <div class="col-md-6">
  602. <label for="youzan_client_secret" class="col-md-3 control-label">client_secret</label>
  603. <div class="col-md-9">
  604. <div class="input-group">
  605. <input class="form-control" type="text" name="youzan_client_secret" value="{{$youzan_client_secret}}" id="youzan_client_secret" />
  606. <span class="input-group-btn">
  607. <button class="btn btn-success" type="button" onclick="setYouzanClientSecret()">修改</button>
  608. </span>
  609. </div>
  610. </div>
  611. </div>
  612. </div>
  613. </div>
  614. </form>
  615. </div>
  616. </div>
  617. </div>
  618. </div>
  619. </div>
  620. </div>
  621. </div>
  622. <!-- END PROFILE CONTENT -->
  623. </div>
  624. </div>
  625. <!-- END PAGE BASE CONTENT -->
  626. </div>
  627. <!-- END CONTENT BODY -->
  628. @endsection
  629. @section('script')
  630. <script src="/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
  631. <script src="/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js" type="text/javascript"></script>
  632. <script src="/assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
  633. <script src="/js/layer/layer.js" type="text/javascript"></script>
  634. <script type="text/javascript">
  635. $('#initial_labels_for_user').select2({
  636. placeholder: '设置后则可见相同标签的节点',
  637. allowClear: true,
  638. width:'100%'
  639. }).change(function () {
  640. var initial_labels_for_user = $(this).val() ? $(this).val().join(',') : '';
  641. console.log(initial_labels_for_user);
  642. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'initial_labels_for_user', value:initial_labels_for_user}, function (ret) {
  643. layer.msg(ret.message, {time:1000}, function() {
  644. if (ret.status == 'fail') {
  645. window.location.reload();
  646. }
  647. });
  648. });
  649. });
  650. // 启用、禁用随机端口
  651. $('#is_rand_port').on({
  652. 'switchChange.bootstrapSwitch': function(event, state) {
  653. var is_rand_port = state ? 1 : 0;
  654. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_rand_port', value:is_rand_port}, function (ret) {
  655. layer.msg(ret.message, {time:1000}, function() {
  656. if (ret.status == 'fail') {
  657. window.location.reload();
  658. }
  659. });
  660. });
  661. }
  662. });
  663. // 启用、禁用机器人访问
  664. $('#is_forbid_robot').on({
  665. 'switchChange.bootstrapSwitch': function(event, state) {
  666. var is_forbid_robot = state ? 1 : 0;
  667. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_forbid_robot', value:is_forbid_robot}, function (ret) {
  668. layer.msg(ret.message, {time:1000}, function() {
  669. if (ret.status == 'fail') {
  670. window.location.reload();
  671. }
  672. });
  673. });
  674. }
  675. });
  676. // 启用、禁用自定义端口
  677. $('#is_user_rand_port').on({
  678. 'switchChange.bootstrapSwitch': function(event, state) {
  679. var is_user_rand_port = state ? 1 : 0;
  680. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_user_rand_port', value:is_user_rand_port}, function (ret) {
  681. layer.msg(ret.message, {time:1000}, function() {
  682. if (ret.status == 'fail') {
  683. window.location.reload();
  684. }
  685. });
  686. });
  687. }
  688. });
  689. // 启用、禁用登录加积分
  690. $('#login_add_score').on({
  691. 'switchChange.bootstrapSwitch': function(event, state) {
  692. var login_add_score = state ? 1 : 0;
  693. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'login_add_score', value:login_add_score}, function (ret) {
  694. layer.msg(ret.message, {time:1000}, function() {
  695. if (ret.status == 'fail') {
  696. window.location.reload();
  697. }
  698. });
  699. });
  700. }
  701. });
  702. // 启用、禁用注册
  703. $('#is_register').on({
  704. 'switchChange.bootstrapSwitch': function(event, state) {
  705. var is_register = state ? 1 : 0;
  706. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_register', value:is_register}, function (ret) {
  707. layer.msg(ret.message, {time:1000}, function() {
  708. if (ret.status == 'fail') {
  709. window.location.reload();
  710. }
  711. });
  712. });
  713. }
  714. });
  715. // 启用、禁用邀请注册
  716. $('#is_invite_register').on({
  717. 'switchChange.bootstrapSwitch': function(event, state) {
  718. var is_invite_register = state ? 1 : 0;
  719. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_invite_register', value:is_invite_register}, function (ret) {
  720. layer.msg(ret.message, {time:1000}, function() {
  721. if (ret.status == 'fail') {
  722. window.location.reload();
  723. }
  724. });
  725. });
  726. }
  727. });
  728. // 启用、禁用用户重置密码
  729. $('#is_reset_password').on({
  730. 'switchChange.bootstrapSwitch': function(event, state) {
  731. var is_reset_password = state ? 1 : 0;
  732. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_reset_password', value:is_reset_password}, function (ret) {
  733. layer.msg(ret.message, {time:1000}, function() {
  734. if (ret.status == 'fail') {
  735. window.location.reload();
  736. }
  737. });
  738. });
  739. }
  740. });
  741. // 启用、禁用验证码
  742. $('#is_captcha').on({
  743. 'switchChange.bootstrapSwitch': function(event, state) {
  744. var is_captcha = state ? 1 : 0;
  745. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_captcha', value:is_captcha}, function (ret) {
  746. layer.msg(ret.message, {time:1000}, function() {
  747. if (ret.status == 'fail') {
  748. window.location.reload();
  749. }
  750. });
  751. });
  752. }
  753. });
  754. // 启用、禁用免费邀请码
  755. $('#is_free_code').on({
  756. 'switchChange.bootstrapSwitch': function(event, state) {
  757. var is_free_code = state ? 1 : 0;
  758. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_free_code', value:is_free_code}, function (ret) {
  759. layer.msg(ret.message, {time:1000}, function() {
  760. if (ret.status == 'fail') {
  761. window.location.reload();
  762. }
  763. });
  764. });
  765. }
  766. });
  767. // 启用、禁用用户激活用户
  768. $('#is_active_register').on({
  769. 'switchChange.bootstrapSwitch': function(event, state) {
  770. var is_active_register = state ? 1 : 0;
  771. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_active_register', value:is_active_register}, function (ret) {
  772. layer.msg(ret.message, {time:1000}, function() {
  773. if (ret.status == 'fail') {
  774. window.location.reload();
  775. }
  776. });
  777. });
  778. }
  779. });
  780. // 启用、禁用用户到期自动邮件提醒
  781. $('#expire_warning').on({
  782. 'switchChange.bootstrapSwitch': function(event, state) {
  783. var expire_warning = state ? 1 : 0;
  784. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'expire_warning', value:expire_warning}, function (ret) {
  785. layer.msg(ret.message, {time:1000}, function() {
  786. if (ret.status == 'fail') {
  787. window.location.reload();
  788. }
  789. });
  790. });
  791. }
  792. });
  793. // 启用、禁用节点宕机发件提醒管理员
  794. $('#is_node_crash_warning').on({
  795. 'switchChange.bootstrapSwitch': function(event, state) {
  796. var is_node_crash_warning = state ? 1 : 0;
  797. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_node_crash_warning', value:is_node_crash_warning}, function (ret) {
  798. layer.msg(ret.message, {time:1000}, function() {
  799. if (ret.status == 'fail') {
  800. window.location.reload();
  801. }
  802. });
  803. });
  804. }
  805. });
  806. // 启用、禁用节点宕机发ServerChan微信消息提醒
  807. $('#is_server_chan').on({
  808. 'switchChange.bootstrapSwitch': function(event, state) {
  809. var is_server_chan = state ? 1 : 0;
  810. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_server_chan', value:is_server_chan}, function (ret) {
  811. layer.msg(ret.message, {time:1000}, function() {
  812. if (ret.status == 'fail') {
  813. window.location.reload();
  814. }
  815. });
  816. });
  817. }
  818. });
  819. // 启用、禁用订阅异常自动封禁
  820. $('#is_subscribe_ban').on({
  821. 'switchChange.bootstrapSwitch': function(event, state) {
  822. var is_subscribe_ban = state ? 1 : 0;
  823. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_subscribe_ban', value:is_subscribe_ban}, function (ret) {
  824. layer.msg(ret.message, {time:1000}, function() {
  825. if (ret.status == 'fail') {
  826. window.location.reload();
  827. }
  828. });
  829. });
  830. }
  831. });
  832. // 启用、禁用退关返利用户可见与否
  833. $('#referral_status').on({
  834. 'switchChange.bootstrapSwitch': function(event, state) {
  835. var referral_status = state ? 1 : 0;
  836. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'referral_status', value:referral_status}, function (ret) {
  837. layer.msg(ret.message, {time:1000}, function() {
  838. if (ret.status == 'fail') {
  839. window.location.reload();
  840. }
  841. });
  842. });
  843. }
  844. });
  845. // 启用、禁用随机端口
  846. $('#traffic_warning').on({
  847. 'switchChange.bootstrapSwitch': function(event, state) {
  848. var traffic_warning = state ? 1 : 0;
  849. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_warning', value:traffic_warning}, function (ret) {
  850. layer.msg(ret.message, {time:1000}, function() {
  851. if (ret.status == 'fail') {
  852. window.location.reload();
  853. }
  854. });
  855. });
  856. }
  857. });
  858. // 启用、禁用随机端口
  859. $('#is_clear_log').on({
  860. 'switchChange.bootstrapSwitch': function(event, state) {
  861. var is_clear_log = state ? 1 : 0;
  862. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_clear_log', value:is_clear_log}, function (ret) {
  863. layer.msg(ret.message, {time:1000}, function() {
  864. if (ret.status == 'fail') {
  865. window.location.reload();
  866. }
  867. });
  868. });
  869. }
  870. });
  871. // 启用、禁用流量自动重置
  872. $('#reset_traffic').on({
  873. 'switchChange.bootstrapSwitch': function(event, state) {
  874. var reset_traffic = state ? 1 : 0;
  875. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'reset_traffic', value:reset_traffic}, function (ret) {
  876. layer.msg(ret.message, {time:1000}, function() {
  877. if (ret.status == 'fail') {
  878. window.location.reload();
  879. }
  880. });
  881. });
  882. }
  883. });
  884. // 启用、禁用流量异常自动封号
  885. $('#is_traffic_ban').on({
  886. 'switchChange.bootstrapSwitch': function(event, state) {
  887. var is_traffic_ban = state ? 1 : 0;
  888. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_traffic_ban', value:is_traffic_ban}, function (ret) {
  889. layer.msg(ret.message, {time:1000}, function() {
  890. if (ret.status == 'fail') {
  891. window.location.reload();
  892. }
  893. });
  894. });
  895. }
  896. });
  897. // 启用、禁用端口自动释放
  898. $('#auto_release_port').on({
  899. 'switchChange.bootstrapSwitch': function(event, state) {
  900. var auto_release_port = state ? 1 : 0;
  901. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'auto_release_port', value:auto_release_port}, function (ret) {
  902. layer.msg(ret.message, {time:1000}, function() {
  903. if (ret.status == 'fail') {
  904. window.location.reload();
  905. }
  906. });
  907. });
  908. }
  909. });
  910. // 启用、禁用有赞云
  911. $('#is_youzan').on({
  912. 'switchChange.bootstrapSwitch': function(event, state) {
  913. var is_youzan = state ? 1 : 0;
  914. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_youzan', value:is_youzan}, function (ret) {
  915. layer.msg(ret.message, {time:1000}, function() {
  916. if (ret.status == 'fail') {
  917. window.location.reload();
  918. }
  919. });
  920. });
  921. }
  922. });
  923. // 流量异常阈值
  924. function setTrafficBanValue() {
  925. var traffic_ban_value = $("#traffic_ban_value").val();
  926. if (traffic_ban_value < 0) {
  927. layer.msg('不能小于0', {time:1000});
  928. return ;
  929. }
  930. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_ban_value', value:traffic_ban_value}, function (ret) {
  931. layer.msg(ret.message, {time:1000}, function() {
  932. if (ret.status == 'fail') {
  933. window.location.reload();
  934. }
  935. });
  936. });
  937. }
  938. // 设置用户封号时长
  939. function setTrafficBanTime() {
  940. var traffic_ban_time = $("#traffic_ban_time").val();
  941. if (traffic_ban_time < 0) {
  942. layer.msg('不能小于0', {time:1000});
  943. return ;
  944. }
  945. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_ban_time', value:traffic_ban_time}, function (ret) {
  946. layer.msg(ret.message, {time:1000}, function() {
  947. if (ret.status == 'fail') {
  948. window.location.reload();
  949. }
  950. });
  951. });
  952. }
  953. // 设置节点宕机警告收件地址
  954. function setCrashWarningEmail() {
  955. var crash_warning_email = $("#crash_warning_email").val();
  956. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'crash_warning_email', value:crash_warning_email}, function (ret) {
  957. layer.msg(ret.message, {time:1000}, function() {
  958. if (ret.status == 'fail') {
  959. window.location.reload();
  960. }
  961. });
  962. });
  963. }
  964. // 设置ServerChan的SCKEY
  965. function setServerChanKey() {
  966. var server_chan_key = $("#server_chan_key").val();
  967. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'server_chan_key', value:server_chan_key}, function (ret) {
  968. layer.msg(ret.message, {time:1000}, function() {
  969. if (ret.status == 'fail') {
  970. window.location.reload();
  971. }
  972. });
  973. });
  974. }
  975. // 设置订阅封禁阈值
  976. function setSubscribeBanTimes() {
  977. var subscribe_ban_times = $("#subscribe_ban_times").val();
  978. if (subscribe_ban_times < 0) {
  979. layer.msg('不能小于0', {time:1000});
  980. return ;
  981. }
  982. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'subscribe_ban_times', value:subscribe_ban_times}, function (ret) {
  983. layer.msg(ret.message, {time:1000}, function() {
  984. if (ret.status == 'fail') {
  985. window.location.reload();
  986. }
  987. });
  988. });
  989. }
  990. // 设置有赞云的kdt_id
  991. function setKdtId() {
  992. var kdt_id = $("#kdt_id").val();
  993. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'kdt_id', value:kdt_id}, function (ret) {
  994. layer.msg(ret.message, {time:1000}, function() {
  995. if (ret.status == 'fail') {
  996. window.location.reload();
  997. }
  998. });
  999. });
  1000. }
  1001. // 设置有赞云的client_id
  1002. function setYouzanClientId() {
  1003. var youzan_client_id = $("#youzan_client_id").val();
  1004. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'youzan_client_id', value:youzan_client_id}, function (ret) {
  1005. layer.msg(ret.message, {time:1000}, function() {
  1006. if (ret.status == 'fail') {
  1007. window.location.reload();
  1008. }
  1009. });
  1010. });
  1011. }
  1012. // 设置有赞云的client_secret
  1013. function setYouzanClientSecret() {
  1014. var youzan_client_secret = $("#youzan_client_secret").val();
  1015. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'youzan_client_secret', value:youzan_client_secret}, function (ret) {
  1016. layer.msg(ret.message, {time:1000}, function() {
  1017. if (ret.status == 'fail') {
  1018. window.location.reload();
  1019. }
  1020. });
  1021. });
  1022. }
  1023. // 设置最小积分
  1024. $("#min_rand_score").change(function () {
  1025. var min_rand_score = $(this).val();
  1026. var max_rand_score = $("#max_rand_score").val();
  1027. if (parseInt(min_rand_score) < 0) {
  1028. layer.msg('最小积分小于0', {time:1000});
  1029. return ;
  1030. }
  1031. if (parseInt(min_rand_score) >= parseInt(max_rand_score)) {
  1032. layer.msg('最小积分必须小于最大积分', {time:1000});
  1033. return ;
  1034. }
  1035. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'min_rand_score', value:min_rand_score}, function (ret) {
  1036. layer.msg(ret.message, {time:1000}, function() {
  1037. if (ret.status == 'fail') {
  1038. window.location.reload();
  1039. }
  1040. });
  1041. });
  1042. });
  1043. // 设置最大积分
  1044. $("#max_rand_score").change(function () {
  1045. var min_rand_score = $("#min_rand_score").val();
  1046. var max_rand_score = $(this).val();
  1047. if (parseInt(max_rand_score) > 99999) {
  1048. layer.msg('最大积分不能大于99999', {time:1000});
  1049. return ;
  1050. }
  1051. if (parseInt(min_rand_score) >= parseInt(max_rand_score)) {
  1052. layer.msg('最大积分必须大于最小积分', {time:1000});
  1053. return ;
  1054. }
  1055. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'max_rand_score', value:max_rand_score}, function (ret) {
  1056. layer.msg(ret.message, {time:1000}, function() {
  1057. if (ret.status == 'fail') {
  1058. window.location.reload();
  1059. }
  1060. });
  1061. });
  1062. });
  1063. // 设置最小端口
  1064. $("#min_port").change(function () {
  1065. var min_port = $(this).val();
  1066. if (parseInt(min_port) < 1000) {
  1067. layer.msg('最小端口不能小于1000', {time:1000});
  1068. return ;
  1069. }
  1070. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'min_port', value:min_port}, function (ret) {
  1071. layer.msg(ret.message, {time:1000}, function() {
  1072. if (ret.status == 'fail') {
  1073. window.location.reload();
  1074. }
  1075. });
  1076. });
  1077. });
  1078. // 设置最大端口
  1079. $("#max_port").change(function () {
  1080. var min_port = $("#min_port").val();
  1081. var max_port = $(this).val();
  1082. // 最大端口必须大于最小端口
  1083. if (parseInt(max_port) <= parseInt(min_port)) {
  1084. layer.msg('必须大于最小端口', {time:1000});
  1085. return ;
  1086. }
  1087. if (parseInt(max_port) > 65535) {
  1088. layer.msg('最大端口不能大于65535', {time:1000});
  1089. return ;
  1090. }
  1091. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'max_port', value:max_port}, function (ret) {
  1092. layer.msg(ret.message, {time:1000}, function() {
  1093. if (ret.status == 'fail') {
  1094. window.location.reload();
  1095. }
  1096. });
  1097. });
  1098. });
  1099. // 设置注册时默认有效期
  1100. function setDefaultDays() {
  1101. var default_days = parseInt($("#default_days").val());
  1102. if (default_days < 0) {
  1103. layer.msg('不能小于0', {time:1000});
  1104. return ;
  1105. }
  1106. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'default_days', value:default_days}, function (ret) {
  1107. layer.msg(ret.message, {time:1000}, function() {
  1108. if (ret.status == 'fail') {
  1109. window.location.reload();
  1110. }
  1111. });
  1112. });
  1113. }
  1114. // 设置注册时默认流量
  1115. function setDefaultTraffic() {
  1116. var default_traffic = parseInt($("#default_traffic").val());
  1117. if (default_traffic < 0) {
  1118. layer.msg('不能小于0', {time:1000});
  1119. return ;
  1120. }
  1121. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'default_traffic', value:default_traffic}, function (ret) {
  1122. layer.msg(ret.message, {time:1000}, function() {
  1123. if (ret.status == 'fail') {
  1124. window.location.reload();
  1125. }
  1126. });
  1127. });
  1128. }
  1129. // 设置可生成邀请码数量
  1130. function setInviteNum() {
  1131. var invite_num = parseInt($("#invite_num").val());
  1132. if (invite_num < 0) {
  1133. layer.msg('不能小于0', {time:1000});
  1134. return ;
  1135. }
  1136. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'invite_num', value:invite_num}, function (ret) {
  1137. layer.msg(ret.message, {time:1000}, function() {
  1138. if (ret.status == 'fail') {
  1139. window.location.reload();
  1140. }
  1141. });
  1142. });
  1143. }
  1144. // 设置重置密码次数
  1145. function setResetPasswordTimes() {
  1146. var reset_password_times = $("#reset_password_times").val();
  1147. if (reset_password_times < 0) {
  1148. layer.msg('不能小于0', {time:1000});
  1149. return ;
  1150. }
  1151. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'reset_password_times', value:reset_password_times}, function (ret) {
  1152. layer.msg(ret.message, {time:1000}, function() {
  1153. if (ret.status == 'fail') {
  1154. window.location.reload();
  1155. }
  1156. });
  1157. });
  1158. }
  1159. // 设置激活用户次数
  1160. function setActiveTimes() {
  1161. var active_times = parseInt($("#active_times").val());
  1162. if (active_times < 0) {
  1163. layer.msg('不能小于0', {time:1000});
  1164. return ;
  1165. }
  1166. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'active_times', value:active_times}, function (ret) {
  1167. layer.msg(ret.message, {time:1000}, function() {
  1168. if (ret.status == 'fail') {
  1169. window.location.reload();
  1170. }
  1171. });
  1172. });
  1173. }
  1174. // 设置节点订阅地址
  1175. function setSubscribeDomain() {
  1176. var subscribe_domain = $("#subscribe_domain").val();
  1177. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'subscribe_domain', value:subscribe_domain}, function (ret) {
  1178. layer.msg(ret.message, {time:1000}, function() {
  1179. if (ret.status == 'fail') {
  1180. window.location.reload();
  1181. }
  1182. });
  1183. });
  1184. }
  1185. // 设置节点订阅随机展示节点数
  1186. function setSubscribeMax() {
  1187. var subscribe_max = parseInt($("#subscribe_max").val());
  1188. if (subscribe_max < 0) {
  1189. layer.msg('不能小于0', {time:1000});
  1190. return ;
  1191. }
  1192. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'subscribe_max', value:subscribe_max}, function (ret) {
  1193. layer.msg(ret.message, {time:1000}, function() {
  1194. if (ret.status == 'fail') {
  1195. window.location.reload();
  1196. }
  1197. });
  1198. });
  1199. }
  1200. // 设置流量警告阈值
  1201. function setTrafficWarningPercent() {
  1202. var traffic_warning_percent = $("#traffic_warning_percent").val();
  1203. if (traffic_warning_percent < 0) {
  1204. layer.msg('不能小于0', {time:1000});
  1205. return ;
  1206. }
  1207. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_warning_percent', value:traffic_warning_percent}, function (ret) {
  1208. layer.msg(ret.message, {time:1000}, function() {
  1209. if (ret.status == 'fail') {
  1210. window.location.reload();
  1211. }
  1212. });
  1213. });
  1214. }
  1215. // 设置用户过期提醒阈值
  1216. function setExpireDays() {
  1217. var expire_days = parseInt($("#expire_days").val());
  1218. if (expire_days < 0) {
  1219. layer.msg('不能小于0', {time:1000});
  1220. return ;
  1221. }
  1222. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'expire_days', value:expire_days}, function (ret) {
  1223. layer.msg(ret.message, {time:1000}, function() {
  1224. if (ret.status == 'fail') {
  1225. window.location.reload();
  1226. }
  1227. });
  1228. });
  1229. }
  1230. // 设置网站名称
  1231. function setWebsiteName() {
  1232. var website_name = $("#website_name").val();
  1233. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'website_name', value:website_name}, function (ret) {
  1234. layer.msg(ret.message, {time:1000}, function() {
  1235. if (ret.status == 'fail') {
  1236. window.location.reload();
  1237. }
  1238. });
  1239. });
  1240. }
  1241. // 设置网站地址
  1242. function setWebsiteUrl() {
  1243. var website_url = $("#website_url").val();
  1244. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'website_url', value:website_url}, function (ret) {
  1245. layer.msg(ret.message, {time:1000}, function() {
  1246. if (ret.status == 'fail') {
  1247. window.location.reload();
  1248. }
  1249. });
  1250. });
  1251. }
  1252. // 登录加积分的时间间隔
  1253. function setLoginAddScoreRange() {
  1254. var login_add_score_range = parseInt($("#login_add_score_range").val());
  1255. if (login_add_score_range < 0) {
  1256. layer.msg('不能小于0', {time:1000});
  1257. return ;
  1258. }
  1259. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'login_add_score_range', value:login_add_score_range}, function (ret) {
  1260. layer.msg(ret.message, {time:1000}, function() {
  1261. if (ret.status == 'fail') {
  1262. window.location.reload();
  1263. }
  1264. });
  1265. });
  1266. }
  1267. // 设置根据推广链接注册送流量
  1268. function setReferralTraffic() {
  1269. var referral_traffic = parseInt($("#referral_traffic").val());
  1270. if (referral_traffic < 0) {
  1271. layer.msg('不能小于0', {time:1000});
  1272. return ;
  1273. }
  1274. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'referral_traffic', value:referral_traffic}, function (ret) {
  1275. layer.msg(ret.message, {time:1000}, function() {
  1276. if (ret.status == 'fail') {
  1277. window.location.reload();
  1278. }
  1279. });
  1280. });
  1281. }
  1282. // 设置根据推广链接注册人每产生一笔消费,则推广人可以获得的返利比例
  1283. function setReferralPercent() {
  1284. var referral_percent = $("#referral_percent").val();
  1285. if (referral_percent < 0) {
  1286. layer.msg('不能小于0', {time:1000});
  1287. return ;
  1288. }
  1289. $.post("{{url('admin/setReferralPercent')}}", {_token:'{{csrf_token()}}', value:referral_percent}, function (ret) {
  1290. layer.msg(ret.message, {time:1000}, function() {
  1291. if (ret.status == 'fail') {
  1292. window.location.reload();
  1293. }
  1294. });
  1295. });
  1296. }
  1297. // 设置返利满多少元才可以提现
  1298. function setReferralMoney() {
  1299. var referral_money = $("#referral_money").val();
  1300. if (referral_money < 0) {
  1301. layer.msg('不能小于0', {time:1000});
  1302. return ;
  1303. }
  1304. $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'referral_money', value:referral_money}, function (ret) {
  1305. layer.msg(ret.message, {time:1000}, function() {
  1306. if (ret.status == 'fail') {
  1307. window.location.reload();
  1308. }
  1309. });
  1310. });
  1311. }
  1312. </script>
  1313. @endsection