Merge branch 'develop'
# Conflicts: # public/js/app.js
This commit is contained in:
@@ -12,8 +12,8 @@ class ServiceController extends Controller
|
||||
public function index()
|
||||
{
|
||||
return inertia('Admin/Services/Index', [
|
||||
'servers' => Server::withCount('sites')->latest()->paginate(5, ['*'], 'servers_per_page'),
|
||||
'sites' => Site::with('server:id,name')->latest()->paginate(5, ['*'], 'sites_per_page'),
|
||||
'servers' => Server::query()->withCount('sites', 'users')->latest()->paginate(5, ['*'], 'servers_per_page'),
|
||||
'sites' => Site::with('server:id,name')->withCount('users')->latest()->paginate(5, ['*'], 'sites_per_page'),
|
||||
'providers' => Provider::query()
|
||||
->withCount('regions', 'plans', 'servers')
|
||||
->latest()
|
||||
|
||||
@@ -37,4 +37,21 @@ class ProfileController extends Controller
|
||||
|
||||
return $mode;
|
||||
}
|
||||
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
/* @var $user \App\Models\User */
|
||||
$user = $request->user();
|
||||
|
||||
$user->sites()->detach();
|
||||
$user->servers()->detach();
|
||||
$user->supportTicketReplies()->delete();
|
||||
$user->supportTickets()->delete();
|
||||
|
||||
$user->delete();
|
||||
|
||||
auth()->logout();
|
||||
|
||||
return redirect()->route('login');
|
||||
}
|
||||
}
|
||||
|
||||
27335
public/js/app.js
vendored
27335
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -25,6 +25,7 @@
|
||||
<TableRow>
|
||||
<TableHeader>{{ __('Name') }}</TableHeader>
|
||||
<TableHeader>{{ __('Usage') }}</TableHeader>
|
||||
<TableHeader>{{ __('Users') }}</TableHeader>
|
||||
<TableHeader></TableHeader>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
@@ -40,6 +41,7 @@
|
||||
</Button>
|
||||
</TableData>
|
||||
<TableData>{{ server.sites_count }}/{{ server.maximum_sites }}</TableData>
|
||||
<TableData>{{ server.users_count }}</TableData>
|
||||
<TableData>
|
||||
<inertia-link :href="route('admin.services.servers.edit', server.id)" class="text-primary font-medium">
|
||||
{{ __('Edit') }}
|
||||
@@ -63,6 +65,7 @@
|
||||
<TableRow>
|
||||
<TableHeader>{{ __('Name') }}</TableHeader>
|
||||
<TableHeader>{{ __('Server') }}</TableHeader>
|
||||
<TableHeader>{{ __('Users') }}</TableHeader>
|
||||
<TableHeader></TableHeader>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
@@ -74,6 +77,9 @@
|
||||
<TableData>
|
||||
{{ site.server ? site.server.name : '-' }}
|
||||
</TableData>
|
||||
<TableData>
|
||||
{{ site.users_count }}
|
||||
</TableData>
|
||||
<TableData>
|
||||
<inertia-link :href="route('admin.services.sites.edit', site.id)" class="text-primary font-medium">
|
||||
{{ __('Edit') }}
|
||||
|
||||
@@ -80,6 +80,14 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (window.location.search.includes('demo=')) {
|
||||
this.form.email = 'demo@ploi-core.io';
|
||||
this.form.password = 'secret';
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.$inertia.post(this.route('login'), {
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
<div>
|
||||
<input id="keyboard_shortcuts" class="form-checkbox" type="checkbox"
|
||||
v-model="form.keyboard_shortcuts">
|
||||
<label for="keyboard_shortcuts" class="ml-2 text-sm">{{ __('Enable keyboard shortcuts') }}</label>
|
||||
<label for="keyboard_shortcuts" class="ml-2 text-sm">{{
|
||||
__('Enable keyboard shortcuts')
|
||||
}}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will allow you to do keyboard shortcuts for navigation, which is visible when you press "/"') }}
|
||||
{{
|
||||
__('This will allow you to do keyboard shortcuts for navigation, which is visible when you press "/"')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -26,101 +30,124 @@
|
||||
</FormActions>
|
||||
</form>
|
||||
</PageBody>
|
||||
|
||||
<div class="border-t border-low-emphasis"></div>
|
||||
|
||||
<PageBody>
|
||||
<form class="space-y-4" @submit.prevent="deleteAccount">
|
||||
<p>
|
||||
You can remove your account here. This will remove all data of your account.
|
||||
</p>
|
||||
<FormActions>
|
||||
<Button variant="danger">{{ __('Save changes') }}</Button>
|
||||
</FormActions>
|
||||
</form>
|
||||
</PageBody>
|
||||
</Container>
|
||||
</Content>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TopBar from './components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import IconBox from '@/components/icons/IconBox'
|
||||
import IconGlobe from '@/components/icons/IconGlobe'
|
||||
import IconStorage from '@/components/icons/IconStorage'
|
||||
import Modal from '@/components/Modal'
|
||||
import ModalContainer from '@/components/ModalContainer'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import TopBar from './components/TopBar'
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
import Button from '@/components/Button'
|
||||
import List from '@/components/List'
|
||||
import ListItem from '@/components/ListItem'
|
||||
import StatusBubble from '@/components/StatusBubble'
|
||||
import NotificationBadge from '@/components/NotificationBadge'
|
||||
import MainLayout from '@/Layouts/MainLayout'
|
||||
import IconBox from '@/components/icons/IconBox'
|
||||
import IconGlobe from '@/components/icons/IconGlobe'
|
||||
import IconStorage from '@/components/icons/IconStorage'
|
||||
import Modal from '@/components/Modal'
|
||||
import ModalContainer from '@/components/ModalContainer'
|
||||
import FormInput from '@/components/forms/FormInput'
|
||||
import FormSelect from '@/components/forms/FormSelect'
|
||||
import FormActions from '@/components/FormActions'
|
||||
import {useConfirmDelete} from '@/hooks/confirm-delete'
|
||||
|
||||
export default {
|
||||
metaInfo() {
|
||||
return {
|
||||
title: `${this.__('Settings')}`,
|
||||
}
|
||||
},
|
||||
export default {
|
||||
metaInfo() {
|
||||
return {
|
||||
title: `${this.__('Settings')}`,
|
||||
}
|
||||
},
|
||||
|
||||
layout: MainLayout,
|
||||
layout: MainLayout,
|
||||
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
IconBox,
|
||||
IconGlobe,
|
||||
IconStorage,
|
||||
Modal,
|
||||
ModalContainer,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
FormActions
|
||||
},
|
||||
components: {
|
||||
TopBar,
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
StatusBubble,
|
||||
NotificationBadge,
|
||||
IconBox,
|
||||
IconGlobe,
|
||||
IconStorage,
|
||||
Modal,
|
||||
ModalContainer,
|
||||
FormInput,
|
||||
FormSelect,
|
||||
FormActions
|
||||
},
|
||||
|
||||
props: {
|
||||
profile: Object,
|
||||
},
|
||||
props: {
|
||||
profile: Object,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
theme: this.profile.theme,
|
||||
keyboard_shortcuts: this.profile.keyboard_shortcuts
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
theme: this.profile.theme,
|
||||
keyboard_shortcuts: this.profile.keyboard_shortcuts
|
||||
},
|
||||
|
||||
breadcrumbs: [
|
||||
{
|
||||
title: this.$page.props.settings.name,
|
||||
to: '/',
|
||||
},
|
||||
{
|
||||
title: this.__('Profile'),
|
||||
to: this.route('profile.index'),
|
||||
},
|
||||
{
|
||||
title: this.__('Settings'),
|
||||
to: this.route('profile.settings.index'),
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
breadcrumbs: [
|
||||
{
|
||||
title: this.$page.props.settings.name,
|
||||
to: '/',
|
||||
},
|
||||
{
|
||||
title: this.__('Profile'),
|
||||
to: this.route('profile.index'),
|
||||
},
|
||||
{
|
||||
title: this.__('Settings'),
|
||||
to: this.route('profile.settings.index'),
|
||||
},
|
||||
],
|
||||
}
|
||||
methods: {
|
||||
submit() {
|
||||
this.$inertia.patch(this.route('profile.settings.update'), this.form, {
|
||||
onStart: () => this.sending = true,
|
||||
onFinish: () => this.sending = false,
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
this.$inertia.patch(this.route('profile.settings.update'), this.form, {
|
||||
onStart: () => this.sending = true,
|
||||
onFinish: () => this.sending = false,
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
deleteAccount() {
|
||||
useConfirmDelete({
|
||||
title: this.__('Are you sure?'),
|
||||
message: `Are you sure you want to remove your account? All data will be deleted and services will be detached.`,
|
||||
onConfirm: () => {
|
||||
this.$inertia.delete(this.route('profile.delete-account'));
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -92,6 +92,7 @@ Route::group(['middleware' => ['auth', 'auth.blocked']], function () {
|
||||
Route::group(['prefix' => 'profile', 'as' => 'profile.', 'namespace' => 'Profile'], function () {
|
||||
Route::get('/', 'ProfileController@index')->name('index');
|
||||
Route::patch('/', 'ProfileController@update')->name('update');
|
||||
Route::delete('destroy', 'ProfileController@destroy')->name('delete-account');
|
||||
|
||||
// Security
|
||||
Route::group(['prefix' => 'security', 'as' => 'security.'], function () {
|
||||
|
||||
Reference in New Issue
Block a user