Bugfixes in server settings, site creation

This commit is contained in:
Dennis
2021-08-04 09:46:11 +02:00
parent 33613cdf1c
commit 3c0964ef0e
5 changed files with 16 additions and 6 deletions

View File

@@ -38,7 +38,17 @@ class SiteController extends Controller
} else {
$server = Server::query()
->where('maximum_sites', '>', 0)
->doesntHave('users')
->where(function ($query) {
return $query
->where(function ($query) {
return $query->whereHas('users', function ($query) {
return $query->where('user_id', auth()->id());
});
})
->orWhere(function ($query) {
return $query->doesntHave('users');
});
})
->withCount('sites')
->inRandomOrder()
->first();

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
<Container>
<PageHeader>
<template #start>
<PageHeaderTitle>{{ __('Settings') }}</PageHeaderTitle>
<PageHeaderTitle>{{ server.name }}</PageHeaderTitle>
</template>
</PageHeader>

View File

@@ -26,11 +26,11 @@
to: this.route('servers.show', this.server.id),
active: this.route().current('servers.show')
},
{
this.can('servers', 'update') ? {
title: this.__('Settings'),
to: this.route('servers.settings.show', this.server.id),
active: this.route().current('servers.settings.show')
},
} : null,
],
}
},

View File

@@ -157,7 +157,7 @@
}
// If it includes a create true parameter, then we open the creation modal
if(window.location.search.includes('create=true')){
if(window.location.search.includes('create=')){
this.modalIsOpen = true;
}
if(window.location.search.includes('server=')){