Ejemplo n.º 1
0
 constructor: function (args) {
     if (args) {
         declare.safeMixin(this, args);
     }
     if (lang.exists("Sequence", this)) {
         this.store = new Store({
             wuid: this.Wuid,
             sequence: this.Sequence,
             isComplete: this.isComplete()
         });
     } else if (lang.exists("Name", this) && lang.exists("NodeGroup", this)) {
         this.store = new Store({
             wuid: this.Wuid,
             cluster: this.NodeGroup,
             name: this.Name,
             isComplete: true
         });
     } else {
         this.store = new Store({
             wuid: this.Wuid,
             cluster: this.Cluster,
             name: this.Name,
             isComplete: true
         });
     }
 },
Ejemplo n.º 2
0
 canShowResults: function () {
     if (lang.exists("Sequence", this)) { //  Regular WU result
         return true;
     } else if (lang.exists("RecordCount", this) && this.RecordCount !== "") { //  DFU Sprayed CSV File will fail here
         return true;
     }
     return false;
 },
Ejemplo n.º 3
0
 arrayUtil.some(item.Clusters.ClusterQueryState, function (cqs, idx) {
     if (lang.exists("Errors", cqs) && cqs.Errors || cqs.State !== "Available") {
         ErrorCount++;
         StatusMessage = context.i18n.SuspendedByCluster;
         return false;
     }
     if (lang.exists("MixedNodeStates", cqs) && cqs.MixedNodeStates === true) {
         StatusMessage = context.i18n.MixedNodeStates;
         MixedNodeStates = true;
     }
 });
Ejemplo n.º 4
0
 return this._send(service, action, params).then(function (response) {
     if (handleAs === "json") {
         if (lang.exists("Exceptions.Source", response) && !params.skipExceptions) {
             var severity = params.suppressExceptionToaster ? "Info" : "Error";
             var source = service + "." + action;
             if (lang.exists("Exceptions.Exception", response) && response.Exceptions.Exception.length === 1) {
                 switch (source) {
                     case "WsWorkunits.WUInfo":
                         if (response.Exceptions.Exception[0].Code === 20080) {
                             severity = "Info";
                         }
                         break;
                     case "WsWorkunits.WUQuery":
                         if (response.Exceptions.Exception[0].Code === 20081) {
                             severity = "Info";
                         }
                         break;
                     case "WsWorkunits.WUCDebug":
                         if (response.Exceptions.Exception[0].Code === -10) {
                             severity = "Info";
                         }
                         break;
                     case "FileSpray.GetDFUWorkunit":
                         if (response.Exceptions.Exception[0].Code === 20080) {
                             severity = "Info";
                         }
                         break;
                     case "WsDfu.DFUInfo":
                         if (response.Exceptions.Exception[0].Code === 20038) {
                             severity = "Info";
                         }
                         break;
                     case "WsWorkunits.WUUpdate":
                         if (response.Exceptions.Exception[0].Code === 20049) {
                             severity = "Error";
                         }
                         break;
                 }
             }
             topic.publish("hpcc/brToaster", {
                 Severity: severity,
                 Source: source,
                 Exceptions: response.Exceptions.Exception
             });
         }
     }
     return response;
 },
Ejemplo n.º 5
0
    preProcessRow: function (item, request, query, options) {
        var context = this;
        var ErrorCount = 0;
        var StatusMessage;
        var MixedNodeStates;
        item[this.idProperty] = item.QuerySetId + ":" + item.Id;
        if (lang.exists("Clusters", item)) {
            arrayUtil.some(item.Clusters.ClusterQueryState, function (cqs, idx) {
                if (lang.exists("Errors", cqs) && cqs.Errors || cqs.State !== "Available") {
                    ErrorCount++;
                    StatusMessage = context.i18n.SuspendedByCluster;
                    return false;
                }
                if (lang.exists("MixedNodeStates", cqs) && cqs.MixedNodeStates === true) {
                    StatusMessage = context.i18n.MixedNodeStates;
                    MixedNodeStates = true;
                }
            });
        }
        if (item.Suspended === true) {
            StatusMessage = this.i18n.SuspendedByUser;
        }

        lang.mixin(item, {
            ErrorCount: ErrorCount,
            Status: StatusMessage,
            MixedNodeStates: MixedNodeStates
        });
    }
Ejemplo n.º 6
0
 }).then(function (response) {
     if (lang.exists("WUGetGraphResponse.Graphs.ECLGraphEx", response) && response.WUGetGraphResponse.Graphs.ECLGraphEx.length) {
         if (subGraphId) {
             if (!context.subgraphs) {
                 context.subgraphs = {};
             }
             if (!context.subgraphs[idx + "." + subGraphId]) {
                 context.subgraphs[idx + "." + subGraphId] = {};
             }
             context.subgraphs[idx + "." + subGraphId].xgmml = "<graph>" + response.WUGetGraphResponse.Graphs.ECLGraphEx[0].Graph + "</graph>";
             onFetchGraphXgmml(context.subgraphs[idx + "." + subGraphId].xgmml, context.subgraphs[idx + "." + subGraphId].svg);
         } else {
             context.graphs[idx].xgmml = response.WUGetGraphResponse.Graphs.ECLGraphEx[0].Graph;
             onFetchGraphXgmml(context.graphs[idx].xgmml, context.graphs[idx].svg);
         }
     } else {
         topic.publish("hpcc/brToaster", {
             Severity: "Error",
             Source: "ESPWorkunit.fetchGraphXgmml",
             Exceptions: [
                 { Message: context.i18n.FetchingXGMMLFailed }
             ]
         });
         onFetchGraphXgmml("", "");
     }
 });
Ejemplo n.º 7
0
 _TpEclAgentsSetter: function (TpEclAgents) {
     if (lang.exists("TpEclAgent", TpEclAgents)) {
         arrayUtil.forEach(TpEclAgents.TpEclAgent, function (item, idx) {
             this.appendChild(createTreeItem(TpEclAgent, item.Name, this, item));
         }, this);
     }
 },
Ejemplo n.º 8
0
 }).then(function (response) {
     var newRows = [];
     if (lang.exists("DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File", response)) {
         var results = response.DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File
         if (results.length) {
             arrayUtil.forEach(results, function (row, idx) {
                 newRows.push({
                     Name: row.Partmask,
                     Modified: row.Modified,
                     PartsFound: row.Partsfound,
                     TotalParts: row.Numparts,
                     Size: row.Size
                 });
             });
         } else if (results.Partmask) {
             newRows.push({
                 Name: results.Partmask,
                 Modified: results.Modified,
                 PartsFound: results.Partsfound,
                 TotalParts: results.Numparts,
                 Size: results.Size
             });
         }
     }
     return newRows;
 });
Ejemplo n.º 9
0
 }).then(function (response) {
     var retVal = [];
     if (lang.exists("TpServiceQueryResponse.ServiceList", response)) {
         retVal.push(createTreeItem(Services, "Services", context.rootItem, response.TpServiceQueryResponse.ServiceList));
     }
     return retVal;
 })
Ejemplo n.º 10
0
        load: function (response) {
            if (lang.exists("WUActionResponse.ActionResults.WUActionResult", response)) {
                var wuMap = {};
                arrayUtil.forEach(workunits, function (item, index) {
                    wuMap[item.Wuid] = item;
                });
                arrayUtil.forEach(response.WUActionResponse.ActionResults.WUActionResult, function (item, index) {
                    if (item.Result.indexOf("Failed:") === 0) {
                        topic.publish("hpcc/brToaster", {
                            Severity: "Error",
                            Source: "WsWorkunits.WUAction",
                            Exceptions: [{ Source: item.Action + " " + item.Wuid, Message: item.Result }]
                        });
                    } else {
                        var wu = wuMap[item.Wuid];
                        if (actionType === "delete" && item.Result === "Success") {
                            wu.set("StateID", 999);
                            wu.set("State", "not found");
                        } else if (wu.refresh) {
                            wu.refresh();
                        }
                    }
                });
            }

            if (callback && callback.load) {
                callback.load(response);
            }
        },