This is an automated email from the ASF dual-hosted git repository.

sarutak pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 72db575  [SPARK-35127][UI] When we switch between different 
stage-detail pages, the entry item in the newly-opened page may be blank
72db575 is described below

commit 72db575bbf654e7ddc515a63cb5b76647c71b6c9
Author: kyoty <echoh...@gmail.com>
AuthorDate: Thu Apr 22 21:00:04 2021 +0900

    [SPARK-35127][UI] When we switch between different stage-detail pages, the 
entry item in the newly-opened page may be blank
    
    ### What changes were proposed in this pull request?
    
    To make sure that pageSize shoud not be shared between different stage 
pages.
    The screenshots of the problem are placed in the attachment of 
[JIRA](https://issues.apache.org/jira/browse/SPARK-35127)
    
    ### Why are the changes needed?
    fix the bug.
    
    according to reference:`https://datatables.net/reference/option/lengthMenu`
    `-1` represents display all rows, but now we use `totalTasksToShow`, it 
will cause the select item show as empty when we swich between different 
stage-detail pages.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    manual test, it is a small io problem, and the modification does not affect 
the function, but just an adjustment of js configuration
    
    the gif below shows how the problem can be reproduced:
    
![reproduce](https://user-images.githubusercontent.com/52202080/115204351-f7060f80-a12a-11eb-8900-a009ad0c8870.gif)
    
    
![微信截图_20210419162849](https://user-images.githubusercontent.com/52202080/115205675-629cac80-a12c-11eb-9cb8-1939c7450e99.png)
    
    the gif below shows the result after modified:
    
    
![after_modified](https://user-images.githubusercontent.com/52202080/115204886-91fee980-a12b-11eb-9ccb-d5900a99095d.gif)
    
    Closes #32223 from kyoty/stages-task-empty-pagesize.
    
    Authored-by: kyoty <echoh...@gmail.com>
    Signed-off-by: Kousuke Saruta <saru...@oss.nttdata.com>
    (cherry picked from commit 7242d7f774b821cbcb564c8afeddecaf6664d159)
    Signed-off-by: Kousuke Saruta <saru...@oss.nttdata.com>
---
 core/src/main/resources/org/apache/spark/ui/static/stagepage.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js 
b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
index 400b70f..674bb86 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js
@@ -621,7 +621,7 @@ $(document).ready(function () {
                     "paging": true,
                     "info": true,
                     "processing": true,
-                    "lengthMenu": [[20, 40, 60, 100, totalTasksToShow], [20, 
40, 60, 100, "All"]],
+                    "lengthMenu": [[20, 40, 60, 100, -1], [20, 40, 60, 100, 
"All"]],
                     "orderMulti": false,
                     "bAutoWidth": false,
                     "ajax": {
@@ -637,6 +637,9 @@ $(document).ready(function () {
                             data.numTasks = totalTasksToShow;
                             data.columnIndexToSort = columnIndexToSort;
                             data.columnNameToSort = columnNameToSort;
+                            if (data.length === -1) {
+                                data.length = totalTasksToShow;
+                            }
                         },
                         "dataSrc": function (jsons) {
                             var jsonStr = JSON.stringify(jsons);

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to