diff --git a/src/Resources/public/administration/.vite/entrypoints.json b/src/Resources/public/administration/.vite/entrypoints.json new file mode 100644 index 0000000..e531186 --- /dev/null +++ b/src/Resources/public/administration/.vite/entrypoints.json @@ -0,0 +1,23 @@ +{ + "base": "/bundles/aeondumpmanager/administration/", + "entryPoints": { + "aeon-dump-manager": { + "css": [], + "dynamic": [], + "js": [ + "/bundles/aeondumpmanager/administration/js/aeon-dump-manager.js" + ], + "legacy": false, + "preload": [] + } + }, + "legacy": false, + "metadatas": {}, + "version": [ + "7.0.4", + 7, + 0, + 4 + ], + "viteServer": null +} \ No newline at end of file diff --git a/src/Resources/public/administration/.vite/manifest.json b/src/Resources/public/administration/.vite/manifest.json new file mode 100644 index 0000000..3e147ac --- /dev/null +++ b/src/Resources/public/administration/.vite/manifest.json @@ -0,0 +1,9 @@ +{ + "main.js": { + "file": "js/aeon-dump-manager.js", + "name": "aeon-dump-manager", + "src": "main.js", + "isEntry": true, + "css": [] + } +} \ No newline at end of file diff --git a/src/Resources/public/administration/js/aeon-dump-manager.js b/src/Resources/public/administration/js/aeon-dump-manager.js index a98546c..072006d 100644 --- a/src/Resources/public/administration/js/aeon-dump-manager.js +++ b/src/Resources/public/administration/js/aeon-dump-manager.js @@ -1 +1,2 @@ -!function(){var e={74:function(){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:null,key:"aeon_dump_manager",roles:{viewer:{privileges:["aeon_dump_manager.viewer"],dependencies:[]},creator:{privileges:["aeon_dump_manager.creator"],dependencies:["aeon_dump_manager.viewer"]},deleter:{privileges:["aeon_dump_manager.deleter"],dependencies:["aeon_dump_manager.viewer"]}}})}},n={};function t(a){var l=n[a];if(void 0!==l)return l.exports;var i=n[a]={exports:{}};return e[a](i,i.exports,t),i.exports}t.p="bundles/aeondumpmanager/",window?.__sw__?.assetPath&&(t.p=window.__sw__.assetPath+"/bundles/aeondumpmanager/"),function(){"use strict";let{ApiService:e}=Shopware.Classes;class n extends e{constructor(e,n,t="aeon-dump-manager"){super(e,n,t)}getList(){return this.httpClient.get("/_action/aeon-dump-manager/dumps",{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}create(){return this.httpClient.post("/_action/aeon-dump-manager/dumps",{},{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}remove(n){return this.httpClient.delete(`/_action/aeon-dump-manager/dumps/${encodeURIComponent(n)}`,{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}getJobStatus(n){return this.httpClient.get(`/_action/aeon-dump-manager/dumps/jobs/${encodeURIComponent(n)}`,{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}download(n){return this.httpClient.get(`/_action/aeon-dump-manager/dumps/${encodeURIComponent(n)}/download`,{headers:this.getBasicHeaders(),responseType:"blob"}).then(n=>e.handleResponse(n))}}t(74);let{Component:a,Mixin:l}=Shopware;a.register("aeon-dump-manager-list",{template:'{% block aeon_dump_manager_list %}\n\n \n\n \n\n {% block aeon_dump_manager_list_progress_modal %}\n \n
\n \n \n \n
\n \n {% endblock %}\n\n \n
\n{% endblock %}\n',mixins:[l.getByName("notification")],inject:["aeonDumpManagerApiService","acl"],data(){return{dumps:[],isLoading:!1,pendingJob:null,deleteFilenames:null,selection:{},pollTimer:null}},computed:{columns(){return[{property:"datetime",label:this.$tc("aeon-dump-manager.list.columnDatetime"),allowResize:!0},{property:"filename",label:this.$tc("aeon-dump-manager.list.columnFilename"),allowResize:!0},{property:"sizeBytes",label:this.$tc("aeon-dump-manager.list.columnSize"),align:"right",allowResize:!0}]},selectionCount(){return Object.keys(this.selection).length}},created(){this.loadList()},beforeDestroy(){this.stopPolling()},methods:{loadList(){return this.isLoading=!0,this.aeonDumpManagerApiService.getList().then(e=>{this.dumps=e.dumps}).finally(()=>{this.isLoading=!1})},formatDatetime(e){return new Date(e).toLocaleString()},formatSize(e){return Shopware.Utils.format.fileSize(e)},onSelectionChange(e){this.selection=e},onCreate(){this.pendingJob={percent:0,status:"pending"},this.aeonDumpManagerApiService.create().then(e=>{this.pollJobStatus(e.jobId)}).catch(e=>{this.pendingJob={status:"failed",percent:null,errorMessage:e.message}})},pollJobStatus(e){this.stopPolling(),this.pollTimer=window.setInterval(()=>{this.aeonDumpManagerApiService.getJobStatus(e).then(e=>{if(this.pendingJob=e,"done"===e.status){this.stopPolling(),this.loadList(),window.setTimeout(()=>{this.pendingJob=null},1500);return}"failed"===e.status&&this.stopPolling()})},2e3)},stopPolling(){null!==this.pollTimer&&(window.clearInterval(this.pollTimer),this.pollTimer=null)},onCloseProgressModal(){this.stopPolling(),this.pendingJob=null},onDownload(e){this.aeonDumpManagerApiService.download(e).then(n=>{let t=window.URL.createObjectURL(n),a=document.createElement("a");a.href=t,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(t)}).catch(e=>{this.createNotificationError({message:this.$tc("aeon-dump-manager.list.downloadFailed",0,{error:e.message})})})},onRequestDelete(e){this.deleteFilenames=[e]},onRequestBulkDelete(){this.deleteFilenames=Object.keys(this.selection)},onCancelDelete(){this.deleteFilenames=null},onConfirmDelete(){let e=this.deleteFilenames;return this.deleteFilenames=null,this.dumps=this.dumps.filter(n=>!e.includes(n.filename)),this.selection={},Promise.all(e.map(e=>this.aeonDumpManagerApiService.remove(e))).then(()=>this.loadList()).catch(e=>(this.createNotificationError({message:this.$tc("aeon-dump-manager.list.deleteFailed",0,{error:e.message})}),this.loadList()))}}});var i=JSON.parse('{"aeon-dump-manager":{"general":{"mainMenuItemGeneral":"Dump-Verwaltung","descriptionTextModule":"SQL-Datenbank-Dumps erstellen, auflisten und l\xf6schen"},"list":{"columnFilename":"Name","columnDatetime":"Erstellt am","columnSize":"Gr\xf6\xdfe","buttonCreate":"Dump erstellen","buttonDownload":"Herunterladen","buttonDelete":"L\xf6schen","bulkDeleteButton":"Auswahl l\xf6schen ({count})","confirmDeleteTitle":"Dump l\xf6schen?","confirmDeleteText":"M\xf6chten Sie \\"{filename}\\" wirklich l\xf6schen? Dies kann nicht r\xfcckg\xe4ngig gemacht werden.","confirmDeleteTextMultiple":"M\xf6chten Sie {count} Dumps wirklich l\xf6schen? Dies kann nicht r\xfcckg\xe4ngig gemacht werden.","empty":"Keine Dumps gefunden.","progressTitle":"Dump wird erstellt","progressText":"Dump wird erstellt…","createFailed":"Dump konnte nicht erstellt werden: {error}","createSuccess":"Dump erstellt.","deleteFailed":"Dump konnte nicht gel\xf6scht werden: {error}","downloadFailed":"Dump konnte nicht heruntergeladen werden: {error}"}}}'),o=JSON.parse('{"aeon-dump-manager":{"general":{"mainMenuItemGeneral":"Dump manager","descriptionTextModule":"Create, list and delete SQL database dumps"},"list":{"columnFilename":"Name","columnDatetime":"Created at","columnSize":"Size","buttonCreate":"Create dump","buttonDownload":"Download","buttonDelete":"Delete","bulkDeleteButton":"Delete selected ({count})","confirmDeleteTitle":"Delete dump?","confirmDeleteText":"Are you sure you want to delete \\"{filename}\\"? This cannot be undone.","confirmDeleteTextMultiple":"Are you sure you want to delete {count} dumps? This cannot be undone.","empty":"No dumps found.","progressTitle":"Creating dump","progressText":"Creating dump…","createFailed":"Could not create dump: {error}","createSuccess":"Dump created.","deleteFailed":"Could not delete dump: {error}","downloadFailed":"Could not download dump: {error}"}}}');Shopware.Module.register("aeon-dump-manager",{type:"plugin",name:"DumpManager",title:"aeon-dump-manager.general.mainMenuItemGeneral",description:"aeon-dump-manager.general.descriptionTextModule",color:"#ff3d58",icon:"regular-database",snippets:{"de-DE":i,"en-GB":o},routes:{list:{component:"aeon-dump-manager-list",path:"list",meta:{parentPath:"sw.settings.index.system",privilege:"aeon_dump_manager.viewer"}}},navigation:[{id:"aeon-dump-manager-list",label:"aeon-dump-manager.general.mainMenuItemGeneral",color:"#ff3d58",path:"aeon.dump.manager.list",icon:"regular-database",parent:"sw-settings",position:100,privilege:"aeon_dump_manager.viewer"}],settingsItem:{group:"system",to:"aeon.dump.manager.list",icon:"regular-database",privilege:"aeon_dump_manager.viewer"}}),Shopware.Application.addServiceProvider("aeonDumpManagerApiService",e=>new n(Shopware.Application.getContainer("init").httpClient,e.loginService))}()}(); \ No newline at end of file +(function(){var e={102:function(){Shopware.Service("privileges").addPrivilegeMappingEntry({category:"permissions",parent:null,key:"aeon_dump_manager",roles:{viewer:{privileges:["aeon_dump_manager.viewer"],dependencies:[]},creator:{privileges:["aeon_dump_manager.creator"],dependencies:["aeon_dump_manager.viewer"]},deleter:{privileges:["aeon_dump_manager.deleter"],dependencies:["aeon_dump_manager.viewer"]}}})}},n={};function t(a){var l=n[a];if(void 0!==l)return l.exports;var i=n[a]={exports:{}};return e[a](i,i.exports,t),i.exports}t.p="bundles/aeondumpmanager/",window?.__sw__?.assetPath&&(t.p=window.__sw__.assetPath+"/bundles/aeondumpmanager/"),function(){"use strict";let{ApiService:e}=Shopware.Classes;class n extends e{constructor(e,n,t="aeon-dump-manager"){super(e,n,t)}getList(){return this.httpClient.get("/_action/aeon-dump-manager/dumps",{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}create(){return this.httpClient.post("/_action/aeon-dump-manager/dumps",{},{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}remove(n){return this.httpClient.delete(`/_action/aeon-dump-manager/dumps/${encodeURIComponent(n)}`,{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}getJobStatus(n){return this.httpClient.get(`/_action/aeon-dump-manager/dumps/jobs/${encodeURIComponent(n)}`,{headers:this.getBasicHeaders()}).then(n=>e.handleResponse(n))}download(n){return this.httpClient.get(`/_action/aeon-dump-manager/dumps/${encodeURIComponent(n)}/download`,{headers:this.getBasicHeaders(),responseType:"blob"}).then(n=>e.handleResponse(n))}}t(102);let{Component:a,Mixin:l}=Shopware;a.register("aeon-dump-manager-list",{template:'{% block aeon_dump_manager_list %}\n\n \n\n \n\n {% block aeon_dump_manager_list_progress_modal %}\n \n
\n \n \n \n
\n \n {% endblock %}\n\n \n
\n{% endblock %}\n',mixins:[l.getByName("notification")],inject:["aeonDumpManagerApiService","acl"],data(){return{dumps:[],isLoading:!1,pendingJob:null,deleteFilenames:null,selection:{},pollTimer:null}},computed:{columns(){return[{property:"datetime",label:this.$tc("aeon-dump-manager.list.columnDatetime"),allowResize:!0},{property:"filename",label:this.$tc("aeon-dump-manager.list.columnFilename"),allowResize:!0},{property:"sizeBytes",label:this.$tc("aeon-dump-manager.list.columnSize"),align:"right",allowResize:!0}]},selectionCount(){return Object.keys(this.selection).length}},created(){this.loadList()},beforeDestroy(){this.stopPolling()},methods:{loadList(){return this.isLoading=!0,this.aeonDumpManagerApiService.getList().then(e=>{this.dumps=e.dumps}).finally(()=>{this.isLoading=!1})},formatDatetime(e){return new Date(e).toLocaleString()},formatSize(e){return Shopware.Utils.format.fileSize(e)},onSelectionChange(e){this.selection=e},onCreate(){this.pendingJob={percent:0,status:"pending"},this.aeonDumpManagerApiService.create().then(e=>{this.pollJobStatus(e.jobId)}).catch(e=>{this.pendingJob={status:"failed",percent:null,errorMessage:e.message}})},pollJobStatus(e){this.stopPolling(),this.pollTimer=window.setInterval(()=>{this.aeonDumpManagerApiService.getJobStatus(e).then(e=>{if(this.pendingJob=e,"done"===e.status){this.stopPolling(),this.loadList(),window.setTimeout(()=>{this.pendingJob=null},1500);return}"failed"===e.status&&this.stopPolling()})},2e3)},stopPolling(){null!==this.pollTimer&&(window.clearInterval(this.pollTimer),this.pollTimer=null)},onCloseProgressModal(){this.stopPolling(),this.pendingJob=null},onDownload(e){this.aeonDumpManagerApiService.download(e).then(n=>{let t=window.URL.createObjectURL(n),a=document.createElement("a");a.href=t,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(t)}).catch(e=>{this.createNotificationError({message:this.$tc("aeon-dump-manager.list.downloadFailed",0,{error:e.message})})})},onRequestDelete(e){this.deleteFilenames=[e]},onRequestBulkDelete(){this.deleteFilenames=Object.keys(this.selection)},onCancelDelete(){this.deleteFilenames=null},onConfirmDelete(){let e=this.deleteFilenames;return this.deleteFilenames=null,this.dumps=this.dumps.filter(n=>!e.includes(n.filename)),this.selection={},Promise.all(e.map(e=>this.aeonDumpManagerApiService.remove(e))).then(()=>this.loadList()).catch(e=>(this.createNotificationError({message:this.$tc("aeon-dump-manager.list.deleteFailed",0,{error:e.message})}),this.loadList()))}}});var i=JSON.parse('{"aeon-dump-manager":{"general":{"mainMenuItemGeneral":"Dump-Verwaltung","descriptionTextModule":"SQL-Datenbank-Dumps erstellen, auflisten und l\xf6schen"},"list":{"columnFilename":"Name","columnDatetime":"Erstellt am","columnSize":"Gr\xf6\xdfe","buttonCreate":"Dump erstellen","buttonDownload":"Herunterladen","buttonDelete":"L\xf6schen","bulkDeleteButton":"Auswahl l\xf6schen ({count})","confirmDeleteTitle":"Dump l\xf6schen?","confirmDeleteText":"M\xf6chten Sie \\"{filename}\\" wirklich l\xf6schen? Dies kann nicht r\xfcckg\xe4ngig gemacht werden.","confirmDeleteTextMultiple":"M\xf6chten Sie {count} Dumps wirklich l\xf6schen? Dies kann nicht r\xfcckg\xe4ngig gemacht werden.","empty":"Keine Dumps gefunden.","progressTitle":"Dump wird erstellt","progressText":"Dump wird erstellt…","createFailed":"Dump konnte nicht erstellt werden: {error}","createSuccess":"Dump erstellt.","deleteFailed":"Dump konnte nicht gel\xf6scht werden: {error}","downloadFailed":"Dump konnte nicht heruntergeladen werden: {error}"}}}'),o=JSON.parse('{"aeon-dump-manager":{"general":{"mainMenuItemGeneral":"Dump manager","descriptionTextModule":"Create, list and delete SQL database dumps"},"list":{"columnFilename":"Name","columnDatetime":"Created at","columnSize":"Size","buttonCreate":"Create dump","buttonDownload":"Download","buttonDelete":"Delete","bulkDeleteButton":"Delete selected ({count})","confirmDeleteTitle":"Delete dump?","confirmDeleteText":"Are you sure you want to delete \\"{filename}\\"? This cannot be undone.","confirmDeleteTextMultiple":"Are you sure you want to delete {count} dumps? This cannot be undone.","empty":"No dumps found.","progressTitle":"Creating dump","progressText":"Creating dump…","createFailed":"Could not create dump: {error}","createSuccess":"Dump created.","deleteFailed":"Could not delete dump: {error}","downloadFailed":"Could not download dump: {error}"}}}');Shopware.Module.register("aeon-dump-manager",{type:"plugin",name:"DumpManager",title:"aeon-dump-manager.general.mainMenuItemGeneral",description:"aeon-dump-manager.general.descriptionTextModule",color:"#ff3d58",icon:"regular-database",snippets:{"de-DE":i,"en-GB":o},routes:{list:{component:"aeon-dump-manager-list",path:"list",meta:{parentPath:"sw.settings.index.system",privilege:"aeon_dump_manager.viewer"}}},navigation:[{id:"aeon-dump-manager-list",label:"aeon-dump-manager.general.mainMenuItemGeneral",color:"#ff3d58",path:"aeon.dump.manager.list",icon:"regular-database",parent:"sw-settings",position:100,privilege:"aeon_dump_manager.viewer"}],settingsItem:{group:"system",to:"aeon.dump.manager.list",icon:"regular-database",privilege:"aeon_dump_manager.viewer"}}),Shopware.Application.addServiceProvider("aeonDumpManagerApiService",e=>new n(Shopware.Application.getContainer("init").httpClient,e.loginService))}()})(); +//# sourceMappingURL=aeon-dump-manager.js.map \ No newline at end of file diff --git a/src/Resources/public/static/js/aeon-dump-manager.js.map b/src/Resources/public/static/js/aeon-dump-manager.js.map new file mode 100644 index 0000000..79f2a60 --- /dev/null +++ b/src/Resources/public/static/js/aeon-dump-manager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"static/js/aeon-dump-manager.js","mappings":"kCAAAA,SAASC,OAAO,CAAC,cAAcC,wBAAwB,CAAC,CACpDC,SAAU,cACVC,OAAQ,KACRC,IAAK,oBACLC,MAAO,CACHC,OAAQ,CACJC,WAAY,CAAC,2BAA2B,CACxCC,aAAc,EAAE,EAEpBC,QAAS,CACLF,WAAY,CAAC,4BAA4B,CACzCC,aAAc,CAAC,2BAA2B,EAE9CE,QAAS,CACLH,WAAY,CAAC,4BAA4B,CACzCC,aAAc,CAAC,2BAA2B,CAElD,CACJ,E,GCjBIG,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,CAAQ,EAEpC,IAAIC,EAAeH,CAAwB,CAACE,EAAS,CACrD,GAAIC,KAAiBC,IAAjBD,EACH,OAAOA,EAAa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,QAAQ,IAEhC,CACJ,CACJ,G,k3DEjNA1E,SAASiI,MAAM,CAAC/E,QAAQ,CAAC,oBAAqB,CAC1CgF,KAAM,SACNC,KAAM,cACNC,MAAO,gDACPC,YAAa,kDACbC,MAAO,UACPC,KAAM,mBAENC,SAAU,CACN,QAASC,EACT,QAASC,CACb,EAEAC,OAAQ,CACJC,KAAM,CACFC,UAAW,yBACXC,KAAM,OACNC,KAAM,CACFC,WAAY,2BACZC,UAAW,0BACf,CACJ,CACJ,EAMAC,WAAY,CAAC,CACTC,GAAI,yBACJlF,MAAO,gDACPqE,MAAO,UACPQ,KAAM,yBACNP,KAAM,mBACNnI,OAAQ,cACRgJ,SAAU,IACVH,UAAW,0BACf,EAAE,CAIFI,aAAc,CACVC,MAAO,SACPC,GAAI,yBACJhB,KAAM,mBACNU,UAAW,0BACf,CACJ,GCjDAjJ,SAASwJ,WAAW,CAACC,kBAAkB,CAAC,4BAA6B,GAG1D,IAAI/H,EAAegI,SAFKF,WAAW,CAACG,YAAY,CAAC,QAEhB/H,UAAU,CAAEgI,EAAU/H,YAAY,E","sources":["webpack://administration/../../../../../../../var/www/html/custom/plugins/AeonDumpManager/src/Resources/app/administration/src/module/aeon-dump-manager/acl/index.ts","webpack://administration/webpack/bootstrap","webpack://administration/webpack/runtime/publicPath","webpack://administration/data:text/javascript;charset=utf-8;base64,CiAgICAgICAgICAgIGlmICh3aW5kb3c/Ll9fc3dfXz8uYXNzZXRQYXRoKSB7CiAgICAgICAgICAgICAgICBfX3dlYnBhY2tfcHVibGljX3BhdGhfXyA9IHdpbmRvdy5fX3N3X18uYXNzZXRQYXRoICsgJy9idW5kbGVzL2Flb25kdW1wbWFuYWdlci8nOwogICAgICAgICAgICB9CiAgICAgICAg","webpack://administration/../../../../../../../var/www/html/custom/plugins/AeonDumpManager/src/Resources/app/administration/src/service/dump-api.service.ts","webpack://administration/../../../../../../../var/www/html/custom/plugins/AeonDumpManager/src/Resources/app/administration/src/module/aeon-dump-manager/page/aeon-dump-manager-list/index.ts","webpack://administration/../../../../../../../var/www/html/custom/plugins/AeonDumpManager/src/Resources/app/administration/src/module/aeon-dump-manager/page/aeon-dump-manager-list/aeon-dump-manager-list.html.twig","webpack://administration/../../../../../../../var/www/html/custom/plugins/AeonDumpManager/src/Resources/app/administration/src/module/aeon-dump-manager/index.ts","webpack://administration/../../../../../../../var/www/html/custom/plugins/AeonDumpManager/src/Resources/app/administration/src/main.ts"],"sourcesContent":["Shopware.Service('privileges').addPrivilegeMappingEntry({\n category: 'permissions',\n parent: null,\n key: 'aeon_dump_manager',\n roles: {\n viewer: {\n privileges: ['aeon_dump_manager.viewer'],\n dependencies: [],\n },\n creator: {\n privileges: ['aeon_dump_manager.creator'],\n dependencies: ['aeon_dump_manager.viewer'],\n },\n deleter: {\n privileges: ['aeon_dump_manager.deleter'],\n dependencies: ['aeon_dump_manager.viewer'],\n },\n },\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.p = \"bundles/aeondumpmanager/\";","\n if (window?.__sw__?.assetPath) {\n __webpack_public_path__ = window.__sw__.assetPath + '/bundles/aeondumpmanager/';\n }\n ","export interface DumpFile {\n filename: string;\n datetime: string;\n sizeBytes: number;\n}\n\nexport interface DumpList {\n dumps: DumpFile[];\n}\n\nexport interface CreateDumpResponse {\n jobId: string;\n}\n\nexport type DumpJobStatus = 'pending' | 'running' | 'done' | 'failed';\n\nexport interface DumpJob {\n id: string;\n status: DumpJobStatus;\n percent: number | null;\n filename: string | null;\n errorMessage: string | null;\n}\n\n// Shopware.Classes.ApiService has no official type package for plugin authors\n// (per docs/research/admin-dump-manager-ui.md §4) — redeclaring the inherited\n// member this class actually uses keeps everything below typed without one.\n// `declare` is required here: a normal field declaration compiles to a real\n// `this.httpClient = void 0` in the constructor, which runs *after* `super()`\n// and silently clobbers the value the base class just set.\nconst { ApiService } = Shopware.Classes;\n\nexport default class DumpApiService extends ApiService {\n protected declare httpClient: {\n get: (url: string, config?: unknown) => Promise;\n post: (url: string, data: unknown, config?: unknown) => Promise;\n delete: (url: string, config?: unknown) => Promise;\n };\n\n protected declare getBasicHeaders: (additionalHeaders?: Record) => Record;\n\n constructor(httpClient: unknown, loginService: unknown, apiEndpoint = 'aeon-dump-manager') {\n super(httpClient, loginService, apiEndpoint);\n }\n\n getList(): Promise {\n return this.httpClient\n .get('/_action/aeon-dump-manager/dumps', { headers: this.getBasicHeaders() })\n .then((response: unknown) => ApiService.handleResponse(response));\n }\n\n create(): Promise {\n return this.httpClient\n .post('/_action/aeon-dump-manager/dumps', {}, { headers: this.getBasicHeaders() })\n .then((response: unknown) => ApiService.handleResponse(response));\n }\n\n remove(filename: string): Promise {\n return this.httpClient\n .delete(`/_action/aeon-dump-manager/dumps/${encodeURIComponent(filename)}`, { headers: this.getBasicHeaders() })\n .then((response: unknown) => ApiService.handleResponse(response));\n }\n\n getJobStatus(jobId: string): Promise {\n return this.httpClient\n .get(`/_action/aeon-dump-manager/dumps/jobs/${encodeURIComponent(jobId)}`, { headers: this.getBasicHeaders() })\n .then((response: unknown) => ApiService.handleResponse(response));\n }\n\n download(filename: string): Promise {\n return this.httpClient\n .get(`/_action/aeon-dump-manager/dumps/${encodeURIComponent(filename)}/download`, {\n headers: this.getBasicHeaders(),\n responseType: 'blob',\n })\n .then((response: unknown) => ApiService.handleResponse(response) as Blob);\n }\n}\n","import template from './aeon-dump-manager-list.html.twig';\nimport type DumpApiService, { DumpFile, DumpJob } from '../../../../service/dump-api.service';\n\nconst { Component, Mixin } = Shopware;\n\ninterface PendingJob {\n status: string;\n percent: number | null;\n errorMessage?: string | null;\n}\n\nconst CREATE_MODAL_AUTO_CLOSE_MS = 1500;\n\ninterface ComponentData {\n dumps: DumpFile[];\n isLoading: boolean;\n pendingJob: PendingJob | null;\n deleteFilenames: string[] | null;\n selection: Record;\n pollTimer: number | null;\n}\n\ninterface ComponentInstance extends ComponentData {\n aeonDumpManagerApiService: DumpApiService;\n $tc: (key: string, count?: number, values?: Record) => string;\n createNotificationError: (options: { message: string }) => void;\n createNotificationSuccess: (options: { message: string }) => void;\n loadList: () => Promise;\n stopPolling: () => void;\n pollJobStatus: (jobId: string) => void;\n selectionCount: number;\n}\n\nComponent.register('aeon-dump-manager-list', {\n template,\n\n // Provides createNotificationSuccess/createNotificationError, used below.\n mixins: [Mixin.getByName('notification')],\n\n inject: ['aeonDumpManagerApiService', 'acl'],\n\n data(): ComponentData {\n return {\n dumps: [],\n isLoading: false,\n pendingJob: null,\n deleteFilenames: null,\n selection: {},\n pollTimer: null,\n };\n },\n\n computed: {\n columns() {\n return [\n {\n property: 'datetime',\n label: this.$tc('aeon-dump-manager.list.columnDatetime'),\n allowResize: true,\n },\n {\n property: 'filename',\n label: this.$tc('aeon-dump-manager.list.columnFilename'),\n allowResize: true,\n },\n {\n property: 'sizeBytes',\n label: this.$tc('aeon-dump-manager.list.columnSize'),\n align: 'right',\n allowResize: true,\n },\n ];\n },\n\n selectionCount(this: ComponentInstance): number {\n return Object.keys(this.selection).length;\n },\n },\n\n created(this: ComponentInstance) {\n this.loadList();\n },\n\n beforeDestroy(this: ComponentInstance) {\n this.stopPolling();\n },\n\n methods: {\n loadList(this: ComponentInstance): Promise {\n this.isLoading = true;\n\n return this.aeonDumpManagerApiService.getList()\n .then((response) => {\n this.dumps = response.dumps;\n })\n .finally(() => {\n this.isLoading = false;\n });\n },\n\n formatDatetime(value: string): string {\n return new Date(value).toLocaleString();\n },\n\n formatSize(bytes: number): string {\n return Shopware.Utils.format.fileSize(bytes);\n },\n\n onSelectionChange(this: ComponentInstance, selection: Record) {\n this.selection = selection;\n },\n\n onCreate(this: ComponentInstance) {\n this.pendingJob = { percent: 0, status: 'pending' };\n\n this.aeonDumpManagerApiService.create()\n .then((response) => {\n this.pollJobStatus(response.jobId);\n })\n .catch((error: Error) => {\n // Shown in the progress modal itself, not a notification —\n // stays open so the user can actually read what went wrong.\n this.pendingJob = { status: 'failed', percent: null, errorMessage: error.message };\n });\n },\n\n pollJobStatus(this: ComponentInstance, jobId: string) {\n this.stopPolling();\n\n this.pollTimer = window.setInterval(() => {\n this.aeonDumpManagerApiService.getJobStatus(jobId).then((job: DumpJob) => {\n this.pendingJob = job;\n\n if (job.status === 'done') {\n this.stopPolling();\n this.loadList();\n window.setTimeout(() => {\n this.pendingJob = null;\n }, CREATE_MODAL_AUTO_CLOSE_MS);\n return;\n }\n\n if (job.status === 'failed') {\n this.stopPolling();\n }\n });\n }, 2000);\n },\n\n stopPolling(this: ComponentInstance) {\n if (this.pollTimer !== null) {\n window.clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n },\n\n onCloseProgressModal(this: ComponentInstance) {\n this.stopPolling();\n this.pendingJob = null;\n },\n\n onDownload(this: ComponentInstance, filename: string) {\n this.aeonDumpManagerApiService.download(filename)\n .then((blob) => {\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n })\n .catch((error: Error) => {\n this.createNotificationError({\n message: this.$tc('aeon-dump-manager.list.downloadFailed', 0, { error: error.message }),\n });\n });\n },\n\n onRequestDelete(this: ComponentInstance, filename: string) {\n this.deleteFilenames = [filename];\n },\n\n onRequestBulkDelete(this: ComponentInstance) {\n this.deleteFilenames = Object.keys(this.selection);\n },\n\n onCancelDelete(this: ComponentInstance) {\n this.deleteFilenames = null;\n },\n\n onConfirmDelete(this: ComponentInstance): Promise {\n const filenames = this.deleteFilenames as string[];\n this.deleteFilenames = null;\n\n // Optimistic UI update: pull the rows out immediately rather than\n // waiting on a full reload, so the grid never looks stale even if\n // loadList() is slow or a later delete in the batch fails.\n this.dumps = this.dumps.filter((dumpFile) => !filenames.includes(dumpFile.filename));\n this.selection = {};\n\n return Promise.all(filenames.map((filename) => this.aeonDumpManagerApiService.remove(filename)))\n .then(() => this.loadList())\n .catch((error: Error) => {\n this.createNotificationError({\n message: this.$tc('aeon-dump-manager.list.deleteFailed', 0, { error: error.message }),\n });\n // A delete failed after the optimistic removal — reload to\n // show the real state rather than leave a wrong guess on screen.\n return this.loadList();\n });\n },\n },\n});\n","export default \"{% block aeon_dump_manager_list %}\\n\\n \\n\\n \\n\\n {% block aeon_dump_manager_list_progress_modal %}\\n \\n
\\n \\n \\n \\n
\\n \\n {% endblock %}\\n\\n 1\\n ? $tc('aeon-dump-manager.list.confirmDeleteTextMultiple', 0, { count: deleteFilenames.length })\\n : $tc('aeon-dump-manager.list.confirmDeleteText', 0, { filename: deleteFilenames[0] })\\\"\\n type=\\\"delete\\\"\\n @confirm=\\\"onConfirmDelete\\\"\\n @cancel=\\\"onCancelDelete\\\"\\n @close=\\\"onCancelDelete\\\"\\n />\\n
\\n{% endblock %}\\n\";","import './acl';\nimport './page/aeon-dump-manager-list';\nimport deDE from './snippet/de-DE.json';\nimport enGB from './snippet/en-GB.json';\n\nShopware.Module.register('aeon-dump-manager', {\n type: 'plugin',\n name: 'DumpManager',\n title: 'aeon-dump-manager.general.mainMenuItemGeneral',\n description: 'aeon-dump-manager.general.descriptionTextModule',\n color: '#ff3d58',\n icon: 'regular-database',\n\n snippets: {\n 'de-DE': deDE,\n 'en-GB': enGB,\n },\n\n routes: {\n list: {\n component: 'aeon-dump-manager-list',\n path: 'list',\n meta: {\n parentPath: 'sw.settings.index.system',\n privilege: 'aeon_dump_manager.viewer',\n },\n },\n },\n\n // Per https://developer.shopware.com/docs/v6.6/guides/plugins/plugins/administration/routing-navigation/add-menu-entry.html —\n // plugins can't register a first-level main-menu entry, so this nests\n // under the core 'sw-settings' navigation node. Clicking Settings in the\n // main sidebar shows this as a sub-item, landing at #/sw/settings/.\n navigation: [{\n id: 'aeon-dump-manager-list',\n label: 'aeon-dump-manager.general.mainMenuItemGeneral',\n color: '#ff3d58',\n path: 'aeon.dump.manager.list',\n icon: 'regular-database',\n parent: 'sw-settings',\n position: 100,\n privilege: 'aeon_dump_manager.viewer',\n }],\n\n // Also shown as a card on the Settings overview page's \"System\" group,\n // next to Plugins/Cache — complements the navigation entry above.\n settingsItem: {\n group: 'system',\n to: 'aeon.dump.manager.list',\n icon: 'regular-database',\n privilege: 'aeon_dump_manager.viewer',\n },\n});\n","import DumpApiService from './service/dump-api.service';\nimport './module/aeon-dump-manager';\n\nShopware.Application.addServiceProvider('aeonDumpManagerApiService', (container: { loginService: unknown }) => {\n const initContainer = Shopware.Application.getContainer('init');\n\n return new DumpApiService(initContainer.httpClient, container.loginService);\n});\n"],"names":["Shopware","Service","addPrivilegeMappingEntry","category","parent","key","roles","viewer","privileges","dependencies","creator","deleter","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","p","window","__sw__","assetPath","ApiService","Classes","DumpApiService","constructor","httpClient","loginService","apiEndpoint","getList","get","headers","getBasicHeaders","then","handleResponse","response","create","post","remove","filename","delete","encodeURIComponent","getJobStatus","jobId","download","responseType","Component","Mixin","register","template","mixins","getByName","inject","data","dumps","isLoading","pendingJob","deleteFilenames","selection","pollTimer","computed","columns","property","label","$tc","allowResize","align","selectionCount","Object","keys","length","created","loadList","beforeDestroy","stopPolling","methods","aeonDumpManagerApiService","finally","formatDatetime","value","Date","toLocaleString","formatSize","bytes","Utils","format","fileSize","onSelectionChange","onCreate","percent","status","pollJobStatus","catch","errorMessage","error","message","setInterval","job","setTimeout","clearInterval","onCloseProgressModal","onDownload","url","URL","createObjectURL","blob","link","document","createElement","href","body","appendChild","click","removeChild","revokeObjectURL","createNotificationError","onRequestDelete","onRequestBulkDelete","onCancelDelete","onConfirmDelete","filenames","filter","includes","dumpFile","Promise","all","map","Module","type","name","title","description","color","icon","snippets","deDE","enGB","routes","list","component","path","meta","parentPath","privilege","navigation","id","position","settingsItem","group","to","Application","addServiceProvider","initContainer","getContainer","container"],"sourceRoot":""} \ No newline at end of file diff --git a/src/Storefront/Resources/public/administration/.vite/entrypoints.json b/src/Storefront/Resources/public/administration/.vite/entrypoints.json new file mode 100644 index 0000000..8e3ff47 --- /dev/null +++ b/src/Storefront/Resources/public/administration/.vite/entrypoints.json @@ -0,0 +1,23 @@ +{ + "base": "/bundles/storefront/administration/", + "entryPoints": { + "storefront": { + "css": [], + "dynamic": [], + "js": [ + "/bundles/storefront/administration/js/storefront.js" + ], + "legacy": false, + "preload": [] + } + }, + "legacy": false, + "metadatas": {}, + "version": [ + "7.0.4", + 7, + 0, + 4 + ], + "viteServer": null +} \ No newline at end of file diff --git a/src/Storefront/Resources/public/administration/.vite/manifest.json b/src/Storefront/Resources/public/administration/.vite/manifest.json new file mode 100644 index 0000000..ab12e23 --- /dev/null +++ b/src/Storefront/Resources/public/administration/.vite/manifest.json @@ -0,0 +1,9 @@ +{ + "main.js": { + "file": "js/storefront.js", + "name": "storefront", + "src": "main.js", + "isEntry": true, + "css": [] + } +} \ No newline at end of file