File manager - Edit - /usr/local/cpanel/base/frontend/jupiter/security/tls_wizard/views/PendingCertificatesController.min.js
Back
define(["lodash","angular","cjt/util/locale","app/views/Certificate","cjt/modules","cjt/directives/spinnerDirective","app/services/CertificatesService","app/services/LocationService","cjt/directives/actionButtonDirective"],(function(e,t,a){"use strict";t.module("App").controller("PendingCertificatesController",["$scope","$location","$routeParams","$anchorScroll","$timeout","$window","CertificatesService","LocationService","Certificate","alertService",function(i,r,s,n,o,c,d,l,_,u){var p={};CPANEL.PAGE.products.forEach((function(e){p[e.provider]=e.provider_display_name})),i.show_introduction_block=d.show_introduction_block,i.get_provider_display_name=function(e){return p[e]||e},i.html_escape=e.escape,i.get_time=function(){return parseInt(Date.now()/1e3,10)},i.LOCALE=a,i.checking_pending_queue=!1,i.cjt1_LOCALE=window.LOCALE,i.pending_certificates=d.get_pending_certificates(),i.expanded_cert=null,i.get_product_by_id=function(e,t){return d.get_product_by_id(e,t)},i.get_cert_title=function(e){var t=e.domains.sort((function(e,t){return e.length===t.length?0:e.length>t.length?1:-1}));return 1===t.length?t[0]:a.maketext("“[_1]” and [quant,_2,other domain,other domains]",t[0],t.length-1)},i.check_pending_queue=function(){return d.process_ssl_pending_queue().then((function(r){var s=[],n=0;if(r.data.forEach((function(t){if(n+=1*t.deleted,t.installed)s.push(t);else{var r,o,c=t.domains,d=i.get_provider_display_name(t.provider),l=e.escape(d),_=e.escape(c[0]),p=c.length-1;switch(t.last_status_code){case"OrderCanceled":case"OrderItemCanceled":o="info",r=p?a.maketext("“[_1]” reports that the certificate for “[_2]” and [quant,_3,other domain,other domains] has been canceled.",l,_,p):a.maketext("“[_1]” reports that the certificate for “[_2]” has been canceled.",l,_);break;case"CA:revoked":o="danger",r=p?a.maketext("“[_1]” reports that the certificate authority issued but then revoked the certificate for “[_2]” and [quant,_3,other domain,other domains].",l,_,p):a.maketext("“[_1]” reports that the certificate authority issued but then revoked “[_2]”’s certificate.",l,_);break;case"CA:rejected":o="danger",r=p?a.maketext("“[_1]” reports that the certificate authority rejected the request for a certificate for “[_2]” and [quant,_3,other domain,other domains].",l,_,p):a.maketext("“[_1]” reports that the certificate authority rejected the request for a certificate for “[_2]”.",l,_)}t.last_status_message&&(r+=" ("+e.escape(t.last_status_message)+")"),u.add({type:o,message:r,closeable:!0,replace:!1,group:"tlsWizard"})}})),s.length){var o=[];t.forEach(s,(function(e){o=o.concat(e.vhost_names)})),u.add({type:"success",message:a.maketext("[numerate,_2,A certificate,Certificates] for the following [numerate,_2,website was,websites were] available, and the system has installed [numerate,_2,it,them]: [list_and_quoted,_1]",o,s.length),closeable:!0,replace:!1,autoClose:1e4,group:"tlsWizard"})}else n||u.add({type:"info",message:a.maketext("The system processed the pending certificate queue successfully, but [numerate,_1,your pending certificate was not,none of your pending certificates were] available.",r.data.length),closeable:!0,replace:!1,group:"tlsWizard"});return d.fetch_pending_certificates().then((function(){i.pending_certificates=d.get_pending_certificates(),0===i.pending_certificates.length?(u.add({type:"info",message:a.maketext("You have no more pending [asis,SSL] certificates.")+" "+a.maketext("You will now return to the beginning of the wizard."),closeable:!0,replace:!1,group:"tlsWizard"}),d.reset(),CPANEL.PAGE.installed_hosts=null,CPANEL.PAGE.domains=null,i.get_new_certs()):(i.prepare_pending_certificates(),i.expanded_cert&&t.forEach(i.pending_certificates,(function(e){e.order_item_id===i.expanded_cert&&i.load_certificate_details(e)})))}))}))},i.reset_and_create=function(){d.hard_reset(),i.get_new_certs()},i.get_new_certs=function(){l.go_to_last_create_route().search("")},i.cancel_purchase=function(t){d.cancel_pending_ssl_certificate_and_poll(t.provider,t.order_item_id).then((function(r){var s=r.data[1].parsedResponse.data,n=s.certificate_pem,o=e.escape(i.get_provider_display_name(t.provider));return n?(u.add({type:"info",message:a.maketext("You have canceled this order, but “[_1]” already issued the certificate. The system will now install it. ([output,url,_2,Do you need help with this order?])",o,t.support_uri),closeable:!0,replace:!1,group:"tlsWizard"}),d.install_certificate(n,t.vhost_names).then((function(){u.add({type:"success",message:a.maketext("The system has installed the new [asis,SSL] certificate on to the [numerate,_1,website,websites] [list_and_quoted,_2].",t.vhost_names.length,t.vhost_names),closeable:!0,replace:!1,autoClose:1e4,group:"tlsWizard"})}),(function(e){u.add({type:"danger",message:a.maketext("The system failed to install the new [asis,SSL] certificate because of an error: [_1]",e),group:"tlsWizard"})}))):"RequiresApproval"===s.status_code?u.add({type:"info",message:a.maketext("The system has canceled the request for this certificate; however, “[_1]” was already waiting on approval before processing your order. To ensure that this certificate order is canceled, you must [output,url,_2,contact support directly].",o,t.support_uri),closeable:!0,replace:!1,group:"tlsWizard"}):"OrderCanceled"===s.status_code?u.add({type:"info",message:a.maketext("This certificate’s order (ID “[_1]”) was already canceled directly via “[_2]”.",e.escape(t.order_id),o),closeable:!0,replace:!1,group:"tlsWizard"}):"OrderItemCanceled"===s.status_code?u.add({type:"info",message:a.maketext("This certificate (order item ID “[_1]”) was already canceled directly via “[_2]”.",e.escape(t.order_item_id),o),closeable:!0,replace:!1,group:"tlsWizard"}):u.add({type:"success",message:a.maketext("The system has canceled this certificate. Your credit card should not be charged for this order."),closeable:!0,replace:!1,autoClose:1e4,group:"tlsWizard"}),CPANEL.PAGE.pending_certificates=null,d.fetch_pending_certificates().then((function(){i.pending_certificates=d.get_pending_certificates(),0===i.pending_certificates.length?i.get_new_certs():i.prepare_pending_certificates()}),(function(e){u.add({type:"danger",message:a.maketext("The system encountered an error as it attempted to refresh your pending certificates: [_1]",e),group:"tlsWizard"})}))}),(function(e){u.add({type:"danger",message:a.maketext("The system encountered an error as it attempted to cancel your transaction: [_1]",e),group:"tlsWizard"})}))};var m=function(e,t){e.domainDetails&&(t.orderDetails=e.domainDetails[t.domain])};i.get_displayed_domains=function(e){var t=e.domains,a=e.display_meta.items_per_page*(e.display_meta.current_page-1),i=Math.min(t.length,a+e.display_meta.items_per_page);if(e.displayed_domains&&e.display_meta.start===a&&e.display_meta.limit===i&&e.displayed_domains.length)return e.displayed_domains;e.display_meta.start=a,e.display_meta.limit=i;for(var r=[],s=e.display_meta.start;s<e.display_meta.limit;s++){var n={domain:t[s]};m(e,n),r.push(n)}return e.displayed_domains=r,e.displayed_domains},i.get_cert_status=function(e){var t=function(e,t){var r;if("RequiresApproval"===e){var s=i.get_providerDisplayName(t);r=a.maketext("Waiting for “[_1]” to approve your order …",s)}return r}(e.last_status_code,e.provider);if(t)return t;var r=e.status;if("unconfirmed"===r)return a.maketext("Pending Completion of Payment");if("confirmed"===r){if(e.statusDetails&&e.statusDetails.loaded){var s=e.statusDetails.details.filter((function(e){return"not-completed"===e.rawStatus}));return 0===s.length?a.maketext("Payment Completed.")+" "+a.maketext("Awaiting Validation …"):1===s.length?a.maketext("Payment Completed.")+" "+s[0].status:a.maketext("Payment Completed.")+" "+a.maketext("Multiple validation items pending …")}return a.maketext("Payment Completed.")+" "+a.maketext("Waiting for the provider to issue the certificate …")}return a.maketext("Status Unknown")},i.toggle_cert_collapse=function(e){i.expanded_cert===e.order_item_id?i.collapse_cert(e):i.expand_cert(e)},i.expand_cert=function(e){r.search("orderItemID",e.order_item_id),i.expanded_cert=e.order_item_id,e.statusDetails||i.load_certificate_details(e),n(i.expanded_cert)},i.load_certificate_details=function(e){e.domainDetails={},e.statusDetails={loaded:!1,loading:!0,details:[]},d.getCertificateStatusDetails(e.provider,e.order_item_id).then((function(i){e.statusDetails.loaded=!0,e.statusDetails.details=i.statusDetails,e.domainDetails={},t.forEach(e.statusDetails.details,(function(e){"completed"===e.rawStatus?(e.rowStatusClass="success",delete e.actionURL):e.rowStatusClass="warning"})),t.forEach(e.domains,(function(t){var r=i.domainDetails[t];r&&(e.hasDomainDetails=!0),e.domainDetails[t]={},"NOTVALIDATED"===r?(e.domainDetails[t].rowStatusClass="warning",e.domainDetails[t].rowStatusLabel=a.maketext("Not Validated"),e.domainDetails[t].domainDetailDescription=a.maketext("The [output,abbr,CA,Certificate Authority] received the request but has not yet performed a [output,abbr,DCV,Domain Control Validation] check.")):"VALIDATED"===r?(e.domainDetails[t].rowStatusClass="success",e.domainDetails[t].rowStatusLabel=a.maketext("Validated"),e.domainDetails[t].domainDetailDescription=a.maketext("The [output,abbr,CA,Certificate Authority] validated the certificate.")):"AWAITINGBRANDING"===r?(e.domainDetails[t].rowStatusClass="info",e.domainDetails[t].rowStatusLabel=a.maketext("Awaiting Branding …"),e.domainDetails[t].domainDetailDescription=a.maketext("The [output,abbr,CA,Certificate Authority] received the request and must now process the brand verification approval.")):(e.domainDetails[t].rowStatusClass="info",e.domainDetails[t].rowStatusLabel=a.maketext("Unknown"),e.domainDetails[t].domainDetailDescription=a.maketext("Unknown."))})),t.forEach(e.displayed_domains,(function(t){m(e,t)}))})).finally((function(){e.statusDetails.loading=!1}))},i.collapse_cert=function(){r.search(),i.expanded_cert=null},i.continue_purchase=function(e){var a=d.get_all_domains();d.reset_purchasing_certificates();var i=new _,s=[],n=d.get_product_by_id(e.provider,e.product_id),o=0;i.set_domains(s),i.set_virtual_hosts(e.vhost_names),i.set_product(n),t.forEach(e.domains,(function(e){t.forEach(a,(function(t){t.domain===e&&(s.push(t),o+=t.is_wildcard?n.wildcard_price:n.price)}))})),i.set_price(o),d.add_new_certificate(i),d.save(),r.path("/purchase/"+e.provider+"/login/").search({order_id:e.order_id})},i.rebuild_local_storage=function(){var e={},a=d.get_all_domains(),r=d.get_virtual_hosts();t.forEach(i.pending_certificates,(function(i){e[i.order_id]=e[i.order_id]||{access_token:"",certificates:[],order_id:i.order_id,checkout_url:i.checkout_url},e[i.order_id].certificates.push(i),t.forEach(i.domains,(function(e){t.forEach(a,(function(t){t.domain===e&&(t.selected=!0)}))})),t.forEach(i.vhost_names,(function(e){var t=d.get_virtual_host_by_display_name(e),a=r[t],s=d.get_product_by_id(i.provider,i.product_id);a&&a.set_product(s)}))})),t.forEach(e,(function(e){d.add_order(e)})),d.save()},i.restore_orders=function(){d.clear_stored_settings();var t=d.fetch_domains();e.isFunction(t.finally)?t.then(i.rebuild_local_storage):t&&i.rebuild_local_storage()},i.prepare_pending_certificates=function(){i.pending_certificates.forEach((function(e){e.support_uri_is_http=/^http/.test(e.support_uri),e.display_meta=e.display_meta||{items_per_page:10,current_page:1}}))},i.init=function(){i.restore_orders(),i.prepare_pending_certificates(),s.orderItemID&&(i.expanded_cert=s.orderItemID,t.forEach(i.pending_certificates,(function(e){e.order_item_id===i.expanded_cert&&i.load_certificate_details(e)})),o((function(){n(i.expanded_cert)}),500))},i.init()}])}));
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.05 |
proxy
|
phpinfo
|
Settings