mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: email notice default off
This commit is contained in:
parent
7a4bd468a2
commit
6ab9a4d54d
@ -3,7 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin\Server;
|
||||
|
||||
use App\Models\Plan;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\ServerGroup;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
@ -50,7 +50,7 @@ class GroupController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$servers = Server::all();
|
||||
$servers = ServerV2ray::all();
|
||||
foreach ($servers as $server) {
|
||||
if (in_array($request->input('id'), $server->group_id)) {
|
||||
abort(500, '该组已被节点所使用,无法删除');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Server;
|
||||
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\ServerShadowsocks;
|
||||
use App\Models\ServerTrojan;
|
||||
use App\Services\ServerService;
|
||||
@ -32,7 +32,7 @@ class ManageController extends Controller
|
||||
}
|
||||
break;
|
||||
case 'v2ray':
|
||||
if (!Server::find($v['value'])->update(['sort' => $k + 1])) {
|
||||
if (!ServerV2ray::find($v['value'])->update(['sort' => $k + 1])) {
|
||||
DB::rollBack();
|
||||
abort(500, '保存失败');
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use App\Http\Requests\Admin\ServerV2rayUpdate;
|
||||
use App\Services\ServerService;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
|
||||
class V2rayController extends Controller
|
||||
{
|
||||
@ -16,7 +16,7 @@ class V2rayController extends Controller
|
||||
$params = $request->validated();
|
||||
|
||||
if ($request->input('id')) {
|
||||
$server = Server::find($request->input('id'));
|
||||
$server = ServerV2ray::find($request->input('id'));
|
||||
if (!$server) {
|
||||
abort(500, '服务器不存在');
|
||||
}
|
||||
@ -30,7 +30,7 @@ class V2rayController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
if (!Server::create($params)) {
|
||||
if (!ServerV2ray::create($params)) {
|
||||
abort(500, '创建失败');
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class V2rayController extends Controller
|
||||
public function drop(Request $request)
|
||||
{
|
||||
if ($request->input('id')) {
|
||||
$server = Server::find($request->input('id'));
|
||||
$server = ServerV2ray::find($request->input('id'));
|
||||
if (!$server) {
|
||||
abort(500, '节点ID不存在');
|
||||
}
|
||||
@ -58,7 +58,7 @@ class V2rayController extends Controller
|
||||
'show',
|
||||
]);
|
||||
|
||||
$server = Server::find($request->input('id'));
|
||||
$server = ServerV2ray::find($request->input('id'));
|
||||
|
||||
if (!$server) {
|
||||
abort(500, '该服务器不存在');
|
||||
@ -76,12 +76,12 @@ class V2rayController extends Controller
|
||||
|
||||
public function copy(Request $request)
|
||||
{
|
||||
$server = Server::find($request->input('id'));
|
||||
$server = ServerV2ray::find($request->input('id'));
|
||||
$server->show = 0;
|
||||
if (!$server) {
|
||||
abort(500, '服务器不存在');
|
||||
}
|
||||
if (!Server::create($server->toArray())) {
|
||||
if (!ServerV2ray::create($server->toArray())) {
|
||||
abort(500, '复制失败');
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ use App\Services\ServerService;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ServerGroup;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\Plan;
|
||||
use App\Models\User;
|
||||
use App\Models\Ticket;
|
||||
@ -91,11 +91,11 @@ class StatController extends Controller
|
||||
{
|
||||
$servers = [
|
||||
'shadowsocks' => ServerShadowsocks::where('parent_id', null)->get()->toArray(),
|
||||
'vmess' => Server::where('parent_id', null)->get()->toArray(),
|
||||
'vmess' => ServerV2ray::where('parent_id', null)->get()->toArray(),
|
||||
'trojan' => ServerTrojan::where('parent_id', null)->get()->toArray()
|
||||
];
|
||||
$timestamp = strtotime('-1 day', strtotime(date('Y-m-d')));
|
||||
$statistics = StatServer::select([
|
||||
$statistics = StatServerV2ray::select([
|
||||
'server_id',
|
||||
'server_type',
|
||||
'u',
|
||||
|
@ -7,7 +7,7 @@ use App\Services\ServerService;
|
||||
use App\Services\UserService;
|
||||
use App\Utils\Clash;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
|
@ -8,7 +8,7 @@ use App\Utils\CacheKey;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\ServerLog;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@ -35,7 +35,7 @@ class DeepbworkController extends Controller
|
||||
public function user(Request $request)
|
||||
{
|
||||
$nodeId = $request->input('node_id');
|
||||
$server = Server::find($nodeId);
|
||||
$server = ServerV2ray::find($nodeId);
|
||||
if (!$server) {
|
||||
abort(500, 'fail');
|
||||
}
|
||||
@ -64,7 +64,7 @@ class DeepbworkController extends Controller
|
||||
public function submit(Request $request)
|
||||
{
|
||||
// Log::info('serverSubmitData:' . $request->input('node_id') . ':' . file_get_contents('php://input'));
|
||||
$server = Server::find($request->input('node_id'));
|
||||
$server = ServerV2ray::find($request->input('node_id'));
|
||||
if (!$server) {
|
||||
return response([
|
||||
'ret' => 0,
|
||||
|
@ -8,7 +8,7 @@ use App\Services\UserService;
|
||||
use App\Utils\CacheKey;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\ServerLog;
|
||||
use App\Models\User;
|
||||
|
||||
|
@ -10,7 +10,7 @@ use App\Utils\CacheKey;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\User;
|
||||
use App\Models\Plan;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\Ticket;
|
||||
use App\Utils\Helper;
|
||||
use App\Models\Order;
|
||||
|
@ -36,7 +36,7 @@ class StatServerJob implements ShouldQueue
|
||||
public function handle()
|
||||
{
|
||||
$statistic = $this->statistic;
|
||||
$data = StatServer::where('record_at', $statistic['record_at'])
|
||||
$data = StatServerV2ray::where('record_at', $statistic['record_at'])
|
||||
->where('server_id', $statistic['server_id'])
|
||||
->first();
|
||||
if ($data) {
|
||||
@ -46,7 +46,7 @@ class StatServerJob implements ShouldQueue
|
||||
abort(500, '节点统计数据更新失败');
|
||||
}
|
||||
} else {
|
||||
if (!StatServer::create($statistic)) {
|
||||
if (!StatServerV2ray::create($statistic)) {
|
||||
abort(500, '节点统计数据创建失败');
|
||||
}
|
||||
}
|
||||
|
@ -4,9 +4,9 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Server extends Model
|
||||
class ServerV2ray extends Model
|
||||
{
|
||||
protected $table = 'v2_server';
|
||||
protected $table = 'v2_server_v2ray';
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = ['id'];
|
||||
protected $casts = [
|
@ -5,7 +5,7 @@ namespace App\Services;
|
||||
use App\Models\ServerLog;
|
||||
use App\Models\ServerShadowsocks;
|
||||
use App\Models\User;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\ServerTrojan;
|
||||
use App\Utils\CacheKey;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
@ -18,7 +18,7 @@ class ServerService
|
||||
public function getV2ray(User $user, $all = false):array
|
||||
{
|
||||
$servers = [];
|
||||
$model = Server::orderBy('sort', 'ASC');
|
||||
$model = ServerV2ray::orderBy('sort', 'ASC');
|
||||
if (!$all) {
|
||||
$model->where('show', 1);
|
||||
}
|
||||
@ -123,7 +123,7 @@ class ServerService
|
||||
|
||||
public function getV2RayConfig(int $nodeId, int $localPort)
|
||||
{
|
||||
$server = Server::find($nodeId);
|
||||
$server = ServerV2ray::find($nodeId);
|
||||
if (!$server) {
|
||||
abort(500, '节点不存在');
|
||||
}
|
||||
@ -301,7 +301,7 @@ class ServerService
|
||||
|
||||
public function getV2rayServers()
|
||||
{
|
||||
$server = Server::orderBy('sort', 'ASC')->get();
|
||||
$server = ServerV2ray::orderBy('sort', 'ASC')->get();
|
||||
for ($i = 0; $i < count($server); $i++) {
|
||||
$server[$i]['type'] = 'v2ray';
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use App\Jobs\ServerLogJob;
|
||||
use App\Jobs\TrafficFetchJob;
|
||||
use App\Models\InviteCode;
|
||||
use App\Models\Order;
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Utils;
|
||||
|
||||
use App\Models\Server;
|
||||
use App\Models\ServerV2ray;
|
||||
use App\Models\ServerShadowsocks;
|
||||
use App\Models\ServerTrojan;
|
||||
use App\Models\User;
|
||||
|
@ -172,34 +172,6 @@ CREATE TABLE `v2_plan` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `v2_server`;
|
||||
CREATE TABLE `v2_server` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` varchar(255) NOT NULL,
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`parent_id` int(11) DEFAULT NULL,
|
||||
`host` varchar(255) NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
`server_port` int(11) NOT NULL,
|
||||
`tls` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`tags` varchar(255) DEFAULT NULL,
|
||||
`rate` varchar(11) NOT NULL,
|
||||
`network` text NOT NULL,
|
||||
`alter_id` int(11) NOT NULL DEFAULT '1',
|
||||
`settings` text,
|
||||
`rules` text,
|
||||
`networkSettings` text,
|
||||
`tlsSettings` text,
|
||||
`ruleSettings` text,
|
||||
`dnsSettings` text,
|
||||
`show` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`sort` int(11) DEFAULT NULL,
|
||||
`created_at` int(11) NOT NULL,
|
||||
`updated_at` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `v2_server_group`;
|
||||
CREATE TABLE `v2_server_group` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
@ -270,6 +242,34 @@ CREATE TABLE `v2_server_trojan` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='trojan伺服器表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `v2_server_v2ray`;
|
||||
CREATE TABLE `v2_server_v2ray` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` varchar(255) NOT NULL,
|
||||
`name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
|
||||
`parent_id` int(11) DEFAULT NULL,
|
||||
`host` varchar(255) NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
`server_port` int(11) NOT NULL,
|
||||
`tls` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`tags` varchar(255) DEFAULT NULL,
|
||||
`rate` varchar(11) NOT NULL,
|
||||
`network` text NOT NULL,
|
||||
`alter_id` int(11) NOT NULL DEFAULT '1',
|
||||
`settings` text,
|
||||
`rules` text,
|
||||
`networkSettings` text,
|
||||
`tlsSettings` text,
|
||||
`ruleSettings` text,
|
||||
`dnsSettings` text,
|
||||
`show` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`sort` int(11) DEFAULT NULL,
|
||||
`created_at` int(11) NOT NULL,
|
||||
`updated_at` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `v2_stat_order`;
|
||||
CREATE TABLE `v2_stat_order` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
@ -356,8 +356,8 @@ CREATE TABLE `v2_user` (
|
||||
`uuid` varchar(36) NOT NULL,
|
||||
`group_id` int(11) DEFAULT NULL,
|
||||
`plan_id` int(11) DEFAULT NULL,
|
||||
`remind_expire` tinyint(4) DEFAULT '1',
|
||||
`remind_traffic` tinyint(4) DEFAULT '1',
|
||||
`remind_expire` tinyint(4) DEFAULT '0',
|
||||
`remind_traffic` tinyint(4) DEFAULT '0',
|
||||
`token` char(32) NOT NULL,
|
||||
`remarks` text,
|
||||
`expired_at` bigint(20) DEFAULT '0',
|
||||
@ -368,4 +368,4 @@ CREATE TABLE `v2_user` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- 2021-09-20 15:35:06
|
||||
-- 2021-09-21 10:07:22
|
||||
|
@ -455,3 +455,10 @@ CREATE TABLE `v2_commission_log` (
|
||||
|
||||
ALTER TABLE `v2_plan`
|
||||
ADD `reset_traffic_method` tinyint(1) NULL AFTER `reset_price`;
|
||||
|
||||
ALTER TABLE `v2_server`
|
||||
RENAME TO `v2_server_v2ray`;
|
||||
|
||||
ALTER TABLE `v2_user`
|
||||
CHANGE `remind_expire` `remind_expire` tinyint(4) NULL DEFAULT '0' AFTER `plan_id`,
|
||||
CHANGE `remind_traffic` `remind_traffic` tinyint(4) NULL DEFAULT '0' AFTER `remind_expire`;
|
||||
|
Loading…
Reference in New Issue
Block a user