graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 3.02 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{40:function(e,t,n){"use strict";n.r(t);n(2),n(9);function s(e,t,n,s){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,"Error getting settings")}}))},e.getSettings(),e.setSettings=function(){e.loader=!0,s.toggleStatistics(e.settings.statistics).then((function(){n.close(),t.success("Settings have been saved")}),(function(e){const n=getError(e.data);t.error(n,"Error saving settings")}))},e.submitForm=function(){e.setSettings()},e.cancel=function(){n.dismiss("cancel")}}function i(e,t,n,s){e.loader=!0,t.checkLicenseHardcoded().success((function(e){s.isLicenseHardcoded="true"===e})).error((function(){s.isLicenseHardcoded=!1,n.error("Error checking license availability")})).then((function(){t.getLicenseInfo().success((function(t){e.loader=!1,e.license=t})).error((function(){e.loader=!1,e.license={message:"No license was set.",valid:!1}}))}))}function c(e,t,n,s,i,c,o){e.$on("securityInit",(function(){o.isAdmin()||n.path("/license")})),e.sendLicenseToValidateAndActivate=a;const r=$(".license-textarea");function a(e){t.sendLicenseToValidate(e).success((function(n){"Invalid"!==n.licensee?(r.val(e),function(e,n){s.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",resolve:{license:function(){return e}}}).result.then((function(){!function(e){e||(e=r.val());if(e){const n=atob(e.replace(/\s/g,""));t.registerLicense(n).success((function(){c.history.back()})).error((function(){i.error("Error registering GraphDB license")}))}else i.error("No license code available in textarea")}(n)}))}(n,e)):(r.val(""),i.error(n.message))})).error((function(){i.error("Invalid license")}))}e.$watch("currentFile",(function(){if(e.currentFile){const n=e.currentFile;t.extractFromLicenseFile(n).success((function(e){a(e)})).error((function(){i.error("Could not upload file")}))}})),e.getBackToPreviousPage=function(){c.history.back()}}function o(e,t,n){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")},e.license=n}function r(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",s).controller("ValidateLicenseModalCtrl",o).controller("LicenseCtrl",i).controller("RegisterLicenseCtrl",c).controller("LoaderSamplesCtrl",r),s.$inject=["$scope","toastr","$uibModalInstance","LicenseRestService"],i.$inject=["$scope","LicenseRestService","toastr","$rootScope"],c.$inject=["$scope","LicenseRestService","$location","$uibModal","toastr","$window","$jwtAuth"],o.$inject=["$scope","$uibModalInstance","license"],r.$inject=["$scope"]}}]);
//# sourceMappingURL=94.afe4c166f07dbf1bc30f.bundle.js.map