Built files from Bizgaze WebServer
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

serviceintegrator.js 6.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Integrations;
  6. (function (Integrations) {
  7. let Components;
  8. (function (Components) {
  9. class ServiceIntegrator extends Platform.Core.BaseComponent {
  10. cssFiles() {
  11. return ["libs/summernote/summernote.css"];
  12. }
  13. jsFiles() {
  14. return ["platform/integrations/components/serviceintegrator.js", "platform/integrations/components/createserviceprovider.js", "platform/integrations/managers/integrationmanager.js", "platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', "libs/summernote/summernote.min.js", "platform/integrations/enums/integratortype.js"];
  15. }
  16. html(id, containerid) {
  17. let html = '<form id="frmUnibase_InputParameters" default="" data-validate="parsley" data-isdynamic="false"><div class="b-b bg-white header"><input id="hf_ServiceIntegratorId" type="hidden" value="0"/><input id="hf_container" type="hidden" value="0"/><strong id="formName" class="text-dark">Input Settings</strong><a class="btn btn-sm ml-auto"><i class="ti-help-alt" title="help" href="javascript:;" target="_blank"></i></a><input id="hf_fromIntegration" type="hidden" value="false"/></div><div data-simplebar class="simple-scroll-bar scrollable integrator-body"><div id="Unibase_ValidationSummary" class="clear mt-10"></div><div class="card"><div class="card-body"><div class="" id="div_InputSettings"></div></div></div></div></div><div id="div_dataApiFooter" class="bg-white footer"><a class="btn btn-light btn-sm btn-center mr-auto btn-close" id="btnClose">Close</a><a class="btn btn-primary btn-center btn-sm text-white" id="btn_execute">Execute</a></div></form>';
  18. return html;
  19. }
  20. load(id, containerid, callback) {
  21. var instance = this;
  22. $("#btn_execute").click(function () {
  23. var serviceIntegratorId = $("#hf_ServiceIntegratorId").val();
  24. Unibase.Platform.Integrations.Components.CreateServiceProvider.Instance().saveSettings(containerid, serviceIntegratorId, ServiceIntegrator.isDownload);
  25. });
  26. }
  27. loadInputSettings(serviceIntegratorId, serviceId, integratorType, isDownload) {
  28. var instance = this;
  29. ServiceIntegrator.isDownload = isDownload;
  30. instance.fileCacheHelper.loadJsFile("platform/integrations/managers/integrationmanager.js", null);
  31. bootbox.confirm("Do you want to Execute this service?", function (result) {
  32. if (result == true) {
  33. Unibase.Platform.Integrations.Managers.IntegrationManager.Instance().getinputsettings(serviceIntegratorId, true).then(function (response) {
  34. $("#hf_ServiceIntegratorId").val(serviceIntegratorId);
  35. if (response.result.length > 0) {
  36. instance.navigationHelper.popup(0, '', Unibase.Platform.Integrations.Components.ServiceIntegrator.Instance(), null, Platform.Helpers.Size.Medium);
  37. $("#hf_ServiceIntegratorId").val(serviceIntegratorId);
  38. var settinghtml = "";
  39. for (let i = 0; i < response.result.length; i++) {
  40. var data = response.result[i];
  41. settinghtml += '<div class="row item-row ml-30 col-sm-12 mt-10 mb-2">' +
  42. '<input type="hidden" class=" hf_Header_Service" id="hf_Header_Service_' + i + '"" value=' + data.ServiceSettingId + '>' +
  43. '<input type="hidden" class="hf_Header_ServiceId" id="hf_Header_ServiceId_' + i + '"" value=' + data.ServiceId + '>' +
  44. '<input type="hidden" class="hf_Header_SettingTypeId" id="hf_Header_SettingTypeId_' + i + '"" value=' + data.SettingTypeId + '>' +
  45. '<div class="focus col-sm-5" id="div_ConfigKey_Collection">' +
  46. '<input class="form-control txt_ConfigKey_Collection readonly" type="text" id="txt_ConfigKey_Collection_' + i + '" placeholder="Enter Key" data-label="Key" data-isdynamic="false" data-placeholder="Key" autocomplete="false" value=' + data.SettingName + '>' +
  47. '</div>' +
  48. '<div class="focus col-sm-5" id="div_ConfigValue_Collection">' +
  49. '<input class="form-control txt_ConfigValue_Collection" type="text" id="txt_ConfigValue_Collection_' + i + '" placeholder="Enter Value" data-label="Value" data-isdynamic="false" data-placeholder="Value" autocomplete="false" value=' + data.SettingValue + '>' +
  50. '</div>' +
  51. '</div>';
  52. }
  53. $("#div_InputSettings").html(settinghtml);
  54. }
  55. else {
  56. Unibase.Platform.Integrations.Components.CreateServiceProvider.Instance().saveSettings("", serviceIntegratorId, isDownload);
  57. }
  58. });
  59. }
  60. });
  61. }
  62. loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
  63. var instance = this;
  64. }
  65. static Instance() {
  66. return new ServiceIntegrator();
  67. }
  68. }
  69. ServiceIntegrator.isDownload = false;
  70. Components.ServiceIntegrator = ServiceIntegrator;
  71. })(Components = Integrations.Components || (Integrations.Components = {}));
  72. })(Integrations = Platform.Integrations || (Platform.Integrations = {}));
  73. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  74. })(Unibase || (Unibase = {}));