This commit is contained in:
Dennis
2021-09-27 09:49:42 +02:00
parent 34da2f563d
commit d1c7b9a418
5 changed files with 23 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ class SynchronizeSiteController extends Controller
{
$server = Server::query()->where('ploi_id', $request->input('server_id'))->firstOrFail();
/* @var $site \App\Models\Site */
$site = Site::query()
->updateOrCreate([
'ploi_id' => $request->input('id')
@@ -42,6 +43,23 @@ class SynchronizeSiteController extends Controller
$site->status = $request->input('status');
$site->server_id = $server->id;
$site->save();
$certificates = $this->getPloi()->server($request->input('server_id'))->sites($request->input('id'))->certificates()->get()->getData();
if ($certificates) {
foreach ($certificates as $certificate) {
$site->certificates()->updateOrCreate([
'ploi_id' => $certificate->id,
], [
'status' => $certificate->status,
'ploi_id' => $certificate->id,
'domain' => $certificate->domain,
'type' => $certificate->type,
]);
}
}
return response('ok');
}
public function synchronizeAll(Request $request)

View File

@@ -21,5 +21,7 @@ class Certificate extends Model
'type',
'certificate',
'private',
'ploi_id',
'status'
];
}

View File

@@ -18,6 +18,7 @@ class Site extends Model
const PROJECT_OCTOBERCMS = 'october-cms';
public $fillable = [
'ploi_id',
'domain',
'dns_id'
];

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
<template>
<aside
class="relative w-full h-full max-w-lg p-8 rounded shadow-2xl pointer-events-auto bg-overlay bf-blur-high"
class="relative w-full h-full max-w-lg p-8 rounded shadow-2xl pointer-events-auto bg-overlay bf-blur-high overflow-y-scroll"
v-click-outside="() => $emit('close')"
>
<button