Fix
This commit is contained in:
cp6 2022-03-06 02:58:25 +11:00
parent d429ecd44d
commit da83aa1f23
9581 changed files with 644 additions and 973096 deletions

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="my_idlers@localhost" uuid="efc7de96-2071-4420-9d95-422a64f97449">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306/my_idlers</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View File

@ -2,8 +2,10 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\IPs;
use App\Models\Labels; use App\Models\Labels;
use App\Models\NetworkSpeed; use App\Models\NetworkSpeed;
use App\Models\OS;
use App\Models\Pricing; use App\Models\Pricing;
use App\Models\Providers; use App\Models\Providers;
use App\Models\Server; use App\Models\Server;
@ -18,7 +20,10 @@ class ApiController extends Controller
{ {
$servers = DB::table('servers as s') $servers = DB::table('servers as s')
->Join('pricings as p', 's.id', '=', 'p.service_id') ->Join('pricings as p', 's.id', '=', 'p.service_id')
->get(['s.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date'])->toJson(JSON_PRETTY_PRINT); ->join('providers as pr', 's.provider_id', '=', 'pr.id')
->join('locations as l', 's.location_id', '=', 'l.id')
->join('os as o', 's.os_id', '=', 'o.id')
->get(['s.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date', 'pr.name as provider', 'l.name as location','o.name as os'])->toJson(JSON_PRETTY_PRINT);
return response($servers, 200); return response($servers, 200);
} }
@ -27,8 +32,11 @@ class ApiController extends Controller
{ {
$server = DB::table('servers as s') $server = DB::table('servers as s')
->Join('pricings as p', 's.id', '=', 'p.service_id') ->Join('pricings as p', 's.id', '=', 'p.service_id')
->join('providers as pr', 's.provider_id', '=', 'pr.id')
->join('locations as l', 's.location_id', '=', 'l.id')
->join('os as o', 's.os_id', '=', 'o.id')
->where('s.id', '=', $id) ->where('s.id', '=', $id)
->get(['s.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date']); ->get(['s.*', 'p.id as price_id', 'p.currency', 'p.price', 'p.term', 'p.as_usd', 'p.usd_per_month', 'p.next_due_date', 'pr.name as provider', 'l.name as location','o.name as os']);
$yabs = DB::table('yabs') $yabs = DB::table('yabs')
->where('yabs.server_id', '=', $id) ->where('yabs.server_id', '=', $id)
@ -47,6 +55,11 @@ class ApiController extends Controller
->where('la.service_id', '=', $id) ->where('la.service_id', '=', $id)
->get(['l.*']); ->get(['l.*']);
$ip_addresses = DB::table('ips as i')
->where('i.service_id', '=', $id)
->get(['i.*']);
$server['ip_addresses'] = $ip_addresses;
$server['yabs'] = $yabs; $server['yabs'] = $yabs;
$server['disk_speed'] = $disk_speed; $server['disk_speed'] = $disk_speed;
$server['network_speed'] = $network_speed; $server['network_speed'] = $network_speed;
@ -215,6 +228,34 @@ class ApiController extends Controller
return response($settings, 200); return response($settings, 200);
} }
protected function getAllOs()
{
$os = OS::all()->toJson(JSON_PRETTY_PRINT);
return response($os, 200);
}
protected function getOs($id)
{
$os = DB::table('os as o')
->where('o.id', '=', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($os, 200);
}
protected function getAllIPs()
{
$ip = IPs::all()->toJson(JSON_PRETTY_PRINT);
return response($ip, 200);
}
protected function getIP($id)
{
$ip = DB::table('ips as i')
->where('i.id', '=', $id)
->get()->toJson(JSON_PRETTY_PRINT);
return response($ip, 200);
}
public function getAllProvidersTable(Request $request) public function getAllProvidersTable(Request $request)
{ {
if ($request->ajax()) { if ($request->ajax()) {

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginRequest; use App\Http\Requests\Auth\LoginRequest;
use App\Models\User;
use App\Providers\RouteServiceProvider; use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -17,6 +18,10 @@ class AuthenticatedSessionController extends Controller
*/ */
public function create() public function create()
{ {
$users = User::all();
if ($users->count() === 0) {//Only allow 1 user for this app
return redirect('/register');
}
return view('auth.login'); return view('auth.login');
} }

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Auth; namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Settings;
use App\Models\User; use App\Models\User;
use App\Providers\RouteServiceProvider; use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Events\Registered;

View File

@ -66,7 +66,13 @@ class DNSController extends Controller
public function show(DNS $dn) public function show(DNS $dn)
{ {
$dns = DNS::findOrFail($dn->id); $dns = DNS::findOrFail($dn->id);
return view('dns.show', compact(['dn', 'dns']));
$labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $dn->id)
->get(['labels.label']);
return view('dns.show', compact(['dn', 'dns', 'labels']));
} }
public function edit(DNS $dn) public function edit(DNS $dn)

View File

@ -7,6 +7,7 @@ use App\Models\Labels;
use App\Models\Pricing; use App\Models\Pricing;
use App\Models\Providers; use App\Models\Providers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -25,13 +26,19 @@ class DomainsController extends Controller
public function show(Domains $domain) public function show(Domains $domain)
{ {
$service_extras = DB::table('domains as d') $service_extras = DB::table('domains as d')
->join('providers as p', 'd.provider_id', '=', 'p.id') ->join('providers as p', 'd.provider_id', '=', 'p.id')
->join('pricings as pr', 'd.id', '=', 'pr.service_id') ->join('pricings as pr', 'd.id', '=', 'pr.service_id')
->where('d.id', '=', $domain->id) ->where('d.id', '=', $domain->id)
->get(['d.*', 'p.name as provider_name', 'pr.*']); ->get(['d.*', 'p.name as provider_name', 'pr.*']);
return view('domains.show', compact(['domain', 'service_extras'])); $labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $domain->id)
->get(['labels.label']);
return view('domains.show', compact(['domain', 'service_extras', 'labels']));
} }
public function create() public function create()
@ -82,10 +89,14 @@ class DomainsController extends Controller
for ($i = 1; $i <= 4; $i++) { for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) { if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $domain_id]); DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $domain_id]);
} }
} }
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('domains.index') return redirect()->route('domains.index')
->with('success', 'Domain Created Successfully.'); ->with('success', 'Domain Created Successfully.');
} }
@ -152,6 +163,10 @@ class DomainsController extends Controller
} }
} }
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('domains.index') return redirect()->route('domains.index')
->with('success', 'Domain Updated Successfully.'); ->with('success', 'Domain Updated Successfully.');
} }
@ -167,6 +182,10 @@ class DomainsController extends Controller
Labels::deleteLabelsAssignedTo($domain->id); Labels::deleteLabelsAssignedTo($domain->id);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('domains.index') return redirect()->route('domains.index')
->with('success', 'Domain was deleted Successfully.'); ->with('success', 'Domain was deleted Successfully.');
} }

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Models\Pricing; use App\Models\Pricing;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\Process; use App\Process;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
@ -28,14 +29,16 @@ class HomeController extends Controller
$p = new Process(); $p = new Process();
$p->startTimer(); $p->startTimer();
$services_count = DB::table('pricings') $services_count = Cache::remember('services_count', 1440, function () {
return DB::table('pricings')
->select('service_type', DB::raw('COUNT(*) as amount')) ->select('service_type', DB::raw('COUNT(*) as amount'))
->groupBy('service_type') ->groupBy('service_type')
->where('active', '=', 1) ->where('active', '=', 1)
->get(); ->get();
});
$due_soon = Cache::remember('due_soon', 1440, function () {
$due_soon = DB::table('pricings as p') return DB::table('pricings as p')
->leftJoin('servers as s', 'p.service_id', '=', 's.id') ->leftJoin('servers as s', 'p.service_id', '=', 's.id')
->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id') ->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id')
->leftJoin('reseller_hosting as r', 'p.service_id', '=', 'r.id') ->leftJoin('reseller_hosting as r', 'p.service_id', '=', 'r.id')
@ -45,6 +48,7 @@ class HomeController extends Controller
->orderBy('next_due_date', 'ASC') ->orderBy('next_due_date', 'ASC')
->limit(6) ->limit(6)
->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']); ->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']);
});
//Check for past due date and refresh the due date if so: //Check for past due date and refresh the due date if so:
@ -64,8 +68,10 @@ class HomeController extends Controller
$count++; $count++;
} }
Cache::put('due_soon', $due_soon);
$recently_added = DB::table('pricings as p') $recently_added = Cache::remember('recently_added', 1440, function () {
return DB::table('pricings as p')
->leftJoin('servers as s', 'p.service_id', '=', 's.id') ->leftJoin('servers as s', 'p.service_id', '=', 's.id')
->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id') ->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id')
->leftJoin('reseller_hosting as r', 'p.service_id', '=', 'r.id') ->leftJoin('reseller_hosting as r', 'p.service_id', '=', 'r.id')
@ -75,13 +81,24 @@ class HomeController extends Controller
->orderBy('created_at', 'DESC') ->orderBy('created_at', 'DESC')
->limit(6) ->limit(6)
->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']); ->get(['p.*', 's.hostname', 'd.domain', 'd.extension', 'r.main_domain as reseller', 'sh.main_domain', 'ms.name']);
});
$settings = DB::table('settings') $settings = Cache::remember('settings', 15, function () {
return DB::table('settings')
->where('id', '=', 1) ->where('id', '=', 1)
->get(); ->get();
});
Session::put('timer_version_footer', $settings[0]->show_versions_footer); Session::put('timer_version_footer', $settings[0]->show_versions_footer);
Session::put('show_servers_public', $settings[0]->show_servers_public); Session::put('show_servers_public', $settings[0]->show_servers_public);
Session::put('show_server_value_ip', $settings[0]->show_server_value_ip);
Session::put('show_server_value_hostname', $settings[0]->show_server_value_hostname);
Session::put('show_server_value_price', $settings[0]->show_server_value_price);
Session::put('show_server_value_yabs', $settings[0]->show_server_value_yabs);
Session::put('show_server_value_provider', $settings[0]->show_server_value_provider);
Session::put('show_server_value_location', $settings[0]->show_server_value_location);
Session::put('default_currency', $settings[0]->default_currency);
Session::put('default_server_os', $settings[0]->default_server_os);
Session::save(); Session::save();
$pricing = json_decode(DB::table('pricings')->get(), true); $pricing = json_decode(DB::table('pricings')->get(), true);
@ -154,8 +171,6 @@ class HomeController extends Controller
'execution_time' => number_format($p->getTimeTaken(), 2) 'execution_time' => number_format($p->getTimeTaken(), 2)
); );
//dd($information);
return view('home', compact('information')); return view('home', compact('information'));
} }
} }

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Labels; use App\Models\Labels;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -32,13 +33,24 @@ class LabelsController extends Controller
'label' => $request->label 'label' => $request->label
]); ]);
Cache::forget('all_labels');
return redirect()->route('labels.index') return redirect()->route('labels.index')
->with('success', 'Label Created Successfully.'); ->with('success', 'Label Created Successfully.');
} }
public function show(Labels $label) public function show(Labels $label)
{ {
return view('labels.show', compact(['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)
->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) public function edit(Labels $label)
@ -56,6 +68,8 @@ class LabelsController extends Controller
Labels::deleteLabelAssignedAs($label_id); Labels::deleteLabelAssignedAs($label_id);
Cache::forget('all_labels');
return redirect()->route('labels.index') return redirect()->route('labels.index')
->with('success', 'Label was deleted Successfully.'); ->with('success', 'Label was deleted Successfully.');
} }

View File

@ -4,6 +4,8 @@ namespace App\Http\Controllers;
use App\Models\Locations; use App\Models\Locations;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class LocationsController extends Controller class LocationsController extends Controller
@ -29,16 +31,42 @@ class LocationsController extends Controller
'name' => $request->location_name 'name' => $request->location_name
]); ]);
Cache::forget('all_locations');
return redirect()->route('locations.index') return redirect()->route('locations.index')
->with('success', 'Location Created Successfully.'); ->with('success', 'Location Created Successfully.');
} }
public function show(Locations $location)
{
$servers = DB::table('servers as s')
->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)
->get(['s.id', 's.main_domain as main_domain_shared'])
->toArray();
$reseller = DB::table('reseller_hosting as r')
->where('r.location_id', '=', $location->id)
->get(['r.id', 'r.main_domain as main_domain_reseller'])
->toArray();
$data = array_merge($servers, $shared, $reseller);
return view('locations.show', compact(['location', 'data']));
}
public function destroy(Locations $location) public function destroy(Locations $location)
{ {
$items = Locations::find($location->id); $items = Locations::find($location->id);
$items->delete(); $items->delete();
Cache::forget('all_locations');
return redirect()->route('locations.index') return redirect()->route('locations.index')
->with('success', 'Location was deleted Successfully.'); ->with('success', 'Location was deleted Successfully.');
} }

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Models\Misc; use App\Models\Misc;
use App\Models\Pricing; use App\Models\Pricing;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -66,6 +67,10 @@ class MiscController extends Controller
'next_due_date' => $request->next_due_date, 'next_due_date' => $request->next_due_date,
]); ]);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('misc.index') return redirect()->route('misc.index')
->with('success', 'Misc service created Successfully.'); ->with('success', 'Misc service created Successfully.');
} }
@ -111,6 +116,10 @@ class MiscController extends Controller
'active' => (isset($request->is_active)) ? 1 : 0 'active' => (isset($request->is_active)) ? 1 : 0
]); ]);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('misc.index') return redirect()->route('misc.index')
->with('success', 'Misc service updated Successfully.'); ->with('success', 'Misc service updated Successfully.');
} }
@ -124,6 +133,10 @@ class MiscController extends Controller
$p = new Pricing(); $p = new Pricing();
$p->deletePricing($misc->id); $p->deletePricing($misc->id);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('misc.index') return redirect()->route('misc.index')
->with('success', 'Misc service was deleted Successfully.'); ->with('success', 'Misc service was deleted Successfully.');
} }

View File

@ -5,6 +5,8 @@ namespace App\Http\Controllers;
use App\Models\Providers; use App\Models\Providers;
use DataTables; use DataTables;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class ProvidersController extends Controller class ProvidersController extends Controller
{ {
@ -29,16 +31,42 @@ class ProvidersController extends Controller
'name' => $request->provider_name 'name' => $request->provider_name
]); ]);
Cache::forget('all_providers');
return redirect()->route('providers.index') return redirect()->route('providers.index')
->with('success', 'Provider Created Successfully.'); ->with('success', 'Provider Created Successfully.');
} }
public function show(Providers $provider)
{
$servers = DB::table('servers as s')
->where('s.provider_id', '=', $provider->id)
->get(['s.id', 's.hostname'])
->toArray();
$shared = DB::table('shared_hosting as s')
->where('s.provider_id', '=', $provider->id)
->get(['s.id', 's.main_domain as main_domain_shared'])
->toArray();
$reseller = DB::table('reseller_hosting as r')
->where('r.provider_id', '=', $provider->id)
->get(['r.id', 'r.main_domain as main_domain_reseller'])
->toArray();
$data = array_merge($servers, $shared, $reseller);
return view('providers.show', compact(['provider', 'data']));
}
public function destroy(Providers $provider) public function destroy(Providers $provider)
{ {
$items = Providers::find($provider->id); $items = Providers::find($provider->id);
$items->delete(); $items->delete();
Cache::forget('all_providers');
return redirect()->route('providers.index') return redirect()->route('providers.index')
->with('success', 'Provider was deleted Successfully.'); ->with('success', 'Provider was deleted Successfully.');
} }
@ -55,7 +83,6 @@ class ProvidersController extends Controller
}) })
->rawColumns(['action']) ->rawColumns(['action'])
->make(true); ->make(true);
dd($dt);
} }
} }

View File

@ -2,12 +2,14 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\IPs;
use App\Models\Labels; use App\Models\Labels;
use App\Models\Locations; use App\Models\Locations;
use App\Models\Pricing; use App\Models\Pricing;
use App\Models\Providers; use App\Models\Providers;
use App\Models\Reseller; use App\Models\Reseller;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -39,7 +41,6 @@ class ResellerController extends Controller
'reseller_type' => 'required', 'reseller_type' => 'required',
'dedicated_ip' => 'present', 'dedicated_ip' => 'present',
'accounts' => 'numeric', 'accounts' => 'numeric',
'has_dedicated_ip' => 'numeric',
'server_type' => 'numeric', 'server_type' => 'numeric',
'ram' => 'numeric', 'ram' => 'numeric',
'disk' => 'numeric', 'disk' => 'numeric',
@ -66,8 +67,6 @@ class ResellerController extends Controller
'main_domain' => $request->domain, 'main_domain' => $request->domain,
'accounts' => $request->accounts, 'accounts' => $request->accounts,
'reseller_type' => $request->reseller_type, 'reseller_type' => $request->reseller_type,
'has_dedicated_ip' => $request->has_dedicated_ip,
'ip' => $request->dedicated_ip,
'provider_id' => $request->provider_id, 'provider_id' => $request->provider_id,
'location_id' => $request->location_id, 'location_id' => $request->location_id,
'disk' => $request->disk, 'disk' => $request->disk,
@ -98,6 +97,30 @@ class ResellerController extends Controller
'next_due_date' => $request->next_due_date, 'next_due_date' => $request->next_due_date,
]); ]);
if (!is_null($request->dedicated_ip)) {
IPs::create(
[
'id' => Str::random(8),
'service_id' => $reseller_id,
'address' => $request->dedicated_ip,
'is_ipv4' => (filter_var($request->dedicated_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1,
'active' => 1
]
);
}
$labels_array = [$request->label1, $request->label2, $request->label3, $request->label4];
for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $reseller_id]);
}
}
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('reseller.index') return redirect()->route('reseller.index')
->with('success', 'Reseller hosting created Successfully.'); ->with('success', 'Reseller hosting created Successfully.');
} }
@ -113,11 +136,15 @@ class ResellerController extends Controller
->get(['s.*', 'p.name as provider_name', 'l.name as location', 'pr.*']); ->get(['s.*', 'p.name as provider_name', 'l.name as location', 'pr.*']);
$labels = DB::table('labels_assigned as l') $labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id') ->LeftJoin('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $reseller->id) ->where('l.service_id', '=', $reseller->id)
->get(['labels.label']); ->get(['labels.label']);
return view('reseller.show', compact(['reseller', 'reseller_extras', 'labels'])); $ip_address = DB::table('ips as i')
->where('i.service_id', '=', $reseller->id)
->get();
return view('reseller.show', compact(['reseller', 'reseller_extras', 'labels', 'ip_address']));
} }
public function edit(Reseller $reseller) public function edit(Reseller $reseller)
@ -125,12 +152,21 @@ class ResellerController extends Controller
$locations = DB::table('locations')->get(['*']); $locations = DB::table('locations')->get(['*']);
$providers = json_decode(DB::table('providers')->get(['*']), true); $providers = json_decode(DB::table('providers')->get(['*']), true);
$labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $reseller->id)
->get(['labels.id', 'labels.label']);
$ip_address = json_decode(DB::table('ips as i')
->where('i.service_id', '=', $reseller->id)
->get(), true);
$reseller = DB::table('reseller_hosting as s') $reseller = DB::table('reseller_hosting as s')
->join('pricings as p', 's.id', '=', 'p.service_id') ->join('pricings as p', 's.id', '=', 'p.service_id')
->where('s.id', '=', $reseller->id) ->where('s.id', '=', $reseller->id)
->get(['s.*', 'p.*']); ->get(['s.*', 'p.*']);
return view('reseller.edit', compact(['reseller', 'locations', 'providers'])); return view('reseller.edit', compact(['reseller', 'locations', 'providers', 'ip_address', 'labels']));
} }
public function update(Request $request, Reseller $reseller) public function update(Request $request, Reseller $reseller)
@ -140,7 +176,6 @@ class ResellerController extends Controller
'domain' => 'required|min:4', 'domain' => 'required|min:4',
'reseller_type' => 'required', 'reseller_type' => 'required',
'dedicated_ip' => 'present', 'dedicated_ip' => 'present',
'has_dedicated_ip' => 'numeric',
'server_type' => 'numeric', 'server_type' => 'numeric',
'disk' => 'numeric', 'disk' => 'numeric',
'os_id' => 'numeric', 'os_id' => 'numeric',
@ -163,8 +198,6 @@ class ResellerController extends Controller
->update([ ->update([
'main_domain' => $request->domain, 'main_domain' => $request->domain,
'reseller_type' => $request->reseller_type, 'reseller_type' => $request->reseller_type,
'has_dedicated_ip' => $request->has_dedicated_ip,
'ip' => $request->dedicated_ip,
'provider_id' => $request->provider_id, 'provider_id' => $request->provider_id,
'location_id' => $request->location_id, 'location_id' => $request->location_id,
'disk' => $request->disk, 'disk' => $request->disk,
@ -195,6 +228,31 @@ class ResellerController extends Controller
'next_due_date' => $request->next_due_date, 'next_due_date' => $request->next_due_date,
]); ]);
$deleted = DB::table('labels_assigned')->where('service_id', '=', $request->id)->delete();
$labels_array = [$request->label1, $request->label2, $request->label3, $request->label4];
for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT IGNORE INTO labels_assigned ( label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $request->id]);
}
}
$delete_ip = DB::table('ips')->where('service_id', '=', $request->id)->delete();
if (isset($request->dedicated_ip)) {
DB::insert('INSERT IGNORE INTO ips (id, address, service_id, is_ipv4) values (?, ?, ?, ?)', [
Str::random(8),
$request->dedicated_ip,
$request->id,
(filter_var($request->dedicated_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1
]);
}
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('reseller.index') return redirect()->route('reseller.index')
->with('success', 'Reseller hosting updated Successfully.'); ->with('success', 'Reseller hosting updated Successfully.');
} }
@ -207,10 +265,16 @@ class ResellerController extends Controller
$items->delete(); $items->delete();
$p = new Pricing(); $p = new Pricing();
$p->deletePricing($reseller->id); $p->deletePricing($id);
Labels::deleteLabelsAssignedTo($id); Labels::deleteLabelsAssignedTo($id);
IPs::deleteIPsAssignedTo($id);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('reseller.index') return redirect()->route('reseller.index')
->with('success', 'Reseller hosting was deleted Successfully.'); ->with('success', 'Reseller hosting was deleted Successfully.');
} }

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\IPs;
use App\Models\Labels; use App\Models\Labels;
use App\Models\OS; use App\Models\OS;
use App\Models\Pricing; use App\Models\Pricing;
@ -9,6 +10,8 @@ use App\Models\Server;
use App\Models\Providers; use App\Models\Providers;
use App\Models\Locations; use App\Models\Locations;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -20,13 +23,27 @@ class ServerController extends Controller
public function index() public function index()
{ {
$servers = DB::table('servers as s') $servers = Cache::remember('all_active_servers', 1440, function () {
return DB::table('servers as s')
->join('pricings as pr', 's.id', '=', 'pr.service_id') ->join('pricings as pr', 's.id', '=', 'pr.service_id')
->join('providers as p', 's.provider_id', '=', 'p.id') ->join('providers as p', 's.provider_id', '=', 'p.id')
->join('locations as l', 's.location_id', '=', 'l.id') ->join('locations as l', 's.location_id', '=', 'l.id')
->join('os as o', 's.os_id', '=', 'o.id') ->join('os as o', 's.os_id', '=', 'o.id')
->where('s.active', '=', 1)
->get(['s.*', 'pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'p.name as provider_name', 'l.name as location', 'o.name as os_name']); ->get(['s.*', 'pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'p.name as provider_name', 'l.name as location', 'o.name as os_name']);
return view('servers.index', compact(['servers'])); });
$non_active_servers = Cache::remember('non_active_servers', 1440, function () {
return DB::table('servers as s')
->join('pricings as pr', 's.id', '=', 'pr.service_id')
->join('providers as p', 's.provider_id', '=', 'p.id')
->join('locations as l', 's.location_id', '=', 'l.id')
->join('os as o', 's.os_id', '=', 'o.id')
->where('s.active', '=', 0)
->get(['s.*', 'pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'p.name as provider_name', 'l.name as location', 'o.name as os_name']);
});
return view('servers.index', compact(['servers', 'non_active_servers']));
} }
public function showServersPublic() public function showServersPublic()
@ -37,18 +54,25 @@ class ServerController extends Controller
Session::put('timer_version_footer', $settings[0]->show_versions_footer); Session::put('timer_version_footer', $settings[0]->show_versions_footer);
Session::put('show_servers_public', $settings[0]->show_servers_public); Session::put('show_servers_public', $settings[0]->show_servers_public);
Session::put('show_server_value_ip', $settings[0]->show_server_value_ip);
Session::put('show_server_value_hostname', $settings[0]->show_server_value_hostname);
Session::put('show_server_value_price', $settings[0]->show_server_value_price);
Session::put('show_server_value_yabs', $settings[0]->show_server_value_yabs);
Session::put('show_server_value_provider', $settings[0]->show_server_value_provider);
Session::put('show_server_value_location', $settings[0]->show_server_value_location);
Session::save(); Session::save();
// dd(Session::all());
if (Session::has('show_servers_public') && Session::get('show_servers_public') === 1) { if ((Session::get('show_servers_public') === 1)) {
$servers = DB::table('servers as s') $servers = DB::table('servers as s')
->Join('pricings as pr', 's.id', '=', 'pr.service_id') ->Join('pricings as pr', 's.id', '=', 'pr.service_id')
->Join('providers as p', 's.provider_id', '=', 'p.id') ->Join('providers as p', 's.provider_id', '=', 'p.id')
->Join('locations as l', 's.location_id', '=', 'l.id') ->Join('locations as l', 's.location_id', '=', 'l.id')
->Join('os as o', 's.os_id', '=', 'o.id') ->Join('os as o', 's.os_id', '=', 'o.id')
->LeftJoin('ips as i', 's.id', '=', 'i.service_id')
->LeftJoin('yabs as y', 's.id', '=', 'y.server_id') ->LeftJoin('yabs as y', 's.id', '=', 'y.server_id')
->LeftJoin('disk_speed as ds', 'y.id', '=', 'ds.id') ->LeftJoin('disk_speed as ds', 'y.id', '=', 'ds.id')
->get(['s.*', 'pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'pr.service_id', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'y.*', 'y.id as yabs_id', 'ds.*']); ->where('s.show_public', '=', 1)
->get(['pr.currency', 'pr.price', 'pr.term', 'pr.as_usd', 'pr.next_due_date', 'pr.service_id', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'y.*', 'y.id as yabs_id', 'ds.*', 's.*', 'i.address as ip', 'i.is_ipv4']);
return view('servers.public-index', compact('servers')); return view('servers.public-index', compact('servers'));
} }
@ -68,8 +92,8 @@ class ServerController extends Controller
$request->validate([ $request->validate([
'hostname' => 'required|min:5', 'hostname' => 'required|min:5',
'ipv4' => 'nullable|ipv4', 'ip1' => 'nullable|ip',
'ipv6' => 'nullable|ipv6', 'ip2' => 'nullable|ip',
'service_type' => 'numeric', 'service_type' => 'numeric',
'server_type' => 'numeric', 'server_type' => 'numeric',
'ram' => 'numeric', 'ram' => 'numeric',
@ -88,8 +112,6 @@ class ServerController extends Controller
Server::create([ Server::create([
'id' => $server_id, 'id' => $server_id,
'hostname' => $request->hostname, 'hostname' => $request->hostname,
'ipv4' => $request->ipv4,
'ipv6' => $request->ipv6,
'server_type' => $request->server_type, 'server_type' => $request->server_type,
'os_id' => $request->os_id, 'os_id' => $request->os_id,
'ssh' => $request->ssh_port, 'ssh' => $request->ssh_port,
@ -106,9 +128,34 @@ class ServerController extends Controller
'ns2' => $request->ns2, 'ns2' => $request->ns2,
'bandwidth' => $request->bandwidth, 'bandwidth' => $request->bandwidth,
'cpu' => $request->cpu, 'cpu' => $request->cpu,
'was_promo' => $request->was_promo 'was_promo' => $request->was_promo,
'show_public' => (isset($request->show_public)) ? 1 : 0
]); ]);
if (!is_null($request->ip1)) {
IPs::create(
[
'id' => Str::random(8),
'service_id' => $server_id,
'address' => $request->ip1,
'is_ipv4' => (filter_var($request->ip1, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1,
'active' => 1
]
);
}
if (!is_null($request->ip2)) {
IPs::create(
[
'id' => Str::random(8),
'service_id' => $server_id,
'address' => $request->ip2,
'is_ipv4' => (filter_var($request->ip2, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1,
'active' => 1
]
);
}
$pricing = new Pricing(); $pricing = new Pricing();
$as_usd = $pricing->convertToUSD($request->price, $request->currency); $as_usd = $pricing->convertToUSD($request->price, $request->currency);
@ -128,10 +175,16 @@ class ServerController extends Controller
for ($i = 1; $i <= 4; $i++) { for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) { if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $server_id]); DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $server_id]);
} }
} }
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
Cache::forget('all_active_servers');//all servers cache
Cache::forget('non_active_servers');//all servers cache
return redirect()->route('servers.index') return redirect()->route('servers.index')
->with('success', 'Server Created Successfully.'); ->with('success', 'Server Created Successfully.');
} }
@ -143,15 +196,25 @@ class ServerController extends Controller
->join('providers as p', 's.provider_id', '=', 'p.id') ->join('providers as p', 's.provider_id', '=', 'p.id')
->join('locations as l', 's.location_id', '=', 'l.id') ->join('locations as l', 's.location_id', '=', 'l.id')
->join('os as o', 's.os_id', '=', 'o.id') ->join('os as o', 's.os_id', '=', 'o.id')
->Leftjoin('yabs as y', 's.id', '=', 'y.server_id')
->Leftjoin('disk_speed as ds', 'y.id', '=', 'ds.id')
->where('s.id', '=', $server->id) ->where('s.id', '=', $server->id)
->get(['s.*', 'p.name as provider_name', 'l.name as location', 'o.name as os_name', 'pr.*']); ->get(['s.*', 'p.name as provider', 'l.name as location', 'o.name as os_name', 'pr.*', 'y.*', 'ds.*']);
$network_speeds = json_decode(DB::table('network_speed')
->where('network_speed.server_id', '=', $server->id)
->get(), true);
$ip_addresses = json_decode(DB::table('ips as i')
->where('i.service_id', '=', $server->id)
->get(), true);
$labels = DB::table('labels_assigned as l') $labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id') ->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $server->id) ->where('l.service_id', '=', $server->id)
->get(['labels.label']); ->get(['labels.label']);
return view('servers.show', compact(['server', 'server_extras', 'labels'])); return view('servers.show', compact(['server', 'server_extras', 'network_speeds', 'labels', 'ip_addresses']));
} }
public function edit(Server $server) public function edit(Server $server)
@ -164,12 +227,17 @@ class ServerController extends Controller
->get(['labels.id', 'labels.label']); ->get(['labels.id', 'labels.label']);
$os = DB::table('os')->get(['*']); $os = DB::table('os')->get(['*']);
$ip_addresses = json_decode(DB::table('ips as i')
->where('i.service_id', '=', $server->id)
->get(), true);
$server = DB::table('servers as s') $server = DB::table('servers as s')
->join('pricings as p', 's.id', '=', 'p.service_id') ->join('pricings as p', 's.id', '=', 'p.service_id')
->where('s.id', '=', $server->id) ->where('s.id', '=', $server->id)
->get(['s.*', 'p.*']); ->get(['s.*', 'p.*']);
return view('servers.edit', compact(['server', 'locations', 'providers', 'os', 'labels'])); return view('servers.edit', compact(['server', 'locations', 'providers', 'os', 'labels', 'ip_addresses']));
} }
public function update(Request $request, Server $server) public function update(Request $request, Server $server)
@ -183,7 +251,8 @@ class ServerController extends Controller
'location_id' => 'numeric', 'location_id' => 'numeric',
'price' => 'numeric', 'price' => 'numeric',
'cpu' => 'numeric', 'cpu' => 'numeric',
'was_promo' => 'numeric' 'was_promo' => 'numeric',
'next_due_date' => 'date'
]); ]);
@ -191,8 +260,6 @@ class ServerController extends Controller
->where('id', $request->server_id) ->where('id', $request->server_id)
->update([ ->update([
'hostname' => $request->hostname, 'hostname' => $request->hostname,
'ipv4' => $request->ipv4,
'ipv6' => $request->ipv6,
'server_type' => $request->server_type, 'server_type' => $request->server_type,
'os_id' => $request->os_id, 'os_id' => $request->os_id,
'ssh' => $request->ssh, 'ssh' => $request->ssh,
@ -210,7 +277,8 @@ class ServerController extends Controller
'bandwidth' => $request->bandwidth, 'bandwidth' => $request->bandwidth,
'cpu' => $request->cpu, 'cpu' => $request->cpu,
'was_promo' => $request->was_promo, 'was_promo' => $request->was_promo,
'active' => (isset($request->is_active)) ? 1 : 0 'active' => (isset($request->is_active)) ? 1 : 0,
'show_public' => (isset($request->show_public)) ? 1 : 0
]); ]);
$pricing = new Pricing(); $pricing = new Pricing();
@ -240,6 +308,26 @@ class ServerController extends Controller
} }
} }
$deleted = DB::table('ips')->where('service_id', '=', $server->id)->delete();
for ($i = 1; $i <= 8; $i++) {//Max of 8 ips
$obj = 'ip' . $i;
if (isset($request->$obj) && !is_null($request->$obj)) {
DB::insert('INSERT IGNORE INTO ips (id, address, service_id, is_ipv4) values (?, ?, ?, ?)', [
Str::random(8),
$request->$obj,
$request->server_id,
(filter_var($request->$obj, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1
]);
}
}
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
Cache::forget('all_active_servers');//all servers cache
Cache::forget('non_active_servers');//all servers cache
return redirect()->route('servers.index') return redirect()->route('servers.index')
->with('success', 'Server Updated Successfully.'); ->with('success', 'Server Updated Successfully.');
} }
@ -255,6 +343,14 @@ class ServerController extends Controller
Labels::deleteLabelsAssignedTo($server->id); Labels::deleteLabelsAssignedTo($server->id);
IPs::deleteIPsAssignedTo($server->id);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
Cache::forget('all_active_servers');//all servers cache
Cache::forget('non_active_servers');//all servers cache
return redirect()->route('servers.index') return redirect()->route('servers.index')
->with('success', 'Server was deleted Successfully.'); ->with('success', 'Server was deleted Successfully.');
} }

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Settings; use App\Models\Settings;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
@ -27,7 +28,9 @@ class SettingsController extends Controller
'show_server_value_provider' => 'required|boolean', 'show_server_value_provider' => 'required|boolean',
'show_server_value_location' => 'required|boolean', 'show_server_value_location' => 'required|boolean',
'show_server_value_price' => 'required|boolean', 'show_server_value_price' => 'required|boolean',
'show_server_value_yabs' => 'required|boolean' 'show_server_value_yabs' => 'required|boolean',
'default_currency' => 'required',
'default_server_os' => 'required'
]); ]);
DB::table('settings') DB::table('settings')
@ -40,15 +43,25 @@ class SettingsController extends Controller
'show_server_value_provider' => $request->show_server_value_provider, 'show_server_value_provider' => $request->show_server_value_provider,
'show_server_value_location' => $request->show_server_value_location, 'show_server_value_location' => $request->show_server_value_location,
'show_server_value_price' => $request->show_server_value_price, 'show_server_value_price' => $request->show_server_value_price,
'show_server_value_yabs' => $request->show_server_value_yabs 'show_server_value_yabs' => $request->show_server_value_yabs,
'default_currency' => $request->default_currency,
'default_server_os' => $request->default_server_os
]); ]);
Session::put('timer_version_footer', $request->show_versions_footer); Session::put('timer_version_footer', $request->show_versions_footer);
Session::put('show_servers_public', $request->show_servers_public); Session::put('show_servers_public', $request->show_servers_public);
Session::put('show_server_value_ip', $request->show_server_value_ip); Session::put('show_server_value_ip', $request->show_server_value_ip);
Session::put('show_server_value_hostname', $request->show_server_value_hostname); Session::put('show_server_value_hostname', $request->show_server_value_hostname);
Session::put('show_server_value_price', $request->show_server_value_price);
Session::put('show_server_value_yabs', $request->show_server_value_yabs);
Session::put('show_server_value_provider', $request->show_server_value_provider);
Session::put('show_server_value_location', $request->show_server_value_location);
Session::put('default_currency', $request->default_currency);
Session::put('default_server_os', $request->default_server_os);
Session::save(); Session::save();
Cache::forget('settings');//Main page settings cache
return redirect()->route('settings.index') return redirect()->route('settings.index')
->with('success', 'Settings Updated Successfully.'); ->with('success', 'Settings Updated Successfully.');
} }

View File

@ -2,12 +2,14 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Models\IPs;
use App\Models\Labels; use App\Models\Labels;
use App\Models\Locations; use App\Models\Locations;
use App\Models\Pricing; use App\Models\Pricing;
use App\Models\Providers; use App\Models\Providers;
use App\Models\Shared; use App\Models\Shared;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -37,8 +39,6 @@ class SharedController extends Controller
$request->validate([ $request->validate([
'domain' => 'required|min:4', 'domain' => 'required|min:4',
'shared_type' => 'required', 'shared_type' => 'required',
'dedicated_ip' => 'present',
'has_dedicated_ip' => 'numeric',
'server_type' => 'numeric', 'server_type' => 'numeric',
'ram' => 'numeric', 'ram' => 'numeric',
'disk' => 'numeric', 'disk' => 'numeric',
@ -64,8 +64,6 @@ class SharedController extends Controller
'id' => $shared_id, 'id' => $shared_id,
'main_domain' => $request->domain, 'main_domain' => $request->domain,
'shared_type' => $request->shared_type, 'shared_type' => $request->shared_type,
'has_dedicated_ip' => $request->has_dedicated_ip,
'ip' => $request->dedicated_ip,
'provider_id' => $request->provider_id, 'provider_id' => $request->provider_id,
'location_id' => $request->location_id, 'location_id' => $request->location_id,
'disk' => $request->disk, 'disk' => $request->disk,
@ -96,6 +94,30 @@ class SharedController extends Controller
'next_due_date' => $request->next_due_date, 'next_due_date' => $request->next_due_date,
]); ]);
$labels_array = [$request->label1, $request->label2, $request->label3, $request->label4];
for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $shared_id]);
}
}
if (!is_null($request->dedicated_ip)) {
IPs::create(
[
'id' => Str::random(8),
'service_id' => $shared_id,
'address' => $request->dedicated_ip,
'is_ipv4' => (filter_var($request->dedicated_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1,
'active' => 1
]
);
}
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('shared.index') return redirect()->route('shared.index')
->with('success', 'Shared hosting created Successfully.'); ->with('success', 'Shared hosting created Successfully.');
} }
@ -114,21 +136,32 @@ class SharedController extends Controller
->where('l.service_id', '=', $shared->id) ->where('l.service_id', '=', $shared->id)
->get(['labels.label']); ->get(['labels.label']);
return view('shared.show', compact(['shared', 'shared_extras', 'labels'])); $ip_address = DB::table('ips as i')
->where('i.service_id', '=', $shared->id)
->get();
return view('shared.show', compact(['shared', 'shared_extras', 'labels', 'ip_address']));
} }
public function edit(Shared $shared) public function edit(Shared $shared)
{ {
$locations = DB::table('locations')->get(['*']); $locations = DB::table('locations')->get(['*']);
$providers = json_decode(DB::table('providers')->get(['*']), true); $providers = json_decode(DB::table('providers')->get(['*']), true);
$labels = DB::table('labels_assigned as l')
->join('labels', 'l.label_id', '=', 'labels.id')
->where('l.service_id', '=', $shared->id)
->get(['labels.id', 'labels.label']);
$ip_address = json_decode(DB::table('ips as i')
->where('i.service_id', '=', $shared->id)
->get(), true);
$shared = DB::table('shared_hosting as s') $shared = DB::table('shared_hosting as s')
->join('pricings as p', 's.id', '=', 'p.service_id') ->join('pricings as p', 's.id', '=', 'p.service_id')
->where('s.id', '=', $shared->id) ->where('s.id', '=', $shared->id)
->get(['s.*', 'p.*']); ->get(['s.*', 'p.*']);
return view('shared.edit', compact(['shared', 'locations', 'providers', 'labels', 'ip_address']));
return view('shared.edit', compact(['shared', 'locations', 'providers']));
} }
public function update(Request $request, Shared $shared) public function update(Request $request, Shared $shared)
@ -138,7 +171,6 @@ class SharedController extends Controller
'domain' => 'required|min:4', 'domain' => 'required|min:4',
'shared_type' => 'required', 'shared_type' => 'required',
'dedicated_ip' => 'present', 'dedicated_ip' => 'present',
'has_dedicated_ip' => 'numeric',
'server_type' => 'numeric', 'server_type' => 'numeric',
'disk' => 'numeric', 'disk' => 'numeric',
'os_id' => 'numeric', 'os_id' => 'numeric',
@ -161,8 +193,6 @@ class SharedController extends Controller
->update([ ->update([
'main_domain' => $request->domain, 'main_domain' => $request->domain,
'shared_type' => $request->shared_type, 'shared_type' => $request->shared_type,
'has_dedicated_ip' => $request->has_dedicated_ip,
'ip' => $request->dedicated_ip,
'provider_id' => $request->provider_id, 'provider_id' => $request->provider_id,
'location_id' => $request->location_id, 'location_id' => $request->location_id,
'disk' => $request->disk, 'disk' => $request->disk,
@ -193,6 +223,31 @@ class SharedController extends Controller
'next_due_date' => $request->next_due_date, 'next_due_date' => $request->next_due_date,
]); ]);
$deleted = DB::table('labels_assigned')->where('service_id', '=', $request->id)->delete();
$labels_array = [$request->label1, $request->label2, $request->label3, $request->label4];
for ($i = 1; $i <= 4; $i++) {
if (!is_null($labels_array[($i - 1)])) {
DB::insert('INSERT IGNORE INTO labels_assigned ( label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $request->id]);
}
}
$delete_ip = DB::table('ips')->where('service_id', '=', $request->id)->delete();
if (isset($request->dedicated_ip)) {
DB::insert('INSERT IGNORE INTO ips (id, address, service_id, is_ipv4) values (?, ?, ?, ?)', [
Str::random(8),
$request->dedicated_ip,
$request->id,
(filter_var($request->dedicated_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) ? 0 : 1
]);
}
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('shared.index') return redirect()->route('shared.index')
->with('success', 'Shared hosting updated Successfully.'); ->with('success', 'Shared hosting updated Successfully.');
} }
@ -209,6 +264,12 @@ class SharedController extends Controller
Labels::deleteLabelsAssignedTo($shared->id); Labels::deleteLabelsAssignedTo($shared->id);
IPs::deleteIPsAssignedTo($shared->id);
Cache::forget('services_count');//Main page services_count cache
Cache::forget('due_soon');//Main page due_soon cache
Cache::forget('recently_added');//Main page recently_added cache
return redirect()->route('shared.index') return redirect()->route('shared.index')
->with('success', 'Shared hosting was deleted Successfully.'); ->with('success', 'Shared hosting was deleted Successfully.');
} }

View File

@ -8,6 +8,7 @@ use App\Process;
use App\Models\DiskSpeed; use App\Models\DiskSpeed;
use App\Models\NetworkSpeed; use App\Models\NetworkSpeed;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
@ -52,7 +53,7 @@ class YabsController extends Controller
'output_date' => $yabs['output_date'], 'output_date' => $yabs['output_date'],
'cpu_cores' => $yabs['cpu_cores'], 'cpu_cores' => $yabs['cpu_cores'],
'cpu_freq' => $yabs['cpu_freq'], 'cpu_freq' => $yabs['cpu_freq'],
'cpu' => $yabs['cpu'], 'cpu_model' => $yabs['cpu'],
'ram' => $yabs['ram'], 'ram' => $yabs['ram'],
'ram_type' => $yabs['ram_type'], 'ram_type' => $yabs['ram_type'],
'ram_mb' => $yabs['ram_mb'], 'ram_mb' => $yabs['ram_mb'],
@ -108,6 +109,9 @@ class YabsController extends Controller
'has_yabs' => 1 'has_yabs' => 1
]); ]);
Cache::forget('all_active_servers');//all servers cache
Cache::forget('non_active_servers');//all servers cache
return redirect()->route('yabs.index') return redirect()->route('yabs.index')
->with('success', 'Success inserting YABs'); ->with('success', 'Success inserting YABs');
} }
@ -130,9 +134,18 @@ class YabsController extends Controller
public function destroy(Yabs $yab) public function destroy(Yabs $yab)
{ {
$id = $yab->id; $id = $yab->id;
$items = Yabs::find($id); $yabs = Yabs::find($id);
$yabs->delete();
$items->delete(); $disk = DiskSpeed::find($id);
$disk->delete();
$network = NetworkSpeed::find($id);
$network->delete();
$update_server = DB::table('servers')
->where('id', $yab->server_id)
->update(['has_yabs' => 0]);
return redirect()->route('yabs.index') return redirect()->route('yabs.index')
->with('success', 'YABs was deleted Successfully.'); ->with('success', 'YABs was deleted Successfully.');

View File

@ -9,5 +9,7 @@ class OS extends Model
{ {
use HasFactory; use HasFactory;
protected $fillable = ['name'];
protected $table = 'os'; protected $table = 'os';
} }

View File

@ -11,7 +11,7 @@ class Server extends Model
public $incrementing = false; public $incrementing = false;
protected $fillable = ['id', 'hostname', 'ipv4', 'ipv6', 'server_type', 'os_id', 'location_id', 'provider_id', 'ram', 'disk', 'ram_type', 'disk_type', 'ns1', 'ns2', 'label', 'bandwidth', 'ram_as_mb', 'disk_as_gb', 'has_yabs', 'was_promo', 'owned_since', 'ssh', 'active']; protected $fillable = ['id', 'hostname', 'ipv4', 'ipv6', 'server_type', 'os_id', 'location_id', 'provider_id', 'ram', 'disk', 'ram_type', 'disk_type', 'ns1', 'ns2', 'label', 'bandwidth', 'ram_as_mb', 'disk_as_gb', 'has_yabs', 'was_promo', 'owned_since', 'ssh', 'active','show_public'];
/** /**
* @var mixed * @var mixed
*/ */

View File

@ -10,4 +10,6 @@ class Settings extends Model
use HasFactory; use HasFactory;
protected $table = 'settings'; protected $table = 'settings';
protected $fillable = ['id', 'show_versions_footer', 'show_servers_public'];
} }

View File

@ -13,5 +13,5 @@ class Yabs extends Model
protected $table = 'yabs'; protected $table = 'yabs';
protected $fillable = ['id', 'server_id', 'has_ipv6', 'aes', 'vm', 'output_date', 'cpu_cores', 'cpu_freq', 'cpu', 'ram', 'ram_type', 'ram_mb', 'disk', 'disk_type', 'disk_gb', 'gb5_single', 'gb5_multi', 'gb5_id', '4k', '4k_type', '4k_as_mbps', '64k', '64k_type', '64k_as_mbps', '512k', '512k_type', '512k_as_mbps', '1m', '1m_type', '1m_as_mbps', 'location', 'send', 'send_type', 'send_as_mbps', 'receive', 'receive_type', 'receive_as_mbps']; protected $fillable = ['id', 'server_id', 'has_ipv6', 'aes', 'vm', 'output_date', 'cpu_cores', 'cpu_freq', 'cpu_model', 'ram', 'ram_type', 'ram_mb', 'disk', 'disk_type', 'disk_gb', 'gb5_single', 'gb5_multi', 'gb5_id', '4k', '4k_type', '4k_as_mbps', '64k', '64k_type', '64k_as_mbps', '512k', '512k_type', '512k_as_mbps', '1m', '1m_type', '1m_as_mbps', 'location', 'send', 'send_type', 'send_as_mbps', 'receive', 'receive_type', 'receive_as_mbps'];
} }

View File

@ -182,8 +182,8 @@ class Process
return array('error_id' => 10, 'error_message' => 'Issue writing/reading txt file'); return array('error_id' => 10, 'error_message' => 'Issue writing/reading txt file');
} }
if (count($array) < 47) { if (count($array) < 46) {
return array('error_id' => 9, 'error_message' => 'Less than 47 lines'); return array('error_id' => 9, 'error_message' => 'Less than 46 lines');
} }
if (str_contains($array[0], "# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #\r")) { if (str_contains($array[0], "# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #\r")) {
@ -192,7 +192,7 @@ class Process
} }
$version_array = explode(' ', preg_replace('!\s+!', ' ', $this->trimRemoveR($array[2]))); $version_array = explode(' ', preg_replace('!\s+!', ' ', $this->trimRemoveR($array[2])));
if ($version_array[1] === 'v2021-12-28') {//YABs version if ($version_array[1] === 'v2021-12-28' || $version_array[1] === 'v2022-02-18') {//YABs version
$cpu = $this->trimRemoveR(str_replace(':', '', strstr($array[10], ': '))); $cpu = $this->trimRemoveR(str_replace(':', '', strstr($array[10], ': ')));
$cpu_spec = explode(' ', strstr($array[11], ': '));//: 2 @ 3792.872 MHz $cpu_spec = explode(' ', strstr($array[11], ': '));//: 2 @ 3792.872 MHz
$cpu_cores = $cpu_spec[1]; $cpu_cores = $cpu_spec[1];

View File

@ -3,6 +3,7 @@
namespace App\View\Components; namespace App\View\Components;
use App\Models\Labels; use App\Models\Labels;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\Component; use Illuminate\View\Component;
class LabelsSelect extends Component class LabelsSelect extends Component
@ -14,8 +15,11 @@ class LabelsSelect extends Component
*/ */
public function render() public function render()
{ {
$all_labels = Cache::rememberForever('all_labels', function () {
return Labels::all();
});
return view('components.labels-select', [ return view('components.labels-select', [
'labels' => Labels::all() 'labels' => $all_labels
]); ]);
} }
} }

View File

@ -3,6 +3,7 @@
namespace App\View\Components; namespace App\View\Components;
use App\Models\Locations; use App\Models\Locations;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\Component; use Illuminate\View\Component;
class LocationsSelect extends Component class LocationsSelect extends Component
@ -14,8 +15,11 @@ class LocationsSelect extends Component
*/ */
public function render() public function render()
{ {
$all_locations = Cache::rememberForever('all_locations', function () {
return Locations::all();
});
return view('components.locations-select', [ return view('components.locations-select', [
'locations' => Locations::all() 'locations' => $all_locations
]); ]);
} }
} }

View File

@ -3,6 +3,7 @@
namespace App\View\Components; namespace App\View\Components;
use App\Models\Providers; use App\Models\Providers;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\Component; use Illuminate\View\Component;
class ProvidersSelect extends Component class ProvidersSelect extends Component
@ -15,8 +16,11 @@ class ProvidersSelect extends Component
*/ */
public function render() public function render()
{ {
$all_providers = Cache::rememberForever('all_providers', function () {
return Providers::all();
});
return view('components.providers-select', [ return view('components.providers-select', [
'providers' => Providers::all() 'providers' => $all_providers
]); ]);
} }
} }

View File

@ -6,11 +6,6 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class DNSFactory extends Factory class DNSFactory extends Factory
{ {
/**
* Define the model's default state.
*
* @return array
*/
public function definition() public function definition()
{ {
return [ return [

View File

@ -6,11 +6,6 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class DomainsFactory extends Factory class DomainsFactory extends Factory
{ {
/**
* Define the model's default state.
*
* @return array
*/
public function definition() public function definition()
{ {
return [ return [

View File

@ -7,18 +7,8 @@ use Illuminate\Database\Eloquent\Factories\Factory;
class ServerFactory extends Factory class ServerFactory extends Factory
{ {
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Server::class; protected $model = Server::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition() public function definition()
{ {

View File

@ -8,18 +8,8 @@ use Illuminate\Support\Str;
class UserFactory extends Factory class UserFactory extends Factory
{ {
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = User::class; protected $model = User::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition() public function definition()
{ {
return [ return [

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCrudTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('crud', function (Blueprint $table) {
$defaultjob = 'unemployed';
$table->id();
$table->string('name')->nullable($value=false);
$table->string('city')->nullable($value=false);
$table->string('phone')->nullable($value=true);
$table->string('job')->nullable($value=true)->default($defaultjob);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('crud');
}
}

View File

@ -14,13 +14,12 @@ class CreateServersTable extends Migration
public function up() public function up()
{ {
Schema::create('servers', function (Blueprint $table) { Schema::create('servers', function (Blueprint $table) {
$table->char('id', 8)->unique()->default(null); $table->char('id', 8)->primary()->default(null);
$table->tinyInteger('active')->default(1); $table->tinyInteger('active')->default(1);
$table->tinyInteger('show_public')->default(0);
$table->string('hostname'); $table->string('hostname');
$table->string('ns1')->nullable()->default(null); $table->string('ns1')->nullable()->default(null);
$table->string('ns2')->nullable()->default(null); $table->string('ns2')->nullable()->default(null);
$table->string('ipv4')->nullable()->default(null);
$table->string('ipv6')->nullable()->default(null);
$table->tinyInteger('server_type')->default(1); $table->tinyInteger('server_type')->default(1);
$table->integer('os_id')->default(0); $table->integer('os_id')->default(0);
$table->integer('provider_id')->default(9999); $table->integer('provider_id')->default(9999);

View File

@ -16,6 +16,7 @@ class CreateOsTable extends Migration
Schema::create('os', function (Blueprint $table) { Schema::create('os', function (Blueprint $table) {
$table->id()->autoIncrement(); $table->id()->autoIncrement();
$table->string('name')->unique(); $table->string('name')->unique();
$table->timestamps();
}); });
} }

View File

@ -14,7 +14,7 @@ class CreateDomainsTable extends Migration
public function up() public function up()
{ {
Schema::create('domains', function (Blueprint $table) { Schema::create('domains', function (Blueprint $table) {
$table->char('id', 8)->unique()->default(null); $table->char('id', 8)->primary()->default(null);
$table->string('domain'); $table->string('domain');
$table->tinyInteger('active')->default(1); $table->tinyInteger('active')->default(1);
$table->string('extension'); $table->string('extension');

View File

@ -15,7 +15,7 @@ class CreateLabelsTable extends Migration
{ {
Schema::create('labels', function (Blueprint $table) { Schema::create('labels', function (Blueprint $table) {
$table->char('id', 8)->primary()->default(null); $table->char('id', 8)->primary()->default(null);
$table->string('label'); $table->string('label')->unique();
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@ -14,11 +14,9 @@ class CreateSharedsTable extends Migration
public function up() public function up()
{ {
Schema::create('shared_hosting', function (Blueprint $table) { Schema::create('shared_hosting', function (Blueprint $table) {
$table->char('id', 8)->unique(); $table->char('id', 8)->primary();
$table->tinyInteger('active')->default(1); $table->tinyInteger('active')->default(1);
$table->string('main_domain'); $table->string('main_domain');
$table->tinyInteger('has_dedicated_ip')->default(0);
$table->string('ip')->nullable()->default(null);
$table->string('shared_type')->nullable(); $table->string('shared_type')->nullable();
$table->integer('provider_id')->default(9999); $table->integer('provider_id')->default(9999);
$table->integer('location_id')->default(9999); $table->integer('location_id')->default(9999);

View File

@ -14,11 +14,9 @@ class CreateResellersTable extends Migration
public function up() public function up()
{ {
Schema::create('reseller_hosting', function (Blueprint $table) { Schema::create('reseller_hosting', function (Blueprint $table) {
$table->char('id', 8)->unique(); $table->char('id', 8)->primary();
$table->tinyInteger('active')->default(1); $table->tinyInteger('active')->default(1);
$table->string('main_domain'); $table->string('main_domain');
$table->tinyInteger('has_dedicated_ip')->default(0);
$table->string('ip')->nullable()->default(null);
$table->integer('accounts')->default(1); $table->integer('accounts')->default(1);
$table->string('reseller_type')->nullable(); $table->string('reseller_type')->nullable();
$table->integer('provider_id')->default(9999); $table->integer('provider_id')->default(9999);

View File

@ -13,7 +13,7 @@ class CreateYabsTable extends Migration
public function up() public function up()
{ {
Schema::create('yabs', function (Blueprint $table) { Schema::create('yabs', function (Blueprint $table) {
$table->char('id', 8)->unique(); $table->char('id', 8)->primary();
$table->char('server_id', 8); $table->char('server_id', 8);
$table->boolean('has_ipv6')->default(false); $table->boolean('has_ipv6')->default(false);
$table->boolean('aes')->default(false); $table->boolean('aes')->default(false);
@ -21,7 +21,7 @@ class CreateYabsTable extends Migration
$table->dateTime('output_date'); $table->dateTime('output_date');
$table->tinyInteger('cpu_cores'); $table->tinyInteger('cpu_cores');
$table->float('cpu_freq'); $table->float('cpu_freq');
$table->string('cpu'); $table->string('cpu_model');
$table->float('ram'); $table->float('ram');
$table->char('ram_type', 2); $table->char('ram_type', 2);
$table->float('ram_mb'); $table->float('ram_mb');
@ -32,6 +32,7 @@ class CreateYabsTable extends Migration
$table->integer('gb5_multi'); $table->integer('gb5_multi');
$table->integer('gb5_id'); $table->integer('gb5_id');
$table->timestamps(); $table->timestamps();
$table->unique(['id','server_id'], 'uni');
}); });
} }

View File

@ -12,7 +12,7 @@ class CreateDiskSpeedTable extends Migration
public function up() public function up()
{ {
Schema::create('disk_speed', function (Blueprint $table) { Schema::create('disk_speed', function (Blueprint $table) {
$table->char('id', 8)->unique(); $table->char('id', 8)->primary();
$table->char('server_id',8); $table->char('server_id',8);
$table->float('d_4k'); $table->float('d_4k');
$table->char('d_4k_type',4); $table->char('d_4k_type',4);

View File

@ -22,6 +22,7 @@ class CreateNetworkSpeedTable extends Migration
$table->char('receive_type', 4); $table->char('receive_type', 4);
$table->float('receive_as_mbps'); $table->float('receive_as_mbps');
$table->timestamps(); $table->timestamps();
$table->unique(['id','server_id', 'location'], 'uni');
}); });
} }

View File

@ -14,8 +14,9 @@ class CreateLabelsAssignedTable extends Migration
public function up() public function up()
{ {
Schema::create('labels_assigned', function (Blueprint $table) { Schema::create('labels_assigned', function (Blueprint $table) {
$table->char('label_id', 8)->unique(); $table->char('label_id', 8);
$table->char('service_id', 8); $table->char('service_id', 8);
$table->unique(['label_id','service_id'], 'uni');
}); });
} }

View File

@ -14,7 +14,7 @@ class CreateSettingsTable extends Migration
public function up() public function up()
{ {
Schema::create('settings', function (Blueprint $table) { Schema::create('settings', function (Blueprint $table) {
$table->integer('id')->default(1)->unique(); $table->integer('id')->default(1)->primary();
$table->boolean('show_versions_footer')->default(true); $table->boolean('show_versions_footer')->default(true);
$table->boolean('show_servers_public')->default(false); $table->boolean('show_servers_public')->default(false);
$table->boolean('show_server_value_ip')->default(false); $table->boolean('show_server_value_ip')->default(false);

View File

@ -14,10 +14,10 @@ class CreateMiscsTable extends Migration
public function up() public function up()
{ {
Schema::create('misc_services', function (Blueprint $table) { Schema::create('misc_services', function (Blueprint $table) {
$table->char('id', 8)->unique(); $table->char('id', 8)->primary();
$table->string('name'); $table->string('name');
$table->tinyInteger('active')->default(1); $table->tinyInteger('active')->default(1);
$table->date('owned_since'); $table->date('owned_since')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
@ -31,4 +31,4 @@ class CreateMiscsTable extends Migration
{ {
Schema::dropIfExists('misc_services'); Schema::dropIfExists('misc_services');
} }
}; }

View File

@ -6,22 +6,16 @@ use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder class DatabaseSeeder extends Seeder
{ {
/**
* Seed the application's database.
*
* @return void
*/
public function run() public function run()
{ {
\App\Models\User::factory(1)->create(); //\App\Models\User::factory(1)->create();//Disable demo first user creation
//\App\Models\Server::factory(10)->create();
//\App\Models\Domains::factory(4)->create();
$this->call(SettingsSeeder::class); $this->call(SettingsSeeder::class);
$this->call(ProvidersSeeder::class); $this->call(ProvidersSeeder::class);
$this->call(LocationsSeeder::class); $this->call(LocationsSeeder::class);
$this->call(OsSeeder::class); $this->call(OsSeeder::class);
$this->call(LabelsSeeder::class); $this->call(LabelsSeeder::class);
$this->call(DomainsSeeder::class); //$this->call(DomainsSeeder::class);
$this->call(ServersSeeder::class); //$this->call(ServersSeeder::class);
//$this->call(SharedSeeder::class);
} }
} }

View File

@ -9,11 +9,6 @@ use Illuminate\Support\Str;
class DomainsSeeder extends Seeder class DomainsSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
$id1 = Str::random(8); $id1 = Str::random(8);
@ -26,7 +21,7 @@ class DomainsSeeder extends Seeder
"extension" => "ai", "extension" => "ai",
"provider_id" => 59, "provider_id" => 59,
"owned_since" => '2013-01-12', "owned_since" => '2013-01-12',
//"next_due_date" => Carbon::now()->addDays(30)->format('Y-m-d') "created_at" => Carbon::now()
], ],
[ [
"id" => $id2, "id" => $id2,
@ -34,7 +29,7 @@ class DomainsSeeder extends Seeder
"extension" => "club", "extension" => "club",
"provider_id" => 59, "provider_id" => 59,
"owned_since" => '2016-04-25', "owned_since" => '2016-04-25',
//"next_due_date" => Carbon::now()->addDays(30)->format('Y-m-d') "created_at" => Carbon::now()
] ]
]; ];

View File

@ -8,11 +8,6 @@ use Illuminate\Support\Str;
class LabelsSeeder extends Seeder class LabelsSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
$os = [ $os = [

View File

@ -7,11 +7,6 @@ use Illuminate\Support\Facades\DB;
class LocationsSeeder extends Seeder class LocationsSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
$locations = array( $locations = array(

View File

@ -2,47 +2,43 @@
namespace Database\Seeders; namespace Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
class OsSeeder extends Seeder class OsSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
$os = [ $os = [
["name" => "None"], ["name" => "None", "created_at" => Carbon::now()],
["name" => "Centos 7"], ["name" => "Centos 7", "created_at" => Carbon::now()],
["name" => "Centos 8"], ["name" => "Centos 8", "created_at" => Carbon::now()],
["name" => "Centos"], ["name" => "Centos", "created_at" => Carbon::now()],
["name" => "Debian 9"], ["name" => "Debian 9", "created_at" => Carbon::now()],
["name" => "Debian 10"], ["name" => "Debian 10", "created_at" => Carbon::now()],
["name" => "Debian"], ["name" => "Debian", "created_at" => Carbon::now()],
["name" => "Fedora 32"], ["name" => "Fedora 32", "created_at" => Carbon::now()],
["name" => "Fedora 33"], ["name" => "Fedora 33", "created_at" => Carbon::now()],
["name" => "Fedora"], ["name" => "Fedora", "created_at" => Carbon::now()],
["name" => "FreeBSD 11.4"], ["name" => "FreeBSD 11.4", "created_at" => Carbon::now()],
["name" => "FreeBSD 12.1"], ["name" => "FreeBSD 12.1", "created_at" => Carbon::now()],
["name" => "FreeBSD"], ["name" => "FreeBSD", "created_at" => Carbon::now()],
["name" => "OpenBSD 6.7"], ["name" => "OpenBSD 6.7", "created_at" => Carbon::now()],
["name" => "OpenBSD 6.8"], ["name" => "OpenBSD 6.8", "created_at" => Carbon::now()],
["name" => "OpenBSD"], ["name" => "OpenBSD", "created_at" => Carbon::now()],
["name" => "Ubuntu 16.04"], ["name" => "Ubuntu 16.04", "created_at" => Carbon::now()],
["name" => "Ubuntu 18.04"], ["name" => "Ubuntu 18.04", "created_at" => Carbon::now()],
["name" => "Ubuntu 20.04"], ["name" => "Ubuntu 20.04", "created_at" => Carbon::now()],
["name" => "Ubuntu 20.10"], ["name" => "Ubuntu 20.10", "created_at" => Carbon::now()],
["name" => "Ubuntu"], ["name" => "Ubuntu", "created_at" => Carbon::now()],
["name" => "Windows Server 2008"], ["name" => "Windows Server 2008", "created_at" => Carbon::now()],
["name" => "Windows Server 2012"], ["name" => "Windows Server 2012", "created_at" => Carbon::now()],
["name" => "Windows Server 2016"], ["name" => "Windows Server 2016", "created_at" => Carbon::now()],
["name" => "Windows Server 2019"], ["name" => "Windows Server 2019", "created_at" => Carbon::now()],
["name" => "Windows 10"], ["name" => "Windows 10", "created_at" => Carbon::now()],
["name" => "Custom"], ["name" => "Custom", "created_at" => Carbon::now()],
["name" => "Other"] ["name" => "Other", "created_at" => Carbon::now()]
]; ];
DB::table('os')->insert($os); DB::table('os')->insert($os);

View File

@ -9,11 +9,6 @@ use Illuminate\Support\Str;
class ProvidersSeeder extends Seeder class ProvidersSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {

View File

@ -9,11 +9,6 @@ use Illuminate\Support\Str;
class ServersSeeder extends Seeder class ServersSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
$id1 = Str::random(8); $id1 = Str::random(8);
@ -25,9 +20,8 @@ class ServersSeeder extends Seeder
"hostname" => "la.node.ai", "hostname" => "la.node.ai",
"os_id" => 20, "os_id" => 20,
"provider_id" => 90, "provider_id" => 90,
"location_id" => 34, "location_id" => 35,
"bandwidth" => 1000, "bandwidth" => 1000,
"ipv4" => '127.0.0.1',
"cpu" => 1, "cpu" => 1,
"ram" => 512, "ram" => 512,
"ram_type" => 'MB', "ram_type" => 'MB',
@ -44,9 +38,8 @@ class ServersSeeder extends Seeder
"hostname" => "sg.node.ai", "hostname" => "sg.node.ai",
"os_id" => 20, "os_id" => 20,
"provider_id" => 90, "provider_id" => 90,
"location_id" => 70, "location_id" => 71,
"bandwidth" => 2000, "bandwidth" => 2000,
"ipv4" => '127.0.0.1',
"cpu" => 1, "cpu" => 1,
"ram" => 2048, "ram" => 2048,
"ram_type" => 'MB', "ram_type" => 'MB',
@ -88,5 +81,26 @@ class ServersSeeder extends Seeder
]; ];
DB::table('pricings')->insert($pricing); DB::table('pricings')->insert($pricing);
$ips = [
[
"id" => Str::random(8),
"service_id" => $id1,
"address" => '127.0.0.1',
"is_ipv4" => 1,
"active" => 1,
"created_at" => Carbon::now()
],
[
"id" => Str::random(8),
"service_id" => $id2,
"address" => '127.0.0.1',
"is_ipv4" => 1,
"active" => 1,
"created_at" => Carbon::now()
],
];
DB::table('ips')->insert($ips);
} }
} }

View File

@ -8,11 +8,6 @@ use Illuminate\Support\Facades\DB;
class SettingsSeeder extends Seeder class SettingsSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
$settings = [ $settings = [

View File

@ -9,27 +9,52 @@ use Illuminate\Support\Str;
class SharedSeeder extends Seeder class SharedSeeder extends Seeder
{ {
/**
* Run the database seeds.
*
* @return void
*/
public function run() public function run()
{ {
/*$shared = [
$id = Str::random(8);
$shared = [
[ [
"id" => Str::random(8), "id" => $id,
"domain" => "node", "active" => 1,
"extension" => "ai", "main_domain" => "node.ai",
"provider_id" => 58, "shared_type" => "Direct Admin",
"price" => 9.99, "bandwidth" => 3000,
"currency" => 'USD', "disk" => 45,
"payment_term" => 4, "disk_type" => 'GB',
"owned_since" => '2013-01-12', "disk_as_gb" => 45,
"next_due_date" => Carbon::now()->addDays(30)->format('Y-m-d') "domains_limit" => 10,
"subdomains_limit" => 10,
"ftp_limit" => 5,
"email_limit" => 5,
"db_limit" => 2,
"provider_id" => 90,
"location_id" => 71,
"owned_since" => Carbon::now()->subDays(220),
"created_at" => Carbon::now(),
"updated_at" => Carbon::now(),
] ]
]; ];
DB::table('shareds')->insert($shared);*/ DB::table('shared_hosting')->insert($shared);
$pricing = [
[
"service_id" => $id,
"active" => 1,
"service_type" => 2,
"currency" => "USD",
"price" => 60.00,
"term" => 4,
"as_usd" => 60.00,
"usd_per_month" => 5.00,
"next_due_date" => Carbon::now()->addDays(12)->format('Y-m-d'),
"created_at" => Carbon::now(),
"updated_at" => Carbon::now(),
]
];
DB::table('pricings')->insert($pricing);
} }
} }

15
node_modules/.bin/acorn generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../acorn/bin/acorn" "$@"
ret=$?
else
node "$basedir/../acorn/bin/acorn" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/acorn.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\acorn\bin\acorn" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/acorn.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../acorn/bin/acorn" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/ansi-html generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../ansi-html-community/bin/ansi-html" "$@"
ret=$?
else
node "$basedir/../ansi-html-community/bin/ansi-html" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/ansi-html.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\ansi-html-community\bin\ansi-html" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/ansi-html.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../ansi-html-community/bin/ansi-html" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../ansi-html-community/bin/ansi-html" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/atob generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../atob/bin/atob.js" "$@"
ret=$?
else
node "$basedir/../atob/bin/atob.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/atob.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\atob\bin\atob.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/atob.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../atob/bin/atob.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../atob/bin/atob.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/autoprefixer generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../autoprefixer/bin/autoprefixer" "$@"
ret=$?
else
node "$basedir/../autoprefixer/bin/autoprefixer" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/autoprefixer.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\autoprefixer\bin\autoprefixer" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/autoprefixer.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/browserslist generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../browserslist/cli.js" "$@"
ret=$?
else
node "$basedir/../browserslist/cli.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/browserslist.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\browserslist\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/browserslist.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../browserslist/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/concat generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../concat/bin/concat" "$@"
ret=$?
else
node "$basedir/../concat/bin/concat" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/concat.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\concat\bin\concat" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/concat.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../concat/bin/concat" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../concat/bin/concat" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/cssesc generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../cssesc/bin/cssesc" "$@"
ret=$?
else
node "$basedir/../cssesc/bin/cssesc" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/cssesc.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\cssesc\bin\cssesc" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/cssesc.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../cssesc/bin/cssesc" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/detective generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../detective/bin/detective.js" "$@"
ret=$?
else
node "$basedir/../detective/bin/detective.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/detective.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\detective\bin\detective.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/detective.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../detective/bin/detective.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../detective/bin/detective.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/envinfo generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../envinfo/dist/cli.js" "$@"
ret=$?
else
node "$basedir/../envinfo/dist/cli.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/envinfo.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\envinfo\dist\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/envinfo.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../envinfo/dist/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../envinfo/dist/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/he generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../he/bin/he" "$@"
ret=$?
else
node "$basedir/../he/bin/he" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/he.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\he\bin\he" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/he.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../he/bin/he" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../he/bin/he" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../html-minifier-terser/cli.js" "$@"
ret=$?
else
node "$basedir/../html-minifier-terser/cli.js" "$@"
ret=$?
fi
exit $ret

View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\html-minifier-terser\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../html-minifier-terser/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../html-minifier-terser/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../import-local/fixtures/cli.js" "$@"
ret=$?
else
node "$basedir/../import-local/fixtures/cli.js" "$@"
ret=$?
fi
exit $ret

View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\import-local\fixtures\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../import-local/fixtures/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/is-docker generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../is-docker/cli.js" "$@"
ret=$?
else
node "$basedir/../is-docker/cli.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/is-docker.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\is-docker\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/is-docker.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../is-docker/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../is-docker/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/jsesc generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
ret=$?
else
node "$basedir/../jsesc/bin/jsesc" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/jsesc.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\jsesc\bin\jsesc" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/jsesc.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../jsesc/bin/jsesc" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/json5 generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../json5/lib/cli.js" "$@"
ret=$?
else
node "$basedir/../json5/lib/cli.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/json5.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\json5\lib\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/json5.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../json5/lib/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/laravel-mix generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../laravel-mix/bin/cli.js" "$@"
ret=$?
else
node "$basedir/../laravel-mix/bin/cli.js" "$@"
ret=$?
fi
exit $ret

17
node_modules/.bin/laravel-mix.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\laravel-mix\bin\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
node_modules/.bin/laravel-mix.ps1 generated vendored
View File

@ -1,18 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../laravel-mix/bin/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../laravel-mix/bin/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
node_modules/.bin/miller-rabin generated vendored
View File

@ -1,15 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../miller-rabin/bin/miller-rabin" "$@"
ret=$?
else
node "$basedir/../miller-rabin/bin/miller-rabin" "$@"
ret=$?
fi
exit $ret

Some files were not shown because too many files have changed in this diff Show More