Viewing file: index.blade.php (9.59 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.customer')
@section('title') Sending Domain @endsection
@section('extra-css')
<link rel="stylesheet" href="{{asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css')}}">
<link rel="stylesheet" href="{{asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css')}}">
<style>
#dnsKey{
background: #d3d3d36b;
padding: 3px 8px;
border-radius: 5px;
margin: 6px 5px;
}
#pubKey{
background: #d3d3d36b;
padding: 3px 8px;
border-radius: 5px;
margin: 6px 5px;
line-break: anywhere;
}
#dkim_key{
background: #d3d3d36b;
padding: 3px 8px;
border-radius: 5px;
margin: 6px 5px;
line-break: anywhere;
overflow-y: scroll;
height: 100px;
width: 100%;
}
#spf_key{
background: #d3d3d36b;
padding: 3px 8px;
border-radius: 5px;
margin: 6px 5px;
line-break: anywhere;
width: 100%;
}
.desc-section{
line-height: 27px;
}
</style>
@endsection
@section('content')
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-12 mt-3">
<div class="card">
<div class="card-header">
<h2 class="card-title">@lang('customer.list')</h2>
<div class="float-right">
<a class="btn btn-primary" href="{{route('customer.domain.create')}}">@lang('customer.new')</a>
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="domains" class="table table-striped table-bordered dt-responsive nowrap">
<thead>
<tr>
<th>@lang('customer.name')</th>
<th>@lang('customer.dkim_key')</th>
<th>@lang('customer.spf_key')</th>
<th>@lang('customer.text')</th>
<th>@lang('customer.dmarc_key')</th>
<th>@lang('customer.dkim_key_verified')</th>
<th>@lang('customer.spf_key_verified')</th>
<th>@lang('customer.text_verified')</th>
<th>@lang('customer.dmarc_key_verified')</th>
<th>@lang('customer.action')</th>
</tr>
</thead>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<button type="button" class="btn btn-primary d-none" id="authorizeDomainButton" data-toggle="modal" data-target="#authorizeDomainModal"></button>
<div class="modal fade" id="authorizeDomainModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title text-center-domain-title" id="exampleModalLabel">Authorize this domain</h5>
<button type="button" class="close modal-close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="fas fa-times"></i></span>
</button>
</div>
<p class="text-center-domain-title">@lang('customer.authorize_your_domain')</p>
<div class="modal-body">
<div class="form-group">
<label for="dkim_key">1. @lang('customer.dkim_key') "<span id="domain_name_sector"></span>" @lang('customer.to_small')</label>
<p id="dkim_key"></p>
<button type="button" class="btn btn-primary ml-2 mt-2 mb-4 float-right verify_btn" id="dkim_key_verify_btn">Verify</button>
</div>
<div class="form-group">
<label for="spf_key">2. @lang('customer.spf_key') "<span class="domain_name"></span>" @lang('customer.to_small')</label>
<p id="spf_key"></p>
<button type="button" class="btn btn-primary ml-2 mt-2 mb-4 float-right verify_btn" id="spf_key_verify_btn">Verify</button>
</div>
<div class="form-group">
<label for="dnsKey">3. @lang('customer.text') "<span class="domain_name"></span>" @lang('customer.to_small')</label>
<p id="dnsKey"></p>
<button type="button" class="btn btn-primary ml-2 mt-2 mb-4 float-right verify_btn" id="text_verify_btn">Verify</button>
</div>
<div class="form-group">
<label for="pubKey">4. @lang('customer.dmarc_key') "_dmarc.<span class="domain_name"></span>" @lang('customer.to_small')</label>
<p id="pubKey"></p>
<button type="button" class="btn btn-primary ml-2 mt-2 mb-2 float-right verify_btn" id="dmarc_key_verify_btn">Verify</button>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('extra-scripts')
<script src="{{asset('js/customer/domain.js')}}"></script>
<script>
$(document).on('click', '.domain_key_show', function(e){
e.preventDefault();
const id = $(this).attr('data-id');
$.ajax({
type:'GET',
url:'{{route('customer.domain.keys.show')}}',
data:{
id:id
},
success:function (res){
if(res.status=='success' && res.data){
$('.ssh_key_section').removeClass('d-none');
$('#continue').addClass('d-none');
$('#dkim_key_verify_btn').attr('key', res.data.dkim_key).attr('name', 'dkim_key').attr('domain_key',res.data.dnskey).attr('data-id',res.data.id);
$('#spf_key_verify_btn').attr('key', res.data.spf_key).attr('name', 'spf_key').attr('domain_key',res.data.name).attr('data-id',res.data.id);
$('#text_verify_btn').attr('key', res.data.mail_code).attr('name', 'text').attr('domain_key',res.data.name).attr('data-id',res.data.id);
$('#dmarc_key_verify_btn').attr('key', res.data.dmarc_key).attr('name', 'dmarc_key').attr('domain_key','_dmarc.'+res.data.name).attr('data-id',res.data.id);
$('.domain_name').text(res.data.name)
$('#domain_name_sector').text(res.data.dnskey);
$('#dkim_key').text(res.data.dkim_key);
$('#spf_key').text(res.data.spf_key);
$('#dnsKey').removeClass('d-none').text(res.data.mail_code);
$('#pubKey').removeClass('d-none').text(res.data.dmarc_key);
if(res.data.dkim_key_verified=='yes'){
$('#dkim_key_verify_btn').attr('disabled', 'true').addClass('disabled');
}
if(res.data.spf_key_verified=='yes'){
$('#spf_key_verify_btn').attr('disabled', 'true').addClass('disabled');
}
if(res.data.text_verified=='yes'){
$('#text_verify_btn').attr('disabled', 'true').addClass('disabled');
}
if(res.data.dmarc_key_verified=='yes'){
$('#dmarc_key_verify_btn').attr('disabled', 'true').addClass('disabled');
}
$('#authorizeDomainButton').trigger('click');
}else{
toastr.error(res.message, {timeOut: 9000});
}
}
})
});
$(document).on('click', '.verify_btn', function (e){
e.preventDefault();
const key = ""+$(this).attr('key');
const name = $(this).attr('name');
const domain_key = $(this).attr('domain_key');
const id = $(this).attr('data-id');
$(this).addClass('disabled').attr('disabled','true');
const that=this;
$.ajax({
type:'POST',
url:'{{route('customer.domain.verification')}}',
data:{
key:key,
name:name,
domain_key:domain_key,
id:id,
_token:'{{csrf_token()}}'
},
success:function (res){
if(res.status=='success'){
toastr.success(res.message, {timeOut: 9000});
}else{
toastr.error(res.message, {timeOut: 9000});
$(that).removeClass('disabled').removeAttr('disabled');
}
}
})
})
</script>
@endsection
|