| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437 |
- @extends('admin.layouts')
- @section('css')
- <link href="/assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
- <link href="/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
- <link href="/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css" rel="stylesheet" type="text/css" />
- <link href="/assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
- <link href="/assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
- @endsection
- @section('title', '控制面板')
- @section('content')
- <!-- BEGIN CONTENT BODY -->
- <div class="page-content" style="padding-top:0;">
- <!-- BEGIN PAGE BASE CONTENT -->
- <div class="row">
- <div class="col-md-12">
- <!-- BEGIN PROFILE CONTENT -->
- <div class="profile-content">
- <div class="row">
- <div class="col-md-12">
- <div class="portlet light bordered">
- <div class="portlet-title tabbable-line">
- <ul class="nav nav-tabs">
- <li class="active">
- <a href="#tab_1" data-toggle="tab"> 常规设置 </a>
- </li>
- <li>
- <a href="#tab_2" data-toggle="tab"> 拓展设置 </a>
- </li>
- <li>
- <a href="#tab_3" data-toggle="tab"> 积分设置 </a>
- </li>
- <li>
- <a href="#tab_4" data-toggle="tab"> 推广返利设置 </a>
- </li>
- <li>
- <a href="#tab_5" data-toggle="tab"> 警告提醒设置 </a>
- </li>
- <li>
- <a href="#tab_6" data-toggle="tab"> 自动化任务 </a>
- </li>
- <li>
- <a href="#tab_7" data-toggle="tab"> 有赞云设置 </a>
- </li>
- </ul>
- </div>
- <div class="portlet-body">
- <div class="tab-content">
- <div class="tab-pane active" id="tab_1">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-6">
- <label for="website_name" class="col-md-3 control-label">网站名称</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="website_name" value="{{$website_name}}" id="website_name" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setWebsiteName()">修改</button>
- </span>
- </div>
- <span class="help-block"> 发邮件时展示 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="website_url" class="col-md-3 control-label">网站地址</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="website_url" value="{{$website_url}}" id="website_url" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setWebsiteUrl()">修改</button>
- </span>
- </div>
- <span class="help-block"> 生成重置密码必备,示例:https://www.ssrpanel.com </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_register" class="col-md-3 control-label">用户注册</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_register) checked @endif id="is_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 关闭后无法注册 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="is_active_register" class="col-md-3 control-label">激活账号</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_active_register) checked @endif id="is_active_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后用户需要通过邮件来激活账号 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_invite_register" class="col-md-3 control-label">邀请注册</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_invite_register) checked @endif id="is_invite_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后必须使用邀请码进行注册 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="is_reset_password" class="col-md-3 control-label">重置密码</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_reset_password) checked @endif id="is_reset_password" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后用户可以通过邮件重置密码 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_captcha" class="col-md-3 control-label">验证码</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_captcha) checked @endif id="is_captcha" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后登录、注册需要输入验证码 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="is_free_code" class="col-md-3 control-label">免费邀请码</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_free_code) checked @endif id="is_free_code" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 关闭后免费邀请码不可见 </span>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="tab-pane" id="tab_2">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_rand_port" class="col-md-3 control-label">随机端口</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_rand_port) checked @endif id="is_rand_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 注册、添加用户时随机生成端口 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label class="col-md-3 control-label">端口范围</label>
- <div class="col-md-9">
- <div class="input-group input-large input-daterange">
- <input type="text" class="form-control" name="min_port" value="{{$min_port}}" id="min_port">
- <span class="input-group-addon"> ~ </span>
- <input type="text" class="form-control" name="max_port" value="{{$max_port}}" id="max_port">
- </div>
- <span class="help-block"> 端口范围:1000 - 65535 </span>
- </div>
- </div>
- </div>
- <!--
- <div class="form-group">
- <label for="is_user_rand_port" class="col-md-2 control-label">自定义端口</label>
- <div class="col-md-6">
- <input type="checkbox" class="make-switch" @if($is_user_rand_port) checked @endif id="is_user_rand_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 用户可以自定义端口 </span>
- </div>
- </div>
- -->
- <div class="form-group">
- <div class="col-md-6">
- <label for="default_days" class="col-md-3 control-label">初始有效期</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="default_days" value="{{$default_days}}" id="default_days" />
- <span class="input-group-addon">天</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setDefaultDays()">修改</button>
- </span>
- </div>
- <span class="help-block"> 用户注册时默认SS(R)有效天数 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="default_traffic" class="col-md-3 control-label">初始流量</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="default_traffic" value="{{$default_traffic}}" id="default_traffic" />
- <span class="input-group-addon">MiB</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setDefaultTraffic()">修改</button>
- </span>
- </div>
- <span class="help-block"> 用户注册时默认可用流量 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="invite_num" class="col-md-3 control-label">可生成邀请码数</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="invite_num" value="{{$invite_num}}" id="invite_num" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setInviteNum()">修改</button>
- </span>
- </div>
- <span class="help-block"> 用户可以生成的邀请码数 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="reset_password_times" class="col-md-3 control-label">重置密码次数</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="reset_password_times" value="{{$reset_password_times}}" id="reset_password_times" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setResetPasswordTimes()">修改</button>
- </span>
- </div>
- <span class="help-block"> 24小时内可以通过邮件重置密码次数 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_forbid_robot" class="col-md-3 control-label">阻止机器人访问</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_forbid_robot) checked @endif id="is_forbid_robot" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 如果是机器人、爬虫、代理访问网站则会抛出403错误 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="active_times" class="col-md-3 control-label">激活账号次数</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="active_times" value="{{$active_times}}" id="active_times" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setActiveTimes()">修改</button>
- </span>
- </div>
- <span class="help-block"> 24小时内可以通过邮件激活账号次数 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="subscribe_domain" class="col-md-3 control-label">节点订阅地址</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="subscribe_domain" value="{{$subscribe_domain}}" id="subscribe_domain" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setSubscribeDomain()">修改</button>
- </span>
- </div>
- <span class="help-block"> (推荐)防止面板域名被投毒后无法正常订阅,需带http://或https:// </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="subscribe_max" class="col-md-3 control-label">订阅节点数</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="subscribe_max" value="{{$subscribe_max}}" id="subscribe_max" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setSubscribeMax()">修改</button>
- </span>
- </div>
- <span class="help-block"> 客户端订阅时随机取得几个节点 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="initial_labels_for_user" class="col-md-3 control-label">用户初始标签</label>
- <div class="col-md-9">
- <select id="initial_labels_for_user" class="form-control select2-multiple" name="initial_labels_for_user" multiple="multiple">
- @foreach($label_list as $label)
- <option value="{{$label->id}}"
- @if (in_array($label->id, explode(',', $initial_labels_for_user)))
- selected
- @endif
- >{{$label->name}}</option>
- @endforeach
- </select>
- <span class="help-block"> 注册用户时的初始标签 </span>
- </div>
- </div>
- <div class="col-md-6"></div>
- </div>
- </div>
- </form>
- </div>
- <div class="tab-pane" id="tab_3">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-6">
- <label for="login_add_score" class="col-md-3 control-label">登录加积分</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($login_add_score) checked @endif id="login_add_score" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 登录时将根据积分范围得到积分 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="login_add_score_range" class="col-md-3 control-label">时间间隔</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="login_add_score_range" value="{{$login_add_score_range}}" id="login_add_score_range" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setLoginAddScoreRange()">修改</button>
- </span>
- </div>
- <span class="help-block"> 每隔多久登录才会加积分(单位分钟) </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label class="col-md-3 control-label">积分范围</label>
- <div class="col-md-9">
- <div class="input-group input-large input-daterange">
- <input type="text" class="form-control" name="min_rand_score" value="{{$min_rand_score}}" id="min_rand_score">
- <span class="input-group-addon"> ~ </span>
- <input type="text" class="form-control" name="max_rand_score" value="{{$max_rand_score}}" id="max_rand_score">
- </div>
- </div>
- </div>
- <div class="col-md-6">
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="tab-pane" id="tab_4">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-6">
- <label for="referral_status" class="col-md-3 control-label">本功能</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($referral_status) checked @endif id="referral_status" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 关闭后用户不可见 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="referral_traffic" class="col-md-3 control-label">注册送流量</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="referral_gift_traffic" value="{{$referral_traffic}}" id="referral_traffic" />
- <span class="input-group-addon">MiB</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setReferralTraffic()">修改</button>
- </span>
- </div>
- <span class="help-block"> 根据推广链接注册则送多少流量(叠加在默认流量上) </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="referral_percent" class="col-md-3 control-label">返利比例</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="referral_percent" value="{{$referral_percent * 100}}" id="referral_percent" />
- <span class="input-group-addon">%</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setReferralPercent()">修改</button>
- </span>
- </div>
- <span class="help-block"> 根据推广链接注册的账号每笔消费推广人可以分成的比例 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="referral_money" class="col-md-3 control-label">提现限制</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="referral_money" value="{{$referral_money}}" id="referral_money" />
- <span class="input-group-addon">元</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setReferralMoney()">修改</button>
- </span>
- </div>
- <span class="help-block"> 满多少元才可以申请提现 </span>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="tab-pane" id="tab_5">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-6">
- <label for="expire_warning" class="col-md-3 control-label">用户过期警告</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($expire_warning) checked @endif id="expire_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后账号距到期还剩阈值设置的值时自动发邮件提醒用户 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="expire_days" class="col-md-3 control-label">过期警告阈值</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="expire_days" value="{{$expire_days}}" id="expire_days" />
- <span class="input-group-addon">天</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setExpireDays()">修改</button>
- </span>
- </div>
- <span class="help-block"> 账号距离过期还差多少天时发警告邮件 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="traffic_warning" class="col-md-3 control-label">用户流量警告</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($traffic_warning) checked @endif id="traffic_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后账号已使用流量超过警告阈值时自动发邮件提醒用户 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="traffic_warning_percent" class="col-md-3 control-label">流量警告阈值</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="traffic_warning_percent" value="{{$traffic_warning_percent}}" id="traffic_warning_percent" />
- <span class="input-group-addon">%</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setTrafficWarningPercent()">修改</button>
- </span>
- </div>
- <span class="help-block"> 建议设置在70%~90% </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_node_crash_warning" class="col-md-3 control-label">节点宕机提醒</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_node_crash_warning) checked @endif id="is_node_crash_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后如果节点宕机则发出提醒邮件 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="crash_warning_email" class="col-md-3 control-label">管理员收信地址</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="crash_warning_email" value="{{$crash_warning_email}}" id="crash_warning_email" placeholder="[email protected]" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setCrashWarningEmail()">修改</button>
- </span>
- </div>
- <span class="help-block"> 填写此值则节点宕机、工单回复会自动提醒 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_server_chan" class="col-md-3 control-label">ServerChan</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_server_chan) checked @endif id="is_server_chan" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 使用ServerChan推送节点宕机提醒(<a href="http://sc.ftqq.com" target="_blank">绑定微信</a>),须先启用节点宕机警告 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="server_chan_key" class="col-md-3 control-label">SCKEY</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="server_chan_key" value="{{$server_chan_key}}" id="server_chan_key" placeholder="请到ServerChan申请" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setServerChanKey()">修改</button>
- </span>
- </div>
- <span class="help-block"> 启用ServerChan,请务必填入本值(<a href="http://sc.ftqq.com" target="_blank">申请SCKEY</a>) </span>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="tab-pane" id="tab_6">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_clear_log" class="col-md-3 control-label">自动清除日志</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_clear_log) checked @endif id="is_clear_log" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> (推荐)启用后自动清除无用日志 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="reset_traffic" class="col-md-3 control-label">流量自动重置</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($reset_traffic) checked @endif id="reset_traffic" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 用户会按其购买套餐的日期自动重置可用流量 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_subscribe_ban" class="col-md-3 control-label">订阅异常自动封禁</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_subscribe_ban) checked @endif id="is_subscribe_ban" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 启用后用户订阅链接请求超过设定阈值则自动封禁 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="subscribe_ban_times" class="col-md-3 control-label">订阅请求阈值</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="subscribe_ban_times" value="{{$subscribe_ban_times}}" id="subscribe_ban_times" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setSubscribeBanTimes()">修改</button>
- </span>
- </div>
- <span class="help-block"> 24小时内订阅链接请求次数限制 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_traffic_ban" class="col-md-3 control-label">异常自动封号</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_traffic_ban) checked @endif id="is_traffic_ban" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 24小时内流量超过异常阈值则自动封号 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="traffic_ban_value" class="col-md-3 control-label">流量异常阈值</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="traffic_ban_value" value="{{$traffic_ban_value}}" id="traffic_ban_value" />
- <span class="input-group-addon">GiB</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setTrafficBanValue()">修改</button>
- </span>
- </div>
- <span class="help-block"> 24小时内超过该值,则触发自动封号 </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="traffic_ban_time" class="col-md-3 control-label">封号时长</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="traffic_ban_time" value="{{$traffic_ban_time}}" id="traffic_ban_time" />
- <span class="input-group-addon">分钟</span>
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setTrafficBanTime()">修改</button>
- </span>
- </div>
- <span class="help-block"> 触发流量异常导致用户被封禁的时长,到期后自动解封 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="auto_release_port" class="col-md-3 control-label">端口自动释放</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($auto_release_port) checked @endif id="auto_release_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 被禁用的用户端口自动释放,重新启用用户则需要手动分配端口并手动重启一次SSR(R) </span>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="tab-pane" id="tab_7">
- <form action="#" method="post" class="form-horizontal">
- <div class="portlet-body">
- <div class="form-group">
- <div class="col-md-12">
- <div class="alert alert-info" style="text-align: center;">
- 请在<a href="https://console.youzanyun.com/login" target="_blank">有赞云</a>后台设置应用的推送网址为:{{$website_url . '/api/yzy'}}
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="is_youzan" class="col-md-3 control-label">本功能</label>
- <div class="col-md-9">
- <input type="checkbox" class="make-switch" @if($is_youzan) checked @endif id="is_youzan" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
- <span class="help-block"> 请先到<a href="https://console.youzanyun.com/dashboard">有赞云</a>申请client_id和client_secret并绑定店铺 </span>
- </div>
- </div>
- <div class="col-md-6">
- <label for="kdt_id" class="col-md-3 control-label">kdt_id</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="kdt_id" value="{{$kdt_id}}" id="kdt_id" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setKdtId()">修改</button>
- </span>
- </div>
- <span class="help-block"> 即:授权店铺id </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="col-md-6">
- <label for="youzan_client_id" class="col-md-3 control-label">client_id</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="youzan_client_id" value="{{$youzan_client_id}}" id="youzan_client_id" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setYouzanClientId()">修改</button>
- </span>
- </div>
- </div>
- </div>
- <div class="col-md-6">
- <label for="youzan_client_secret" class="col-md-3 control-label">client_secret</label>
- <div class="col-md-9">
- <div class="input-group">
- <input class="form-control" type="text" name="youzan_client_secret" value="{{$youzan_client_secret}}" id="youzan_client_secret" />
- <span class="input-group-btn">
- <button class="btn btn-success" type="button" onclick="setYouzanClientSecret()">修改</button>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- END PROFILE CONTENT -->
- </div>
- </div>
- <!-- END PAGE BASE CONTENT -->
- </div>
- <!-- END CONTENT BODY -->
- @endsection
- @section('script')
- <script src="/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
- <script src="/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js" type="text/javascript"></script>
- <script src="/assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
- <script src="/js/layer/layer.js" type="text/javascript"></script>
- <script type="text/javascript">
- $('#initial_labels_for_user').select2({
- placeholder: '设置后则可见相同标签的节点',
- allowClear: true,
- width:'100%'
- }).change(function () {
- var initial_labels_for_user = $(this).val() ? $(this).val().join(',') : '';
- console.log(initial_labels_for_user);
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'initial_labels_for_user', value:initial_labels_for_user}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- });
-
- // 启用、禁用随机端口
- $('#is_rand_port').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_rand_port = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_rand_port', value:is_rand_port}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用机器人访问
- $('#is_forbid_robot').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_forbid_robot = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_forbid_robot', value:is_forbid_robot}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用自定义端口
- $('#is_user_rand_port').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_user_rand_port = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_user_rand_port', value:is_user_rand_port}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用登录加积分
- $('#login_add_score').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var login_add_score = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'login_add_score', value:login_add_score}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用注册
- $('#is_register').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_register = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_register', value:is_register}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用邀请注册
- $('#is_invite_register').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_invite_register = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_invite_register', value:is_invite_register}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用用户重置密码
- $('#is_reset_password').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_reset_password = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_reset_password', value:is_reset_password}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用验证码
- $('#is_captcha').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_captcha = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_captcha', value:is_captcha}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用免费邀请码
- $('#is_free_code').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_free_code = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_free_code', value:is_free_code}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用用户激活用户
- $('#is_active_register').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_active_register = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_active_register', value:is_active_register}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用用户到期自动邮件提醒
- $('#expire_warning').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var expire_warning = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'expire_warning', value:expire_warning}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用节点宕机发件提醒管理员
- $('#is_node_crash_warning').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_node_crash_warning = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_node_crash_warning', value:is_node_crash_warning}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用节点宕机发ServerChan微信消息提醒
- $('#is_server_chan').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_server_chan = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_server_chan', value:is_server_chan}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用订阅异常自动封禁
- $('#is_subscribe_ban').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_subscribe_ban = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_subscribe_ban', value:is_subscribe_ban}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用退关返利用户可见与否
- $('#referral_status').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var referral_status = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'referral_status', value:referral_status}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用随机端口
- $('#traffic_warning').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var traffic_warning = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_warning', value:traffic_warning}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用随机端口
- $('#is_clear_log').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_clear_log = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_clear_log', value:is_clear_log}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用流量自动重置
- $('#reset_traffic').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var reset_traffic = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'reset_traffic', value:reset_traffic}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用流量异常自动封号
- $('#is_traffic_ban').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_traffic_ban = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_traffic_ban', value:is_traffic_ban}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用端口自动释放
- $('#auto_release_port').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var auto_release_port = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'auto_release_port', value:auto_release_port}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 启用、禁用有赞云
- $('#is_youzan').on({
- 'switchChange.bootstrapSwitch': function(event, state) {
- var is_youzan = state ? 1 : 0;
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'is_youzan', value:is_youzan}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- });
- // 流量异常阈值
- function setTrafficBanValue() {
- var traffic_ban_value = $("#traffic_ban_value").val();
- if (traffic_ban_value < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_ban_value', value:traffic_ban_value}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置用户封号时长
- function setTrafficBanTime() {
- var traffic_ban_time = $("#traffic_ban_time").val();
- if (traffic_ban_time < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_ban_time', value:traffic_ban_time}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置节点宕机警告收件地址
- function setCrashWarningEmail() {
- var crash_warning_email = $("#crash_warning_email").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'crash_warning_email', value:crash_warning_email}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置ServerChan的SCKEY
- function setServerChanKey() {
- var server_chan_key = $("#server_chan_key").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'server_chan_key', value:server_chan_key}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置订阅封禁阈值
- function setSubscribeBanTimes() {
- var subscribe_ban_times = $("#subscribe_ban_times").val();
- if (subscribe_ban_times < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'subscribe_ban_times', value:subscribe_ban_times}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置有赞云的kdt_id
- function setKdtId() {
- var kdt_id = $("#kdt_id").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'kdt_id', value:kdt_id}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置有赞云的client_id
- function setYouzanClientId() {
- var youzan_client_id = $("#youzan_client_id").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'youzan_client_id', value:youzan_client_id}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置有赞云的client_secret
- function setYouzanClientSecret() {
- var youzan_client_secret = $("#youzan_client_secret").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'youzan_client_secret', value:youzan_client_secret}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置最小积分
- $("#min_rand_score").change(function () {
- var min_rand_score = $(this).val();
- var max_rand_score = $("#max_rand_score").val();
- if (parseInt(min_rand_score) < 0) {
- layer.msg('最小积分小于0', {time:1000});
- return ;
- }
- if (parseInt(min_rand_score) >= parseInt(max_rand_score)) {
- layer.msg('最小积分必须小于最大积分', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'min_rand_score', value:min_rand_score}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- });
- // 设置最大积分
- $("#max_rand_score").change(function () {
- var min_rand_score = $("#min_rand_score").val();
- var max_rand_score = $(this).val();
- if (parseInt(max_rand_score) > 99999) {
- layer.msg('最大积分不能大于99999', {time:1000});
- return ;
- }
- if (parseInt(min_rand_score) >= parseInt(max_rand_score)) {
- layer.msg('最大积分必须大于最小积分', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'max_rand_score', value:max_rand_score}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- });
- // 设置最小端口
- $("#min_port").change(function () {
- var min_port = $(this).val();
- if (parseInt(min_port) < 1000) {
- layer.msg('最小端口不能小于1000', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'min_port', value:min_port}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- });
- // 设置最大端口
- $("#max_port").change(function () {
- var min_port = $("#min_port").val();
- var max_port = $(this).val();
- // 最大端口必须大于最小端口
- if (parseInt(max_port) <= parseInt(min_port)) {
- layer.msg('必须大于最小端口', {time:1000});
- return ;
- }
- if (parseInt(max_port) > 65535) {
- layer.msg('最大端口不能大于65535', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'max_port', value:max_port}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- });
- // 设置注册时默认有效期
- function setDefaultDays() {
- var default_days = parseInt($("#default_days").val());
- if (default_days < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'default_days', value:default_days}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置注册时默认流量
- function setDefaultTraffic() {
- var default_traffic = parseInt($("#default_traffic").val());
- if (default_traffic < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'default_traffic', value:default_traffic}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置可生成邀请码数量
- function setInviteNum() {
- var invite_num = parseInt($("#invite_num").val());
- if (invite_num < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'invite_num', value:invite_num}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置重置密码次数
- function setResetPasswordTimes() {
- var reset_password_times = $("#reset_password_times").val();
- if (reset_password_times < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'reset_password_times', value:reset_password_times}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置激活用户次数
- function setActiveTimes() {
- var active_times = parseInt($("#active_times").val());
- if (active_times < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'active_times', value:active_times}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置节点订阅地址
- function setSubscribeDomain() {
- var subscribe_domain = $("#subscribe_domain").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'subscribe_domain', value:subscribe_domain}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置节点订阅随机展示节点数
- function setSubscribeMax() {
- var subscribe_max = parseInt($("#subscribe_max").val());
- if (subscribe_max < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'subscribe_max', value:subscribe_max}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置流量警告阈值
- function setTrafficWarningPercent() {
- var traffic_warning_percent = $("#traffic_warning_percent").val();
- if (traffic_warning_percent < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'traffic_warning_percent', value:traffic_warning_percent}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置用户过期提醒阈值
- function setExpireDays() {
- var expire_days = parseInt($("#expire_days").val());
- if (expire_days < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'expire_days', value:expire_days}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置网站名称
- function setWebsiteName() {
- var website_name = $("#website_name").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'website_name', value:website_name}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置网站地址
- function setWebsiteUrl() {
- var website_url = $("#website_url").val();
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'website_url', value:website_url}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 登录加积分的时间间隔
- function setLoginAddScoreRange() {
- var login_add_score_range = parseInt($("#login_add_score_range").val());
- if (login_add_score_range < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'login_add_score_range', value:login_add_score_range}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置根据推广链接注册送流量
- function setReferralTraffic() {
- var referral_traffic = parseInt($("#referral_traffic").val());
- if (referral_traffic < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'referral_traffic', value:referral_traffic}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置根据推广链接注册人每产生一笔消费,则推广人可以获得的返利比例
- function setReferralPercent() {
- var referral_percent = $("#referral_percent").val();
- if (referral_percent < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setReferralPercent')}}", {_token:'{{csrf_token()}}', value:referral_percent}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- // 设置返利满多少元才可以提现
- function setReferralMoney() {
- var referral_money = $("#referral_money").val();
- if (referral_money < 0) {
- layer.msg('不能小于0', {time:1000});
- return ;
- }
- $.post("{{url('admin/setConfig')}}", {_token:'{{csrf_token()}}', name:'referral_money', value:referral_money}, function (ret) {
- layer.msg(ret.message, {time:1000}, function() {
- if (ret.status == 'fail') {
- window.location.reload();
- }
- });
- });
- }
- </script>
- @endsection
|