commit
ce68708cdc
18 changed files with 656 additions and 550 deletions
|
@ -33,6 +33,7 @@ class System
|
|||
"credits-reward-amount-email" => "required|min:0|integer",
|
||||
"server-limit-discord" => "required|min:0|integer",
|
||||
"server-limit-email" => "required|min:0|integer",
|
||||
"server-limit-purchase" => "required|min:0|integer",
|
||||
"pterodactyl-api-key" => "required|string",
|
||||
"pterodactyl-url" => "required|string",
|
||||
|
||||
|
@ -59,9 +60,11 @@ class System
|
|||
"SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL" => "credits-reward-amount-email",
|
||||
"SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD" => "server-limit-discord",
|
||||
"SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL" => "server-limit-email",
|
||||
"SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE" => "server-limit-purchase",
|
||||
"SETTINGS::MISC:PHPMYADMIN:URL" => "phpmyadmin-url",
|
||||
"SETTINGS::SYSTEM:PTERODACTYL:URL" => "pterodactyl-url",
|
||||
"SETTINGS::SYSTEM:PTERODACTYL:TOKEN" => "pterodactyl-api-key",
|
||||
"SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO" => "enable-login-logo",
|
||||
];
|
||||
|
||||
|
||||
|
@ -78,13 +81,16 @@ class System
|
|||
{
|
||||
$request->validate([
|
||||
'icon' => 'nullable|max:10000|mimes:jpg,png,jpeg',
|
||||
'logo' => 'nullable|max:10000|mimes:jpg,png,jpeg',
|
||||
'favicon' => 'nullable|max:10000|mimes:ico',
|
||||
]);
|
||||
|
||||
if ($request->hasFile('icon')) {
|
||||
$request->file('icon')->storeAs('public', 'icon.png');
|
||||
}
|
||||
|
||||
if ($request->hasFile('logo')) {
|
||||
$request->file('logo')->storeAs('public', 'logo.png');
|
||||
}
|
||||
if ($request->hasFile('favicon')) {
|
||||
$request->file('favicon')->storeAs('public', 'favicon.ico');
|
||||
}
|
||||
|
|
|
@ -123,8 +123,15 @@ class UserController extends Controller
|
|||
"credits" => "required|numeric|min:0|max:99999999",
|
||||
"server_limit" => "required|numeric|min:0|max:1000000",
|
||||
"role" => Rule::in(['admin', 'mod', 'client', 'member']),
|
||||
"referral_code" => "required|string|min:2|max:32",
|
||||
]);
|
||||
|
||||
if (User::where('referral_code', '=', $request->input('referral_code'))->exists()) {
|
||||
throw ValidationException::withMessages([
|
||||
'referral_code' => [__("Another User with this Referral-Code already exists!")]
|
||||
]);
|
||||
}
|
||||
|
||||
if (isset($this->pterodactyl->getUser($request->input('pterodactyl_id'))['errors'])) {
|
||||
throw ValidationException::withMessages([
|
||||
'pterodactyl_id' => [__("User does not exists on pterodactyl's panel")]
|
||||
|
|
1081
composer.lock
generated
1081
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,7 @@ use App\Models\Settings;
|
|||
|
||||
return [
|
||||
|
||||
'version' => '0.7.6',
|
||||
'version' => '0.7.7',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -17,7 +17,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
'name' => env('APP_NAME', 'Controlpanel.gg'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
32
database/migrations/2022_07_12_051152_decimals-in-price.php
Normal file
32
database/migrations/2022_07_12_051152_decimals-in-price.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DecimalsInPrice extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->decimal('price',['11','2'])->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->integer('price')->change();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -72,7 +72,7 @@
|
|||
serverSide: true,
|
||||
stateSave: true,
|
||||
ajax: "{{ route('admin.payments.datatable') }}",
|
||||
order: [[ 9, "asc" ]],
|
||||
order: [[ 9, "desc" ]],
|
||||
columns: [
|
||||
{data: 'id',name: 'payments.id'},
|
||||
{data: 'type'},
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="price">{{__('Price in')}} {{CREDITS_DISPLAY_NAME}}</label>
|
||||
<input value="{{$product->price ?? old('price')}}" id="price" name="price"
|
||||
<input value="{{$product->price ?? old('price')}}" id="price" name="price" step=".01"
|
||||
type="number"
|
||||
class="form-control @error('price') is-invalid @enderror"
|
||||
required="required">
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label for="price">{{__('Price in')}} {{ CREDITS_DISPLAY_NAME }}</label>
|
||||
<input value="{{ $product->price }}" id="price" name="price" type="number"
|
||||
<input value="{{ $product->price }}" id="price" name="price" type="number" step=".01"
|
||||
class="form-control @error('price') is-invalid @enderror"
|
||||
required="required">
|
||||
@error('price')
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<th width="20"></th>
|
||||
<th>{{__('Name')}}</th>
|
||||
<th>{{__('User')}}</th>
|
||||
<th>{{__('Server id')}}</th>
|
||||
<th>{{__('Config')}}</th>
|
||||
<th>{{__('Suspended at')}}</th>
|
||||
<th>{{__('Created at')}}</th>
|
||||
|
@ -33,6 +34,7 @@
|
|||
{data: 'status' , name : 'servers.suspended'},
|
||||
{data: 'name'},
|
||||
{data: 'user' , name : 'user.name'},
|
||||
{data: 'identifier'},
|
||||
{data: 'resources' , name : 'product.name'},
|
||||
{data: 'suspended'},
|
||||
{data: 'created_at'},
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
data-content="Tax Value that will be added to the total price of the order. <br><br> Example: 19 results in (19%)"
|
||||
class="fas fa-info-circle"></i>
|
||||
</div>
|
||||
<input x-model="sales-tax" id="sales-tax" name="sales-tax" type="number"
|
||||
<input x-model="sales-tax" id="sales-tax" name="sales-tax" type="number" step=".01"
|
||||
value="{{ config('SETTINGS::PAYMENTS:SALES_TAX') }}"
|
||||
class="form-control @error('sales-tax') is-invalid @enderror">
|
||||
</div>
|
||||
|
|
|
@ -150,6 +150,13 @@
|
|||
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') }}"
|
||||
class="form-control @error('server-limit-email') is-invalid @enderror" required>
|
||||
</div>
|
||||
<div class="custom-control mb-3 p-0">
|
||||
<label for="server-limit-purchase">{{ __('Server Limit after Credits Purchase') }}</label>
|
||||
<input x-model="server-limit-purchase" id="server-limit-purchase" name="server-limit-purchase"
|
||||
type="number"
|
||||
value="{{ config('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') }}"
|
||||
class="form-control @error('server-limit-purchase') is-invalid @enderror" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -173,6 +180,21 @@
|
|||
class="form-control @error('allocation-limit') is-invalid @enderror" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Design --}}
|
||||
<div class="col-md-3 px-3">
|
||||
<div class="row mb-2">
|
||||
<div class="col text-center">
|
||||
<h1>{{ __('Design') }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-control mb-3 p-0">
|
||||
<input value="true" id="enable-login-logo" name="enable-login-logo"
|
||||
{{ config('SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO') == 'true' ? 'checked' : '' }}
|
||||
type="checkbox">
|
||||
<label for="enable-login-logo">{{ __('Enable Logo on Loginpage') }} </label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="custom-file mb-3 mt-3">
|
||||
<input type="file" accept="image/png,image/jpeg,image/jpg" class="custom-file-input" name="icon"
|
||||
|
@ -185,7 +207,19 @@
|
|||
</span>
|
||||
@enderror
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-file mb-3 mt-3">
|
||||
<input type="file" accept="image/png,image/jpeg,image/jpg" class="custom-file-input" name="logo"
|
||||
id="logo">
|
||||
<label class="custom-file-label selected" for="logo">{{ __('Select Login-page Logo') }}</label>
|
||||
</div>
|
||||
@error('logo')
|
||||
<span class="text-danger">
|
||||
{{ $message }}
|
||||
</span>
|
||||
@enderror
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="custom-file mb-3">
|
||||
<input type="file" accept="image/x-icon" class="custom-file-input" name="favicon"
|
||||
|
@ -200,7 +234,6 @@
|
|||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button class="btn btn-primary ml-3 mt-3">{{ __('Submit') }}</button>
|
||||
|
|
|
@ -114,12 +114,23 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name">{{__('Referral-Code')}}</label>
|
||||
<input value="{{$user->referral_code}}" id="referral_code" name="referral_code" type="text"
|
||||
class="form-control @error('referral_code') is-invalid @enderror" required="required">
|
||||
@error('referral_code')
|
||||
<div class="invalid-feedback">
|
||||
{{$message}}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
@error('role')
|
||||
<div class="text-danger">
|
||||
{{$message}}
|
||||
</div>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<button type="submit" class="btn btn-primary">{{__('Submit')}}</button>
|
||||
</div>
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
serverSide: true,
|
||||
stateSave: true,
|
||||
ajax: "{{route('admin.users.datatable')}}",
|
||||
order: [[ 10, "asc" ]],
|
||||
order: [[ 11, "asc" ]],
|
||||
columns: [
|
||||
{data: 'discordId', visible: false, name: 'discordUser.id'},
|
||||
{data: 'pterodactyl_id', visible: false},
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fas fa-user-check mr-2"></i>{{__('Referals')}} ({{__("referral-code")}} : {{$user->referral_code}})</h5>
|
||||
<h5 class="card-title"><i class="fas fa-user-check mr-2"></i>{{__('Referals')}} ({{__("referral-code")}}: {{$user->referral_code}})</h5>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
<div class="card card-outline card-primary">
|
||||
<div class="card-header text-center">
|
||||
<a href="{{route('welcome')}}" class="h1"><b class="mr-1">{{config('app.name', 'Laravel')}}</b></a>
|
||||
@if(config("SETTINGS::SYSTEM:ENABLE_LOGIN_LOGO"))
|
||||
<img
|
||||
src="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png')? asset('storage/logo.png'): asset('images/controlpanel_logo.png') }}"
|
||||
alt="{{ config('app.name', 'Controlpanel.gg') }} Logo"
|
||||
style="opacity: .8;max-width:100%">
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="login-box-msg">{{__('Sign in to start your session')}}</p>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
</div>
|
||||
@if(config('SETTINGS::REFERRAL::ENABLED') == "true")
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" value="{{ \Request::get('ref') }}" class="form-control" name="referral_code" placeholder="{{__('Referral code')}} ( {{__("optional")}} )">
|
||||
<input type="text" value="{{ \Request::get('ref') }}" class="form-control" name="referral_code" placeholder="{{__('Referral code')}} ({{__("optional")}})">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user-check"></span>
|
||||
|
|
|
@ -188,7 +188,7 @@
|
|||
src="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('icon.png')? asset('storage/icon.png'): asset('images/controlpanel_logo.png') }}"
|
||||
alt="{{ config('app.name', 'Laravel') }} Logo" class="brand-image img-circle"
|
||||
style="opacity: .8">
|
||||
<span class="brand-text font-weight-light">{{ config('app.name', 'Laravel') }}</span>
|
||||
<span class="brand-text font-weight-light">{{ config('app.name', 'Controlpanel.gg') }}</span>
|
||||
</a>
|
||||
|
||||
<!-- Sidebar -->
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
</div>
|
||||
<div class="mt-2 mb-2">
|
||||
<span class="card-text text-muted">{{ __('Description') }}</span>
|
||||
<p class="card-text" x-text="product.description"></p>
|
||||
<p class="card-text" style="white-space:pre" x-text="product.description"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-auto border rounded border-secondary">
|
||||
|
|
Loading…
Add table
Reference in a new issue