mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
change js
This commit is contained in:
@@ -12,9 +12,14 @@ function ExportHrd(station_id) {
|
||||
url: base_url + 'index.php/hrdlog/upload_station',
|
||||
type: 'post',
|
||||
data: {'station_id': station_id},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
|
||||
//modify running state
|
||||
$(".ld-ext-right-"+station_id).removeClass('running');
|
||||
$(".ld-ext-right-"+station_id).prop('disabled', false);
|
||||
|
||||
//react to success
|
||||
if (data.status == 'OK') {
|
||||
$.each(data.info, function(index, value){
|
||||
$('#modcount'+value.station_id).html(value.modcount);
|
||||
@@ -22,29 +27,39 @@ function ExportHrd(station_id) {
|
||||
$('#totcount'+value.station_id).html(value.totcount);
|
||||
});
|
||||
$(".card-body").append('<div class="alert alert-success" role="alert">' + data.infomessage + '</div>');
|
||||
}
|
||||
else {
|
||||
$(".card-body").append('<div class="alert alert-info" role="alert">' + data.info + '</div>');
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.errormessages.length > 0) {
|
||||
$("#hrdlog_export").append(
|
||||
'<div class="errormessages">\n' +
|
||||
' <div class="card mt-2">\n' +
|
||||
' <div class="card-header bg-danger">\n' +
|
||||
' Error Message\n' +
|
||||
' </div>\n' +
|
||||
' <div class="card-body">\n' +
|
||||
' <div class="errors"></div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
'</div>'
|
||||
);
|
||||
$.each(data.errormessages, function (index, value) {
|
||||
$(".errors").append('<li>' + value);
|
||||
});
|
||||
//react to errors during upload
|
||||
if (data.status == 'Error') {
|
||||
$(".card-body").append('<div class="alert alert-info" role="alert">' + data.info + '</div>');
|
||||
|
||||
if (data.errormessages.length > 0) {
|
||||
$("#hrdlog_export").append(
|
||||
'<div class="errormessages">\n' +
|
||||
' <div class="card mt-2">\n' +
|
||||
' <div class="card-header bg-danger">\n' +
|
||||
' Error Message\n' +
|
||||
' </div>\n' +
|
||||
' <div class="card-body">\n' +
|
||||
' <div class="errors"></div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
'</div>'
|
||||
);
|
||||
$.each(data.errormessages, function (index, value) {
|
||||
$(".errors").append('<li>' + value);
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//react to errors due to credentials or disabled upload
|
||||
if (data.status == 'Credential_Error'){
|
||||
$(".card-body").append('<div class="alert alert-danger" role="alert">' + data.infomessage + '</div>');
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user