diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml deleted file mode 100644 index d90f38a..0000000 --- a/.github/workflows/cherry-pick.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: - pull_request: - branches: - - main - types: ["closed"] - -jobs: - cherry-pick-0-2: - runs-on: ubuntu-latest - name: Cherry pick into 0.2 - if: ${{ contains(github.event.pull_request.labels.*.name, 'release-0.2') && github.event.pull_request.merged == true }} - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Cherry pick into 0.2 - uses: carloscastrojumo/github-cherry-pick-action@v1.0.9 - with: - branch: 0.2 - labels: | - cherry-pick diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml deleted file mode 100644 index 190abb4..0000000 --- a/.github/workflows/code-style.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Code Style -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -jobs: - cs: - if: github.event_name != 'schedule' - uses: shopware/github-actions/.github/workflows/cs-fixer.yml@main - phpstan: - uses: shopware/github-actions/.github/workflows/phpstan.yml@main - with: - extensionName: FroshTools - shopwareVersion: 6.5.x diff --git a/.github/workflows/qodana.yml b/.github/workflows/qodana.yml deleted file mode 100644 index 3371db3..0000000 --- a/.github/workflows/qodana.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Qodana -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - qodana: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: 'Qodana Scan' - uses: JetBrains/qodana-action@main - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/.github/workflows/store.yml b/.github/workflows/store.yml deleted file mode 100644 index b0a9c5a..0000000 --- a/.github/workflows/store.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Build extension -on: - workflow_dispatch: - push: - branches: - - '1.0' - -jobs: - build: - uses: FriendsOfShopware/actions/.github/workflows/store-shopware-cli.yml@main - with: - extensionName: ${{ github.event.repository.name }} - secrets: - accountUser: ${{ secrets.ACCOUNT_USER }} - accountPassword: ${{ secrets.ACCOUNT_PASSWORD }} - ghToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 622a7fb..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -/.php-cs-fixer.cache -/composer.lock -/vendor -/src/Resources/public/ -/src/Resources/app/administration/node_modules/ diff --git a/.shopware-extension.yml b/.shopware-extension.yml deleted file mode 100644 index 0a28262..0000000 --- a/.shopware-extension.yml +++ /dev/null @@ -1,108 +0,0 @@ -store: - availabilities: - - German - - International - default_locale: en_GB - localizations: - - de_DE - - en_GB - categories: - - Administration - type: extension - icon: src/Resources/store/icon.png - automatic_bugfix_version_compatibility: true - description: - de: file:src/Resources/store/de.md - en: file:src/Resources/store/en.md - installation_manual: - de: file:src/Resources/store/de_manual.md - en: file:src/Resources/store/en_manual.md - tags: - de: - - Tools - - scheduled event - - scheduled task - en: - - tools - - scheduled event - - scheduled task - videos: - de: [] - en: [] - highlights: - de: - - Geplanter Task-Manager - - Warteschlangen-Manager - - Log-Viewer - en: - - Scheduled Task Manager - - Queue Manager - - Log viewer - features: - de: - - Task-Protokollierung - - System-Status - - Cache-Verwaltung - - Geplanter Task-Manager - - Warteschlangen-Manager - - Log-Viewer - en: - - System Status - - Cache manager - - Scheduled Task Manager - - Queue Manager - - Task Logging - - Log viewer - faq: - de: [] - en: [] - images: - - file: src/Resources/store/img-0.png - activate: - de: true - en: true - preview: - de: true - en: true - priority: 0 - - file: src/Resources/store/img-1.png - activate: - de: true - en: true - preview: - de: false - en: false - priority: 0 - - file: src/Resources/store/img-2.png - activate: - de: true - en: true - preview: - de: false - en: false - priority: 0 - - file: src/Resources/store/img-3.png - activate: - de: true - en: true - preview: - de: false - en: false - priority: 0 - - file: src/Resources/store/img-4.png - activate: - de: true - en: true - preview: - de: false - en: false - priority: 0 -build: - zip: - assets: - enable_es_build_for_admin: true - enable_es_build_for_storefront: true - npm_strict: true - -changelog: - enabled: true diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md new file mode 100755 index 0000000..a0c0ca1 --- /dev/null +++ b/CHANGELOG_en-GB.md @@ -0,0 +1,3 @@ +# 1.3.4 +- [Update composer.json](/b930c7a) +- [Delete src/Components/Health/Checker/PerformanceChecker/MySQL8Checker.php](/3f83ee5) \ No newline at end of file diff --git a/src/Resources/public/administration/css/frosh-tools.css b/src/Resources/public/administration/css/frosh-tools.css new file mode 100755 index 0000000..0b627d4 --- /dev/null +++ b/src/Resources/public/administration/css/frosh-tools.css @@ -0,0 +1 @@ +.frosh-tools-tab-index__health-card .sw-card__content{padding:0}.frosh-tools-tab-index__health-card .sw-card__content .sw-label{text-align:center;min-width:70px}.frosh-tools-tab-cache__cache-card .sw-card__content{padding:0}.frosh-tools-tab-cache__cache-card .sw-card__content .sw-label{text-align:center}.frosh-tools-tab-queue__manager-card .sw-card__toolbar{display:flex;justify-content:space-between}.frosh-tools-tab-queue__manager-card .sw-card__content{padding:0}.frosh-tools-tab-scheduled__tasks-card .sw-card__toolbar{display:flex;justify-content:space-between}.frosh-tools-tab-scheduled__tasks-card .sw-card__content{padding:0}.frosh-tools-tab-scheduled__tasks-card .sw-data-grid__cell--nextExecutionTime .sw-field--datepicker{display:flex;gap:10px}.frosh-tools-tab-scheduled__tasks-card .sw-data-grid__cell--nextExecutionTime.is--compact .sw-field--datepicker input{padding-top:10px;padding-bottom:10px}.frosh-tools-tab-logs__logs-card .sw-card__content{padding:0}.frosh-tools-tab-logs__logs-card .sw-card__toolbar{display:grid;grid-template-columns:auto 1fr;grid-gap:20px}.frosh-tools-tab-logs__logs-card .sw-single-select{margin:0}.frosh-tools-tab-state-machines__state-machines-card .sw-card__toolbar .sw-select{margin:0;display:flex;flex-direction:row;gap:10px;align-items:center}.frosh-tools-tab-state-machines__state-machines-card .sw-card__toolbar .sw-select .sw-field__label{gap:6px;margin-bottom:2px}.frosh-tools-tab-state-machines__state-machines-card .sw-card__toolbar .sw-select .sw-block-field__block{flex:1}.frosh-tools-tab-state-machines__state-machines-card .sw-card__content{padding:0}.frosh-tools-tab-state-machines__state-machines-card .sw-card__content .sw-label{text-align:center}.frosh-tools .sw-tabs{width:1330px;margin:0 auto}.frosh-tools .sw-card-view__content{padding-top:0;width:1330px;margin:0 auto}.frosh-tools .sw-card-view{position:initial;height:initial;width:initial}.sw-version__status.has-permission{cursor:pointer} diff --git a/src/Resources/public/administration/js/frosh-tools.js b/src/Resources/public/administration/js/frosh-tools.js new file mode 100755 index 0000000..4439f34 --- /dev/null +++ b/src/Resources/public/administration/js/frosh-tools.js @@ -0,0 +1,623 @@ +(()=>{var x=Object.create;var F=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var re=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of te(t))!ae.call(e,r)&&r!==s&&F(e,r,{get:()=>t[r],enumerable:!(a=ee(t,r))||a.enumerable});return e};var ne=(e,t,s)=>(s=e!=null?x(se(e)):{},re(t||!e||!e.__esModule?F(s,"default",{value:e,enumerable:!0}):s,e));var X=ie((Mt,$)=>{var h=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},b=-1,_=1,m=0;h.Diff=function(e,t){return[e,t]};h.prototype.diff_main=function(e,t,s,a){typeof a>"u"&&(this.Diff_Timeout<=0?a=Number.MAX_VALUE:a=new Date().getTime()+this.Diff_Timeout*1e3);var r=a;if(e==null||t==null)throw new Error("Null input. (diff_main)");if(e==t)return e?[new h.Diff(m,e)]:[];typeof s>"u"&&(s=!0);var i=s,n=this.diff_commonPrefix(e,t),o=e.substring(0,n);e=e.substring(n),t=t.substring(n),n=this.diff_commonSuffix(e,t);var l=e.substring(e.length-n);e=e.substring(0,e.length-n),t=t.substring(0,t.length-n);var c=this.diff_compute_(e,t,i,r);return o&&c.unshift(new h.Diff(m,o)),l&&c.push(new h.Diff(m,l)),this.diff_cleanupMerge(c),c};h.prototype.diff_compute_=function(e,t,s,a){var r;if(!e)return[new h.Diff(_,t)];if(!t)return[new h.Diff(b,e)];var i=e.length>t.length?e:t,n=e.length>t.length?t:e,o=i.indexOf(n);if(o!=-1)return r=[new h.Diff(_,i.substring(0,o)),new h.Diff(m,n),new h.Diff(_,i.substring(o+n.length))],e.length>t.length&&(r[0][0]=r[2][0]=b),r;if(n.length==1)return[new h.Diff(b,e),new h.Diff(_,t)];var l=this.diff_halfMatch_(e,t);if(l){var c=l[0],f=l[1],u=l[2],d=l[3],g=l[4],p=this.diff_main(c,u,s,a),v=this.diff_main(f,d,s,a);return p.concat([new h.Diff(m,g)],v)}return s&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,a):this.diff_bisect_(e,t,a)};h.prototype.diff_lineMode_=function(e,t,s){var a=this.diff_linesToChars_(e,t);e=a.chars1,t=a.chars2;var r=a.lineArray,i=this.diff_main(e,t,!1,s);this.diff_charsToLines_(i,r),this.diff_cleanupSemantic(i),i.push(new h.Diff(m,""));for(var n=0,o=0,l=0,c="",f="";n=1&&l>=1){i.splice(n-o-l,o+l),n=n-o-l;for(var u=this.diff_main(c,f,!1,s),d=u.length-1;d>=0;d--)i.splice(n,0,u[d]);n=n+u.length}l=0,o=0,c="",f="";break}n++}return i.pop(),i};h.prototype.diff_bisect_=function(e,t,s){for(var a=e.length,r=t.length,i=Math.ceil((a+r)/2),n=i,o=2*i,l=new Array(o),c=new Array(o),f=0;fs);w++){for(var S=-w+g;S<=w-p;S+=2){var y=n+S,k;S==-w||S!=w&&l[y-1]a)p+=2;else if(A>r)g+=2;else if(d){var E=n+u-S;if(E>=0&&E=M)return this.diff_bisectSplit_(e,t,k,A,s)}}}for(var T=-w+v;T<=w-C;T+=2){var E=n+T,M;T==-w||T!=w&&c[E-1]a)C+=2;else if(R>r)v+=2;else if(!d){var y=n+u-T;if(y>=0&&y=M)return this.diff_bisectSplit_(e,t,k,A,s)}}}}return[new h.Diff(b,e),new h.Diff(_,t)]};h.prototype.diff_bisectSplit_=function(e,t,s,a,r){var i=e.substring(0,s),n=t.substring(0,a),o=e.substring(s),l=t.substring(a),c=this.diff_main(i,n,!1,r),f=this.diff_main(o,l,!1,r);return c.concat(f)};h.prototype.diff_linesToChars_=function(e,t){var s=[],a={};s[0]="";function r(l){for(var c="",f=0,u=-1,d=s.length;ua?e=e.substring(s-a):st.length?e:t,a=e.length>t.length?t:e;if(s.length<4||a.length*2=p.length?[k,A,E,M,y]:null}var n=i(s,a,Math.ceil(s.length/4)),o=i(s,a,Math.ceil(s.length/2)),l;if(!n&&!o)return null;o?n?l=n[4].length>o[4].length?n:o:l=o:l=n;var c,f,u,d;e.length>t.length?(c=l[0],f=l[1],u=l[2],d=l[3]):(u=l[0],d=l[1],c=l[2],f=l[3]);var g=l[4];return[c,f,u,d,g]};h.prototype.diff_cleanupSemantic=function(e){for(var t=!1,s=[],a=0,r=null,i=0,n=0,o=0,l=0,c=0;i0?s[a-1]:-1,n=0,o=0,l=0,c=0,r=null,t=!0)),i++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),i=1;i=g?(d>=f.length/2||d>=u.length/2)&&(e.splice(i,0,new h.Diff(m,u.substring(0,d))),e[i-1][1]=f.substring(0,f.length-d),e[i+1][1]=u.substring(d),i++):(g>=f.length/2||g>=u.length/2)&&(e.splice(i,0,new h.Diff(m,f.substring(0,g))),e[i-1][0]=_,e[i-1][1]=u.substring(0,u.length-g),e[i+1][0]=b,e[i+1][1]=f.substring(g),i++),i++}i++}};h.prototype.diff_cleanupSemanticLossless=function(e){function t(g,p){if(!g||!p)return 6;var v=g.charAt(g.length-1),C=p.charAt(0),w=v.match(h.nonAlphaNumericRegex_),S=C.match(h.nonAlphaNumericRegex_),y=w&&v.match(h.whitespaceRegex_),k=S&&C.match(h.whitespaceRegex_),A=y&&v.match(h.linebreakRegex_),E=k&&C.match(h.linebreakRegex_),M=A&&g.match(h.blanklineEndRegex_),T=E&&p.match(h.blanklineStartRegex_);return M||T?5:A||E?4:w&&!y&&k?3:y||k?2:w||S?1:0}for(var s=1;s=u&&(u=d,l=a,c=r,f=i)}e[s-1][1]!=l&&(l?e[s-1][1]=l:(e.splice(s-1,1),s--),e[s][1]=c,f?e[s+1][1]=f:(e.splice(s+1,1),s--))}s++}};h.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;h.whitespaceRegex_=/\s/;h.linebreakRegex_=/[\r\n]/;h.blanklineEndRegex_=/\n\r?\n$/;h.blanklineStartRegex_=/^\r?\n\r?\n/;h.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,s=[],a=0,r=null,i=0,n=!1,o=!1,l=!1,c=!1;i0?s[a-1]:-1,l=c=!1),t=!0)),i++;t&&this.diff_cleanupMerge(e)};h.prototype.diff_cleanupMerge=function(e){e.push(new h.Diff(m,""));for(var t=0,s=0,a=0,r="",i="",n;t1?(s!==0&&a!==0&&(n=this.diff_commonPrefix(i,r),n!==0&&(t-s-a>0&&e[t-s-a-1][0]==m?e[t-s-a-1][1]+=i.substring(0,n):(e.splice(0,0,new h.Diff(m,i.substring(0,n))),t++),i=i.substring(n),r=r.substring(n)),n=this.diff_commonSuffix(i,r),n!==0&&(e[t][1]=i.substring(i.length-n)+e[t][1],i=i.substring(0,i.length-n),r=r.substring(0,r.length-n))),t-=s+a,e.splice(t,s+a),r.length&&(e.splice(t,0,new h.Diff(b,r)),t++),i.length&&(e.splice(t,0,new h.Diff(_,i)),t++),t++):t!==0&&e[t-1][0]==m?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,a=0,s=0,r="",i="";break}e[e.length-1][1]===""&&e.pop();var o=!1;for(t=1;tt));n++)r=s,i=a;return e.length!=n&&e[n][0]===b?i:i+(t-r)};h.prototype.diff_prettyHtml=function(e){for(var t=[],s=/&/g,a=//g,i=/\n/g,n=0;n");switch(o){case _:t[n]=''+c+"";break;case b:t[n]=''+c+"";break;case m:t[n]=""+c+"";break}}return t.join("")};h.prototype.diff_text1=function(e){for(var t=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(t),r=this;function i(k,A){var E=k/t.length,M=Math.abs(s-A);return r.Match_Distance?E+M/r.Match_Distance:M?1:E}var n=this.Match_Threshold,o=e.indexOf(t,s);o!=-1&&(n=Math.min(i(0,o),n),o=e.lastIndexOf(t,s+t.length),o!=-1&&(n=Math.min(i(0,o),n)));var l=1<=p;w--){var S=a[e.charAt(w-1)];if(g===0?C[w]=(C[w+1]<<1|1)&S:C[w]=(C[w+1]<<1|1)&S|((d[w+1]|d[w])<<1|1)|d[w+1],C[w]&l){var y=i(g,w-1);if(y<=n)if(n=y,o=w-1,o>s)p=Math.max(1,2*s-o);else break}}if(i(g+1,s)>n)break;d=C}return o};h.prototype.match_alphabet_=function(e){for(var t={},s=0;s"u")a=e,r=this.diff_main(a,t,!0),r.length>2&&(this.diff_cleanupSemantic(r),this.diff_cleanupEfficiency(r));else if(e&&typeof e=="object"&&typeof t>"u"&&typeof s>"u")r=e,a=this.diff_text1(r);else if(typeof e=="string"&&t&&typeof t=="object"&&typeof s>"u")a=e,r=t;else if(typeof e=="string"&&typeof t=="string"&&s&&typeof s=="object")a=e,r=s;else throw new Error("Unknown call format to patch_make.");if(r.length===0)return[];for(var i=[],n=new h.patch_obj,o=0,l=0,c=0,f=a,u=a,d=0;d=2*this.Patch_Margin&&o&&(this.patch_addContext_(n,f),i.push(n),n=new h.patch_obj,o=0,f=u,l=c);break}g!==_&&(l+=p.length),g!==b&&(c+=p.length)}return o&&(this.patch_addContext_(n,f),i.push(n)),i};h.prototype.patch_deepCopy=function(e){for(var t=[],s=0;sthis.Match_MaxBits?(l=this.match_main(t,o.substring(0,this.Match_MaxBits),n),l!=-1&&(c=this.match_main(t,o.substring(o.length-this.Match_MaxBits),n+o.length-this.Match_MaxBits),(c==-1||l>=c)&&(l=-1))):l=this.match_main(t,o,n),l==-1)r[i]=!1,a-=e[i].length2-e[i].length1;else{r[i]=!0,a=l-n;var f;if(c==-1?f=t.substring(l,l+o.length):f=t.substring(l,c+this.Match_MaxBits),o==f)t=t.substring(0,l)+this.diff_text2(e[i].diffs)+t.substring(l+o.length);else{var u=this.diff_main(o,f,!1);if(o.length>this.Match_MaxBits&&this.diff_levenshtein(u)/o.length>this.Patch_DeleteThreshold)r[i]=!1;else{this.diff_cleanupSemanticLossless(u);for(var d=0,g,p=0;pi[0][1].length){var n=t-i[0][1].length;i[0][1]=s.substring(i[0][1].length)+i[0][1],r.start1-=n,r.start2-=n,r.length1+=n,r.length2+=n}if(r=e[e.length-1],i=r.diffs,i.length==0||i[i.length-1][0]!=m)i.push(new h.Diff(m,s)),r.length1+=t,r.length2+=t;else if(t>i[i.length-1][1].length){var n=t-i[i.length-1][1].length;i[i.length-1][1]+=s.substring(0,n),r.length1+=n,r.length2+=n}return s};h.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,s=0;s2*t?(o.length1+=f.length,r+=f.length,l=!1,o.diffs.push(new h.Diff(c,f)),a.diffs.shift()):(f=f.substring(0,t-o.length1-this.Patch_Margin),o.length1+=f.length,r+=f.length,c===m?(o.length2+=f.length,i+=f.length):l=!1,o.diffs.push(new h.Diff(c,f)),f==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(f.length))}n=this.diff_text2(o.diffs),n=n.substring(n.length-this.Patch_Margin);var u=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);u!==""&&(o.length1+=u.length,o.length2+=u.length,o.diffs.length!==0&&o.diffs[o.diffs.length-1][0]===m?o.diffs[o.diffs.length-1][1]+=u:o.diffs.push(new h.Diff(m,u))),l||e.splice(++s,0,o)}}};h.prototype.patch_toText=function(e){for(var t=[],s=0;sD.handleResponse(s))}clearCache(t){let s=`${this.getApiBasePath()}/cache/${t}`;return this.httpClient.delete(s,{headers:this.getBasicHeaders()}).then(a=>D.handleResponse(a))}getQueue(){let t=`${this.getApiBasePath()}/queue/list`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>D.handleResponse(s))}resetQueue(){let t=`${this.getApiBasePath()}/queue`;return this.httpClient.delete(t,{headers:this.getBasicHeaders()}).then(s=>D.handleResponse(s))}runScheduledTask(t){let s=`${this.getApiBasePath()}/scheduled-task/${t}`;return this.httpClient.post(s,{},{headers:this.getBasicHeaders()}).then(a=>D.handleResponse(a))}scheduledTasksRegister(){let t=`${this.getApiBasePath()}/scheduled-tasks/register`;return this.httpClient.post(t,{},{headers:this.getBasicHeaders()}).then(s=>D.handleResponse(s))}healthStatus(){if(!this.loginService.isLoggedIn())return;let t=`${this.getApiBasePath()}/health/status`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>D.handleResponse(s))}performanceStatus(){let t=`${this.getApiBasePath()}/performance/status`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>D.handleResponse(s))}getLogFiles(){let t=`${this.getApiBasePath()}/logs/files`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>D.handleResponse(s))}getLogFile(t,s=0,a=20){let r=`${this.getApiBasePath()}/logs/file`;return this.httpClient.get(r,{params:{file:t,offset:s,limit:a},headers:this.getBasicHeaders()}).then(i=>i)}getShopwareFiles(){let t=`${this.getApiBasePath()}/shopware-files`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>s)}getFileContents(t){let s=`${this.getApiBasePath()}/file-contents`;return this.httpClient.get(s,{params:{file:t},headers:this.getBasicHeaders()}).then(a=>a)}restoreShopwareFile(t){let s=`${this.getApiBasePath()}/shopware-file/restore`;return this.httpClient.get(s,{params:{file:t},headers:this.getBasicHeaders()}).then(a=>a)}stateMachines(t){let s=`${this.getApiBasePath()}/state-machines/load/${t}`;return this.httpClient.get(s,{headers:this.getBasicHeaders()}).then(a=>D.handleResponse(a))}},N=B;var{ApiService:L}=Shopware.Classes,P=class extends L{constructor(t,s,a="_action/frosh-tools/elasticsearch"){super(t,s,a)}status(){let t=`${this.getApiBasePath()}/status`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}indices(){let t=`${this.getApiBasePath()}/indices`;return this.httpClient.get(t,{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}deleteIndex(t){let s=`${this.getApiBasePath()}/index/`+t;return this.httpClient.delete(s,{headers:this.getBasicHeaders()}).then(a=>L.handleResponse(a))}console(t,s,a){let r=`${this.getApiBasePath()}/console`+s;return this.httpClient.request({url:r,method:t,headers:{...this.getBasicHeaders(),"content-type":"application/json"},data:a}).then(i=>L.handleResponse(i))}flushAll(){let t=`${this.getApiBasePath()}/flush_all`;return this.httpClient.post(t,{},{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}reindex(){let t=`${this.getApiBasePath()}/reindex`;return this.httpClient.post(t,{},{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}switchAlias(){let t=`${this.getApiBasePath()}/switch_alias`;return this.httpClient.post(t,{},{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}cleanup(){let t=`${this.getApiBasePath()}/cleanup`;return this.httpClient.post(t,{},{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}reset(){let t=`${this.getApiBasePath()}/reset`;return this.httpClient.post(t,{},{headers:this.getBasicHeaders()}).then(s=>L.handleResponse(s))}},H=P;var{Application:I}=Shopware;I.addServiceProvider("froshToolsService",e=>{let t=I.getContainer("init");return new N(t.httpClient,e.loginService)});I.addServiceProvider("froshElasticSearch",e=>{let t=I.getContainer("init");return new H(t.httpClient,e.loginService)});var O=`{% block sw_data_grid_inline_edit_type_unknown %} + + + + + + + {% parent() %} +{% endblock %} +`;var{Component:le}=Shopware;le.override("sw-data-grid-inline-edit",{template:O});var z=`{% block sw_version_status %} + + {% block sw_version_status_badge %} + + + {% endblock %} + + +{% endblock %} +`;var{Component:ce}=Shopware;ce.override("sw-version",{template:z,inject:["froshToolsService","acl","loginService"],async created(){this.checkPermission()&&await this.checkHealth()},data(){return{health:null,hasPermission:!1}},computed:{healthVariant(){let e="success";for(let t of this.health){if(t.state==="STATE_ERROR"){e="error";continue}t.state==="STATE_WARNING"&&e==="success"&&(e="warning")}return e},healthPlaceholder(){let e="Shop Status: Ok";if(this.health===null)return e;for(let t of this.health){if(t.state==="STATE_ERROR"){e="Shop Status: May outage, Check System Status";continue}t.state==="STATE_WARNING"&&e==="Shop Status: Ok"&&(e="Shop Status: Issues, Check System Status")}return e}},methods:{async checkHealth(){this.health=await this.froshToolsService.healthStatus(),this.checkInterval=setInterval(async()=>{try{this.health=await this.froshToolsService.healthStatus()}catch(e){console.error(e),clearInterval(this.checkInterval)}},6e4),this.loginService.addOnLogoutListener(()=>clearInterval(this.checkInterval))},checkPermission(){return this.hasPermission=this.acl.can("frosh_tools:read")}}});var j=` + + + + + + + + + + + + + + + + {{ $tc('frosh-tools.noRecommendations') }} + + + + + + + + + + + +`;var{Component:ue}=Shopware;ue.register("frosh-tools-tab-index",{inject:["froshToolsService"],template:j,data(){return{isLoading:!0,health:null,performanceStatus:null}},created(){this.createdComponent()},computed:{columns(){return[{property:"name",label:"frosh-tools.name",rawData:!0},{property:"current",label:"frosh-tools.current",rawData:!0},{property:"recommended",label:"frosh-tools.recommended",rawData:!0}]}},methods:{async refresh(){this.isLoading=!0,await this.createdComponent()},async createdComponent(){this.health=await this.froshToolsService.healthStatus(),this.performanceStatus=await this.froshToolsService.performanceStatus(),this.isLoading=!1}}});var U=` + + + + + + + + + + + + + + + + + {{ $tc('frosh-tools.compileTheme') }} + + +`;var{Component:ge,Mixin:me}=Shopware,{Criteria:pe}=Shopware.Data;ge.register("frosh-tools-tab-cache",{template:U,inject:["froshToolsService","repositoryFactory","themeService"],mixins:[me.getByName("notification")],data(){return{cacheInfo:null,isLoading:!0,numberFormater:null}},created(){let e=Shopware.Application.getContainer("factory").locale.getLastKnownLocale();this.numberFormater=new Intl.NumberFormat(e,{minimumFractionDigits:2,maximumFractionDigits:2}),this.createdComponent()},computed:{columns(){return[{property:"name",label:"frosh-tools.name",rawData:!0},{property:"size",label:"frosh-tools.used",rawData:!0,align:"right"},{property:"freeSpace",label:"frosh-tools.free",rawData:!0,align:"right"}]},cacheFolders(){return this.cacheInfo===null?[]:this.cacheInfo},salesChannelRepository(){return this.repositoryFactory.create("sales_channel")}},methods:{async createdComponent(){this.isLoading=!0,this.cacheInfo=await this.froshToolsService.getCacheInfo(),this.isLoading=!1},formatSize(e){let t=e/1048576;return this.numberFormater.format(t)+" MiB"},async clearCache(e){this.isLoading=!0,await this.froshToolsService.clearCache(e.name),await this.createdComponent()},async compileTheme(){let e=new pe;e.addAssociation("themes"),this.isLoading=!0;let t=await this.salesChannelRepository.search(e,Shopware.Context.api);for(let s of t){let a=s.extensions.themes.first();a&&(await this.themeService.assignTheme(a.id,s.id),this.createNotificationSuccess({message:`${s.translated.name}: ${this.$tc("frosh-tools.themeCompiled")}`}))}this.isLoading=!1}}});var q=` + + + + + + + + + {{ $tc('frosh-tools.tabs.queue.reset.modal.description') }} + + + + +`;var{Component:ve,Mixin:be}=Shopware;ve.register("frosh-tools-tab-queue",{template:q,inject:["repositoryFactory","froshToolsService"],mixins:[be.getByName("notification")],data(){return{queueEntries:[],showResetModal:!1,isLoading:!0}},created(){this.createdComponent()},computed:{columns(){return[{property:"name",label:"Name",rawData:!0},{property:"size",label:"Size",rawData:!0}]}},methods:{async refresh(){this.isLoading=!0,await this.createdComponent()},async createdComponent(){this.queueEntries=await this.froshToolsService.getQueue();for(let e of this.queueEntries){let t=e.name.split("\\");e.name=t[t.length-1]}this.isLoading=!1},async resetQueue(){this.isLoading=!0,await this.froshToolsService.resetQueue(),this.showResetModal=!1,await this.createdComponent(),this.createNotificationSuccess({message:this.$tc("frosh-tools.tabs.queue.reset.success")}),this.isLoading=!1}}});var Q=` + + + + + + + + + + + + + + +
+        
+ + + +`;var{Component:Se,Mixin:ye}=Shopware,{Criteria:V}=Shopware.Data;Se.register("frosh-tools-tab-scheduled",{template:Q,inject:["repositoryFactory","froshToolsService"],mixins:[ye.getByName("notification")],data(){return{items:null,showResetModal:!1,isLoading:!0,page:1,limit:25,taskError:null}},created(){this.createdComponent()},computed:{scheduledRepository(){return this.repositoryFactory.create("scheduled_task")},columns(){return[{property:"name",label:"frosh-tools.name",rawData:!0,primary:!0},{property:"runInterval",label:"frosh-tools.interval",rawData:!0,inlineEdit:"number"},{property:"lastExecutionTime",label:"frosh-tools.lastExecutionTime",rawData:!0},{property:"nextExecutionTime",label:"frosh-tools.nextExecutionTime",rawData:!0,inlineEdit:"datetime"},{property:"status",label:"frosh-tools.status",rawData:!0}]}},methods:{async refresh(){this.isLoading=!0,await this.createdComponent()},async createdComponent(){let e=new V(this.page,this.limit);e.addSorting(V.sort("nextExecutionTime","ASC")),this.items=await this.scheduledRepository.search(e,Shopware.Context.api),this.isLoading=!1},async runTask(e){this.isLoading=!0;try{this.createNotificationInfo({message:this.$tc("frosh-tools.scheduledTaskStarted",0,{name:e.name})}),await this.froshToolsService.runScheduledTask(e.id),this.createNotificationSuccess({message:this.$tc("frosh-tools.scheduledTaskSucceed",0,{name:e.name})})}catch(t){this.createNotificationError({message:this.$tc("frosh-tools.scheduledTaskFailed",0,{name:e.name})}),this.taskError=t.response.data}this.createdComponent()},async registerScheduledTasks(){this.isLoading=!0;try{this.createNotificationInfo({message:this.$tc("frosh-tools.scheduledTasksRegisterStarted")}),await this.froshToolsService.scheduledTasksRegister(),this.createNotificationSuccess({message:this.$tc("frosh-tools.scheduledTasksRegisterSucceed")})}catch{this.createNotificationError({message:this.$tc("frosh-tools.scheduledTasksRegisterFailed")})}this.createdComponent()}}});var G=` + + Elasticsearch is not enabled + +
+
Elasticsearch version: {{ statusInfo.info.version.number }}
+
Nodes: {{ statusInfo.health.number_of_nodes }}
+
Cluster status: {{ statusInfo.health.status }}
+
+
+ + + + + + + + + + + + + + + + Reindex + Trigger alias switching + Flush all indices + + Cleanup unused Indices + Delete all indices + + + + + + Send + +
Output:
+ +
{{ consoleOutput }}
+
+
+`;var{Mixin:Ce,Component:Me}=Shopware;Me.register("frosh-tools-tab-elasticsearch",{template:G,inject:["froshElasticSearch"],mixins:[Ce.getByName("notification")],data(){return{isLoading:!0,isActive:!0,statusInfo:{},indices:[],consoleInput:"GET /_cat/indices",consoleOutput:{}}},computed:{columns(){return[{property:"name",label:"frosh-tools.name",rawData:!0,primary:!0},{property:"indexSize",label:"frosh-tools.size",rawData:!0,primary:!0},{property:"docs",label:"frosh-tools.docs",rawData:!0,primary:!0}]}},created(){this.createdComponent()},methods:{async createdComponent(){this.isLoading=!0;try{this.statusInfo=await this.froshElasticSearch.status()}catch{this.isActive=!1,this.isLoading=!1;return}finally{this.isLoading=!1}this.indices=await this.froshElasticSearch.indices()},formatSize(e){let a=e;if(Math.abs(e)<1024)return e+" B";let r=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=-1,n=10**1;do a/=1024,++i;while(Math.round(Math.abs(a)*n)/n>=1024&&i + + + + + + + + + + + + + + + +
+
+ +`;var{Component:Ae,Mixin:Te}=Shopware;Ae.register("frosh-tools-tab-logs",{template:W,inject:["froshToolsService"],mixins:[Te.getByName("notification")],data(){return{logFiles:[],selectedLogFile:null,logEntries:[],totalLogEntries:0,limit:25,page:1,isLoading:!0,displayedLog:null}},created(){this.createdComponent()},computed:{columns(){return[{property:"date",label:"frosh-tools.date",rawData:!0},{property:"channel",label:"frosh-tools.channel",rawData:!0},{property:"level",label:"frosh-tools.level",rawData:!0},{property:"message",label:"frosh-tools.message",rawData:!0}]}},methods:{async refresh(){this.isLoading=!0,await this.createdComponent(),await this.onFileSelected()},async createdComponent(){this.logFiles=await this.froshToolsService.getLogFiles(),this.isLoading=!1},async onFileSelected(){if(!this.selectedLogFile)return;let e=await this.froshToolsService.getLogFile(this.selectedLogFile,(this.page-1)*this.limit,this.limit);this.logEntries=e.data,this.totalLogEntries=parseInt(e.headers["file-size"],10)},async onPageChange(e){this.page=e.page,this.limit=e.limit,await this.onFileSelected()},showInfoModal(e){this.displayedLog=e},closeInfoModal(){this.displayedLog=null}}});var K=` + + +
+ State Machine +
+ + +
+
+`;var{Component:Le,Mixin:Re}=Shopware;Le.register("frosh-tools-tab-state-machines",{template:K,inject:["froshToolsService"],mixins:[Re.getByName("notification")],data(){return{selectedStateMachine:null,image:null,isLoading:!0}},created(){this.createdComponent()},methods:{createdComponent(){this.isLoading=!1},async onStateMachineChange(e){if(!e)return;let t=await this.froshToolsService.stateMachines(e),s=document.getElementById("state_machine");"svg"in t?(this.image=t.svg,s.src=this.image,s.style.opacity="1",s.style.width="100%",s.style.height="auto"):s.style.opacity="0"}}});var Z=` + + {{ items.error }} + + {{ $tc('frosh-tools.tabs.files.allFilesOk') }} + {{ $tc('frosh-tools.tabs.files.notOk') }} + + + + + + + + + + + + + + + + + + + + +`;var Y=ne(X()),{Component:Ie,Mixin:Be}=Shopware;Ie.register("frosh-tools-tab-files",{template:Z,inject:["repositoryFactory","froshToolsService"],mixins:[Be.getByName("notification")],data(){return{items:{},isLoading:!0,diffData:{html:"",file:""},showModal:!1}},created(){this.createdComponent()},computed:{columns(){return[{property:"name",label:"frosh-tools.name",rawData:!0,primary:!0},{property:"expected",label:"frosh-tools.status",rawData:!0,primary:!0}]},isLoadingClass(){return{"is-loading":this.isLoading}}},methods:{async refresh(){this.isLoading=!0,await this.createdComponent()},async createdComponent(){this.items=(await this.froshToolsService.getShopwareFiles()).data,this.isLoading=!1},openUrl(e){window.open(e,"_blank")},async diff(e){this.isLoading=!0;let t=(await this.froshToolsService.getFileContents(e.name)).data,s=new Y.default,a=s.diff_main(t.originalContent,t.content);s.diff_cleanupSemantic(a),this.diffData.html=s.diff_prettyHtml(a).replace(new RegExp("background:#e6ffe6;","g"),"background:#ABF2BC;").replace(new RegExp("background:#ffe6e6;","g"),"background:rgba(255,129,130,0.4);"),this.diffData.file=e,this.openModal(),this.isLoading=!1},async restoreFile(e){this.closeModal(),this.isLoading=!0;let t=await this.froshToolsService.restoreShopwareFile(e);t.data.status?this.createNotificationSuccess({message:t.data.status}):this.createNotificationError({message:t.data.error}),await this.refresh()},openModal(){this.showModal=!0},closeModal(){this.showModal=!1}}});var J=` + + +`;var{Component:Fe}=Shopware;Fe.register("frosh-tools-index",{template:J,computed:{elasticsearchAvailable(){return Shopware.State.get("context").app.config.settings?.elasticsearchEnabled||!1}}});Shopware.Service("privileges").addPrivilegeMappingEntry({category:"additional_permissions",parent:null,key:"frosh_tools",roles:{frosh_tools:{privileges:["frosh_tools:read"],dependencies:[]}}});Shopware.Module.register("frosh-tools",{type:"plugin",name:"frosh-tools.title",title:"frosh-tools.title",description:"",color:"#303A4F",icon:"regular-cog",routes:{index:{component:"frosh-tools-index",path:"index",children:{index:{component:"frosh-tools-tab-index",path:"index",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},cache:{component:"frosh-tools-tab-cache",path:"cache",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},queue:{component:"frosh-tools-tab-queue",path:"queue",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},scheduled:{component:"frosh-tools-tab-scheduled",path:"scheduled",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},elasticsearch:{component:"frosh-tools-tab-elasticsearch",path:"elasticsearch",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},logs:{component:"frosh-tools-tab-logs",path:"logs",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},files:{component:"frosh-tools-tab-files",path:"files",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}},statemachines:{component:"frosh-tools-tab-state-machines",path:"state-machines",meta:{privilege:"frosh_tools:read",parentPath:"frosh.tools.index.index"}}}}},settingsItem:[{group:"plugins",to:"frosh.tools.index.cache",icon:"regular-cog",name:"frosh-tools",label:"frosh-tools.title",privilege:"frosh_tools:read"}]});})(); diff --git a/src/Resources/store/de.md b/src/Resources/store/de.md deleted file mode 100644 index fddbf09..0000000 --- a/src/Resources/store/de.md +++ /dev/null @@ -1,26 +0,0 @@ -Dieses Plugin enthält einige nützliche Funktionen für die Verwaltung eines Shopware 6 Shops. - -Der aktuelle Funktionsumfang besteht aus: - -* System-Status - * Prüft PHP Version, MySQL, Queue funktioniert etc. -* Cache-Verwaltung - * Listet App und Http Cache und alle Ordner in var/cache auf -* Geplanter Task-Manager - * Zeigt alle geplanten Tasks und kann einen bestimmten ausführen -* Warteschlangen-Manager - * Zeigt die Anzahl der Nachrichten in der Warteschlange an -* Log-Viewer - * Zeigt die Einträge der Dateien /var/log/*.log an -* Task-Protokollierung - * Kann mit FROSH_TOOLS_TASK_LOGGING=1 in .env aktiviert werden. Dadurch wird ein Protokoll in var/log/task_logging-xx.log erstellt. - * Mit FROSH_TOOLS_TASK_LOGGING_INFO=1 in .env werden alle Tasks geloggt. -* Feature Flag Manager - * Erlaubt das aktivieren/deaktivieren von Feature Flags - -Link to repository: [https://github.com/FriendsOfShopware/FroshTools](https://github.com/FriendsOfShopware/FroshTools) - -Dieses Plugin wird von [@FriendsOfShopware](https://store.shopware.com/friends-of-shopware.html) entwickelt. -Maintainer dieses Plugins ist: [Soner Sayakci](https://github.com/shyim) - -Bei Fragen / Fehlern bitte ein [Github Issue](https://github.com/FriendsOfShopware/FroshTools/issues) erstellen diff --git a/src/Resources/store/de_manual.md b/src/Resources/store/de_manual.md deleted file mode 100644 index 28adb81..0000000 --- a/src/Resources/store/de_manual.md +++ /dev/null @@ -1 +0,0 @@ -Einfach in der Administration über den Shopware App Manager installieren. \ No newline at end of file diff --git a/src/Resources/store/en.md b/src/Resources/store/en.md deleted file mode 100644 index b654a36..0000000 --- a/src/Resources/store/en.md +++ /dev/null @@ -1,27 +0,0 @@ -This plugin contains some utility functions for managing a Shopware 6 shop. - -The current feature set consists of: - -* System Status - * Checks PHP Version, MySQL, Queue is working etc. -* Cache manager - * Lists App and Http Cache and all folders in var/cache -* Scheduled Task Manager - * Shows all Scheduled Tasks and can execute one specific -* Queue Manager - * Shows the amount of messages in the queue -* Log viewer - * Shows the entries of /var/log/*.log files -* Task Logging - * Can be enabled with env FROSH_TOOLS_TASK_LOGGING=1 in .env. This will create a log in var/log/task_logging-xx.log - * Set FROSH_TOOLS_TASK_LOGGING_INFO=1 in .env to log all tasks -* Feature Flag Manager - * Provides the ability to enable or disable feature flags - -Link to repository: [https://github.com/FriendsOfShopware/FroshTools](https://github.com/FriendsOfShopware/FroshTools) - -This plugin is part of [@FriendsOfShopware](https://store.shopware.com/en/friends-of-shopware.html). - -Maintainer for the plugin is: [Soner Sayakci](https://github.com/shyim) - -For questions or bugs please create a [Github Issue](https://github.com/FriendsOfShopware/FroshTools/issues/new) diff --git a/src/Resources/store/en_manual.md b/src/Resources/store/en_manual.md deleted file mode 100644 index 05b91ce..0000000 --- a/src/Resources/store/en_manual.md +++ /dev/null @@ -1 +0,0 @@ -Simply install via the shopware app manager in the shop administration. \ No newline at end of file diff --git a/src/Resources/store/icon.png b/src/Resources/store/icon.png deleted file mode 100644 index 885856b..0000000 Binary files a/src/Resources/store/icon.png and /dev/null differ diff --git a/src/Resources/store/img-0.png b/src/Resources/store/img-0.png deleted file mode 100755 index 4df53d8..0000000 Binary files a/src/Resources/store/img-0.png and /dev/null differ diff --git a/src/Resources/store/img-1.png b/src/Resources/store/img-1.png deleted file mode 100755 index cbaf4cb..0000000 Binary files a/src/Resources/store/img-1.png and /dev/null differ diff --git a/src/Resources/store/img-2.png b/src/Resources/store/img-2.png deleted file mode 100755 index 782c10f..0000000 Binary files a/src/Resources/store/img-2.png and /dev/null differ diff --git a/src/Resources/store/img-3.png b/src/Resources/store/img-3.png deleted file mode 100755 index b1bd2d6..0000000 Binary files a/src/Resources/store/img-3.png and /dev/null differ diff --git a/src/Resources/store/img-4.png b/src/Resources/store/img-4.png deleted file mode 100755 index b65992f..0000000 Binary files a/src/Resources/store/img-4.png and /dev/null differ