1
0
mirror of https://github.com/cp6/my-idlers.git synced 2024-11-16 23:42:32 +01:00

Merge pull request #74 from cp6/Development

2.1.8 Development to main
This commit is contained in:
corbpie 2022-10-20 15:49:15 +11:00 committed by GitHub
commit 1c8ec5fc6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 572 additions and 626 deletions

View File

@ -8,7 +8,7 @@ Despite what the name infers this self hosted web app isn't just for storing idl
a [YABs](https://github.com/masonr/yet-another-bench-script) output you can get disk & network speed values along with
GeekBench 5 scores to do easier comparing and sorting.
[![Generic badge](https://img.shields.io/badge/version-2.1.7-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Laravel-9.0-red.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/PHP-8.1-purple.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Bootstrap-5.1-pink.svg)](https://shields.io/)
[![Generic badge](https://img.shields.io/badge/version-2.1.8-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Laravel-9.0-red.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/PHP-8.1-purple.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Bootstrap-5.1-pink.svg)](https://shields.io/)
<img src="https://raw.githubusercontent.com/cp6/my-idlers/main/public/My%20Idlers%20logo.jpg" width="128" height="128" />
@ -20,7 +20,7 @@ GeekBench 5 scores to do easier comparing and sorting.
[Cloud Five Limited](https://cloud-v.net/) for providing the hosting for demo installation.
## 2.1.7 changes (13th October 2022):
## 2.1.8 changes (20th October 2022):
#### You can no longer use the form to submit YABS results
yabs.sh now has JSON formatted response and can POST the output directly from calling the script.
@ -36,26 +36,18 @@ Example yabs.sh call to POST the result
#### Please run the following if updating from existing install:
```shell
php artisan migrate
php artisan route:cache
php artisan cache:clear
```
* Added default order by (Change this in settings)
* Added dual success & error response alert component
* Added new response alert component into views
* Added input parameters for `compareYabs()`
* Updated and fixed server_type and virt mix-ups
* Updated views title `@section` layout
* Updated cache timeframes
* Updated `RouteServiceProvider::HOME` for `'/'`
* Updated the server choose compare method
* Fixed update server ssh port
* Fixed server due in X days being null
* Removed unused with 'labels.label' in queries
* Removed unused welcome and dashboard views
* Removed dashboard redirect to / from routes file
* Removed now unused success & error alert components
* Added & implemented details footer blade component
* Added new index layout
* Updated domains, misc, reseller, seedboxes and shared use new index layout
* Updated validation for store and update
* Updated `updatePricing()` to not need `$as_usd` parameter
* Updated labels assigned insert
* Updated order/sort by methods for pricing related columns
* Removed add YABs button on servers index page
## Requires

View File

@ -34,9 +34,13 @@ class DNSController extends Controller
public function store(Request $request)
{
$request->validate([
'hostname' => 'required|min:2',
'address' => 'required|min:2',
'dns_type' => 'required'
'hostname' => 'required|string|min:2',
'address' => 'required|string|min:2',
'dns_type' => 'required|string',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$dns_id = Str::random(8);
@ -90,9 +94,13 @@ class DNSController extends Controller
public function update(Request $request, DNS $dn)
{
$request->validate([
'hostname' => 'required|min:2',
'address' => 'required|min:2',
'dns_type' => 'required'
'hostname' => 'required|string|min:2',
'address' => 'required|string|min:2',
'dns_type' => 'required|string',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$dn->update([

View File

@ -34,11 +34,20 @@ class DomainsController extends Controller
public function store(Request $request)
{
$request->validate([
'domain' => 'required|min:2',
'extension' => 'required|min:2',
'provider_id' => 'numeric',
'domain' => 'required|string|min:2',
'extension' => 'required|string|min:2',
'ns1' => 'sometimes|nullable|min:2',
'ns2' => 'sometimes|nullable|min:2',
'ns3' => 'sometimes|nullable|min:2',
'provider_id' => 'integer',
'payment_term' => 'integer',
'price' => 'numeric',
'next_due_date' => 'required|date'
'next_due_date' => 'required|date',
'owned_since' => 'sometimes|nullable|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$domain_id = Str::random(8);
@ -74,15 +83,24 @@ class DomainsController extends Controller
public function update(Request $request, Domains $domain)
{
$request->validate([
'domain' => 'required|min:2',
'extension' => 'required|min:2',
'provider_id' => 'numeric',
'price' => 'numeric'
'domain' => 'required|string|min:2',
'extension' => 'required|string|min:2',
'ns1' => 'sometimes|nullable|min:2',
'ns2' => 'sometimes|nullable|min:2',
'ns3' => 'sometimes|nullable|min:2',
'provider_id' => 'integer',
'payment_term' => 'integer',
'price' => 'numeric',
'next_due_date' => 'required|date',
'owned_since' => 'sometimes|nullable|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency);
$pricing->updatePricing($domain->id, $request->currency, $request->price, $request->payment_term, $as_usd, $request->next_due_date);
$pricing->updatePricing($domain->id, $request->currency, $request->price, $request->payment_term, $request->next_due_date);
$domain->update([
'domain' => $request->domain,

View File

@ -31,7 +31,8 @@ class IPsController extends Controller
{
$request->validate([
'address' => 'required|ip|min:2',
'ip_type' => 'required'
'ip_type' => 'required|string|size:4',
'service_id' => 'required|string'
]);
$ip_id = Str::random(8);

View File

@ -25,7 +25,7 @@ class LabelsController extends Controller
public function store(Request $request)
{
$request->validate([
'label' => 'required|min:2'
'label' => 'required|string|min:2'
]);
Labels::create([

View File

@ -24,7 +24,7 @@ class LocationsController extends Controller
public function store(Request $request)
{
$request->validate([
'location_name' => 'required|min:2'
'location_name' => 'required|string|min:2'
]);
Locations::create([

View File

@ -32,9 +32,11 @@ class MiscController extends Controller
public function store(Request $request)
{
$request->validate([
'name' => 'required|min:3',
'name' => 'required|string|min:3',
'price' => 'required|numeric',
'owned_since' => 'date',
'payment_term' => 'required|integer',
'currency' => 'required|string|size:3',
'owned_since' => 'sometimes|nullable|date',
'next_due_date' => 'required|date'
]);
@ -65,21 +67,22 @@ class MiscController extends Controller
public function update(Request $request, Misc $misc)
{
$request->validate([
'name' => 'required',
'owned_since' => 'date',
'name' => 'required|string|min:3',
'price' => 'required|numeric',
'payment_term' => 'required|integer',
'currency' => 'required|string|size:3',
'owned_since' => 'sometimes|nullable|date',
'next_due_date' => 'required|date'
]);
DB::table('misc_services')
->where('id', $misc->id)
->update([
'name' => $request->name,
'owned_since' => $request->owned_since,
'active' => (isset($request->is_active)) ? 1 : 0
]);
$misc->update([
'name' => $request->name,
'owned_since' => $request->owned_since,
'active' => (isset($request->is_active)) ? 1 : 0
]);
$pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency);
$pricing->updatePricing($misc->id, $request->currency, $request->price, $request->payment_term, $as_usd, $request->next_due_date);
$pricing->updatePricing($misc->id, $request->currency, $request->price, $request->payment_term, $request->next_due_date);
Cache::forget("all_misc");
Cache::forget("misc.{$misc->id}");

View File

@ -22,7 +22,7 @@ class OsController extends Controller
public function store(Request $request)
{
$request->validate([
'os_name' => 'required|min:2'
'os_name' => 'required|string|min:2'
]);
OS::create([

View File

@ -24,7 +24,7 @@ class ProvidersController extends Controller
public function store(Request $request)
{
$request->validate([
'provider_name' => 'required|min:2'
'provider_name' => 'required|string|min:2'
]);
Providers::create([

View File

@ -31,26 +31,27 @@ class ResellerController extends Controller
{
$request->validate([
'domain' => 'required|min:4',
'reseller_type' => 'required',
'dedicated_ip' => 'present',
'accounts' => 'numeric',
'server_type' => 'numeric',
'ram' => 'numeric',
'disk' => 'numeric',
'os_id' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'reseller_type' => 'required|string',
'disk' => 'integer',
'os_id' => 'integer',
'provider_id' => 'integer',
'location_id' => 'integer',
'price' => 'numeric',
'payment_term' => 'numeric',
'was_promo' => 'numeric',
'owned_since' => 'date',
'domains' => 'numeric',
'sub_domains' => 'numeric',
'bandwidth' => 'numeric',
'email' => 'numeric',
'ftp' => 'numeric',
'db' => 'numeric',
'next_due_date' => 'required|date'
'payment_term' => 'integer',
'was_promo' => 'integer',
'owned_since' => 'sometimes|nullable|date',
'accounts' => 'integer',
'domains' => 'integer',
'sub_domains' => 'integer',
'bandwidth' => 'integer',
'email' => 'integer',
'ftp' => 'integer',
'db' => 'integer',
'next_due_date' => 'required|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$reseller_id = Str::random(8);
@ -106,50 +107,50 @@ class ResellerController extends Controller
public function update(Request $request, Reseller $reseller)
{
$request->validate([
'id' => 'required|size:8',
'domain' => 'required|min:4',
'reseller_type' => 'required',
'dedicated_ip' => 'present',
'server_type' => 'numeric',
'disk' => 'numeric',
'os_id' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'reseller_type' => 'required|string',
'disk' => 'integer',
'os_id' => 'integer',
'provider_id' => 'integer',
'location_id' => 'integer',
'price' => 'numeric',
'payment_term' => 'numeric',
'was_promo' => 'numeric',
'owned_since' => 'date',
'domains' => 'numeric',
'sub_domains' => 'numeric',
'bandwidth' => 'numeric',
'email' => 'numeric',
'ftp' => 'numeric',
'db' => 'numeric'
'payment_term' => 'integer',
'was_promo' => 'integer',
'owned_since' => 'sometimes|nullable|date',
'accounts' => 'integer',
'domains' => 'integer',
'sub_domains' => 'integer',
'bandwidth' => 'integer',
'email' => 'integer',
'ftp' => 'integer',
'db' => 'integer',
'next_due_date' => 'required|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
DB::table('reseller_hosting')
->where('id', $request->id)
->update([
'main_domain' => $request->domain,
'reseller_type' => $request->reseller_type,
'provider_id' => $request->provider_id,
'location_id' => $request->location_id,
'disk' => $request->disk,
'disk_type' => 'GB',
'disk_as_gb' => $request->disk,
'owned_since' => $request->owned_since,
'bandwidth' => $request->bandwidth,
'was_promo' => $request->was_promo,
'domains_limit' => $request->domains,
'subdomains_limit' => $request->sub_domains,
'email_limit' => $request->email,
'ftp_limit' => $request->ftp,
'db_limit' => $request->db
]);
$reseller->update([
'main_domain' => $request->domain,
'reseller_type' => $request->reseller_type,
'provider_id' => $request->provider_id,
'location_id' => $request->location_id,
'disk' => $request->disk,
'disk_type' => 'GB',
'disk_as_gb' => $request->disk,
'owned_since' => $request->owned_since,
'bandwidth' => $request->bandwidth,
'was_promo' => $request->was_promo,
'domains_limit' => $request->domains,
'subdomains_limit' => $request->sub_domains,
'email_limit' => $request->email,
'ftp_limit' => $request->ftp,
'db_limit' => $request->db
]);
$pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency);
$pricing->updatePricing($request->id, $request->currency, $request->price, $request->payment_term, $as_usd, $request->next_due_date);
$pricing->updatePricing($request->id, $request->currency, $request->price, $request->payment_term, $request->next_due_date);
Labels::deleteLabelsAssignedTo($request->id);
Labels::insertLabelsAssigned([$request->label1, $request->label2, $request->label3, $request->label4], $request->id);

View File

@ -29,19 +29,23 @@ class SeedBoxesController extends Controller
public function store(Request $request)
{
$request->validate([
'title' => 'required|string',
'hostname' => 'string|nullable',
'seed_box_type' => 'required',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'title' => 'required|string|min:2',
'hostname' => 'sometimes|nullable|string|min:2',
'seed_box_type' => 'required|string',
'provider_id' => 'integer',
'location_id' => 'integer',
'price' => 'numeric',
'payment_term' => 'numeric',
'was_promo' => 'numeric',
'owned_since' => 'date',
'disk' => 'numeric',
'bandwidth' => 'numeric',
'port_speed' => 'numeric',
'next_due_date' => 'required|date'
'payment_term' => 'integer',
'was_promo' => 'integer',
'owned_since' => 'sometimes|nullable|date',
'disk' => 'integer',
'bandwidth' => 'integer',
'port_speed' => 'integer',
'next_due_date' => 'required|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$seedbox_id = Str::random(8);
@ -91,41 +95,42 @@ class SeedBoxesController extends Controller
public function update(Request $request, SeedBoxes $seedbox)
{
$request->validate([
'id' => 'required|size:8',
'title' => 'required|string',
'hostname' => 'string|nullable',
'seed_box_type' => 'required',
'disk' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'title' => 'required|string|min:2',
'hostname' => 'sometimes|nullable|string|min:2',
'seed_box_type' => 'required|string',
'provider_id' => 'integer',
'location_id' => 'integer',
'price' => 'numeric',
'payment_term' => 'numeric',
'was_promo' => 'numeric',
'owned_since' => 'date',
'bandwidth' => 'numeric',
'port_speed' => 'numeric'
'payment_term' => 'integer',
'was_promo' => 'integer',
'owned_since' => 'sometimes|nullable|date',
'disk' => 'integer',
'bandwidth' => 'integer',
'port_speed' => 'integer',
'next_due_date' => 'required|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
DB::table('seedboxes')
->where('id', $seedbox->id)
->update([
'title' => $request->title,
'hostname' => $request->hostname,
'seed_box_type' => $request->seed_box_type,
'location_id' => $request->location_id,
'provider_id' => $request->provider_id,
'disk' => $request->disk,
'disk_type' => 'GB',
'disk_as_gb' => $request->disk,
'owned_since' => $request->owned_since,
'bandwidth' => $request->bandwidth,
'port_speed' => $request->port_speed,
'was_promo' => $request->was_promo
]);
$seedbox->update([
'title' => $request->title,
'hostname' => $request->hostname,
'seed_box_type' => $request->seed_box_type,
'location_id' => $request->location_id,
'provider_id' => $request->provider_id,
'disk' => $request->disk,
'disk_type' => 'GB',
'disk_as_gb' => $request->disk,
'owned_since' => $request->owned_since,
'bandwidth' => $request->bandwidth,
'port_speed' => $request->port_speed,
'was_promo' => $request->was_promo
]);
$pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency);
$pricing->updatePricing($seedbox->id, $request->currency, $request->price, $request->payment_term, $as_usd, $request->next_due_date);
$pricing->updatePricing($seedbox->id, $request->currency, $request->price, $request->payment_term, $request->next_due_date);
Labels::deleteLabelsAssignedTo($seedbox->id);
Labels::insertLabelsAssigned([$request->label1, $request->label2, $request->label3, $request->label4], $seedbox->id);

View File

@ -18,9 +18,7 @@ class ServerController extends Controller
public function index()
{
$servers = Server::allActiveServers();
$non_active_servers = Server::allNonActiveServers();
return view('servers.index', compact(['servers', 'non_active_servers']));
}
@ -43,22 +41,30 @@ class ServerController extends Controller
public function store(Request $request)
{
$request->validate([
'hostname' => 'required|min:5',
'ip1' => 'nullable|ip',
'ip2' => 'nullable|ip',
'service_type' => 'numeric',
'server_type' => 'numeric',
'ram' => 'numeric',
'disk' => 'numeric',
'os_id' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'price' => 'numeric',
'cpu' => 'numeric',
'was_promo' => 'numeric',
'next_due_date' => 'required|date'
'ip1' => 'sometimes|nullable|ip',
'ip2' => 'sometimes|nullable|ip',
'ns1' => 'sometimes|nullable|string',
'ns2' => 'sometimes|nullable|string',
'service_type' => 'integer',
'server_type' => 'integer',
'ssh_port' => 'integer',
'bandwidth' => 'integer',
'ram' => 'required|numeric',
'disk' => 'required|integer',
'os_id' => 'required|integer',
'provider_id' => 'required|integer',
'location_id' => 'required|integer',
'price' => 'required|numeric',
'cpu' => 'required|integer',
'was_promo' => 'integer',
'next_due_date' => 'required|date',
'owned_since' => 'sometimes|nullable|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$server_id = Str::random(8);
@ -123,49 +129,57 @@ class ServerController extends Controller
{
$request->validate([
'hostname' => 'required|min:5',
'ram' => 'numeric',
'disk' => 'numeric',
'os_id' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'price' => 'numeric',
'cpu' => 'numeric',
'was_promo' => 'numeric',
'next_due_date' => 'date'
'ip1' => 'sometimes|nullable|ip',
'ip2' => 'sometimes|nullable|ip',
'ns1' => 'sometimes|nullable|string',
'ns2' => 'sometimes|nullable|string',
'service_type' => 'integer',
'server_type' => 'integer',
'ssh_port' => 'integer',
'bandwidth' => 'integer',
'ram' => 'required|numeric',
'disk' => 'required|integer',
'os_id' => 'required|integer',
'provider_id' => 'required|integer',
'location_id' => 'required|integer',
'price' => 'required|numeric',
'cpu' => 'required|integer',
'was_promo' => 'integer',
'next_due_date' => 'required|date',
'owned_since' => 'sometimes|nullable|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$server->update([
'hostname' => $request->hostname,
'server_type' => $request->server_type,
'os_id' => $request->os_id,
'ssh' => $request->ssh_port,
'provider_id' => $request->provider_id,
'location_id' => $request->location_id,
'ram' => $request->ram,
'ram_type' => $request->ram_type,
'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram * 1024),
'disk' => $request->disk,
'disk_type' => $request->disk_type,
'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1024),
'owned_since' => $request->owned_since,
'ns1' => $request->ns1,
'ns2' => $request->ns2,
'bandwidth' => $request->bandwidth,
'cpu' => $request->cpu,
'was_promo' => $request->was_promo,
'active' => (isset($request->is_active)) ? 1 : 0,
'show_public' => (isset($request->show_public)) ? 1 : 0
]);
$server_id = $request->server_id;
DB::table('servers')
->where('id', $server_id)
->update([
'hostname' => $request->hostname,
'server_type' => $request->server_type,
'os_id' => $request->os_id,
'ssh' => $request->ssh_port,
'provider_id' => $request->provider_id,
'location_id' => $request->location_id,
'ram' => $request->ram,
'ram_type' => $request->ram_type,
'ram_as_mb' => ($request->ram_type === 'MB') ? $request->ram : ($request->ram * 1024),
'disk' => $request->disk,
'disk_type' => $request->disk_type,
'disk_as_gb' => ($request->disk_type === 'GB') ? $request->disk : ($request->disk * 1024),
'owned_since' => $request->owned_since,
'ns1' => $request->ns1,
'ns2' => $request->ns2,
'bandwidth' => $request->bandwidth,
'cpu' => $request->cpu,
'was_promo' => $request->was_promo,
'active' => (isset($request->is_active)) ? 1 : 0,
'show_public' => (isset($request->show_public)) ? 1 : 0
]);
$pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency);
$pricing->updatePricing($server_id, $request->currency, $request->price, $request->payment_term, $as_usd, $request->next_due_date);
$pricing->updatePricing($server_id, $request->currency, $request->price, $request->payment_term, $request->next_due_date);
Labels::deleteLabelsAssignedTo($server_id);
@ -209,7 +223,7 @@ class ServerController extends Controller
{//NOTICE: Selecting servers is not cached yet
$all_servers = Server::where('has_yabs', 1)->get();
if (isset($all_servers[1])){
if (isset($all_servers[1])) {
return view('servers.choose-compare', compact('all_servers'));
}
@ -222,7 +236,7 @@ class ServerController extends Controller
$server1_data = Server::server($server1);
if (!isset($server1_data[0]->yabs[0])) {
abort(404);
abort(404);
}
$server2_data = Server::server($server2);

View File

@ -29,24 +29,26 @@ class SharedController extends Controller
{
$request->validate([
'domain' => 'required|min:4',
'shared_type' => 'required',
'server_type' => 'numeric',
'ram' => 'numeric',
'disk' => 'numeric',
'os_id' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'shared_type' => 'required|string',
'disk' => 'integer',
'os_id' => 'integer',
'provider_id' => 'integer',
'location_id' => 'integer',
'price' => 'numeric',
'payment_term' => 'numeric',
'was_promo' => 'numeric',
'owned_since' => 'date',
'domains' => 'numeric',
'sub_domains' => 'numeric',
'bandwidth' => 'numeric',
'email' => 'numeric',
'ftp' => 'numeric',
'db' => 'numeric',
'next_due_date' => 'required|date'
'payment_term' => 'integer',
'was_promo' => 'integer',
'owned_since' => 'sometimes|nullable|date',
'domains' => 'integer',
'sub_domains' => 'integer',
'bandwidth' => 'integer',
'email' => 'integer',
'ftp' => 'integer',
'db' => 'integer',
'next_due_date' => 'required|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
$shared_id = Str::random(8);
@ -103,50 +105,49 @@ class SharedController extends Controller
public function update(Request $request, Shared $shared)
{
$request->validate([
'id' => 'required|size:8',
'domain' => 'required|min:4',
'shared_type' => 'required',
'dedicated_ip' => 'present',
'server_type' => 'numeric',
'disk' => 'numeric',
'os_id' => 'numeric',
'provider_id' => 'numeric',
'location_id' => 'numeric',
'shared_type' => 'required|string',
'disk' => 'integer',
'os_id' => 'integer',
'provider_id' => 'integer',
'location_id' => 'integer',
'price' => 'numeric',
'payment_term' => 'numeric',
'was_promo' => 'numeric',
'owned_since' => 'date',
'domains' => 'numeric',
'sub_domains' => 'numeric',
'bandwidth' => 'numeric',
'email' => 'numeric',
'ftp' => 'numeric',
'db' => 'numeric'
'payment_term' => 'integer',
'was_promo' => 'integer',
'owned_since' => 'sometimes|nullable|date',
'domains' => 'integer',
'sub_domains' => 'integer',
'bandwidth' => 'integer',
'email' => 'integer',
'ftp' => 'integer',
'db' => 'integer',
'next_due_date' => 'required|date',
'label1' => 'sometimes|nullable|string',
'label2' => 'sometimes|nullable|string',
'label3' => 'sometimes|nullable|string',
'label4' => 'sometimes|nullable|string',
]);
DB::table('shared_hosting')
->where('id', $request->id)
->update([
'main_domain' => $request->domain,
'shared_type' => $request->shared_type,
'provider_id' => $request->provider_id,
'location_id' => $request->location_id,
'disk' => $request->disk,
'disk_type' => 'GB',
'disk_as_gb' => $request->disk,
'owned_since' => $request->owned_since,
'bandwidth' => $request->bandwidth,
'was_promo' => $request->was_promo,
'domains_limit' => $request->domains,
'subdomains_limit' => $request->sub_domains,
'email_limit' => $request->email,
'ftp_limit' => $request->ftp,
'db_limit' => $request->db
]);
$shared->update([
'main_domain' => $request->domain,
'shared_type' => $request->shared_type,
'provider_id' => $request->provider_id,
'location_id' => $request->location_id,
'disk' => $request->disk,
'disk_type' => 'GB',
'disk_as_gb' => $request->disk,
'owned_since' => $request->owned_since,
'bandwidth' => $request->bandwidth,
'was_promo' => $request->was_promo,
'domains_limit' => $request->domains,
'subdomains_limit' => $request->sub_domains,
'email_limit' => $request->email,
'ftp_limit' => $request->ftp,
'db_limit' => $request->db
]);
$pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency);
$pricing->updatePricing($request->id, $request->currency, $request->price, $request->payment_term, $as_usd, $request->next_due_date);
$pricing->updatePricing($request->id, $request->currency, $request->price, $request->payment_term, $request->next_due_date);
Labels::deleteLabelsAssignedTo($request->id);
Labels::insertLabelsAssigned([$request->label1, $request->label2, $request->label3, $request->label4], $request->id);

View File

@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;
class Domains extends Model
{
@ -23,7 +24,12 @@ class Domains extends Model
public static function allDomains()
{//All domains and relationships (no using joins)
return Cache::remember("all_domains", now()->addMonth(1), function () {
return Domains::with(['provider', 'price', 'labels'])->get();
$query = Domains::with(['provider', 'price', 'labels']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "domains.id"), $options[1]);
}
return $query->get();
});
}

View File

@ -33,7 +33,7 @@ class Labels extends Model
{
for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $service_id]);
DB::table('labels_assigned')->insert(['label_id' => $labels_array[($i - 1)], 'service_id' => $service_id]);
}
}
}

View File

@ -35,7 +35,12 @@ class Misc extends Model
public static function allMisc()
{//All misc and relationships (no using joins)
return Cache::remember("all_misc", now()->addMonth(1), function () {
return Misc::with(['price'])->get();
$query = Misc::with(['price']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "misc_services.id"), $options[1]);
}
return $query->get();
});
}
@ -49,9 +54,6 @@ class Misc extends Model
public function price()
{
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
return $this->hasOne(Pricing::class, 'service_id', 'id')->orderBy(Settings::orderByProcess(Session::get('sort_on'))[0], Settings::orderByProcess(Session::get('sort_on'))[1]);
}
return $this->hasOne(Pricing::class, 'service_id', 'id');
}

View File

@ -48,7 +48,7 @@ class Pricing extends Model
private static function getRates($currency): float
{
$rate = self::refreshRates()->$currency;
return $rate === null ? 1.00 : $rate;
return $rate ?? 1.00;
}
public static function getCurrencyList(): array
@ -125,8 +125,9 @@ class Pricing extends Model
]);
}
public function updatePricing(string $service_id, string $currency, float $price, int $term, float $as_usd, string $next_due_date, int $is_active = 1): int
public function updatePricing(string $service_id, string $currency, float $price, int $term, string $next_due_date, int $is_active = 1): int
{
$as_usd = $this->convertToUSD($price, $currency);
return DB::table('pricings')
->where('service_id', $service_id)
->update([
@ -136,15 +137,14 @@ class Pricing extends Model
'as_usd' => $as_usd,
'usd_per_month' => $this->costAsPerMonth($as_usd, $term),
'next_due_date' => $next_due_date,
'active' => ($is_active) ? 1 : 0
'active' => $is_active
]);
}
public static function allPricing()
{
return Cache::remember('all_pricing', now()->addWeek(1), function () {
return DB::table('pricings')
->get();
return Pricing::get();
});
}

View File

@ -36,7 +36,12 @@ class Reseller extends Model
public static function allResellerHosting()
{//All reseller hosting and relationships (no using joins)
return Cache::remember("all_reseller", now()->addMonth(1), function () {
return Reseller::with(['location', 'provider', 'price', 'ips', 'labels'])->get();
$query = Reseller::with(['location', 'provider', 'price', 'ips', 'labels']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "reseller_hosting.id"), $options[1]);
}
return $query->get();
});
}
@ -65,9 +70,6 @@ class Reseller extends Model
public function price()
{
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
return $this->hasOne(Pricing::class, 'service_id', 'id')->orderBy(Settings::orderByProcess(Session::get('sort_on'))[0], Settings::orderByProcess(Session::get('sort_on'))[1]);
}
return $this->hasOne(Pricing::class, 'service_id', 'id');
}

View File

@ -36,7 +36,12 @@ class SeedBoxes extends Model
public static function allSeedboxes()
{//All seedboxes and relationships (no using joins)
return Cache::remember("all_seedboxes", now()->addMonth(1), function () {
return SeedBoxes::with(['location', 'provider', 'price'])->get();
$query = SeedBoxes::with(['location', 'provider', 'price']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "seedboxes.id"), $options[1]);
}
return $query->get();
});
}
@ -60,9 +65,6 @@ class SeedBoxes extends Model
public function price()
{
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
return $this->hasOne(Pricing::class, 'service_id', 'id')->orderBy(Settings::orderByProcess(Session::get('sort_on'))[0], Settings::orderByProcess(Session::get('sort_on'))[1]);
}
return $this->hasOne(Pricing::class, 'service_id', 'id');
}

View File

@ -43,7 +43,12 @@ class Server extends Model
public static function allServers()
{//All servers and relationships (no using joins)
return Cache::remember("all_servers", now()->addMonth(1), function () {
return Server::with(['location', 'provider', 'os', 'price', 'ips', 'yabs', 'yabs.disk_speed', 'yabs.network_speed', 'labels'])->get();
$query = Server::with(['location', 'provider', 'os', 'price', 'ips', 'yabs', 'yabs.disk_speed', 'yabs.network_speed', 'labels']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "servers.id"), $options[1]);
}
return $query->get();
});
}
@ -58,8 +63,13 @@ class Server extends Model
public static function allActiveServers()
{//All ACTIVE servers and relationships replaces activeServersDataIndexPage()
return Cache::remember("all_active_servers", now()->addMonth(1), function () {
return Server::where('active', '=', 1)
->with(['location', 'provider', 'os', 'ips', 'yabs', 'yabs.disk_speed', 'yabs.network_speed', 'labels', 'price'])->get();
$query = Server::where('active', '=', 1)
->with(['location', 'provider', 'os', 'ips', 'yabs', 'yabs.disk_speed', 'yabs.network_speed', 'labels', 'price']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "servers.id"), $options[1]);
}
return $query->get();
});
}
@ -216,9 +226,6 @@ class Server extends Model
public function price()
{
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
return $this->hasOne(Pricing::class, 'service_id', 'id')->orderBy(Settings::orderByProcess(Session::get('sort_on'))[0], Settings::orderByProcess(Session::get('sort_on'))[1]);
}
return $this->hasOne(Pricing::class, 'service_id', 'id');
}

View File

@ -36,7 +36,12 @@ class Shared extends Model
public static function allSharedHosting()
{//All shared hosting and relationships (no using joins)
return Cache::remember("all_shared", now()->addMonth(1), function () {
return Shared::with(['location', 'provider', 'price', 'ips', 'labels'])->get();
$query = Shared::with(['location', 'provider', 'price', 'ips', 'labels']);
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
$options = Settings::orderByProcess(Session::get('sort_on'));
$query->orderBy(Pricing::select("pricings.$options[0]")->whereColumn("pricings.service_id", "shared_hosting.id"), $options[1]);
}
return $query->get();
});
}
@ -65,9 +70,6 @@ class Shared extends Model
public function price()
{
if (in_array(Session::get('sort_on'), [3, 4, 5, 6], true)) {
return $this->hasOne(Pricing::class, 'service_id', 'id')->orderBy(Settings::orderByProcess(Session::get('sort_on'))[0], Settings::orderByProcess(Session::get('sort_on'))[1]);
}
return $this->hasOne(Pricing::class, 'service_id', 'id');
}

View File

@ -46,10 +46,6 @@
</div>
</form>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>@if(isset($timer))@endif Built on
Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -0,0 +1,4 @@
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP
v{{ PHP_VERSION }})</small></p>
@endif

View File

@ -8,10 +8,10 @@
showModal: false
},
methods: {
modalForm(event) {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.id.replace('btn-', '');
this.modal_id = event.target.title;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = '{{$uri}}/' + this.modal_id;
}
}

View File

@ -42,8 +42,8 @@
<i class="fas fa-pen" title="edit"></i></a>
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$dns->hostname}}" title="{{$dns->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$dns->id}}" title="{{$dns->hostname}}"></i>
</form>
</td>
</tr>
@ -57,12 +57,7 @@
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-modal-delete-script>
<x-slot name="uri">dns</x-slot>

View File

@ -1,20 +1,17 @@
@section("title", "Domains")
@section('style')
@extends('layouts.index')
@section('title', 'Domains')
@section('css_style')
<x-modal-style></x-modal-style>
@endsection
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@section('header')
{{ __('Domains') }}
@endsection
<x-app-layout>
<x-slot name="header">
{{ __('Domains') }}
</x-slot>
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<x-card class="shadow mt-3">
<a href="{{ route('domains.create') }}" class="btn btn-primary mb-3">Add a domain</a>
<x-response-alerts></x-response-alerts>
@section('content')
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<x-card class="shadow mt-3">
<a href="{{ route('domains.create') }}" class="btn btn-primary mb-3">Add a domain</a>
<x-response-alerts></x-response-alerts>
<div class="table-responsive">
<table class="table table-bordered">
<thead class="table-light">
@ -32,12 +29,14 @@
@foreach($domains as $domain)
<tr>
<td class="text-nowrap"><a href="https://{{ $domain->domain }}.{{$domain->extension}}"
class="text-decoration-none">{{ $domain->domain }}.{{$domain->extension}}</a></td>
class="text-decoration-none">{{ $domain->domain }}
.{{$domain->extension}}</a></td>
<td class="text-nowrap">{{ $domain->owned_since}}</td>
<td class="text-nowrap">{{ now()->diffInDays($domain->price->next_due_date) }} <small>days</small>
</td>
<td class="text-nowrap">{{ $domain->provider->name}}</td>
<td class="text-nowrap">{{ $domain->price->price }} <small>{{$domain->price->currency}}</small></td>
<td class="text-nowrap">{{ $domain->price->price }}
<small>{{$domain->price->currency}}</small></td>
<td class="text-nowrap">
<form action="{{ route('domains.destroy', $domain->id) }}" method="POST">
<a href="{{ route('domains.show', $domain->id) }}"
@ -48,8 +47,8 @@
<i class="fas fa-pen" title="edit"></i></a>
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$domain->domain}}" title="{{$domain->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$domain->id}}" title="{{$domain->domain}}"></i>
</form>
</td>
</tr>
@ -63,14 +62,9 @@
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-modal-delete-script>
<x-slot name="uri">domains</x-slot>
</x-modal-delete-script>
</x-app-layout>
@endsection

View File

@ -41,8 +41,8 @@
<form action="{{ route('IPs.destroy', $ip->id) }}" method="POST">
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$ip->hostname}}" title="{{$ip->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$ip->id}}" title="{{$ip->hostname}}"></i>
</form>
</td>
</tr>
@ -56,12 +56,7 @@
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-datatables-assets></x-datatables-assets>
<script type="text/javascript">

View File

@ -36,8 +36,8 @@
class="text-body mx-1">
<i class="fas fa-eye" title="view"></i></a>
@csrf
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$label->label}}" title="{{$label->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$label->id}}" title="{{$label->label}}"></i>
</form>
</td>
</tr>
@ -50,12 +50,7 @@
</tbody>
</table>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-datatables-assets></x-datatables-assets>
<script type="text/javascript">
@ -75,6 +70,6 @@
});
</script>
<x-modal-delete-script>
<x-slot name="uri">locations</x-slot>
<x-slot name="uri">labels</x-slot>
</x-modal-delete-script>
</x-app-layout>

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
@if(isset(Auth::user()->api_token))
<meta name="api_token" content="{{ Auth::user()->api_token }}">
@endif
<title>@yield('title') - @if (config()->has('app.name')){{ config('app.name') }} @else My idlers @endif</title>
@if(Session::get('dark_mode'))
<link rel="stylesheet" href="{{ asset('css/bootstrap-dark.min.css') }}">
@else
<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}">
@endif
<link rel="stylesheet" href="{{ asset('css/fa.min.css') }}">
@yield('css_style')
<script src="{{ asset('js/vue.min.js') }}"></script>
</head>
<body class="font-sans antialiased">
<div class="container-fluid">
@include('layouts.navigation')
</div>
<div class="container">
<h3 class="ms-2 mt-3">
@yield('header')
</h3>
</div>
<div class="container">
@yield('content')
</div>
<script src="{{ asset('js/bootstrap.min.js') }}" defer></script>
@yield('scripts')
</body>
</html>

View File

@ -49,12 +49,7 @@
</tbody>
</table>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-datatables-assets></x-datatables-assets>
<script type="text/javascript">

View File

@ -1,15 +1,12 @@
@section("title", "Misc services")
@section('style')
@extends('layouts.index')
@section('title', 'Misc')
@section('css_style')
<x-modal-style></x-modal-style>
@endsection
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@section('header')
{{ __('Misc') }}
@endsection
<x-app-layout>
<x-slot name="header">
{{ __('Misc services') }}
</x-slot>
@section('content')
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<x-card class="shadow mt-3">
@ -51,8 +48,8 @@
</a>
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$m->name}}" title="{{$m->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$m->id}}" title="{{$m->name}}"></i>
</form>
</td>
</tr>
@ -66,14 +63,9 @@
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-modal-delete-script>
<x-slot name="uri">misc</x-slot>
</x-modal-delete-script>
</x-app-layout>
@endsection

View File

@ -32,8 +32,8 @@
<td class="text-nowrap">{{ $o->name }}</td>
<td class="text-nowrap">
<form action="{{ route('locations.destroy', $o->id) }}" method="POST">
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$o->name}}" title="{{$o->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$o->id}}" title="{{$o->name}}"></i>
</form>
</td>
</tr>
@ -46,12 +46,7 @@
</tbody>
</table>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-datatables-assets></x-datatables-assets>
<script type="text/javascript">

View File

@ -35,8 +35,8 @@
<a href="{{ route('providers.show', $provider->id) }}"
class="text-body mx-1">
<i class="fas fa-eye" title="view"></i></a>
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$provider->name}}" title="{{$provider->id}}"></i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$provider->id}}" title="{{$provider->name}}"></i>
</form>
</td>
</tr>
@ -49,10 +49,7 @@
</tbody>
</table>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-datatables-assets></x-datatables-assets>
<script type="text/javascript">

View File

@ -1,16 +1,12 @@
@section("title", "Resellers")
@section('style')
@extends('layouts.index')
@section('title', 'Resellers')
@section('css_style')
<x-modal-style></x-modal-style>
@endsection
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@section('header')
{{ __('Reseller') }}
@endsection
<x-app-layout>
<x-slot name="header">
{{ __('Reseller') }}
</x-slot>
@section('content')
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<div class="card shadow mt-3">
@ -73,30 +69,9 @@
</div>
</div>
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
<script>
let app = new Vue({
el: "#app",
data: {
"modal_hostname": '',
"modal_id": '',
"delete_form_action": '',
showModal: false
},
methods: {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = 'reseller/' + this.modal_id;
}
}
});
</script>
</x-app-layout>
<x-modal-delete-script>
<x-slot name="uri">reseller</x-slot>
</x-modal-delete-script>
@endsection

View File

@ -145,11 +145,6 @@
<x-slot name="route">{{ route('reseller.edit', $reseller->id) }}</x-slot>
</x-edit-btn>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -1,15 +1,12 @@
@section("title", "Seed boxes")
@section('style')
@extends('layouts.index')
@section('title', 'Seed boxes')
@section('css_style')
<x-modal-style></x-modal-style>
@endsection
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@section('header')
{{ __('Seed boxes') }}
@endsection
<x-app-layout>
<x-slot name="header">
{{ __('Seed boxes') }}
</x-slot>
@section('content')
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<div class="card shadow mt-3">
@ -96,29 +93,9 @@
</div>
</div>
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<script>
let app = new Vue({
el: "#app",
data: {
"modal_hostname": '',
"modal_id": '',
"delete_form_action": '',
showModal: false
},
methods: {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = 'seedboxes/' + this.modal_id;
}
}
});
</script>
</x-app-layout>
<x-modal-delete-script>
<x-slot name="uri">seedboxes</x-slot>
</x-modal-delete-script>
@endsection

View File

@ -129,11 +129,6 @@
<x-slot name="route">{{ route('seedboxes.edit', $seedbox_data->id) }}</x-slot>
</x-edit-btn>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -43,10 +43,7 @@
@endif
</div>
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<script type="application/javascript">
let app = new Vue({

View File

@ -95,10 +95,7 @@
<div class="tab-pane fade" id="non-active" role="tabpanel" aria-labelledby="non-active-tab">
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<script>

View File

@ -32,7 +32,6 @@
<a href="{{ route('servers.create') }}" class="btn btn-primary mb-3">Add server</a>
<a href="{{ route('servers-compare-choose') }}" class="btn btn-primary mb-3 ms-2">Compare
servers</a>
<a href="{{ route('yabs.create') }}" class="btn btn-primary mb-3 ms-2">Add a YABs</a>
<div class="table-responsive">
<table class="table table-bordered">
<thead class="table-light">
@ -93,9 +92,9 @@
<i class="fas fa-pen" title="edit"></i>
</a>
<i class="fas fa-plug mx-1" id="btn-{{$server->hostname}}"
<i class="fas fa-plug mx-1" id="{{$server->hostname}}"
title="check if up"
@click="onClk">
@click="checkUp">
</i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$server->id}}" title="{{$server->hostname}}"></i>
@ -174,9 +173,9 @@
<i class="fas fa-pen" title="edit"></i>
</a>
<i class="fas fa-plug mx-1" id="btn-{{$server->hostname}}"
<i class="fas fa-plug mx-1" id="{{$server->hostname}}"
title="check if up"
@click="onClk">
@click="checkUp">
</i>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$server->id}}" title="{{$server->hostname}}"></i>
@ -195,14 +194,9 @@
</div>
</x-card>
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<script>
axios.defaults.headers.common = {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
@ -220,12 +214,12 @@
showModal: false
},
methods: {
onClk(event) {
var hostname = event.target.id.replace('btn-', '');
checkUp(event) {
var hostname = event.target.id;
if (hostname) {
axios
.get('/api/online/' + event.target.id.replace('btn-', ''), {headers: {'Authorization': 'Bearer ' + document.querySelector('meta[name="api_token"]').getAttribute('content')}})
.get('/api/online/' + event.target.id, {headers: {'Authorization': 'Bearer ' + document.querySelector('meta[name="api_token"]').getAttribute('content')}})
.then(response => (this.status = response.data.is_online))
.finally(() => {
if (this.status) {

View File

@ -125,9 +125,6 @@
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -204,18 +204,14 @@
</table>
</div>
@else
<p>Please <a href="{{ route('yabs.create') }}" class="text-decoration-none">add a YABs</a> to
see Geekbench, disk and network speeds</p>
<p>Please add a YABs to
see Geekbench, disk and network speeds:</p>
<code>curl -sL yabs.sh | bash -s -- -s "{{route('api.store-yabs', [$server_data->id, \Illuminate\Support\Facades\Auth::user()->api_token])}}"</code>
@endif
</div>
<p id="yabs_code" class="d-none pt-3"><code>curl -sL yabs.sh | bash -s -- -s "{{route('api.store-yabs', [$server_data->id, \Illuminate\Support\Facades\Auth::user()->api_token])}}"</code></p>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -281,9 +281,6 @@
</div>
</form>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -1,15 +1,12 @@
@section("title", "Shared hosting")
@section('style')
@extends('layouts.index')
@section('title', 'Shared hosting')
@section('css_style')
<x-modal-style></x-modal-style>
@endsection
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@section('header')
{{ __('Shared') }}
@endsection
<x-app-layout>
<x-slot name="header">
{{ __('Shared hosting') }}
</x-slot>
@section('content')
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<div class="card shadow mt-3">
@ -74,29 +71,9 @@
</div>
</div>
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<script>
let app = new Vue({
el: "#app",
data: {
"modal_hostname": '',
"modal_id": '',
"delete_form_action": '',
showModal: false
},
methods: {
confirmDeleteModal(event) {
this.showModal = true;
this.modal_hostname = event.target.title;
this.modal_id = event.target.id;
this.delete_form_action = 'shared/' + this.modal_id;
}
}
});
</script>
</x-app-layout>
<x-modal-delete-script>
<x-slot name="uri">shared</x-slot>
</x-modal-delete-script>
@endsection

View File

@ -140,11 +140,6 @@
<x-slot name="route">{{ route('shared.edit', $shared->id) }}</x-slot>
</x-edit-btn>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>

View File

@ -43,10 +43,7 @@
@endif
</div>
</div>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<script type="application/javascript">
let app = new Vue({

View File

@ -15,77 +15,78 @@
<x-card class="shadow mt-3">
<a href="{{ route('yabs.compare-choose') }}" class="btn btn-success mb-3">Compare YABs</a>
<x-response-alerts></x-response-alerts>
<div class="table-responsive">
<table class="table table-bordered">
<thead class="table-light">
<tr class="bg-gray-100">
<th>Server</th>
<th>CPU</th>
<th>CPU FREQ</th>
<th>RAM</th>
<th>DISK</th>
<th>GB5 S</th>
<th>GB5 M</th>
<th>Ipv6</th>
<th>4k</th>
<th>64k</th>
<th>512k</th>
<th>1m</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@if(!empty($yabs))
@foreach($yabs as $yab)
<tr>
<td><a href="servers/{{$yab->server_id}}" class="text-decoration-none">{{ $yab->server->hostname }}</a></td>
<td><span title="{{$yab->cpu_model}}">{{ $yab->cpu_cores }}</span></td>
<td><span title="{{$yab->cpu_model}}">{{ $yab->cpu_freq }}<small>Mhz</small></span></td>
<td>{{ $yab->ram }}<small>{{ $yab->ram_type }}</small></td>
<td>{{ $yab->disk }}<small>{{ $yab->disk_type }}</small></td>
<td><a href="https://browser.geekbench.com/v5/cpu/{{$yab->gb5_id}}" class="text-decoration-none">{{ $yab->gb5_single }}</a></td>
<td><a href="https://browser.geekbench.com/v5/cpu/{{$yab->gb5_id}}" class="text-decoration-none">{{ $yab->gb5_multi }}</a></td>
<td>@if($yab->has_ipv6 === 1)
Yes
@else
No
@endif
</td>
<td>{{ $yab->disk_speed->d_4k }}<small>{{ $yab->disk_speed->d_4k_type }}</small></td>
<td>{{ $yab->disk_speed->d_64k }}<small>{{ $yab->disk_speed->d_64k_type }}</small></td>
<td>{{ $yab->disk_speed->d_512k }}<small>{{ $yab->disk_speed->d_512k_type }}</small></td>
<td>{{ $yab->disk_speed->d_1m }}<small>{{ $yab->disk_speed->d_1m_type }}</small></td>
<td>{{ date_format(new DateTime($yab->output_date), 'Y-m-d g:i a') }}</small></td>
<td class="text-nowrap">
<form action="{{ route('yabs.destroy', $yab->id) }}" method="POST">
<a href="{{ route('yabs.show', $yab->id) }}"
class="text-body mx-1">
<i class="fas fa-eye" title="view"></i>
</a>
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
id="btn-{{$yab->server->hostname}}" title="{{$yab->id}}"></i>
</form>
</td>
</tr>
@endforeach
@else
<div class="table-responsive">
<table class="table table-bordered">
<thead class="table-light">
<tr class="bg-gray-100">
<th>Server</th>
<th>CPU</th>
<th>CPU FREQ</th>
<th>RAM</th>
<th>DISK</th>
<th>GB5 S</th>
<th>GB5 M</th>
<th>Ipv6</th>
<th>4k</th>
<th>64k</th>
<th>512k</th>
<th>1m</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@if(!empty($yabs))
@foreach($yabs as $yab)
<tr>
<td class="px-4 py-2 border text-red-500" colspan="3">No YABs found.</td>
</tr>
@endif
</tbody>
</table>
<td><a href="servers/{{$yab->server_id}}"
class="text-decoration-none">{{ $yab->server->hostname }}</a></td>
<td><span title="{{$yab->cpu_model}}">{{ $yab->cpu_cores }}</span></td>
<td><span title="{{$yab->cpu_model}}">{{ $yab->cpu_freq }}<small>Mhz</small></span></td>
<td>{{ $yab->ram }}<small>{{ $yab->ram_type }}</small></td>
<td>{{ $yab->disk }}<small>{{ $yab->disk_type }}</small></td>
<td><a href="https://browser.geekbench.com/v5/cpu/{{$yab->gb5_id}}"
class="text-decoration-none">{{ $yab->gb5_single }}</a></td>
<td><a href="https://browser.geekbench.com/v5/cpu/{{$yab->gb5_id}}"
class="text-decoration-none">{{ $yab->gb5_multi }}</a></td>
<td>@if($yab->has_ipv6 === 1)
Yes
@else
No
@endif
</td>
<td>{{ $yab->disk_speed->d_4k }}<small>{{ $yab->disk_speed->d_4k_type }}</small></td>
<td>{{ $yab->disk_speed->d_64k }}<small>{{ $yab->disk_speed->d_64k_type }}</small></td>
<td>{{ $yab->disk_speed->d_512k }}<small>{{ $yab->disk_speed->d_512k_type }}</small>
</td>
<td>{{ $yab->disk_speed->d_1m }}<small>{{ $yab->disk_speed->d_1m_type }}</small></td>
<td>{{ date_format(new DateTime($yab->output_date), 'Y-m-d g:i a') }}</small></td>
<td class="text-nowrap">
<form action="{{ route('yabs.destroy', $yab->id) }}" method="POST">
<a href="{{ route('yabs.show', $yab->id) }}"
class="text-body mx-1">
<i class="fas fa-eye" title="view"></i>
</a>
</div>
<i class="fas fa-trash text-danger ms-3" @click="confirmDeleteModal"
id="{{$yab->id}}" title="{{$yab->server->hostname}}"></i>
</form>
</td>
</tr>
@endforeach
@else
<tr>
<td class="px-4 py-2 border text-red-500" colspan="3">No YABs found.</td>
</tr>
@endif
</tbody>
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>Built on Laravel
v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})</small></p>
@endif
<x-details-footer></x-details-footer>
</div>
<x-modal-delete-script>
<x-slot name="uri">yabs</x-slot>
</x-modal-delete-script>
<x-modal-delete-script>
<x-slot name="uri">yabs</x-slot>
</x-modal-delete-script>
</x-app-layout>

View File

@ -135,11 +135,6 @@
</div>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
<x-details-footer></x-details-footer>
</div>
</x-app-layout>