PluginProbe
ElasticPress / 5.0.1
ElasticPress v5.0.1
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / dist / js / status-report-script.js

status-report-script.js in ElasticPress 5.0.1, at dist/js/status-report-script.js

1 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 !function(){"use strict";var e={5251:function(e,t,s){var r=s(9196),n=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var i=Symbol.for;n=i("react.element"),t.Fragment=i("react.fragment")}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,s){var r,i={},c=null,p=null;for(r in void 0!==s&&(c=""+s),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(p=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:n,type:e,key:c,ref:p,props:i,_owner:o.current}}t.jsx=c,t.jsxs=c},5893:function(e,t,s){e.exports=s(5251)},9196:function(e){e.exports=window.React}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,s),i.exports}!function(){var e=window.wp.element,t=window.wp.i18n,r=window.wp.components,n=window.wp.data,i=window.wp.notices,o=s(5893);const a=(0,e.createContext)(),l=({children:t,title:s})=>{const{createNotice:l,removeNotice:c}=(0,n.useDispatch)(i.store),{notices:p}=(0,n.useSelect)((e=>({notices:e(i.store).getNotices()})),[]),d=(0,e.useMemo)((()=>({createNotice:l,removeNotice:c})),[l,c]);return(0,o.jsx)(a.Provider,{value:d,children:(0,o.jsxs)("div",{className:"ep-settings-page",children:[(0,o.jsxs)("div",{className:"ep-settings-page__wrap",children:[(0,o.jsx)("h1",{className:"ep-settings-page__title",children:s}),t]}),(0,o.jsx)(r.SnackbarList,{className:"ep-settings-page__snackbar-list",notices:p,onRemove:e=>c(e)})]})})},{plainTextReport:c,reports:p}=window.epStatusReport;var d=window.wp.compose,u=window.wp.dom,x=window.wp.htmlEntities,h=({value:t})=>{if("object"===typeof t){const e=JSON.stringify(t,null,2);return(0,o.jsx)("pre",{children:e})}if("string"===typeof t){if(0===t.indexOf("{"))try{const e=JSON.parse(t),s=JSON.stringify(e,null,2);return(0,o.jsx)("pre",{children:s})}catch(e){return(0,o.jsx)("pre",{children:t})}return(0,o.jsx)(e.RawHTML,{children:t})}return t.toString()},f=({actions:t,groups:s,id:n,messages:i,title:a})=>s.length<1?null:(0,o.jsxs)(r.Panel,{id:a,className:"ep-status-report",children:[(0,o.jsxs)(r.PanelHeader,{children:[(0,o.jsx)("h2",{id:n,children:a}),t.map((({href:e,label:t})=>(0,o.jsx)(r.Button,{href:(0,x.decodeEntities)(e),isDestructive:!0,isSecondary:!0,isSmall:!0,children:t},e)))]}),i.map((({message:t,type:s})=>(0,o.jsx)(r.Notice,{status:s,isDismissible:!1,children:(0,o.jsx)(e.RawHTML,{children:(0,u.safeHTML)(t)})}))),s.map((({fields:e,title:t})=>(0,o.jsx)(r.PanelBody,{title:(0,x.decodeEntities)(t),initialOpen:!1,children:(0,o.jsxs)("table",{cellPadding:"0",cellSpacing:"0",className:"wp-list-table widefat striped",children:[(0,o.jsxs)("colgroup",{children:[(0,o.jsx)("col",{}),(0,o.jsx)("col",{})]}),(0,o.jsx)("tbody",{children:Object.entries(e).map((([e,{description:t="",label:s,value:r}])=>(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[s,t?(0,o.jsx)("small",{children:t}):null]}),(0,o.jsx)("td",{children:(0,o.jsx)(h,{value:r})})]},e)))})]})},t)))]}),j=({plainTextReport:s,reports:n})=>{const{createNotice:i}=(0,e.useContext)(a),l=`data:text/plain;charset=utf-8,${encodeURIComponent(s)}`,c=(0,d.useCopyToClipboard)(s,(()=>{i("info",(0,t.__)("Copied status report to clipboard.","elasticpress"))}));return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:(0,t.__)("This screen provides a list of information related to ElasticPress and synced content that can be helpful during troubleshooting. This list can also be copy/pasted and shared as needed.","elasticpress")}),(0,o.jsx)("p",{children:(0,o.jsxs)(r.Flex,{justify:"start",children:[(0,o.jsx)(r.FlexItem,{children:(0,o.jsx)(r.Button,{download:"elasticpress-report.txt",href:l,variant:"primary",children:(0,t.__)("Download status report","elasticpress")})}),(0,o.jsx)(r.FlexItem,{children:(0,o.jsx)(r.Button,{ref:c,variant:"secondary",children:(0,t.__)("Copy status report to clipboard","elasticpress")})})]})}),Object.entries(n).map((([e,{actions:t,groups:s,messages:r,title:n}])=>(0,o.jsx)(f,{actions:t,groups:s,id:e,messages:r,title:n},e)))]})};const m=()=>(0,o.jsx)(l,{title:(0,t.__)("Status Report","elasticpress"),children:(0,o.jsx)(j,{plainTextReport:c,reports:p})});if("function"===typeof e.createRoot){(0,e.createRoot)(document.getElementById("ep-status-reports")).render((0,o.jsx)(m,{}))}else(0,e.render)((0,o.jsx)(m,{}),document.getElementById("ep-status-reports"))}()}();