mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
WebUI: make error messages user dismissible
Fixes #1171 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -28,12 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
{{define "page_body"}}
|
||||
|
||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
||||
</div>
|
||||
|
||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||
<div id="successTxt" class="card-body"></div>
|
||||
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||
<span id="errorTxt"></span>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="card shadow mb-4">
|
||||
@@ -130,6 +129,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
var username = table.row({ selected: true }).data()[1];
|
||||
var path = '{{.AdminURL}}' + "/" + fixedEncodeURIComponent(username);
|
||||
$('#deleteModal').modal('hide');
|
||||
$('#errorMsg').hide();
|
||||
$.ajax({
|
||||
url: path,
|
||||
type: 'DELETE',
|
||||
@@ -153,9 +153,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
}
|
||||
$('#errorTxt').text(txt);
|
||||
$('#errorMsg').show();
|
||||
setTimeout(function () {
|
||||
$('#errorMsg').hide();
|
||||
}, 5000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user