123 lines
4.2 KiB
Plaintext
123 lines
4.2 KiB
Plaintext
@Html.AntiForgeryToken()
|
|
<style>
|
|
.modal-content {
|
|
background-color: #334155;
|
|
color: #fff;
|
|
}
|
|
|
|
.itemSection {
|
|
display: flex;
|
|
align-items: center;
|
|
/* justify-content: space-between; */
|
|
background-color: #253247;
|
|
padding: 7px 5px;
|
|
border-radius: 10px;
|
|
margin: 5px 0;
|
|
font-size: 13px;
|
|
gap: 10px;
|
|
}
|
|
|
|
.itemSection.header {
|
|
background-color: #212c3d;
|
|
}
|
|
|
|
.form-control {
|
|
border: none;
|
|
background-color: #475569;
|
|
color: #ffffff !important;
|
|
}
|
|
|
|
.form-control:focus {
|
|
background-color: #475569;
|
|
outline: none;
|
|
border: none;
|
|
border-color: transparent;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.form-control:active {
|
|
outline: none;
|
|
}
|
|
|
|
.form-control::placeholder {
|
|
color: #eeeeee;
|
|
}
|
|
|
|
.stickyHeader {
|
|
position: sticky;
|
|
top: 0;
|
|
}
|
|
|
|
.btn-cancel {
|
|
background-color: #27272a;
|
|
width: 100%;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.btn-logout {
|
|
background-color: #ef4444;
|
|
color: #fff;
|
|
}
|
|
</style>
|
|
|
|
|
|
|
|
<div class="modal fade" id="passwordModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="passwordModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="border-color: #1e293b;">
|
|
<h6 class="modal-title w-100 fs-6 text-center" id="passwordModalLabel">گذرواژه</h6>
|
|
@* <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> *@
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>برای خروج از این سامانه باید گذرواژه خود را وارد نمایید</p>
|
|
|
|
<div class="position-relative">
|
|
<input name="password" id="password" class="form-control" type="password" placeholder="گذرواژه" autofocus autocomplete="new-password" style="direction: ltr" />
|
|
<span class="position-absolute" id="toggle-password" style="cursor: pointer; top: 0; right: 5px; padding: 5px;">
|
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="18" height="18">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer" style="border-color: #1e293b;">
|
|
<div class="d-flex align-items-center gap-2 w-100">
|
|
<button type="button" class="btn btn-cancel w-50" data-bs-dismiss="modal">انصراف</button>
|
|
<a id="logOut" onclick="logout()" type="button" class="btn btn-logout w-50">خروج</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function logout() {
|
|
|
|
$.ajax({
|
|
async: false,
|
|
// contentType: 'application/json',
|
|
// dataType: 'data',
|
|
type: 'POST',
|
|
url: '@Url.Page("./Index", "CheckPassword")',
|
|
data: { "password": $('#password').val() },
|
|
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
|
success: function (response) {
|
|
if (!response.isSuccess) {
|
|
$('.alert-msg').show();
|
|
$('.alert-msg p').text(response.errorMessage);
|
|
} else {
|
|
|
|
window.location.href ='@Url.Page("/Camera/Index", "Logout")';
|
|
}
|
|
},
|
|
failure: function (response) {
|
|
console.log(5, response);
|
|
}
|
|
});
|
|
};
|
|
</script>
|
|
|