Iniit
This commit is contained in:
@@ -0,0 +1,239 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Hyperfusion;
|
||||
(function (Hyperfusion) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Virtualmachine extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.pageIndex = 0;
|
||||
}
|
||||
cssFiles() {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
jsFiles() {
|
||||
return ["apps/hyperfusion/managers/hyperfusionmanager.js", "libs/jquery/pagination/jquery.pagination.js"];
|
||||
;
|
||||
}
|
||||
html(id, containerid) {
|
||||
return null;
|
||||
}
|
||||
load(id, containerid, callback) { }
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, PortletWidgetId) { }
|
||||
init(containerid) {
|
||||
let instance = this;
|
||||
instance.fileCacheHelper.loadJsFiles(["libs/jquery/pagination/jquery.pagination.js"], null);
|
||||
$(`.${containerid}`).append(`<div class="card mb-0 border-0 p-2 BindData_` + containerid + ` findcontainer h-100" style="background:0 0">
|
||||
<div class="card-header border-bottom py-2 px-2 search-bar-main-wrapper viewer-header position-sticky t-0 bg-white z-index-2"
|
||||
id="ViewerHeader_` + containerid + `">
|
||||
<div class="card-header-top line-loader-container p-relative">
|
||||
<div id="bizgaze_hyperfusion" class="bg-white" default="" data-validate="parsley" data-isdynamic="false">
|
||||
<div class="px-20 pt-3 w-100 d-flex align-items-center justify-content-between"><span
|
||||
class="font-18 font-weight-600">Virtual Machines</span></div>
|
||||
<div class="b-b bg-white header log-Header modal-header align-items-end">
|
||||
<div class="b-b bg-white d-flex flex-column" id="div_Location"><label
|
||||
class="font-weight-500">Location</label><select type="text" id="txtlocation"
|
||||
class="form-control floating-label-control " placeholder="Location *"
|
||||
data-placeholder="Select Location"></select></div>
|
||||
<div class="b-b bg-white d-flex flex-column" id="div_server"><label
|
||||
class="font-weight-500">Server Name</label><select type="text" id="txtserver"
|
||||
class="form-control floating-label-control " placeholder="Server Name *"
|
||||
data-placeholder="Select Server Name"></select></div>
|
||||
<div id="log_item" class="flex-column row"><label class="font-weight-500">Stage</label>
|
||||
<div class=""><select id="txtAutocomplete_log" placeholder="Select" class="form-control pl-0"
|
||||
data-placeholder="Select" data-label="Log">
|
||||
<option class="primary-account font-10" value="1">All</option>
|
||||
<option class="secondary-account font-10" value="0">Created</option>
|
||||
<option class="secondary-account font-10" value="2">Start</option>
|
||||
<option class="secondary-account font-10" value="3">Stop</option>
|
||||
<option class="secondary-account font-10" value="4">Delete</option>
|
||||
<option class="secondary-account font-10" value="5">Failed</option>
|
||||
<option class="secondary-account font-10" value="6">Configure</option>
|
||||
</select><input type="hidden" value="0" id="hfAutocomplete_log"></div>
|
||||
</div>
|
||||
<div class="d-flex flex-column" id="div_fromDate" data-dateinitialized="false">
|
||||
<label class="font-weight-400">From Date</label>
|
||||
<div class="align-items-center d-flex"><input type="date" id="txt_fromDate" min="1980-01-01"
|
||||
class="form-control floating-label-control datepicker-input pl-0 w-150p"
|
||||
style="box-shadow: none;" data-date-format="dd/MM/yyyy" data-isdynamic="false"
|
||||
placeholder="From Date *" data-placeholder="dd/mm/yyyy" data-label="From Date">
|
||||
<div id="clr_fdate"><i class="fa fa-close"></i></div>
|
||||
</div>
|
||||
<input type="hidden" id="hf_fromDate">
|
||||
</div>
|
||||
<div class="d-flex flex-column" id="div_toDate"><label class="font-weight-400">To Date</label>
|
||||
<div class="floating-label-from-group align-items-center d-flex"><input type="date" id="txt_toDate"
|
||||
class="form-control floating-label-control datepicker-input pl-0 w-150p"
|
||||
data-date-format="dd/MM/yyyy" style="box-shadow: none;" data-isdynamic="false"
|
||||
placeholder="To Date *" data-placeholder="dd/mm/yyyy" data-label="To Date">
|
||||
<div id="clr_tdate"><i class="fa fa-close"></i></div>
|
||||
</div>
|
||||
<input type="hidden" id="hf_toDate">
|
||||
</div><a href="javascript:;" class="btn btn-icon btn-flush-biz-theme btn-rounded flush-soft-hover w-30p h-30p dataapilog-refresh-btn mr-20" id="dataapilogRefreshBtn_" data-tooltip="true" title="Refresh All" onclick="javascript:Bizgaze.Apps.Hyperfusion.Components.Virtualmachine.Instance().refreshData();"><span class="btn-icon-wrap"><i class="fa fa-refresh"></i></span></a>
|
||||
<a href="javascript:;" id="btnApply" class="btn btn-primary btn-sm" onclick="javascript:Bizgaze.Apps.Hyperfusion.Components.Virtualmachine.Instance().loadData();">Apply</a><a href="javascript:;"
|
||||
class="btn btn-icon btn-flush-biz-theme btn-rounded flush-soft-hover w-30p h-30p dataapilog-refresh-btn " onclick="javascript:Bizgaze.Apps.Hyperfusion.Components.Virtualmachine.Instance().downloadServersReport();"
|
||||
id="dataapilogRefreshBtn_" data-tooltip="true" title="Download All"><span class="btn-icon-wrap"><i
|
||||
class="fa fa-download"></i></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-2 border-removed border-white-removed show userDesignWidgetCardBody" id="Viewer_` + containerid + `" data-iscollapseapplied="false">
|
||||
<div class="hyperfunction_` + containerid + `" id="hyperfunction"></div>
|
||||
</div>
|
||||
</div>`);
|
||||
instance.virtualMeachine(containerid);
|
||||
var url = _appsettings.server_url() + '/apis/v4/hyperfusion/hireserver/machines/serversautocomplete';
|
||||
AutoCompleteHelper.getHelper().Create("#txtserver", "#hf_Autocomplete_Services", url, function (response) {
|
||||
var data = response;
|
||||
$("#div_server").find('.select2ErrorClass').addClass('w-200p');
|
||||
});
|
||||
url = _appsettings.server_url() + '/apis/v4/hyperfusion/hireserver/machines/locationsautocomplete';
|
||||
AutoCompleteHelper.getHelper().Create($("#txtlocation"), "#hfAutocomplete_Plant", url, function (response) {
|
||||
var data = response;
|
||||
$("#div_Location").find('.select2ErrorClass').addClass('w-200p');
|
||||
});
|
||||
}
|
||||
loadPagination(totalRecords) {
|
||||
var instance = this;
|
||||
let element = $('#ItemsListPagination');
|
||||
element.pagination(totalRecords, 20, {
|
||||
items_per_page: 20,
|
||||
callback: function (page, component) {
|
||||
instance.pageIndex = page;
|
||||
instance.loadData();
|
||||
}, current_page: instance.pageIndex
|
||||
});
|
||||
}
|
||||
virtualMeachine(containerid) {
|
||||
var instance = this;
|
||||
let html = '';
|
||||
html += `<div class="font-weight-600 list-group-item-secondary mx-0 py-2 row">
|
||||
<div class="col-2">Machine Name</div>
|
||||
<div class="col-1 text-nowrap">VM Stage</div>
|
||||
<div class="col-1 text-nowrap">HS Stage</div>
|
||||
<div class="col-2">Created Date</div>
|
||||
<div class="col-2">Contact Name</div>
|
||||
<div class="col-2">Location</div>
|
||||
<div class="col-2">Server Name</div>
|
||||
</div>
|
||||
<div class="divlog list-group font-14 mb-10 templateviewer-body"></div>
|
||||
<div class="px-15 d-flex justify-content-between align-items-center">
|
||||
<div id="totalcount" class="font-14 font-weight-600">Total Count :<a href="javascript:; " id="getcount"></a></div>
|
||||
<div id="ItemsListPagination" class="pagination custom-pagination pagination-rounded pull-right"></div>
|
||||
</div>
|
||||
<div id="div_LogFooter" class="bg-white footer h-50p"></div>`;
|
||||
$(".hyperfunction_" + containerid).append(html);
|
||||
instance.loadData();
|
||||
}
|
||||
loadData() {
|
||||
var instance = this;
|
||||
let datetimeIns = Unibase.Platform.Helpers.DateTimeHelper.Instance();
|
||||
var instance = this;
|
||||
var Serverid = $('#txtserver option:selected').val();
|
||||
var Branchid = $('#txtlocation option:selected').val();
|
||||
var postData = {
|
||||
ServerId: Serverid,
|
||||
BranchId: Branchid,
|
||||
Page: instance.pageIndex,
|
||||
Rows: 20,
|
||||
FromDate: $("#txt_fromDate").val(),
|
||||
ToDate: $("#txt_toDate").val(),
|
||||
Stage: $('#txtAutocomplete_log option:selected').text()
|
||||
};
|
||||
if (($("#txt_fromDate").val() == "" && $("#txt_toDate").val() != "" && $("#txt_toDate").val() != undefined)) {
|
||||
MessageHelper.Instance().showError("Please select FromDate", "Unibase_ValidationSummary");
|
||||
}
|
||||
else if ($("#txt_fromDate").val() != "" && $("#txt_fromDate").val() != undefined && $("#txt_toDate").val() == "") {
|
||||
MessageHelper.Instance().showError("Please select ToDate", "Unibase_ValidationSummary");
|
||||
}
|
||||
else if (($("#txt_fromDate").val() > $("#txt_toDate").val())) {
|
||||
MessageHelper.Instance().showError("ToDate is lessthan FromDate", "Unibase_ValidationSummary");
|
||||
}
|
||||
else {
|
||||
$(".divlog").html(Unibase.Themes.Compact.Components.Nav_Template.Instance().skelTonHorizontal());
|
||||
}
|
||||
instance.fileCacheHelper.loadJsFiles(["apps/hyperfusion/managers/hyperfusionmanager.js"], () => {
|
||||
Hyperfusion.Managers.HyperfusionManager.Instance().getMachinesDataforfilter(postData).then((response) => {
|
||||
let html = '';
|
||||
if (response.result.length == 0) {
|
||||
$(".divlog").hide();
|
||||
$("#totalcount").hide();
|
||||
}
|
||||
else {
|
||||
$(".divlog").show();
|
||||
$("#totalcount").show();
|
||||
if (response.result != null) {
|
||||
for (let i = 0; i < response.result.length; i++) {
|
||||
let data = response.result[i];
|
||||
let machine_name = data.MachineName;
|
||||
let contact_name = data.ContactName;
|
||||
let stage_name = data.StageName;
|
||||
var date = Unibase.Platform.Helpers.DateTimeHelper.Instance().FormatDateTime(data.CreatedDate);
|
||||
html += `<ul class="row mx-0"><li class="col-2">${data.MachineName}</li><li class="col-1">${data.ActualStage}</li><li class="col-1">${data.StageName}</li><li class="col-2">${date}</li><li class="col-2">${data.ContactName}</li><li class="col-2">${data.BranchName}</li><li class="col-2">${data.ServerName}</li></ul>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (response.totalRecords > 20) {
|
||||
$("#ItemsListPagination").removeClass("hidden");
|
||||
instance.loadPagination(response.totalRecords);
|
||||
}
|
||||
else {
|
||||
$("#ItemsListPagination").addClass("hidden");
|
||||
}
|
||||
$('#getcount').text(response.totalRecords);
|
||||
$("#lblintegratelogRecords").text(response.result.length);
|
||||
$(".divlog").html(html);
|
||||
});
|
||||
});
|
||||
}
|
||||
downloadServersReport() {
|
||||
let datetimeIns = Unibase.Platform.Helpers.DateTimeHelper.Instance();
|
||||
var instance = this;
|
||||
var ServerId = $('#txtserver option:selected').val();
|
||||
var BranchId = $('#txtlocation option:selected').val();
|
||||
var postData = {
|
||||
ServerId: ServerId,
|
||||
BranchId: BranchId,
|
||||
Page: instance.pageIndex,
|
||||
Rows: 20,
|
||||
FromDate: $("#txt_fromDate").val(),
|
||||
ToDate: $("#txt_toDate").val(),
|
||||
Stage: $('#txtAutocomplete_log option:selected').text()
|
||||
};
|
||||
if (($("#txt_fromDate").val() == "" && $("#txt_toDate").val() != "" && $("#txt_toDate").val() != undefined)) {
|
||||
MessageHelper.Instance().showError("Please select FromDate", "Unibase_ValidationSummary");
|
||||
}
|
||||
else if ($("#txt_fromDate").val() != "" && $("#txt_fromDate").val() != undefined && $("#txt_toDate").val() == "") {
|
||||
MessageHelper.Instance().showError("Please select ToDate", "Unibase_ValidationSummary");
|
||||
}
|
||||
else if (($("#txt_fromDate").val() > $("#txt_toDate").val())) {
|
||||
MessageHelper.Instance().showError("ToDate is lessthan FromDate", "Unibase_ValidationSummary");
|
||||
}
|
||||
else {
|
||||
}
|
||||
this.fileCacheHelper.loadJsFiles(['apps/Hyperfusion/manager/hyperfusionmanager.js'], () => {
|
||||
Hyperfusion.Managers.HyperfusionManager.Instance().downloadData(postData).then((response) => {
|
||||
Unibase.Platform.Helpers.FileHelper.Instance().convertBase64tofile(response.result);
|
||||
});
|
||||
});
|
||||
}
|
||||
refreshData() {
|
||||
$('#txt_fromDate').val('');
|
||||
$('#txt_toDate').val('');
|
||||
$('#txtAutocomplete_log').val(1);
|
||||
$('#txtserver').text('');
|
||||
$('#txtlocation').text('');
|
||||
this.loadData();
|
||||
}
|
||||
static Instance() {
|
||||
return new Virtualmachine();
|
||||
}
|
||||
}
|
||||
Components.Virtualmachine = Virtualmachine;
|
||||
})(Components = Hyperfusion.Components || (Hyperfusion.Components = {}));
|
||||
})(Hyperfusion = Apps.Hyperfusion || (Apps.Hyperfusion = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,51 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Hyperfusion;
|
||||
(function (Hyperfusion) {
|
||||
let Managers;
|
||||
(function (Managers) {
|
||||
class HyperfusionManager extends Unibase.Platform.Core.BaseManager {
|
||||
getMachinesDataforfilter(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = '/apis/v4/hyperfusion/hireserver/machines/getvirtualmachinesdataforfilter';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null && response.result != "") {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
downloadData(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = '/apis/v4/hyperfusion/hireserver/machines/downloaddata';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result != null) {
|
||||
response.result = JSON.parse(response.result);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new HyperfusionManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Managers.HyperfusionManager = HyperfusionManager;
|
||||
})(Managers = Hyperfusion.Managers || (Hyperfusion.Managers = {}));
|
||||
})(Hyperfusion = Apps.Hyperfusion || (Apps.Hyperfusion = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hyperfusionmanager.js","sourceRoot":"","sources":["hyperfusionmanager.ts"],"names":[],"mappings":";;;;;;;;;AAGA,IAAU,OAAO,CAmChB;AAnCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAiCpB;IAjCD,WAAiB,IAAI;QACjB,IAAiB,WAAW,CA+B3B;QA/BD,WAAiB,WAAW;YACxB,IAAiB,QAAQ,CA6BxB;YA7BD,WAAiB,QAAQ;gBACrB,MAAa,kBAAmB,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW;oBAE/D,wBAAwB,CAAC,GAAG;;4BAC9B,MAAM,GAAG,GAAG,0EAA0E,CAAC;4BACvF,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;gCACtE,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,IAAI,EAAE,EAAE;oCACjD,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;iCAClD;gCACD,OAAO,QAAQ,CAAC;4BACpB,CAAC,CAAC,CAAC;wBACP,CAAC;qBAAA;oBAEK,YAAY,CAAC,GAAG;;4BAClB,MAAM,GAAG,GAAG,uDAAuD,CAAC;4BACpE,OAAO,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;gCACtE,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE;oCACzB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;iCACjD;gCACD,OAAO,QAAQ,CAAC;4BACpB,CAAC,CAAC,CAAC;wBACP,CAAC;qBAAA;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAC;wBAC9C,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBA3BY,2BAAkB,qBA2B9B,CAAA;YACL,CAAC,EA7BgB,QAAQ,GAAR,oBAAQ,KAAR,oBAAQ,QA6BxB;QACL,CAAC,EA/BgB,WAAW,GAAX,gBAAW,KAAX,gBAAW,QA+B3B;IACL,CAAC,EAjCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAiCpB;AACL,CAAC,EAnCS,OAAO,KAAP,OAAO,QAmChB"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ihyperfusionmanager.js","sourceRoot":"","sources":["ihyperfusionmanager.ts"],"names":[],"mappings":""}
|
||||
Reference in New Issue
Block a user