mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Display errors in red.
This commit is contained in:
@@ -1100,9 +1100,9 @@ GuacUI.Client.attach = function(guac) {
|
||||
var offset = 0;
|
||||
|
||||
// Invalidate stream on all errors
|
||||
stream.onerror = function() {
|
||||
stream.onerror = function(text, code) {
|
||||
valid = false;
|
||||
// TODO: Update notification with error status
|
||||
upload.showError(text);
|
||||
};
|
||||
|
||||
// Continue upload when acknowledged
|
||||
@@ -1133,6 +1133,12 @@ GuacUI.Client.attach = function(guac) {
|
||||
|
||||
};
|
||||
|
||||
// Close dialog and abort when close is clicked
|
||||
upload.onclose = function() {
|
||||
GuacUI.Client.notification_area.removeChild(upload.getElement());
|
||||
// TODO: Abort transfer
|
||||
};
|
||||
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
|
||||
|
@@ -750,6 +750,22 @@ GuacUI.Download = function(filename) {
|
||||
progress.textContent = text;
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the content of the dialog to reflect an error condition
|
||||
* represented by the given text.
|
||||
*
|
||||
* @param {String} text A human-readable description of the error.
|
||||
*/
|
||||
this.showError = function(text) {
|
||||
|
||||
element.removeChild(progress);
|
||||
GuacUI.addClass(element, "error");
|
||||
|
||||
var status = GuacUI.createChildElement(element, "div", "status");
|
||||
status.textContent = text;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the progress indicator and replaces it with a download button.
|
||||
*/
|
||||
@@ -845,6 +861,22 @@ GuacUI.Upload = function(filename) {
|
||||
progress.textContent = text;
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the content of the dialog to reflect an error condition
|
||||
* represented by the given text.
|
||||
*
|
||||
* @param {String} text A human-readable description of the error.
|
||||
*/
|
||||
this.showError = function(text) {
|
||||
|
||||
element.removeChild(progress);
|
||||
GuacUI.addClass(element, "error");
|
||||
|
||||
var status = GuacUI.createChildElement(element, "div", "status");
|
||||
status.textContent = text;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the element representing this notification.
|
||||
*/
|
||||
|
@@ -369,6 +369,13 @@ p.hint {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.upload.notification .status,
|
||||
.download.notification .status {
|
||||
color: red;
|
||||
font-size: 1em;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.download.notification .progress,
|
||||
.upload.notification .progress,
|
||||
.download.notification .download,
|
||||
|
Reference in New Issue
Block a user