chore: ♻️ code refactoring -> cleanup
This commit is contained in:
parent
f503dedf7e
commit
21a86ce44d
|
@ -34,7 +34,6 @@ class Misc
|
|||
|
||||
$values = [
|
||||
//SETTINGS::VALUE => REQUEST-VALUE (coming from the html-form)
|
||||
"SETTINGS::MISC:PHPMYADMIN:URL" => "phpmyadmin-url",
|
||||
"SETTINGS::DISCORD:BOT_TOKEN" => "discord-bot-token",
|
||||
"SETTINGS::DISCORD:CLIENT_ID" => "discord-client-id",
|
||||
"SETTINGS::DISCORD:CLIENT_SECRET" => "discord-client-secret",
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
<div class="tab-pane mt-3 active" id="configurations">
|
||||
<table id="datatable" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Key') }}</th>
|
||||
<th>{{ __('Value') }}</th>
|
||||
<th>{{ __('Type') }}</th>
|
||||
<th width="600">{{ __('Description') }}</th>
|
||||
<th>{{ __('Created at') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- The Modal -->
|
||||
<div class="modal fade" id="editConfigurationModel">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content ">
|
||||
|
||||
<form method="post" action="{{ route('admin.settings.updatevalue') }}">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">{{ __('Edit Configuration') }}</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label id="keyLabel" for="value">{{ __('Text Field') }}</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">
|
||||
<i class="fa fa-cog"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input hidden id="key" name="key" type="text" class="form-control" required="required">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">{{ __('Cancel') }}</button>
|
||||
<button type="submit" class="btn btn-primary">{{ __('Save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.configuration = {
|
||||
parse(key, value, type) {
|
||||
$('#keyLabel').html(key)
|
||||
$('#key').val(key)
|
||||
$('#value').remove();
|
||||
if (type === 'integer') {
|
||||
$('.input-group').append(
|
||||
'<input id="value" name="value" type="number" class="form-control" required="required">')
|
||||
} else if (type === 'boolean') {
|
||||
$('.input-group').append('<select id="value" name="value" class="form-control" required=required>' +
|
||||
'<option value="true">true</option>' +
|
||||
'<option value="false">false</option>' +
|
||||
'</select>')
|
||||
} else if (type === 'string') {
|
||||
$('.input-group').append(
|
||||
'<input id="value" name="value" type="text" class="form-control" required="required">')
|
||||
}
|
||||
$('#value').val(value)
|
||||
$('#editConfigurationModel').modal('show')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
$('#datatable').DataTable({
|
||||
language: {
|
||||
url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ config('app.datatable_locale') }}.json'
|
||||
},
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
stateSave: true,
|
||||
ajax: "{{ route('admin.settings.datatable') }}",
|
||||
columns: [{
|
||||
data: 'key'
|
||||
},
|
||||
{
|
||||
data: 'value'
|
||||
},
|
||||
{
|
||||
data: 'type'
|
||||
},
|
||||
{
|
||||
data: 'description'
|
||||
},
|
||||
{
|
||||
data: 'created_at'
|
||||
},
|
||||
{
|
||||
data: 'actions',
|
||||
sortable: false
|
||||
},
|
||||
],
|
||||
fnDrawCallback: function(oSettings) {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -5,12 +5,11 @@
|
|||
@method('PATCH')
|
||||
|
||||
<div class="row">
|
||||
|
||||
{{-- System --}}
|
||||
<div class="col-md-3 px-3">
|
||||
<div class="row mb-2">
|
||||
<div class="col text-center">
|
||||
<h1>{{ __('Server') }}</h1>
|
||||
<h1>{{ __('System') }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -45,8 +44,8 @@
|
|||
<div class="custom-control mb-3 p-0">
|
||||
<label for="credits-display-name">{{ __('Credits Display Name') }}</label>
|
||||
<input x-model="credits-display-name" id="credits-display-name" name="credits-display-name"
|
||||
type="number" value="{{ config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME', 'Credits') }}"
|
||||
class="form-control @error('credits-display-name') is-invalid @enderror">
|
||||
type="text" value="{{ config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME', 'Credits') }}"
|
||||
class="form-control @error('credits-display-name') is-invalid @enderror" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -78,13 +77,13 @@
|
|||
<label for="initial-credits">{{ __('Initial Credits') }}</label>
|
||||
<input x-model="initial-credits" id="initial-credits" name="initial-credits" type="number"
|
||||
value="{{ config('SETTINGS::USER:INITIAL_CREDITS') }}"
|
||||
class="form-control @error('initial-credits') is-invalid @enderror">
|
||||
class="form-control @error('initial-credits') is-invalid @enderror" required>
|
||||
</div>
|
||||
<div class="custom-control mb-3 p-0">
|
||||
<label for="initial-server-limit">{{ __('Initial Server Limit') }}</label>
|
||||
<input x-model="initial-server-limit" id="initial-server-limit" name="initial-server-limit"
|
||||
type="number" value="{{ config('SETTINGS::USER:INITIAL_SERVER_LIMIT') }}"
|
||||
class="form-control @error('initial-server-limit') is-invalid @enderror">
|
||||
class="form-control @error('initial-server-limit') is-invalid @enderror" required>
|
||||
</div>
|
||||
<div class="custom-control mb-3 p-0">
|
||||
<label
|
||||
|
@ -92,7 +91,7 @@
|
|||
<input x-model="credits-reward-amount-discord" id="credits-reward-amount-discord"
|
||||
name="credits-reward-amount-discord" type="number"
|
||||
value="{{ config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') }}"
|
||||
class="form-control @error('credits-reward-amount-discord') is-invalid @enderror">
|
||||
class="form-control @error('credits-reward-amount-discord') is-invalid @enderror" required>
|
||||
</div>
|
||||
|
||||
<div class="custom-control mb-3 p-0">
|
||||
|
@ -100,21 +99,21 @@
|
|||
<input x-model="credits-reward-amount-email" id="credits-reward-amount-email"
|
||||
name="credits-reward-amount-email" type="number"
|
||||
value="{{ config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') }}"
|
||||
class="form-control @error('credits-reward-amount-email') is-invalid @enderror">
|
||||
class="form-control @error('credits-reward-amount-email') is-invalid @enderror" required>
|
||||
</div>
|
||||
<div class="custom-control mb-3 p-0">
|
||||
<label for="server-limit-discord">{{ __('Server Limit Increase - Discord') }}</label>
|
||||
<input x-model="server-limit-discord" id="server-limit-discord" name="crserver-limit-discord"
|
||||
type="number"
|
||||
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') }}"
|
||||
class="form-control @error('server-limit-discord') is-invalid @enderror">
|
||||
class="form-control @error('server-limit-discord') is-invalid @enderror" required>
|
||||
</div>
|
||||
<div class="custom-control mb-3 p-0">
|
||||
<label for="server-limit-email">{{ __('Server Limit Increase - E-Mail') }}</label>
|
||||
<input x-model="server-limit-email" id="server-limit-email" name="crserver-limit-email"
|
||||
type="number"
|
||||
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') }}"
|
||||
class="form-control @error('server-limit-email') is-invalid @enderror">
|
||||
class="form-control @error('server-limit-email') is-invalid @enderror" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -135,7 +134,7 @@
|
|||
</div>
|
||||
<input x-model="allocation-limit" id="allocation-limit" name="allocation-limit" type="number"
|
||||
value="{{ config('SETTINGS::SERVER:ALLOCATION_LIMIT') }}"
|
||||
class="form-control @error('allocation-limit') is-invalid @enderror">
|
||||
class="form-control @error('allocation-limit') is-invalid @enderror" required>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue