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([
|
return $this->success([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => 'OK',
|
'message' => 'OK',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\Log::info('Caddy request failed',[
|
||||||
|
'domain' => $domain,
|
||||||
|
'workspace' => $workspace?->id,
|
||||||
|
]);
|
||||||
|
|
||||||
return $this->error([
|
return $this->error([
|
||||||
'success' => false,
|
'success' => false,
|
||||||
'message' => 'Unauthorized domain',
|
'message' => 'Unauthorized domain',
|
||||||
|
|
|
@ -168,7 +168,8 @@ export default {
|
||||||
custom_domains: this.customDomains.split('\n')
|
custom_domains: this.customDomains.split('\n')
|
||||||
.map(domain => domain.trim())
|
.map(domain => domain.trim())
|
||||||
.filter(domain => domain && domain.length > 0)
|
.filter(domain => domain && domain.length > 0)
|
||||||
}).then(() => {
|
}).then((response) => {
|
||||||
|
this.$store.commit('open/workspaces/addOrUpdate', response.data)
|
||||||
this.alertSuccess('Custom domains saved.')
|
this.alertSuccess('Custom domains saved.')
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.alertError('Failed to update custom domains: ' + error.response.data.message)
|
this.alertError('Failed to update custom domains: ' + error.response.data.message)
|
||||||
|
|
Loading…
Reference in New Issue