123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- @extends('admin.layouts')
- @section('css')
- <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
- @endsection
- @section('content')
- <div class="page-content container-fluid">
- <div class="panel">
- <div class="panel-heading">
- <h2 class="panel-title">节点授权列表<small>WEBAPI</small></h2>
- @can('admin.node.auth.store')
- <div class="panel-actions">
- <!--<button class="btn btn-primary" onclick="addAuth()">-->
- <!-- <i class="icon wb-plus" aria-hidden="true"></i>生成授权-->
- <!--</button>-->
- </div>
- @endcan
- </div>
- <div class="panel-body">
- <div class="form-row">
- <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
- <input type="text" class="form-control" id="node" name="node" value="{{Request::input('node')}}" placeholder="节点"/>
- </div>
- <div class="form-group col-xxl-2 col-lg-3 col-md-3 col-sm-4">
- <input type="text" class="form-control" id="serverip" name="serverip" value="{{Request::input('serverip')}}" placeholder="IP"/>
- </div>
- <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4">
- <select class="form-control" id="status" name="status">
- <option value="">全部</option>
- <option value="1">正常</option>
- <option value="0">维护</option>
- </select>
- </div>
- <div class="form-group col-xxl-1 col-lg-3 col-md-3 col-4 btn-group">
- <button class="btn btn-primary" onclick="Search()">搜 索</button>
- <a href="{{route('admin.node.index')}}" class="btn btn-danger">{{trans('common.reset')}}</a>
- </div>
- </div>
- <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
- <thead class="thead-default">
- <tr>
- <th> 节点ID</th>
- <th> 节点类型</th>
- <th> 节点名称</th>
- <th> 节点域名</th>
- <th> IPv4</th>
- <th> 通信密钥<small>节点用</small></th>
- <th> 反向通信密钥</th>
- <th> {{trans('common.action')}}</th>
- </tr>
- </thead>
- <tbody>
- @foreach ($authorizations as $auth)
- <tr>
- <td> {{$auth->node_id}} </td>
- <td> {{$auth->node->type_label}} </td>
- <td> {{Str::limit($auth->node->name, 20) ?? '【节点已删除】'}} </td>
- <td> {{$auth->node->server ?? '【节点已删除】'}} </td>
- <td> {{$auth->node->ip ?? '【节点已删除】'}} </td>
- <td><span class="badge badge-lg badge-info"> {{$auth->key}} </span></td>
- <td><span class="badge badge-lg badge-info"> {{$auth->secret}} </span></td>
- <td>
- <div class="btn-group">
- <button data-target="#install_{{$auth->node->type}}_{{$auth->id}}" data-toggle="modal" class="btn btn-primary">
- <i class="icon wb-code" aria-hidden="true"></i>部署后端
- </button>
- @can('admin.node.auth.update')
- <button onclick="refreshAuth('{{$auth->id}}')" class="btn btn-danger">
- <i class="icon wb-reload" aria-hidden="true"></i> 重置密钥
- </button>
- @endcan
- @can('admin.node.auth.destroy')
- <button onclick="deleteAuth('{{$auth->id}}')" class="btn btn-primary">
- <i class="icon wb-trash" aria-hidden="true"></i> 删除
- </button>
- @endcan
- </div>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
- <div class="panel-footer">
- <div class="row">
- <div class="col-sm-4">
- 共 <code>{{$authorizations->total()}}</code> 条授权
- </div>
- <div class="col-sm-8">
- <nav class="Page navigation float-right">
- {{$authorizations->links()}}
- </nav>
- </div>
- </div>
- </div>
- </div>
- </div>
- @foreach($authorizations as $auth)
- <div id="install_{{$auth->node->type}}_{{$auth->id}}" class="modal fade" tabindex="-1" data-focus-on="input:first" data-keyboard="false">
- <div class="modal-dialog modal-simple modal-center modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title">
- 部署 {{$auth->node->type_label}} 后端
- </h4>
- </div>
- <div class="modal-body">
- @if($auth->node->type === 0)
- <div class="alert alert-info text-break">
- <div class="text-center red-700 mb-5">Shadowsocks</div>
- (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
- && curl -L -s http://user.naiyout.buzz/xrayr.sh \<br>
- | WEB_API="http://apitx.naiyout.buzz" \<br>
- NODE_ID={{$auth->node->id}} \<br>
- NODE_KEY={{$auth->key}} \<br>
- NODE_TYPE=Shadowsocks \<br>
- bash
- <br>
- <br>
- <div class="text-center red-700 mb-5">操作命令</div>
- 更新:同上
- <br>
- 卸载:curl -L -s https://bit.ly/3828OP1 | bash -s -- --remove
- <br>
- 启动:systemctl start XrayR
- <br>
- 停止:systemctl stop XrayR
- <br>
- 重启:systemctl restart XrayR
- <br>
- 状态:systemctl status XrayR
- <br>
- 近期日志:journalctl -x -n 300 --no-pager -u XrayR
- <br>
- 实时日志:journalctl -u XrayR -f
- </div>
- @elseif($auth->node->type === 2)
- <div class="alert alert-info text-break">
- <div class="text-center red-700 mb-5">V2Ray</div>
- (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
- && curl -L -s http://apitx.naiyout.buzz/xrayr.sh \<br>
- | WEB_API="http://apitx.naiyout.buzz" \<br>
- NODE_ID={{$auth->node->id}} \<br>
- NODE_KEY={{$auth->key}} \<br>
- NODE_TYPE=V2ray \<br>
- bash
- <br>
- <br>
- <div class="text-center red-700 mb-5">操作命令</div>
- 更新:同上
- <br>
- 卸载:curl -L -s https://bit.ly/3oO3HZy | bash -s -- --remove
- <br>
- 启动:systemctl start vnet-v2ray
- <br>
- 停止:systemctl stop vnet-v2ray
- <br>
- 状态:systemctl status vnet-v2ray
- <br>
- 近期日志:journalctl -x -n 300 --no-pager -u vnet-v2ray
- <br>
- 实时日志:journalctl -u vnet-v2ray -f
- </div>
- {{-- <div class="alert alert-info text-break">--}}
- {{-- <div class="text-center red-700 mb-5">VNET-V2Ray</div>--}}
- {{-- (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>--}}
- {{-- && curl -L -s https://bit.ly/3oO3HZy \<br>--}}
- {{-- | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>--}}
- {{-- NODE_ID={{$auth->node->id}} \<br>--}}
- {{-- NODE_KEY={{$auth->key}} \<br>--}}
- {{-- bash--}}
- {{-- <br>--}}
- {{-- <br>--}}
- {{-- <div class="text-center red-700 mb-5">操作命令</div>--}}
- {{-- 更新:同上--}}
- {{-- <br>--}}
- {{-- 卸载:curl -L -s https://bit.ly/3oO3HZy | bash -s -- --remove--}}
- {{-- <br>--}}
- {{-- 启动:systemctl start vnet-v2ray--}}
- {{-- <br>--}}
- {{-- 停止:systemctl stop vnet-v2ray--}}
- {{-- <br>--}}
- {{-- 状态:systemctl status vnet-v2ray--}}
- {{-- <br>--}}
- {{-- 近期日志:journalctl -x -n 300 --no-pager -u vnet-v2ray--}}
- {{-- <br>--}}
- {{-- 实时日志:journalctl -u vnet-v2ray -f--}}
- {{-- </div>--}}
- <div class="alert alert-info text-break">
- <div class="text-center red-700 mb-5">V2Ray-Poseidon</div>
- (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
- && curl -L -s https://bit.ly/2HswWko \<br>
- | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>
- NODE_ID={{$auth->node->id}} \<br>
- NODE_KEY={{$auth->key}} \<br>
- bash
- <br>
- <br>
- <div class="text-center red-700 mb-5">操作命令</div>
- 更新:curl -L -s https://bit.ly/2HswWko | bash
- <br>
- 卸载:curl -L -s http://mrw.so/5IHPR4 | bash
- <br>
- 启动:systemctl start v2ray
- <br>
- 停止:systemctl stop v2ray
- <br>
- 状态:systemctl status v2ray
- <br>
- 近期日志:journalctl -x -n 300 --no-pager -u v2ray
- <br>
- 实时日志:journalctl -u v2ray -f
- </div>
- @elseif($auth->node->type === 3)
- @if(!$auth->node->server)
- <h3>请先<a href="{{route('admin.node.edit', $auth->node)}}" target="_blank">填写节点域名</a>并将域名解析到节点对应的IP上
- </h3>
- @else
- <div class="alert alert-info text-break">
- <div class="text-center red-700 mb-5">Trojan-Poseidon</div>
- (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
- && curl -L -s http://mrw.so/6cMfGy \<br>
- | WEB_API="{{sysConfig('web_api_url') ?: sysConfig('website_url')}}" \<br>
- NODE_ID={{$auth->node->id}} \<br>
- NODE_KEY={{$auth->key}} \<br>
- NODE_HOST={{$auth->node->server}} \<br>
- bash
- <br>
- <br>
- <div class="text-center red-700 mb-5">操作命令</div>
- 更新:curl -L -s http://mrw.so/6cMfGy | bash
- <br>
- 卸载:curl -L -s http://mrw.so/5ulpvu | bash
- <br>
- 启动:systemctl start trojanp
- <br>
- 停止:systemctl stop trojanp
- <br>
- 状态:systemctl status trojanp
- <br>
- 近期日志:journalctl -x -n 300 --no-pager -u trojanp
- <br>
- 实时日志:journalctl -u trojanp -f
- </div>
- @endif
- @else
- <div class="alert alert-info text-break">
- <div class="text-center red-700 mb-5">VNET</div>
- (yum install curl 2> /dev/null || apt install curl 2> /dev/null) \<br>
- && curl -L -s http://apitx.naiyout.buzz/vnet.sh \<br>
- | WEB_API="http://apitx.naiyout.buzz" \<br>
- NODE_ID={{$auth->node->id}} \<br>
- NODE_KEY={{$auth->key}} \<br>
- bash
- <br>
- <br>
- <div class="text-center red-700 mb-5">操作命令</div>
- 更新:同上
- <br>
- 卸载:curl -L -s https://bit.ly/3828OP1 | bash -s -- --remove
- <br>
- 启动:systemctl start vnet
- <br>
- 停止:systemctl stop vnet
- <br>
- 重启:systemctl restart vnet
- <br>
- 状态:systemctl status vnet
- <br>
- 近期日志:journalctl -x -n 300 --no-pager -u vnet
- <br>
- 实时日志:journalctl -u vnet -f
- </div>
- @endif
- </div>
- </div>
- </div>
- </div>
- @endforeach
- @endsection
- @section('javascript')
- <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js"></script>
- <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
- <script>
- function Search() {
- window.location.href = '{{route('admin.node.auth.index')}}' + '?status=' + $('#status option:selected').val() + '&node=' + $('#node').val() + '&serverip=' + $('#serverip').val();
- }
- // 生成授权KEY
- @can('admin.node.auth.store')
- function addAuth() {
- swal.fire({
- title: '提示',
- text: '确定生成所有节点的授权吗?',
- icon: 'info',
- showCancelButton: true,
- cancelButtonText: '{{trans('common.close')}}',
- confirmButtonText: '{{trans('common.confirm')}}',
- }).then((result) => {
- if (result.value) {
- $.post('{{route('admin.node.auth.store')}}', {_token: '{{csrf_token()}}'}, function(ret) {
- if (ret.status === 'success') {
- swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
- } else {
- swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
- }
- });
- }
- });
- }
- @endcan
- @can('admin.node.auth.destroy')
- // 删除授权
- function deleteAuth(id) {
- swal.fire({
- title: '提示',
- text: '确定删除该授权吗?',
- icon: 'info',
- showCancelButton: true,
- cancelButtonText: '{{trans('common.close')}}',
- confirmButtonText: '{{trans('common.confirm')}}',
- }).then((result) => {
- if (result.value) {
- $.ajax({
- method: 'DELETE',
- url: '{{route('admin.node.auth.destroy', '')}}/' + id,
- data: {_token: '{{csrf_token()}}'},
- dataType: 'json',
- success: function(ret) {
- if (ret.status === 'success') {
- swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
- } else {
- swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
- }
- },
- });
- }
- });
- }
- @endcan
- @can('admin.node.auth.update')
- // 重置授权认证KEY
- function refreshAuth(id) {
- swal.fire({
- title: '提示',
- text: '确定继续操作吗?',
- icon: 'info',
- showCancelButton: true,
- cancelButtonText: '{{trans('common.close')}}',
- confirmButtonText: '{{trans('common.confirm')}}',
- }).then((result) => {
- if (result.value) {
- $.ajax({
- method: 'PUT',
- url: '{{route('admin.node.auth.update', '')}}/' + id,
- data: {_token: '{{csrf_token()}}'},
- dataType: 'json',
- success: function(ret) {
- if (ret.status === 'success') {
- swal.fire({title: ret.message, icon: 'success', timer: 1000, showConfirmButton: false}).then(() => window.location.reload());
- } else {
- swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
- }
- },
- });
- }
- });
- }
- @endcan
- </script>
- @endsection
|