refactor(xxl-job-admin):重构管理员界面代码

- 修改 JobApiController 包名从 biz 到 openapi
- 优化 common.1.js 中的代码结构,增加模块化
- 调整 jobgroup.index.1.js 中的表格布局
- 移动 common.macro.ftl 中的初始化代码到 common.1.js
-
3.2.0-release
xuxueli 4 weeks ago
parent c5d514bc48
commit ed0d65ab47

@ -1,4 +1,4 @@
package com.xxl.job.admin.controller.biz;
package com.xxl.job.admin.controller.openapi;
import com.xxl.job.admin.scheduler.conf.XxlJobAdminConfig;
import com.xxl.job.core.biz.AdminBiz;

@ -1,5 +1,8 @@
$(function(){
// ---------------------- logout ----------------------
// logout
$("#logoutBtn").click(function(){
layer.confirm( I18n.logout_confirm , {
@ -28,6 +31,9 @@ $(function(){
});
// ---------------------- update pwd ----------------------
// update pwd
$('#updatePwd').on('click', function(){
$('#updatePwdModal').modal({backdrop: false, keyboard: false}).modal('show');
@ -99,6 +105,9 @@ $(function(){
$("#updatePwdModal .form .form-group").removeClass("has-error");
});
// ---------------------- slideToTop ----------------------
// slideToTop
var slideToTop = $("<div />");
slideToTop.html('<i class="fa fa-chevron-up"></i>');
@ -142,9 +151,27 @@ $(function(){
});
// ---------------------- body fixed ----------------------
// init body fixed
$('body').addClass('fixed');
// ---------------------- menu, sidebar-toggle ----------------------
// init menu speed
$('.sidebar-menu').attr('data-animation-speed', 1); // default 300ms
// init menu status
if ( 'close' === $.cookie('sidebar_status') ) {
$('body').addClass('sidebar-collapse');
} else {
$('body').removeClass('sidebar-collapse');
}
// change menu status
$('.sidebar-toggle').click(function(){
if ( 'close' == $.cookie('sidebar_status') ) {
if ( 'close' === $.cookie('sidebar_status') ) {
$.cookie('sidebar_status', 'open', { expires: 7 });
} else {
$.cookie('sidebar_status', 'close', { expires: 7 }); //$.cookie('the_cookie', '', { expires: -1 });

@ -140,8 +140,8 @@ $(function() {
var html = '<table class="table table-bordered"><tbody>';
if (row.registryList) {
for (var index in row.registryList) {
html += '<tr><th>' + (parseInt(index)+1) + '</th>';
html += '<th><span class="badge bg-green" >' + row.registryList[index] + '</span></th><tr>';
html += '<tr><th class="col-md-3" >' + (parseInt(index)+1) + '</th>';
html += '<th class="col-md-9" ><span class="badge bg-green" >' + row.registryList[index] + '</span></th><tr>';
}
}
html += '</tbody></table>';

@ -61,17 +61,6 @@
<script>
var base_url = '${request.contextPath}';
var I18n = ${I18nUtil.getMultString()};
// init menu status
if ( 'close' == $.cookie('sidebar_status') ) {
$('body').addClass('sidebar-collapse');
} else {
$('body').removeClass('sidebar-collapse');
}
// init body fixed
$('body').addClass('fixed');
// init menu speed
$('.sidebar-menu').attr('data-animation-speed', 1);
</script>
<!-- AdminLTE App -->

@ -87,7 +87,7 @@
<!-- . -->
<div class="modal fade" id="showRegistryListModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" >${I18n.jobinfo_opt_registryinfo}</h4>

@ -55,7 +55,7 @@
<input type="text" class="form-control" id="username" autocomplete="on" >
</div>
</div>
<div class="col-xs-1">
<div class="col-xs-2">
<button class="btn btn-block btn-info" id="searchBtn">${I18n.system_search}</button>
</div>
<div class="col-xs-2">

Loading…
Cancel
Save