system.blade.php 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-select/bootstrap-select.min.css" type="text/css" rel="stylesheet">
  4. <link href="//cdn.bootcss.com/bootstrap-switch/4.0.0-alpha.1/css/bootstrap-switch.min.css" type="text/css" rel="stylesheet">
  5. <link href="/assets/global/vendor/dropify/dropify.min.css" type="text/css" rel="stylesheet">
  6. <style>
  7. .text-help {
  8. padding-left: 15px;
  9. }
  10. </style>
  11. @endsection
  12. @section('content')
  13. <div class="page-content container-fluid">
  14. <div class="panel">
  15. <div class="panel-heading">
  16. <h1 class="panel-title"><i class="icon wb-settings"></i>通用配置</h1>
  17. </div>
  18. <div class="panel-body">
  19. <div class="nav-tabs-horizontal" data-plugin="tabs">
  20. <ul class="nav nav-tabs" role="tablist">
  21. <li class="nav-item" role="presentation">
  22. <a class="nav-link active" data-toggle="tab" href="#webSetting" aria-controls="webSetting" role="tab">网站常规</a>
  23. </li>
  24. <li class="nav-item" role="presentation">
  25. <a class="nav-link" data-toggle="tab" href="#account" aria-controls="account" role="tab">账号设置</a>
  26. </li>
  27. <li class="nav-item" role="presentation">
  28. <a class="nav-link" data-toggle="tab" href="#node" aria-controls="node" role="tab">节点设置</a>
  29. </li>
  30. <li class="nav-item" role="presentation">
  31. <a class="nav-link" data-toggle="tab" href="#extend" aria-controls="extend" role="tab">拓展功能</a>
  32. </li>
  33. <li class="nav-item" role="presentation">
  34. <a class="nav-link" data-toggle="tab" href="#checkIn" aria-controls="checkIn" role="tab">签到系统</a>
  35. </li>
  36. <li class="nav-item" role="presentation">
  37. <a class="nav-link" data-toggle="tab" href="#promo" aria-controls="promo" role="tab">推广系统</a>
  38. </li>
  39. <li class="nav-item" role="presentation">
  40. <a class="nav-link" data-toggle="tab" href="#notify" aria-controls="notify" role="tab">通知系统</a>
  41. </li>
  42. <li class="nav-item" role="presentation">
  43. <a class="nav-link" data-toggle="tab" href="#auto" aria-controls="auto" role="tab">自动任务</a>
  44. </li>
  45. <li class="nav-item" role="presentation">
  46. <a class="nav-link" data-toggle="tab" href="#other" aria-controls="other" role="tab">LOGO|客服|统计</a>
  47. </li>
  48. <li class="nav-item" role="presentation">
  49. <a class="nav-link" data-toggle="tab" href="#payment" aria-controls="payment" role="tab">支付系统</a>
  50. </li>
  51. <li class="dropdown nav-item" role="presentation">
  52. <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" aria-expanded="false">菜单</a>
  53. <div class="dropdown-menu" role="menu">
  54. <a class="dropdown-item active" data-toggle="tab" href="#webSetting" aria-controls="webSetting" role="tab">网站常规</a>
  55. <a class="dropdown-item" data-toggle="tab" href="#account" aria-controls="account" role="tab">账号设置</a>
  56. <a class="dropdown-item" data-toggle="tab" href="#node" aria-controls="node" role="tab">节点设置</a>
  57. <a class="dropdown-item" data-toggle="tab" href="#extend" aria-controls="extend" role="tab">拓展功能</a>
  58. <a class="dropdown-item" data-toggle="tab" href="#checkIn" aria-controls="checkIn" role="tab">签到系统</a>
  59. <a class="dropdown-item" data-toggle="tab" href="#promo" aria-controls="promo" role="tab">推广系统</a>
  60. <a class="dropdown-item" data-toggle="tab" href="#notify" aria-controls="notify" role="tab">通知系统</a>
  61. <a class="dropdown-item" data-toggle="tab" href="#auto" aria-controls="auto" role="tab">自动任务</a>
  62. <a class="dropdown-item" data-toggle="tab" href="#other" aria-controls="other" role="tab">LOGO|客服|统计</a>
  63. <a class="dropdown-item" data-toggle="tab" href="#payment" aria-controls="payment" role="tab">支付系统</a>
  64. </div>
  65. </li>
  66. </ul>
  67. <div class="tab-content py-35 px-35">
  68. <div class="tab-pane active" id="webSetting" role="tabpanel">
  69. <form action="#" method="post" role="form" class="form-horizontal" autocomplete="off">
  70. <div class="form-row">
  71. <div class="form-group col-lg-6">
  72. <div class="row">
  73. <label class="col-md-3" for="website_name">网站名称</label>
  74. <div class="col-md-6">
  75. <div class="input-group">
  76. <input type="text" class="form-control" name="website_name" id="website_name" value="{{$website_name}}"/>
  77. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setWebsiteName()">修改</button></span>
  78. </div>
  79. </div>
  80. <span class="offset-md-3 text-help"> 发邮件时展示 </span>
  81. </div>
  82. </div>
  83. <div class="form-group col-lg-6">
  84. <div class="row">
  85. <label class="col-md-3 col-form-label" for="website_url">网站地址</label>
  86. <div class="col-md-6">
  87. <div class="input-group">
  88. <input type="url" class="form-control" name="website_url" id="website_url" value="{{$website_url}}"/>
  89. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setWebsiteUrl()">修改</button></span>
  90. </div>
  91. </div>
  92. <span class="text-help offset-md-3"> 生成重置密码、在线支付必备 </span>
  93. </div>
  94. </div>
  95. <div class="form-group col-lg-6">
  96. <div class="row">
  97. <label class="col-md-3 col-form-label" for="AppStore_id">苹果账号</label>
  98. <div class="col-md-6">
  99. <div class="input-group">
  100. <input type="email" class="form-control" name="AppStore_id" id="AppStore_id" value="{{$AppStore_id}}"/>
  101. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAppStoreId()">修改</button></span>
  102. </div>
  103. </div>
  104. <span class="text-help offset-md-3"> iOS软件设置教程中使用的苹果账号 </span>
  105. </div>
  106. </div>
  107. <div class="form-group col-lg-6">
  108. <div class="row">
  109. <label class="col-md-3 col-form-label" for="AppStore_password">苹果密码</label>
  110. <div class="col-md-6">
  111. <div class="input-group">
  112. <input type="password" class="form-control" name="AppStore_password" id="AppStore_password" value="{{$AppStore_password}}"/>
  113. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAppStorePassword()">修改</button></span>
  114. </div>
  115. </div>
  116. <span class="text-help offset-md-3"> iOS软件设置教程中使用的苹果密码 </span>
  117. </div>
  118. </div>
  119. <div class="form-group col-lg-6">
  120. <div class="row">
  121. <label class="col-md-3 col-form-label" for="admin_email">管理员邮箱</label>
  122. <div class="col-md-6">
  123. <div class="input-group">
  124. <input type="email" class="form-control" name="admin_email" id="admin_email" value="{{$admin_email}}"/>
  125. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAdminEmail()">修改</button></span>
  126. </div>
  127. </div>
  128. <span class="text-help offset-md-3"> 错误提示时会提供管理员邮箱作为联系方式 </span>
  129. </div>
  130. </div>
  131. <div class="form-group col-lg-6">
  132. <div class="row">
  133. <label class="col-md-3 col-form-label" for="website_security_code">网站安全码</label>
  134. <div class="col-md-6">
  135. <div class="input-group">
  136. <input type="text" class="form-control" name="website_security_code" id="website_security_code" value="{{$website_security_code}}"/>
  137. <span class="input-group-append">
  138. <button class="btn btn-info" type="button" onclick="makeWebsiteSecurityCode()">生成</button>
  139. <button class="btn btn-primary" type="button" onclick="setWebsiteSecurityCode()">修改</button>
  140. </span>
  141. </div>
  142. </div>
  143. <span class="text-help offset-md-3">非空时必须通过 <a href="/login?securityCode=" target="_blank">安全入口</a> 加上安全码才可访问 </span>
  144. </div>
  145. </div>
  146. <div class="form-group col-lg-6">
  147. <div class="row">
  148. <label class="col-md-3 col-form-label" for="is_forbid_china">阻止大陆访问</label>
  149. <span class="col-md-9"><input type="checkbox" id="is_forbid_china" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_forbid_china) checked @endif></span>
  150. <span class="text-help offset-md-3"> 开启后大陆IP禁止访问 </span>
  151. </div>
  152. </div>
  153. <div class="form-group col-lg-6">
  154. <div class="row">
  155. <label class="col-md-3 col-form-label" for="is_forbid_oversea">阻止海外访问</label>
  156. <span class="col-md-9"><input type="checkbox" id="is_forbid_oversea" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_forbid_oversea) checked @endif></span>
  157. <span class="text-help offset-md-3"> 开启后海外IP(含港澳台)禁止访问 </span>
  158. </div>
  159. </div>
  160. <div class="form-group col-lg-6">
  161. <div class="row">
  162. <label class="col-md-3 col-form-label" for="is_forbid_robot">阻止机器人访问</label>
  163. <span class="col-md-9"><input type="checkbox" id="is_forbid_robot" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_forbid_robot) checked @endif></span>
  164. <span class="text-help offset-md-3"> 如果是机器人、爬虫、代理访问网站则会抛出404错误 </span>
  165. </div>
  166. </div>
  167. </div>
  168. </form>
  169. </div>
  170. <div class="tab-pane" id="account" role="tabpanel">
  171. <form action="#" method="post" role="form" class="form-horizontal">
  172. <div class="form-row">
  173. <div class="form-group col-lg-6">
  174. <div class="row">
  175. <label class="col-md-3 col-form-label" for="is_register">用户注册</label>
  176. <span class="col-md-9"><input type="checkbox" id="is_register" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_register) checked @endif></span>
  177. <span class="text-help offset-md-3"> 关闭后无法注册 </span>
  178. </div>
  179. </div>
  180. <div class="form-group col-lg-6">
  181. <div class="row">
  182. <label class="col-md-3 col-form-label" for="is_invite_register">邀请注册</label>
  183. <select class="col-md-3" name="is_invite_register" id="is_invite_register" data-plugin="selectpicker" data-style="btn-outline btn-primary">
  184. <option value="0" @if($is_invite_register == '0') selected @endif>关闭</option>
  185. <option value="1" @if($is_invite_register == '1') selected @endif>可选</option>
  186. <option value="2" @if($is_invite_register == '2') selected @endif>必须</option>
  187. </select>
  188. </div>
  189. </div>
  190. <div class="form-group col-lg-6">
  191. <div class="row">
  192. <label class="col-md-3 col-form-label" for="is_active_register">激活账号</label>
  193. <span class="col-md-9"><input type="checkbox" id="is_active_register" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_active_register) checked @endif></span>
  194. <span class="text-help offset-md-3"> 启用后用户需要通过邮件来激活账号 </span>
  195. </div>
  196. </div>
  197. <div class="form-group col-lg-6">
  198. <div class="row">
  199. <label class="col-md-3 col-form-label" for="is_reset_password">重置密码</label>
  200. <span class="col-md-9"><input type="checkbox" id="is_reset_password" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_reset_password) checked @endif></span>
  201. <span class="text-help offset-md-3"> 启用后用户可以通过邮件重置密码 </span>
  202. </div>
  203. </div>
  204. <div class="form-group col-lg-6">
  205. <div class="row">
  206. <label class="col-md-3 col-form-label" for="is_captcha">验证码</label>
  207. <select class="col-md-5" name="is_captcha" id="is_captcha" data-plugin="selectpicker" data-style="btn-outline btn-primary">
  208. <option value="0" @if($is_captcha == '0') selected @endif>关闭</option>
  209. <option value="1" @if($is_captcha == '1') selected @endif>普通验证码</option>
  210. <option value="2" @if($is_captcha == '2') selected @endif>极验Geetest</option>
  211. <option value="3" @if($is_captcha == '3') selected @endif>Google reCAPTCHA</option>
  212. </select>
  213. <span class="text-help offset-md-3"> 启用后登录、注册需要输入验证码 </span>
  214. </div>
  215. </div>
  216. <div class="form-group col-lg-6">
  217. <div class="row">
  218. <label class="col-md-3 col-form-label" for="is_free_code">免费邀请码</label>
  219. <span class="col-md-9"><input type="checkbox" id="is_free_code" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_free_code) checked @endif></span>
  220. <span class="text-help offset-md-3"> 关闭后免费邀请码不可见 </span>
  221. </div>
  222. </div>
  223. <div class="form-group col-lg-6">
  224. <div class="row">
  225. <label class="col-md-3 col-form-label" for="is_verify_register">注册校验验证码</label>
  226. <span class="col-md-9"><input type="checkbox" id="is_verify_register" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_verify_register) checked @endif></span>
  227. <span class="text-help offset-md-3"> 注册时需要先通过邮件获取验证码方可注册,‘激活账号’失效 </span>
  228. </div>
  229. </div>
  230. <div class="form-group col-lg-6">
  231. <div class="row">
  232. <label for="is_rand_port" class="col-md-3 col-form-label">随机端口</label>
  233. <span class="col-md-9"><input type="checkbox" id="is_rand_port" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_rand_port) checked @endif></span>
  234. <span class="text-help offset-md-3"> 注册、添加用户时随机生成端口 </span>
  235. </div>
  236. </div>
  237. <div class="form-group col-lg-6">
  238. <div class="row">
  239. <label class="col-md-3 col-form-label">端口范围</label>
  240. <div class="col-md-7">
  241. <div class="input-group">
  242. <label for="min_port"></label>
  243. <input type="number" class="form-control" name="min_port" id="min_port" value="{{$min_port}}"/>
  244. <div class="input-group-prepend">
  245. <span class="input-group-text"> ~ </span>
  246. </div>
  247. <label for="max_port"></label>
  248. <input type="number" class="form-control" name="max_port" id="max_port" value="{{$max_port}}"/>
  249. </div>
  250. </div>
  251. <span class="text-help offset-md-3"> 端口范围:1000 - 65535 </span>
  252. </div>
  253. </div>
  254. <div class="form-group col-lg-6">
  255. <div class="row">
  256. <label class="col-md-3 col-form-label" for="is_user_rand_port">自定义端口</label>
  257. <span class="col-md-9"><input type="checkbox" id="is_user_rand_port" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_user_rand_port) checked @endif></span>
  258. <span class="text-help offset-md-3"> 用户可以自定义端口 </span>
  259. </div>
  260. </div>
  261. <div class="form-group col-lg-6">
  262. <div class="row">
  263. <label class="col-md-3 col-form-label" for="default_days">初始有效期</label>
  264. <div class="col-md-7">
  265. <div class="input-group">
  266. <input type="number" class="form-control" name="default_days" id="default_days" value="{{$default_days}}"/>
  267. <div class="input-group-append">
  268. </div>
  269. <span class="input-group-text">天</span>
  270. <button class="btn btn-primary" type="button" onclick="setDefaultDays()">修改</button>
  271. </div>
  272. </div>
  273. <span class="text-help offset-md-3"> 用户注册时默认账户有效期,为0即当天到期 </span>
  274. </div>
  275. </div>
  276. <div class="form-group col-lg-6">
  277. <div class="row">
  278. <label class="col-md-3 col-form-label" for="default_traffic">初始流量</label>
  279. <div class="col-md-7">
  280. <div class="input-group">
  281. <input type="number" class="form-control" name="default_traffic" id="default_traffic" value="{{$default_traffic}}"/>
  282. <div class="input-group-append">
  283. </div>
  284. <span class="input-group-text">MB</span>
  285. <button class="btn btn-primary" type="button" onclick="setDefaultTraffic()">修改</button>
  286. </div>
  287. </div>
  288. <span class="text-help offset-md-3"> 用户注册时默认可用流量 </span>
  289. </div>
  290. </div>
  291. <div class="form-group col-lg-6">
  292. <div class="row">
  293. <label class="col-md-3 col-form-label" for="invite_num">可生成邀请码数</label>
  294. <div class="col-md-7">
  295. <div class="input-group">
  296. <input type="number" class="form-control" name="invite_num" id="invite_num" value="{{$invite_num}}"/>
  297. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setInviteNum()">修改</button></span>
  298. </div>
  299. </div>
  300. <span class="text-help offset-md-3"> 用户可以生成的邀请码数 </span>
  301. </div>
  302. </div>
  303. <div class="form-group col-lg-6">
  304. <div class="row">
  305. <label class="col-md-3 col-form-label" for="reset_password_times">重置密码次数</label>
  306. <div class="col-md-7">
  307. <div class="input-group">
  308. <input type="number" class="form-control" name="reset_password_times" id="reset_password_times" value="{{$reset_password_times}}"/>
  309. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setResetPasswordTimes()">修改</button></span>
  310. </div>
  311. </div>
  312. <span class="text-help offset-md-3"> 24小时内可以通过邮件重置密码次数 </span>
  313. </div>
  314. </div>
  315. <div class="form-group col-lg-6">
  316. <div class="row">
  317. <label class="col-md-3 col-form-label" for="sensitiveType">邮箱过滤机制</label>
  318. <span class="col-md-9"><input type="checkbox" id="sensitiveType" data-on-color="primary" data-off-color="danger" data-on-text="黑名单" data-off-text="白名单" data-base-class="bootstrap-switch" @if($sensitiveType) checked @endif></span>
  319. <span class="text-help offset-md-3"> 黑名单时,用户可使用任意黑名单外的邮箱注册;白名单时用户只能选择使用白名单中的邮箱后缀注册 </span>
  320. </div>
  321. </div>
  322. <div class="form-group col-lg-6">
  323. <div class="row">
  324. <label class="col-md-3 col-form-label" for="active_times">激活账号次数</label>
  325. <div class="col-md-7">
  326. <div class="input-group">
  327. <input type="number" class="form-control" name="active_times" id="active_times" value="{{$active_times}}"/>
  328. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setActiveTimes()">修改</button></span>
  329. </div>
  330. </div>
  331. <span class="text-help offset-md-3"> 24小时内可以通过邮件激活账号次数 </span>
  332. </div>
  333. </div>
  334. <div class="form-group col-lg-6">
  335. <div class="row">
  336. <label class="col-md-3 col-form-label" for="register_ip_limit">同IP注册限制</label>
  337. <div class="col-md-7">
  338. <div class="input-group">
  339. <input type="number" class="form-control" name="register_ip_limit" id="register_ip_limit" value="{{$register_ip_limit}}"/>
  340. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setRegisterIpLimit()">修改</button></span>
  341. </div>
  342. </div>
  343. <span class="text-help offset-md-3"> 同IP在24小时内允许注册数量,为0时不限制 </span>
  344. </div>
  345. </div>
  346. <div class="form-group col-lg-6">
  347. <div class="row">
  348. <label class="col-md-3 col-form-label" for="initial_labels_for_user">用户初始标签</label>
  349. <select class="col-md-7 show-tick" name="initial_labels_for_user" id="initial_labels_for_user" data-plugin="selectpicker" data-style="btn-outline btn-primary" multiple>
  350. @foreach($label_list as $label)
  351. <option value="{{$label->id}}" @if(in_array($label->id, explode(',', $initial_labels_for_user))) selected @endif>{{$label->name}}</option>
  352. @endforeach
  353. </select>
  354. <span class="text-help offset-md-3"> 注册用户时的初始标签,标签用于关联节点 </span>
  355. </div>
  356. </div>
  357. <div class="form-group col-lg-6">
  358. <div class="row">
  359. <label class="col-md-3 col-form-label" for="user_invite_days">用户-邀请码有效期</label>
  360. <div class="col-md-7">
  361. <div class="input-group">
  362. <input type="number" class="form-control" name="user_invite_days" id="user_invite_days" value="{{$user_invite_days}}"/>
  363. <div class="input-group-append">
  364. </div>
  365. <span class="input-group-text">天</span>
  366. <button class="btn btn-primary" type="button" onclick="setUserInviteDays()">修改</button>
  367. </div>
  368. </div>
  369. <span class="text-help offset-md-3"> 用户自行生成邀请的有效期 </span>
  370. </div>
  371. </div>
  372. </div>
  373. </form>
  374. </div>
  375. <div class="tab-pane" id="node" role="tabpanel">
  376. <form action="#" method="post" role="form" class="form-horizontal">
  377. <div class="form-row">
  378. <div class="form-group col-lg-6">
  379. <div class="row">
  380. <label class="col-md-3 col-form-label" for="subscribe_domain">节点订阅地址</label>
  381. <div class="col-md-7">
  382. <div class="input-group">
  383. <input type="url" class="form-control" name="subscribe_domain" id="subscribe_domain" value="{{$subscribe_domain}}"/>
  384. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setSubscribeDomain()">修改</button></span>
  385. </div>
  386. </div>
  387. <span class="text-help offset-md-3"> (推荐)防止面板域名被DNS投毒后无法正常订阅,需带http://或https:// </span>
  388. </div>
  389. </div>
  390. <div class="form-group col-lg-6">
  391. <div class="row">
  392. <label class="col-md-3 col-form-label" for="subscribe_max">订阅节点数</label>
  393. <div class="col-md-7">
  394. <div class="input-group">
  395. <input type="number" class="form-control" name="subscribe_max" id="subscribe_max" value="{{$subscribe_max}}"/>
  396. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setSubscribeMax()">修改</button></span>
  397. </div>
  398. </div>
  399. <span class="text-help offset-md-3"> 客户端订阅时取得几个节点,为0时返回全部节点 </span>
  400. </div>
  401. </div>
  402. <div class="form-group col-lg-6">
  403. <div class="row">
  404. <label class="col-md-3 col-form-label" for="mix_subscribe">混合订阅</label>
  405. <span class="col-md-9"><input type="checkbox" id="mix_subscribe" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($mix_subscribe) checked @endif></span>
  406. <span class="text-help offset-md-3"> 启用后,订阅信息中将包含V2Ray节点信息(仅支持Shadowrocket、Quantumult、v2rayN) </span>
  407. </div>
  408. </div>
  409. <div class="form-group col-lg-6">
  410. <div class="row">
  411. <label class="col-md-3 col-form-label" for="rand_subscribe">随机订阅</label>
  412. <span class="col-md-9"><input type="checkbox" id="rand_subscribe" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($rand_subscribe) checked @endif></span>
  413. <span class="text-help offset-md-3"> 启用后,订阅时将随机返回节点信息,否则按节点排序返回 </span>
  414. </div>
  415. </div>
  416. <div class="form-group col-lg-6">
  417. <div class="row">
  418. <label class="col-md-3 col-form-label" for="is_custom_subscribe">高级订阅</label>
  419. <span class="col-md-9"><input type="checkbox" id="is_custom_subscribe" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_custom_subscribe) checked @endif></span>
  420. <span class="text-help offset-md-3"> 启用后,订阅信息顶部将显示过期时间、剩余流量(Quantumult有特殊效果) </span>
  421. </div>
  422. </div>
  423. </div>
  424. </form>
  425. </div>
  426. <div class="tab-pane" id="extend" role="tabpanel">
  427. <form action="#" method="post" role="form" class="form-horizontal">
  428. <div class="form-row">
  429. <div class="form-group col-lg-6">
  430. <div class="row">
  431. <label class="col-md-3 col-form-label" for="is_namesilo">Namesilo</label>
  432. <span class="col-md-9"><input type="checkbox" id="is_namesilo" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_namesilo) checked @endif></span>
  433. <span class="text-help offset-md-3"> 添加、编辑节点的绑定域名时自动更新域名DNS记录值为节点IP(<a href="https://www.namesilo.com/account_api.php?rid=326ec20pa" target="_blank">创建API KEY</a>) </span>
  434. </div>
  435. </div>
  436. <div class="form-group col-lg-6">
  437. <div class="row">
  438. <label class="col-md-3 col-form-label" for="namesilo_key">Namesilo API KEY</label>
  439. <div class="col-md-7">
  440. <div class="input-group">
  441. <input type="text" class="form-control" name="namesilo_key" id="namesilo_key" value="{{$namesilo_key}}" placeholder="填入Namesilo上申请的API KEY"/>
  442. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setNamesiloKey()">修改</button></span>
  443. </div>
  444. </div>
  445. <span class="text-help offset-md-3"> 域名必须是<a href="https://www.namesilo.com/?rid=326ec20pa" target="_blank">www.namesilo.com</a>上购买的 </span>
  446. </div>
  447. </div>
  448. <div class="form-group col-lg-6">
  449. <div class="row">
  450. <label class="col-md-3 col-form-label" for="admin_invite_days">管理员-邀请码有效期</label>
  451. <div class="col-md-7">
  452. <div class="input-group">
  453. <input type="number" class="form-control" name="admin_invite_days" id="admin_invite_days" value="{{$admin_invite_days}}"/>
  454. <div class="input-group-append">
  455. </div>
  456. <span class="input-group-text">天</span>
  457. <button class="btn btn-primary" type="button" onclick="setAdminInviteDays()">修改</button>
  458. </div>
  459. </div>
  460. <span class="text-help offset-md-3"> 管理员生成邀请码的有效期 </span>
  461. </div>
  462. </div>
  463. @if($is_captcha == 2)
  464. <div class="form-group col-lg-6">
  465. <div class="row">
  466. <label class="col-md-3 col-form-label" for="geetest_id">极验ID</label>
  467. <div class="col-md-7">
  468. <div class="input-group">
  469. <input type="text" class="form-control" name="geetest_id" id="geetest_id" value="{{$geetest_id}}"/>
  470. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setGeetestId()">修改</button></span>
  471. </div>
  472. </div>
  473. <span class="text-help offset-md-3"> 本功能需要 <a href="https://auth.geetest.com/login/" target="_blank">极验后台</a> 申请权限及应用 </span>
  474. </div>
  475. </div>
  476. <div class="form-group col-lg-6">
  477. <div class="row">
  478. <label class="col-md-3 col-form-label" for="geetest_key">极验KEY</label>
  479. <div class="col-md-7">
  480. <div class="input-group">
  481. <input type="text" class="form-control" name="geetest_key" id="geetest_key" value="{{$geetest_key}}"/>
  482. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setGeetestKey()">修改</button></span>
  483. </div>
  484. </div>
  485. </div>
  486. </div>
  487. @elseif($is_captcha == 3)
  488. <div class="form-group col-lg-6">
  489. <div class="row">
  490. <label class="col-md-3 col-form-label" for="google_captcha_sitekey">网站密钥</label>
  491. <div class="col-md-7">
  492. <div class="input-group">
  493. <input type="text" class="form-control" name="google_captcha_sitekey" id="google_captcha_sitekey" value="{{$google_captcha_sitekey}}"/>
  494. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setGoogleCaptchaId()">修改</button></span>
  495. </div>
  496. </div>
  497. <span class="text-help offset-md-3"> 本功能需要 <a href="https://www.google.com/recaptcha/admin" target="_blank">Google reCAPTCHA后台</a> 申请权限及应用 (申请需科学上网,日常验证不用)</span>
  498. </div>
  499. </div>
  500. <div class="form-group col-lg-6">
  501. <div class="row">
  502. <label class="col-md-3 control-label" for="google_captcha_secret">密钥</label>
  503. <div class="col-md-7">
  504. <div class="input-group">
  505. <input type="text" class="form-control" name="google_captcha_secret" id="google_captcha_secret" value="{{$google_captcha_secret}}"/>
  506. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setGoogleCaptchaKey()">修改</button></span>
  507. </div>
  508. </div>
  509. </div>
  510. </div>
  511. @endif
  512. </div>
  513. </form>
  514. </div>
  515. <div class="tab-pane" id="checkIn" role="tabpanel">
  516. <form action="#" method="post" role="form" class="form-horizontal">
  517. <div class="form-row">
  518. <div class="form-group col-lg-6">
  519. <div class="row">
  520. <label class="col-md-3 col-form-label" for="is_checkin">签到加流量</label>
  521. <span class="col-md-9"><input type="checkbox" id="is_checkin" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_checkin) checked @endif></span>
  522. <span class="text-help offset-md-3"> 登录时将根据流量范围随机得到流量 </span>
  523. </div>
  524. </div>
  525. <div class="form-group col-lg-6">
  526. <div class="row">
  527. <label class="col-md-3 col-form-label" for="traffic_limit_time">时间间隔</label>
  528. <div class="col-md-7">
  529. <div class="input-group">
  530. <input type="number" class="form-control" name="traffic_limit_time" id="traffic_limit_time" value="{{$traffic_limit_time}}"/>
  531. <div class="input-group-append">
  532. </div>
  533. <span class="input-group-text">分钟</span>
  534. <button class="btn btn-primary" type="button" onclick="setTrafficLimitTime()">修改</button>
  535. </div>
  536. </div>
  537. <span class="text-help offset-md-3"> 间隔多久才可以再次签到</span>
  538. </div>
  539. </div>
  540. <div class="form-group col-lg-6">
  541. <div class="row">
  542. <label class="col-md-3 col-form-label">流量范围</label>
  543. <div class="col-md-7">
  544. <div class="input-group">
  545. <label for="min_rand_traffic"></label>
  546. <input type="number" class="form-control" name="min_rand_traffic" id="min_rand_traffic" value="{{$min_rand_traffic}}"/>
  547. <div class="input-group-prepend">
  548. <span class="input-group-text"> ~ </span>
  549. </div>
  550. <label for="max_rand_traffic"></label>
  551. <input type="number" class="form-control" name="max_rand_traffic" id="max_rand_traffic" value="{{$max_rand_traffic}}"/>
  552. <div class="input-group-prepend">
  553. <span class="input-group-text"> MB </span>
  554. </div>
  555. </div>
  556. </div>
  557. </div>
  558. </div>
  559. </div>
  560. </form>
  561. </div>
  562. <div class="tab-pane" id="promo" role="tabpanel">
  563. <form action="#" method="post" role="form" class="form-horizontal">
  564. <div class="form-row">
  565. <div class="form-group col-lg-6">
  566. <div class="row">
  567. <label class="col-md-3 col-form-label" for="referral_status">推广功能</label>
  568. <div class="col-md-7">
  569. <div class="input-group">
  570. <input type="checkbox" id="referral_status" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($referral_status) checked @endif>
  571. </div>
  572. </div>
  573. <span class="text-help offset-md-3"> 关闭后用户不可见,但是不影响其正常邀请返利 </span>
  574. </div>
  575. </div>
  576. <div class="form-group col-lg-6">
  577. <div class="row">
  578. <label class="col-md-3 col-form-label" for="referral_traffic">注册送流量</label>
  579. <div class="col-md-7">
  580. <div class="input-group">
  581. <input type="number" class="form-control" name="referral_gift_traffic" id="referral_traffic" value="{{$referral_traffic}}"/>
  582. <div class="input-group-append">
  583. <span class="input-group-text">MB</span>
  584. <button class="btn btn-primary" type="button" onclick="setReferralTraffic()">修改</button>
  585. </div>
  586. </div>
  587. </div>
  588. <span class="text-help offset-md-3"> 根据推广链接、邀请码注册则赠送相应的流量 </span>
  589. </div>
  590. </div>
  591. <div class="form-group col-lg-6">
  592. <div class="row">
  593. <label class="col-md-3 col-form-label" for="referral_percent">返利比例</label>
  594. <div class="col-md-7">
  595. <div class="input-group">
  596. <input type="number" class="form-control" name="referral_percent" id="referral_percent" value="{{$referral_percent * 100}}"/>
  597. <div class="input-group-append">
  598. <span class="input-group-text">%</span>
  599. <button class="btn btn-primary" type="button" onclick="setReferralPercent()">修改</button>
  600. </div>
  601. </div>
  602. </div>
  603. <span class="text-help offset-md-3"> 根据推广链接注册的账号每笔消费推广人可以分成的比例 </span>
  604. </div>
  605. </div>
  606. <div class="form-group col-lg-6">
  607. <div class="row">
  608. <label class="col-md-3 col-form-label" for="referral_money">提现限制</label>
  609. <div class="col-md-7">
  610. <div class="input-group">
  611. <input type="number" class="form-control" name="referral_money" id="referral_money" value="{{$referral_money}}"/>
  612. <div class="input-group-append">
  613. <span class="input-group-text">元</span>
  614. <button class="btn btn-primary" type="button" onclick="setReferralMoney()">修改</button>
  615. </div>
  616. </div>
  617. </div>
  618. <span class="text-help offset-md-3"> 满多少元才可以申请提现 </span>
  619. </div>
  620. </div>
  621. </div>
  622. </form>
  623. </div>
  624. <div class="tab-pane" id="notify" role="tabpanel">
  625. <form action="#" method="post" role="form" class="form-horizontal">
  626. <div class="row">
  627. <div class="form-group col-lg-6">
  628. <div class="row">
  629. <label class="col-md-3 col-form-label" for="expire_warning">用户过期警告</label>
  630. <span class="col-md-9"><input type="checkbox" id="expire_warning" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($expire_warning) checked @endif></span>
  631. <span class="text-help offset-md-3"> 启用后账号距到期还剩阈值设置的值时自动发邮件提醒用户 </span>
  632. </div>
  633. </div>
  634. <div class="form-group col-lg-6">
  635. <div class="row">
  636. <label class="col-md-3 col-form-label" for="expire_days">过期警告阈值</label>
  637. <div class="col-md-7">
  638. <div class="input-group">
  639. <input type="number" class="form-control" name="expire_days" id="expire_days" value="{{$expire_days}}"/>
  640. <div class="input-group-append">
  641. <span class="input-group-text">天</span>
  642. <button class="btn btn-primary" type="button" onclick="setExpireDays()">修改</button>
  643. </div>
  644. </div>
  645. </div>
  646. <span class="text-help offset-md-3"> 账号距离过期还差多少天时发警告邮件 </span>
  647. </div>
  648. </div>
  649. <div class="form-group col-lg-6">
  650. <div class="row">
  651. <label class="col-md-3 col-form-label" for="traffic_warning">用户流量警告</label>
  652. <span class="col-md-9"><input type="checkbox" id="traffic_warning" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($traffic_warning) checked @endif></span>
  653. <span class="text-help offset-md-3"> 启用后账号已使用流量超过警告阈值时自动发邮件提醒用户 </span>
  654. </div>
  655. </div>
  656. <div class="form-group col-lg-6">
  657. <div class="row">
  658. <label for="traffic_warning_percent" class="col-md-3 col-form-label">流量警告阈值</label>
  659. <div class="col-md-7">
  660. <div class="input-group">
  661. <input type="number" class="form-control" name="traffic_warning_percent" id="traffic_warning_percent" value="{{$traffic_warning_percent}}"/>
  662. <div class="input-group-append">
  663. <span class="input-group-text">%</span>
  664. <button class="btn btn-primary" type="button" onclick="setTrafficWarningPercent()">修改</button>
  665. </div>
  666. </div>
  667. </div>
  668. <span class="text-help offset-md-3"> 建议设置在70%~90% </span>
  669. </div>
  670. </div>
  671. <div class="form-group col-lg-6">
  672. <div class="row">
  673. <label class="col-md-3 col-form-label" for="is_node_crash_warning">节点离线提醒</label>
  674. <span class="col-md-9"><input type="checkbox" id="is_node_crash_warning" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_node_crash_warning) checked @endif></span>
  675. <span class="text-help offset-md-3"> 启用后如果节点离线则通过ServerChan推送提醒 </span>
  676. </div>
  677. </div>
  678. <div class="form-group col-lg-6">
  679. <div class="row">
  680. <label class="col-md-3 col-form-label" for="webmaster_email">管理员收信地址</label>
  681. <div class="col-md-7">
  682. <div class="input-group">
  683. <input type="email" class="form-control" name="webmaster_email" id="webmaster_email" value="{{$webmaster_email}}" placeholder="master@ssrpanel.com"/>
  684. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setCrashWarningEmail()">修改</button></span>
  685. </div>
  686. </div>
  687. <span class="text-help offset-md-3"> 填写此值则节点离线、用户回复工单都会自动提醒 </span>
  688. </div>
  689. </div>
  690. <div class="form-group col-lg-6">
  691. <div class="row">
  692. <label class="col-md-3 col-form-label" for="nodes_detection">节点阻断检测</label>
  693. <span class="col-md-9"><input type="checkbox" id="nodes_detection" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($nodes_detection) checked @endif></span>
  694. <span class="text-help offset-md-3"> 每小时检测节点是否被阻断并提醒 </span>
  695. </div>
  696. </div>
  697. <div class="form-group col-lg-6">
  698. <div class="row">
  699. <label class="col-md-3 col-form-label" for="numberOfWarningTimes">阻断检测提醒</label>
  700. <div class="col-md-7">
  701. <div class="input-group">
  702. <input type="number" class="form-control" name="numberOfWarningTimes" id="numberOfWarningTimes" value="{{$numberOfWarningTimes}}"/>
  703. <div class="input-group-append">
  704. <span class="input-group-text">次</span>
  705. <button class="btn btn-primary" type="button" onclick="setNumberOfWarningTimes()">修改</button>
  706. </div>
  707. </div>
  708. </div>
  709. <span class="text-help offset-md-3"> 提醒N次后自动下线节点,为0时不限制,不超过12 </span>
  710. </div>
  711. </div>
  712. <div class="form-group col-lg-6">
  713. <div class="row">
  714. <label class="col-md-3 col-form-label" for="is_server_chan">ServerChan</label>
  715. <span class="col-md-9"><input type="checkbox" id="is_server_chan" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_server_chan) checked @endif></span>
  716. <span class="text-help offset-md-3"> 推送节点离线提醒、用户流量异常警告、节点使用报告(<a href="http://sc.ftqq.com" target="_blank">绑定微信</a>) </span>
  717. </div>
  718. </div>
  719. <div class="form-group col-lg-6">
  720. <div class="row">
  721. <label class="col-md-3 col-form-label" for="server_chan_key">SCKEY</label>
  722. <div class="col-md-7">
  723. <div class="input-group">
  724. <input type="text" class="form-control" name="server_chan_key" id="server_chan_key" value="{{$server_chan_key}}" placeholder="请到ServerChan申请"/>
  725. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setServerChanKey()">修改</button></span>
  726. </div>
  727. </div>
  728. <span class="text-help offset-md-3"> 启用ServerChan,请务必填入本值(<a href="http://sc.ftqq.com" target="_blank">申请SCKEY</a>) </span>
  729. </div>
  730. </div>
  731. <div class="form-group col-lg-6">
  732. <div class="row">
  733. <label class="col-md-3 col-form-label" for="is_push_bear">PushBear</label>
  734. <span class="col-md-9"><input type="checkbox" id="is_push_bear" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_push_bear) checked @endif></span>
  735. <span class="text-help offset-md-3"> 使用PushBear推送微信消息给用户(<a href="https://pushbear.ftqq.com/admin/#/signin" target="_blank">创建消息通道</a>) </span>
  736. </div>
  737. </div>
  738. <div class="form-group col-lg-6">
  739. <div class="row">
  740. <label class="col-md-3 col-form-label" for="push_bear_send_key">PushBear SendKey</label>
  741. <div class="col-md-7">
  742. <div class="input-group">
  743. <input type="text" class="form-control" name="push_bear_send_key" id="push_bear_send_key" value="{{$push_bear_send_key}}" placeholder="创建消息通道后即可获取"/>
  744. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setPushBearSendKey()">修改</button></span>
  745. </div>
  746. </div>
  747. <span class="text-help offset-md-3"> 启用PushBear,请务必填入本值 </span>
  748. </div>
  749. </div>
  750. <div class="form-group col-lg-6">
  751. <div class="row">
  752. <label class="col-md-3 col-form-label" for="push_bear_qrcode">PushBear订阅二维码</label>
  753. <div class="col-md-7">
  754. <div class="input-group">
  755. <input type="url" class="form-control" name="push_bear_qrcode" id="push_bear_qrcode" value="{{$push_bear_qrcode}}" placeholder="填入消息通道的二维码URL"/>
  756. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setPushBearQrCode()">修改</button></span>
  757. </div>
  758. </div>
  759. <span class="text-help offset-md-3"> 创建消息通道后,在二维码上点击右键“复制图片地址”并粘贴至此处 </span>
  760. </div>
  761. </div>
  762. </div>
  763. </form>
  764. </div>
  765. <div class="tab-pane" id="auto" role="tabpanel">
  766. <form action="#" method="post" role="form" class="form-horizontal">
  767. <div class="row">
  768. <div class="form-group col-lg-6">
  769. <div class="row">
  770. <label class="col-md-3 col-form-label" for="is_clear_log">自动清除日志</label>
  771. <span class="col-md-9"><input type="checkbox" id="is_clear_log" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_clear_log) checked @endif></span>
  772. <span class="text-help offset-md-3"> (推荐)启用后自动清除无用日志 </span>
  773. </div>
  774. </div>
  775. <div class="form-group col-lg-6">
  776. <div class="row">
  777. <label class="col-md-3 col-form-label" for="reset_traffic">流量自动重置</label>
  778. <span class="col-md-9"><input type="checkbox" id="reset_traffic" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($reset_traffic) checked @endif></span>
  779. <span class="text-help offset-md-3"> 用户会按其购买套餐的日期自动重置可用流量 </span>
  780. </div>
  781. </div>
  782. <div class="form-group col-lg-6">
  783. <div class="row">
  784. <label class="col-md-3 col-form-label" for="is_subscribe_ban">订阅异常自动封禁</label>
  785. <span class="col-md-9"><input type="checkbox" id="is_subscribe_ban" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_subscribe_ban) checked @endif></span>
  786. <span class="text-help offset-md-3"> 启用后用户订阅链接请求超过设定阈值则自动封禁 </span>
  787. </div>
  788. </div>
  789. <div class="form-group col-lg-6">
  790. <div class="row">
  791. <label class="col-md-3 col-form-label" for="subscribe_ban_times">订阅请求阈值</label>
  792. <div class="col-md-7">
  793. <div class="input-group">
  794. <input type="number" class="form-control" name="subscribe_ban_times" id="subscribe_ban_times" value="{{$subscribe_ban_times}}"/>
  795. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setSubscribeBanTimes()">修改</button></span>
  796. </div>
  797. </div>
  798. <span class="text-help offset-md-3"> 24小时内订阅链接请求次数限制 </span>
  799. </div>
  800. </div>
  801. <div class="form-group col-lg-6">
  802. <div class="row">
  803. <label class="col-md-3 col-form-label" for="is_traffic_ban">异常自动封号</label>
  804. <span class="col-md-9"><input type="checkbox" id="is_traffic_ban" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_traffic_ban) checked @endif/></span>
  805. <span class="text-help offset-md-3"> 1小时内流量超过异常阈值则自动封号(仅禁用代理) </span>
  806. </div>
  807. </div>
  808. <div class="form-group col-lg-6">
  809. <div class="row">
  810. <label class="col-md-3 col-form-label" for="traffic_ban_value">流量异常阈值</label>
  811. <div class="col-md-7">
  812. <div class="input-group">
  813. <input type="number" class="form-control" name="traffic_ban_value" id="traffic_ban_value" value="{{$traffic_ban_value}}"/>
  814. <div class="input-group-append">
  815. <span class="input-group-text">GB</span>
  816. <button class="btn btn-primary" type="button" onclick="setTrafficBanValue()">修改</button>
  817. </div>
  818. </div>
  819. </div>
  820. <span class="text-help offset-md-3"> 1小时内超过该值,则触发自动封号 </span>
  821. </div>
  822. </div>
  823. <div class="form-group col-lg-6">
  824. <div class="row">
  825. <label class="col-md-3 col-form-label" for="traffic_ban_time">封号时长</label>
  826. <div class="col-md-7">
  827. <div class="input-group">
  828. <input type="number" class="form-control" name="traffic_ban_time" id="traffic_ban_time" value="{{$traffic_ban_time}}"/>
  829. <div class="input-group-append">
  830. <span class="input-group-text">分钟</span>
  831. <button class="btn btn-primary" type="button" onclick="setTrafficBanTime()">修改</button>
  832. </div>
  833. </div>
  834. </div>
  835. <span class="text-help offset-md-3"> 触发流量异常导致用户被封禁的时长,到期后自动解封 </span>
  836. </div>
  837. </div>
  838. <div class="form-group col-lg-6">
  839. <div class="row">
  840. <label class="col-md-3 col-form-label" for="auto_release_port">端口自动释放</label>
  841. <span class="col-md-9"><input type="checkbox" data-on-color="primary" id="auto_release_port" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($auto_release_port) checked @endif></span>
  842. <span class="text-help offset-md-3"> 被封禁和过期一个月的用户端口自动释放 </span>
  843. </div>
  844. </div>
  845. <div class="form-group col-lg-6">
  846. <div class="row">
  847. <label class="col-md-3 col-form-label" for="is_ban_status">过期自动封禁</label>
  848. <span class="col-md-9"><input type="checkbox" id="is_ban_status" data-on-color="primary" data-off-color="danger" data-on-text="封禁整个账号" data-off-text="仅封禁代理" data-base-class="bootstrap-switch" @if($is_ban_status) checked @endif></span>
  849. <span class="text-help offset-md-3"> (慎重)封禁整个账号会重置账号的所有数据且会导致用户无法登录 </span>
  850. </div>
  851. </div>
  852. <div class="form-group col-lg-6">
  853. <div class="row">
  854. <label class="col-md-3 col-form-label" for="node_daily_report">节点使用报告</label>
  855. <span class="col-md-9"><input type="checkbox" id="node_daily_report" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($node_daily_report) checked @endif></span>
  856. <span class="text-help offset-md-3"> 每天早上9点推送昨天节点的使用情况 </span>
  857. </div>
  858. </div>
  859. </div>
  860. </form>
  861. </div>
  862. <div class="tab-pane" id="other" role="tabpanel">
  863. <form action="/admin/setExtend" method="post" enctype="multipart/form-data" class="upload-form" role="form" id="setExtend">
  864. {{csrf_field()}}
  865. <div class="form-row">
  866. <div class="form-group col-lg-6">
  867. <div class="row">
  868. <label class="col-form-label col-md-3" for="website_home_logo">首页LOGO</label>
  869. <div class="col-md-9">
  870. <input type="file" name="website_home_logo" id="website_home_logo" data-plugin="dropify" data-default-file={{$website_home_logo?:'/assets/images/noimage.png'}} />
  871. <button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
  872. </div>
  873. </div>
  874. </div>
  875. <div class="form-group col-lg-6">
  876. <div class="row">
  877. <label class="col-form-label col-md-3" for="website_logo">站内LOGO</label>
  878. <div class="col-md-9">
  879. <input type="file" name="website_logo" id="website_logo" data-plugin="dropify" data-default-file={{$website_logo?:'/assets/images/noimage.png'}} />
  880. <button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
  881. </div>
  882. </div>
  883. </div>
  884. <div class="form-group col-lg-6">
  885. <div class="row">
  886. <label class="col-form-label col-md-3" for="website_analytics">统计代码</label>
  887. <div class="col-md-9">
  888. <textarea class="form-control" rows="10" name="website_analytics" id="website_analytics">{{$website_analytics}}</textarea>
  889. <button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
  890. </div>
  891. </div>
  892. </div>
  893. <div class="form-group col-lg-6">
  894. <div class="row">
  895. <label class="col-form-label col-md-3" for="website_customer_service">客服代码</label>
  896. <div class="col-md-9">
  897. <textarea class="form-control" rows="10" name="website_customer_service" id="website_customer_service">{{$website_customer_service}}</textarea>
  898. <button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
  899. </div>
  900. </div>
  901. </div>
  902. </div>
  903. </form>
  904. </div>
  905. <div class="tab-pane" id="payment" role="tabpanel">
  906. <form action="#" method="post" role="form" class="form-horizontal">
  907. <div class="row pb-70">
  908. <div class="form-group col-lg-6">
  909. <div class="row">
  910. <label for="is_alipay" class="col-md-3 col-form-label">AliPay国际</label>
  911. <span class="col-md-9"><input type="checkbox" id="is_alipay" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_alipay) checked @endif></span>
  912. <span class="text-help offset-md-3"> 请先到 <a href="https://global.alipay.com/" target="_blank">AliPay国际</a> 申请partner和key </span>
  913. </div>
  914. </div>
  915. <div class="form-group col-lg-6">
  916. <div class="row">
  917. <label class="col-md-3 col-form-label" for="alipay_currency">结算币种</label>
  918. <select class="col-md-5" name="alipay_currency" id="alipay_currency" data-plugin="selectpicker" data-style="btn-outline btn-primary">
  919. <option value="USD" @if($alipay_currency == 'USD') selected @endif>美元</option>
  920. <option value="HKD" @if($alipay_currency == 'HKD') selected @endif>港币</option>
  921. <option value="JPY" @if($alipay_currency == 'JPY') selected @endif>日元</option>
  922. <option value="EUR" @if($alipay_currency == 'EUR') selected @endif>欧元</option>
  923. </select>
  924. </div>
  925. </div>
  926. <div class="form-group col-lg-6">
  927. <div class="row">
  928. <label class="col-md-3 col-form-label" for="alipay_sign_type">加密方式</label>
  929. <select class="col-md-5" name="alipay_sign_type" id="alipay_sign_type" data-plugin="selectpicker" data-style="btn-outline btn-primary">
  930. <option value="MD5" @if($alipay_sign_type == 'MD5') selected @endif>MD5</option>
  931. <option value="RSA" @if($alipay_sign_type == 'RSA') selected @endif>RSA</option>
  932. </select>
  933. </div>
  934. </div>
  935. <div class="form-group col-lg-6">
  936. <div class="row">
  937. <label class="col-md-3 col-form-label" for="alipay_transport">启用SSL验证</label>
  938. <select class="col-md-5" name="alipay_transport" id="alipay_transport" data-plugin="selectpicker" data-style="btn-outline btn-primary">
  939. <option value="http" @if($alipay_transport == 'http') selected @endif>否</option>
  940. <option value="https" @if($alipay_transport == 'https') selected @endif>是</option>
  941. </select>
  942. <span class="text-help offset-md-3"> HTTPS站点需启用 </span>
  943. </div>
  944. </div>
  945. <div class="form-group col-lg-6">
  946. <div class="row">
  947. <label class="col-md-3 col-form-label" for="alipay_partner">Partner</label>
  948. <div class="col-md-7">
  949. <div class="input-group">
  950. <input type="text" class="form-control" name="alipay_partner" id="alipay_partner" value="{{$alipay_partner}}"/>
  951. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAlipayPartner()">修改</button></span>
  952. </div>
  953. </div>
  954. </div>
  955. </div>
  956. <div class="form-group col-lg-6">
  957. <div class="row">
  958. <label for="alipay_key" class="col-md-3 col-form-label">Key</label>
  959. <div class="col-md-7">
  960. <div class="input-group">
  961. <input type="password" class="form-control" name="alipay_key" id="alipay_key" value="{{$alipay_key}}"/>
  962. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAlipayKey()">修改</button></span>
  963. </div>
  964. </div>
  965. </div>
  966. </div>
  967. <div class="form-group col-lg-6">
  968. <div class="row">
  969. <label class="col-md-3 col-form-label" for="alipay_private_key">RSA私钥</label>
  970. <div class="col-md-7">
  971. <div class="input-group">
  972. <input type="password" class="form-control" name="alipay_private_key" id="alipay_private_key" value="{{$alipay_private_key}}"/>
  973. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAlipayPrivateKey()">修改</button></span>
  974. </div>
  975. </div>
  976. </div>
  977. </div>
  978. <div class="form-group col-lg-6">
  979. <div class="row">
  980. <label class="col-md-3 col-form-label" for="alipay_public_key">RSA公钥</label>
  981. <div class="col-md-7">
  982. <div class="input-group">
  983. <input type="password" class="form-control" name="alipay_public_key" id="alipay_public_key" value="{{$alipay_public_key}}"/>
  984. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setAlipayPublicKey()">修改</button></span>
  985. </div>
  986. </div>
  987. </div>
  988. </div>
  989. </div>
  990. <div class="row pb-70">
  991. <div class="form-group col-lg-6">
  992. <div class="row">
  993. <label class="col-md-3 col-form-label" for="is_f2fpay">支付宝F2F</label>
  994. <span class="col-md-9"><input type="checkbox" id="is_f2fpay" data-on-color="primary" data-off-color="danger" data-on-text="启用" data-off-text="关闭" data-base-class="bootstrap-switch" @if($is_f2fpay) checked @endif></span>
  995. <span class="text-help offset-md-3"> 本功能需要 <a href="https://open.alipay.com/platform/home.htm" target="_blank">蚂蚁金服开放平台</a> 申请权限及应用 </span>
  996. </div>
  997. </div>
  998. <div class="form-group col-lg-6">
  999. <div class="row">
  1000. <label class="col-md-3 col-form-label" for="f2fpay_app_id">应用ID</label>
  1001. <div class="col-md-7">
  1002. <div class="input-group">
  1003. <input type="text" class="form-control" name="f2fpay_app_id" id="f2fpay_app_id" value="{{$f2fpay_app_id}}"/>
  1004. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setF2fpayAppId()">修改</button></span>
  1005. </div>
  1006. </div>
  1007. <span class="text-help offset-md-3">即:APPID</span>
  1008. </div>
  1009. </div>
  1010. <div class="form-group col-lg-6">
  1011. <div class="row">
  1012. <label class="col-md-3 col-form-label" for="f2fpay_private_key">RSA私钥</label>
  1013. <div class="col-md-7">
  1014. <div class="input-group">
  1015. <input class="form-control" type="text" name="f2fpay_private_key" id="f2fpay_private_key" value="{{$f2fpay_private_key}}"/>
  1016. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setF2fpayPrivateKey()">修改</button></span>
  1017. </div>
  1018. </div>
  1019. <span class="text-help offset-md-3">即:rsa_private_key,不包括首尾格式</span>
  1020. </div>
  1021. </div>
  1022. <div class="form-group col-lg-6">
  1023. <div class="row">
  1024. <label class="col-md-3 col-form-label" for="f2fpay_public_key">支付宝公钥</label>
  1025. <div class="col-md-7">
  1026. <div class="input-group">
  1027. <input type="text" class="form-control" name="f2fpay_public_key" id="f2fpay_public_key" value="{{$f2fpay_public_key}}"/>
  1028. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setF2fpayPublicKey()">修改</button></span>
  1029. </div>
  1030. </div>
  1031. <span class="text-help offset-md-3"> 注意不是RSA公钥 </span>
  1032. </div>
  1033. </div>
  1034. </div>
  1035. <div class="form-group col-lg-6">
  1036. <div class="row">
  1037. <label class="col-md-3 col-form-label" for="f2fpay_subject_name">自定义商品名称</label>
  1038. <div class="col-md-7">
  1039. <div class="input-group">
  1040. <input type="text" class="form-control" name="f2fpay_subject_name" id="f2fpay_subject_name" value="{{$f2fpay_subject_name}}"/>
  1041. <span class="input-group-append"><button class="btn btn-primary" type="button" onclick="setF2fpaySubjectName()">修改</button></span>
  1042. </div>
  1043. </div>
  1044. <span class="text-help offset-md-3"> 用于在用户支付宝客户端显示 </span>
  1045. </div>
  1046. </div>
  1047. </form>
  1048. </div>
  1049. </div>
  1050. </div>
  1051. </div>
  1052. </div>
  1053. </div>
  1054. @endsection
  1055. @section('script')
  1056. <script src="/assets/global/vendor/matchheight/jquery.matchHeight-min.js" type="text/javascript"></script>
  1057. <script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js" type="text/javascript"></script>
  1058. <script src="//cdn.bootcss.com/bootstrap-switch/4.0.0-alpha.1/js/bootstrap-switch.min.js" type="text/javascript"></script>
  1059. <script src="/assets/global/vendor/dropify/dropify.min.js" type="text/javascript"></script>
  1060. <script src="/assets/global/js/Plugin/bootstrap-select.js" type="text/javascript"></script>
  1061. <script src="/assets/global/js/Plugin/responsive-tabs.js" type="text/javascript"></script>
  1062. <script src="/assets/global/js/Plugin/tabs.js" type="text/javascript"></script>
  1063. <script src="/assets/global/js/Plugin/dropify.js" type="text/javascript"></script>
  1064. <script type="text/javascript">
  1065. $('input[type="checkbox"]').bootstrapSwitch();
  1066. // 注册的默认标签
  1067. $('#initial_labels_for_user').on("changed.bs.select", function () {
  1068. $.post("/admin/setConfig", {
  1069. _token: '{{csrf_token()}}',
  1070. name: 'initial_labels_for_user',
  1071. value: $(this).val() ? $(this).val().join(',') : ''
  1072. }, function (ret) {
  1073. if (ret.status === 'success') {
  1074. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1075. .then(() => window.location.reload())
  1076. } else {
  1077. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1078. }
  1079. });
  1080. });
  1081. // 启用、禁用随机端口
  1082. $('#is_rand_port').on({
  1083. 'switchChange.bootstrapSwitch': function (event, state) {
  1084. $.post("/admin/setConfig", {
  1085. _token: '{{csrf_token()}}',
  1086. name: 'is_rand_port',
  1087. value: state ? 1 : 0
  1088. }, function (ret) {
  1089. if (ret.status === 'success') {
  1090. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1091. .then(() => window.location.reload())
  1092. } else {
  1093. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1094. }
  1095. });
  1096. }
  1097. });
  1098. // 启用、禁用屏蔽大陆访问
  1099. $('#is_forbid_china').on({
  1100. 'switchChange.bootstrapSwitch': function (event, state) {
  1101. $.post("/admin/setConfig", {
  1102. _token: '{{csrf_token()}}',
  1103. name: 'is_forbid_china',
  1104. value: state ? 1 : 0
  1105. }, function (ret) {
  1106. if (ret.status === 'success') {
  1107. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1108. .then(() => window.location.reload())
  1109. } else {
  1110. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1111. }
  1112. });
  1113. }
  1114. });
  1115. // 启用、禁用屏蔽海外访问
  1116. $('#is_forbid_oversea').on({
  1117. 'switchChange.bootstrapSwitch': function (event, state) {
  1118. $.post("/admin/setConfig", {
  1119. _token: '{{csrf_token()}}',
  1120. name: 'is_forbid_oversea',
  1121. value: state ? 1 : 0
  1122. }, function (ret) {
  1123. if (ret.status === 'success') {
  1124. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1125. .then(() => window.location.reload())
  1126. } else {
  1127. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1128. }
  1129. });
  1130. }
  1131. });
  1132. // 启用、禁用机器人访问
  1133. $('#is_forbid_robot').on({
  1134. 'switchChange.bootstrapSwitch': function (event, state) {
  1135. $.post("/admin/setConfig", {
  1136. _token: '{{csrf_token()}}',
  1137. name: 'is_forbid_robot',
  1138. value: is_forbid_robot = state ? 1 : 0
  1139. }, function (ret) {
  1140. if (ret.status === 'success') {
  1141. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1142. .then(() => window.location.reload())
  1143. } else {
  1144. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1145. }
  1146. });
  1147. }
  1148. });
  1149. // 启用、禁用注册校验验证码
  1150. $('#is_verify_register').on({
  1151. 'switchChange.bootstrapSwitch': function (event, state) {
  1152. $.post("/admin/setConfig", {
  1153. _token: '{{csrf_token()}}',
  1154. name: 'is_verify_register',
  1155. value: is_verify_register = state ? 1 : 0
  1156. }, function (ret) {
  1157. if (ret.status === 'success') {
  1158. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1159. .then(() => window.location.reload())
  1160. } else {
  1161. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1162. }
  1163. });
  1164. }
  1165. });
  1166. // 启用、禁用自定义端口
  1167. $('#is_user_rand_port').on({
  1168. 'switchChange.bootstrapSwitch': function (event, state) {
  1169. $.post("/admin/setConfig", {
  1170. _token: '{{csrf_token()}}',
  1171. name: 'is_user_rand_port',
  1172. value: state ? 1 : 0
  1173. }, function (ret) {
  1174. if (ret.status === 'success') {
  1175. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1176. .then(() => window.location.reload())
  1177. } else {
  1178. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1179. }
  1180. });
  1181. }
  1182. });
  1183. // 启用、禁用登录加流量
  1184. $('#is_checkin').on({
  1185. 'switchChange.bootstrapSwitch': function (event, state) {
  1186. $.post("/admin/setConfig", {
  1187. _token: '{{csrf_token()}}',
  1188. name: 'is_checkin',
  1189. value: is_checkin = state ? 1 : 0
  1190. }, function (ret) {
  1191. if (ret.status === 'success') {
  1192. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1193. .then(() => window.location.reload())
  1194. } else {
  1195. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1196. }
  1197. });
  1198. }
  1199. });
  1200. // 启用、禁用注册
  1201. $('#is_register').on({
  1202. 'switchChange.bootstrapSwitch': function (event, state) {
  1203. $.post("/admin/setConfig", {
  1204. _token: '{{csrf_token()}}',
  1205. name: 'is_register',
  1206. value: is_register = state ? 1 : 0
  1207. }, function (ret) {
  1208. if (ret.status === 'success') {
  1209. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1210. .then(() => window.location.reload())
  1211. } else {
  1212. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1213. }
  1214. });
  1215. }
  1216. });
  1217. // 启用、可选、禁用邀请注册
  1218. $("#is_invite_register").on("changed.bs.select", function () {
  1219. $.post("/admin/setConfig", {
  1220. _token: '{{csrf_token()}}',
  1221. name: 'is_invite_register',
  1222. value: $(this).val()
  1223. }, function (ret) {
  1224. if (ret.status === 'success') {
  1225. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1226. .then(() => window.location.reload())
  1227. } else {
  1228. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1229. }
  1230. });
  1231. });
  1232. // 启用、禁用用户重置密码
  1233. $('#is_reset_password').on({
  1234. 'switchChange.bootstrapSwitch': function (event, state) {
  1235. $.post("/admin/setConfig", {
  1236. _token: '{{csrf_token()}}',
  1237. name: 'is_reset_password',
  1238. value: state ? 1 : 0
  1239. }, function (ret) {
  1240. if (ret.status === 'success') {
  1241. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1242. .then(() => window.location.reload())
  1243. } else {
  1244. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1245. }
  1246. });
  1247. }
  1248. });
  1249. // 启用、禁用验证码
  1250. $('#is_captcha').on("changed.bs.select", function () {
  1251. $.post("/admin/setConfig", {
  1252. _token: '{{csrf_token()}}',
  1253. name: 'is_captcha',
  1254. value: $(this).val()
  1255. }, function (ret) {
  1256. if (ret.status === 'success') {
  1257. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1258. .then(() => window.location.reload())
  1259. } else {
  1260. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1261. }
  1262. });
  1263. });
  1264. // 启用、禁用免费邀请码
  1265. $('#is_free_code').on({
  1266. 'switchChange.bootstrapSwitch': function (event, state) {
  1267. $.post("/admin/setConfig", {
  1268. _token: '{{csrf_token()}}',
  1269. name: 'is_free_code',
  1270. value: state ? 1 : 0
  1271. }, function (ret) {
  1272. if (ret.status === 'success') {
  1273. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1274. .then(() => window.location.reload())
  1275. } else {
  1276. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1277. }
  1278. });
  1279. }
  1280. });
  1281. // 启用、禁用用户激活用户
  1282. $('#is_active_register').on({
  1283. 'switchChange.bootstrapSwitch': function (event, state) {
  1284. $.post("/admin/setConfig", {
  1285. _token: '{{csrf_token()}}',
  1286. name: 'is_active_register',
  1287. value: state ? 1 : 0
  1288. }, function (ret) {
  1289. if (ret.status === 'success') {
  1290. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1291. .then(() => window.location.reload())
  1292. } else {
  1293. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1294. }
  1295. });
  1296. }
  1297. });
  1298. // 启用、禁用用户到期自动邮件提醒
  1299. $('#expire_warning').on({
  1300. 'switchChange.bootstrapSwitch': function (event, state) {
  1301. $.post("/admin/setConfig", {
  1302. _token: '{{csrf_token()}}',
  1303. name: 'expire_warning',
  1304. value: state ? 1 : 0
  1305. }, function (ret) {
  1306. if (ret.status === 'success') {
  1307. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1308. .then(() => window.location.reload())
  1309. } else {
  1310. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1311. }
  1312. });
  1313. }
  1314. });
  1315. // 启用、禁用节点离线发件提醒管理员
  1316. $('#is_node_crash_warning').on({
  1317. 'switchChange.bootstrapSwitch': function (event, state) {
  1318. $.post("/admin/setConfig", {
  1319. _token: '{{csrf_token()}}',
  1320. name: 'is_node_crash_warning',
  1321. value: state ? 1 : 0
  1322. }, function (ret) {
  1323. if (ret.status === 'success') {
  1324. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1325. .then(() => window.location.reload())
  1326. } else {
  1327. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1328. }
  1329. });
  1330. }
  1331. });
  1332. // 启用、禁用节点离线发ServerChan微信消息提醒
  1333. $('#is_server_chan').on({
  1334. 'switchChange.bootstrapSwitch': function (event, state) {
  1335. $.post("/admin/setConfig", {
  1336. _token: '{{csrf_token()}}',
  1337. name: 'is_server_chan',
  1338. value: state ? 1 : 0
  1339. }, function (ret) {
  1340. if (ret.status === 'success') {
  1341. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1342. .then(() => window.location.reload())
  1343. } else {
  1344. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1345. }
  1346. });
  1347. }
  1348. });
  1349. // 启用、禁用Namesilo
  1350. $('#is_namesilo').on({
  1351. 'switchChange.bootstrapSwitch': function (event, state) {
  1352. $.post("/admin/setConfig", {
  1353. _token: '{{csrf_token()}}',
  1354. name: 'is_namesilo',
  1355. value: state ? 1 : 0
  1356. }, function (ret) {
  1357. if (ret.status === 'success') {
  1358. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1359. .then(() => window.location.reload())
  1360. } else {
  1361. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1362. }
  1363. });
  1364. }
  1365. });
  1366. // 启用、禁用混合订阅
  1367. $('#mix_subscribe').on({
  1368. 'switchChange.bootstrapSwitch': function (event, state) {
  1369. $.post("/admin/setConfig", {
  1370. _token: '{{csrf_token()}}',
  1371. name: 'mix_subscribe',
  1372. value: state ? 1 : 0
  1373. }, function (ret) {
  1374. if (ret.status === 'success') {
  1375. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1376. .then(() => window.location.reload())
  1377. } else {
  1378. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1379. }
  1380. });
  1381. }
  1382. });
  1383. // 启用、禁用随机订阅
  1384. $('#rand_subscribe').on({
  1385. 'switchChange.bootstrapSwitch': function (event, state) {
  1386. $.post("/admin/setConfig", {
  1387. _token: '{{csrf_token()}}',
  1388. name: 'rand_subscribe',
  1389. value: state ? 1 : 0
  1390. }, function (ret) {
  1391. if (ret.status === 'success') {
  1392. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1393. .then(() => window.location.reload())
  1394. } else {
  1395. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1396. }
  1397. });
  1398. }
  1399. });
  1400. // 启用、禁用自定义订阅
  1401. $('#is_custom_subscribe').on({
  1402. 'switchChange.bootstrapSwitch': function (event, state) {
  1403. $.post("/admin/setConfig", {
  1404. _token: '{{csrf_token()}}',
  1405. name: 'is_custom_subscribe',
  1406. value: state ? 1 : 0
  1407. }, function (ret) {
  1408. if (ret.status === 'success') {
  1409. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1410. .then(() => window.location.reload())
  1411. } else {
  1412. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1413. }
  1414. });
  1415. }
  1416. });
  1417. // 启用、禁用PushBear
  1418. $('#is_push_bear').on({
  1419. 'switchChange.bootstrapSwitch': function (event, state) {
  1420. $.post("/admin/setConfig", {
  1421. _token: '{{csrf_token()}}',
  1422. name: 'is_push_bear',
  1423. value: state ? 1 : 0
  1424. }, function (ret) {
  1425. if (ret.status === 'success') {
  1426. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1427. .then(() => window.location.reload())
  1428. } else {
  1429. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1430. }
  1431. });
  1432. }
  1433. });
  1434. // 启用、禁用节点阻断探测
  1435. $('#nodes_detection').on({
  1436. 'switchChange.bootstrapSwitch': function (event, state) {
  1437. $.post("/admin/setConfig", {
  1438. _token: '{{csrf_token()}}',
  1439. name: 'nodes_detection',
  1440. value: state ? 1 : 0
  1441. }, function (ret) {
  1442. if (ret.status === 'success') {
  1443. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1444. .then(() => window.location.reload())
  1445. } else {
  1446. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1447. }
  1448. });
  1449. }
  1450. });
  1451. // 启用、禁用订阅异常自动封禁
  1452. $('#is_subscribe_ban').on({
  1453. 'switchChange.bootstrapSwitch': function (event, state) {
  1454. $.post("/admin/setConfig", {
  1455. _token: '{{csrf_token()}}',
  1456. name: 'is_subscribe_ban',
  1457. value: state ? 1 : 0
  1458. }, function (ret) {
  1459. if (ret.status === 'success') {
  1460. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1461. .then(() => window.location.reload())
  1462. } else {
  1463. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1464. }
  1465. });
  1466. }
  1467. });
  1468. // 启用、禁用退关返利用户可见与否
  1469. $('#referral_status').on({
  1470. 'switchChange.bootstrapSwitch': function (event, state) {
  1471. $.post("/admin/setConfig", {
  1472. _token: '{{csrf_token()}}',
  1473. name: 'referral_status',
  1474. value: state ? 1 : 0
  1475. }, function (ret) {
  1476. if (ret.status === 'success') {
  1477. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1478. .then(() => window.location.reload())
  1479. } else {
  1480. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1481. }
  1482. });
  1483. }
  1484. });
  1485. // 启用、禁用随机端口
  1486. $('#traffic_warning').on({
  1487. 'switchChange.bootstrapSwitch': function (event, state) {
  1488. $.post("/admin/setConfig", {
  1489. _token: '{{csrf_token()}}',
  1490. name: 'traffic_warning',
  1491. value: state ? 1 : 0
  1492. }, function (ret) {
  1493. if (ret.status === 'success') {
  1494. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1495. .then(() => window.location.reload())
  1496. } else {
  1497. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1498. }
  1499. });
  1500. }
  1501. });
  1502. // 启用、禁用随机端口
  1503. $('#is_clear_log').on({
  1504. 'switchChange.bootstrapSwitch': function (event, state) {
  1505. $.post("/admin/setConfig", {
  1506. _token: '{{csrf_token()}}',
  1507. name: 'is_clear_log',
  1508. value: state ? 1 : 0
  1509. }, function (ret) {
  1510. if (ret.status === 'success') {
  1511. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1512. .then(() => window.location.reload())
  1513. } else {
  1514. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1515. }
  1516. });
  1517. }
  1518. });
  1519. // 启用、禁用流量自动重置
  1520. $('#reset_traffic').on({
  1521. 'switchChange.bootstrapSwitch': function (event, state) {
  1522. $.post("/admin/setConfig", {
  1523. _token: '{{csrf_token()}}',
  1524. name: 'reset_traffic',
  1525. value: state ? 1 : 0
  1526. }, function (ret) {
  1527. if (ret.status === 'success') {
  1528. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1529. .then(() => window.location.reload())
  1530. } else {
  1531. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1532. }
  1533. });
  1534. }
  1535. });
  1536. // 启用、禁用流量异常自动封号
  1537. $('#is_traffic_ban').on({
  1538. 'switchChange.bootstrapSwitch': function (event, state) {
  1539. $.post("/admin/setConfig", {
  1540. _token: '{{csrf_token()}}',
  1541. name: 'is_traffic_ban',
  1542. value: state ? 1 : 0
  1543. }, function (ret) {
  1544. if (ret.status === 'success') {
  1545. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1546. .then(() => window.location.reload())
  1547. } else {
  1548. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1549. }
  1550. });
  1551. }
  1552. });
  1553. // 启用、禁用端口自动释放
  1554. $('#auto_release_port').on({
  1555. 'switchChange.bootstrapSwitch': function (event, state) {
  1556. $.post("/admin/setConfig", {
  1557. _token: '{{csrf_token()}}',
  1558. name: 'auto_release_port',
  1559. value: state ? 1 : 0
  1560. }, function (ret) {
  1561. if (ret.status === 'success') {
  1562. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1563. .then(() => window.location.reload())
  1564. } else {
  1565. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1566. }
  1567. });
  1568. }
  1569. });
  1570. // 启用、禁用节点使用报告
  1571. $('#node_daily_report').on({
  1572. 'switchChange.bootstrapSwitch': function (event, state) {
  1573. $.post("/admin/setConfig", {
  1574. _token: '{{csrf_token()}}',
  1575. name: 'node_daily_report',
  1576. value: state ? 1 : 0
  1577. }, function (ret) {
  1578. if (ret.status === 'success') {
  1579. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1580. .then(() => window.location.reload())
  1581. } else {
  1582. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1583. }
  1584. });
  1585. }
  1586. });
  1587. // 过期封禁是否禁止账号
  1588. $('#is_ban_status').on({
  1589. 'switchChange.bootstrapSwitch': function (event, state) {
  1590. $.post("/admin/setConfig", {
  1591. _token: '{{csrf_token()}}',
  1592. name: 'is_ban_status',
  1593. value: state ? 1 : 0
  1594. }, function (ret) {
  1595. if (ret.status === 'success') {
  1596. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1597. .then(() => window.location.reload())
  1598. } else {
  1599. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1600. }
  1601. });
  1602. }
  1603. });
  1604. // 启用、禁用alipay国际
  1605. $('#is_alipay').on({
  1606. 'switchChange.bootstrapSwitch': function (event, state) {
  1607. $.post("/admin/setConfig", {
  1608. _token: '{{csrf_token()}}',
  1609. name: 'is_alipay',
  1610. value: state ? 1 : 0
  1611. }, function (ret) {
  1612. if (ret.status === 'success') {
  1613. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1614. .then(() => window.location.reload())
  1615. } else {
  1616. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1617. }
  1618. });
  1619. }
  1620. });
  1621. // 启用、禁用支付宝当面付
  1622. $('#is_f2fpay').on({
  1623. 'switchChange.bootstrapSwitch': function (event, state) {
  1624. $.post("/admin/setConfig", {
  1625. _token: '{{csrf_token()}}',
  1626. name: 'is_f2fpay',
  1627. value: state ? 1 : 0
  1628. }, function (ret) {
  1629. if (ret.status === 'success') {
  1630. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1631. .then(() => window.location.reload())
  1632. } else {
  1633. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1634. }
  1635. });
  1636. }
  1637. });
  1638. // 流量异常阈值
  1639. function setTrafficBanValue() {
  1640. const traffic_ban_value = $("#traffic_ban_value").val();
  1641. if (traffic_ban_value < 1) {
  1642. swal.fire({title: '不能小于1', type: 'warning', timer: 1000, showConfirmButton: false});
  1643. return;
  1644. }
  1645. $.post("/admin/setConfig", {
  1646. _token: '{{csrf_token()}}',
  1647. name: 'traffic_ban_value',
  1648. value: traffic_ban_value
  1649. }, function (ret) {
  1650. if (ret.status === 'success') {
  1651. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1652. .then(() => window.location.reload())
  1653. } else {
  1654. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1655. }
  1656. });
  1657. }
  1658. // 设置用户封号时长
  1659. function setTrafficBanTime() {
  1660. const traffic_ban_time = $("#traffic_ban_time").val();
  1661. if (traffic_ban_time < 0) {
  1662. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  1663. return;
  1664. }
  1665. $.post("/admin/setConfig", {
  1666. _token: '{{csrf_token()}}',
  1667. name: 'traffic_ban_time',
  1668. value: traffic_ban_time
  1669. }, function (ret) {
  1670. if (ret.status === 'success') {
  1671. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1672. .then(() => window.location.reload())
  1673. } else {
  1674. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1675. }
  1676. });
  1677. }
  1678. // 设置节点离线警告收件地址
  1679. function setCrashWarningEmail() {
  1680. $.post("/admin/setConfig", {
  1681. _token: '{{csrf_token()}}',
  1682. name: 'webmaster_email',
  1683. value: $("#webmaster_email").val()
  1684. }, function (ret) {
  1685. if (ret.status === 'success') {
  1686. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1687. .then(() => window.location.reload())
  1688. } else {
  1689. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1690. }
  1691. });
  1692. }
  1693. // 设置ServerChan的SCKEY
  1694. function setServerChanKey() {
  1695. $.post("/admin/setConfig", {
  1696. _token: '{{csrf_token()}}',
  1697. name: 'server_chan_key',
  1698. value: $("#server_chan_key").val()
  1699. }, function (ret) {
  1700. if (ret.status === 'success') {
  1701. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1702. .then(() => window.location.reload())
  1703. } else {
  1704. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1705. }
  1706. });
  1707. }
  1708. // 设置Namesilo API KEY
  1709. function setNamesiloKey() {
  1710. $.post("/admin/setConfig", {
  1711. _token: '{{csrf_token()}}',
  1712. name: 'namesilo_key',
  1713. value: $("#namesilo_key").val()
  1714. }, function (ret) {
  1715. if (ret.status === 'success') {
  1716. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1717. .then(() => window.location.reload())
  1718. } else {
  1719. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1720. }
  1721. });
  1722. }
  1723. // 设置PushBear的SendKey
  1724. function setPushBearSendKey() {
  1725. $.post("/admin/setConfig", {
  1726. _token: '{{csrf_token()}}',
  1727. name: 'push_bear_send_key',
  1728. value: $("#push_bear_send_key").val()
  1729. }, function (ret) {
  1730. if (ret.status === 'success') {
  1731. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1732. .then(() => window.location.reload())
  1733. } else {
  1734. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1735. }
  1736. });
  1737. }
  1738. // 设置PushBear的消息通道二维码URL
  1739. function setPushBearQrCode() {
  1740. $.post("/admin/setConfig", {
  1741. _token: '{{csrf_token()}}',
  1742. name: 'push_bear_qrcode',
  1743. value: $("#push_bear_qrcode").val()
  1744. }, function (ret) {
  1745. if (ret.status === 'success') {
  1746. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1747. .then(() => window.location.reload())
  1748. } else {
  1749. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1750. }
  1751. });
  1752. }
  1753. // 设置TCP阻断检测提醒次数
  1754. function setNumberOfWarningTimes() {
  1755. const numberOfWarningTimes = $("#numberOfWarningTimes").val();
  1756. if (numberOfWarningTimes < 0 || numberOfWarningTimes > 12) {
  1757. swal.fire({title: '只能在0-12之间', type: 'warning', timer: 1000, showConfirmButton: false});
  1758. return;
  1759. }
  1760. $.post("/admin/setConfig", {
  1761. _token: '{{csrf_token()}}',
  1762. name: 'numberOfWarningTimes',
  1763. value: numberOfWarningTimes
  1764. }, function (ret) {
  1765. if (ret.status === 'success') {
  1766. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1767. .then(() => window.location.reload())
  1768. } else {
  1769. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1770. }
  1771. });
  1772. }
  1773. // 设置订阅封禁阈值
  1774. function setSubscribeBanTimes() {
  1775. const subscribe_ban_times = $("#subscribe_ban_times").val();
  1776. if (subscribe_ban_times < 0) {
  1777. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  1778. return;
  1779. }
  1780. $.post("/admin/setConfig", {
  1781. _token: '{{csrf_token()}}',
  1782. name: 'subscribe_ban_times',
  1783. value: subscribe_ban_times
  1784. }, function (ret) {
  1785. if (ret.status === 'success') {
  1786. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1787. .then(() => window.location.reload())
  1788. } else {
  1789. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1790. }
  1791. });
  1792. }
  1793. // 设置alipay加密方式
  1794. $('#alipay_sign_type').change(function () {
  1795. $.post("/admin/setConfig", {
  1796. _token: '{{csrf_token()}}',
  1797. name: 'alipay_sign_type',
  1798. value: $(this).val()
  1799. }, function (ret) {
  1800. if (ret.status === 'success') {
  1801. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1802. .then(() => window.location.reload())
  1803. } else {
  1804. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1805. }
  1806. });
  1807. });
  1808. // 设置alipay是否启用SSL验证
  1809. $('#alipay_transport').change(function () {
  1810. $.post("/admin/setConfig", {
  1811. _token: '{{csrf_token()}}',
  1812. name: 'alipay_transport',
  1813. value: $(this).val()
  1814. }, function (ret) {
  1815. if (ret.status === 'success') {
  1816. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1817. .then(() => window.location.reload())
  1818. } else {
  1819. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1820. }
  1821. });
  1822. });
  1823. //设置alipay的partner
  1824. function setAlipayPartner() {
  1825. $.post("/admin/setConfig", {
  1826. _token: '{{csrf_token()}}',
  1827. name: 'alipay_partner',
  1828. value: $("#alipay_partner").val()
  1829. }, function (ret) {
  1830. if (ret.status === 'success') {
  1831. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1832. .then(() => window.location.reload())
  1833. } else {
  1834. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1835. }
  1836. });
  1837. }
  1838. //设置alipay的key
  1839. function setAlipayKey() {
  1840. $.post("/admin/setConfig", {
  1841. _token: '{{csrf_token()}}',
  1842. name: 'alipay_key',
  1843. value: $("#alipay_key").val()
  1844. }, function (ret) {
  1845. if (ret.status === 'success') {
  1846. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1847. .then(() => window.location.reload())
  1848. } else {
  1849. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1850. }
  1851. });
  1852. }
  1853. //设置alipay的私钥
  1854. function setAlipayPrivateKey() {
  1855. $.post("/admin/setConfig", {
  1856. _token: '{{csrf_token()}}',
  1857. name: 'alipay_private_key',
  1858. value: $("#alipay_private_key").val()
  1859. }, function (ret) {
  1860. if (ret.status === 'success') {
  1861. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1862. .then(() => window.location.reload())
  1863. } else {
  1864. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1865. }
  1866. });
  1867. }
  1868. //设置alipay的公钥
  1869. function setAlipayPublicKey() {
  1870. $.post("/admin/setConfig", {
  1871. _token: '{{csrf_token()}}',
  1872. name: 'alipay_public_key',
  1873. value: $("#alipay_public_key").val()
  1874. }, function (ret) {
  1875. if (ret.status === 'success') {
  1876. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1877. .then(() => window.location.reload())
  1878. } else {
  1879. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1880. }
  1881. });
  1882. }
  1883. // 设置alipay结算币种
  1884. $('#alipay_currency').on("changed.bs.select", function () {
  1885. $.post("/admin/setConfig", {
  1886. _token: '{{csrf_token()}}',
  1887. name: 'alipay_currency',
  1888. value: $(this).val()
  1889. }, function (ret) {
  1890. if (ret.status === 'success') {
  1891. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1892. .then(() => window.location.reload())
  1893. } else {
  1894. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1895. }
  1896. });
  1897. });
  1898. // 设置最小流量
  1899. $("#min_rand_traffic").change(function () {
  1900. const min_rand_traffic = $(this).val();
  1901. const max_rand_traffic = $("#max_rand_traffic").val();
  1902. if (parseInt(min_rand_traffic) < 0) {
  1903. swal.fire({title: '最小流量值不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  1904. return;
  1905. }
  1906. if (parseInt(min_rand_traffic) >= parseInt(max_rand_traffic)) {
  1907. swal.fire({title: '最小流量值必须小于最大流量值', type: 'warning', timer: 1000, showConfirmButton: false});
  1908. return;
  1909. }
  1910. $.post("/admin/setConfig", {
  1911. _token: '{{csrf_token()}}',
  1912. name: 'min_rand_traffic',
  1913. value: min_rand_traffic
  1914. }, function (ret) {
  1915. if (ret.status === 'success') {
  1916. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1917. .then(() => window.location.reload())
  1918. } else {
  1919. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1920. }
  1921. });
  1922. });
  1923. // 设置最大流量
  1924. $("#max_rand_traffic").change(function () {
  1925. const min_rand_traffic = $("#min_rand_traffic").val();
  1926. const max_rand_traffic = $(this).val();
  1927. if (parseInt(max_rand_traffic) > 99999) {
  1928. swal.fire({title: '最大流量值不能大于99999', type: 'warning', timer: 1000, showConfirmButton: false});
  1929. return;
  1930. }
  1931. if (parseInt(min_rand_traffic) >= parseInt(max_rand_traffic)) {
  1932. swal.fire({title: '最大流量值必须大于最小流量值', type: 'warning', timer: 1000, showConfirmButton: false});
  1933. return;
  1934. }
  1935. $.post("/admin/setConfig", {
  1936. _token: '{{csrf_token()}}',
  1937. name: 'max_rand_traffic',
  1938. value: max_rand_traffic
  1939. }, function (ret) {
  1940. if (ret.status === 'success') {
  1941. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1942. .then(() => window.location.reload())
  1943. } else {
  1944. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1945. }
  1946. });
  1947. });
  1948. // 设置f2fpay的应用id
  1949. function setF2fpayAppId() {
  1950. $.post("/admin/setConfig", {
  1951. _token: '{{csrf_token()}}',
  1952. name: 'f2fpay_app_id',
  1953. value: $("#f2fpay_app_id").val()
  1954. }, function (ret) {
  1955. if (ret.status === 'success') {
  1956. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1957. .then(() => window.location.reload())
  1958. } else {
  1959. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1960. }
  1961. });
  1962. }
  1963. // 设置f2fpay的私钥
  1964. function setF2fpayPrivateKey() {
  1965. $.post("/admin/setConfig", {
  1966. _token: '{{csrf_token()}}',
  1967. name: 'f2fpay_private_key',
  1968. value: $("#f2fpay_private_key").val()
  1969. }, function (ret) {
  1970. if (ret.status === 'success') {
  1971. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1972. .then(() => window.location.reload())
  1973. } else {
  1974. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1975. }
  1976. });
  1977. }
  1978. // 设置f2fpay的公钥
  1979. function setF2fpayPublicKey() {
  1980. $.post("/admin/setConfig", {
  1981. _token: '{{csrf_token()}}',
  1982. name: 'f2fpay_public_key',
  1983. value: $("#f2fpay_public_key").val()
  1984. }, function (ret) {
  1985. if (ret.status === 'success') {
  1986. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  1987. .then(() => window.location.reload())
  1988. } else {
  1989. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  1990. }
  1991. });
  1992. }
  1993. // 自动去除公钥和私钥中的空格和换行
  1994. $("#alipay_public_key,#alipay_private_key,#f2fpay_public_key,#f2fpay_private_key").on('input', function () {
  1995. $(this).val($(this).val().replace(/(\s+)/g, ''));
  1996. });
  1997. // 设置f2fpay的商品名称
  1998. function setF2fpaySubjectName() {
  1999. $.post("/admin/setConfig", {
  2000. _token: '{{csrf_token()}}',
  2001. name: 'f2fpay_subject_name',
  2002. value: $("#f2fpay_subject_name").val()
  2003. }, function (ret) {
  2004. if (ret.status === 'success') {
  2005. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2006. .then(() => window.location.reload())
  2007. } else {
  2008. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2009. }
  2010. });
  2011. }
  2012. // 设置极验的Id
  2013. function setGeetestId() {
  2014. $.post("/admin/setConfig", {
  2015. _token: '{{csrf_token()}}',
  2016. name: 'geetest_id',
  2017. value: $("#geetest_id").val()
  2018. }, function (ret) {
  2019. if (ret.status === 'success') {
  2020. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2021. .then(() => window.location.reload())
  2022. } else {
  2023. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2024. }
  2025. });
  2026. }
  2027. // 设置极验的Key
  2028. function setGeetestKey() {
  2029. $.post("/admin/setConfig", {
  2030. _token: '{{csrf_token()}}',
  2031. name: 'geetest_key',
  2032. value: $("#geetest_key").val()
  2033. }, function (ret) {
  2034. if (ret.status === 'success') {
  2035. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2036. .then(() => window.location.reload())
  2037. } else {
  2038. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2039. }
  2040. });
  2041. }
  2042. // 设置Google reCAPTCHA的Id
  2043. function setGoogleCaptchaId() {
  2044. $.post("/admin/setConfig", {
  2045. _token: '{{csrf_token()}}',
  2046. name: 'google_captcha_sitekey',
  2047. value: $("#google_captcha_sitekey").val()
  2048. }, function (ret) {
  2049. if (ret.status === 'success') {
  2050. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2051. .then(() => window.location.reload())
  2052. } else {
  2053. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2054. }
  2055. });
  2056. }
  2057. // 设置Google reCAPTCHA的Key
  2058. function setGoogleCaptchaKey() {
  2059. $.post("/admin/setConfig", {
  2060. _token: '{{csrf_token()}}',
  2061. name: 'google_captcha_secret',
  2062. value: $("#google_captcha_secret").val()
  2063. }, function (ret) {
  2064. if (ret.status === 'success') {
  2065. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2066. .then(() => window.location.reload())
  2067. } else {
  2068. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2069. }
  2070. });
  2071. }
  2072. // 设置最小端口
  2073. $("#min_port").change(function () {
  2074. const min_port = $(this).val();
  2075. const max_port = $("#max_port").val();
  2076. // 最大端口必须大于最小端口
  2077. if (parseInt(max_port) <= parseInt(min_port)) {
  2078. swal.fire({title: '必须小于最大端口', type: 'warning', timer: 1000, showConfirmButton: false});
  2079. return;
  2080. }
  2081. if (parseInt(min_port) < 1000) {
  2082. swal.fire({title: '最小端口不能小于1000', type: 'warning', timer: 1000, showConfirmButton: false});
  2083. return;
  2084. }
  2085. $.post("/admin/setConfig", {_token: '{{csrf_token()}}', name: 'min_port', value: min_port}, function (ret) {
  2086. if (ret.status === 'success') {
  2087. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2088. .then(() => window.location.reload())
  2089. } else {
  2090. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2091. }
  2092. });
  2093. });
  2094. // 设置最大端口
  2095. $("#max_port").change(function () {
  2096. const min_port = $("#min_port").val();
  2097. const max_port = $(this).val();
  2098. // 最大端口必须大于最小端口
  2099. if (parseInt(max_port) <= parseInt(min_port)) {
  2100. swal.fire({title: '必须大于最小端口', type: 'warning', timer: 1000, showConfirmButton: false});
  2101. return;
  2102. }
  2103. if (parseInt(max_port) > 65535) {
  2104. swal.fire({title: '最大端口不能大于65535', type: 'warning', timer: 1000, showConfirmButton: false});
  2105. return;
  2106. }
  2107. $.post("/admin/setConfig", {_token: '{{csrf_token()}}', name: 'max_port', value: max_port}, function (ret) {
  2108. if (ret.status === 'success') {
  2109. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2110. .then(() => window.location.reload())
  2111. } else {
  2112. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2113. }
  2114. });
  2115. });
  2116. // 邮箱黑白名单切换
  2117. $('#sensitiveType').on({
  2118. 'switchChange.bootstrapSwitch': function (event, state) {
  2119. $.post("/admin/setConfig", {
  2120. _token: '{{csrf_token()}}',
  2121. name: 'sensitiveType',
  2122. value: state ? 1 : 0
  2123. }, function (ret) {
  2124. if (ret.status === 'success') {
  2125. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2126. .then(() => window.location.reload())
  2127. } else {
  2128. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2129. }
  2130. });
  2131. }
  2132. });
  2133. // 设置注册时默认有效期
  2134. function setDefaultDays() {
  2135. const default_days = parseInt($("#default_days").val());
  2136. if (default_days < 0) {
  2137. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2138. return;
  2139. }
  2140. $.post("/admin/setConfig", {
  2141. _token: '{{csrf_token()}}',
  2142. name: 'default_days',
  2143. value: default_days
  2144. }, function (ret) {
  2145. if (ret.status === 'success') {
  2146. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2147. .then(() => window.location.reload())
  2148. } else {
  2149. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2150. }
  2151. });
  2152. }
  2153. // 设置注册时默认流量
  2154. function setDefaultTraffic() {
  2155. const default_traffic = parseInt($("#default_traffic").val());
  2156. if (default_traffic < 0) {
  2157. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2158. return;
  2159. }
  2160. $.post("/admin/setConfig", {
  2161. _token: '{{csrf_token()}}',
  2162. name: 'default_traffic',
  2163. value: default_traffic
  2164. }, function (ret) {
  2165. if (ret.status === 'success') {
  2166. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2167. .then(() => window.location.reload())
  2168. } else {
  2169. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2170. }
  2171. });
  2172. }
  2173. // 设置可生成邀请码数量
  2174. function setInviteNum() {
  2175. const invite_num = parseInt($("#invite_num").val());
  2176. if (invite_num < 0) {
  2177. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2178. return;
  2179. }
  2180. $.post("/admin/setConfig", {
  2181. _token: '{{csrf_token()}}',
  2182. name: 'invite_num',
  2183. value: invite_num
  2184. }, function (ret) {
  2185. if (ret.status === 'success') {
  2186. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2187. .then(() => window.location.reload())
  2188. } else {
  2189. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2190. }
  2191. });
  2192. }
  2193. // 设置重置密码次数
  2194. function setResetPasswordTimes() {
  2195. const reset_password_times = $("#reset_password_times").val();
  2196. if (reset_password_times < 0) {
  2197. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2198. return;
  2199. }
  2200. $.post("/admin/setConfig", {
  2201. _token: '{{csrf_token()}}',
  2202. name: 'reset_password_times',
  2203. value: reset_password_times
  2204. }, function (ret) {
  2205. if (ret.status === 'success') {
  2206. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2207. .then(() => window.location.reload())
  2208. } else {
  2209. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2210. }
  2211. });
  2212. }
  2213. // 设置激活用户次数
  2214. function setActiveTimes() {
  2215. const active_times = parseInt($("#active_times").val());
  2216. if (active_times < 0) {
  2217. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2218. return;
  2219. }
  2220. $.post("/admin/setConfig", {
  2221. _token: '{{csrf_token()}}',
  2222. name: 'active_times',
  2223. value: active_times
  2224. }, function (ret) {
  2225. if (ret.status === 'success') {
  2226. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2227. .then(() => window.location.reload())
  2228. } else {
  2229. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2230. }
  2231. });
  2232. }
  2233. // 设置节点订阅地址
  2234. function setSubscribeDomain() {
  2235. $.post("/admin/setConfig", {
  2236. _token: '{{csrf_token()}}',
  2237. name: 'subscribe_domain',
  2238. value: $("#subscribe_domain").val()
  2239. }, function (ret) {
  2240. if (ret.status === 'success') {
  2241. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2242. .then(() => window.location.reload())
  2243. } else {
  2244. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2245. }
  2246. });
  2247. }
  2248. // 24小时内同IP注册限制
  2249. function setRegisterIpLimit() {
  2250. const register_ip_limit = parseInt($("#register_ip_limit").val());
  2251. if (register_ip_limit < 0) {
  2252. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2253. return;
  2254. }
  2255. $.post("/admin/setConfig", {
  2256. _token: '{{csrf_token()}}',
  2257. name: 'register_ip_limit',
  2258. value: register_ip_limit
  2259. }, function (ret) {
  2260. if (ret.status === 'success') {
  2261. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2262. .then(() => window.location.reload())
  2263. } else {
  2264. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2265. }
  2266. });
  2267. }
  2268. // 设置节点订阅随机展示节点数
  2269. function setSubscribeMax() {
  2270. const subscribe_max = parseInt($("#subscribe_max").val());
  2271. if (subscribe_max < 0) {
  2272. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2273. return;
  2274. }
  2275. $.post("/admin/setConfig", {
  2276. _token: '{{csrf_token()}}',
  2277. name: 'subscribe_max',
  2278. value: subscribe_max
  2279. }, function (ret) {
  2280. if (ret.status === 'success') {
  2281. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2282. .then(() => window.location.reload())
  2283. } else {
  2284. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2285. }
  2286. });
  2287. }
  2288. // 设置用户生成邀请码有效期
  2289. function setUserInviteDays() {
  2290. const user_invite_days = parseInt($("#user_invite_days").val());
  2291. if (user_invite_days <= 0) {
  2292. swal.fire({title: '必须大于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2293. return;
  2294. }
  2295. $.post("/admin/setConfig", {
  2296. _token: '{{csrf_token()}}',
  2297. name: 'user_invite_days',
  2298. value: user_invite_days
  2299. }, function (ret) {
  2300. if (ret.status === 'success') {
  2301. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2302. .then(() => window.location.reload())
  2303. } else {
  2304. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2305. }
  2306. });
  2307. }
  2308. // 设置管理员生成邀请码有效期
  2309. function setAdminInviteDays() {
  2310. const admin_invite_days = parseInt($("#admin_invite_days").val());
  2311. if (admin_invite_days <= 0) {
  2312. swal.fire({title: '必须大于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2313. return;
  2314. }
  2315. $.post("/admin/setConfig", {
  2316. _token: '{{csrf_token()}}',
  2317. name: 'admin_invite_days',
  2318. value: admin_invite_days
  2319. }, function (ret) {
  2320. if (ret.status === 'success') {
  2321. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2322. .then(() => window.location.reload())
  2323. } else {
  2324. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2325. }
  2326. });
  2327. }
  2328. // 设置流量警告阈值
  2329. function setTrafficWarningPercent() {
  2330. const traffic_warning_percent = $("#traffic_warning_percent").val();
  2331. if (traffic_warning_percent < 0) {
  2332. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2333. return;
  2334. }
  2335. $.post("/admin/setConfig", {
  2336. _token: '{{csrf_token()}}',
  2337. name: 'traffic_warning_percent',
  2338. value: traffic_warning_percent
  2339. }, function (ret) {
  2340. if (ret.status === 'success') {
  2341. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2342. .then(() => window.location.reload())
  2343. } else {
  2344. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2345. }
  2346. });
  2347. }
  2348. // 设置用户过期提醒阈值
  2349. function setExpireDays() {
  2350. const expire_days = parseInt($("#expire_days").val());
  2351. if (expire_days < 0) {
  2352. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2353. return;
  2354. }
  2355. $.post("/admin/setConfig", {
  2356. _token: '{{csrf_token()}}',
  2357. name: 'expire_days',
  2358. value: expire_days
  2359. }, function (ret) {
  2360. if (ret.status === 'success') {
  2361. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2362. .then(() => window.location.reload())
  2363. } else {
  2364. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2365. }
  2366. });
  2367. }
  2368. // 设置网站名称
  2369. function setWebsiteName() {
  2370. $.post("/admin/setConfig", {
  2371. _token: '{{csrf_token()}}',
  2372. name: 'website_name',
  2373. value: $("#website_name").val()
  2374. }, function (ret) {
  2375. if (ret.status === 'success') {
  2376. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2377. .then(() => window.location.reload())
  2378. } else {
  2379. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2380. }
  2381. });
  2382. }
  2383. // 设置网站地址
  2384. function setWebsiteUrl() {
  2385. $.post("/admin/setConfig", {
  2386. _token: '{{csrf_token()}}',
  2387. name: 'website_url',
  2388. value: $("#website_url").val()
  2389. }, function (ret) {
  2390. if (ret.status === 'success') {
  2391. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2392. .then(() => window.location.reload())
  2393. } else {
  2394. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2395. }
  2396. });
  2397. }
  2398. // 设置苹果账号
  2399. function setAppStoreId() {
  2400. $.post("/admin/setConfig", {
  2401. _token: '{{csrf_token()}}',
  2402. name: 'AppStore_id',
  2403. value: $("#AppStore_id").val()
  2404. }, function (ret) {
  2405. if (ret.status === 'success') {
  2406. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2407. .then(() => window.location.reload())
  2408. } else {
  2409. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2410. }
  2411. });
  2412. }
  2413. // 设置苹果密码
  2414. function setAppStorePassword() {
  2415. $.post("/admin/setConfig", {
  2416. _token: '{{csrf_token()}}',
  2417. name: 'AppStore_password',
  2418. value: $("#AppStore_password").val()
  2419. }, function (ret) {
  2420. if (ret.status === 'success') {
  2421. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2422. .then(() => window.location.reload())
  2423. } else {
  2424. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2425. }
  2426. });
  2427. }
  2428. //设置管理员邮箱
  2429. function setAdminEmail() {
  2430. $.post("/admin/setConfig", {
  2431. _token: '{{csrf_token()}}',
  2432. name: 'admin_email',
  2433. value: $("#admin_email").val()
  2434. }, function (ret) {
  2435. if (ret.status === 'success') {
  2436. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2437. .then(() => window.location.reload())
  2438. } else {
  2439. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2440. }
  2441. });
  2442. }
  2443. // 生成网站安全码
  2444. function makeWebsiteSecurityCode() {
  2445. $.get("/makeSecurityCode", function (ret) {
  2446. $("#website_security_code").val(ret);
  2447. });
  2448. }
  2449. // 设置网站安全码
  2450. function setWebsiteSecurityCode() {
  2451. $.post("/admin/setConfig", {
  2452. _token: '{{csrf_token()}}',
  2453. name: 'website_security_code',
  2454. value: $("#website_security_code").val()
  2455. }, function (ret) {
  2456. if (ret.status === 'success') {
  2457. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2458. .then(() => window.location.reload())
  2459. } else {
  2460. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2461. }
  2462. });
  2463. }
  2464. // 登录加流量的时间间隔
  2465. function setTrafficLimitTime() {
  2466. const traffic_limit_time = parseInt($("#traffic_limit_time").val());
  2467. if (traffic_limit_time < 0) {
  2468. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2469. return;
  2470. }
  2471. $.post("/admin/setConfig", {
  2472. _token: '{{csrf_token()}}',
  2473. name: 'traffic_limit_time',
  2474. value: traffic_limit_time
  2475. }, function (ret) {
  2476. if (ret.status === 'success') {
  2477. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2478. .then(() => window.location.reload())
  2479. } else {
  2480. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2481. }
  2482. });
  2483. }
  2484. // 设置根据推广链接注册送流量
  2485. function setReferralTraffic() {
  2486. const referral_traffic = parseInt($("#referral_traffic").val());
  2487. if (referral_traffic < 0) {
  2488. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2489. return;
  2490. }
  2491. $.post("/admin/setConfig", {
  2492. _token: '{{csrf_token()}}',
  2493. name: 'referral_traffic',
  2494. value: referral_traffic
  2495. }, function (ret) {
  2496. if (ret.status === 'success') {
  2497. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2498. .then(() => window.location.reload())
  2499. } else {
  2500. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2501. }
  2502. });
  2503. }
  2504. // 设置根据推广链接注册人每产生一笔消费,则推广人可以获得的返利比例
  2505. function setReferralPercent() {
  2506. const referral_percent = $("#referral_percent").val();
  2507. if (referral_percent < 0) {
  2508. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2509. return;
  2510. }
  2511. if (referral_percent > 100) {
  2512. swal.fire({title: '不能大于100', type: 'warning', timer: 1000, showConfirmButton: false});
  2513. return;
  2514. }
  2515. $.post("/admin/setConfig", {
  2516. _token: '{{csrf_token()}}',
  2517. name: 'referral_percent',
  2518. value: referral_percent
  2519. }, function (ret) {
  2520. if (ret.status === 'success') {
  2521. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2522. .then(() => window.location.reload())
  2523. } else {
  2524. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2525. }
  2526. });
  2527. }
  2528. // 设置返利满多少元才可以提现
  2529. function setReferralMoney() {
  2530. const referral_money = $("#referral_money").val();
  2531. if (referral_money < 0) {
  2532. swal.fire({title: '不能小于0', type: 'warning', timer: 1000, showConfirmButton: false});
  2533. return;
  2534. }
  2535. $.post("/admin/setConfig", {
  2536. _token: '{{csrf_token()}}',
  2537. name: 'referral_money',
  2538. value: referral_money
  2539. }, function (ret) {
  2540. if (ret.status === 'success') {
  2541. swal.fire({title: ret.message, type: 'success', timer: 1000, showConfirmButton: false})
  2542. .then(() => window.location.reload())
  2543. } else {
  2544. swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload())
  2545. }
  2546. });
  2547. }
  2548. </script>
  2549. @endsection