Iniit
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Automation;
|
||||
(function (Automation) {
|
||||
let Sync;
|
||||
(function (Sync) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class SyncSubmission extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
return ['platform/automation/sync/managers/syncmanager.js'];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html() {
|
||||
return null;
|
||||
}
|
||||
load() {
|
||||
}
|
||||
syncTenant(tenantid, database, rdbconstr, isindividual) {
|
||||
let containerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
|
||||
let btnSync = $(containerId).find('.btn_sync');
|
||||
let obj = new syncProviders();
|
||||
obj.TenantId = tenantid;
|
||||
obj.DBName = database;
|
||||
obj.RDBConnectionString = rdbconstr;
|
||||
obj.IsIndividual = isindividual;
|
||||
var instance = this;
|
||||
if (isindividual) {
|
||||
instance.fileCacheHelper.loadJsFile("platform/automation/sync/managers/syncmanager.js", function () {
|
||||
Unibase.Platform.Automation.Sync.Managers.SyncManager.Instance().syncTenant(obj).then(function (responce) {
|
||||
if (responce != null) {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
bootbox.confirm("Are you sure you want to SYNC All tenants?", function (result) {
|
||||
if (result) {
|
||||
instance.fileCacheHelper.loadJsFile("platform/automation/sync/managers/syncmanager.js", function () {
|
||||
Unibase.Platform.Automation.Sync.Managers.SyncManager.Instance().syncTenant(obj).then(function (responce) {
|
||||
if (responce != null) {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new SyncSubmission();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
SyncSubmission.syncName = [];
|
||||
Components.SyncSubmission = SyncSubmission;
|
||||
})(Components = Sync.Components || (Sync.Components = {}));
|
||||
class syncProviders {
|
||||
}
|
||||
})(Sync = Automation.Sync || (Automation.Sync = {}));
|
||||
})(Automation = Platform.Automation || (Platform.Automation = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1,48 @@
|
||||
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 Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Automation;
|
||||
(function (Automation) {
|
||||
let Sync;
|
||||
(function (Sync) {
|
||||
let Managers;
|
||||
(function (Managers) {
|
||||
class SyncManager extends Unibase.Platform.Core.BaseManager {
|
||||
syncTenant(obj) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
debugger;
|
||||
const url = 'apis/v4/unibase/synctenants/tenants/syncTenant';
|
||||
return yield this.dataHelper().postAsync(url, obj).then(function (response) {
|
||||
if (response.result == null) {
|
||||
MessageHelper.Instance().showSuccess(response.message, '');
|
||||
}
|
||||
if (response.result != null) {
|
||||
MessageHelper.Instance().showSuccess("SuccessFully Synced", '');
|
||||
}
|
||||
response.result = JSON.parse(response.result);
|
||||
return response;
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this._instance === undefined)
|
||||
this._instance = new SyncManager();
|
||||
return this._instance;
|
||||
}
|
||||
}
|
||||
Managers.SyncManager = SyncManager;
|
||||
})(Managers = Sync.Managers || (Sync.Managers = {}));
|
||||
})(Sync = Automation.Sync || (Automation.Sync = {}));
|
||||
})(Automation = Platform.Automation || (Platform.Automation = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
Reference in New Issue
Block a user