[PATCH] [Kimchi] Added cursor for tasks in progress

From: Samuel Guimarães <sguimaraes943@gmail.com> This patch updates kimchi.trackTask() progress callback to add a css class and change mouse cursor to "progress" instead of the default mouse pointer. It requires a patch sent to Wok. Samuel Guimarães (1): Added cursor for tasks in progress ui/js/src/kimchi.api.js | 4 ++++ 1 file changed, 4 insertions(+) -- 1.9.3

From: Samuel Guimarães <sguimaraes943@gmail.com> Signed-off-by: Samuel Guimarães <sguimaraes943@gmail.com> --- ui/js/src/kimchi.api.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js index ce93d7d..740d922 100644 --- a/ui/js/src/kimchi.api.js +++ b/ui/js/src/kimchi.api.js @@ -532,18 +532,22 @@ var kimchi = { var taskStatus = result['status']; switch(taskStatus) { case 'running': + $('html').addClass('in-progress'); progress && progress(result); setTimeout(function() { kimchi.trackTask(taskID, suc, err, progress); }, 2000); break; case 'finished': + $('html').removeClass('in-progress'); suc && suc(result); break; case 'failed': + $('html').removeClass('in-progress'); err && err(result); break; default: + $('html').removeClass('in-progress'); break; } }; -- 1.9.3

Although, I agree with this patch it will not be enough to close the issue https://github.com/kimchi-project/kimchi/issues/966 Some requests which do not rely on Tasks may take some time (from reach the server and get the response and it will depend on network throughput) to be completed. So we need to cover them too. On 07/19/2016 10:36 AM, sguimaraes943@gmail.com wrote:
From: Samuel Guimarães <sguimaraes943@gmail.com>
This patch updates kimchi.trackTask() progress callback to add a css class and change mouse cursor to "progress" instead of the default mouse pointer. It requires a patch sent to Wok.
Samuel Guimarães (1): Added cursor for tasks in progress
ui/js/src/kimchi.api.js | 4 ++++ 1 file changed, 4 insertions(+)

Yes but this will require different approaches and solutions to fix this for all screens. I've tried manually adding it to Guests list when creating, cloning or migrating a VM and it didn't work because of the timeout refresh interval, the mouse cursor would show "in progress" after the task was finished and not immediately after I've clicked the button. In some cases I think this cursor is redundant for instance when a Loading message is already displayed on the screen. The mouse cursor is not a reliable UI indicator because the browser can still override it and the user may rely on keyboard navigation and hide the mouse. I think we should show a JS alert when the user attempts to close the window/tab when a task is running (like when you start writing a post on Facebook and closes the window before posting it) and maybe display a progress bar on top of the navigation bar like this: http://onextrapixel.com/examples/youtube-like-ajax-loading-bar/index.html and http://github.hubspot.com/pace/docs/welcome/ Using these JS plugins however may not be a wise idea because they would trigger the progress bar for every ajax request/response, including the notifications. PACE plugin does have a parameter to ignore some requests but I'm not sure how flexible it can be. Samuel -----Original Message----- From: kimchi-devel-bounces@ovirt.org [mailto:kimchi-devel-bounces@ovirt.org] On Behalf Of Aline Manera Sent: quinta-feira, 21 de julho de 2016 15:28 To: sguimaraes943@gmail.com; Kimchi Devel <kimchi-devel@ovirt.org> Subject: Re: [Kimchi-devel] [PATCH] [Kimchi] Added cursor for tasks in progress Although, I agree with this patch it will not be enough to close the issue https://github.com/kimchi-project/kimchi/issues/966 Some requests which do not rely on Tasks may take some time (from reach the server and get the response and it will depend on network throughput) to be completed. So we need to cover them too. On 07/19/2016 10:36 AM, sguimaraes943@gmail.com wrote:
From: Samuel Guimarães <sguimaraes943@gmail.com>
This patch updates kimchi.trackTask() progress callback to add a css class and change mouse cursor to "progress" instead of the default mouse pointer. It requires a patch sent to Wok.
Samuel Guimarães (1): Added cursor for tasks in progress
ui/js/src/kimchi.api.js | 4 ++++ 1 file changed, 4 insertions(+)
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Applied. Thanks. Regards, Aline Manera
participants (3)
-
Aline Manera
-
Samuel Henrique De Oliveira Guimaraes
-
sguimaraes943@gmail.com