Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

domain.js 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Common;
  6. (function (Common) {
  7. let Components;
  8. (function (Components) {
  9. class Domain extends Unibase.Platform.Core.BaseComponent {
  10. constructor() {
  11. super();
  12. }
  13. cssFiles() {
  14. return [""];
  15. }
  16. jsFiles() {
  17. return ["platform/common/components/domain.js", "platform/common/managers/commonmanager.js"];
  18. }
  19. loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
  20. this.addprovider(Pk_Value);
  21. }
  22. addprovider(Pk_Value) {
  23. this.navigationHelper.popup(Pk_Value, '', Unibase.Platform.Common.Components.Domain.Instance(), null, Platform.Helpers.Size.Large);
  24. }
  25. loadDomainForm(iscreate) {
  26. var Pk_Value = 0;
  27. if (!iscreate) {
  28. Pk_Value = Unibase.Themes.Providers.DetailHelper.recordId;
  29. this.addprovider(Pk_Value);
  30. }
  31. this.navigationHelper.popup(Pk_Value, '', Unibase.Platform.Common.Components.Domain.Instance(), null, Platform.Helpers.Size.Large);
  32. }
  33. html(id, containerid) {
  34. var html = `<form id="frmUnibase_CreateDomian" data-validate="parsley" data-isdynamic="false">
  35. <div class="card bg-light">
  36. <div class="b-b bg-white card-header header"><strong class="text-dark title" id="lbl_title">Domain</strong>
  37. <div id="div_domainmessage" class="position-fixed w-100"></div></div>
  38. <div data-simplebar class="card-body simple-scroll-bar scrollable" id="divCreateDomain">
  39. <div class="bg-white card">
  40. <div id="unibase_ValidationSummary" class="clear"></div>
  41. <div class="card-body">
  42. <div class="row">
  43. <div class="col-sm-12">
  44. <div class="floating-label-form-group">
  45. <label for="txt_FriendlyName" class="font-bold">Domain Name<span class="text-danger"> *</span></label>
  46. <input type="text" id="domain_url_name" class="form-control floating-label-control required" data-isdynamic="false" placeholder="Domain Name *" data-placeholder="Enter Domain Name" data-label="Domain Name *" autocomplete="off" /> </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="bg-white card-footer footer " id="CreateAppFooter ">
  53. <button id="btn_CloseApp" class="btn btn-secondary btn-sm mr-auto ">Close</button>
  54. <button id="btn_SaveApp" class="btn btn-primary btn-sm pull-right ">Save</button>
  55. </div>
  56. </div>
  57. </form>`;
  58. return html;
  59. }
  60. load(id, containerid, callback) {
  61. $("#btn_CloseApp").click(function () {
  62. $('#' + containerid).modal('hide');
  63. $('#' + containerid).remove();
  64. });
  65. $("#btn_SaveApp").click(function () {
  66. event.preventDefault();
  67. var url = $("#domain_url_name").val();
  68. if (url.toString().length > 0) {
  69. var obj = {
  70. DomainUrl: url,
  71. TenantId: Unibase.Platform.Membership.Infos.Identity.getCurrentUser().tenantId
  72. };
  73. Unibase.Platform.Common.Managers.CommonManager.Instance().saveDomain(obj).then((res) => {
  74. if (res.status == Unibase.Data.Status.Error) {
  75. MessageHelper.Instance().showError(res.message, "div_domainmessage");
  76. }
  77. else {
  78. MessageHelper.Instance().showSuccess(res.message, "div_domainmessage");
  79. $('#' + containerid).modal('hide');
  80. $('#' + containerid).remove();
  81. }
  82. });
  83. }
  84. else {
  85. MessageHelper.Instance().showError("Enter Url", "div_domainmessage");
  86. }
  87. });
  88. }
  89. init(id) {
  90. var instance = this;
  91. var html = instance.html(id, "");
  92. $("." + id).append(html);
  93. instance.load(0, id, null);
  94. }
  95. static Instance() {
  96. if (this.instance === undefined) {
  97. this.instance = new Domain();
  98. }
  99. return this.instance;
  100. }
  101. }
  102. Components.Domain = Domain;
  103. })(Components = Common.Components || (Common.Components = {}));
  104. })(Common = Platform.Common || (Platform.Common = {}));
  105. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  106. })(Unibase || (Unibase = {}));