Skip to content

Commit

Permalink
Merge branch 'candidate-7.0.x' into candidate-7.2.x
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chapman <[email protected]>
  • Loading branch information
richardkchapman committed Apr 25, 2019
2 parents 3104db5 + d6e7d55 commit a381717
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 165 deletions.
4 changes: 2 additions & 2 deletions esp/src/eclwatch/DFUQueryWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,8 @@ define([
IntSize: {
label: this.i18n.Size, width: 100,
formatter: function (intsize, row) {
if (intsize === null) {
return "0 Bytes";
if (intsize === null || intsize === undefined) {
return 0;
} else {
return Utility.convertedSize(intsize);
}
Expand Down
20 changes: 10 additions & 10 deletions esp/src/eclwatch/PackageMapPartsWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ define([
this.addPartsDropDown.placeAt(this.openButton.domNode, "after");
this.addPartsDropDown.filterForm.set("style", "width:600px;");
this.addPartsDropDown.filterDropDown.set("label", context.i18n.Add);
this.addPartsPartName = this.createLabelAndElement("PartName", this.i18n.PartName, "ValidationTextBox", this.i18n.PartName);
this.addPartsContent = this.createLabelAndElement("Content", this.i18n.Content, "Textarea", this.i18n.Content);
this.addPartsDaliIp = this.createLabelAndElement("DaliIp", this.i18n.DaliIP, "TextBox", this.i18n.DaliIP);
this.addPartsSourceProcess = this.createLabelAndElement("SourceProcess", this.i18n.SourceProcess, "TextBox", this.i18n.SourceProcess);
this.addPartsDeletePrevious = this.createLabelAndElement("DeletePrevious", this.i18n.DeletePrevious, "CheckBox", this.i18n.DeletePrevious);
this.addPartsAllowForeign = this.createLabelAndElement("AllowForeignFiles", this.i18n.AllowForeignFiles, "CheckBox", this.i18n.AllowForeignFiles);
this.addPartsPreloadAllPackages = this.createLabelAndElement("PreloadAllPackages", this.i18n.PreloadAllPackages, "CheckBox", this.i18n.PreloadAllPackages);
this.addPartsUpdateSuperFiles = this.createLabelAndElement("UpdateSuperFiles", this.i18n.UpdateSuperFiles, "CheckBox", this.i18n.UpdateSuperFiles);
this.addPartsUpdateCloneFrom = this.createLabelAndElement("UpdateCloneFrom", this.i18n.UpdateCloneFrom, "CheckBox", this.i18n.UpdateCloneFrom);
this.addPartsAppendCluster = this.createLabelAndElement("AppendCluster", this.i18n.AppendCluster, "CheckBox", this.i18n.AppendCluster);
this.addPartsPartName = this.createLabelAndElement(this.id + "PartName", this.i18n.PartName, "ValidationTextBox", this.i18n.PartName);
this.addPartsContent = this.createLabelAndElement(this.id + "Content", this.i18n.Content, "Textarea", this.i18n.Content);
this.addPartsDaliIp = this.createLabelAndElement(this.id + "DaliIp", this.i18n.DaliIP, "TextBox", this.i18n.DaliIP);
this.addPartsSourceProcess = this.createLabelAndElement(this.id + "SourceProcess", this.i18n.SourceProcess, "TextBox", this.i18n.SourceProcess);
this.addPartsDeletePrevious = this.createLabelAndElement(this.id + "DeletePrevious", this.i18n.DeletePrevious, "CheckBox", this.i18n.DeletePrevious);
this.addPartsAllowForeign = this.createLabelAndElement(this.id + "AllowForeignFiles", this.i18n.AllowForeignFiles, "CheckBox", this.i18n.AllowForeignFiles);
this.addPartsPreloadAllPackages = this.createLabelAndElement(this.id + "PreloadAllPackages", this.i18n.PreloadAllPackages, "CheckBox", this.i18n.PreloadAllPackages);
this.addPartsUpdateSuperFiles = this.createLabelAndElement(this.id + "UpdateSuperFiles", this.i18n.UpdateSuperFiles, "CheckBox", this.i18n.UpdateSuperFiles);
this.addPartsUpdateCloneFrom = this.createLabelAndElement(this.id + "UpdateCloneFrom", this.i18n.UpdateCloneFrom, "CheckBox", this.i18n.UpdateCloneFrom);
this.addPartsAppendCluster = this.createLabelAndElement(this.id + "AppendCluster", this.i18n.AppendCluster, "CheckBox", this.i18n.AppendCluster);

this.removeParts = new Button({
id: this.id + "RemoveParts",
Expand Down
154 changes: 47 additions & 107 deletions esp/src/eclwatch/PackageMapQueryWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ define([
"dijit/form/Button",
"dijit/form/DropDownButton",
"dijit/form/Select",
"dijit/form/Textarea",
"dijit/Toolbar",
"dijit/TooltipDialog"
], function (declare, lang, i18n, nlsHPCC, arrayUtil, dom, domConstruct, domForm, ObjectStore, on, topic,
Expand Down Expand Up @@ -71,10 +72,20 @@ define([
this.targetSelect = registry.byId(this.id + "TargetSelect");
this.processSelect = registry.byId(this.id + "ProcessSelect");
this.processSelectFilter = registry.byId(this.id + "ProcessFilterSelect");
this.addPackageMapForm = registry.byId(this.id + "AddProcessMapForm");
this.addProcessMapId = registry.byId(this.id + "AddProcessMapId");
this.addPackageMapContent = registry.byId(this.id + "AddPackagemapContent");
this.addPackageTargetSelect = registry.byId(this.id + "AddProcessMapTargetSelect");
this.addPackageProcessSelect = registry.byId(this.id + "AddProcessMapProcessSelect");
this.addPackageProcessFilter = registry.byId(this.id + "AddProcessMapProcessFilter");
this.addPackageMapDialog = registry.byId(this.id + "AddProcessMapDialog");
this.addPackageMapContent = dom.byId("AddPackagemapContent");
this.addPackageMapSubmit = registry.byId(this.id + "AddProcessMapDialogSubmit");
this.addPackageMapCloseButton = registry.byId(this.id + "AddProcessMapDialogClose");
this.addPackageMapUploader = registry.byId(this.id + "AddProcessMapFileUploader");
this.addProcessMapDaliIp = registry.byId(this.id + "AddProcessMapDaliIP");
this.addProcessMapActivate = registry.byId(this.id + "AddProcessMapActivate");
this.addProcessMapOverWrite = registry.byId(this.id + "AddProcessMapOverWrite");
this.filter = registry.byId(this.id + "Filter");
},

Expand Down Expand Up @@ -111,82 +122,41 @@ define([
}
},

_onCancel: function (event) {
this.addPackageMapDialog.hide();
this.addPackageMapContent.value = "";
},

_onAdd: function (event) {
this.addPackageMapDialog.show();

var context = this;
var addPackageMapUploader = registry.byId(this.id + "AddProcessMapFileUploader");
dojo.connect(addPackageMapUploader, "onComplete", this, function (e) {
registry.byId(this.id + "AddProcessMapDialogSubmit").set('disabled', false);
return context.addPackageMapCallback();
});
dojo.connect(addPackageMapUploader, "onBegin", this, function (e) {
registry.byId(this.id + "AddProcessMapDialogSubmit").set('disabled', true);
return;
});
var addPackageMapSubmitButton = registry.byId(this.id + "AddProcessMapDialogSubmit");
dojo.connect(addPackageMapSubmitButton, "onClick", this, function (e) {
return context._onAddPackageMapSubmit();
});
var addPackageMapCloseButton = registry.byId(this.id + "AddProcessMapDialogClose");
dojo.connect(addPackageMapCloseButton, "onClick", this, function (e) {
this.addPackageMapDialog.onCancel();
});
},

_onAddProcessMapIdKeyUp: function () {
this._onCheckAddProcessMapInput();
},
_onAddPackageMapSubmit: function () {
var context = this;

_onCheckAddProcessMapInput: function () {
var id = registry.byId(this.id + "AddProcessMapId").get('value');
var files = registry.byId(this.id + "AddProcessMapFileUploader").getFileList();
if (files.length > 1) {
alert(this.i18n.Only1PackageFileAllowed);
return;
if (this.addPackageMapForm.validate()) {
WsPackageMaps.AddPackage({
request: {
Info: this.addPackageMapContent.value,
PackageMap: this.addProcessMapId.get('value'),
Process: this.addPackageProcessSelect.get('value'),
Target: this.addPackageTargetSelect.get('value'),
Activate: this.addProcessMapActivate.get('checked'),
Overwrite: this.addProcessMapOverWrite.get('checked'),
DaliIp: this.addProcessMapDaliIp.get('value')
}
}).then(function(response){
if (lang.exists("AddPackageResponse.status", response)) {
if (response.AddPackageResponse.status.Code === 0) {
context.refreshGrid();
context._onCancel();
}
} else {
this._onCancel();
this.showErrors(response.Exceptions.Exception[0].Message);
}
});
}
var fileName = '';
if (files.length > 0)
fileName = files[0].name;
if ((fileName !== '') && (id === '')) {
registry.byId(this.id + "AddProcessMapId").set('value', fileName);
registry.byId(this.id + "AddProcessMapDialogSubmit").set('disabled', false);
} else if ((id === '') || (files.length < 1))
registry.byId(this.id + "AddProcessMapDialogSubmit").set('disabled', true);
else
registry.byId(this.id + "AddProcessMapDialogSubmit").set('disabled', false);
},

_onAddPackageMapSubmit: function () {
var target = this.addPackageMapTargetSelect.getValue();
var id = registry.byId(this.id + "AddProcessMapId").get('value');
var process = this.addPackageMapProcessSelect.getValue();
var daliIp = registry.byId(this.id + "AddProcessMapDaliIP").get('value');
var activate = registry.byId(this.id + "AddProcessMapActivate").get('checked');
var overwrite = registry.byId(this.id + "AddProcessMapOverWrite").get('checked');
if ((id === '') || (target === ''))
return false;
if ((process === '') || (process === this.i18n.ANY))
process = '*';

var action = "/WsPackageProcess/AddPackage?upload_&PackageMap=" + id + "&Target=" + target;
if (process !== '')
action += "&Process=" + process;
if (daliIp !== '')
action += "&DaliIp=" + daliIp;
if (activate)
action += "&Activate=1";
else
action += "&Activate=0";
if (overwrite)
action += "&OverWrite=1";
else
action += "&OverWrite=0";
var theForm = registry.byId(this.id + "AddProcessMapForm");
if (theForm === undefined)
return false;
theForm.set('action', action);
return true;
},

_onDelete: function (event) {
Expand All @@ -206,6 +176,8 @@ define([
if (response.DeletePackageResponse.status.Code === 0) {
context.refreshGrid();
}
} else {
context.showErrors(response.Exceptions.Exception[0].Message);
}
});
});
Expand Down Expand Up @@ -257,16 +229,6 @@ define([
});
},

addProcessSelections: function (processSelect, processes, processData) {
for (var i = 0; i < processData.length; ++i) {
var process = processData[i];
if ((processes != null) && (processes.indexOf(process) !== -1))
continue;
processes.push(process);
processSelect.options.push({ label: process, value: process });
}
},

init: function (params) {
var context = this;
if (this.inherited(arguments))
Expand All @@ -277,14 +239,13 @@ define([
this.targetSelect.init({
GetPackageMapTargets: true
});

this.processSelect.init({
GetPackageMapProcesses: true
});

this.processSelectFilter.init({
GetPackageMapProcessFilter: true
})
});

this.addPackageTargetSelect.init({
GetPackageMapTargets: true
Expand All @@ -294,8 +255,6 @@ define([
GetPackageMapProcesses: true
});

this.initPackagesGrid();

this.filter.on("clear", function (evt) {
context._onFilterType();
context.refreshHRef();
Expand All @@ -305,6 +264,7 @@ define([
context.refreshHRef();
context.refreshGrid();
});
this.initPackagesGrid();
},

initTab: function () {
Expand Down Expand Up @@ -411,11 +371,8 @@ define([
},

getFilter: function () {
return {
Target: this.targetSelect.getValue(),
Process: this.processSelect.getValue(),
ProcessFilter: this.processSelectFilter.getValue()
};
var retVal = this.filter.toObject();
return retVal;
},

refreshGrid: function (clearSelection) {
Expand All @@ -434,23 +391,6 @@ define([
registry.byId(this.id + "Deactivate").set("disabled", selection.length !== 1);
},

packageMapDeleted: function (tabId) {
if (this.tabMap[tabId] == null)
return;
this.tabContainer.removeChild(this.tabMap[tabId]);
this.tabMap[tabId].destroyRecursive();
delete this.tabMap[tabId];

this.tabContainer.selectChild(this.packagesTab);
this.packagesGrid.rowSelectCell.toggleAllSelection(false);
this.refreshGrid();
},

addPackageMapCallback: function (event) {
this.addPackageMapDialog.onCancel();
this.refreshGrid();
},

ensurePane: function (id, params) {
id = this.createChildTabID(id);
var retVal = registry.byId(id);
Expand All @@ -468,4 +408,4 @@ define([
return retVal;
}
});
});
});
8 changes: 7 additions & 1 deletion esp/src/eclwatch/TargetSelectClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,16 @@ define([
} else if (params.DFUSprayQueues === true) {
this.loadSprayQueues();
} else if (params.GetPackageMapTargets === true) {
this.defaultValue = "*";
this.set("value", "*");
this.loadGetPackageMapTargets();
} else if (params.GetPackageMapProcesses === true) {
this.defaultValue = "*";
this.set("value", "*");
this.loadGetPackageMapProcesses();
} else if (params.GetPackageMapProcessFilter === true) {
this.defaultValue = "*";
this.set("value", "*");
this.loadGetPackageMapProcessFilter();
} else if (params.DropZoneMachines === true) {
this.defaultValue = "";
Expand Down Expand Up @@ -638,4 +644,4 @@ define([
});
}
};
});
});
Loading

0 comments on commit a381717

Please sign in to comment.