Log caddy request, cache in vuex WS domain changes
This commit is contained in:
parent
b50f579155
commit
ac968403b6
|
@ -21,13 +21,26 @@ class CaddyController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
if (Workspace::whereJsonContains('custom_domains',$domain)->exists()) {
|
||||
\Log::info('Caddy request received',[
|
||||
'domain' => $domain,
|
||||
]);
|
||||
|
||||
if ($workspace = Workspace::whereJsonContains('custom_domains',$domain)->first()) {
|
||||
\Log::info('Caddy request successful',[
|
||||
'domain' => $domain,
|
||||
'workspace' => $workspace->id,
|
||||
]);
|
||||
return $this->success([
|
||||
'success' => true,
|
||||
'message' => 'OK',
|
||||
]);
|
||||
}
|
||||
|
||||
\Log::info('Caddy request failed',[
|
||||
'domain' => $domain,
|
||||
'workspace' => $workspace?->id,
|
||||
]);
|
||||
|
||||
return $this->error([
|
||||
'success' => false,
|
||||
'message' => 'Unauthorized domain',
|
||||
|
|
|
@ -168,7 +168,8 @@ export default {
|
|||
custom_domains: this.customDomains.split('\n')
|
||||
.map(domain => domain.trim())
|
||||
.filter(domain => domain && domain.length > 0)
|
||||
}).then(() => {
|
||||
}).then((response) => {
|
||||
this.$store.commit('open/workspaces/addOrUpdate', response.data)
|
||||
this.alertSuccess('Custom domains saved.')
|
||||
}).catch((error) => {
|
||||
this.alertError('Failed to update custom domains: ' + error.response.data.message)
|
||||
|
|
Loading…
Reference in New Issue