mirror of
https://github.com/kokororin/typecho-plugin-Access.git
synced 2025-03-14 03:40:21 +08:00
feat: optimize migration page style
This commit is contained in:
parent
2111c388da
commit
bbd6f043f0
@ -5,3 +5,34 @@
|
||||
.typecho-access-migration-summary {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.typecho-access-migration-btn {
|
||||
border: none;
|
||||
background-color: #b94a48;
|
||||
cursor: pointer;
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
padding: 0 12px;
|
||||
height: 32px;
|
||||
vertical-align: middle;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.typecho-access-migration-btn:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.typecho-access-migration-btn:hover {
|
||||
transition-duration: 0.4s;
|
||||
background-color: #a4403f;
|
||||
}
|
||||
|
||||
.typecho-access-migration-btn:active {
|
||||
background-color: #9c3e3c;
|
||||
}
|
||||
|
||||
.typecho-access-migration-btn:disabled {
|
||||
background-color: #c1605e;
|
||||
cursor: default;
|
||||
}
|
||||
|
@ -9,6 +9,11 @@ $(document).ready(function () {
|
||||
success: function (res) {
|
||||
if (res.code === 0) {
|
||||
if (res.data.remain === 0) {
|
||||
swal({
|
||||
icon: "success",
|
||||
title: "完成",
|
||||
text: "旧版数据迁移完成!",
|
||||
});
|
||||
$('body').loadingModal('hide');
|
||||
} else {
|
||||
$('body').loadingModal('text', '迁移中,剩余' + res.data.remain + '条等待迁移...');
|
||||
@ -17,11 +22,33 @@ $(document).ready(function () {
|
||||
$('#ancient-logs-count').text(res.data.remain);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
if (!silent) {
|
||||
$('.typecho-access-logs-main').loadingModal('hide');
|
||||
}
|
||||
swal({
|
||||
icon: "error",
|
||||
title: "错误",
|
||||
text: "请求错误 code: " + xhr.status,
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
$('[data-action="migrate"]').click(function() {
|
||||
start();
|
||||
swal({
|
||||
title: "确定进行旧版数据迁移?",
|
||||
text: "\n1. 每次迁移1000条,自动重复直到完全迁移完成。\n2. 可随时通过关闭页面中断迁移。\n3. 迁移中断后下次将从中断处继续迁移。\n4. 请勿同时打开多个页面点击迁移,否则会导致数据重复。",
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: "算啦",
|
||||
confirm: "是的",
|
||||
},
|
||||
}).then((value) => {
|
||||
if (value === true) {
|
||||
start();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
|
@ -4,14 +4,12 @@
|
||||
<link rel="stylesheet" href="<?php $options->pluginUrl('Access/page/routes/migration/index.css')?>">
|
||||
<script defer src="<?php $options->pluginUrl('Access/page/routes/migration/index.js')?>"></script>
|
||||
|
||||
<div class="col-mb-12">
|
||||
<div class="typecho-access-migration-main">
|
||||
<div class="typecho-access-migration-summary">
|
||||
<span>存在历史数据:</span>
|
||||
<span id="ancient-logs-count">loading</span>
|
||||
<span>条</span>
|
||||
</div>
|
||||
|
||||
<button data-action="migrate" type="button" class="btn btn-m primary"><?php _e('开始迁移'); ?></button>
|
||||
<div class="typecho-access-migration-main">
|
||||
<div class="typecho-access-migration-summary">
|
||||
<span>存在历史数据:</span>
|
||||
<span id="ancient-logs-count">loading</span>
|
||||
<span>条</span>
|
||||
</div>
|
||||
|
||||
<button data-action="migrate" type="button" class="typecho-access-migration-btn"><?php _e('开始迁移'); ?></button>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user