Initial commit
This commit is contained in:
69
views/config.erb
Normal file
69
views/config.erb
Normal file
@@ -0,0 +1,69 @@
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<%= I18n.t('views.install_server_title') %>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text text-center"><%= I18n.t('views.install_server_description') %></p>
|
||||
<div class="container">
|
||||
<form id="cert-form" action="/install" method="POST" class="d-flex flex-column align-items-center">
|
||||
<div class="mb-3 w-100">
|
||||
<label for="cert-path" class="form-label"><%= I18n.t('views.cert_path_label') %></label>
|
||||
<input type="text" class="form-control w-100 required" id="cert-path" name="cert-path"
|
||||
placeholder="<%= I18n.t('views.enter_cert_path_placeholder') %>">
|
||||
</div>
|
||||
<div class="mb-3 w-100">
|
||||
<label for="validity-days" class="form-label"><%= I18n.t('views.cert_val_day') %></label>
|
||||
<input type="text" class="form-control w-100 required" id="validity-days" name="validity-days"
|
||||
placeholder="3650">
|
||||
</div>
|
||||
<div class="mb-3 w-100">
|
||||
<label for="country-name" class="form-label"><%= I18n.t('views.country_name_label') %></label>
|
||||
<input type="text" class="form-control w-100 required" id="country-name" name="country-name"
|
||||
placeholder="<%= I18n.t('views.enter_country_name_placeholder') %>">
|
||||
</div>
|
||||
<div class="mb-3 w-100">
|
||||
<label for="org-name" class="form-label"><%= I18n.t('views.org_name_label') %></label>
|
||||
<input type="text" class="form-control w-100 required" id="org-name" name="org-name"
|
||||
placeholder="<%= I18n.t('views.enter_org_name_placeholder') %>">
|
||||
</div>
|
||||
<div class="mb-3 w-100">
|
||||
<label for="common-name" class="form-label"><%= I18n.t('views.common_name_label') %></label>
|
||||
<input type="text" class="form-control w-100 required" id="common-name" name="common-name"
|
||||
placeholder="<%= I18n.t('views.enter_common_name_placeholder') %>">
|
||||
</div>
|
||||
<div class="mb-3 w-100">
|
||||
<label for="cert-password" class="form-label"><%= I18n.t('views.cert_password_label') %></label>
|
||||
<input type="password" class="form-control w-100 required" id="cert-password" name="cert-password"
|
||||
placeholder="<%= I18n.t('views.enter_cert_password_placeholder') %>">
|
||||
</div>
|
||||
<div class="d-flex justify-content-center w-100">
|
||||
<button type="button" class="btn btn-primary" id="submit-btn"><%= I18n.t('views.save') %></button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#submit-btn').click(function () {
|
||||
var isValid = true;
|
||||
$('.required').each(function() {
|
||||
if ($(this).val() === '') {
|
||||
isValid = false;
|
||||
$(this).addClass('is-invalid');
|
||||
} else {
|
||||
$(this).removeClass('is-invalid');
|
||||
}
|
||||
});
|
||||
|
||||
if (isValid) {
|
||||
$('#cert-form').submit();
|
||||
} else {
|
||||
alert('<%= I18n.t('views.please_enter_all_required_fields') %>');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user