mirror of
https://github.com/barkeser2002/pterodactyl-addons.git
synced 2026-09-25 02:19:54 +03:00
422 lines
104 KiB
JSON
Executable File
422 lines
104 KiB
JSON
Executable File
{
|
|
"./app/Http/Controllers/Admin/Bagou/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Admin/Bagou/BagouCenterController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Admin\\Bagou;\n\nuse Illuminate\\View\\View;\nuse Prologue\\Alerts\\AlertsMessageBag;\nuse Pterodactyl\\Http\\Controllers\\Controller;\nuse Illuminate\\Support\\Facades\\Http;\n\nclass BagouCenterController extends Controller\n{\n protected $alert;\n\n public function __construct(\n AlertsMessageBag $alert\n ) {\n $this->alert = $alert;\n }\n /**\n * Display licensing system\n */\n public function index(): View\n {\n $apistatus = Http::get('https://api.bagou450.com/api/client/pterodactyl/checkOnline')->object();\n $cdnstatus = Http::get('https://cdn.bagou450.com/status')->object();\n\n return view('admin.bagoucenter.index', ['apistatus' => $apistatus, 'cdnstatus' => $cdnstatus]);\n }\n public function settings(): View\n {\n return view('admin.bagoucenter.support.index');\n }\n}\n"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Admin/Bagou/BagouLicenseController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Admin\\Bagou;\n\nuse Illuminate\\View\\View;\nuse Pterodactyl\\Models\\Bagoulicense;\nuse Illuminate\\Http\\RedirectResponse;\nuse Prologue\\Alerts\\AlertsMessageBag;\nuse Pterodactyl\\Http\\Controllers\\Controller;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Http;\n\nclass BagouLicenseController extends Controller\n{\n protected $alert;\n\n public function __construct(\n AlertsMessageBag $alert\n ) {\n $this->alert = $alert;\n }\n /**\n * Display licensing system\n */\n public function index(): View\n {\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $licenses = Bagoulicense::all();\n return view('admin.bagoucenter.license.index', ['addonslist' => $addonslist, 'licenses' => $licenses]);\n }\n\n /**\n * Display license of the addon\n *\n * @throws \\Pterodactyl\\Exceptions\\Repository\\RecordNotFoundException\n */\n public function license(string $addon): View\n {\n $dbaddon = Bagoulicense::where('addon', $addon)->first();\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $licenses = Bagoulicense::all();\n return view('admin.bagoucenter.license.license', [\n 'addon' => $addon,\n 'enabled' => ($dbaddon)? $dbaddon['enabled'] : 0,\n 'usage' => ($dbaddon) ? $dbaddon['usage'] : null ,\n 'maxusage' => ($dbaddon) ? $dbaddon['maxusage'] : null,\n 'license' => ($dbaddon) ? $dbaddon['license']: 'Your license',\n 'addonslist' => $addonslist,\n 'licenses' => $licenses\n ]);\n }\n\n /**\n * Set a license\n *\n * @throws \\Throwable\n */\n public function setlicense(Request $request, $addon): RedirectResponse\n { \n $license = Http::accept('application/json')->post(\"https://api.bagou450.com/api/client/pterodactyl/license\", [\n 'id' => $request->license,\n 'selectaddon' => $addon\n ])->object();\n if($license->message == 'Transaction is not valid.') {\n $this->alert->danger('License not found please contact me on discord')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon);\n } else if($license->message == 'Too many license usage please contact me on discord') {\n $this->alert->danger('License are already used on too many panel please contact me on discord')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon);\n } else if ($license->message == 'User blacklisted') {\n if(Bagoulicense::where('addon', $addon)->exists()) {\n\n Bagoulicense::where('addon', $addon)->update(['license' => $request->license, 'usage' => 1, 'maxusage' => 1, 'enabled' => false]);\n } else {\n Bagoulicense::create(['addon' => $addon, 'license' => $request->license, 'usage' => 1, 'maxusage' => 1, 'enabled' => false]);\n }\n $this->alert->danger('You are BLACKLISTED (probably because of a paypal dispute)')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon);\n } else if($license->message == 'Not the good addon') {\n $this->alert->danger('This license is not for this addon!')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon, );\n } else if($license->message == 'done' && $license->name == $addon && !$license->blacklisted) {\n if(Bagoulicense::where('addon', $addon)->exists()) {\n\n Bagoulicense::where('addon', $addon)->update(['license' => $request->license, 'usage' => $license->usage, 'maxusage' => $license->maxusage, 'enabled' => true]);\n } else {\n Bagoulicense::create(['addon' => $addon, 'license' => $request->license, 'usage' => $license->usage, 'maxusage' => $license->maxusage, 'enabled' => true]);\n }\n \n $this->alert->success('License updated sucessfully!')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon);\n }\n $this->alert->danger('Error!')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon);\n }\n\n /**\n * Rmove a license\n *\n * @throws \\Throwable\n */\n public function removelicense($addon): RedirectResponse\n { \n if(Bagoulicense::where('addon', $addon)->exists()) {\n $transaction = Bagoulicense::where('addon', $addon)->first();\n if(!$transaction) {\n $this->alert->danger('No license found.')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon);\n }\n $transaction = $transaction['license'];\n $license = Http::delete(\"https://api.bagou450.com/api/client/pterodactyl/license?id=$transaction\")->object();\n Bagoulicense::where('addon', $addon)->delete();\n $this->alert->success('License removed sucessfully')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon); \n } else {\n $this->alert->danger('No license found.')->flash();\n return redirect()->route('admin.bagoucenter.license.addon', $addon); \n }\n\n }\n}\n"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Admin/Bagou/BagouSettingsController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Admin\\Bagou;\n\nuse Illuminate\\View\\View;\nuse Pterodactyl\\Models\\Bagoulicense;\nuse Prologue\\Alerts\\AlertsMessageBag;\nuse Pterodactyl\\Http\\Controllers\\Controller;\nuse Illuminate\\Support\\Facades\\Http;\n\nclass BagouSettingsController extends Controller\n{\n protected $alert;\n\n public function __construct(\n AlertsMessageBag $alert\n ) {\n $this->alert = $alert;\n }\n /**\n * Display licensing system\n */\n public function index(): View\n {\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $licenses = Bagoulicense::all();\n return view('admin.bagoucenter.settings.index', [ 'addonslist' => $addonslist,\n 'licenses' => $licenses]);\n }\n\n /**\n * Display licensing system\n */\n public function addon(string $addon): View\n {\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $licenses = Bagoulicense::all();\n return view($addon['tabroute'], ['addonslist' => $addonslist,\n 'licenses' => $licenses]);\n }\n}\n"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Admin/Bagou/BagouVersionsController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Admin\\Bagou;\n\nuse Illuminate\\View\\View;\nuse Pterodactyl\\Models\\Bagoulicense;\nuse Prologue\\Alerts\\AlertsMessageBag;\nuse Pterodactyl\\Http\\Controllers\\Controller;\nuse Illuminate\\Support\\Facades\\Http;\n\nclass BagouVersionsController extends Controller\n{\n protected AlertsMessageBag $alert;\n\n public function __construct(\n AlertsMessageBag $alert\n ) {\n $this->alert = $alert;\n }\n /**\n * Display licensing system\n */\n public function index(): View\n {\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $licenses = Bagoulicense::all();\n return view('admin.bagoucenter.versions.index', ['addonslist' => $addonslist, 'licenses' => $licenses]);\n }\n /**\n * Refresh Versions\n */\n public function refresh(): View\n {\n $licenses = Bagoulicense::all();\n foreach($licenses as $license) {\n $id = $license['license'];\n $version = Http::get(\"https://api.bagou450.com/api/client/pterodactyl/getVersion?id=$id\");\n if($version->failed()) {\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $this->alert->danger('Error!')->flash();\n return view('admin.bagoucenter.versions.index', ['addonslist' => $addonslist, 'licenses' => $licenses]);\n } else {\n Bagoulicense::where('license', '=', $id)->update(['version' => $version->json()['version']]);\n }\n }\n $addonslist = Http::get('https://api.bagou450.com/api/client/pterodactyl/addonsList')->json();\n $licenses = Bagoulicense::all();\n\n $this->alert->success('Versions updated sucessfully!')->flash();\n return view('admin.bagoucenter.versions.index', ['addonslist' => $addonslist, 'licenses' => $licenses]);\n }\n}\n"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Api/Client/Servers/Bagou/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Api/Client/Servers/Bagou/Minecraft/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./app/Http/Controllers/Api/Client/Servers/Bagou/Minecraft/ModPacksController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Api\\Client\\Servers\\Bagou\\Minecraft;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Pterodactyl\\Exceptions\\DisplayException;\nuse Pterodactyl\\Models\\Server;\nuse Pterodactyl\\Models\\Egg;\nuse Pterodactyl\\Models\\Permission;\nuse Spatie\\QueryBuilder\\QueryBuilder;\nuse Spatie\\QueryBuilder\\AllowedFilter;\nuse Pterodactyl\\Models\\Filters\\MultiFieldServerFilter;\nuse Pterodactyl\\Repositories\\Eloquent\\ServerRepository;\nuse Pterodactyl\\Transformers\\Api\\Client\\ServerTransformer;\nuse Pterodactyl\\Http\\Requests\\Api\\Client\\GetServersRequest;\nuse Pterodactyl\\Http\\Controllers\\Api\\Client\\ClientApiController;\nuse Pterodactyl\\Models\\Bagoulicense;\nuse Illuminate\\Support\\Facades\\Http;\nuse Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException;\nuse Pterodactyl\\Repositories\\Wings\\DaemonFileRepository;\nuse Pterodactyl\\Facades\\Activity;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Response;\nuse Pterodactyl\\Services\\Eggs\\Sharing\\EggUrlBagouImporterService;\nuse Pterodactyl\\Repositories\\Eloquent\\ServerVariableRepository;\nuse Pterodactyl\\Services\\Servers\\ReinstallServerService;\nuse Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException;\n\nclass ModPacksController extends ClientApiController\n{\n /**\n * @var \\Pterodactyl\\Repositories\\Wings\\DaemonFileRepository\n */\n private $fileRepository;\n /**\n * @var \\Pterodactyl\\Repositories\\Eloquent\\ServerVariableRepository\n */\n private $variablesRepository;\n /**\n * @var \\Pterodactyl\\Repositories\\Wings\\EggUrlImporterService\n */\n private $eggImporter;\n /**\n * @var \\Pterodactyl\\Repositories\\Eloquent\\ServerRepository\n */\n private $repository;\n /**\n * @var \\Pterodactyl\\Services\\Servers\\ReinstallServerService\n */\n private $reinstallServerService;\n /**\n * FileController constructor.\n */\n public function __construct(\n DaemonFileRepository $fileRepository,\n ServerRepository $repository,\n EggUrlBagouImporterService $eggImporter,\n ServerVariableRepository $variablesRepository,\n ReinstallServerService $reinstallServerService\n ) {\n parent::__construct();\n\n $this->repository = $repository;\n $this->fileRepository = $fileRepository;\n $this->eggImporter = $eggImporter;\n $this->variablesRepository = $variablesRepository;\n $this->reinstallServerService = $reinstallServerService;\n }\n /**\n * @throws DisplayException\n */\n public function getModPacks(Request $request)\n {\n $license = Bagoulicense::where('addon', '327')->first();\n if(!$license) {\n return new BadRequestHttpException('No license for this addons please setup the license trough admin tab.');\n }\n $license = $license['license'];\n\n return Http::accept('application/json')->get('https://api.bagou450.com/api/client/pterodactyl/modpacks/', ['page' => $request->page, 'search' => $request->search, 'id' => $license, 'type' => $request->type, 'game_versions' => $request->version, 'loaders' => $request->loader]);\n\n }\n public function getMcVersions(Request $request)\n {\n $license = Bagoulicense::where('addon', '327')->first();\n if(!$license) {\n return new BadRequestHttpException('No license for this addons please setup the license trough admin tab.');\n }\n $license = $license['license'];\n return Http::accept('application/json')->get('https://api.bagou450.com/api/client/pterodactyl/modpacks/getMcVersions', ['id' => $license]);\n }\n\n\n public function versions(Request $request)\n {\n\n $license = Bagoulicense::where('addon', '327')->first();\n if(!$license) {\n return new BadRequestHttpException('No license for this addons please setup the license trough admin tab.');\n }\n $license = $license['license'];\n\n return Http::accept('application/json')->get('https://api.bagou450.com/api/client/pterodactyl/mods/versions', ['modId' => $request->modId, 'page' => $request->page, 'id' => $license, 'type' => $request->type]);\n }\n\n public function getModpacksDescription(Request $request)\n {\n $license = Bagoulicense::where('addon', '327')->first();\n if(!$license) {\n return new BadRequestHttpException('No license for this addons please setup the license trough admin tab.');\n }\n $license = $license['license'];\n\n return Http::accept('application/json')->get('https://api.bagou450.com/api/client/pterodactyl/modpacks/getMcModpacksDescription', ['modpackId' => $request->modpackId, 'id' => $license, 'type' => $request->type]);\n }\n\n\n public function install(Request $request, Server $server)\n {\n $license = Bagoulicense::where(\"addon\", \"327\")->first();\n if (!$license) {\n return new BadRequestHttpException(\n \"No license for this addons please setup the license trough admin tab.\"\n );\n }\n\n $license = $license[\"license\"];\n if($request->type === 'voidswrath') {\n if($request->step === 0) {\n $version = $request->modpack[\"versions\"];\n ini_set(\"memory_limit\", \"512M\");\n $urlsize = \"\";\n\n $url = $request->modpack[\"downloadlink\"];\n\n $url = Http::get(\n \"https://api.bagou450.com/api/client/pterodactyl/modpacks/download?id=$license&data=$url&type=voidswrath\"\n )->json();\n if ($url['message'] !== \"Good\") {\n return [\"status\" => \"error\", \"response\" => []];\n }\n $this->fileRepository->setServer($server)->pull($url['data'], \"/\");\n\n $this->repository->update($server->id, [\n \"mcversion\" => $request->modpack['name'],\n \"oldegg\" => $server->egg_id\n ]);\n Activity::event(\"server:versions.install\")\n ->property(\"name\", $request->modpack['name'])\n ->log();\n Server::where(\"id\", $server->id)->update([\n \"startup\" =>\n 'java -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true $( [ ! -f unix_args.txt ] && printf %s \"-jar server.jar\" || printf %s \"@unix_args.txt\" )',\n ]);\n return $url['size'];\n } else if ($request->step === 1) {\n $contents = $this->fileRepository\n ->setServer($server)\n ->getDirectory($request->get('directory') ?? '/');\n foreach($contents as $file) {\n if(str_starts_with($file['name'], 'forge') || str_starts_with($file['name'], 'fabric')) {\n $this->fileRepository\n ->setServer($server)\n ->renameFiles('/', array(array('from' => $file['name'], 'to' => 'server.jar')));\n }\n if(str_ends_with($file['name'], 'bat') || str_ends_with($file['name'], 'sh')) {\n $this->fileRepository->setServer($server)->deleteFiles(\n '/',\n [$file['name']]\n );\n }\n }\n return new JsonResponse([], Response::HTTP_NO_CONTENT);\n }\n\n } else if ($request->type === 'ftb') {\n $nestid = $server->nest_id;\n $egg = $this->eggImporter->handle('ftb', $nestid);\n \n $this->repository->update($server->id, [\n \"mcversion\" => $request->modpack['name'],\n \"oldegg\" => $server->egg_id,\n \"egg_id\" => $egg->id\n ]);\n $server = Server::where('id', '=', $server->id)->firstOrFail();\n $variable = $server->variables()->where('env_variable', 'MODPACK_ID')->first();\n $id = $request->modpack['id'];\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variable->id,\n ], [\n 'variable_value' => \"$id\",\n ]);\n $variable = $server->variables()->where('env_variable', 'MODPACK_VERSION')->first();\n $id = $request->modpack['versionid'];\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variable->id,\n ], [\n 'variable_value' => \"$id\",\n ]);\n $this->reinstallServerService->handle($server);\n\n Activity::event(\"server:versions.install\")\n ->property(\"name\", $request->modpack['name'])\n ->log();\n\n\n } else if ($request->type === 'technicpack') {\n $nestid = $server->nest_id;\n $egg = $this->eggImporter->handle('technicpack', $nestid);\n $this->repository->update($server->id, [\n \"mcversion\" => $request->modpack['name'],\n \"oldegg\" => $server->egg_id,\n \"egg_id\" => $egg->id\n ]);\n $server = Server::where('id', '=', $server->id)->firstOrFail();\n $variable = $server->variables()->where('env_variable', 'DOWNLOAD_URL')->first();\n $id = $request->modpack['downloadlink'];\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variable->id,\n ], [\n 'variable_value' => \"$id\",\n ]);\n\n $this->reinstallServerService->handle($server);\n\n Activity::event(\"server:versions.install\")\n ->property(\"name\", $request->modpack['name'])\n ->log();\n\n\n } else if ($request->type === 'curseforge') {\n $nestid = $server->nest_id;\n $egg = $this->eggImporter->handle('curseforge', $nestid);\n $this->repository->update($server->id, [\n \"mcversion\" => $request->modpack['name'],\n \"oldegg\" => $server->egg_id,\n \"egg_id\" => $egg->id\n ]);\n $server = Server::where('id', '=', $server->id)->firstOrFail();\n $variable = $server->variables()->where('env_variable', 'DOWNLOAD_URL')->first();\n $variableversion = $server->variables()->where('env_variable', 'MCVERSION')->first();\n $variableloader = $server->variables()->where('env_variable', 'LOADER')->first();\n\n $modpackid = $request->modpack['id'];\n $downloaddata = Http::get(\n \"https://api.bagou450.com/api/client/pterodactyl/modpacks/download?id=$license&type=curseforge&modpackid=$modpackid\"\n )->object();\n if($downloaddata->message == 'Error') {\n throw new NotFoundHttpException();\n }\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variable->id,\n ], [\n 'variable_value' => \"$downloaddata->data\",\n ]);\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variableversion->id,\n ], [\n 'variable_value' => \"$downloaddata->mcversion\",\n ]);\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variableloader->id,\n ], [\n 'variable_value' => \"$downloaddata->loader\",\n ]);\n $this->reinstallServerService->handle($server);\n\n Activity::event(\"server:versions.install\")\n ->property(\"name\", $request->modpack['name'])\n ->log();\n\n\n } else if ($request->type === 'modrinth') {\n $nestid = $server->nest_id;\n $egg = $this->eggImporter->handle('CurseForge', $nestid);\n $this->repository->update($server->id, [\n \"mcversion\" => $request->modpack['name'],\n \"oldegg\" => $server->egg_id,\n \"egg_id\" => $egg->id\n ]);\n $server = Server::where('id', '=', $server->id)->firstOrFail();\n $variable = $server->variables()->where('env_variable', 'DOWNLOAD_URL')->first();\n $variableversion = $server->variables()->where('env_variable', 'MCVERSION')->first();\n $variableloader = $server->variables()->where('env_variable', 'LOADER')->first();\n\n $modpackid = $request->modpack['id'];\n $downloaddata = Http::get(\n \"https://api.bagou450.com/api/client/pterodactyl/modpacks/download?id=$license&type=modrinth&modpackid=$modpackid\"\n )->object();\n if($downloaddata->message == 'Error') {\n dd($downloaddata);\n throw new NotFoundHttpException();\n }\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variable->id,\n ], [\n 'variable_value' => \"$downloaddata->data\",\n ]);\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variableversion->id,\n ], [\n 'variable_value' => \"$downloaddata->mcversion\",\n ]);\n $this->variablesRepository->updateOrCreate([\n 'server_id' => $server->id,\n 'variable_id' => $variableloader->id,\n ], [\n 'variable_value' => \"$downloaddata->loader\",\n ]);\n $this->reinstallServerService->handle($server);\n\n Activity::event(\"server:versions.install\")\n ->property(\"name\", $request->modpack['name'])\n ->log();\n\n\n }\n\n }\n\n public function getversionsize(Server $server, Request $request)\n {\n $contents = $this->fileRepository\n ->setServer($server)\n ->getDirectory($request->get(\"directory\") ?? \"/\");\n $results = array_filter($contents, function ($content) {\n global $request;\n return $content[\"name\"] == \"$request->filename\";\n });\n\n $size = array_shift($results)[\"size\"];\n\n return $size;\n }\n\n\n}\n\n"
|
|
}
|
|
],
|
|
"./database/migrations/2022_05_21_133943_add_version_field_to_servers_table.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass AddVersionFieldToServersTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n\n Schema::table('servers', function (Blueprint $table) {\n $table->string('mcversion')->nullable()->after('updated_at');\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::table('servers', function (Blueprint $table) {\n $table->dropColumn('mcversion');\n });\n }\n}"
|
|
}
|
|
],
|
|
"./database/migrations/2022_07_04_151819_create_bagoulicense_table.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateBagoulicenseTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n Schema::create('bagoulicense', function (Blueprint $table) {\n $table->id();\n $table->string('addon');\n $table->string('license');\n $table->integer('usage');\n $table->integer('maxusage');\n $table->boolean('enabled');\n $table->timestamps();\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::dropIfExists('bagoulicense');\n }\n}\n"
|
|
}
|
|
],
|
|
"./database/migrations/2022_10_24_133158_add_version_field_to_bagoulicense_table.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass AddVersionFieldToBagoulicenseTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n Schema::table('bagoulicense', function (Blueprint $table) {\n $table->decimal('version')->default(0);\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::table('bagoulicense', function (Blueprint $table) {\n $table->dropColumn('version');\n });\n }\n}"
|
|
}
|
|
],
|
|
"./database/migrations/2023_01_22_102259_add_old_eggid_field_to_server_table.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass AddOldEggidFieldToServerTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n Schema::table('servers', function (Blueprint $table) {\n $table->string('oldegg');\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::table('servers', function (Blueprint $table) {\n $table->dropColumn('oldegg');\n });\n }\n}\n"
|
|
}
|
|
],
|
|
"./database/migrations/2022_10_25_151037_create_modpacklist_table.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateModpacklistTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n Schema::create('modpacklist', function (Blueprint $table) {\n $table->id();\n $table->timestamps();\n $table->string('name');\n $table->string('version');\n $table->string('mcversion');\n $table->string('url');\n\n\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::dropIfExists('modpacklist');\n }\n}"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/mcmodpacks/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/mcmodpacks/getMinecraftMcModpacks.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import useSWR from 'swr';\nimport http, { PaginatedResult } from '@/api/http';\nimport { createContext, useContext } from 'react';\nimport { ServerContext } from '@/state/server';\n\ninterface ctx {\n page: number;\n setPage: (value: number | ((s: number) => number)) => void;\n searchFilter: string;\n type: string;\n setType: (value: string | ((s: string) => string)) => void;\n version: string;\n setVersion: (value: string | ((s: string) => string)) => void;\n loader: string;\n setLoader: (value: string | ((s: string) => string)) => void;\n setSearchFilter: (value: string | ((s: string) => string)) => void;\n}\n\nexport const Context = createContext<ctx>({\n page: 1,\n setPage: () => 1,\n searchFilter: '',\n setSearchFilter: () => '',\n type: 'curseforge',\n setType: () => 'curseforge',\n version: '',\n setVersion: () => '',\n loader: '',\n setLoader: () => '',\n});\n\nexport default () => {\n const { page, searchFilter, type, version, loader } = useContext(Context);\n const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);\n\n return useSWR<PaginatedResult<any>>(\n ['server:minecraftModpacks', page, searchFilter, type, version, loader],\n async () => {\n const { data } = await http.get(`/api/client/servers/${uuid}/mcmodpacks`, {\n params: { page, search: searchFilter, type, version, loader },\n timeout: 60000,\n });\n const totalpage = type === 'voidswrath' ? 0 : type === 'ftb' ? 7 : 1317;\n return {\n items: data || [],\n pagination: { total: 13170, count: data.length, perPage: 20, currentPage: page, totalPages: totalpage },\n };\n }\n );\n};\n"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/mcmodpacks/getMinecraftMcModpacksDescription.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import http from '@/api/http';\n\nexport default (uuid: string, modpackId: string, type: string): Promise<string> => {\n return new Promise((resolve, reject) => {\n http\n .get(`/api/client/servers/${uuid}/mcmodpacks/description`, {\n params: {\n modpackId,\n type,\n },\n })\n .then(({ data }) => resolve(data))\n .catch(reject);\n });\n};"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/mcmodpacks/getMinecraftModPackFileSize.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import http from '@/api/http';\n\nexport default async (uuid: string, filename: string): Promise<any> => {\n return new Promise((resolve, reject) => {\n http\n .get(`/api/client/servers/${uuid}/mcmodpacks/getversionsize`, { params: { filename } })\n .then((data) => resolve(data.data))\n .catch(reject);\n });\n};"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/mcmodpacks/getMinecraftVersions.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import http from '@/api/http';\n\nexport default (uuid: string): Promise<any> => {\n return new Promise((resolve, reject) => {\n http\n .get(`/api/client/servers/${uuid}/mcmodpacks/mcversions`)\n .then(({ data }) => resolve(data))\n .catch(reject);\n });\n};"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/mcmodpacks/InstallMinecraftModPack.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import http from '@/api/http';\n\nexport default async (uuid: string, name: string, modpack: any, type: string, step?: number): Promise<any> => {\n return new Promise((resolve, reject) => {\n http\n .post(`/api/client/servers/${uuid}/mcmodpacks/install`, { name, type, modpack, step })\n .then((data) => resolve(data.data))\n .catch(reject);\n });\n};"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/mcmodpacks": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/mcmodpacks/McModpacksContainer.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import React, { useContext, useEffect, useState } from 'react';\nimport Spinner from '@/components/elements/Spinner';\nimport useFlash from '@/plugins/useFlash';\nimport { Form, Formik } from 'formik';\nimport McModsRow from '@/components/server/mcmodpacks/McModpacksRow';\nimport tw from 'twin.macro';\nimport Field from '@/components/elements/Field';\nimport { object, string } from 'yup';\nimport getMinecraftMcModpacks, {\n Context as ServerMcModPacksContext,\n} from '@/api/server/mcmodpacks/getMinecraftMcModpacks';\nimport ServerContentBlock from '@/components/elements/ServerContentBlock';\nimport Pagination from '@/components/elements/PaginationBagou';\nimport Select from '@/components/elements/Select';\nimport getMinecraftVersions from '@/api/server/mcmodpacks/getMinecraftVersions';\nimport { ServerContext } from '@/state/server';\nimport FlashMessageRender from '@/components/FlashMessageRender';\n\ninterface Values {\n search: string;\n}\n\nconst McModPacksContainer = () => {\n const { page, setPage, searchFilter, setSearchFilter, type, setType, version, setVersion, loader, setLoader } =\n useContext(ServerMcModPacksContext);\n const { clearFlashes, clearAndAddHttpError } = useFlash();\n const { data: minecraftMcModpacks, error, isValidating } = getMinecraftMcModpacks();\n const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);\n const submit = ({ search }: Values) => {\n clearFlashes('minecraftMcMods');\n setSearchFilter(search);\n };\n useEffect(() => {\n if (!error) {\n clearFlashes('minecraftMcMods');\n\n return;\n }\n\n clearAndAddHttpError({ error, key: 'minecraftMcMods' });\n }, [error]);\n const [versions, setVersions] = useState([{ id: 1 }]);\n if (versions.length === 1) {\n getMinecraftVersions(uuid)\n .then((data) => {\n setVersions(data);\n })\n .catch((e) => {\n clearAndAddHttpError({ error: e, key: 'minecraftMcMods' });\n });\n }\n if (!minecraftMcModpacks || (error && isValidating) || versions.length === 1) {\n return <Spinner size={'large'} centered />;\n }\n return (\n <ServerContentBlock title={'Minecraft Mods'} css={tw`bg-transparent`}>\n <FlashMessageRender byKey={'server:minecraftModpacks'} css={tw`mb-2`} />\n <div css={tw`flex gap-4 mb-4`}>\n <div\n css={!['technicpack', 'voidswrath'].includes(type) ? tw`w-full sm:w-3/6 gap-4` : tw`w-full sm:w-5/6 gap-4`}\n >\n <Formik\n onSubmit={submit}\n initialValues={{\n search: searchFilter,\n }}\n validationSchema={object().shape({\n search: string().optional().min(1),\n })}\n >\n <Form>\n <Field id={'search'} name={'search'} label={'Search'} type={'text'} />\n </Form>\n </Formik>\n </div>\n <Select\n css={tw`w-full sm:w-1/6 inset-x-0 bottom-0 mt-6`}\n onChange={(e) => setType(e.target.value)}\n defaultValue={type}\n >\n <option value={'curseforge'}>Curseforge</option>\n {/** <option value={'modrinth'}>Modrinth</option> */} \n <option value={'technicpack'}>TechnicPack</option>\n <option value={'ftb'}>FTB</option>\n <option value={'voidswrath'}>VoidsWrath</option>\n </Select>\n <Select\n css={\n type === 'curseforge' && version === ''\n ? tw`w-full sm:w-2/6 inset-x-0 bottom-0 mt-6`\n : ['technicpack', 'voidswrath'].includes(type)\n ? tw`hidden`\n : tw`w-full sm:w-1/6 inset-x-0 bottom-0 mt-6`\n }\n onChange={(e) => setVersion(e.target.value)}\n defaultValue={version}\n >\n <option value={''}>All Versions</option>\n {versions.length !== 1 &&\n versions.map((item, index) => {\n return (\n <option value={item.id} key={index}>\n {item.id}\n </option>\n );\n })}\n </Select>\n {['ftb', 'modrinth'].includes(type) && (\n <Select\n css={tw`w-full sm:w-1/6 inset-x-0 bottom-0 mt-6`}\n onChange={(e) => setLoader(e.target.value)}\n defaultValue={loader}\n >\n <option value={''}>All Loaderes</option>\n <option value={'forge'}>Forge</option>\n <option value={'fabric'}>Fabric</option>\n </Select>\n )}\n {type === 'curseforge' && version !== '' && (\n <Select\n css={tw`w-full sm:w-1/6 inset-x-0 bottom-0 mt-6`}\n onChange={(e) => setLoader(e.target.value)}\n defaultValue={loader}\n >\n <option value={''}>All Loaderes</option>\n <option value={'forge'}>Forge</option>\n <option value={'fabric'}>Fabric</option>\n </Select>\n )}\n </div>\n <Pagination data={minecraftMcModpacks} onPageSelect={setPage} customcss={`grid grid-cols-2 gap-4`}>\n {({ items }) =>\n !items.length ? (\n <p css={tw`text-center text-sm text-neutral-300 col-span-2`}>\n {page > 1\n ? \"Looks like we've run out of minecraft mods to show you, try going back a page.\"\n : 'It looks like there are no minecraft mods matching search criteria.'}\n </p>\n ) : (\n items.map((minecraftMcModpack, key) => (\n <McModsRow key={key} minecraftMcModpack={minecraftMcModpack} type={type} />\n ))\n )\n }\n </Pagination>\n </ServerContentBlock>\n );\n};\n\nexport default () => {\n const [page, setPage] = useState<number>(1);\n const [searchFilter, setSearchFilter] = useState<string>('');\n const [type, setType] = useState<string>('curseforge');\n const [version, setVersion] = useState<string>('');\n const [loader, setLoader] = useState<string>('');\n\n return (\n <ServerMcModPacksContext.Provider\n value={{ page, setPage, searchFilter, setSearchFilter, type, setType, version, setVersion, loader, setLoader }}\n >\n <McModPacksContainer />\n </ServerMcModPacksContext.Provider>\n );\n};"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/mcmodpacks/McModpacksRow.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faDownload, faPaperclip } from '@fortawesome/free-solid-svg-icons';\nimport tw from 'twin.macro';\nimport useFlash from '@/plugins/useFlash';\nimport GreyRowBox from '@/components/elements/GreyRowBox';\nimport Modal from '@/components/elements/Modal';\nimport Button from '@/components/elements/Button';\nimport FlashMessageRender from '@/components/FlashMessageRender';\nimport Parser from 'html-react-parser';\nimport ReactMarkdown from 'react-markdown';\nimport getMinecraftMcModpacksDescription from '@/api/server/mcmodpacks/getMinecraftMcModpacksDescription';\nimport { ServerContext } from '@/state/server';\nimport SpinnerOverlay from '@/components/elements/SpinnerOverlay';\nimport { ApplicationStore } from '@/state';\nimport { Actions, useStoreActions } from 'easy-peasy';\nimport deleteFiles from '@/api/server/files/deleteFiles';\nimport InstallMinecraftModPack from '@/api/server/mcmodpacks/InstallMinecraftModPack';\nimport getMinecraftModPackFileSize from '@/api/server/mcmodpacks/getMinecraftModPackFileSize';\nimport { bytesToString } from '@/lib/formatters';\nimport decompressFiles from '@/api/server/files/decompressFiles';\nimport setSelectedDockerImage from '@/api/server/setSelectedDockerImage';\n\ninterface Props {\n minecraftMcModpack: any;\n className?: string;\n type: string;\n}\n\nexport default ({ minecraftMcModpack, className, type }: Props) => {\n const { clearAndAddHttpError } = useFlash();\n const [visible, setVisible] = useState('');\n const [infoload, setInfoLoad] = useState(false);\n const [disabled, setDisabled] = useState(false);\n const [loading, setLoading] = useState(false);\n const [pourcentage, setPourcentage] = useState('');\n const [description, setDescription] = useState('');\n const { addFlash, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);\n const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);\n function clear() {\n clearFlashes();\n }\n if (type === 'modrinth') {\n minecraftMcModpack.id = minecraftMcModpack.project_id;\n minecraftMcModpack.name = minecraftMcModpack.title;\n minecraftMcModpack.logo = { thumbnailUrl: minecraftMcModpack.icon_url };\n minecraftMcModpack.links = { websiteUrl: `https://modrinth.com/mod/${minecraftMcModpack.slug}` };\n minecraftMcModpack.summary = minecraftMcModpack.description;\n }\n const getDescription = () => {\n setInfoLoad(true);\n if (['curseforge', 'modrinth'].includes(type)) {\n getMinecraftMcModpacksDescription(uuid, minecraftMcModpack.id, type)\n .then((data) => {\n setDescription(data);\n setInfoLoad(false);\n setVisible('informations');\n })\n .catch((e) => clearAndAddHttpError({ key: minecraftMcModpack.id, error: e }));\n } else {\n setDescription(minecraftMcModpack.description);\n setInfoLoad(false);\n setVisible('informations');\n }\n };\n const InstallFTBORTECHNIC = () => {\n setDisabled(true);\n setLoading(true);\n setPourcentage('Delete old versions...');\n deleteFiles(uuid, '/', [\n 'server.jar',\n 'zip.zip',\n 'libraries',\n 'fontfiles',\n 'worldshape',\n 'oresources',\n 'resources',\n 'structures',\n 'scripts',\n 'unix_args.txt',\n 'user_jvm_args.txt',\n 'config',\n 'mods',\n ])\n .then(() => {\n InstallMinecraftModPack(uuid, minecraftMcModpack.name, minecraftMcModpack, type, 0)\n .then(() => {\n setLoading(false);\n setDisabled(false);\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'success',\n message: 'Modpacks in installation. Wait the server installation for use it.',\n });\n })\n .catch((error) => {\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the version. The modpack maybe don't have a server pack.\",\n });\n console.log(error);\n setDisabled(false);\n setLoading(false);\n });\n })\n .catch((error) => {\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the version.\",\n });\n console.log(error);\n setDisabled(false);\n });\n };\n const InstallVoidswrath = () => {\n setDisabled(true);\n setLoading(true);\n setPourcentage('Delete old versions...');\n deleteFiles(uuid, '/', [\n 'server.jar',\n 'zip.zip',\n 'libraries',\n 'fontfiles',\n 'worldshape',\n 'oresources',\n 'resources',\n 'structures',\n 'scripts',\n 'unix_args.txt',\n 'user_jvm_args.txt',\n 'config',\n 'mods',\n ])\n .then(() => {\n InstallMinecraftModPack(uuid, minecraftMcModpack.name, minecraftMcModpack, type, 0)\n .then((data) => {\n setPourcentage('Setup requirements...');\n const filename = minecraftMcModpack.downloadlink.replace(/^.*[\\\\/]/, '');\n let oldsize = 0;\n let dockerimage = 'ghcr.io/pterodactyl/yolks:java_8';\n if (parseInt(minecraftMcModpack.versions.slice(2)) >= 17) {\n dockerimage = 'ghcr.io/pterodactyl/yolks:java_16';\n }\n if (parseInt(minecraftMcModpack.versions.slice(2)) >= 18) {\n dockerimage = 'ghcr.io/pterodactyl/yolks:java_17';\n }\n const Download = setInterval(function () {\n getMinecraftModPackFileSize(uuid, filename)\n .then((size) => {\n if (data !== size) {\n setPourcentage(\n `Download in progress ${bytesToString(size)}/${bytesToString(data)} (${bytesToString(\n size - oldsize\n )}/s)`\n );\n oldsize = size;\n } else {\n clearInterval(Download);\n setPourcentage('Decompress files...');\n decompressFiles(uuid, '/', filename)\n .then(() => {\n setPourcentage('Delete compressed file...');\n deleteFiles(uuid, '/', [filename])\n .then(() => {\n setPourcentage('Change java version...');\n setSelectedDockerImage(uuid, dockerimage).then(() => {\n InstallMinecraftModPack(uuid, minecraftMcModpack.name, minecraftMcModpack, type, 1)\n .then(() => {\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'success',\n message: 'Modpack changed successfully',\n });\n setDisabled(false);\n setLoading(false);\n setTimeout(clear, 3000);\n })\n .catch(() => {\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the modpack.\",\n });\n });\n });\n })\n .catch((err) => {\n clearInterval(Download);\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the modpack.\",\n });\n console.log(err);\n setDisabled(false);\n setTimeout(clear, 3000);\n });\n })\n .catch((err) => {\n clearInterval(Download);\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the modpack.\",\n });\n console.log(err);\n setDisabled(false);\n setTimeout(clear, 3000);\n });\n }\n })\n .catch((err) => {\n clearInterval(Download);\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the modpack.\",\n });\n console.log(err);\n setDisabled(false);\n });\n }, 1000);\n })\n .catch((error) => {\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the version.\",\n });\n console.log(error);\n setDisabled(false);\n });\n })\n .catch((error) => {\n addFlash({\n key: 'server:minecraftModpacks',\n type: 'error',\n message: \"Can't install the version.\",\n });\n console.log(error);\n setDisabled(false);\n });\n };\n return (\n <GreyRowBox css={tw`flex-wrap md:flex-nowrap items-center mb-2`} className={className}>\n <SpinnerOverlay fixed={true} size={'large'} visible={loading}>\n <div css={tw`text-white mt-2`}>{pourcentage}</div>\n </SpinnerOverlay>\n <Modal\n visible={visible === 'informations'}\n onDismissed={() => {\n setVisible('');\n }}\n >\n <FlashMessageRender byKey={minecraftMcModpack.id} css={tw`mb-4`} />\n {type === 'ftb' ? <ReactMarkdown>{description}</ReactMarkdown> : Parser(description)}\n </Modal>\n <div css={tw`flex items-center truncate w-full md:flex-1`}>\n <div css={tw`flex flex-col truncate`}>\n <div css={tw`flex items-center text-sm mb-1`}>\n <div\n css={tw`w-10 h-10 rounded-lg bg-white border-2 border-neutral-800 overflow-hidden hidden md:block`}\n title={minecraftMcModpack.name}\n >\n <img alt={minecraftMcModpack.name} src={minecraftMcModpack.logo.thumbnailUrl} />\n </div>\n <a\n href={\n type === 'curseforge' || type === 'modrinth'\n ? minecraftMcModpack.links.websiteUrl\n : minecraftMcModpack.link\n }\n css={tw`ml-4 break-words truncate`}\n title={minecraftMcModpack.summary}\n >\n {minecraftMcModpack.name}\n {!['technicpack', 'voidswrath'].includes(type) && (\n <>\n <br />\n <div css={tw`text-2xs text-neutral-400`}>Description (Hover me)</div>\n </>\n )}\n </a>\n <br />\n </div>\n <p css={tw`mt-1 md:mt-0 text-xs truncate`}>\n {type === 'modrinth' || type === 'ftb' ? (\n <p>{minecraftMcModpack.display_categories.join(', ')} </p>\n ) : (\n type === 'curseforge' &&\n minecraftMcModpack.categories.map((category: any, index: any) => (\n <img\n css={index > 0 ? tw`ml-1 w-8 h-8 inline` : tw`w-8 h-8 inline`}\n key={category.name}\n src={category.iconUrl}\n alt={category.name}\n title={category.name}\n />\n ))\n )}\n </p>\n </div>\n </div>\n\n <div css={tw`mt-4 md:mt-0 ml-6 grid grid-rows-2 gap-y-2`} style={{ marginRight: '-0.5rem' }}>\n <Button\n type={'button'}\n aria-label={'More Informations'}\n onClick={() => getDescription()}\n title='More Informations'\n isLoading={infoload}\n isSecondary\n >\n <FontAwesomeIcon icon={faPaperclip} /> Informations\n </Button>\n\n <Button\n type={'button'}\n aria-label={'Install'}\n disabled={disabled}\n onClick={() => {\n if (type === 'voidswrath') {\n InstallVoidswrath();\n } else if (type === 'ftb' || type === 'technicpack' || type === 'curseforge') {\n InstallFTBORTECHNIC();\n } else {\n setVisible('versions');\n }\n }}\n title='Download and Install'\n >\n <FontAwesomeIcon icon={faDownload} /> Install\n </Button>\n </div>\n </GreyRowBox>\n );\n};"
|
|
}
|
|
],
|
|
"./resources/scripts/routers/ServerElements.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "no",
|
|
"add": "import React from 'react';\nimport { ServerContext } from '@/state/server';\nimport routes from '@/routers/routes';\nimport Can from '@/components/elements/Can';\nimport { NavLink, Route, Switch, useRouteMatch } from 'react-router-dom';\nimport PermissionRoute from '@/components/elements/PermissionRoute';\nimport Spinner from '@/components/elements/Spinner';\nimport { NotFound } from '@/components/elements/ScreenBlock';\nimport TransitionRouter from '@/TransitionRouter';\nimport { useLocation } from 'react-router';\n\ninterface Props {\n route: any;\n}\n\nconst NavItem = ({ route }: Props) => {\n const match = useRouteMatch<{ id: string }>();\n\n const nestId = ServerContext.useStoreState(state => state.server.data?.nestId);\n const eggId = ServerContext.useStoreState(state => state.server.data?.eggId);\n\n const to = (value: string, url = false) => {\n return `${(url ? match.url : match.path).replace(/\\/*$/, '')}/${value.replace(/^\\/+/, '')}`;\n };\n\n return (\n ((route.nestIds && route.nestIds.includes(nestId ?? 0))\n || (route.eggIds && route.eggIds.includes(eggId ?? 0))\n || (route.nestId && route.nestId === nestId)\n || (route.eggId && route.eggId === eggId)\n || (!route.eggIds && !route.nestIds && !route.nestId && !route.eggId)) &&\n <NavLink to={to(route.path, true)} exact={route.exact}>\n {route.name}\n </NavLink>\n );\n}\n\nexport const Navigation = () => {\n return (\n <>\n {routes.server\n .filter((route) => !!route.name)\n .map((route) =>\n route.permission ? (\n <Can key={route.path} action={route.permission} matchAny>\n <NavItem route={route} />\n </Can>\n ) : (\n <React.Fragment key={route.path}>\n <NavItem route={route} />\n </React.Fragment>\n )\n )}\n </>\n );\n}\n\nexport const ComponentLoader = () => {\n const match = useRouteMatch<{ id: string }>();\n const location = useLocation();\n\n const serverNestId = ServerContext.useStoreState(state => state.server.data?.nestId);\n const serverEggId = ServerContext.useStoreState(state => state.server.data?.eggId);\n\n const to = (value: string, url = false) => {\n return `${(url ? match.url : match.path).replace(/\\/*$/, '')}/${value.replace(/^\\/+/, '')}`;\n };\n\n return (\n <>\n <TransitionRouter>\n <Switch location={location}>\n {routes.server.map(({ path, permission, component: Component, nestIds, eggIds, nestId, eggId }) => {\n return (\n ((nestIds && nestIds.includes(serverNestId ?? 0))\n || (eggIds && eggIds.includes(serverEggId ?? 0))\n || (nestId && serverNestId === nestId)\n || (eggId && serverEggId === eggId)\n || (!eggIds && !nestIds && !nestId && !eggId)) &&\n <PermissionRoute key={path} permission={permission} path={to(path)} exact>\n <Spinner.Suspense>\n <Component />\n </Spinner.Suspense>\n </PermissionRoute>\n )\n })}\n <Route path={'*'} component={NotFound} />\n </Switch>\n </TransitionRouter>\n </>\n );\n}"
|
|
}
|
|
],
|
|
"./resources/scripts/components/elements/PaginationBagou.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "no",
|
|
"add": "import React from 'react';\nimport { PaginatedResult } from '@/api/http';\nimport tw from 'twin.macro';\nimport styled from 'styled-components/macro';\nimport Button from '@/components/elements/Button';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faAngleDoubleLeft, faAngleDoubleRight } from '@fortawesome/free-solid-svg-icons';\n\ninterface RenderFuncProps<T> {\n items: T[];\n isLastPage: boolean;\n isFirstPage: boolean;\n}\n\ninterface Props<T> {\n data: PaginatedResult<T>;\n customcss?: string;\n custompage?: string;\n showGoToLast?: boolean;\n showGoToFirst?: boolean;\n onPageSelect: (page: number) => void;\n children: (props: RenderFuncProps<T>) => React.ReactNode;\n}\n\nconst Block = styled(Button)`\n ${tw`p-0 w-10 h-10`}\n\n &:not(:last-of-type) {\n ${tw`mr-2`};\n }\n`;\n\nfunction Pagination<T>({ data: { items, pagination }, customcss, custompage, onPageSelect, children }: Props<T>) {\n const isFirstPage = pagination.currentPage === 1;\n const isLastPage = pagination.currentPage >= pagination.totalPages;\n\n const pages = [];\n\n // Start two spaces before the current page. If that puts us before the starting page default\n // to the first page as the starting point.\n const start = Math.max(pagination.currentPage - 2, 1);\n const end = Math.min(pagination.totalPages, pagination.currentPage + 5);\n\n for (let i = start; i <= end; i++) {\n pages.push(i);\n }\n\n return (\n <div className={custompage}>\n {children({ items, isFirstPage, isLastPage })}\n {pages.length > 1 && (\n <div css={tw`mt-4 flex justify-center`} className={customcss}>\n {pages[0] > 1 && !isFirstPage && (\n <Block isSecondary color={'primary'} onClick={() => onPageSelect(1)}>\n <FontAwesomeIcon icon={faAngleDoubleLeft} />\n </Block>\n )}\n {pages.map((i) => (\n <Block\n isSecondary={pagination.currentPage !== i}\n color={'primary'}\n key={`block_page_${i}`}\n onClick={() => onPageSelect(i)}\n >\n {i}\n </Block>\n ))}\n {pages[4] < pagination.totalPages && !isLastPage && (\n <Block isSecondary color={'primary'} onClick={() => onPageSelect(pagination.totalPages)}>\n <FontAwesomeIcon icon={faAngleDoubleRight} />\n </Block>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport default Pagination;"
|
|
}
|
|
],
|
|
"./routes/admin.php": [
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"add": "/*\n|--------------------------------------------------------------------------\n| Bagou License Center Routes\n|--------------------------------------------------------------------------\n|\n| Endpoint: /admin/bagoucenter\n|\n*/\nRoute::group(['prefix' => 'bagoucenter'], function () {\n Route::get('/', [Admin\\Bagou\\BagouCenterController::class, 'index'])->name('admin.bagoucenter');\n Route::get('/license/', [Admin\\Bagou\\BagouLicenseController::class, 'index'])->name('admin.bagoucenter.license');\n Route::get('/license/{addon}', [Admin\\Bagou\\BagouLicenseController::class, 'license'])->name('admin.bagoucenter.license.addon');\n \n Route::get('/versions/', [Admin\\Bagou\\BagouVersionsController::class, 'index'])->name('admin.bagoucenter.versions');\n\n Route::get('/settings', [Admin\\Bagou\\BagouSettingsController::class, 'index'])->name('admin.bagoucenter.settings');\n Route::get('/settings/{addon}', [Admin\\Bagou\\BagouSettingsController::class, 'settings'])->name('admin.bagoucenter.settings.addon');\n\n Route::get('/support/', [Admin\\Bagou\\BagouCenterController::class, 'settings'])->name('admin.bagoucenter.support');\n\n Route::post('/license/{addon}', [Admin\\Bagou\\BagouLicenseController::class, 'setlicense']);\n \n Route::post('/versions', [Admin\\Bagou\\BagouVersionsController::class, 'refresh']);\n\n Route::delete('/license/{addon}', [Admin\\Bagou\\BagouLicenseController::class, 'removelicense']);\n \n});",
|
|
"where": " Route::delete('/egg/{egg:id}/variables/{variable:id}', [Admin\\Nests\\EggVariableController::class, 'destroy']);\n});"
|
|
}
|
|
],
|
|
"./app/Models/Bagoulicense.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Models;\n\n/**\n * @property int $id\n * @property string $uuid\n * @property int $nest_id\n * @property string $author\n * @property string $name\n * @property string|null $description\n * @property array|null $features\n * @property string $docker_image -- deprecated, use $docker_images\n * @property string $update_url\n * @property array<string, string> $docker_images\n * @property array|null $file_denylist\n * @property string|null $config_files\n * @property string|null $config_startup\n * @property string|null $config_logs\n * @property string|null $config_stop\n * @property int|null $config_from\n * @property string|null $startup\n * @property bool $script_is_privileged\n * @property string|null $script_install\n * @property string $script_entry\n * @property string $script_container\n * @property int|null $copy_script_from\n * @property \\Carbon\\Carbon $created_at\n * @property \\Carbon\\Carbon $updated_at\n * @property string|null $copy_script_install\n * @property string $copy_script_entry\n * @property string $copy_script_container\n * @property string|null $inherit_config_files\n * @property string|null $inherit_config_startup\n * @property string|null $inherit_config_logs\n * @property string|null $inherit_config_stop\n * @property string $inherit_file_denylist\n * @property array|null $inherit_features\n */\nclass BagouLicense extends Model\n{\n /**\n * The resource name for this model when it is transformed into an\n * API representation using fractal.\n */\n public const RESOURCE_NAME = 'BagouLicense';\n\n /**\n * Defines the current egg export version.\n */\n public const EXPORT_VERSION = 'PTDL_v2';\n\n /**\n * The table associated with the model.\n *\n * @var string\n */\n protected $table = 'bagoulicense';\n\n /**\n * Fields that are not mass assignable.\n *\n * @var array\n */\n protected $fillable = [\n 'addon',\n 'license',\n 'usage',\n 'maxusage',\n 'enabled'\n ];\n\n /**\n * Cast values to correct type.\n *\n * @var array\n */\n protected $casts = [\n 'addon' => 'string',\n 'license' => 'string',\n 'usage' => 'integer',\n 'maxusage' => 'integer',\n 'enabled' => 'boolean'\n ];\n\n /**\n * @var array\n */\n public static array $validationRules = [\n 'addon' => 'required|string',\n 'license' => 'required|string',\n ];\n\n}\n"
|
|
}
|
|
],
|
|
"./app/Models/MinecraftModpacks.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Models;\n\n/**\n * @property int $id\n * @property string $uuid\n * @property int $nest_id\n * @property string $author\n * @property string $name\n * @property string|null $description\n * @property array|null $features\n * @property string $docker_image -- deprecated, use $docker_images\n * @property string $update_url\n * @property array<string, string> $docker_images\n * @property array|null $file_denylist\n * @property string|null $config_files\n * @property string|null $config_startup\n * @property string|null $config_logs\n * @property string|null $config_stop\n * @property int|null $config_from\n * @property string|null $startup\n * @property bool $script_is_privileged\n * @property string|null $script_install\n * @property string $script_entry\n * @property string $script_container\n * @property int|null $copy_script_from\n * @property \\Carbon\\Carbon $created_at\n * @property \\Carbon\\Carbon $updated_at\n * @property string|null $copy_script_install\n * @property string $copy_script_entry\n * @property string $copy_script_container\n * @property string|null $inherit_config_files\n * @property string|null $inherit_config_startup\n * @property string|null $inherit_config_logs\n * @property string|null $inherit_config_stop\n * @property string $inherit_file_denylist\n * @property array|null $inherit_features\n */\nclass MinecraftModpacks extends Model\n{\n /**\n * The resource name for this model when it is transformed into an\n * API representation using fractal.\n */\n public const RESOURCE_NAME = 'MinecraftModpacks';\n\n /**\n * Defines the current egg export version.\n */\n public const EXPORT_VERSION = 'PTDL_v2';\n\n /**\n * The table associated with the model.\n *\n * @var string\n */\n protected $table = 'modpacklist';\n\n /**\n * Fields that are not mass assignable.\n *\n * @var array\n */\n protected $fillable = [\n 'name',\n 'version',\n 'mcversion',\n 'url',\n 'icon'\n ];\n\n /**\n * Cast values to correct type.\n *\n * @var array\n */\n protected $casts = [\n 'name' => 'string',\n 'version' => 'string',\n 'mcversion' => 'string',\n 'url' => 'string',\n 'icon' => 'string'\n\n ];\n\n /**\n * @var array\n */\n public static array $validationRules = [\n 'name' => 'required|string',\n 'version' => 'required|string',\n 'mcversion' => 'required|string',\n 'url' => 'required|string',\n 'icon' => 'required|string'\n\n ];\n\n}\n"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/index.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n<h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav', ['addon' => null])\n\n <div class=\"row\" style=\"margin-top: 15px;\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou Center</h3>\n </div>\n <p class=\"box-body\">\n Select a tab above for manage all your Bagou450 addons!</span>.\n <br>\n <span style=\"font-size: 20px;\">Api status: @if ($apistatus === 1) Online <i class=\"fa fa-check-circle\" style=\"color: green;\" aria-hidden=\"true\"></i> @elseif ($apistatus === 2) Maintenance mode <i class=\"fa fa-exclamation-circle\" style=\"color: yellow;\" aria-hidden=\"true\"></i> @else Down <i class=\"fa fa-minus-circle\" style=\"color: red;\" aria-hidden=\"true\"></i> @endif</span>\n <br>\n <span style=\"font-size: 20px;\">CDN status: @if ($cdnstatus === 1) Online <i class=\"fa fa-check-circle\" style=\"color: green;\" aria-hidden=\"true\"></i> @elseif ($cdnstatus === 2) Maintenance mode <i class=\"fa fa-exclamation-circle\" style=\"color: yellow;\" aria-hidden=\"true\"></i> @else Down <i class=\"fa fa-minus-circle\" style=\"color: red;\" aria-hidden=\"true\"></i> @endif</span>\n\n </p>\n </div>\n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/license.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n <h1>Bagou License<small>Configure license for Bagou450 Addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou License</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoulicense.nav', ['addon' => $addon])\n\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou License</h3>\n </div>\n <form action=\"{{ route('admin.settings') }}\" method=\"POST\">\n <div class=\"box-body\">\n <div class=\"row\">\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Company Name</label>\n <div>\n <input type=\"text\" class=\"form-control\" name=\"app:name\" value=\"{{ old('app:name', config('app.name')) }}\" />\n <p class=\"text-muted\"><small>This is the name that is used throughout the panel and in emails sent to clients.</small></p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Require 2-Factor Authentication</label>\n <div>\n <div class=\"btn-group\" data-toggle=\"buttons\">\n @php\n $level = old('pterodactyl:auth:2fa_required', config('pterodactyl.auth.2fa_required'));\n @endphp\n <label class=\"btn btn-primary @if ($level == 0) active @endif\">\n <input type=\"radio\" name=\"pterodactyl:auth:2fa_required\" autocomplete=\"off\" value=\"0\" @if ($level == 0) checked @endif> Not Required\n </label>\n <label class=\"btn btn-primary @if ($level == 1) active @endif\">\n <input type=\"radio\" name=\"pterodactyl:auth:2fa_required\" autocomplete=\"off\" value=\"1\" @if ($level == 1) checked @endif> Admin Only\n </label>\n <label class=\"btn btn-primary @if ($level == 2) active @endif\">\n <input type=\"radio\" name=\"pterodactyl:auth:2fa_required\" autocomplete=\"off\" value=\"2\" @if ($level == 2) checked @endif> All Users\n </label>\n </div>\n <p class=\"text-muted\"><small>If enabled, any account falling into the selected grouping will be required to have 2-Factor authentication enabled to use the Panel.</small></p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Status</label>\n <div>\n <p>@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n<h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoulicense.nav', ['addon' => $addon])\n\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou License</h3>\n </div>\n <form method=\"POST\">\n <div class=\"box-body\">\n <div class=\"row\">\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Addon license (Transaction id)</label>\n <div>\n <input type=\"text\" class=\"form-control\" name=\"license\" value=\"{{ $license }}\" />\n <p class=\"text-muted\"><small>Add here your transaction id if not work contact me on <a href=\"https://discord.bagou450.com\">discord</a></small></p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Usage</label>\n <div>\n <p>{{ $usage && $maxusage ? \"$usage / $maxusage panel(s)\" : 'No license' }} <br> {{ $usage && $maxusage ? 'Contact me on discord for increase panel limit.' : 'For use the addon you need to insert a license' }}</p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Status</label>\n <div>\n <p style=\"font-size: 50px\">{{$enabled ? '✅' : '\uD83D\uDEAB' }}</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"box-footer\">\n {!! csrf_field() !!}\n <button type=\"submit\" name=\"_method\" value=\"POST\" style=\"margin-left: 8px\" class=\"btn btn-sm btn-primary pull-right \">Save</button>\n {!! csrf_field() !!}\n <button type=\"submit\" name=\"_method\" value=\"DELETE\" class=\"btn btn-sm btn-danger pull-right \">Remove License</button>\n\n </form>\n </div>\n\n </div>\n </div>\n </div>\n@endsection\n</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"box-footer\">\n {!! csrf_field() !!}\n <button type=\"submit\" name=\"_method\" value=\"PATCH\" class=\"btn btn-sm btn-primary pull-right\">Save</button>\n </div>\n </form>\n </div>\n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/nav.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@php\n $router = app('router');\n@endphp\n<div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"nav-tabs-custom nav-tabs-floating\" style=\"margin-bottom: 1px;\">\n <ul class=\"nav nav-tabs\">\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter') ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter') }}\">Overview</a>\n </li>\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter.license') || $router->currentRouteNamed('admin.bagoucenter.license.addon')? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.license') }}\">License</a>\n </li>\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter.versions') || str_starts_with($router->current()->uri, 'admin/bagoucenter/versions') ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.versions') }}\">Version checker</a>\n </li>\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter.settings') || str_starts_with($router->current()->uri, 'admin/bagoucenter/settings') ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.settings') }}\">Settings</a>\n </li>\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter.support') || str_starts_with($router->current()->uri, 'admin/bagoucenter/support') ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.support') }}\">Support</a>\n </li>\n </ul>\n </div>\n </div>\n</div>"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/license/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/license/index.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n <h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav')\n@include('admin.bagoucenter.license.nav', ['addon' => null, 'addonslist' => $addonslist, 'licenses' => $licenses])\n\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou License</h3>\n </div>\n <p class=\"box-body\">\n You can manage your license here.\n <br>Actual license status:\n <ul>\n @foreach ($addonslist as $addon)\n @php\n $found = false;\n @endphp\n @foreach($licenses as $license) \n @if($license->addon == $addon['id'])\n @php\n $found = true;\n @endphp\n <li>{{$addon['name']}}: <span style=\"color: green;\">Activated</span></li>\n @endif\n @endforeach\n @if (!$found)\n <li>{{$addon['name']}}: <span style=\"color: red;\">Disabled</span></li>\n @endif\n @endforeach\n </ul>\n </p>\n </div>\n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/license/nav.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@php\n $router = app('router');\n@endphp\n<div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"nav-tabs-custom nav-tabs-floating\">\n <ul class=\"nav nav-tabs\">\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter.license') ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.license') }}\">Overview</a>\n </li>\n @foreach ($addonslist as $addonn) \n @if (isset($addonn['id']) && isset($addonn['name']))\n <li class=\"{{ $addon == $addonn['id'] ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.license.addon', $addonn['id']) }}\">{{$addonn['name']}} @if($addonn['new']) <span class=\"label label-success\"> NEW </span> @endif</a>\n </li>\n @endif\n @endforeach\n </ul>\n </div>\n </div>\n</div>"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/license/license.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n<h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav')\n@include('admin.bagoucenter.license.nav', ['addon' => $addon, 'addonslist' => $addonslist, 'licenses' => $licenses])\n\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou License</h3>\n </div>\n <form action=\"{{ route('admin.settings') }}\" method=\"POST\">\n <div class=\"box-body\">\n <div class=\"row\">\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Company Name</label>\n <div>\n <input type=\"text\" class=\"form-control\" name=\"app:name\" value=\"{{ old('app:name', config('app.name')) }}\" />\n <p class=\"text-muted\"><small>This is the name that is used throughout the panel and in emails sent to clients.</small></p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Require 2-Factor Authentication</label>\n <div>\n <div class=\"btn-group\" data-toggle=\"buttons\">\n @php\n $level = old('pterodactyl:auth:2fa_required', config('pterodactyl.auth.2fa_required'));\n @endphp\n <label class=\"btn btn-primary @if ($level == 0) active @endif\">\n <input type=\"radio\" name=\"pterodactyl:auth:2fa_required\" autocomplete=\"off\" value=\"0\" @if ($level == 0) checked @endif> Not Required\n </label>\n <label class=\"btn btn-primary @if ($level == 1) active @endif\">\n <input type=\"radio\" name=\"pterodactyl:auth:2fa_required\" autocomplete=\"off\" value=\"1\" @if ($level == 1) checked @endif> Admin Only\n </label>\n <label class=\"btn btn-primary @if ($level == 2) active @endif\">\n <input type=\"radio\" name=\"pterodactyl:auth:2fa_required\" autocomplete=\"off\" value=\"2\" @if ($level == 2) checked @endif> All Users\n </label>\n </div>\n <p class=\"text-muted\"><small>If enabled, any account falling into the selected grouping will be required to have 2-Factor authentication enabled to use the Panel.</small></p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Status</label>\n <div>\n <p>@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n <h1>Bagou License<small>Configure license for Bagou450 Addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou License</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav')\n@include('admin.bagoucenter.license.nav', ['addon' => $addon, 'addonslist' => $addonslist, 'licenses' => $licenses])\n\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou License</h3>\n </div>\n <form method=\"POST\">\n <div class=\"box-body\">\n <div class=\"row\">\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Addon license (Transaction id)</label>\n <div>\n <input type=\"text\" class=\"form-control\" name=\"license\" value=\"{{ $license }}\" />\n <p class=\"text-muted\"><small>Add here your transaction id if not work contact me on <a href=\"https://discord.bagou450.com\">discord</a></small></p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Usage</label>\n <div>\n <p>{{ $usage && $maxusage ? \"$usage / $maxusage panel(s)\" : 'No license' }} <br> {{ $usage && $maxusage ? 'Contact me on discord for increase panel limit.' : 'For use the addon you need to insert a license' }}</p>\n </div>\n </div>\n <div class=\"form-group col-md-4\">\n <label class=\"control-label\">Status</label>\n <div>\n <p style=\"font-size: 50px\">{{$enabled ? '✅' : '\uD83D\uDEAB' }}</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"box-footer\">\n {!! csrf_field() !!}\n <button type=\"submit\" name=\"_method\" value=\"POST\" style=\"margin-left: 8px\" class=\"btn btn-sm btn-primary pull-right \">Save</button>\n {!! csrf_field() !!}\n <button type=\"submit\" name=\"_method\" value=\"DELETE\" class=\"btn btn-sm btn-danger pull-right \">Remove License</button>\n\n </form>\n </div>\n\n </div>\n </div>\n </div>\n@endsection\n</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"box-footer\">\n {!! csrf_field() !!}\n <button type=\"submit\" name=\"_method\" value=\"PATCH\" class=\"btn btn-sm btn-primary pull-right\">Save</button>\n </div>\n </form>\n </div>\n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/settings": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/settings/index.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n <h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav')\n@include('admin.bagoucenter.settings.nav', ['addon' => null, 'addonslist' => $addonslist, 'licenses' => $licenses])\n\n <div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou Settings</h3>\n </div>\n <p class=\"box-body\">\n Choose a tab above for manage addon settings\n </p>\n </div>\n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/settings/nav.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@php\n $router = app('router');\n@endphp\n<div class=\"row\">\n <div class=\"col-xs-12\">\n <div class=\"nav-tabs-custom nav-tabs-floating\">\n <ul class=\"nav nav-tabs\">\n <li class=\"{{ $router->currentRouteNamed('admin.bagoucenter.settings') ? 'active' : '' }}\">\n <a href=\"{{ route('admin.bagoucenter.settings') }}\">Overview</a>\n </li>\n @foreach ($addonslist as $addonn)\n @foreach($licenses as $license) \n @if($license->addon == $addonn['id'] && $addonn['tab'])\n @php\n $found = true;\n @endphp\n <li class=\"{{ $addon == $addonn['id'] ? 'active' : '' }}\">\n <a href=\"{{ route($addonn['tabroute'], $addonn['id']) }}\">{{$addonn['name']}} @if($addonn['new']) <span class=\"label label-success\"> NEW </span> @endif</a>\n </li>\n @endif\n @endforeach\n @endforeach\n </ul>\n </div>\n </div>\n</div>"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/support": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/support/index.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n<h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav', ['addon' => null])\n\n <div class=\"row\" style=\"margin-top: 15px;\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou Support</h3>\n </div>\n <p class=\"box-body\">\n You can contact me trough many way!</span>.\n <br>\n <span style=\"font-size: 20px;\">Discord: <a href=\"http://discord.bagou450.com\">here</a> (24 hour response time) </span>\n <br>\n <span style=\"font-size: 20px;\">Sms (No call): +33 7 56 89 00 36 (24 hours response time) </span>\n <br>\n <span style=\"font-size: 20px;\">Email: contact@bagou450.com (48 hours response time) </span>\n\n </p>\n </div>\n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/versions": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/versions/index.blade.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "@extends('layouts.admin')\n@include('partials/admin.settings.nav', ['activeTab' => 'basic'])\n\n@section('title')\n Bagou License\n@endsection\n\n@section('content-header')\n <h1>Bagou Center<small>Manage all bagou450 addons.</small></h1>\n <ol class=\"breadcrumb\">\n <li><a href=\"{{ route('admin.index') }}\">Admin</a></li>\n <li class=\"active\">Bagou Center</li>\n </ol>\n@endsection\n@section('content')\n@include('admin.bagoucenter.nav')\n\n <div class=\"row\" style=\"margin-top: 15px;\">\n <div class=\"col-xs-12\">\n <div class=\"box\">\n <div class=\"box-header with-border\">\n <h3 class=\"box-title\">Bagou Update Checker</h3>\n </div>\n <p class=\"box-body\">\n You can manage your license here.\n <br>Actual license status:\n <ul>\n @foreach ($addonslist as $addon)\n @foreach($licenses as $license) \n @if($license->addon == $addon['id'])\n <li>{{$addon['name']}} {{$license->version}}: @if($addon['version'] == $license->version) <span style=\"color: green;\">Updated</span> @else <span style=\"color: red;\">Outdated (Latest version: {{$addon['version']}})</span> @endif</li>\n @endif\n @endforeach\n @endforeach\n </ul>\n \n </p>\n <div class=\"box-footer\">\n <form method=\"POST\">\n @csrf\n <button type=\"submit\" name=\"_method\" value=\"POST\" style=\"margin-left: 8px\" class=\"btn btn-sm btn-primary pull-right \">Refresh</button>\n</form>\n </div>\n </div>\n \n </div>\n </div>\n@endsection"
|
|
}
|
|
],
|
|
"./resources/views/layouts/admin.blade.php": [
|
|
{
|
|
"type": "above",
|
|
"theme": "any",
|
|
"where": "<li class=\"header\">MANAGEMENT</li>",
|
|
"add": " <li class=\"{{ ! starts_with(Route::currentRouteName(), 'admin.bagoucenter') ?: 'active' }}\">\n <a href=\"{{ route('admin.bagoucenter')}}\">\n <i class=\"fa fa-globe\"></i> <span>Bagou Center</span>\n </a>\n </li>"
|
|
}
|
|
],
|
|
"resources/scripts/routers/routes.ts": [
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " {\n path: '/files',\n permission: 'file.*',\n name: 'Files',\n component: FileManagerContainer,\n },",
|
|
"add": " {\n path: '/minecraft/modpacks',\n permission: 'file.*',\n name: 'Modpacks',\n nestId: 1,\n component: McModpacksContainer,\n },"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "{\n path: '/databases',\n permission: 'database.*',\n name: 'Databases',\n icon: DatabaseIcon,\n component: DatabasesContainer,\n },",
|
|
"add": " {\n path: '/minecraft/modpacks',\n permission: 'file.*',\n name: 'Modpacks',\n nestId: 1,\n icon: ListIcon,\n component: McModpacksContainer,\n },"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "{\n path: '/databases',\n permission: 'database.*',\n name: 'Databases',\n icon: Icon.Database,\n component: DatabasesContainer,\n },",
|
|
"add": " {\n path: '/minecraft/modpacks',\n permission: 'file.*',\n name: 'Modpacks',\n nestId: 1,\n icon: Icon.List,\n component: McModpacksContainer,\n },"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "import ServerActivityLogContainer from '@/components/server/ServerActivityLogContainer';",
|
|
"add": "import McModpacksContainer from '@/components/server/mcmodpacks/McModpacksContainer';"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "permission: string | string[] | null;",
|
|
"add": " nestId?: number;\n eggId?: number;\n nestIds?: number[];\n eggIds?: number[];"
|
|
}
|
|
],
|
|
"./resources/scripts/routers/ServerRouter.tsx": [
|
|
{
|
|
"type": "replace",
|
|
"theme": "no",
|
|
"where": "{routes.server\n .filter((route) => !!route.name)\n .map((route) =>\n route.permission ? (\n <Can key={route.path} action={route.permission} matchAny>\n <NavLink to={to(route.path, true)} exact={route.exact}>\n {route.name}\n </NavLink>\n </Can>\n ) : (\n <NavLink key={route.path} to={to(route.path, true)} exact={route.exact}>\n {route.name}\n </NavLink>\n )\n )}",
|
|
"add": "<Navigation />"
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"theme": "no",
|
|
"where": "{routes.server.map(({ path, permission, component: Component }) => (\n <PermissionRoute key={path} permission={permission} path={to(path)} exact>\n <Spinner.Suspense>\n <Component />\n </Spinner.Suspense>\n </PermissionRoute>\n ))}",
|
|
"add": "<ComponentLoader />"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "no",
|
|
"where": "import routes from '@/routers/routes';",
|
|
"add": "import { Navigation, ComponentLoader } from '@/routers/ServerElements';"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/getServer.ts": [
|
|
{
|
|
"type": "under",
|
|
"where": "allocations: Allocation[];",
|
|
"theme": "any",
|
|
"add": " eggId: number;"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"where": "allocations: Allocation[];",
|
|
"theme": "any",
|
|
"add": " nestId: number;"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " allocations: ((data.relationships?.allocations as FractalResponseList | undefined)?.data || []).map(\n rawDataToServerAllocation\n ),\n",
|
|
"add": " nestId: data.nest_id,"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " allocations: ((data.relationships?.allocations as FractalResponseList | undefined)?.data || []).map(\n rawDataToServerAllocation\n ),\n",
|
|
"add": " eggId: data.egg_id,"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"where": "allocations: Allocation[];",
|
|
"theme": "any",
|
|
"add": " mcversion: string;\n"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " allocations: ((data.relationships?.allocations as FractalResponseList | undefined)?.data || []).map(\n rawDataToServerAllocation\n ),\n",
|
|
"add": " mcversion: data.mcversion,\n"
|
|
}
|
|
],
|
|
"./resources/lang/en/activity.php": [
|
|
{
|
|
"type": "above",
|
|
"theme": "any",
|
|
"add": " 'versions' => [\n 'install' => 'Installation of :name',\n ],",
|
|
"where": "'subuser' => ["
|
|
}
|
|
],
|
|
"./routes/api-client.php": [
|
|
{
|
|
"type": "above",
|
|
"theme": "any",
|
|
"where": " Route::group(['prefix' => '/settings'], function () {",
|
|
"add": " Route::group(['prefix' => '/mcmodpacks'], function () {\n Route::get('/', [Client\\Servers\\Bagou\\Minecraft\\ModPacksController::class, 'getModPacks']);\n Route::get('/mcversions', [Client\\Servers\\Bagou\\Minecraft\\ModPacksController::class, 'getMcVersions']);\n Route::get('/description', [Client\\Servers\\Bagou\\Minecraft\\ModPacksController::class, 'getModpacksDescription']);\n Route::get('/getversionsize', [Client\\Servers\\Bagou\\Minecraft\\ModPacksController::class, 'getversionsize']);\n Route::post('/install', [Client\\Servers\\Bagou\\Minecraft\\ModPacksController::class, 'install']);\n });"
|
|
}
|
|
],
|
|
"./app/Transformers/Api/Client/ServerTransformer.php": [
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "'name' => $server->name,",
|
|
"add": " 'nest_id' => $server->nest_id,\n 'egg_id' => $server->egg_id,"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "'name' => $server->name,",
|
|
"add": "'mcversion' => $server->mcversion,\n"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/files/UploadButton.tsx": [
|
|
{
|
|
"type": "replace",
|
|
"theme": "any",
|
|
"where": "data: ProgressEvent, name: string",
|
|
"add": "data: any, name: string"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/settings/RenameServerBox.tsx": [
|
|
{
|
|
"type": "replace",
|
|
"theme": "any",
|
|
"where": " description: string;",
|
|
"add": " description: any;"
|
|
}
|
|
]
|
|
}
|