|
|
@ -27721,6 +27721,7 @@ $(document).on('turbolinks:load', function(){
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
if ($('body.admins-identity-authentications-index-page').length > 0) {
|
|
|
|
if ($('body.admins-identity-authentications-index-page').length > 0) {
|
|
|
|
var $searchFrom = $('.identity-authentication-list-form');
|
|
|
|
var $searchFrom = $('.identity-authentication-list-form');
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
|
|
|
|
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
var $link = $(this);
|
|
|
|
var $link = $(this);
|
|
|
@ -27732,14 +27733,160 @@ $(document).on('turbolinks:load', function() {
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
|
|
|
|
if ($('body.admins-mirror-repositories-edit-page, body.admins-mirror-repositories-update-page').length > 0) {
|
|
|
|
|
|
|
|
var $form = $('form.edit-mirror');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form.validate({
|
|
|
|
|
|
|
|
errorElement: 'span',
|
|
|
|
|
|
|
|
errorClass: 'danger text-danger',
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
"mirror_repository[type_name]": {
|
|
|
|
|
|
|
|
required: true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form.submit(function(e){
|
|
|
|
|
|
|
|
if(!$form.valid()){ e.preventDefault(); }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
|
|
|
|
if ($('body.admins-mirror-repositories-index-page').length > 0) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
|
|
|
|
$('.admin-modal-container').on('show.bs.modal', '.modal.admin-choose-mirror-modal', function(){
|
|
|
|
|
|
|
|
var $modal = $('.modal.admin-choose-mirror-modal');
|
|
|
|
|
|
|
|
var $form = $modal.find('form.admin-choose-mirror-form');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var validateForm = function(){
|
|
|
|
|
|
|
|
var checkedValue = $form.find('input[name="mirror_number"]:checked').val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(checkedValue == undefined){
|
|
|
|
|
|
|
|
$modal.find('.error').html('必须选择一种镜像保存!');
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$modal.on('click', '.submit-btn', function(){
|
|
|
|
|
|
|
|
$form.find('.error').html('');
|
|
|
|
|
|
|
|
var url = $form.attr('action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (validateForm()) {
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
method: 'POST',
|
|
|
|
|
|
|
|
dataType: 'script',
|
|
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
|
|
data: $form.serialize(),
|
|
|
|
|
|
|
|
}).done(function(){
|
|
|
|
|
|
|
|
$modal.modal('hide');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
|
|
|
|
var $modal = $('.modal.admin-replace-mirror-modal');
|
|
|
|
|
|
|
|
if ($modal.length > 0) {
|
|
|
|
|
|
|
|
var $form = $modal.find('form.admin-replace-mirror-form');
|
|
|
|
|
|
|
|
var $mirrorIdInput = $modal.find('.modal-body input[name="mirror_id"]');
|
|
|
|
|
|
|
|
var $mirrorSelect = $modal.find('.new-mirror-select');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var setMirror = function(id, name){
|
|
|
|
|
|
|
|
$mirrorIdInput.val(id);
|
|
|
|
|
|
|
|
$form.find('.mirror-id-container').html(id);
|
|
|
|
|
|
|
|
$form.find('.mirror-name-container').html(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form.validate({
|
|
|
|
|
|
|
|
errorElement: 'span',
|
|
|
|
|
|
|
|
errorClass: 'danger text-danger',
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
new_mirror_id: {
|
|
|
|
|
|
|
|
required: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
messages: {
|
|
|
|
|
|
|
|
new_mirror_id: {
|
|
|
|
|
|
|
|
required: '请选择新镜像'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// modal ready fire
|
|
|
|
|
|
|
|
$modal.on('show.bs.modal', function (event) {
|
|
|
|
|
|
|
|
var $link = $(event.relatedTarget);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mirrorId = $link.data('id');
|
|
|
|
|
|
|
|
var mirrorName = $link.data('name');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setMirror(mirrorId, mirrorName);
|
|
|
|
|
|
|
|
$mirrorSelect.select2('val', ' ');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$modal.on('hide.bs.modal', function () {
|
|
|
|
|
|
|
|
setMirror('', '');
|
|
|
|
|
|
|
|
$mirrorSelect.select2('val', ' ');
|
|
|
|
|
|
|
|
$('#new_mirror_id-error').remove();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$mirrorSelect.select2({
|
|
|
|
|
|
|
|
theme: 'bootstrap4',
|
|
|
|
|
|
|
|
placeholder: '输入要合并的镜像名',
|
|
|
|
|
|
|
|
minimumInputLength: 1,
|
|
|
|
|
|
|
|
ajax: {
|
|
|
|
|
|
|
|
url: '/admins/mirror_repositories/for_select',
|
|
|
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
|
|
|
data: function(params){
|
|
|
|
|
|
|
|
return { keyword: params.term };
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
processResults: function(data){
|
|
|
|
|
|
|
|
return { results: data.mirrors }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
templateResult: function (item) {
|
|
|
|
|
|
|
|
if(!item.id || item.id === '') return item.text;
|
|
|
|
|
|
|
|
return item.name;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
templateSelection: function(item){
|
|
|
|
|
|
|
|
if (item.id) {
|
|
|
|
|
|
|
|
$('#new_mirror_id-error').remove();
|
|
|
|
|
|
|
|
$('#new_mirror_id').val(item.id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return item.name || item.text;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$modal.on('click', '.submit-btn', function(){
|
|
|
|
|
|
|
|
$form.find('.error').html('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($form.valid()) {
|
|
|
|
|
|
|
|
var url = $form.data('url');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
method: 'POST',
|
|
|
|
|
|
|
|
dataType: 'script',
|
|
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
|
|
data: $form.serialize(),
|
|
|
|
|
|
|
|
}).done(function(){
|
|
|
|
|
|
|
|
$modal.modal('hide');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
if ($('body.admins-professional-authentications-index-page').length > 0) {
|
|
|
|
if ($('body.admins-professional-authentications-index-page').length > 0) {
|
|
|
|
var $searchFrom = $('.professional-authentication-list-form');
|
|
|
|
var $searchFrom = $('.professional-authentication-list-form');
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
|
|
|
|
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
var $link = $(this);
|
|
|
|
var $link = $(this);
|
|
|
@ -27751,6 +27898,7 @@ $(document).on('turbolinks:load', function() {
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -27905,6 +28053,7 @@ $(document).on('turbolinks:load', function() {
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
if ($('body.admins-shixun-authorizations-index-page').length > 0) {
|
|
|
|
if ($('body.admins-shixun-authorizations-index-page').length > 0) {
|
|
|
|
var $searchFrom = $('.shixun-authorization-list-form');
|
|
|
|
var $searchFrom = $('.shixun-authorization-list-form');
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
|
|
|
|
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
var $link = $(this);
|
|
|
|
var $link = $(this);
|
|
|
@ -27916,6 +28065,7 @@ $(document).on('turbolinks:load', function() {
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -27940,6 +28090,7 @@ $(document).on('turbolinks:load', function(){
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
if ($('body.admins-subject-authorizations-index-page').length > 0) {
|
|
|
|
if ($('body.admins-subject-authorizations-index-page').length > 0) {
|
|
|
|
var $searchFrom = $('.subject-authorization-list-form');
|
|
|
|
var $searchFrom = $('.subject-authorization-list-form');
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
|
|
|
|
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
$searchFrom.on('click', '.search-form-tab', function(){
|
|
|
|
var $link = $(this);
|
|
|
|
var $link = $(this);
|
|
|
@ -27951,6 +28102,7 @@ $(document).on('turbolinks:load', function() {
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
$searchFrom.find('.status-filter').show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
$searchFrom.find('.status-filter').hide();
|
|
|
|
|
|
|
|
$searchFrom.find('select[name="status"]').val('pending');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -28267,8 +28419,11 @@ $(document).on('turbolinks:load', function(){
|
|
|
|
// flash alert提示框自动关闭
|
|
|
|
// flash alert提示框自动关闭
|
|
|
|
if($('.admin-alert-container .alert').length > 0){
|
|
|
|
if($('.admin-alert-container .alert').length > 0){
|
|
|
|
setTimeout(function(){
|
|
|
|
setTimeout(function(){
|
|
|
|
$('.admin-alert-container .alert').alert('close');
|
|
|
|
$('.admin-alert-container .alert:not(.alert-danger)').alert('close');
|
|
|
|
}, 2000);
|
|
|
|
}, 2000);
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
|
|
|
$('.admin-alert-container .alert.alert-danger').alert('close');
|
|
|
|
|
|
|
|
}, 5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|