[ 
https://issues.apache.org/jira/browse/YARN-9836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16932273#comment-16932273
 ] 

Gergely Pollak commented on YARN-9836:
--------------------------------------

Hi Adam thank you for the patch!

Since you are using jQuery, the following line (108)
{code:java}
document.getElementById('error-div').style.display = "none";{code}
should be substituted by: 
{code:java}
$("#error-div").css("display", "none"){code}
It's better to use a consistent method for DOM manipulation if possible.

The for loop (line 111) for calling jquery multiple times is a bit inefficient, 
it would be the best to add a common class for all divs, and use a jquery class 
selector eg $(".areaCls").empty();

With the current structure you can use (this is supposed to select and empty 
all divs having id beginning with 'area' and are inside an element with 'row' 
class):
{code:java}
$(".row div[id^='area']").empty();{code}
It's better to use a bit more complex jQuery selectors than repeating the same 
simple one in a for loop, because each invocation will start a DOM scan.

If possible please change the alert error message on line 117 to the new much 
more sophisticated error display solution.

 

> General usability improvements in showSimulationTrace.html
> ----------------------------------------------------------
>
>                 Key: YARN-9836
>                 URL: https://issues.apache.org/jira/browse/YARN-9836
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: scheduler-load-simulator
>    Affects Versions: 3.3.0
>            Reporter: Adam Antal
>            Assignee: Adam Antal
>            Priority: Minor
>         Attachments: YARN-9836.001.patch
>
>
> There are some small usability improvements that can be made for the offline 
> analysis page (showSimulationTrace.html):
> - empty divs can be hidden until no data is displayed
> - the site can be refactored to be responsive given that bootstrap is already 
> available as third party library
> - there's no proper error handling in the site (e.g. a JSON is malformed and 
> similar cases) which is really a big problem
> - there's no indentation in the raw html file which makes supportability even 
> worse



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to