Merge pull request #536 from 1day2die/development
test client api key button
This commit is contained in:
commit
09138c17c7
|
@ -344,6 +344,15 @@ class Pterodactyl
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get info about user
|
||||||
|
*/
|
||||||
|
public static function getClientUser()
|
||||||
|
{
|
||||||
|
return self::clientAdmin()->get("/client/account");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if node has enough free resources to allocate the given resources
|
* Check if node has enough free resources to allocate the given resources
|
||||||
* @param Node $node
|
* @param Node $node
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Classes\Settings;
|
namespace App\Classes\Settings;
|
||||||
|
|
||||||
|
use App\Classes\Pterodactyl;
|
||||||
use App\Models\Settings;
|
use App\Models\Settings;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
@ -16,7 +17,12 @@ class System
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkPteroClientkey(){
|
||||||
|
$response = Pterodactyl::getClientUser();
|
||||||
|
|
||||||
|
if ($response->failed()){ return redirect()->back()->with('error', __('Your Key or URL is not correct')); }
|
||||||
|
return redirect()->back()->with('success', __('Everything is good!'));
|
||||||
|
}
|
||||||
|
|
||||||
public function updateSettings(Request $request)
|
public function updateSettings(Request $request)
|
||||||
{
|
{
|
||||||
|
@ -79,6 +85,7 @@ class System
|
||||||
return redirect(route('admin.settings.index') . '#system')->with('success', __('System settings updated!'));
|
return redirect(route('admin.settings.index') . '#system')->with('success', __('System settings updated!'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function updateIcons(Request $request)
|
private function updateIcons(Request $request)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
type="text" value="{{ config('SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN') }}"
|
type="text" value="{{ config('SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN') }}"
|
||||||
class="form-control @error('pterodactyl-admin-api-key') is-invalid @enderror" required>
|
class="form-control @error('pterodactyl-admin-api-key') is-invalid @enderror" required>
|
||||||
</div>
|
</div>
|
||||||
|
<a href="{{route('admin.settings.checkPteroClientkey')}}"> <button type="button" class="btn btn-secondary">{{__("Test API")}}</button></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -147,7 +147,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
|
||||||
#settings
|
#settings
|
||||||
Route::get('settings/datatable', [SettingsController::class, 'datatable'])->name('settings.datatable');
|
Route::get('settings/datatable', [SettingsController::class, 'datatable'])->name('settings.datatable');
|
||||||
Route::patch('settings/updatevalue', [SettingsController::class, 'updatevalue'])->name('settings.updatevalue');
|
Route::patch('settings/updatevalue', [SettingsController::class, 'updatevalue'])->name('settings.updatevalue');
|
||||||
|
Route::get("settings/checkPteroClientkey", [System::class, 'checkPteroClientkey'])->name('settings.checkPteroClientkey');
|
||||||
#settings
|
#settings
|
||||||
Route::patch('settings/update/invoice-settings', [Invoices::class, 'updateSettings'])->name('settings.update.invoicesettings');
|
Route::patch('settings/update/invoice-settings', [Invoices::class, 'updateSettings'])->name('settings.update.invoicesettings');
|
||||||
Route::patch('settings/update/language', [Language::class, 'updateSettings'])->name('settings.update.languagesettings');
|
Route::patch('settings/update/language', [Language::class, 'updateSettings'])->name('settings.update.languagesettings');
|
||||||
|
@ -158,7 +158,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
|
||||||
|
|
||||||
#invoices
|
#invoices
|
||||||
Route::get('invoices/download-invoices', [InvoiceController::class, 'downloadAllInvoices'])->name('invoices.downloadAllInvoices');;
|
Route::get('invoices/download-invoices', [InvoiceController::class, 'downloadAllInvoices'])->name('invoices.downloadAllInvoices');;
|
||||||
Route::get('invoices/download-single-invoice', [InvoiceController::class, 'downloadSingleInvoice'])->name('invoices.downloadSingleInvoice');;
|
Route::get('invoices/download-single-invoice', [InvoiceController::class, 'downloadSingleInvoice'])->name('invoices.downloadSingleInvoice');
|
||||||
|
|
||||||
#usefullinks
|
#usefullinks
|
||||||
Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable');
|
Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable');
|
||||||
|
|
Loading…
Reference in a new issue