Explorar el Código

Merge pull request #5789 from GordonSmith/HPCC-11206

HPCC-11206 Add graph link to activities page

Reviewed-By: Kevin Wang <kevin.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman hace 11 años
padre
commit
43d57635d7
Se han modificado 2 ficheros con 39 adiciones y 4 borrados
  1. 37 2
      esp/src/eclwatch/ActivityWidget.js
  2. 2 2
      esp/src/eclwatch/GridDetailsWidget.js

+ 37 - 2
esp/src/eclwatch/ActivityWidget.js

@@ -299,7 +299,15 @@ define([
                             return "<img src='" + img + "'/>&nbsp;<a href='#' class='" + context.id + "RowClick'>" + name + "</a>";
                         }
                     }),
-                    DisplaySize: { label: this.i18n.Size, width: 59, sortable: true },
+                    GID: {
+                        label: this.i18n.Graph, width: 90, sortable: true,
+                        formatter: function (_gid, row) {
+                            if (context.activity.isInstanceOfWorkunit(row)) {
+                                return "<a href='#' class='" + context.id + "GraphClick'>" + row.GraphName + "-" + row.GID + "</a>";
+                            }
+                            return "";
+                        }
+                    },
                     State: {
                         label: this.i18n.State,
                         sortable: false,
@@ -333,9 +341,21 @@ define([
             on(document, "." + this.id + "RowClick:click", function (evt) {
                 if (context._onRowDblClick) {
                     var row = retVal.row(evt).data;
-                    context._onRowDblClick(row);
+                    context._onRowDblClick(row, {
+                        OpenMode: "WU"
+                    });
+                }
+            });
+
+            on(document, "." + this.id + "GraphClick:click", function (evt) {
+                if (context._onRowDblClick) {
+                    var row = retVal.row(evt).data;
+                    context._onRowDblClick(row, {
+                        OpenMode: "Graph"
+                    });
                 }
             });
+
             return retVal;
         },
 
@@ -353,6 +373,21 @@ define([
                     }
                 });
             } else if (this.activity.isInstanceOfWorkunit(row)) {
+                if (lang.exists("OpenMode", params) && params.OpenMode === "Graph") {
+                    return new DelayLoadWidget({
+                        id: id,
+                        title: row.GraphName,
+                        closable: true,
+                        delayWidget: "GraphPageWidget",
+                        hpcc: {
+                            params: {
+                                Wuid: row.Wuid,
+                                GraphName: row.GraphName,
+                                SubGraphId: row.GID
+                            }
+                        }
+                    });
+                }
                 if (row.Server === "DFUserver") {
                     return new DelayLoadWidget({
                         id: id,

+ 2 - 2
esp/src/eclwatch/GridDetailsWidget.js

@@ -87,8 +87,8 @@ define([
             }
         },
 
-        _onRowDblClick: function (row) {
-            var tab = this.ensurePane(row);
+        _onRowDblClick: function (row, params) {
+            var tab = this.ensurePane(row, params);
             if (tab) {
                 this.selectChild(tab);
             }