Improving Switches on Config Server Page

This commit is contained in:
Silversthorn 2023-01-31 20:20:08 +01:00
parent 3eeb00e524
commit 7949db65ac

View File

@ -194,6 +194,7 @@
required>
</div>
<!--
<div class="form-check-flat">
<label for="auto_start" class="form-check-label ml-4 mb-4">
{% if data['server_stats']['server_id']['auto_start'] %}
@ -233,6 +234,43 @@
</label>
{% end %}
</div>
-->
<div class="form-group">
<div class="custom-control custom-switch">
{% if data['server_stats']['server_id']['auto_start'] %}
<input type="checkbox" class="custom-control-input" id="auto_start" name="auto_start" checked="" value="1">
<label class="custom-control-label" for="auto_start">&nbsp;&nbsp;{{ translate('serverConfig', 'serverAutoStart', data['lang']) }}</label>
{% else %}
<input type="checkbox" class="custom-control-input" id="auto_start" name="auto_start" value="1">
<label class="custom-control-label" for="auto_start">&nbsp;&nbsp;{{ translate('serverConfig', 'serverAutoStart', data['lang']) }}</label>
{% end %}
</div>
</div>
<div class="form-group">
<div class="custom-control custom-switch">
{% if data['server_stats']['server_id']['crash_detection'] %}
<input type="checkbox" class="custom-control-input" id="crash_detection" name="crash_detection" checked="" value="1">
<label class="custom-control-label" for="crash_detection">&nbsp;&nbsp;{{ translate('serverConfig', 'serverCrashDetection', data['lang']) }}</label>
{% else %}
<input type="checkbox" class="custom-control-input" id="crash_detection" name="crash_detection" value="1">
<label class="custom-control-label" for="crash_detection">&nbsp;&nbsp;{{ translate('serverConfig', 'serverCrashDetection', data['lang']) }}</label>
{% end %}
</div>
</div>
<div class="form-group">
<div class="custom-control custom-switch">
{% if data['super_user'] %}
{% if data['server_stats']['server_id']['show_status'] %}
<input type="checkbox" class="custom-control-input" id="show_status" name="show_status" checked="" value="1">
<label class="custom-control-label" for="show_status">&nbsp;&nbsp;{{ translate('serverConfig', 'showStatus', data['lang']) }}</label>
{% else %}
<input type="checkbox" class="custom-control-input" id="show_status" name="show_status" value="1">&nbsp;&nbsp;{{ translate('serverConfig', 'showStatus', data['lang']) }}
<label class="custom-control-label" for="show_status">&nbsp;&nbsp;{{ translate('serverConfig', 'showStatus', data['lang']) }}</label>
{% end %}
{% end %}
</div>
</div>
<button type="submit" class="btn btn-success mr-2"><i class="fas fa-save"></i> {{
translate('serverConfig', 'save', data['lang']) }}</button>
@ -305,18 +343,19 @@
</div>
<style>
.toggle-handle {
background-color: white !important;
}
.toggle-on {
.custom-control-input:checked~.custom-control-label::before {
color: black !important;
background-color: blueviolet !important;
border-color: var(--outline) !important;
}
.toggle {
height: 0px !important;
background-color: grey !important;
.custom-control-label::before {
background-color: white !important;
top: calc(-0.2rem);
}
.custom-switch .custom-control-label::after {
top: calc(-0.125rem + 1px);
}
</style>
<!-- content-wrapper ends -->