Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev up to Main #98

Merged
merged 58 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
14f1e80
Merge pull request #78 from cp6/Development
cp6 Nov 13, 2022
0f0b06e
Updated readme for NPM usage
cp6 Nov 13, 2022
1572cea
Update README.md
cp6 Dec 1, 2022
159d17e
Merge pull request #81 from cp6/Development
cp6 Dec 2, 2022
036122c
Merge pull request #82 from cp6/Development
cp6 Dec 2, 2022
7f88a38
Updated gitignore for fonts to be included
cp6 Dec 2, 2022
7f83b92
Use app name at more places in app
Gamerboy59 Jan 17, 2023
6ecf12c
Merge pull request #84 from Gamerboy59/appname-patch
cp6 Feb 14, 2023
ba21329
Update composer.json
Gamerboy59 Feb 14, 2023
cd03865
Delete composer.lock
Gamerboy59 Feb 14, 2023
792f010
Update Kernel.php
Gamerboy59 Feb 14, 2023
102f02b
Update package.json
Gamerboy59 Feb 14, 2023
7ed69cb
Delete package-lock.json
Gamerboy59 Feb 14, 2023
6e95917
Merge pull request #85 from Gamerboy59/laravel-10
cp6 Feb 19, 2023
39b9033
Updated readme for version 2.2
cp6 Feb 19, 2023
c24056c
Fix for issue 89
cp6 Mar 19, 2023
2708d37
Updated readme for 2.2.1
cp6 Mar 20, 2023
4dbfe6f
Removed CSS and JS files as these are no longer needed with the use o…
cp6 Mar 30, 2023
f619f34
Merge remote-tracking branch 'origin/main' into main
cp6 Mar 30, 2023
8a6748f
Added ability to upload own favicon
cp6 Mar 31, 2023
f488e10
Updated array() usages to be []
cp6 Mar 31, 2023
a683f0e
Updated Settings.php
cp6 Mar 31, 2023
5dbc6a5
Updated readme for version 2.3
cp6 Mar 31, 2023
e82941b
Update composer.json
Gamerboy59 Aug 6, 2023
72f22be
Update package.json
Gamerboy59 Aug 6, 2023
fcb99b1
Update css/js resources
Aug 6, 2023
02c15e9
Fix resource links
Gamerboy59 Aug 6, 2023
3495992
Fix resource links
Gamerboy59 Aug 6, 2023
0aeb38d
Merge pull request #92 from Gamerboy59/main
cp6 Aug 7, 2023
171eb63
Update Pricing.php
cp6 Aug 15, 2023
3b82fd6
Update README.md for 2.3.1
cp6 Aug 17, 2023
c448a27
Update README.md for 2.3.1
cp6 Aug 17, 2023
de66fb2
Fixed spelling mistake in array key
cp6 Aug 18, 2023
65f0474
Merge remote-tracking branch 'origin/main' into main
cp6 Aug 18, 2023
e100203
Updated counts to use Eloquent
cp6 Aug 18, 2023
877592f
Updated count
cp6 Aug 18, 2023
afe5c1e
Cleaned up queries that had un-needed '='
cp6 Aug 18, 2023
455cf45
Cleaned up Server.php
cp6 Aug 18, 2023
507f128
Added return types
cp6 Aug 19, 2023
3bef30d
Removed un unused create() and store() from YabsController.php
cp6 Aug 19, 2023
ae9b23c
Added return types
cp6 Aug 19, 2023
b512cae
Updated to use Eloquent rather than DB::table()
cp6 Aug 19, 2023
b20e405
Used Eloquent
cp6 Aug 19, 2023
7fcbd53
Cleaned up unused file imports
cp6 Aug 19, 2023
966ff38
Unused cleanup
cp6 Aug 19, 2023
f0178ac
Removed un-needed imports
cp6 Aug 20, 2023
6bbbc23
Removed un-needed imports in Controllers
cp6 Aug 20, 2023
ec29479
Fix for accessing an object instead of an array
cp6 Sep 9, 2023
3f4c46e
Fix for accessing an object instead of an array
Gamerboy59 Sep 9, 2023
266d67f
Merge pull request #95 from Gamerboy59/main
cp6 Sep 9, 2023
aadfc48
timestamps false for LabelsAssigned
cp6 Sep 11, 2023
25d338b
Update README.md
cp6 Sep 11, 2023
e486781
Removed YABS GB5 table row from server show
cp6 Sep 12, 2023
b2595fc
Fixed pricing breakdown cache not being refreshed
cp6 Sep 14, 2023
f44c69c
Fixed save_yabs_as_txt causing settings update to fail validation
cp6 Sep 14, 2023
cfbc1bf
Updated homepage tables to remove card with padding, made tables rounded
cp6 Sep 14, 2023
5e6c0a6
Removed unused ExampleComponent.vue
cp6 Sep 14, 2023
d4b75b2
Update README.md
cp6 Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,4 @@ fabric.properties
# .idea/misc.xml
# *.ipr
storage/clockwork/
#public/css/
#public/js/
#public/fonts/
#public/webfonts/
!public/
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,34 @@ 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.9-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.3.1-blue.svg)](https://shields.io/) [![Generic badge](https://img.shields.io/badge/Laravel-10.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.2-pink.svg)](https://shields.io/)

<img src="https://raw.githubusercontent.com/cp6/my-idlers/main/public/My%20Idlers%20logo.jpg" width="128" height="128" />

[Demo site](https://demo.myidlers.com/)
[View demo site](https://demo.myidlers.com/)

**Note:** Create, Update and Delete are disabled on demo site.

## Project sponsor

Currently seeking a project sponsor

## 2.1.9 changes (2nd December 2022):
## 2.3.1 changes (17th August 2023):

* Updated resource files
* Updated composer.json
* Updated packages.json
* Fixed dashboard price summary including non active services

#### Please run the following if updating from existing install:

```shell
composer update
php artisan migrate
php artisan route:cache
php artisan cache:clear
```

* Added & implemented NPM webpack
* Added compiled assets
* Added notes (Servers, shared, reseller, domains, DNS and IPs)
* Fixed create views default provider is no longer the former sponsor

## Requires

* PHP 8.1
Expand Down Expand Up @@ -76,6 +77,7 @@ If you already have at least version 2.0 installed:

* Run `git clone https://github.com/cp6/my-idlers.git`
* Run `composer install`
* Run `composer update`
* Run `php artisan migrate`
* Run `php artisan route:cache`
* Run `php artisan cache:clear`
Expand Down Expand Up @@ -112,6 +114,10 @@ Example yabs.sh call to POST the result:

`curl -sL yabs.sh | bash -s -- -s "https://yourdomain.com/api/yabs/SERVERID/USERAPIKEYISHERE"`

## TODO

Add Geekbench 6 single and multi-core scores

## API endpoints

For GET requests the header must have `Accept: application/json` and your API token (found at `/account`)
Expand Down
40 changes: 19 additions & 21 deletions app/Http/Controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Http\Controllers;

use App\Models\DiskSpeed;
use App\Models\Domains;
use App\Models\IPs;
use App\Models\Labels;
Expand All @@ -17,7 +16,6 @@
use App\Models\Shared;
use App\Models\User;
use App\Models\Yabs;
use App\Process;
use DataTables;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
Expand Down Expand Up @@ -60,7 +58,7 @@ protected function getAllNetworkSpeeds()

protected function getNetworkSpeeds($id)
{
$ns = NetworkSpeed::where('server_id', '=', $id)
$ns = NetworkSpeed::where('server_id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($ns, 200);
}
Expand All @@ -73,7 +71,7 @@ protected function getAllLabels()

protected function getLabel($id)
{
$label = Labels::where('id', '=', $id)
$label = Labels::where('id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($label, 200);
}
Expand Down Expand Up @@ -148,7 +146,7 @@ protected function getAllDns()
protected function getDns($id)
{
$dns = DB::table('d_n_s')
->where('id', '=', $id)
->where('id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($dns, 200);
}
Expand All @@ -163,7 +161,7 @@ protected function getAllLocations()
protected function getLocation($id)
{
$location = DB::table('locations')
->where('id', '=', $id)
->where('id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($location, 200);
}
Expand All @@ -178,7 +176,7 @@ protected function getAllProviders()
protected function getProvider($id)
{
$providers = DB::table('providers')
->where('id', '=', $id)
->where('id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($providers, 200);
}
Expand All @@ -199,7 +197,7 @@ protected function getAllOs()
protected function getOs($id)
{
$os = DB::table('os as o')
->where('o.id', '=', $id)
->where('o.id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($os, 200);
}
Expand All @@ -213,7 +211,7 @@ protected function getAllIPs()
protected function getIP($id)
{
$ip = DB::table('ips as i')
->where('i.id', '=', $id)
->where('i.id', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($ip, 200);
}
Expand Down Expand Up @@ -264,7 +262,7 @@ protected function getIpForDomain(string $domainname, string $type)

protected function storeServer(Request $request)
{
$rules = array(
$rules = [
'hostname' => 'min:3',
'server_type' => 'required|integer',
'os_id' => 'required|integer',
Expand All @@ -289,9 +287,9 @@ protected function storeServer(Request $request)
'price' => 'required|numeric',
'payment_term' => 'required|integer',
'next_due_date' => 'date',
);
];

$messages = array(
$messages = [
'required' => ':attribute is required',
'min' => ':attribute must be longer than 3',
'integer' => ':attribute must be an integer',
Expand All @@ -300,7 +298,7 @@ protected function storeServer(Request $request)
'numeric' => ':attribute must be a float',
'ip' => ':attribute must be a valid IP address',
'date' => ':attribute must be a date Y-m-d',
);
];

$validator = Validator::make($request->all(), $rules, $messages);

Expand Down Expand Up @@ -375,7 +373,7 @@ public function destroyServer(Request $request)

public function updateServer(Request $request)
{
$rules = array(
$rules = [
'hostname' => 'string|min:3',
'server_type' => 'integer',
'os_id' => 'integer',
Expand All @@ -398,17 +396,17 @@ public function updateServer(Request $request)
'price' => 'numeric',
'payment_term' => 'integer',
'next_due_date' => 'date',
);
];

$messages = array(
$messages = [
'required' => ':attribute is required',
'min' => ':attribute must be longer than 3',
'integer' => ':attribute must be an integer',
'string' => ':attribute must be a string',
'size' => ':attribute must be exactly :size characters',
'numeric' => ':attribute must be a float',
'date' => ':attribute must be a date Y-m-d',
);
];

$validator = Validator::make($request->all(), $rules, $messages);

Expand All @@ -430,22 +428,22 @@ public function updateServer(Request $request)

public function updatePricing(Request $request)
{
$rules = array(
$rules = [
'price' => 'required|numeric',
'currency' => 'required|string|size:3',
'term' => 'required|integer',
'active' => 'integer',
'next_due_date' => 'date',
);
];

$messages = array(
$messages = [
'required' => ':attribute is required',
'integer' => ':attribute must be an integer',
'string' => ':attribute must be a string',
'size' => ':attribute must be exactly :size characters',
'numeric' => ':attribute must be a float',
'date' => ':attribute must be a date Y-m-d',
);
];

$validator = Validator::make($request->all(), $rules, $messages);

Expand Down
13 changes: 6 additions & 7 deletions app/Http/Controllers/DNSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Models\Server;
use App\Models\Domains;
use App\Models\Shared;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -69,8 +68,8 @@ public function show(DNS $dn)
$dns = DNS::findOrFail($dn->id);

$labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $dn->id)
->join('labels', 'l.label_id', 'labels.id')
->where('l.service_id', $dn->id)
->get(['labels.label']);

return view('dns.show', compact(['dn', 'dns', 'labels']));
Expand All @@ -84,14 +83,14 @@ public function edit(DNS $dn)
$Resellers = Reseller::all();
$dn = DNS::findOrFail($dn->id);
$labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $dn->id)
->join('labels', 'l.label_id', 'labels.id')
->where('l.service_id', $dn->id)
->get(['labels.id']);

return view('dns.edit', compact(['dn', 'labels', 'Servers', 'Domains', 'Shareds', 'Resellers']));
}

public function update(Request $request, DNS $dn)
public function update(Request $request, DNS $dn): \Illuminate\Http\RedirectResponse
{
$request->validate([
'hostname' => 'required|string|min:2',
Expand Down Expand Up @@ -121,7 +120,7 @@ public function update(Request $request, DNS $dn)
->with('success', 'DNS updated Successfully.');
}

public function destroy(DNS $dn)
public function destroy(DNS $dn): \Illuminate\Http\RedirectResponse
{
if ( $dn->delete()){
Cache::forget('dns_count');
Expand Down
9 changes: 3 additions & 6 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use App\Models\Labels;
use App\Models\Pricing;
use App\Models\Settings;
use Carbon\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use App\Process;
use Illuminate\Support\Facades\Session;

Expand Down Expand Up @@ -47,7 +44,7 @@ public function index()

$p->stopTimer();

$information = array(
$information = [
'servers' => $service_count['servers'],
'domains' => $service_count['domains'],
'shared' => $service_count['shared'],
Expand All @@ -59,15 +56,15 @@ public function index()
'total_services' => $service_count['total'],
'total_inactive' => $pricing_breakdown['inactive_count'],
'total_cost_weekly' => number_format($pricing_breakdown['total_cost_weekly'], 2),
'total_cost_monthly' => number_format($pricing_breakdown['total_cost_montly'], 2),
'total_cost_monthly' => number_format($pricing_breakdown['total_cost_monthly'], 2),
'total_cost_yearly' => number_format($pricing_breakdown['total_cost_yearly'], 2),
'total_cost_2_yearly' => number_format(($pricing_breakdown['total_cost_yearly'] * 2), 2),
'due_soon' => $due_soon,
'newest' => $recently_added,
'execution_time' => number_format($p->getTimeTaken(), 2),
'servers_summary' => $server_summary,
'currency' => Session::get('dashboard_currency')
);
];

return view('home', compact('information'));
}
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/IPsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace App\Http\Controllers;

use App\Models\DNS;
use App\Models\IPs;
use App\Models\Reseller;
use App\Models\SeedBoxes;
use App\Models\Server;
use App\Models\Shared;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

class IPsController extends Controller
Expand Down
17 changes: 6 additions & 11 deletions app/Http/Controllers/LabelsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,17 @@ public function store(Request $request)
public function show(Labels $label)
{
$labels = DB::table('labels_assigned as las')
->leftJoin('pricings as p', 'las.service_id', '=', 'p.service_id')
->leftJoin('servers as s', 'las.service_id', '=', 's.id')
->leftJoin('shared_hosting as sh', 'las.service_id', '=', 'sh.id')
->leftJoin('reseller_hosting as r', 'las.service_id', '=', 'r.id')
->leftJoin('domains as d', 'las.service_id', '=', 'd.id')
->where('las.label_id', '=', $label->id)
->leftJoin('pricings as p', 'las.service_id', 'p.service_id')
->leftJoin('servers as s', 'las.service_id', 's.id')
->leftJoin('shared_hosting as sh', 'las.service_id', 'sh.id')
->leftJoin('reseller_hosting as r', 'las.service_id', 'r.id')
->leftJoin('domains as d', 'las.service_id', 'd.id')
->where('las.label_id', $label->id)
->get(['p.service_type', 'p.service_id', 's.hostname', 'sh.main_domain as shared', 'r.main_domain as reseller', 'd.domain', 'd.extension']);

return view('labels.show', compact(['label', 'labels']));
}

public function edit(Labels $label)
{
abort(404);
}

public function destroy(Labels $label)
{
if ($label->delete()) {
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/LocationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public function store(Request $request)
public function show(Locations $location)
{
$servers = DB::table('servers as s')
->where('s.location_id', '=', $location->id)
->where('s.location_id', $location->id)
->get(['s.id', 's.hostname'])
->toArray();

$shared = DB::table('shared_hosting as s')
->where('s.location_id', '=', $location->id)
->where('s.location_id', $location->id)
->get(['s.id', 's.main_domain as main_domain_shared'])
->toArray();

$reseller = DB::table('reseller_hosting as r')
->where('r.location_id', '=', $location->id)
->where('r.location_id', $location->id)
->get(['r.id', 'r.main_domain as main_domain_reseller'])
->toArray();

Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use App\Models\Pricing;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

class MiscController extends Controller
Expand Down
Loading
Loading