Skip to content

Commit

Permalink
Revert "Merge branch 'main' of https://github.com/1day2die/dashboard
Browse files Browse the repository at this point in the history
…into development"

This reverts commit 7045483, reversing
changes made to 4657b34.
  • Loading branch information
1day2die committed Feb 5, 2023
1 parent 7045483 commit fd6e8bd
Show file tree
Hide file tree
Showing 23 changed files with 189 additions and 205 deletions.
31 changes: 0 additions & 31 deletions .github/dependabot.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- PayPal Integration
- Stripe Integration
- Referral System
- Partner System
- Ticket System
- Upgrade/Downgrade Server Resources
- Store (credit system with hourly billing and invoices)
Expand All @@ -12,27 +13,29 @@
- User/Server Management
- Customisable server plans
- Vouchers
- Alert System
- Theme Support
- and so much more!

# ControlPanel-gg

![controlpanel](https://user-images.githubusercontent.com/45005889/123518824-06b05000-d6a8-11eb-91b9-d1ed36bd2317.png)
![controlpanel](https://user-images.githubusercontent.com/67899387/214684708-739c1d21-06e8-4dec-a4f1-81533a46cc7e.png)


![](https://img.shields.io/endpoint?label=v0.8%20Installations&url=https%3A%2F%2Fmarket.controlpanel.gg%2Fcallhome.php%3Fgetinstalls)
![](https://img.shields.io/endpoint?label=v0.9%20Installations&url=https%3A%2F%2Fmarket.controlpanel.gg%2Fcallhome.php%3Fgetinstalls)
![](https://img.shields.io/badge/Overall%20Installations-3500%2B-green)
![](https://img.shields.io/github/stars/ControlPanel-gg/dashboard) ![](https://img.shields.io/github/forks/ControlPanel-gg/dashboard) ![](https://img.shields.io/github/tag/ControlPanel-gg/dashboard) [![Crowdin](https://badges.crowdin.net/controlpanelgg/localized.svg)](https://crowdin.com/project/controlpanelgg) ![](https://img.shields.io/github/issues/ControlPanel-gg/dashboard) ![](https://img.shields.io/github/license/ControlPanel-gg/dashboard) ![](https://img.shields.io/discord/787829714483019826)
## About

ControlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their pterodactyl servers. This dashboard comes with a credit-based billing solution that credits users hourly for each server they have and suspends them if they run out of credits.

This dashboard offers an easy to use and free billing solution for all starting and experienced hosting providers. This dashboard has many customization options and added discord 0auth verification to offer a solid link between your discord server and your dashboard. You can check our Demo here ([Demo](https://demo.controlpanel.gg "Demo"))
This dashboard offers an easy to use and free billing solution for all starting and experienced hosting providers. This dashboard has many customisation options and added discord Oauth verification to offer a solid link between your discord server and your dashboard. You can check our [Demo here](https://demo.controlpanel.gg "Demo").

### [Installation](https://controlpanel.gg/docs/intro "Installation")

### [Updating](https://controlpanel.gg/docs/Installation/updating "Updating")

### [Discord](https://discord.gg/4Y6HjD2uyU "discord")
### [Discord](https://discord.gg/4Y6HjD2uyU "Discord")

### [Contributing](https://controlpanel.gg/docs/Contributing/contributing "Contributing")

Expand All @@ -43,15 +46,22 @@ This dashboard offers an easy to use and free billing solution for all starting
# Preview

### Server Creation
![image](https://user-images.githubusercontent.com/8725848/171575021-bc248f12-2aba-44e8-82aa-bdc907b1d3fc.png)
![image](https://user-images.githubusercontent.com/67899387/214687234-d1ae58c0-5667-4e99-ac39-adeaabfcc7f2.png)

### Overview
![image](https://user-images.githubusercontent.com/8725848/171575809-7620ed4f-5715-420f-8c25-8bfa1c4342f7.png)
![image](https://user-images.githubusercontent.com/67899387/214685859-03c8d9e1-c685-4a07-979f-df2e88ec3931.png)

### Example server products
![image](https://user-images.githubusercontent.com/8725848/171575987-c1398ff6-83fa-4cb8-bd1f-986cee4da565.png)
![image](https://user-images.githubusercontent.com/67899387/214686950-218e1ede-6a1f-4e53-b3f4-fe1abc371a9c.png)

### Ticket System
![image](https://user-images.githubusercontent.com/8725848/184131270-9d997ebf-8965-4910-90d2-b410ae37f201.png)
![image](https://user-images.githubusercontent.com/67899387/214687123-0a3d0f8f-b53c-4b0d-869a-4d5df45f5184.png)

### Voucher System
![image](https://user-images.githubusercontent.com/67899387/214686578-ec9f0b0f-6047-4665-835f-70594b56dfd5.png)

### Partner System
![image](https://user-images.githubusercontent.com/67899387/214686321-36ba97a3-4181-4e60-9ba3-c9b318fe66a8.png)



1 change: 1 addition & 0 deletions app/Classes/Settings/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function updateSettings(Request $request)
'pterodactyl-admin-api-key' => 'required|string',
'enable-upgrades' => 'string',
'enable-disable-servers' => 'string',
'enable-disable-new-users' => 'string',
'show-imprint' => 'string',
'show-privacy' => 'string',
'show-tos' => 'string',
Expand Down
19 changes: 19 additions & 0 deletions app/Enums/UsefulLinkLocation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Enums;

enum UsefulLinkLocation:String
{
/**
* Top bar
* Only visible in the dashboard view
*/
case topbar = "topbar";

/**
* Dashboard
* Only visible in the dashboard view
*/
case dashboard = "dashboard";

}
1 change: 1 addition & 0 deletions app/Extensions/PaymentGateways/Stripe/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ function getConfig()
"RoutesIgnoreCsrf" => [
"payment/StripeWebhooks",
],
"enabled" => config('SETTINGS::PAYMENTS:STRIPE:SECRET') && config('SETTINGS::PAYMENTS:STRIPE:CLIENT_ID'),
];
}
6 changes: 5 additions & 1 deletion app/Http/Controllers/Admin/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function checkOut(ShopProduct $shopProduct)
$price = $shopProduct->price - ($shopProduct->price * $discount / 100);

$paymentGateways = [];

if ($price > 0) {
$extensions = ExtensionHelper::getAllExtensionsByNamespace('PaymentGateways');

Expand All @@ -59,6 +58,11 @@ public function checkOut(ShopProduct $shopProduct)
}
}






return view('store.checkout')->with([
'product' => $shopProduct,
'discountpercent' => $discount,
Expand Down
8 changes: 7 additions & 1 deletion app/Http/Controllers/Admin/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ public function index()

//Get all tabs as laravel view paths
$tabs = [];
foreach (glob(Theme::getViewPaths()[0] . '/admin/settings/tabs/*.blade.php') as $filename) {
if(file_exists(Theme::getViewPaths()[0] . '/admin/settings/tabs/')){
$tabspath = glob(Theme::getViewPaths()[0] . '/admin/settings/tabs/*.blade.php');
}else{
$tabspath = glob(Theme::path($path = 'views', $themeName = 'default').'/admin/settings/tabs/*.blade.php');
}

foreach ($tabspath as $filename) {
$tabs[] = 'admin.settings.tabs.'.basename($filename, '.blade.php');
}

Expand Down
23 changes: 20 additions & 3 deletions app/Http/Controllers/Admin/UsefulLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\Admin;

use App\Enums\UsefulLinkLocation;
use App\Http\Controllers\Controller;
use App\Models\UsefulLink;
use Illuminate\Contracts\Foundation\Application;
Expand Down Expand Up @@ -30,7 +31,8 @@ public function index()
*/
public function create()
{
return view('admin.usefullinks.create');
$positions = UsefulLinkLocation::cases();
return view('admin.usefullinks.create')->with('positions', $positions);
}

/**
Expand All @@ -48,7 +50,14 @@ public function store(Request $request)
'description' => 'required|string|max:2000',
]);

UsefulLink::create($request->all());

UsefulLink::create([
'icon' => $request->icon,
'title' => $request->title,
'link' => $request->link,
'description' => $request->description,
'position' => implode(",",$request->position),
]);

return redirect()->route('admin.usefullinks.index')->with('success', __('link has been created!'));
}
Expand All @@ -72,8 +81,10 @@ public function show(UsefulLink $usefullink)
*/
public function edit(UsefulLink $usefullink)
{
$positions = UsefulLinkLocation::cases();
return view('admin.usefullinks.edit', [
'link' => $usefullink,
'positions' => $positions,
]);
}

Expand All @@ -93,7 +104,13 @@ public function update(Request $request, UsefulLink $usefullink)
'description' => 'required|string|max:2000',
]);

$usefullink->update($request->all());
$usefullink->update([
'icon' => $request->icon,
'title' => $request->title,
'link' => $request->link,
'description' => $request->description,
'position' => implode(",",$request->position),
]);

return redirect()->route('admin.usefullinks.index')->with('success', __('link has been updated!'));
}
Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
Expand Down Expand Up @@ -118,6 +119,7 @@ protected function create(array $data)

if ($response->failed()) {
$user->delete();
Log::error('Pterodactyl Registration Error: ' . $response->json()['errors'][0]['detail']);
throw ValidationException::withMessages([
'ptero_registration_error' => [__('Account already exists on Pterodactyl. Please contact the Support!')],
]);
Expand All @@ -128,7 +130,7 @@ protected function create(array $data)
]);

//INCREMENT REFERRAL-USER CREDITS
if (! empty($data['referral_code'])) {
if (!empty($data['referral_code'])) {
$ref_code = $data['referral_code'];
$new_user = $user->id;
if ($ref_user = User::query()->where('referral_code', '=', $ref_code)->first()) {
Expand All @@ -140,7 +142,7 @@ protected function create(array $data)
activity()
->performedOn($user)
->causedBy($ref_user)
->log('gained '.config('SETTINGS::REFERRAL::REWARD').' '.config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME').' for sign-up-referral of '.$user->name.' (ID:'.$user->id.')');
->log('gained ' . config('SETTINGS::REFERRAL::REWARD') . ' ' . config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ' for sign-up-referral of ' . $user->name . ' (ID:' . $user->id . ')');
}
//INSERT INTO USER_REFERRALS TABLE
DB::table('user_referrals')->insert([
Expand Down
1 change: 1 addition & 0 deletions app/Models/UsefulLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ class UsefulLink extends Model
'title',
'link',
'description',
'position',
];
}
1 change: 1 addition & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Providers;

use App\Models\Settings;
use App\Models\UsefulLink;
use Exception;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Artisan;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('useful_links', function (Blueprint $table) {
$table->string('position')->after("description")->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('useful_links', function (Blueprint $table) {
$table->dropColumn('position');
});
}
};
Loading

0 comments on commit fd6e8bd

Please sign in to comment.