427 lines
20 KiB
HTML
427 lines
20 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<meta name="description" content="">
|
||
<meta name="author" content="">
|
||
|
||
<title>レコード一覧 - {$config.webname}</title>
|
||
|
||
<!-- Bootstrap Core CSS -->
|
||
<link href="/static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||
|
||
<!-- MetisMenu CSS -->
|
||
<link href="/static/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
|
||
|
||
<!-- DataTables CSS -->
|
||
<link href="/static/vendor/datatables-plugins/dataTables.bootstrap.css" rel="stylesheet">
|
||
|
||
<!-- DataTables Responsive CSS -->
|
||
<link href="/static/vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">
|
||
|
||
<!-- Custom CSS -->
|
||
<link href="/static/dist/css/sb-admin-2.css" rel="stylesheet">
|
||
|
||
<!-- Custom Fonts -->
|
||
<link href="/static/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||
|
||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||
<!--[if lt IE 9]>
|
||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||
<![endif]-->
|
||
|
||
</head>
|
||
|
||
<body>
|
||
|
||
<div id="wrapper">
|
||
|
||
<!-- Navigation -->
|
||
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
|
||
<div class="navbar-header">
|
||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||
<span class="sr-only">Toggle navigation</span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
</button>
|
||
<a class="navbar-brand" href="index.html">
|
||
{$config.webname}
|
||
</a>
|
||
</div>
|
||
<!-- /.navbar-header -->
|
||
|
||
<ul class="nav navbar-top-links navbar-right">
|
||
<li class="dropdown">
|
||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||
<i class="fa fa-user fa-fw"></i>
|
||
<i class="fa fa-caret-down"></i>
|
||
</a>
|
||
<ul class="dropdown-menu dropdown-user">
|
||
<li>
|
||
<a href="#">
|
||
<i class="fa fa-user fa-fw"></i> User Profile</a>
|
||
</li>
|
||
<li>
|
||
<a href="#">
|
||
<i class="fa fa-gear fa-fw"></i> Settings</a>
|
||
</li>
|
||
<li class="divider"></li>
|
||
<li>
|
||
<a href="login.html">
|
||
<i class="fa fa-sign-out fa-fw"></i> Logout</a>
|
||
</li>
|
||
</ul>
|
||
<!-- /.dropdown-user -->
|
||
</li>
|
||
<!-- /.dropdown -->
|
||
</ul>
|
||
<!-- /.navbar-top-links -->
|
||
|
||
<div class="navbar-default sidebar" role="navigation">
|
||
<div class="sidebar-nav navbar-collapse">
|
||
<ul class="nav" id="side-menu">
|
||
<li>
|
||
<a href="/">
|
||
<i class="fa fa-dashboard fa-fw"></i> ダッシュボード</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<!-- /.sidebar-collapse -->
|
||
</div>
|
||
<!-- /.navbar-static-side -->
|
||
</nav>
|
||
|
||
<div id="page-wrapper">
|
||
<div class="row">
|
||
<div class="col-lg-12">
|
||
<h1 class="page-header">レコード一覧</h1>
|
||
</div>
|
||
<!-- /.col-lg-12 -->
|
||
</div>
|
||
<!-- /.row -->
|
||
<div class="row">
|
||
<div class="col-lg-12">
|
||
<div class="panel panel-default">
|
||
<div class="panel-heading">
|
||
{$domain}のレコード一覧
|
||
</div>
|
||
<!-- /.panel-heading -->
|
||
<div class="panel-body">
|
||
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
|
||
<thead>
|
||
<tr>
|
||
<th>レコード</th>
|
||
<th>レコードタイプ</th>
|
||
<th>TTL(秒)</th>
|
||
<th>レコード値</th>
|
||
<th>優先度</th>
|
||
<!-- <th>作成日</th>
|
||
<th>更新日</th>
|
||
<th>GSLB機能</th> -->
|
||
<th>レコード</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{volist name="r_list.records" id="vo"} {neq name="vo.type" value="SOA"}
|
||
<tr>
|
||
<td class='record'>{:substr($vo['name'], 0, -1)}</td>
|
||
<td class='type'>{$vo.type}</td>
|
||
<td class='col-md-1 ttl'>{$vo.ttl}</td>
|
||
<td class='value'>{$vo.data}</td>
|
||
<td class='col-md-1 priority'>{:empty($vo['priority']) ? '' : $vo['priority']}</td>
|
||
<td class='col-md-2'>
|
||
<a data-domain-id="{$vo.domain_id}" data-record-id="{$vo.id}" class="btn btn-primary btn-sm btn-domain-edit">レコード更新</a>
|
||
<div data-domain-id="{$vo.domain_id}" data-record-id="{$vo.id}" class="btn btn-danger btn-sm btn-domain-delete">レコード削除</div>
|
||
</td>
|
||
</tr>
|
||
{/neq} {/volist}
|
||
|
||
</tbody>
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<input class="form-control" id='input-record-name' placeholder="@">
|
||
</td>
|
||
<td>
|
||
<select id="input-record-type" class="form-control">
|
||
<option value="A">A</option>
|
||
<option value="AAAA">AAAA</option>
|
||
<option value="CNAME">CNAME</option>
|
||
<option value="MX">MX</option>
|
||
<!-- <option value="SRV">SRV</option> -->
|
||
<option value="NS">NS</option>
|
||
<option value="TXT">TXT</option>
|
||
<!-- <option value="PTR">PTR</option> -->
|
||
</select>
|
||
</td>
|
||
<td>
|
||
<input id="input-record-ttl" type='number' class="form-control" placeholder="300">
|
||
</td>
|
||
<td>
|
||
<input id="input-record-value" class="form-control" placeholder="8.8.8.8">
|
||
</td>
|
||
<td>
|
||
<input id="input-record-priority" type='number' class="form-control" disabled='true' readonly='readonly' placeholder="0">
|
||
</td>
|
||
<td class='col-md-2'>
|
||
<div data-domain-id="{$r_list.records.0.domain_id}" class="btn btn-success btn-sm btn-record-add">レコード作成</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<!-- /.table-responsive -->
|
||
<!-- <a class="btn btn-default btn-lg btn-block" href="">新しいレコードを追加</a> -->
|
||
|
||
</div>
|
||
<!-- /.panel-body -->
|
||
</div>
|
||
<!-- /.panel -->
|
||
</div>
|
||
<!-- /.col-lg-12 -->
|
||
|
||
<!-- 提示框 -->
|
||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog">
|
||
<!--提示内容-->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
<!-- /.提示框 -->
|
||
|
||
<!--域名更新-->
|
||
<!-- Modal -->
|
||
<div class="modal fade" id="record-edit" tabindex="-1" role="dialog" aria-labelledby="domain-edit" aria-hidden="true">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h4 class="modal-title" id="domain-edit">レコード更新</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="form-group">
|
||
<label>レコード</label>
|
||
<input id='edit-record' class="form-control" value=''>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="disabledSelect">レコードタイプ</label>
|
||
<input class="form-control" id="edit-type" type="text" placeholder="" disabled>
|
||
</div>
|
||
<!-- <div class="form-group">
|
||
<label>レコードタイプ</label>
|
||
<p id='edit-type' class="form-control-static"></p>
|
||
</div> -->
|
||
|
||
<div class="form-group">
|
||
<label>TTL(秒)</label>
|
||
<input id='edit-ttl' type='number' class="form-control" value=''>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label>レコード値</label>
|
||
<input id='edit-value' class="form-control" value=''>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label>優先度</label>
|
||
<input id='edit-priority' type='number' class="form-control" disabled='true' readonly='readonly' value=''>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">オフ</button>
|
||
<button type="button" class="btn btn-primary" id='edit-save' data-record-id="">レコード更新</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
<!-- /.modal -->
|
||
<!-- /.域名更新 -->
|
||
</div>
|
||
<!-- /.row -->
|
||
</div>
|
||
<!-- /#page-wrapper -->
|
||
|
||
</div>
|
||
<!-- /#wrapper -->
|
||
|
||
<!-- jQuery -->
|
||
<script src="/static/vendor/jquery/jquery.min.js"></script>
|
||
|
||
<!-- Bootstrap Core JavaScript -->
|
||
<script src="/static/vendor/bootstrap/js/bootstrap.min.js"></script>
|
||
|
||
<!-- Metis Menu Plugin JavaScript -->
|
||
<script src="/static/vendor/metisMenu/metisMenu.min.js"></script>
|
||
|
||
<!-- DataTables JavaScript -->
|
||
<script src="/static/vendor/datatables/js/jquery.dataTables.min.js"></script>
|
||
<script src="/static/vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
|
||
<script src="/static/vendor/datatables-responsive/dataTables.responsive.js"></script>
|
||
|
||
<!-- Custom Theme JavaScript -->
|
||
<script src="/static/dist/js/sb-admin-2.js"></script>
|
||
|
||
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
|
||
<script>
|
||
var getAlert = function (status, msg) {
|
||
return '<div class="alert alert-' + status + '">' + msg + '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button></div>';
|
||
};
|
||
$(document).ready(function () {
|
||
$('#dataTables-example').DataTable({
|
||
responsive: true
|
||
});
|
||
|
||
$('#edit-save').click(function () {
|
||
|
||
$.ajax({
|
||
url: '/index/record/edit',
|
||
async: false,
|
||
method: 'post',
|
||
data: {
|
||
'domain': '{$domain}',
|
||
'domain_id': $(this).attr('data-domain-id'),
|
||
'record_id': $(this).attr('data-record-id'),
|
||
'type': $('#edit-type').val(),
|
||
'record': $('#edit-record').val(),
|
||
'ttl': $('#edit-ttl').val(),
|
||
'value': $('#edit-value').val(),
|
||
'priority': $('#edit-priority').val(),
|
||
},
|
||
success: function (data) {
|
||
if (data.code == 1) {
|
||
$("#record-edit").modal('hide');
|
||
$("#myModal").modal()
|
||
$('.modal-dialog').html(getAlert('success', data.msg));
|
||
setTimeout("window.location.reload();", "3000");
|
||
}
|
||
if (data.code == 0) {
|
||
alert(data.msg);
|
||
// $('.modal-dialog').html(getAlert('danger',data.msg));
|
||
|
||
}
|
||
},
|
||
error: function (data) {
|
||
alert('ajax請求エラー');
|
||
// $('.modal-dialog').html(getAlert('danger','ajax請求エラー'));
|
||
}
|
||
});
|
||
});
|
||
|
||
$('.btn-domain-edit').click(function () {
|
||
$("#record-edit").modal();
|
||
$('#edit-record').attr('value', $(this).parent().parent().find('.record').html());
|
||
$('#edit-type').attr('value', $(this).parent().parent().find('.type').html());
|
||
$('#edit-ttl').attr('value', $(this).parent().parent().find('.ttl').html());
|
||
$('#edit-value').attr('value', $(this).parent().parent().find('.value').html());
|
||
$('#edit-priority').attr('value', $(this).parent().parent().find('.priority').html());
|
||
$('#edit-save').attr('data-domain-id', $(this).attr('data-domain-id'));
|
||
$('#edit-save').attr('data-record-id', $(this).attr('data-record-id'));
|
||
|
||
$('#edit-priority').attr("disabled", true).attr('readonly', true);
|
||
$('#edit-ttl').removeAttr("disabled").removeAttr('readonly');
|
||
|
||
if ($(this).parent().parent().find('.type').html() == "MX") {
|
||
$('#edit-priority').removeAttr("disabled").removeAttr('readonly');
|
||
$('#edit-ttl').attr("disabled", true).attr('readonly', true);
|
||
}
|
||
if ($(this).parent().parent().find('.type').html() == "NS") {
|
||
$('#edit-ttl').attr("disabled", true).attr('readonly', true);
|
||
}
|
||
// console.log($(this).parent().parent().find('.record').html());
|
||
});
|
||
|
||
$('.btn-record-add').click(function () {
|
||
$.ajax({
|
||
url: '/index/record/add',
|
||
async: false,
|
||
method: 'post',
|
||
data: {
|
||
'domain': '{$domain}',
|
||
// 'domain_id':$(this).attr('data-domain-id'),
|
||
'domain_id': '{$r_list.records.0.domain_id}',
|
||
'record': $('#input-record-name').val(),
|
||
'type': $('#input-record-type').val(),
|
||
'ttl': $('#input-record-ttl').val(),
|
||
'value': $('#input-record-value').val(),
|
||
'priority': $('#input-record-priority').val()
|
||
|
||
},
|
||
success: function (data) {
|
||
if (data.code == 1) {
|
||
$("#myModal").modal()
|
||
$('.modal-dialog').html(getAlert('success', data.msg));
|
||
setTimeout("window.location.reload();", "3000");
|
||
|
||
}
|
||
if (data.code == 0) {
|
||
alert(data.msg);
|
||
// $('.modal-dialog').html(getAlert('danger',data.msg));
|
||
|
||
}
|
||
},
|
||
error: function (data) {
|
||
alert('ajax請求エラー');
|
||
// $('.modal-dialog').html(getAlert('danger','ajax請求エラー'));
|
||
}
|
||
});
|
||
});
|
||
|
||
$('#input-record-type').change(function () {
|
||
|
||
$('#input-record-priority').attr("disabled", true).attr('readonly', true);
|
||
$('#input-record-ttl').removeAttr("disabled").removeAttr('readonly');
|
||
|
||
if ($(this).val() == 'MX') {
|
||
$('#input-record-priority').removeAttr("disabled").removeAttr('readonly');
|
||
$('#input-record-ttl').attr('disabled', true).attr('readonly', 'readonly');
|
||
}
|
||
|
||
if ($(this).val() == 'NS') {
|
||
$('#input-record-priority').attr("disabled", true).attr('readonly', true);
|
||
$('#input-record-ttl').attr('disabled', true).attr('readonly', true);
|
||
}
|
||
|
||
});
|
||
|
||
$('.btn-domain-delete').click(function () {
|
||
$.ajax({
|
||
url: '/index/record/delete',
|
||
async: false,
|
||
method: 'post',
|
||
data: {
|
||
'domain_id': $(this).attr('data-domain-id'),
|
||
'record_id': $(this).attr('data-record-id')
|
||
},
|
||
success: function (data) {
|
||
if (data.code == 1) {
|
||
$("#myModal").modal()
|
||
$('.modal-dialog').html(getAlert('success', data.msg));
|
||
setTimeout("window.location.reload();", "3000");
|
||
}
|
||
if (data.code == 0) {
|
||
alert(data.msg);
|
||
// $('.modal-dialog').html(getAlert('danger',data.msg));
|
||
|
||
}
|
||
},
|
||
error: function (data) {
|
||
alert('ajax請求エラー');
|
||
// $('.modal-dialog').html(getAlert('danger','ajax請求エラー'));
|
||
}
|
||
});
|
||
});
|
||
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
|
||
</html> |