mirror of
https://github.com/barkeser2002/pterodactyl-addons.git
synced 2026-09-25 02:19:54 +03:00
450 lines
100 KiB
JSON
Executable File
450 lines
100 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/BagouMcVersionsController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Admin\\Bagou;\n\nuse Illuminate\\Support\\Facades\\Http;\nuse Illuminate\\View\\View;\nuse Prologue\\Alerts\\AlertsMessageBag;\nuse Pterodactyl\\Http\\Controllers\\Controller;\nuse Illuminate\\Http\\Request;\nuse Pterodactyl\\Models\\Bagoulicense;\nuse Pterodactyl\\Models\\MinecraftModpacks;\n\nclass BagouMcVersionsController extends Controller\n{\n protected $alert;\n\n public function __construct(\n AlertsMessageBag $alert\n ) {\n $this->alert = $alert;\n }\n /**\n * Display version \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 $modpacks = MinecraftModpacks::get();\n return view('admin.bagoucenter.settings.mcversions.index', ['licenses' => $licenses, 'addonslist' => $addonslist, 'modpacks' => $modpacks]);\n }\n /**\n * Add Versions\n */\n public function add(Request $request): View\n {\n if(!ends_with($request->url, ['zip', 'tar.gz', 'tar.xz'])) {\n $this->alert->danger('The url is invalid (is not a direct link to a zip,tar.gz or tar.xz!')->flash();\n return $this->index();\n }\n MinecraftModpacks::create(['name' => $request->name, 'version' => $request->version, 'mcversion' => $request->mcversion, 'url' => $request->url , 'icon' => $request->icon]);\n $this->alert->success('Modpack added sucessfully!')->flash();\n return $this->index();\n\n }\n /**\n * Delete Versions\n */\n public function delete(string $id): View\n {\n MinecraftModpacks::where('id', '=', $id)->delete();\n $this->alert->success('Modpack removed sucessfully!')->flash();\n return $this->index();\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/VersionsController.php": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "<?php\n\nnamespace Pterodactyl\\Http\\Controllers\\Api\\Client\\Servers;\n\nuse Pterodactyl\\Models\\Egg;\nuse Pterodactyl\\Models\\MinecraftModpacks;\nuse Pterodactyl\\Models\\Server;\nuse Pterodactyl\\Models\\ServerVariable;\nuse Pterodactyl\\Repositories\\Eloquent\\ServerRepository;\nuse Pterodactyl\\Http\\Controllers\\Api\\Client\\ClientApiController;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Http;\nuse Pterodactyl\\Repositories\\Wings\\DaemonFileRepository;\nuse Pterodactyl\\Facades\\Activity;\nuse Pterodactyl\\Models\\Bagoulicense;\nuse Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException;\nuse Pterodactyl\\Models\\EggVariable;\nclass VersionsController extends ClientApiController\n{\n /**\n * @var \\Pterodactyl\\Repositories\\Eloquent\\ServerRepository\n */\n private $repository;\n\n /**\n * ClientController constructor.\n */\n public function __construct(\n ServerRepository $repository,\n DaemonFileRepository $fileRepository\n ) {\n parent::__construct();\n\n $this->repository = $repository;\n $this->fileRepository = $fileRepository;\n }\n public function listversion(Request $request)\n {\n $license = Bagoulicense::where(\"addon\", \"296\")->first();\n if (!$license) {\n return new BadRequestHttpException(\n \"No license for this addons please setup the license trough admin tab.\"\n );\n }\n $license = $license[\"license\"];\n $versionsType = $request->versionsType;\n $versions = [];\n $url = $_SERVER[\"SERVER_NAME\"];\n if($versionsType === 'modpacks' && $request->modpacktype === 'others') {\n $modpacks = MinecraftModpacks::get();\n $versions = array('message' => 'Good', 'data' => $modpacks);\n } else {\n $versions = Http::accept(\"application/json\")\n ->get(\n \"https://api.bagou450.com/api/client/pterodactyl/mcversions?id=$license&stype=$versionsType&url=$url&page=$request->page&modpacktype=$request->modpacktype\"\n )\n ->json();\n }\n\n if ($versions['message'] !== \"Good\") {\n return [\"status\" => \"error\", \"response\" => []];\n }\n return $versions;\n }\n public function installversion(Server $server, Request $request)\n {\n $license = Bagoulicense::where(\"addon\", \"296\")->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 $version = $request->minecraftVersions[\"version\"];\n ini_set(\"memory_limit\", \"512M\");\n $urlsize = \"\";\n\n if ($request->type == \"3\") {\n $url = $request->minecraftVersions[\"Url\"];\n $url = Http::get(\n \"https://api.bagou450.com/api/client/pterodactyl/mcversions/download?id=$license&type=$request->type&version=$version&stype=$request->stype&url=$url&zip=no\"\n )->json();\n } else {\n if (\n $request->stype == \"fabric\" ||\n $request->stype == \"forge\" ||\n $request->stype == \"mohist\" ||\n $request->stype == \"modpacks\"\n ) {\n if(isset($request->minecraftVersions[\"url\"])) {\n $url = array('message' => 'Good', 'data' => $request->minecraftVersions[\"url\"], 'size' => get_headers($request->minecraftVersions[\"url\"], true)['Content-Length']);\n } else {\n $url = Http::get(\n \"https://api.bagou450.com/api/client/pterodactyl/mcversions/download?id=$license&type=$request->type&version=\" .\n rawurlencode($version) .\n \"&stype=\" .\n rawurlencode($request->stype) .\n \"&url=a&zip=yes\"\n )->json();\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_JARFILE}}\" || printf %s \"@unix_args.txt\" )',\n ]);\n }\n } else {\n $url = Http::get(\n \"https://api.bagou450.com/api/client/pterodactyl/mcversions/download?id=$license&type=$request->type&version=$version&stype=$request->stype&url=a&zip=no\"\n )->json();\n }\n }\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->stype $version\",\n ]);\n Activity::event(\"server:versions.install\")\n ->property(\"name\", $request->name)\n ->log();\n if($request->stype === 'bungeecord' || $request->stype === 'velocity') {\n\n $eggId = Egg::where('name', 'Bungeecord')->firstOrFail()->id;\n Server::where('id', '=', $server->id)->update(['egg_id' => $eggId]);\n $eggVariableId = EggVariable::where('name', '=', 'Bungeecord Jar File')->where('egg_id', '=', $eggId)->firstOrFail()->id;\n ServerVariable::where('server_id', '=', $server->id)->where('id', '=', $eggVariableId)->update(['variable_value' => 'server.jar']);\n } else {\n $eggId = Egg::where('name', 'Paper')->firstOrFail()->id;\n Server::where('id', '=', $server->id)->update(['egg_id' => $eggId]);\n }\n return $url['size'];\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"
|
|
}
|
|
],
|
|
"./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/2022_10_26_123454_add_icon_field_to_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 AddIconFieldToModpacklistTable extends Migration\n{\n /**\n * Run the migrations.\n *\n * @return void\n */\n public function up()\n {\n Schema::table('modpacklist', function (Blueprint $table) {\n $table->string('icon');\n });\n }\n\n /**\n * Reverse the migrations.\n *\n * @return void\n */\n public function down()\n {\n Schema::table('modpacklist', function (Blueprint $table) {\n $table->dropColumn('icon');\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/version/": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/version/getMinecraftVersions.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import useSWR from 'swr';\nimport { createContext, useContext } from 'react';\nimport { ServerContext } from '@/state/server';\nimport http, { PaginatedResult } from '@/api/http';\ninterface ctx {\n page: number;\n setPage: (value: number | ((s: number) => number)) => void;\n searchFilter: string;\n setSearchFilter: (value: string | ((s: string) => string)) => void;\n versionsType: string;\n setVersionsType: (value: string | ((s: string) => string)) => void;\n modpacktype: string;\n setModpacktype: (value: string | ((s: string) => string)) => void;\n}\n\nexport const MinecraftVersionsContext = createContext<ctx>({ page: 1, setPage: () => 1, searchFilter: '', setSearchFilter: () => '', modpacktype: 'curseforge', setModpacktype: () => '',versionsType: 'vanilla', setVersionsType: () => ''});\n\nexport default () => {\n const { page, searchFilter, modpacktype, versionsType } = useContext(MinecraftVersionsContext);\n const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);\n return useSWR<PaginatedResult<any>>([ 'server:minecraftVersion', page, searchFilter, modpacktype, versionsType ], async () => {\n console.log(versionsType)\n const { data } = await http.get(`/api/client/servers/${uuid}/versions/listversion`, {\n params: { versionsType, page, modpacktype },\n timeout: 60000,\n });\n\n return {\n items: (data.data || []),\n pagination: { total: data.page*16, count: data.data.length, perPage: 16, currentPage: page, totalPages: data.page },\n };\n });\n};\n"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/version/InstallMinecraftVersion.ts": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import http from '@/api/http';\n\nexport default async (\n uuid: string,\n name: string,\n stype: string,\n minecraftVersions: any,\n type: string\n): Promise<any> => {\n return new Promise((resolve, reject) => {\n http\n .post(`/api/client/servers/${uuid}/versions/installversion`, { name, type, minecraftVersions, stype })\n .then((data) => resolve(data.data))\n .catch(reject);\n });\n};\n\n"
|
|
}
|
|
],
|
|
"./resources/scripts/api/server/version/getVersionFileSize.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}/versions/getversionsize`, { params: { filename } })\n .then((data) => resolve(data.data))\n .catch(reject);\n });\n};\n\n"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/versions": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/versions/McVersionsContainer.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 FlashMessageRender from '@/components/FlashMessageRender';\nimport tw from 'twin.macro';\nimport ServerContentBlock from '@/components/elements/ServerContentBlock';\nimport McVersionsRow from './McVersionsRow';\nimport { ServerContext } from '@/state/server';\nimport getMinecraftVersions, { MinecraftVersionsContext } from '@/api/server/version/getMinecraftVersions';\nimport GreyRowBox from '@/components/elements/GreyRowBox';\nimport Select from '@/components/elements/Select';\nimport Pagination from '@/components/elements/PaginationMc';\n\nconst custom = false;\nconst modpacks = true;\n\nconst VersionSelect = () => {\n const { versionsType, setVersionsType, setPage, modpacktype, setModpacktype } = useContext(MinecraftVersionsContext);\n return (\n <><p>\n <span css={tw`font-bold`}>Version selector</span>\n <br />\n Select the version you want to run your server with.\n </p><Select\n onChange={(e) => { console.log(e.target.value); setVersionsType(e.target.value); setPage(1); } }\n defaultValue={versionsType}\n >\n <option key={1} value={'vanilla'}>\n Vanilla\n </option>\n <option key={2} value={'snapshot'}>\n Snapshot\n </option>\n <option key={3} value={'spigot'}>\n Spigot\n </option>\n <option key={4} value={'paper'}>\n Paper\n </option>\n <option key={5} value={'purpur'}>\n Purpur\n </option>\n <option key={6} value={'sponge'}>\n Sponge\n </option>\n <option key={7} value={'bungeecord'}>\n Bungeecord\n </option>\n <option key={8} value={'waterfall'}>\n Waterfall\n </option>\n <option key={9} value={'velocity'}>\n Velocity\n </option>\n <option key={10} value={'forge'}>\n Forge\n </option>\n <option key={11} value={'fabric'}>\n Fabric\n </option>\n <option key={12} value={'mohist'}>\n Mohist\n </option>\n <option key={13} value={'magma'}>\n Magma\n </option>\n <option key={14} value={'catserver'}>\n Catserver\n </option>\n {modpacks && (\n <option key={15} value={'modpacks'}>\n Modpacks\n </option>\n )}\n {custom && (\n <option key={16} value={'others'}>\n Others\n </option>\n )}\n </Select><div css={versionsType !== 'modpacks' ? tw`hidden` : tw`flex grid grid-cols-2 col-span-2`}>\n <p>\n Select the platform you want to search modpacks.\n </p>\n <Select\n onChange={(e) => { setModpacktype(e.target.value); setPage(1); } }\n defaultValue={modpacktype}\n >\n <option key={1} value={'curseforge'}>\n CurseForge\n </option>\n <option key={2} value={'technic'}>\n Technic Platform\n </option>\n <option key={3} value={'others'}>\n Others\n </option>\n </Select>\n </div></>\n )\n}\nconst McVersionsVanillaContainer = () => {\n const { clearFlashes, clearAndAddHttpError } = useFlash();\n const mcversion = ServerContext.useStoreState((state) => state.server.data!.mcversion);\n const { data: minecraftVersions, error, isValidating } = getMinecraftVersions();\n const { versionsType, setPage, modpacktype } = useContext(MinecraftVersionsContext);\n\n useEffect(() => {\n if (!error) {\n clearFlashes('server:minecraftVersion');\n\n return;\n }\n\n clearAndAddHttpError({ error, key: 'server:minecraftVersion' });\n }, [error]);\n if (!minecraftVersions || (error && isValidating)) {\n return <Spinner size={'large'} centered />;\n }\n return (\n <ServerContentBlock title={'Minecraft Version ' + versionsType}>\n <FlashMessageRender byKey={'server:minecraftVersion'} css={tw`mb-2`} />\n {mcversion !== null && (\n <p css={tw`text-lg text-center mb-2`}>\n Current version: <span css={tw`text-cyan-600`}>{mcversion.charAt(0).toUpperCase() + mcversion.slice(1)}</span>\n </p>\n )}\n\n <Pagination data={minecraftVersions} onPageSelect={setPage} custompage={'grid grid-cols-1 md:grid-cols-3'} customcss={tw`md:col-span-3`}> \n {({ items }) =>\n !items.length ? (\n <>\n <GreyRowBox css={tw`grid grid-cols-2 col-span-2 mt-2 mr-2`}>\n <VersionSelect/>\n </GreyRowBox>\n <p css={tw`text-center text-sm text-neutral-300 col-span-3`}>Can't find any version on the server</p>\n </>\n ) : (\n <>\n <GreyRowBox css={tw`grid grid-cols-2 col-span-2 mt-2 mr-2`}>\n <VersionSelect/>\n </GreyRowBox>\n {items.map((minecraftVersions, index) => (\n <McVersionsRow\n key={index}\n minecraftVersions={minecraftVersions}\n type={versionsType}\n stype={versionsType}\n modpacktype={modpacktype}\n css={tw`mt-2 mr-2`}\n />\n ))}\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 [ versionsType, setVersionsType ] = useState<string>('vanilla');\n const [ modpacktype, setModpacktype ] = useState<string>('curseforge');\n\n return (\n <MinecraftVersionsContext.Provider value={{ page, setPage, searchFilter, setSearchFilter, modpacktype, setModpacktype, versionsType, setVersionsType }}>\n <McVersionsVanillaContainer/>\n </MinecraftVersionsContext.Provider>\n );\n};\n\n\n"
|
|
}
|
|
],
|
|
"./resources/scripts/components/server/versions/McVersionsRow.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faDownload } from '@fortawesome/free-solid-svg-icons';\nimport tw from 'twin.macro';\nimport GreyRowBox from '@/components/elements/GreyRowBox';\nimport { ServerContext } from '@/state/server';\nimport Button from '@/components/elements/Button';\nimport deleteFiles from '@/api/server/files/deleteFiles';\nimport { ApplicationStore } from '@/state';\nimport { Actions, useStoreActions } from 'easy-peasy';\nimport ConfirmationModal from '@/components/elements/ConfirmationModal';\nimport setSelectedDockerImage from '@/api/server/setSelectedDockerImage';\nimport InstallMinecraftVersion from '@/api/server/version/InstallMinecraftVersion';\nimport getVersionFileSize from '@/api/server/version/getVersionFileSize';\nimport decompressFiles from '@/api/server/files/decompressFiles';\nimport SpinnerOverlay from '@/components/elements/SpinnerOverlay';\nimport { bytesToString } from '@/lib/formatters';\nimport renameFiles from '@/api/server/files/renameFiles';\n\ninterface Props {\n minecraftVersions: any;\n className?: string;\n stype: string;\n type: string;\n modpacktype: string;\n}\n\nexport default ({ minecraftVersions, className, stype, type, modpacktype }: Props) => {\n const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid);\n const [disabled, setDisabled] = useState(false);\n const { addFlash, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);\n const [visible, setVisible] = useState(false);\n const [pourcentage, setPourcentage] = useState('');\n const name = stype.charAt(0).toUpperCase() + stype.slice(1) + ' ' + minecraftVersions.version;\n let dockerimage = 'ghcr.io/pterodactyl/yolks:java_8';\n if(stype !== 'modpacks') {\n if (parseInt(minecraftVersions.version.slice(2)) >= 17) {\n dockerimage = 'ghcr.io/pterodactyl/yolks:java_16';\n }\n if (parseInt(minecraftVersions.version.slice(2)) >= 18) {\n dockerimage = 'ghcr.io/pterodactyl/yolks:java_17';\n }\n } else if (minecraftVersions.mcversion) {\n if (parseInt(minecraftVersions.mcversion) >= 17) {\n dockerimage = 'ghcr.io/pterodactyl/yolks:java_16';\n }\n if (parseInt(minecraftVersions.mcversion) >= 18) {\n dockerimage = 'ghcr.io/pterodactyl/yolks:java_17';\n }\n }\nconsole.log(dockerimage)\n function clear() {\n clearFlashes();\n }\n const Install = () => {\n setVisible(false);\n setDisabled(true);\n setPourcentage('Delete old versions...');\n deleteFiles(uuid, '/', ['server.jar', 'zip.zip', 'libraries', 'fontfiles', 'worldshape', 'oresources', 'resources', 'structures', 'scripts', 'unix_args.txt', 'user_jvm_args.txt', 'config', 'mods'])\n .then(() => {\n InstallMinecraftVersion(\n uuid,\n type.charAt(0).toUpperCase() + type.slice(1) + ' ' + minecraftVersions.version,\n stype,\n minecraftVersions,\n type\n )\n .then((data) => {\n setPourcentage('Setup requirements...');\n const filename =\n stype === 'forge' || stype === 'fabric' || stype === 'mohist' || stype === 'modpacks'\n ? modpacktype === 'others'\n ? minecraftVersions.url.replace(/^.*[\\\\/]/, '')\n : `${minecraftVersions.version}.zip`\n : stype === 'magma' ?\n `${minecraftVersions.version}.jar`\n : `${minecraftVersions.version}`;\n let oldsize = 0;\n const Download = setInterval(function () {\n getVersionFileSize(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 if (filename.endsWith('tar.xz') || filename.endsWith('zip') || filename.endsWith('tar.gz')) {\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 addFlash({\n key: 'server:minecraftVersion',\n type: 'success',\n message: 'Version changed successfully',\n });\n setDisabled(false);\n setTimeout(clear, 3000);\n });\n })\n .catch((err) => {\n clearInterval(Download);\n addFlash({\n key: 'server:minecraftVersion',\n type: 'error',\n message: \"Can't install the version.\",\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:minecraftVersion',\n type: 'error',\n message: \"Can't install the version.\",\n });\n console.log(err);\n setDisabled(false);\n setTimeout(clear, 3000);\n });\n } else {\n setPourcentage('Rename files...');\n renameFiles(uuid, '/', [{ from: filename, to: 'server.jar' }])\n .then(() => {\n setPourcentage('Change java version...');\n setSelectedDockerImage(uuid, dockerimage)\n .then(() => {\n addFlash({\n key: 'server:minecraftVersion',\n type: 'success',\n message: 'Version changed successfully',\n });\n setDisabled(false);\n setTimeout(clear, 3000);\n })\n .catch((err) => {\n clearInterval(Download);\n addFlash({\n key: 'server:minecraftVersion',\n type: 'error',\n message: \"Can't install the version.\",\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:minecraftVersion',\n type: 'error',\n message: \"Can't install the version.\",\n });\n console.log(err);\n setDisabled(false);\n setTimeout(clear, 3000);\n });\n }\n }\n })\n .catch((err) => {\n clearInterval(Download);\n addFlash({\n key: 'server:minecraftVersion',\n type: 'error',\n message: \"Can't install the version.\",\n });\n console.log(err);\n setDisabled(false);\n });\n }, 1000);\n })\n .catch((error) => {\n addFlash({\n key: 'server:minecraftVersion',\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:minecraftVersion',\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`grid grid-rows-2`} className={className}>\n <SpinnerOverlay fixed={true} size={'large'} visible={disabled}>\n <div css={tw`text-white mt-2`}>{pourcentage}</div>\n </SpinnerOverlay>\n <ConfirmationModal\n visible={visible}\n title={`Install the ${name}?`}\n buttonText={'Install'}\n onConfirmed={() => Install()}\n onModalDismissed={() => setVisible(false)}\n >\n <p css={tw`text-neutral-300`}>This action remove server.jar,libraries,mods,resources,scripts,fontfiles,oresources and config folder from the server.</p>\n <p css={tw`text-neutral-300`}>Are you sure you want to continue?</p>\n </ConfirmationModal>\n <div css={tw`mx-auto`}>\n <div css={tw`flex`}>\n <img src={stype !== 'modpacks' ? `https://cdn.bagou450.com/img/${stype}-icon.jpg` : modpacktype !== 'others' ? `https://cdn.bagou450.com/img/modpacks/${minecraftVersions.name.toLowerCase()}.png` : minecraftVersions.icon} css={tw`mr-3 h-8 w-8`} />\n {stype === 'modpacks' ? (\n <p css={tw`my-auto`}>\n {modpacktype === 'others' ? minecraftVersions.name : minecraftVersions.version}{' : '}\n <span css={tw`text-cyan-600`}>{minecraftVersions.mcversion} </span>\n </p>\n ):(\n <p css={tw`my-auto`}>\n {stype.charAt(0).toUpperCase() + stype.slice(1) + ': '}\n <span css={tw`text-cyan-600`}>{minecraftVersions.version} </span>\n </p>\n )}\n\n </div>\n </div>\n <div css={tw`mx-auto mt-2`}>\n <Button\n type={'button'}\n color={'grey'}\n isSecondary\n onClick={() => setVisible(true)}\n isLoading={disabled}\n title='Install'\n >\n <p css={disabled ? tw`mr-4 ml-4 invisible` : tw`mr-4 ml-4`}>\n <FontAwesomeIcon icon={faDownload} /> Install\n </p>\n </Button>\n </div>\n </GreyRowBox>\n );\n};\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/PaginationMc.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "no",
|
|
"add": "import React from 'react';\nimport { PaginatedResult } from '@/api/http';\nimport tw, { TwStyle } 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 showGoToLast?: boolean;\n showGoToFirst?: boolean;\n customcss?: TwStyle;\n custompage?: string;\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 }, onPageSelect, customcss, custompage, 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={customcss ? customcss : tw`mt-4 flex justify-center`}>\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;\n\n"
|
|
}
|
|
],
|
|
"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: '/versions',\n permission: 'file.*',\n name: 'Version',\n nestId: 1,\n component: McVersionsContainer,\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: '/versions',\n permission: 'file.*',\n name: 'Version',\n icon: ListIcon,\n nestId: 1,\n component: McVersionsContainer,\n },"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "{\n path: '/databases',\n permission: 'database.*',\n name: Lang.Databases,\n icon: Icon.Database,\n component: DatabasesContainer,\n },",
|
|
"add": " {\n path: '/versions',\n permission: 'file.*',\n name: 'Versions',\n icon: Icon.List,\n nestId: 1,\n component: McVersionsContainer,\n },"
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"theme": "any",
|
|
"where": "UserIcon, ",
|
|
"add": "ListIcon, "
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": "import ServerActivityLogContainer from '@/components/server/ServerActivityLogContainer';",
|
|
"add": "import McVersionsContainer from '@/components/server/versions/McVersionsContainer';"
|
|
},
|
|
{
|
|
"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[];\n",
|
|
"theme": "any",
|
|
"add": " eggId: number;"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"where": "allocations: Allocation[];\n",
|
|
"theme": "any",
|
|
"add": " nestId: number;"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " node: data.node,\n",
|
|
"add": " nestId: data.nest_id,"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " node: data.node,\n",
|
|
"add": " eggId: data.egg_id,"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"where": "allocations: Allocation[];\n",
|
|
"theme": "any",
|
|
"add": " mcversion: string;\n"
|
|
},
|
|
{
|
|
"type": "under",
|
|
"theme": "any",
|
|
"where": " node: data.node,\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",
|
|
"add": " Route::group(['prefix' => '/versions'], function () {\n Route::get('/listversion', [Client\\Servers\\VersionsController::class, 'listversion']);\n Route::get('/getversionsize', [Client\\Servers\\VersionsController::class, 'getversionsize']);\n\n Route::post('/installversion', [Client\\Servers\\VersionsController::class, 'installversion']);\n });",
|
|
"where": " Route::group(['prefix' => '/settings'], function () {"
|
|
}
|
|
],
|
|
"./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});"
|
|
},
|
|
{
|
|
"type": "above",
|
|
"theme": "any",
|
|
"add": "\tRoute::group(['prefix' => 'settings/addon/mcversion'], function () {\n\t Route::get('/', [Admin\\Bagou\\BagouMcVersionsController::class, 'index'])->name('admin.bagoucenter.settings.addon.mcversions');\n Route::post('/', [Admin\\Bagou\\BagouMcVersionsController::class, 'add']);\n Route::delete('/{name}', [Admin\\Bagou\\BagouMcVersionsController::class, 'delete']);\n\t});",
|
|
"where": "Route::delete('/license/{addon}', [Admin\\Bagou\\BagouLicenseController::class, 'removelicense']);"
|
|
}
|
|
],
|
|
"./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/api/http.ts": [
|
|
{
|
|
"type": "above",
|
|
"theme": "any",
|
|
"where": "export interface PaginationDataSet {",
|
|
"add": "export interface VersionsResult<T> {\n items: T[];\n}"
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"theme": "any",
|
|
"where": "20000",
|
|
"add": "120000"
|
|
}
|
|
],
|
|
"./resources/scripts/components/elements/VersionsList.tsx": [
|
|
{
|
|
"type": "newfile",
|
|
"theme": "any",
|
|
"add": "import React from 'react';\nimport { VersionsResult } from '@/api/http';\ninterface RenderFuncProps<T> {\n items: T[];\n}\n\ninterface Props<T> {\n data: VersionsResult<T>;\n children: (props: RenderFuncProps<T>) => React.ReactNode;\n}\n\nfunction VersionsList<T>({ data: { items }, children }: Props<T>) {\n return <>{children({ items })}</>;\n}\n\nexport default VersionsList;\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/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;"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/settings/mcversions": [
|
|
{
|
|
"type": "folder"
|
|
}
|
|
],
|
|
"./resources/views/admin/bagoucenter/settings/mcversions/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\" 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 Modpacks list</h3>\n <div class=\"box-tools\">\n <button class=\"btn btn-sm btn-primary\" data-toggle=\"modal\" data-target=\"#newModPackModal\">Create New</button>\n </div>\n </div>\n <div class=\"box-body table-responsive no-padding\">\n <table class=\"table table-hover\">\n <tbody>\n <tr>\n <th>Icon</th>\n <th>Name</th>\n <th>Version</th>\n <th>McVersion</th>\n <th>URL</th>\n <th></th>\n </tr>\n @foreach ($modpacks as $modpack)\n <tr>\n\n <td><img src=\"{{ $modpack->icon }}\" alt=\"modpack icon\" height=\"64px\" width=\"64px\"/> </td>\n <td>{{ $modpack->name }}</td>\n <td>{{ $modpack->version }}</td>\n <td>{{ $modpack->mcversion }}</td>\n <td>{{ $modpack->url }}</td>\n <td>\n <a href=\"#\" data-action=\"remove-modpack\" data-attr=\"{{ $modpack->id }}\">\n <i class=\"fa fa-trash text-danger\"></i>\n </a>\n </td>\n </tr>\n @endforeach\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n<div class=\"modal fade\" id=\"newModPackModal\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <form action=\"{{ route('admin.bagoucenter.settings.addon.mcversions') }}\" method=\"POST\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\">Create New Modpack</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"form-group\">\n <label for=\"pName\" class=\"form-label\">Name</label>\n <input type=\"text\" name=\"name\" id=\"pName\" class=\"form-control\" />\n <p class=\"text-muted small\">The name of the modpack</p>\n </div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <label for=\"pHost\" class=\"form-label\">Version</label>\n <input type=\"text\" name=\"version\" id=\"pVersion\" class=\"form-control\" />\n <p class=\"text-muted small\">The version of the modpack</p>\n </div>\n <div class=\"col-md-6\">\n <label for=\"pPort\" class=\"form-label\">Minecraft Version</label>\n <input type=\"text\" name=\"mcversion\" id=\"pMcversion\" class=\"form-control\"/>\n <p class=\"text-muted small\">The Minecraft version of the modpack.</p>\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"pUrl\" class=\"form-label\">Url</label>\n <input type=\"text\" name=\"url\" id=\"pUrl\" class=\"form-control\" />\n <p class=\"text-muted small\">The download url of the modpack (This MUST be a direct download link)</p>\n </div>\n <div class=\"form-group\">\n <label for=\"pIcon\" class=\"form-label\">Icon</label>\n <input type=\"text\" name=\"icon\" id=\"pIcon\" class=\"form-control\" />\n <p class=\"text-muted small\">The icon of the modpack (must be a direct link).</p>\n </div>\n </div>\n <div class=\"modal-footer\">\n {!! csrf_field() !!}\n <button type=\"button\" class=\"btn btn-secondary btn-sm pull-left\" data-dismiss=\"modal\">Cancel</button>\n <button type=\"submit\" class=\"btn btn-success btn-sm\">Create</button>\n </div>\n </form>\n </div>\n </div>\n</div>\n@endsection\n\n@section('footer-scripts')\n @parent\n <script>\n $(document).ready(function() {\n $('[data-action=\"remove-modpack\"]').click(function (event) {\n var self = $(this);\n event.preventDefault();\n swal({\n type: 'warning',\n title: 'Remove the modpack?',\n showCancelButton: true,\n allowOutsideClick: true,\n closeOnConfirm: false,\n confirmButtonText: 'Remove',\n confirmButtonColor: '#d9534f',\n showLoaderOnConfirm: true\n }, function () {\n $.ajax({\n method: 'DELETE',\n url: '/admin/bagoucenter/settings/addon/mcversion/' + self.data('attr'),\n headers: {\n 'X-CSRF-TOKEN': '{{ csrf_token() }}'\n }\n }).done(function () {\n swal({\n type: 'success',\n title: 'Removed!',\n text: 'Modpack removed sucessfully.'\n });\n self.parent().parent().slideUp();\n }).fail(function (jqXHR) {\n console.error(jqXHR);\n swal({\n type: 'error',\n title: 'Whoops!',\n text: 'An error occurred while attempting to remove this modpack.'\n });\n });\n });\n });\n });\n </script>\n@endsection\n"
|
|
}
|
|
]
|
|
}
|