Ability to remove logo and pagination to system logs
This commit is contained in:
@@ -16,8 +16,9 @@ class DashboardController extends Controller
|
||||
'servers' => Server::count(),
|
||||
'sites' => Site::count(),
|
||||
'users' => User::count(),
|
||||
'logs' => SystemLog::latest()->limit(10)->with('model')->get()
|
||||
->map(function (SystemLog $systemLog) {
|
||||
'logs' => SystemLog::query()
|
||||
->latest()->limit(10)->with('model')->paginate()
|
||||
->through(function (SystemLog $systemLog) {
|
||||
return [
|
||||
'title' => __($systemLog->title, [
|
||||
'site' => $systemLog->model->domain ?? '-Unknown-'
|
||||
|
||||
@@ -26,7 +26,8 @@ class SettingController extends Controller
|
||||
'enable_api' => setting('enable_api'),
|
||||
'api_token' => setting('api_token') ? decrypt(setting('api_token')) : null,
|
||||
'rotate_logs_after' => setting('rotate_logs_after') ? setting('rotate_logs_after') : null,
|
||||
'default_language' => setting('default_language', 'en')
|
||||
'default_language' => setting('default_language', 'en'),
|
||||
'has_logo' => (bool)setting('logo'),
|
||||
];
|
||||
|
||||
$packages = Package::pluck('name', 'id');
|
||||
@@ -128,4 +129,13 @@ class SettingController extends Controller
|
||||
|
||||
return ['content' => $template];
|
||||
}
|
||||
|
||||
public function removeLogo(Request $request)
|
||||
{
|
||||
Storage::delete(setting('logo'));
|
||||
|
||||
setting(['logo' => null]);
|
||||
|
||||
return redirect()->back()->with('success', 'Logo has ben removed');
|
||||
}
|
||||
}
|
||||
|
||||
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -11,12 +11,12 @@
|
||||
</PageHeader>
|
||||
|
||||
<PageBody>
|
||||
<SettingsLayout>
|
||||
<SettingsLayout space="space-y-0">
|
||||
<template #nav>
|
||||
<Tabs />
|
||||
<Tabs class="mb-16" />
|
||||
</template>
|
||||
<template #segments>
|
||||
<div>
|
||||
<div class="mb-16">
|
||||
<ul class="grid grid-cols-3 gap-4">
|
||||
<li class="p-6 rounded shadow bg-surface-3">
|
||||
<div class="flex space-x-4">
|
||||
@@ -54,10 +54,10 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="pb-4">
|
||||
<h2>{{ __('Recent logs') }}</h2>
|
||||
<List>
|
||||
<ListItem v-for="log in logs" :key="log.id">
|
||||
<ListItem v-for="log in logs.data" :key="log.id">
|
||||
<template #title>
|
||||
{{ log.title }}
|
||||
</template>
|
||||
@@ -66,7 +66,7 @@
|
||||
</ListItem>
|
||||
</List>
|
||||
</div>
|
||||
|
||||
<pagination :links="logs"/>
|
||||
</template>
|
||||
</SettingsLayout>
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
import Container from '@/components/Container'
|
||||
import Content from '@/components/Content'
|
||||
import Page from '@/components/Page'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import PageHeader from '@/components/PageHeader'
|
||||
import PageHeaderTitle from '@/components/PageHeaderTitle'
|
||||
import PageBody from '@/components/PageBody'
|
||||
@@ -116,6 +117,7 @@
|
||||
Container,
|
||||
Content,
|
||||
Page,
|
||||
Pagination,
|
||||
PageHeader,
|
||||
PageHeaderTitle,
|
||||
PageBody,
|
||||
@@ -140,7 +142,7 @@
|
||||
servers: Number,
|
||||
sites: Number,
|
||||
users: Number,
|
||||
logs: Array,
|
||||
logs: [Array, Object],
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -29,21 +29,35 @@
|
||||
<FormInput :label="__('E-mail address')" :errors="$page.props.errors.email"
|
||||
v-model="form.email"/>
|
||||
|
||||
<FormFileInput accept="image/*" :label="__('Logo')" type="file" :errors="$page.props.errors.logo"
|
||||
<FormFileInput accept="image/*" :label="__('Logo')" type="file"
|
||||
:errors="$page.props.errors.logo"
|
||||
v-model="form.logo"/>
|
||||
|
||||
<FormInput :helper-text="__('Separate by comma to allow more email addresses')" :label="__('Support email addresses')" :errors="$page.props.errors.support_emails"
|
||||
<Button v-if="company_settings.has_logo" variant="danger" type="button" class="ml-2 px-4 py-1 bg-gray-500 hover:bg-gray-700 rounded-sm text-xs font-medium text-white" @click="removeLogo">
|
||||
Remove logo
|
||||
</Button>
|
||||
|
||||
<FormInput :helper-text="__('Separate by comma to allow more email addresses')"
|
||||
:label="__('Support email addresses')"
|
||||
:errors="$page.props.errors.support_emails"
|
||||
v-model="form.support_emails"/>
|
||||
|
||||
<FormSelect :helper-text="__('Select the default package a user should get when you create or they register')" :label="__('Select default package')" v-model="form.default_package">
|
||||
<FormSelect
|
||||
:helper-text="__('Select the default package a user should get when you create or they register')"
|
||||
:label="__('Select default package')" v-model="form.default_package">
|
||||
<option v-for="(name, id) in packages" :value="id" v-text="name"></option>
|
||||
</FormSelect>
|
||||
|
||||
<FormSelect :helper-text="__('Select the default package a user should get when you create or they register')" :label="__('Select default language')" v-model="form.default_language">
|
||||
<option v-for="language in languages" :value="language" v-text="language"></option>
|
||||
<FormSelect
|
||||
:helper-text="__('Select the default package a user should get when you create or they register')"
|
||||
:label="__('Select default language')" v-model="form.default_language">
|
||||
<option v-for="language in languages" :value="language"
|
||||
v-text="language"></option>
|
||||
</FormSelect>
|
||||
|
||||
<FormSelect :helper-text="__('This will rotate any logs older than selected, this helps cleanup your database')" :label="__('Rotate logs after')" v-model="form.rotate_logs_after">
|
||||
<FormSelect
|
||||
:helper-text="__('This will rotate any logs older than selected, this helps cleanup your database')"
|
||||
:label="__('Rotate logs after')" v-model="form.rotate_logs_after">
|
||||
<option value="">Don't rotate logs</option>
|
||||
<option value="weeks-1">Older than 1 week</option>
|
||||
<option value="months-1">Older than 1 month</option>
|
||||
@@ -58,36 +72,50 @@
|
||||
<div>
|
||||
<input id="support" class="form-checkbox" type="checkbox"
|
||||
v-model="form.support">
|
||||
<label for="support" class="ml-2 text-sm">{{ __('Enable support platform') }}</label>
|
||||
<label for="support" class="ml-2 text-sm">{{
|
||||
__('Enable support platform')
|
||||
}}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will allow your customers to make support requests to you.') }}
|
||||
{{
|
||||
__('This will allow your customers to make support requests to you.')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input id="documentation" class="form-checkbox" type="checkbox"
|
||||
v-model="form.documentation">
|
||||
<label for="documentation" class="ml-2 text-sm">{{ __('Enable documentation platform') }}</label>
|
||||
<label for="documentation" class="ml-2 text-sm">{{
|
||||
__('Enable documentation platform')
|
||||
}}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will allow you to create articles for your users to look at.') }}
|
||||
{{
|
||||
__('This will allow you to create articles for your users to look at.')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input id="allow_registration" class="form-checkbox" type="checkbox"
|
||||
v-model="form.allow_registration">
|
||||
<label for="allow_registration" class="ml-2 text-sm">{{ __('Allow customer registration') }}</label>
|
||||
<label for="allow_registration"
|
||||
class="ml-2 text-sm">{{ __('Allow customer registration') }}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will allow public users to register on your platform.') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input id="receive_email_on_server_creation" class="form-checkbox" type="checkbox"
|
||||
<input id="receive_email_on_server_creation" class="form-checkbox"
|
||||
type="checkbox"
|
||||
v-model="form.receive_email_on_server_creation">
|
||||
<label for="receive_email_on_server_creation" class="ml-2 text-sm">{{ __('Receive email when customers create server') }}</label>
|
||||
<label for="receive_email_on_server_creation" class="ml-2 text-sm">{{
|
||||
__('Receive email when customers create server')
|
||||
}}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will send an email to all admins notifying them about a new server installation.') }}
|
||||
{{
|
||||
__('This will send an email to all admins notifying them about a new server installation.')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -96,19 +124,27 @@
|
||||
v-model="form.enable_api">
|
||||
<label for="enable_api" class="ml-2 text-sm">{{ __('Enable API') }}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will allow you to interact with your system via the API.') }} <a href="https://docs.ploi-core.io/core-api/introduction" class="text-primary" target="_blank">More information</a>
|
||||
{{
|
||||
__('This will allow you to interact with your system via the API.')
|
||||
}} <a href="https://docs.ploi-core.io/core-api/introduction"
|
||||
class="text-primary" target="_blank">More information</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<FormInput v-if="form.enable_api" allow-random-string :label="__('API token')" :errors="$page.props.errors.api_token"
|
||||
<FormInput v-if="form.enable_api" allow-random-string :label="__('API token')"
|
||||
:errors="$page.props.errors.api_token"
|
||||
v-model="form.api_token"/>
|
||||
|
||||
<div>
|
||||
<input id="isolate_per_site_per_user" class="form-checkbox" type="checkbox"
|
||||
v-model="form.isolate_per_site_per_user">
|
||||
<label for="isolate_per_site_per_user" class="ml-2 text-sm">{{ __('Enable site isolation per site & user') }}</label>
|
||||
<label for="isolate_per_site_per_user" class="ml-2 text-sm">{{
|
||||
__('Enable site isolation per site & user')
|
||||
}}</label>
|
||||
<p class="text-small mt-1 text-medium-emphasis">
|
||||
{{ __('This will make sure each site created by one user is always isolated from another.') }}
|
||||
{{
|
||||
__('This will make sure each site created by one user is always isolated from another.')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -243,6 +279,14 @@
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
removeLogo() {
|
||||
this.$inertia.delete(this.route('admin.settings.remove-logo'), {
|
||||
preserveScroll: true,
|
||||
onStart: () => this.sending = true,
|
||||
onFinish: () => this.sending = false,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<slot name="nav" />
|
||||
</aside>
|
||||
<section class="col-span-4 md:col-span-3">
|
||||
<div class="space-y-16">
|
||||
<div :class="space">
|
||||
<slot name="segments"></slot>
|
||||
</div>
|
||||
</section>
|
||||
@@ -18,6 +18,10 @@ export default {
|
||||
type: Array,
|
||||
required: false,
|
||||
},
|
||||
space: {
|
||||
type: String,
|
||||
default: 'space-y-16'
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -10,6 +10,7 @@ Route::group(['prefix' => 'settings'], function () {
|
||||
Route::get('terms', 'SettingController@terms')->name('settings.terms');
|
||||
Route::get('terms/template', 'SettingController@termsTemplate')->name('settings.terms.template');
|
||||
Route::patch('terms', 'SettingController@updateTerms')->name('settings.terms.update');
|
||||
Route::delete('remove-logo', 'SettingController@removeLogo')->name('settings.remove-logo');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user