UNPKG

graphdb-workbench

Version:
2 lines 3.44 kB
export const __webpack_esm_id__=46570;export const __webpack_esm_ids__=[46570];export const __webpack_esm_modules__={46570:(e,t,n)=>{n(82493),n(98599);var s=n(57154);function i(e,t,n,s,i){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,s.getStatistics().then(function(t){e.settings.statistics="true"===t.data,e.supportsStatistics=!0},function(n){if(404===n.status)e.supportsStatistics=!1;else{const e=getError(n.data);t.error(e,i.instant("error.getting.settings"))}})},e.getSettings(),e.setSettings=function(){e.loader=!0,s.toggleStatistics(e.settings.statistics).then(function(){n.close(),t.success(i.instant("saving.settings.success"))},function(e){const n=getError(e.data);t.error(n,i.instant("saving.settings.error"))})},e.submitForm=function(){e.setSettings()},e.cancel=function(){n.dismiss("cancel")}}function r(e,t,n,i,r,o){const c=(0,s.service)(s.LicenseService),a=(0,s.service)(s.LicenseContextService);e.isLicenseHardcoded=!0,e.removeLicense=function(){i.openSimpleModal({title:r.instant("confirm.operation"),message:r.instant("remove.license.warning.msg"),warning:!0}).result.then(()=>c.unregisterLicense()).then(()=>c.updateLicenseStatus()).then(()=>o.applyTrackingConsent()).catch(e=>{const n=getError(e.data,e.status);t.error(n,r.instant("common.error"))})};const l=a.onIsLicenseHardcodedChanged(t=>e.isLicenseHardcoded=t);e.$on("$destroy",()=>{l?.()})}function o(e,t,n,i,r,o,c){const a=(0,s.service)(s.AuthorizationService),l=(0,s.service)(s.LicenseService);e.isLicenseHardcodedValue=!0,a.isAdmin()||s.RoutingUtil.navigate("license"),e.validateLicenseCode=e=>{d(e)};const u=$(".license-textarea");e.$watch("currentFile",function(){if(e.currentFile){const t=e.currentFile;l.extractFromLicenseFile(t).then(e=>{d(e)}).catch(()=>{i.error(c.instant("could.not.upload.file.error"))})}}),e.getBackToPreviousPage=function(){r.history.back()};const d=e=>{l.validateLicense(e).then(t=>{t.present?(u.val(e),function(e,t){n.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then(function(){!function(e){if(e||(e=u.val()),e){const t=atob(e.replace(/\s/g,""));l.registerLicense(t).then(()=>{const e=(0,s.service)(s.NavigationContextService).getPreviousRoute();(0,s.navigate)(e??"./")}).catch(e=>{const t=getError(e);i.error(t,c.instant("license.register.error"))})}else i.error(c.instant("no.license.code.error"))}(t)})}(t,e)):(u.val(""),i.error(t.message))}).catch(()=>{i.error(c.instant("invalid.license"))})}}function c(e,t,n){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")},e.license=n}function a(e){e.loader=!0,e.setLoader=function(t){e.loader=t}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",i).controller("ValidateLicenseModalCtrl",c).controller("LicenseCtrl",r).controller("RegisterLicenseCtrl",o).controller("LoaderSamplesCtrl",a),i.$inject=["$scope","toastr","$uibModalInstance","LicenseRestService","$translate"],r.$inject=["$scope","toastr","$rootScope","ModalService","$translate","TrackingService"],o.$inject=["$scope","$location","$uibModal","toastr","$window","$jwtAuth","$translate"],c.$inject=["$scope","$uibModalInstance","license"],a.$inject=["$scope"]}}; //# sourceMappingURL=46570.063324dafc21def5312c.bundle.js.map