airdcpp-webui 2.14.0-beta.1 → 2.14.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +1 -1
- package/dist/js/{544.898c1446b5aa789e87aa.chunk.js → 544.d80fd4be34c4025d53c2.chunk.js} +1 -1
- package/dist/js/544.d80fd4be34c4025d53c2.chunk.js.gz +0 -0
- package/dist/js/{544.898c1446b5aa789e87aa.chunk.js.map → 544.d80fd4be34c4025d53c2.chunk.js.map} +1 -1
- package/dist/js/{favorite-hubs.b27996a4b16db08060e3.chunk.js → favorite-hubs.b435e52e7a89e94f29d3.chunk.js} +1 -1
- package/dist/js/favorite-hubs.b435e52e7a89e94f29d3.chunk.js.gz +0 -0
- package/dist/js/{favorite-hubs.b27996a4b16db08060e3.chunk.js.map → favorite-hubs.b435e52e7a89e94f29d3.chunk.js.map} +1 -1
- package/dist/js/{filelists.6fcc193dfe9850d6be17.chunk.js → filelists.3e9317b5397551364a0a.chunk.js} +1 -1
- package/dist/js/{filelists.6fcc193dfe9850d6be17.chunk.js.gz → filelists.3e9317b5397551364a0a.chunk.js.gz} +0 -0
- package/dist/js/{filelists.6fcc193dfe9850d6be17.chunk.js.map → filelists.3e9317b5397551364a0a.chunk.js.map} +1 -1
- package/dist/js/{home.b8752a4d9f41261d1528.chunk.js → home.b7ce1147e0cd4dcc4030.chunk.js} +2 -2
- package/dist/js/home.b7ce1147e0cd4dcc4030.chunk.js.gz +0 -0
- package/dist/js/{home.b8752a4d9f41261d1528.chunk.js.map → home.b7ce1147e0cd4dcc4030.chunk.js.map} +1 -1
- package/dist/js/main.58ad2e94feda86a40744.entry.js +3 -0
- package/dist/js/main.58ad2e94feda86a40744.entry.js.gz +0 -0
- package/dist/js/{main.df3afb8b1116c1c8b56e.entry.js.map → main.58ad2e94feda86a40744.entry.js.map} +1 -1
- package/dist/js/{queue.b9062cb9418fe60b3d0f.chunk.js → queue.42bfad4f850be836bf95.chunk.js} +1 -1
- package/dist/js/{queue.b9062cb9418fe60b3d0f.chunk.js.gz → queue.42bfad4f850be836bf95.chunk.js.gz} +0 -0
- package/dist/js/{queue.b9062cb9418fe60b3d0f.chunk.js.map → queue.42bfad4f850be836bf95.chunk.js.map} +1 -1
- package/dist/js/{search.c72ee2a33abcc244726a.chunk.js → search.2585d4f639d45210ab3e.chunk.js} +1 -1
- package/dist/js/search.2585d4f639d45210ab3e.chunk.js.gz +0 -0
- package/dist/js/{search.c72ee2a33abcc244726a.chunk.js.map → search.2585d4f639d45210ab3e.chunk.js.map} +1 -1
- package/dist/js/{settings.290b2b69605a1b68cbd7.chunk.js → settings.8fecce2a6b439d476182.chunk.js} +2 -2
- package/dist/js/settings.8fecce2a6b439d476182.chunk.js.gz +0 -0
- package/dist/js/{settings.290b2b69605a1b68cbd7.chunk.js.map → settings.8fecce2a6b439d476182.chunk.js.map} +1 -1
- package/dist/js/{share.f410e2c905170f691c9c.chunk.js → share.d1de787e69222186cc14.chunk.js} +1 -1
- package/dist/js/share.d1de787e69222186cc14.chunk.js.gz +0 -0
- package/dist/js/{share.f410e2c905170f691c9c.chunk.js.map → share.d1de787e69222186cc14.chunk.js.map} +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.gz +0 -0
- package/package.json +1 -1
- package/tsconfig.json +0 -3
- package/vitest.workspace.ts +1 -1
- package/dist/js/544.898c1446b5aa789e87aa.chunk.js.gz +0 -0
- package/dist/js/favorite-hubs.b27996a4b16db08060e3.chunk.js.gz +0 -0
- package/dist/js/home.b8752a4d9f41261d1528.chunk.js.gz +0 -0
- package/dist/js/main.df3afb8b1116c1c8b56e.entry.js +0 -3
- package/dist/js/main.df3afb8b1116c1c8b56e.entry.js.gz +0 -0
- package/dist/js/search.c72ee2a33abcc244726a.chunk.js.gz +0 -0
- package/dist/js/settings.290b2b69605a1b68cbd7.chunk.js.gz +0 -0
- package/dist/js/share.f410e2c905170f691c9c.chunk.js.gz +0 -0
- /package/dist/js/{home.b8752a4d9f41261d1528.chunk.js.LICENSE.txt → home.b7ce1147e0cd4dcc4030.chunk.js.LICENSE.txt} +0 -0
- /package/dist/js/{main.df3afb8b1116c1c8b56e.entry.js.LICENSE.txt → main.58ad2e94feda86a40744.entry.js.LICENSE.txt} +0 -0
package/dist/index.html
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{
|
|
17
17
|
// We must inject the main chunk dynamically as well because the final path is not known on compile time
|
|
18
18
|
var script = document.createElement('script');
|
|
19
|
-
script.src = getBasePath() + "js/main.
|
|
19
|
+
script.src = getBasePath() + "js/main.58ad2e94feda86a40744.entry.js";
|
|
20
20
|
document.body.appendChild(script);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[544],{20082:(e,n,o)=>{o.d(n,{A:()=>d});var t=o(71354),a=o.n(t),s=o(76314),l=o.n(s)()(a());l.push([e.id,".download-dialog .accordion.download-targets {\n overflow-y: auto;\n}\n\n.download-dialog .main-content,\n.download-dialog .mobile.layout {\n display: flex;\n flex-direction: column;\n}\n\n.download-dialog .main-content .list {\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.download-dialog .content > div,\n.download-dialog .ui.grid .column,\n.download-dialog .main-content {\n height: 100%;\n}\n\n.download-dialog .download-handler {\n display: flex;\n align-items: baseline;\n}\n\n.download-dialog .disk-info {\n color: black;\n font-size: 90%;\n font-style: italic;\n}\n\n.download-dialog .normal.layout .four.wide.column {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n","",{version:3,sources:["webpack://./src/components/download/style.css"],names:[],mappings:"AAAA;EACE,gBAAgB;AAClB;;AAEA;;EAEE,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;;;EAGE,YAAY;AACd;;AAEA;EACE,aAAa;EACb,qBAAqB;AACvB;;AAEA;EACE,YAAY;EACZ,cAAc;EACd,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC",sourcesContent:[".download-dialog .accordion.download-targets {\r\n overflow-y: auto;\r\n}\r\n\r\n.download-dialog .main-content,\r\n.download-dialog .mobile.layout {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.download-dialog .main-content .list {\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n}\r\n\r\n.download-dialog .content > div,\r\n.download-dialog .ui.grid .column,\r\n.download-dialog .main-content {\r\n height: 100%;\r\n}\r\n\r\n.download-dialog .download-handler {\r\n display: flex;\r\n align-items: baseline;\r\n}\r\n\r\n.download-dialog .disk-info {\r\n color: black;\r\n font-size: 90%;\r\n font-style: italic;\r\n}\r\n\r\n.download-dialog .normal.layout .four.wide.column {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: space-between;\r\n}\r\n"],sourceRoot:""}]);const d=l},53213:(e,n,o)=>{o.d(n,{G:()=>a});var t=o(93226);const a=(e,n,o)=>e.post(`${t.Ay.STRINGS_URL}/${n}`,{string:o})},73070:(e,n,o)=>{o.d(n,{Y9:()=>h,fI:()=>c,xA:()=>m});var t=o(74848),a=(o(96540),o(46942)),s=o.n(a),l=o(32389),d=o(42695),i=o(67749);const r=e=>e||(0,t.jsx)(l.x6,{i18nKey:(0,d.j2)("na",i.KV.COMMON),children:"N/A"}),c=({title:e,text:n,className:o,titleWidth:a="four",noText:l})=>(0,t.jsxs)("div",{className:s()("ui row",o),children:[(0,t.jsx)("div",{className:s()(l?"sixteen":a,"wide column title"),children:(0,t.jsx)("div",{className:"ui tiny header",style:{overflow:"hidden"},children:e})}),!l&&(0,t.jsx)("div",{className:"column value",children:r(n)})]}),h=({title:e})=>(0,t.jsx)("div",{className:"ui row",children:(0,t.jsx)("div",{className:"sixteen wide column",children:(0,t.jsx)("div",{className:"ui blue section header",children:e})})}),m=e=>{var{className:n,children:o,columns:a,stackable:l}=e,d=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(t=Object.getOwnPropertySymbols(e);a<t.length;a++)n.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(o[t[a]]=e[t[a]])}return o}(e,["className","children","columns","stackable"]);return(0,t.jsx)("div",Object.assign({className:s()("ui grid",{[`${a} column`]:!!a},{stackable:l},n)},d,{children:o}))}},79179:(e,n,o)=>{o.d(n,{A:()=>a});const t="favorite_directories",a={MODULE_URL:t,GROUPED_DIRECTORIES_URL:t+"/grouped_paths",DIRECTORIES_URL:t,DIRECTORIES_UPDATED:"favorite_directories_updated"}},88544:(e,n,o)=>{o.d(n,{A:()=>le});var t=o(74848),a=o(96540),s=o(85788),l=o(32389),d=o(93226),i=o(59315),r=o(4425),c=o(88939),h=o(56484),m=o(65385),u=o(99671),A=o(47603),p=o(36076),w=o(42695),f=o(53213),y=o(33968),x=o(8098),v=o(42191),j=o(79179),O=o(27725),g=o(67749),E=o(32728),b=o(83994),N=o(74416),C=o(50489);const I=(e,n,{formatSize:o})=>e.free_space<=0?e.path:` (${n((0,w.j2)("spaceFree",g.KV.COMMON),{defaultValue:"{{freeSpace}} free",replace:{freeSpace:o(e.free_space)}})})`,P=({pathInfo:e,downloadHandler:n,t:o})=>{const a=(0,N.k)();return(0,t.jsxs)("div",{className:"item",children:[(0,t.jsx)(b.A,{icon:r.A.FOLDER}),(0,t.jsx)("div",{className:"content",children:(0,t.jsx)(C.A,{onClick:()=>n(e.path),caption:(0,t.jsxs)(t.Fragment,{children:[e.path,(0,t.jsx)("span",{className:"disk-info",children:I(e,o,a)})]})})})]})},B=(0,h.A)(function({downloadHandler:e,pathInfos:n,t:o}){return(0,t.jsx)("div",{className:"ui relaxed list",children:n.map(n=>(0,t.jsx)(P,{pathInfo:n,downloadHandler:e,t:o},n.path))})},{urls:{pathInfos:({paths:e},n)=>n.post(i.A.DISK_INFO_URL,{paths:e})}}),k=e=>0===e.paths.length?(0,t.jsx)(E.A,{title:(0,w.Tl)("No paths to display",e.t,g.KV.COMMON)}):(0,t.jsx)(B,Object.assign({},e));var R=o(78340);class D extends a.Component{constructor(){super(...arguments),this.formatParent=e=>{const{downloadHandler:n,t:o}=this.props;return(0,t.jsxs)(a.Fragment,{children:[(0,t.jsxs)("div",{className:"title",children:[(0,t.jsx)(b.A,{icon:r.A.DROPDOWN}),e.name]}),(0,t.jsx)("div",{className:"content",children:(0,t.jsx)(k,{paths:e.paths,downloadHandler:n,t:o})})]},e.name)}}render(){const{groupedPaths:e,t:n}=this.props;return 0===e.length?(0,t.jsx)(E.A,{title:(0,w.Tl)("No paths to display",n,g.KV.COMMON)}):(0,t.jsx)(R.Ay,{className:"styled download-targets",children:e.map(this.formatParent)})}}const _=D;var S=o(90425);const M=(e,n,o)=>n?[...e,(0,t.jsxs)(O.A,{onClick:n,children:[(0,w.Tl)("Browse",o,g.KV.COMMON),(0,t.jsx)(b.A,{icon:r.A.BROWSE})]},"browse")]:e,T=({menuItems:e,title:n,handleBrowse:o,t:a,children:s})=>(0,t.jsxs)("div",{className:"mobile layout",children:[(0,t.jsx)(S.A,{selection:!0,caption:n,children:M(e,o,a)}),(0,t.jsx)("div",{className:"ui segment main-content",children:s})]});var H=o(96529),L=o(73070);const U=({menuItems:e,title:n,handleBrowse:o,t:a,children:s})=>(0,t.jsxs)(L.xA,{className:"normal layout",children:[(0,t.jsxs)("div",{className:"four wide column",children:[(0,t.jsx)("div",{className:"ui vertical fluid tabular menu",children:e}),!!o&&(0,t.jsx)(H.A,{className:"fluid basic",caption:(0,w.Tl)("Browse",a,g.KV.COMMON),onClick:o,icon:r.A.BROWSE})]}),(0,t.jsx)("div",{className:"twelve wide stretched column",children:(0,t.jsx)("div",{className:"ui segment main-content",children:s})})]}),V=(0,h.A)(e=>{const{t:n}=(0,l.Bd)(),[o,s]=(0,a.useState)("history"),d=a.useMemo(()=>{const{historyPaths:n,sharePaths:o,favoritePaths:a,itemInfo:s}=e;return(e=>{const{sharePaths:n,favoritePaths:o,historyPaths:a,dupePaths:s}=e;return[{name:"Previous",key:"history",list:a,component:({downloadHandler:e,t:n})=>(0,t.jsx)(k,{paths:a,downloadHandler:e,t:n})},{name:"Shared",key:"shared",list:n,component:({downloadHandler:e,t:o})=>(0,t.jsx)(_,{groupedPaths:n,downloadHandler:e,t:o})},{name:"Favorites",key:"favorites",list:o,component:({downloadHandler:e,t:n})=>(0,t.jsx)(_,{groupedPaths:o,downloadHandler:e,t:n})},{name:"Dupes",key:"dupes",list:s,component:({downloadHandler:e,t:n})=>(0,t.jsx)(k,{paths:s,downloadHandler:e,t:n})}]})({historyPaths:n,sharePaths:o,favoritePaths:a,dupePaths:s.dupe?s.dupe.paths.map(e=>(0,y._6)(e)):[]})},[]),i=d.find(e=>e.key===o);if(!i)return null;const r=d.map(e=>((e,n,o,a)=>(0,t.jsx)(O.A,{onClick:()=>o(e.key),active:n===e.key,children:(0,t.jsxs)(t.Fragment,{children:[a((0,w.j2)(e.key,g.KV.COMMON),e.name),!!e.list&&(0,t.jsx)("div",{className:"ui small label",children:e.list.length})]})},e.key))(e,o,s,n)),c=(0,x.vU)()?T:U;return(0,t.jsx)(c,{menuItems:r,title:i.name,handleBrowse:e.handleBrowse,t:n,children:(0,t.jsx)(i.component,{t:n,downloadHandler:e.downloadHandler})},i.key)},{urls:{sharePaths:v.A.GROUPED_ROOTS_GET_URL,favoritePaths:j.A.GROUPED_DIRECTORIES_URL}});var F=o(86038),K=o(85072),G=o.n(K),W=o(97825),Y=o.n(W),q=o(77659),$=o.n(q),z=o(55056),Z=o.n(z),J=o(10540),Q=o.n(J),X=o(41113),ee=o.n(X),ne=o(20082),oe={};oe.styleTagTransform=ee(),oe.setAttributes=Z(),oe.insert=$().bind(null,"head"),oe.domAPI=Y(),oe.insertStyleElement=Q(),G()(ne.A,oe),ne.A&&ne.A.locals&&ne.A.locals;var te=o(28286),ae=o(48249),se=function(e,n,o,t){return new(o||(o=Promise))(function(a,s){function l(e){try{i(t.next(e))}catch(e){s(e)}}function d(e){try{i(t.throw(e))}catch(e){s(e)}}function i(e){var n;e.done?a(e.value):(n=e.value,n instanceof o?n:new o(function(e){e(n)})).then(l,d)}i((t=t.apply(e,n||[])).next())})};const le=(0,m.A)((0,h.A)(e=>{const{t:n}=(0,l.Bd)(),o=(0,s.Zp)(),{hasAccess:a}=(0,te.w)(),h=(0,ae.F)(),{downloadHandler:m,itemInfo:x,userGetter:v,params:j,session:O,historyPaths:E,handleClose:b}=e,N=function(e,n){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(t=Object.getOwnPropertySymbols(e);a<t.length;a++)n.indexOf(t[a])<0&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(o[t[a]]=e[t[a]])}return o}(e,["downloadHandler","itemInfo","userGetter","params","session","historyPaths","handleClose"]),C=(o,t)=>se(void 0,void 0,void 0,function*(){try{yield m(x,v?v(j.downloadItemId,e):void 0,{target_name:t||x.name,target_directory:o,priority:F.Fm.DEFAULT},O)}catch(e){c.A.error({title:n((0,w.j2)("queueingFailed",g.KV.COMMON),{defaultValue:"Failed to queue the item {{item.name}}",replace:{item:x}}),message:e.message})}(0,p.bd)(()=>(0,f.G)(h,d.n2.DOWNLOAD_DIR,o),n)}),I={subHeader:x.name,title:(0,w.Tl)("Download",n,g.KV.COMMON),icon:r.A.DOWNLOAD,closable:!1},P=a(F.US.FILESYSTEM_VIEW);return(0,t.jsxs)(s.BV,{children:[(0,t.jsx)(s.qh,{path:"browse/*",element:(0,t.jsx)(A.d,Object.assign({onConfirm:e=>se(void 0,void 0,void 0,function*(){yield C((0,y.oK)(e),(0,y.WP)(e))}),initialPath:(()=>{const e=E.length>0?E[E.length-1]:"";return"directory"===x.type.id?e:e+x.name})(),selectMode:"directory"===x.type.id?g.bV.DIRECTORY:g.bV.FILE,historyId:i.A.LOCATION_DOWNLOAD,approveCaption:(0,w.Tl)("Download",n,g.KV.COMMON),modalComponent:u.A},I))}),(0,t.jsx)(s.qh,{index:!0,element:(0,t.jsx)(u.A,Object.assign({className:"download-dialog",fullHeight:!0},I,N,{children:(0,t.jsx)(V,{downloadHandler:(e,n)=>se(void 0,void 0,void 0,function*(){yield C(e,n),yield b()}),handleBrowse:P?()=>{o("browse")}:void 0,historyPaths:E,itemInfo:x})}))})]})},{urls:{historyPaths:`${d.Ay.STRINGS_URL}/${d.n2.DOWNLOAD_DIR}`,itemInfo:({params:e,itemDataGetter:n},o)=>n(e.downloadItemId,o)}}),"/download/:downloadItemId")}}]);
|
|
2
|
-
//# sourceMappingURL=544.
|
|
2
|
+
//# sourceMappingURL=544.d80fd4be34c4025d53c2.chunk.js.map
|
|
Binary file
|
package/dist/js/{544.898c1446b5aa789e87aa.chunk.js.map → 544.d80fd4be34c4025d53c2.chunk.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js/544.898c1446b5aa789e87aa.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,wtBAqCtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,qPAAqP,eAAiB,CAAC,myBAAmyB,WAAa,MAE5pC,S,kDCzCO,MAAMC,EAAa,CAACC,EAAmBC,EAAmBC,IACxDF,EAAOG,KAAK,GAAG,KAAiBC,eAAeH,IAAa,CACjEI,OAAQH,G,qICWZ,MAAMI,EAAcJ,GACZA,IAIC,SAAC,KAAK,CAACK,SAAS,QAAU,KAAM,KAAWC,QAAO,iBAG9CC,EAA0B,EACrCC,QACAR,OACAS,YACAC,aAAa,OACbC,aAEA,iBAAKF,UAAW,IAAW,SAAUA,GAAU,WAC7C,gBAAKA,UAAW,IAAWE,EAAS,UAAYD,EAAY,qBA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C/BC,gBAAgB,QAAU,WAAYpH,EAAG,KAAWpB,QACpDyI,eAAgBC,EAAA,GACZjB,OAIV,SAAC,KAAK,CACJkB,OAAK,EACLZ,SACE,SAACW,EAAA,EAAU,eACTvI,UAAU,kBACVyI,YAAY,GACRnB,EACA5G,EAAK,WAET,SAAC,EAAc,CACbe,gBAAiB,CAAO+E,EAAYC,IAAmB,QAAD,kCAC9CF,EAAeC,EAAYC,SAC3BH,GACR,GACA7C,aAAciE,EAhDL,KACnBzB,EAAS,gBA+CqDU,EACpDrC,aAAcA,EACdG,SAAUA,aAaJ,CAChBnC,KAAM,CACJgC,aAAc,GAAGoE,EAAA,GAAiBjJ,eAAe,KAAkB4H,eACnE5C,SAAU,EAAG2B,SAAQuC,kBAAkBtJ,IAC9BsJ,EAAevC,EAAOM,eAAiBrH,MAIpD,4B","sources":["webpack://airdcpp-webui/./src/components/download/style.css","webpack://airdcpp-webui/./src/services/api/HistoryApi.ts","webpack://airdcpp-webui/./src/components/semantic/Grid.tsx","webpack://airdcpp-webui/./src/constants/FavoriteDirectoryConstants.ts","webpack://airdcpp-webui/./src/components/download/layout/sections/PathListItem.tsx","webpack://airdcpp-webui/./src/components/download/layout/sections/PathList.tsx","webpack://airdcpp-webui/./src/components/download/layout/sections/AccordionTargets.tsx","webpack://airdcpp-webui/./src/components/download/layout/MobileDownloadLayout.tsx","webpack://airdcpp-webui/./src/components/download/layout/NormalDownloadLayout.tsx","webpack://airdcpp-webui/./src/components/download/layout/DownloadView.tsx","webpack://airdcpp-webui/./src/components/download/layout/sections/sections.tsx","webpack://airdcpp-webui/./src/components/download/style.css?6643","webpack://airdcpp-webui/./src/components/download/DownloadDialog.tsx"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.download-dialog .accordion.download-targets {\r\n overflow-y: auto;\r\n}\r\n\r\n.download-dialog .main-content,\r\n.download-dialog .mobile.layout {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.download-dialog .main-content .list {\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n}\r\n\r\n.download-dialog .content > div,\r\n.download-dialog .ui.grid .column,\r\n.download-dialog .main-content {\r\n height: 100%;\r\n}\r\n\r\n.download-dialog .download-handler {\r\n display: flex;\r\n align-items: baseline;\r\n}\r\n\r\n.download-dialog .disk-info {\r\n color: black;\r\n font-size: 90%;\r\n font-style: italic;\r\n}\r\n\r\n.download-dialog .normal.layout .four.wide.column {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: space-between;\r\n}\r\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/download/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,gBAAgB;AAClB;;AAEA;;EAEE,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;;;EAGE,YAAY;AACd;;AAEA;EACE,aAAa;EACb,qBAAqB;AACvB;;AAEA;EACE,YAAY;EACZ,cAAc;EACd,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC\",\"sourcesContent\":[\".download-dialog .accordion.download-targets {\\r\\n overflow-y: auto;\\r\\n}\\r\\n\\r\\n.download-dialog .main-content,\\r\\n.download-dialog .mobile.layout {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n}\\r\\n\\r\\n.download-dialog .main-content .list {\\r\\n overflow-y: auto;\\r\\n overflow-x: hidden;\\r\\n}\\r\\n\\r\\n.download-dialog .content > div,\\r\\n.download-dialog .ui.grid .column,\\r\\n.download-dialog .main-content {\\r\\n height: 100%;\\r\\n}\\r\\n\\r\\n.download-dialog .download-handler {\\r\\n display: flex;\\r\\n align-items: baseline;\\r\\n}\\r\\n\\r\\n.download-dialog .disk-info {\\r\\n color: black;\\r\\n font-size: 90%;\\r\\n font-style: italic;\\r\\n}\\r\\n\\r\\n.download-dialog .normal.layout .four.wide.column {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: space-between;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { APISocket } from '@/services/SocketService';\r\nimport HistoryConstants from '@/constants/HistoryConstants';\r\n\r\nexport const addHistory = (socket: APISocket, historyId: string, text: string) => {\r\n return socket.post(`${HistoryConstants.STRINGS_URL}/${historyId}`, {\r\n string: text,\r\n });\r\n};\r\n","import * as React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nimport { Trans } from 'react-i18next';\r\nimport { toI18nKey } from '@/utils/TranslationUtils';\r\n\r\nimport * as UI from '@/types/ui';\r\n\r\nexport interface RowProps {\r\n title: React.ReactNode;\r\n text?: React.ReactNode;\r\n titleWidth?: string;\r\n className?: string;\r\n noText?: boolean;\r\n}\r\n\r\nconst formatText = (text: React.ReactNode) => {\r\n if (!!text) {\r\n return text;\r\n }\r\n\r\n return <Trans i18nKey={toI18nKey('na', UI.Modules.COMMON)}>N/A</Trans>;\r\n};\r\n\r\nexport const Row: React.FC<RowProps> = ({\r\n title,\r\n text,\r\n className,\r\n titleWidth = 'four',\r\n noText,\r\n}) => (\r\n <div className={classNames('ui row', className)}>\r\n <div className={classNames(noText ? 'sixteen' : titleWidth, 'wide column title')}>\r\n <div className=\"ui tiny header\" style={{ overflow: 'hidden' }}>\r\n {title}\r\n </div>\r\n </div>\r\n {!noText && <div className=\"column value\">{formatText(text)}</div>}\r\n </div>\r\n);\r\n\r\nexport interface HeaderProps {\r\n title: React.ReactNode;\r\n}\r\n\r\nexport const Header: React.FC<HeaderProps> = ({ title }) => (\r\n <div className=\"ui row\">\r\n <div className=\"sixteen wide column\">\r\n <div className=\"ui blue section header\">{title}</div>\r\n </div>\r\n </div>\r\n);\r\n\r\nexport interface GridProps extends React.HTMLAttributes<HTMLDivElement> {\r\n columns?: string;\r\n stackable?: boolean;\r\n}\r\n\r\nexport const Grid: React.FC<GridProps> = ({\r\n className,\r\n children,\r\n columns,\r\n stackable,\r\n ...other\r\n}) => (\r\n <div\r\n className={classNames(\r\n 'ui grid',\r\n //`${columns} column`,\r\n { [`${columns} column`]: !!columns },\r\n { stackable: stackable },\r\n className,\r\n )}\r\n {...other}\r\n >\r\n {children}\r\n </div>\r\n);\r\n","const MODULE_URL = 'favorite_directories';\r\nexport default {\r\n MODULE_URL: MODULE_URL,\r\n\r\n GROUPED_DIRECTORIES_URL: MODULE_URL + '/grouped_paths',\r\n DIRECTORIES_URL: MODULE_URL,\r\n\r\n DIRECTORIES_UPDATED: 'favorite_directories_updated',\r\n};\r\n","import * as React from 'react';\r\n\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport Icon from '@/components/semantic/Icon';\r\n\r\nimport { toI18nKey } from '@/utils/TranslationUtils';\r\nimport { Formatter, useFormatter } from '@/context/FormatterContext';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\nimport { PathDownloadHandler } from '../../types';\r\nimport LinkButton from '@/components/semantic/LinkButton';\r\n\r\ninterface PathItemProps {\r\n pathInfo: API.DiskSpaceInfo;\r\n downloadHandler: PathDownloadHandler;\r\n t: UI.TranslateF;\r\n}\r\n\r\nconst formatFreeSpace = (\r\n pathInfo: API.DiskSpaceInfo,\r\n t: UI.TranslateF,\r\n { formatSize }: Formatter,\r\n) => {\r\n if (pathInfo.free_space <= 0) {\r\n return pathInfo.path;\r\n }\r\n\r\n return ` (${t(toI18nKey('spaceFree', UI.Modules.COMMON), {\r\n defaultValue: '{{freeSpace}} free',\r\n replace: {\r\n freeSpace: formatSize(pathInfo.free_space),\r\n },\r\n })})`;\r\n};\r\n\r\nexport const PathListItem: React.FC<PathItemProps> = ({\r\n pathInfo,\r\n downloadHandler,\r\n t,\r\n}) => {\r\n const formatter = useFormatter();\r\n return (\r\n <div className=\"item\">\r\n <Icon icon={IconConstants.FOLDER} />\r\n <div className=\"content\">\r\n <LinkButton\r\n onClick={() => downloadHandler(pathInfo.path)}\r\n caption={\r\n <>\r\n {pathInfo.path}\r\n <span className=\"disk-info\">{formatFreeSpace(pathInfo, t, formatter)}</span>\r\n </>\r\n }\r\n />\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import FilesystemConstants from '@/constants/FilesystemConstants';\r\n\r\nimport DataProviderDecorator from '@/decorators/DataProviderDecorator';\r\n\r\nimport Message from '@/components/semantic/Message';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { PathDownloadHandler } from '../../types';\r\nimport { PathListItem } from './PathListItem';\r\n\r\ninterface PathListProps {\r\n // Function handling the path selection\r\n downloadHandler: PathDownloadHandler;\r\n\r\n // Array of paths to list\r\n paths: string[];\r\n t: UI.TranslateF;\r\n}\r\n\r\ninterface PathListDataProps {\r\n pathInfos: API.DiskSpaceInfo[];\r\n}\r\n\r\nconst PathListWithData = DataProviderDecorator<PathListProps, PathListDataProps>(\r\n function PathList({ downloadHandler, pathInfos, t }) {\r\n return (\r\n <div className=\"ui relaxed list\">\r\n {pathInfos.map((pathInfo) => (\r\n <PathListItem\r\n key={pathInfo.path}\r\n pathInfo={pathInfo}\r\n downloadHandler={downloadHandler}\r\n t={t}\r\n />\r\n ))}\r\n </div>\r\n );\r\n },\r\n {\r\n urls: {\r\n pathInfos: ({ paths }, socket) =>\r\n socket.post(FilesystemConstants.DISK_INFO_URL, { paths }),\r\n },\r\n },\r\n);\r\n\r\nconst PathList: React.FC<PathListProps> = (props) => {\r\n if (props.paths.length === 0) {\r\n return (\r\n <Message title={translate('No paths to display', props.t, UI.Modules.COMMON)} />\r\n );\r\n }\r\n\r\n return <PathListWithData {...props} />;\r\n};\r\n\r\nexport default PathList;\r\n","import React, { Component } from 'react';\r\n\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport Accordion from '@/components/semantic/Accordion';\r\nimport Icon from '@/components/semantic/Icon';\r\nimport Message from '@/components/semantic/Message';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\nimport { PathDownloadHandler } from '../../types';\r\n\r\nimport PathList from './PathList';\r\n\r\ninterface AccordionTargetsProps {\r\n // Grouped paths to list\r\n groupedPaths: API.GroupedPath[];\r\n\r\n // Function handling the path selection. Receives the selected path as argument.\r\n downloadHandler: PathDownloadHandler;\r\n\r\n t: UI.TranslateF;\r\n}\r\n\r\nclass AccordionTargets extends Component<AccordionTargetsProps> {\r\n formatParent = (parent: API.GroupedPath) => {\r\n const { downloadHandler, t } = this.props;\r\n return (\r\n <React.Fragment key={parent.name}>\r\n <div className=\"title\">\r\n <Icon icon={IconConstants.DROPDOWN} />\r\n {parent.name}\r\n </div>\r\n\r\n <div className=\"content\">\r\n <PathList paths={parent.paths} downloadHandler={downloadHandler} t={t} />\r\n </div>\r\n </React.Fragment>\r\n );\r\n };\r\n\r\n render() {\r\n const { groupedPaths, t } = this.props;\r\n if (groupedPaths.length === 0) {\r\n return <Message title={translate('No paths to display', t, UI.Modules.COMMON)} />;\r\n }\r\n\r\n return (\r\n <Accordion className=\"styled download-targets\">\r\n {groupedPaths.map(this.formatParent)}\r\n </Accordion>\r\n );\r\n }\r\n}\r\n\r\nexport default AccordionTargets;\r\n","import * as React from 'react';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport Dropdown from '@/components/semantic/Dropdown';\r\nimport MenuItemLink from '@/components/semantic/MenuItemLink';\r\n\r\nimport * as UI from '@/types/ui';\r\n\r\nimport Icon from '@/components/semantic/Icon';\r\nimport { BrowseHandler, DownloadLayoutProps } from '../types';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nconst appendBrowseItem = (\r\n menuItems: React.ReactNode[],\r\n handleBrowse: BrowseHandler,\r\n t: UI.TranslateF,\r\n) => {\r\n if (!handleBrowse) {\r\n return menuItems;\r\n }\r\n\r\n return [\r\n ...menuItems,\r\n <MenuItemLink key=\"browse\" onClick={handleBrowse}>\r\n {translate('Browse', t, UI.Modules.COMMON)}\r\n <Icon icon={IconConstants.BROWSE} />\r\n </MenuItemLink>,\r\n ];\r\n};\r\n\r\nexport const MobileDownloadLayout: React.FC<DownloadLayoutProps> = ({\r\n menuItems,\r\n title,\r\n handleBrowse,\r\n t,\r\n children,\r\n}) => (\r\n <div className=\"mobile layout\">\r\n <Dropdown selection={true} caption={title}>\r\n {appendBrowseItem(menuItems, handleBrowse, t)}\r\n </Dropdown>\r\n <div className=\"ui segment main-content\">{children}</div>\r\n </div>\r\n);\r\n","import * as React from 'react';\r\n\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport Button from '@/components/semantic/Button';\r\nimport { Grid } from '@/components/semantic/Grid';\r\n\r\nimport * as UI from '@/types/ui';\r\nimport { DownloadLayoutProps } from '../types';\r\n\r\nexport const NormalDownloadLayout: React.FC<DownloadLayoutProps> = ({\r\n menuItems,\r\n title,\r\n handleBrowse,\r\n t,\r\n children,\r\n}) => (\r\n <Grid className=\"normal layout\">\r\n <div className=\"four wide column\">\r\n <div className=\"ui vertical fluid tabular menu\">{menuItems}</div>\r\n {!!handleBrowse && (\r\n <Button\r\n className=\"fluid basic\"\r\n caption={translate('Browse', t, UI.Modules.COMMON)}\r\n onClick={handleBrowse}\r\n icon={IconConstants.BROWSE}\r\n />\r\n )}\r\n </div>\r\n <div className=\"twelve wide stretched column\">\r\n <div className=\"ui segment main-content\">{children}</div>\r\n </div>\r\n </Grid>\r\n);\r\n","import { useState } from 'react';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { getParentPath } from '@/utils/FileUtils';\r\nimport { usingMobileLayout } from '@/utils/BrowserUtils';\r\nimport { toI18nKey } from '@/utils/TranslationUtils';\r\n\r\nimport ShareConstants from '@/constants/ShareConstants';\r\nimport FavoriteDirectoryConstants from '@/constants/FavoriteDirectoryConstants';\r\n\r\nimport MenuItemLink from '@/components/semantic/MenuItemLink';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { getDownloadSections, DownloadSection } from './sections';\r\nimport { BrowseHandler, PathDownloadHandler } from '../types';\r\n\r\nimport { MobileDownloadLayout } from './MobileDownloadLayout';\r\nimport { NormalDownloadLayout } from './NormalDownloadLayout';\r\nimport DataProviderDecorator from '@/decorators/DataProviderDecorator';\r\n\r\nexport interface DownloadLayoutDataProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> {\r\n sharePaths: API.GroupedPath[];\r\n favoritePaths: API.GroupedPath[];\r\n}\r\n\r\nexport interface DownloadLayoutProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> {\r\n downloadHandler: PathDownloadHandler;\r\n handleBrowse: BrowseHandler;\r\n\r\n historyPaths: string[];\r\n itemInfo: ItemT;\r\n}\r\n\r\nconst getMenuItem = (\r\n section: DownloadSection,\r\n activeSection: string,\r\n onClick: (key: string) => void,\r\n t: UI.TranslateF,\r\n) => (\r\n <MenuItemLink\r\n key={section.key}\r\n onClick={() => onClick(section.key)}\r\n active={activeSection === section.key}\r\n >\r\n <>\r\n {t(toI18nKey(section.key, UI.Modules.COMMON), section.name)}\r\n {!!section.list && <div className=\"ui small label\">{section.list.length}</div>}\r\n </>\r\n </MenuItemLink>\r\n);\r\n\r\ntype Props<ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo> =\r\n DownloadLayoutProps<ItemT> & DownloadLayoutDataProps<ItemT>;\r\n\r\nconst DownloadLayout: React.FC<Props> = (props) => {\r\n const { t } = useTranslation();\r\n const [activeSectionKey, setActiveSectionKey] = useState('history');\r\n\r\n const sections = React.useMemo(() => {\r\n const { historyPaths, sharePaths, favoritePaths, itemInfo } = props;\r\n const dupePaths = itemInfo.dupe\r\n ? itemInfo.dupe.paths.map((path) => getParentPath(path))\r\n : [];\r\n\r\n return getDownloadSections({\r\n historyPaths,\r\n sharePaths,\r\n favoritePaths,\r\n dupePaths,\r\n });\r\n }, []);\r\n\r\n const activeSection = sections.find((s) => s.key === activeSectionKey);\r\n if (!activeSection) {\r\n return null;\r\n }\r\n\r\n const menuItems = sections.map((s) =>\r\n getMenuItem(s, activeSectionKey, setActiveSectionKey, t),\r\n );\r\n\r\n const Component = usingMobileLayout() ? MobileDownloadLayout : NormalDownloadLayout;\r\n return (\r\n <Component\r\n key={activeSection.key} // Ensure that section-specific data is refetched\r\n menuItems={menuItems}\r\n title={activeSection.name}\r\n handleBrowse={props.handleBrowse}\r\n t={t}\r\n >\r\n <activeSection.component t={t} downloadHandler={props.downloadHandler} />\r\n </Component>\r\n );\r\n};\r\n\r\nconst DownloadLayoutDecorated = DataProviderDecorator<\r\n DownloadLayoutProps,\r\n DownloadLayoutDataProps\r\n>(DownloadLayout, {\r\n urls: {\r\n sharePaths: ShareConstants.GROUPED_ROOTS_GET_URL,\r\n favoritePaths: FavoriteDirectoryConstants.GROUPED_DIRECTORIES_URL,\r\n },\r\n});\r\n\r\nexport { DownloadLayoutDecorated as DownloadLayout };\r\n","import * as React from 'react';\r\n\r\nimport PathList from './PathList';\r\nimport AccordionTargets from './AccordionTargets';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { PathDownloadHandler } from '../../types';\r\n\r\nexport interface DownloadSectionChildProps {\r\n t: UI.TranslateF;\r\n downloadHandler: PathDownloadHandler;\r\n}\r\n\r\nexport interface DownloadSection {\r\n name: string;\r\n key: string;\r\n list?: string[] | API.GroupedPath[];\r\n component: React.ComponentType<DownloadSectionChildProps>;\r\n}\r\n\r\ninterface PathInfo {\r\n sharePaths: API.GroupedPath[];\r\n favoritePaths: API.GroupedPath[];\r\n historyPaths: string[];\r\n dupePaths: string[];\r\n}\r\n\r\nexport const getDownloadSections = (pathInfo: PathInfo) => {\r\n const { sharePaths, favoritePaths, historyPaths, dupePaths } = pathInfo;\r\n\r\n const sections: DownloadSection[] = [\r\n {\r\n name: 'Previous',\r\n key: 'history',\r\n list: historyPaths,\r\n component: ({ downloadHandler, t }) => (\r\n <PathList paths={historyPaths} downloadHandler={downloadHandler} t={t} />\r\n ),\r\n },\r\n {\r\n name: 'Shared',\r\n key: 'shared',\r\n list: sharePaths,\r\n component: ({ downloadHandler, t }) => (\r\n <AccordionTargets\r\n groupedPaths={sharePaths}\r\n downloadHandler={downloadHandler}\r\n t={t}\r\n />\r\n ),\r\n },\r\n {\r\n name: 'Favorites',\r\n key: 'favorites',\r\n list: favoritePaths,\r\n component: ({ downloadHandler, t }) => (\r\n <AccordionTargets\r\n groupedPaths={favoritePaths}\r\n downloadHandler={downloadHandler}\r\n t={t}\r\n />\r\n ),\r\n },\r\n {\r\n name: 'Dupes',\r\n key: 'dupes',\r\n list: dupePaths,\r\n component: ({ downloadHandler, t }) => (\r\n <PathList paths={dupePaths} downloadHandler={downloadHandler} t={t} />\r\n ),\r\n },\r\n ];\r\n\r\n return sections;\r\n};\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\nimport { Route, Routes, useNavigate } from 'react-router';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport {\r\n default as HistoryConstants,\r\n HistoryStringEnum,\r\n} from '@/constants/HistoryConstants';\r\nimport FilesystemConstants from '@/constants/FilesystemConstants';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport NotificationActions from '@/actions/NotificationActions';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from '@/decorators/DataProviderDecorator';\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from '@/decorators/ModalRouteDecorator';\r\n\r\nimport RouteModal, { RouteModalProps } from '@/components/semantic/RouteModal';\r\nimport { FileBrowserDialog } from '@/components/filebrowser';\r\n\r\nimport { runBackgroundSocketAction } from '@/utils/ActionUtils';\r\nimport { toI18nKey, translate } from '@/utils/TranslationUtils';\r\nimport { addHistory } from '@/services/api/HistoryApi';\r\n\r\nimport { DownloadLayout } from './layout';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\nimport { PathDownloadHandler } from './types';\r\n\r\nimport './style.css';\r\nimport { useSession } from '@/context/SessionContext';\r\nimport { useSocket } from '@/context/SocketContext';\r\nimport { getFileName, getFilePath } from '@/utils/FileUtils';\r\n\r\nexport type DownloadDialogProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> = UI.ItemDownloadHandler<ItemT, Props<ItemT>>;\r\n\r\ntype DownloadDialogRouteProps = ModalRouteDecoratorChildProps;\r\n\r\ninterface DownloadDialogDataProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> extends DataProviderDecoratorChildProps {\r\n historyPaths: string[];\r\n itemInfo: ItemT;\r\n}\r\n\r\ntype Props<ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo> =\r\n DownloadDialogProps<ItemT> & DownloadDialogDataProps<ItemT> & DownloadDialogRouteProps;\r\n\r\nconst DownloadDialog: React.FC<Props> = (props) => {\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const { hasAccess } = useSession();\r\n const socket = useSocket();\r\n\r\n const {\r\n downloadHandler,\r\n itemInfo,\r\n userGetter,\r\n params,\r\n session,\r\n historyPaths,\r\n handleClose,\r\n ...other\r\n } = props;\r\n\r\n const handleDownload: PathDownloadHandler = async (targetPath, targetFilename) => {\r\n try {\r\n await downloadHandler(\r\n itemInfo,\r\n !!userGetter ? userGetter(params.downloadItemId!, props) : undefined,\r\n {\r\n target_name: !!targetFilename ? targetFilename : itemInfo.name,\r\n target_directory: targetPath,\r\n priority: API.QueuePriorityEnum.DEFAULT,\r\n },\r\n session,\r\n );\r\n } catch (e) {\r\n NotificationActions.error({\r\n title: t(toI18nKey('queueingFailed', UI.Modules.COMMON), {\r\n defaultValue: 'Failed to queue the item {{item.name}}',\r\n replace: {\r\n item: itemInfo,\r\n },\r\n }),\r\n message: e.message,\r\n });\r\n }\r\n\r\n runBackgroundSocketAction(\r\n () => addHistory(socket, HistoryStringEnum.DOWNLOAD_DIR, targetPath),\r\n t,\r\n );\r\n };\r\n\r\n const getInitialBrowsePath = () => {\r\n const path = historyPaths.length > 0 ? historyPaths[historyPaths.length - 1] : '';\r\n return itemInfo.type.id === 'directory' ? path : path + itemInfo.name;\r\n };\r\n\r\n const handleBrowse = () => {\r\n navigate(`browse`);\r\n };\r\n\r\n const commonDialogProps: RouteModalProps = {\r\n subHeader: itemInfo.name,\r\n title: translate('Download', t, UI.Modules.COMMON),\r\n icon: IconConstants.DOWNLOAD,\r\n closable: false,\r\n };\r\n\r\n const hasFileBrowserAccess = hasAccess(API.AccessEnum.FILESYSTEM_VIEW);\r\n return (\r\n <Routes>\r\n <Route\r\n path=\"browse/*\"\r\n element={\r\n <FileBrowserDialog\r\n onConfirm={async (path) => {\r\n await handleDownload(getFilePath(path), getFileName(path));\r\n }}\r\n initialPath={getInitialBrowsePath()}\r\n selectMode={\r\n itemInfo.type.id === 'directory'\r\n ? UI.FileSelectModeEnum.DIRECTORY\r\n : UI.FileSelectModeEnum.FILE\r\n }\r\n historyId={FilesystemConstants.LOCATION_DOWNLOAD}\r\n approveCaption={translate('Download', t, UI.Modules.COMMON)}\r\n modalComponent={RouteModal}\r\n {...commonDialogProps}\r\n />\r\n }\r\n />\r\n <Route\r\n index\r\n element={\r\n <RouteModal\r\n className=\"download-dialog\"\r\n fullHeight={true}\r\n {...commonDialogProps}\r\n {...other}\r\n >\r\n <DownloadLayout\r\n downloadHandler={async (targetPath, targetFilename) => {\r\n await handleDownload(targetPath, targetFilename);\r\n await handleClose();\r\n }}\r\n handleBrowse={hasFileBrowserAccess ? handleBrowse : undefined}\r\n historyPaths={historyPaths}\r\n itemInfo={itemInfo}\r\n />\r\n </RouteModal>\r\n }\r\n />\r\n </Routes>\r\n );\r\n};\r\n\r\nexport default ModalRouteDecorator<DownloadDialogProps>(\r\n DataProviderDecorator<\r\n DownloadDialogProps & DownloadDialogRouteProps,\r\n DownloadDialogDataProps\r\n >(DownloadDialog, {\r\n urls: {\r\n historyPaths: `${HistoryConstants.STRINGS_URL}/${HistoryStringEnum.DOWNLOAD_DIR}`,\r\n itemInfo: ({ params, itemDataGetter }, socket) => {\r\n return itemDataGetter(params.downloadItemId!, socket);\r\n },\r\n },\r\n }),\r\n '/download/:downloadItemId',\r\n);\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","addHistory","socket","historyId","text","post","STRINGS_URL","string","formatText","i18nKey","COMMON","Row","title","className","titleWidth","noText","style","overflow","Header","Grid","children","columns","stackable","other","MODULE_URL","GROUPED_DIRECTORIES_URL","DIRECTORIES_URL","DIRECTORIES_UPDATED","formatFreeSpace","pathInfo","t","formatSize","free_space","path","defaultValue","replace","freeSpace","PathListItem","downloadHandler","formatter","Icon","icon","IconConstants","FOLDER","LinkButton","onClick","caption","PathListWithData","DataProviderDecorator","pathInfos","map","urls","paths","FilesystemConstants","DISK_INFO_URL","props","length","Message","AccordionTargets","Component","formatParent","parent","this","DROPDOWN","name","render","groupedPaths","Accordion","appendBrowseItem","menuItems","handleBrowse","MenuItemLink","BROWSE","MobileDownloadLayout","Dropdown","selection","NormalDownloadLayout","Button","DownloadLayoutDecorated","activeSectionKey","setActiveSectionKey","useState","sections","historyPaths","sharePaths","favoritePaths","itemInfo","dupePaths","key","list","component","getDownloadSections","dupe","activeSection","find","s","section","active","getMenuItem","ShareConstants","GROUPED_ROOTS_GET_URL","FavoriteDirectoryConstants","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","ModalRouteDecorator","navigate","hasAccess","userGetter","params","session","handleClose","handleDownload","targetPath","targetFilename","downloadItemId","undefined","target_name","target_directory","priority","DEFAULT","e","NotificationActions","error","item","message","DOWNLOAD_DIR","commonDialogProps","subHeader","DOWNLOAD","closable","hasFileBrowserAccess","FILESYSTEM_VIEW","element","onConfirm","initialPath","type","getInitialBrowsePath","selectMode","DIRECTORY","FILE","LOCATION_DOWNLOAD","approveCaption","modalComponent","RouteModal","index","fullHeight","HistoryConstants","itemDataGetter"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/544.d80fd4be34c4025d53c2.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,wtBAqCtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,qPAAqP,eAAiB,CAAC,myBAAmyB,WAAa,MAE5pC,S,kDCzCO,MAAMC,EAAa,CAACC,EAAmBC,EAAmBC,IACxDF,EAAOG,KAAK,GAAG,KAAiBC,eAAeH,IAAa,CACjEI,OAAQH,G,qICWZ,MAAMI,EAAcJ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AaA,EAAa3B,OAAS,GAAK,GAC/E,MAA4B,cAArB8B,EAASsD,KAAK5I,GAAqBiC,EAAOA,EAAOqD,EAAStB,MAwB5C6E,GACbC,WACuB,cAArBxD,EAASsD,KAAK5I,GACV,KAAsB+I,UACtB,KAAsBC,KAE5B7I,UAAWkD,EAAA,EAAoB4F,kBAC/BC,gBAAgB,QAAU,WAAYpH,EAAG,KAAWpB,QACpDyI,eAAgBC,EAAA,GACZjB,OAIV,SAAC,KAAK,CACJkB,OAAK,EACLZ,SACE,SAACW,EAAA,EAAU,eACTvI,UAAU,kBACVyI,YAAY,GACRnB,EACA5G,EAAK,WAET,SAAC,EAAc,CACbe,gBAAiB,CAAO+E,EAAYC,IAAmB,QAAD,kCAC9CF,EAAeC,EAAYC,SAC3BH,GACR,GACA7C,aAAciE,EAhDL,KACnBzB,EAAS,gBA+CqDU,EACpDrC,aAAcA,EACdG,SAAUA,aAaJ,CAChBnC,KAAM,CACJgC,aAAc,GAAGoE,EAAA,GAAiBjJ,eAAe,KAAkB4H,eACnE5C,SAAU,EAAG2B,SAAQuC,kBAAkBtJ,IAC9BsJ,EAAevC,EAAOM,eAAiBrH,MAIpD,4B","sources":["webpack://airdcpp-webui/./src/components/download/style.css","webpack://airdcpp-webui/./src/services/api/HistoryApi.ts","webpack://airdcpp-webui/./src/components/semantic/Grid.tsx","webpack://airdcpp-webui/./src/constants/FavoriteDirectoryConstants.ts","webpack://airdcpp-webui/./src/components/download/layout/sections/PathListItem.tsx","webpack://airdcpp-webui/./src/components/download/layout/sections/PathList.tsx","webpack://airdcpp-webui/./src/components/download/layout/sections/AccordionTargets.tsx","webpack://airdcpp-webui/./src/components/download/layout/MobileDownloadLayout.tsx","webpack://airdcpp-webui/./src/components/download/layout/NormalDownloadLayout.tsx","webpack://airdcpp-webui/./src/components/download/layout/DownloadView.tsx","webpack://airdcpp-webui/./src/components/download/layout/sections/sections.tsx","webpack://airdcpp-webui/./src/components/download/style.css?6643","webpack://airdcpp-webui/./src/components/download/DownloadDialog.tsx"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.download-dialog .accordion.download-targets {\r\n overflow-y: auto;\r\n}\r\n\r\n.download-dialog .main-content,\r\n.download-dialog .mobile.layout {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.download-dialog .main-content .list {\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n}\r\n\r\n.download-dialog .content > div,\r\n.download-dialog .ui.grid .column,\r\n.download-dialog .main-content {\r\n height: 100%;\r\n}\r\n\r\n.download-dialog .download-handler {\r\n display: flex;\r\n align-items: baseline;\r\n}\r\n\r\n.download-dialog .disk-info {\r\n color: black;\r\n font-size: 90%;\r\n font-style: italic;\r\n}\r\n\r\n.download-dialog .normal.layout .four.wide.column {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: space-between;\r\n}\r\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/download/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,gBAAgB;AAClB;;AAEA;;EAEE,aAAa;EACb,sBAAsB;AACxB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;AACpB;;AAEA;;;EAGE,YAAY;AACd;;AAEA;EACE,aAAa;EACb,qBAAqB;AACvB;;AAEA;EACE,YAAY;EACZ,cAAc;EACd,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,8BAA8B;AAChC\",\"sourcesContent\":[\".download-dialog .accordion.download-targets {\\r\\n overflow-y: auto;\\r\\n}\\r\\n\\r\\n.download-dialog .main-content,\\r\\n.download-dialog .mobile.layout {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n}\\r\\n\\r\\n.download-dialog .main-content .list {\\r\\n overflow-y: auto;\\r\\n overflow-x: hidden;\\r\\n}\\r\\n\\r\\n.download-dialog .content > div,\\r\\n.download-dialog .ui.grid .column,\\r\\n.download-dialog .main-content {\\r\\n height: 100%;\\r\\n}\\r\\n\\r\\n.download-dialog .download-handler {\\r\\n display: flex;\\r\\n align-items: baseline;\\r\\n}\\r\\n\\r\\n.download-dialog .disk-info {\\r\\n color: black;\\r\\n font-size: 90%;\\r\\n font-style: italic;\\r\\n}\\r\\n\\r\\n.download-dialog .normal.layout .four.wide.column {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n justify-content: space-between;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { APISocket } from '@/services/SocketService';\r\nimport HistoryConstants from '@/constants/HistoryConstants';\r\n\r\nexport const addHistory = (socket: APISocket, historyId: string, text: string) => {\r\n return socket.post(`${HistoryConstants.STRINGS_URL}/${historyId}`, {\r\n string: text,\r\n });\r\n};\r\n","import * as React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nimport { Trans } from 'react-i18next';\r\nimport { toI18nKey } from '@/utils/TranslationUtils';\r\n\r\nimport * as UI from '@/types/ui';\r\n\r\nexport interface RowProps {\r\n title: React.ReactNode;\r\n text?: React.ReactNode;\r\n titleWidth?: string;\r\n className?: string;\r\n noText?: boolean;\r\n}\r\n\r\nconst formatText = (text: React.ReactNode) => {\r\n if (!!text) {\r\n return text;\r\n }\r\n\r\n return <Trans i18nKey={toI18nKey('na', UI.Modules.COMMON)}>N/A</Trans>;\r\n};\r\n\r\nexport const Row: React.FC<RowProps> = ({\r\n title,\r\n text,\r\n className,\r\n titleWidth = 'four',\r\n noText,\r\n}) => (\r\n <div className={classNames('ui row', className)}>\r\n <div className={classNames(noText ? 'sixteen' : titleWidth, 'wide column title')}>\r\n <div className=\"ui tiny header\" style={{ overflow: 'hidden' }}>\r\n {title}\r\n </div>\r\n </div>\r\n {!noText && <div className=\"column value\">{formatText(text)}</div>}\r\n </div>\r\n);\r\n\r\nexport interface HeaderProps {\r\n title: React.ReactNode;\r\n}\r\n\r\nexport const Header: React.FC<HeaderProps> = ({ title }) => (\r\n <div className=\"ui row\">\r\n <div className=\"sixteen wide column\">\r\n <div className=\"ui blue section header\">{title}</div>\r\n </div>\r\n </div>\r\n);\r\n\r\nexport interface GridProps extends React.HTMLAttributes<HTMLDivElement> {\r\n columns?: string;\r\n stackable?: boolean;\r\n}\r\n\r\nexport const Grid: React.FC<GridProps> = ({\r\n className,\r\n children,\r\n columns,\r\n stackable,\r\n ...other\r\n}) => (\r\n <div\r\n className={classNames(\r\n 'ui grid',\r\n //`${columns} column`,\r\n { [`${columns} column`]: !!columns },\r\n { stackable: stackable },\r\n className,\r\n )}\r\n {...other}\r\n >\r\n {children}\r\n </div>\r\n);\r\n","const MODULE_URL = 'favorite_directories';\r\nexport default {\r\n MODULE_URL: MODULE_URL,\r\n\r\n GROUPED_DIRECTORIES_URL: MODULE_URL + '/grouped_paths',\r\n DIRECTORIES_URL: MODULE_URL,\r\n\r\n DIRECTORIES_UPDATED: 'favorite_directories_updated',\r\n};\r\n","import * as React from 'react';\r\n\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport Icon from '@/components/semantic/Icon';\r\n\r\nimport { toI18nKey } from '@/utils/TranslationUtils';\r\nimport { Formatter, useFormatter } from '@/context/FormatterContext';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\nimport { PathDownloadHandler } from '../../types';\r\nimport LinkButton from '@/components/semantic/LinkButton';\r\n\r\ninterface PathItemProps {\r\n pathInfo: API.DiskSpaceInfo;\r\n downloadHandler: PathDownloadHandler;\r\n t: UI.TranslateF;\r\n}\r\n\r\nconst formatFreeSpace = (\r\n pathInfo: API.DiskSpaceInfo,\r\n t: UI.TranslateF,\r\n { formatSize }: Formatter,\r\n) => {\r\n if (pathInfo.free_space <= 0) {\r\n return pathInfo.path;\r\n }\r\n\r\n return ` (${t(toI18nKey('spaceFree', UI.Modules.COMMON), {\r\n defaultValue: '{{freeSpace}} free',\r\n replace: {\r\n freeSpace: formatSize(pathInfo.free_space),\r\n },\r\n })})`;\r\n};\r\n\r\nexport const PathListItem: React.FC<PathItemProps> = ({\r\n pathInfo,\r\n downloadHandler,\r\n t,\r\n}) => {\r\n const formatter = useFormatter();\r\n return (\r\n <div className=\"item\">\r\n <Icon icon={IconConstants.FOLDER} />\r\n <div className=\"content\">\r\n <LinkButton\r\n onClick={() => downloadHandler(pathInfo.path)}\r\n caption={\r\n <>\r\n {pathInfo.path}\r\n <span className=\"disk-info\">{formatFreeSpace(pathInfo, t, formatter)}</span>\r\n </>\r\n }\r\n />\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import FilesystemConstants from '@/constants/FilesystemConstants';\r\n\r\nimport DataProviderDecorator from '@/decorators/DataProviderDecorator';\r\n\r\nimport Message from '@/components/semantic/Message';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { PathDownloadHandler } from '../../types';\r\nimport { PathListItem } from './PathListItem';\r\n\r\ninterface PathListProps {\r\n // Function handling the path selection\r\n downloadHandler: PathDownloadHandler;\r\n\r\n // Array of paths to list\r\n paths: string[];\r\n t: UI.TranslateF;\r\n}\r\n\r\ninterface PathListDataProps {\r\n pathInfos: API.DiskSpaceInfo[];\r\n}\r\n\r\nconst PathListWithData = DataProviderDecorator<PathListProps, PathListDataProps>(\r\n function PathList({ downloadHandler, pathInfos, t }) {\r\n return (\r\n <div className=\"ui relaxed list\">\r\n {pathInfos.map((pathInfo) => (\r\n <PathListItem\r\n key={pathInfo.path}\r\n pathInfo={pathInfo}\r\n downloadHandler={downloadHandler}\r\n t={t}\r\n />\r\n ))}\r\n </div>\r\n );\r\n },\r\n {\r\n urls: {\r\n pathInfos: ({ paths }, socket) =>\r\n socket.post(FilesystemConstants.DISK_INFO_URL, { paths }),\r\n },\r\n },\r\n);\r\n\r\nconst PathList: React.FC<PathListProps> = (props) => {\r\n if (props.paths.length === 0) {\r\n return (\r\n <Message title={translate('No paths to display', props.t, UI.Modules.COMMON)} />\r\n );\r\n }\r\n\r\n return <PathListWithData {...props} />;\r\n};\r\n\r\nexport default PathList;\r\n","import React, { Component } from 'react';\r\n\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport Accordion from '@/components/semantic/Accordion';\r\nimport Icon from '@/components/semantic/Icon';\r\nimport Message from '@/components/semantic/Message';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\nimport { PathDownloadHandler } from '../../types';\r\n\r\nimport PathList from './PathList';\r\n\r\ninterface AccordionTargetsProps {\r\n // Grouped paths to list\r\n groupedPaths: API.GroupedPath[];\r\n\r\n // Function handling the path selection. Receives the selected path as argument.\r\n downloadHandler: PathDownloadHandler;\r\n\r\n t: UI.TranslateF;\r\n}\r\n\r\nclass AccordionTargets extends Component<AccordionTargetsProps> {\r\n formatParent = (parent: API.GroupedPath) => {\r\n const { downloadHandler, t } = this.props;\r\n return (\r\n <React.Fragment key={parent.name}>\r\n <div className=\"title\">\r\n <Icon icon={IconConstants.DROPDOWN} />\r\n {parent.name}\r\n </div>\r\n\r\n <div className=\"content\">\r\n <PathList paths={parent.paths} downloadHandler={downloadHandler} t={t} />\r\n </div>\r\n </React.Fragment>\r\n );\r\n };\r\n\r\n render() {\r\n const { groupedPaths, t } = this.props;\r\n if (groupedPaths.length === 0) {\r\n return <Message title={translate('No paths to display', t, UI.Modules.COMMON)} />;\r\n }\r\n\r\n return (\r\n <Accordion className=\"styled download-targets\">\r\n {groupedPaths.map(this.formatParent)}\r\n </Accordion>\r\n );\r\n }\r\n}\r\n\r\nexport default AccordionTargets;\r\n","import * as React from 'react';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport Dropdown from '@/components/semantic/Dropdown';\r\nimport MenuItemLink from '@/components/semantic/MenuItemLink';\r\n\r\nimport * as UI from '@/types/ui';\r\n\r\nimport Icon from '@/components/semantic/Icon';\r\nimport { BrowseHandler, DownloadLayoutProps } from '../types';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nconst appendBrowseItem = (\r\n menuItems: React.ReactNode[],\r\n handleBrowse: BrowseHandler,\r\n t: UI.TranslateF,\r\n) => {\r\n if (!handleBrowse) {\r\n return menuItems;\r\n }\r\n\r\n return [\r\n ...menuItems,\r\n <MenuItemLink key=\"browse\" onClick={handleBrowse}>\r\n {translate('Browse', t, UI.Modules.COMMON)}\r\n <Icon icon={IconConstants.BROWSE} />\r\n </MenuItemLink>,\r\n ];\r\n};\r\n\r\nexport const MobileDownloadLayout: React.FC<DownloadLayoutProps> = ({\r\n menuItems,\r\n title,\r\n handleBrowse,\r\n t,\r\n children,\r\n}) => (\r\n <div className=\"mobile layout\">\r\n <Dropdown selection={true} caption={title}>\r\n {appendBrowseItem(menuItems, handleBrowse, t)}\r\n </Dropdown>\r\n <div className=\"ui segment main-content\">{children}</div>\r\n </div>\r\n);\r\n","import * as React from 'react';\r\n\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport { translate } from '@/utils/TranslationUtils';\r\n\r\nimport Button from '@/components/semantic/Button';\r\nimport { Grid } from '@/components/semantic/Grid';\r\n\r\nimport * as UI from '@/types/ui';\r\nimport { DownloadLayoutProps } from '../types';\r\n\r\nexport const NormalDownloadLayout: React.FC<DownloadLayoutProps> = ({\r\n menuItems,\r\n title,\r\n handleBrowse,\r\n t,\r\n children,\r\n}) => (\r\n <Grid className=\"normal layout\">\r\n <div className=\"four wide column\">\r\n <div className=\"ui vertical fluid tabular menu\">{menuItems}</div>\r\n {!!handleBrowse && (\r\n <Button\r\n className=\"fluid basic\"\r\n caption={translate('Browse', t, UI.Modules.COMMON)}\r\n onClick={handleBrowse}\r\n icon={IconConstants.BROWSE}\r\n />\r\n )}\r\n </div>\r\n <div className=\"twelve wide stretched column\">\r\n <div className=\"ui segment main-content\">{children}</div>\r\n </div>\r\n </Grid>\r\n);\r\n","import { useState } from 'react';\r\nimport * as React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport { getParentPath } from '@/utils/FileUtils';\r\nimport { usingMobileLayout } from '@/utils/BrowserUtils';\r\nimport { toI18nKey } from '@/utils/TranslationUtils';\r\n\r\nimport ShareConstants from '@/constants/ShareConstants';\r\nimport FavoriteDirectoryConstants from '@/constants/FavoriteDirectoryConstants';\r\n\r\nimport MenuItemLink from '@/components/semantic/MenuItemLink';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { getDownloadSections, DownloadSection } from './sections';\r\nimport { BrowseHandler, PathDownloadHandler } from '../types';\r\n\r\nimport { MobileDownloadLayout } from './MobileDownloadLayout';\r\nimport { NormalDownloadLayout } from './NormalDownloadLayout';\r\nimport DataProviderDecorator from '@/decorators/DataProviderDecorator';\r\n\r\nexport interface DownloadLayoutDataProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> {\r\n sharePaths: API.GroupedPath[];\r\n favoritePaths: API.GroupedPath[];\r\n}\r\n\r\nexport interface DownloadLayoutProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> {\r\n downloadHandler: PathDownloadHandler;\r\n handleBrowse: BrowseHandler;\r\n\r\n historyPaths: string[];\r\n itemInfo: ItemT;\r\n}\r\n\r\nconst getMenuItem = (\r\n section: DownloadSection,\r\n activeSection: string,\r\n onClick: (key: string) => void,\r\n t: UI.TranslateF,\r\n) => (\r\n <MenuItemLink\r\n key={section.key}\r\n onClick={() => onClick(section.key)}\r\n active={activeSection === section.key}\r\n >\r\n <>\r\n {t(toI18nKey(section.key, UI.Modules.COMMON), section.name)}\r\n {!!section.list && <div className=\"ui small label\">{section.list.length}</div>}\r\n </>\r\n </MenuItemLink>\r\n);\r\n\r\ntype Props<ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo> =\r\n DownloadLayoutProps<ItemT> & DownloadLayoutDataProps<ItemT>;\r\n\r\nconst DownloadLayout: React.FC<Props> = (props) => {\r\n const { t } = useTranslation();\r\n const [activeSectionKey, setActiveSectionKey] = useState('history');\r\n\r\n const sections = React.useMemo(() => {\r\n const { historyPaths, sharePaths, favoritePaths, itemInfo } = props;\r\n const dupePaths = itemInfo.dupe\r\n ? itemInfo.dupe.paths.map((path) => getParentPath(path))\r\n : [];\r\n\r\n return getDownloadSections({\r\n historyPaths,\r\n sharePaths,\r\n favoritePaths,\r\n dupePaths,\r\n });\r\n }, []);\r\n\r\n const activeSection = sections.find((s) => s.key === activeSectionKey);\r\n if (!activeSection) {\r\n return null;\r\n }\r\n\r\n const menuItems = sections.map((s) =>\r\n getMenuItem(s, activeSectionKey, setActiveSectionKey, t),\r\n );\r\n\r\n const Component = usingMobileLayout() ? MobileDownloadLayout : NormalDownloadLayout;\r\n return (\r\n <Component\r\n key={activeSection.key} // Ensure that section-specific data is refetched\r\n menuItems={menuItems}\r\n title={activeSection.name}\r\n handleBrowse={props.handleBrowse}\r\n t={t}\r\n >\r\n <activeSection.component t={t} downloadHandler={props.downloadHandler} />\r\n </Component>\r\n );\r\n};\r\n\r\nconst DownloadLayoutDecorated = DataProviderDecorator<\r\n DownloadLayoutProps,\r\n DownloadLayoutDataProps\r\n>(DownloadLayout, {\r\n urls: {\r\n sharePaths: ShareConstants.GROUPED_ROOTS_GET_URL,\r\n favoritePaths: FavoriteDirectoryConstants.GROUPED_DIRECTORIES_URL,\r\n },\r\n});\r\n\r\nexport { DownloadLayoutDecorated as DownloadLayout };\r\n","import * as React from 'react';\r\n\r\nimport PathList from './PathList';\r\nimport AccordionTargets from './AccordionTargets';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { PathDownloadHandler } from '../../types';\r\n\r\nexport interface DownloadSectionChildProps {\r\n t: UI.TranslateF;\r\n downloadHandler: PathDownloadHandler;\r\n}\r\n\r\nexport interface DownloadSection {\r\n name: string;\r\n key: string;\r\n list?: string[] | API.GroupedPath[];\r\n component: React.ComponentType<DownloadSectionChildProps>;\r\n}\r\n\r\ninterface PathInfo {\r\n sharePaths: API.GroupedPath[];\r\n favoritePaths: API.GroupedPath[];\r\n historyPaths: string[];\r\n dupePaths: string[];\r\n}\r\n\r\nexport const getDownloadSections = (pathInfo: PathInfo) => {\r\n const { sharePaths, favoritePaths, historyPaths, dupePaths } = pathInfo;\r\n\r\n const sections: DownloadSection[] = [\r\n {\r\n name: 'Previous',\r\n key: 'history',\r\n list: historyPaths,\r\n component: ({ downloadHandler, t }) => (\r\n <PathList paths={historyPaths} downloadHandler={downloadHandler} t={t} />\r\n ),\r\n },\r\n {\r\n name: 'Shared',\r\n key: 'shared',\r\n list: sharePaths,\r\n component: ({ downloadHandler, t }) => (\r\n <AccordionTargets\r\n groupedPaths={sharePaths}\r\n downloadHandler={downloadHandler}\r\n t={t}\r\n />\r\n ),\r\n },\r\n {\r\n name: 'Favorites',\r\n key: 'favorites',\r\n list: favoritePaths,\r\n component: ({ downloadHandler, t }) => (\r\n <AccordionTargets\r\n groupedPaths={favoritePaths}\r\n downloadHandler={downloadHandler}\r\n t={t}\r\n />\r\n ),\r\n },\r\n {\r\n name: 'Dupes',\r\n key: 'dupes',\r\n list: dupePaths,\r\n component: ({ downloadHandler, t }) => (\r\n <PathList paths={dupePaths} downloadHandler={downloadHandler} t={t} />\r\n ),\r\n },\r\n ];\r\n\r\n return sections;\r\n};\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\nimport { Route, Routes, useNavigate } from 'react-router';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport {\r\n default as HistoryConstants,\r\n HistoryStringEnum,\r\n} from '@/constants/HistoryConstants';\r\nimport FilesystemConstants from '@/constants/FilesystemConstants';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport NotificationActions from '@/actions/NotificationActions';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from '@/decorators/DataProviderDecorator';\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from '@/decorators/ModalRouteDecorator';\r\n\r\nimport RouteModal, { RouteModalProps } from '@/components/semantic/RouteModal';\r\nimport { FileBrowserDialog } from '@/components/filebrowser';\r\n\r\nimport { runBackgroundSocketAction } from '@/utils/ActionUtils';\r\nimport { toI18nKey, translate } from '@/utils/TranslationUtils';\r\nimport { addHistory } from '@/services/api/HistoryApi';\r\n\r\nimport { DownloadLayout } from './layout';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\nimport { PathDownloadHandler } from './types';\r\n\r\nimport './style.css';\r\nimport { useSession } from '@/context/SessionContext';\r\nimport { useSocket } from '@/context/SocketContext';\r\nimport { getFileName, getFilePath } from '@/utils/FileUtils';\r\n\r\nexport type DownloadDialogProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> = UI.ItemDownloadHandler<ItemT, Props<ItemT>>;\r\n\r\ntype DownloadDialogRouteProps = ModalRouteDecoratorChildProps;\r\n\r\ninterface DownloadDialogDataProps<\r\n ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo,\r\n> extends DataProviderDecoratorChildProps {\r\n historyPaths: string[];\r\n itemInfo: ItemT;\r\n}\r\n\r\ntype Props<ItemT extends UI.DownloadableItemInfo = UI.DownloadableItemInfo> =\r\n DownloadDialogProps<ItemT> & DownloadDialogDataProps<ItemT> & DownloadDialogRouteProps;\r\n\r\nconst DownloadDialog: React.FC<Props> = (props) => {\r\n const { t } = useTranslation();\r\n const navigate = useNavigate();\r\n const { hasAccess } = useSession();\r\n const socket = useSocket();\r\n\r\n const {\r\n downloadHandler,\r\n itemInfo,\r\n userGetter,\r\n params,\r\n session,\r\n historyPaths,\r\n handleClose,\r\n ...other\r\n } = props;\r\n\r\n const handleDownload: PathDownloadHandler = async (targetPath, targetFilename) => {\r\n try {\r\n await downloadHandler(\r\n itemInfo,\r\n !!userGetter ? userGetter(params.downloadItemId!, props) : undefined,\r\n {\r\n target_name: !!targetFilename ? targetFilename : itemInfo.name,\r\n target_directory: targetPath,\r\n priority: API.QueuePriorityEnum.DEFAULT,\r\n },\r\n session,\r\n );\r\n } catch (e) {\r\n NotificationActions.error({\r\n title: t(toI18nKey('queueingFailed', UI.Modules.COMMON), {\r\n defaultValue: 'Failed to queue the item {{item.name}}',\r\n replace: {\r\n item: itemInfo,\r\n },\r\n }),\r\n message: e.message,\r\n });\r\n }\r\n\r\n runBackgroundSocketAction(\r\n () => addHistory(socket, HistoryStringEnum.DOWNLOAD_DIR, targetPath),\r\n t,\r\n );\r\n };\r\n\r\n const getInitialBrowsePath = () => {\r\n const path = historyPaths.length > 0 ? historyPaths[historyPaths.length - 1] : '';\r\n return itemInfo.type.id === 'directory' ? path : path + itemInfo.name;\r\n };\r\n\r\n const handleBrowse = () => {\r\n navigate(`browse`);\r\n };\r\n\r\n const commonDialogProps: RouteModalProps = {\r\n subHeader: itemInfo.name,\r\n title: translate('Download', t, UI.Modules.COMMON),\r\n icon: IconConstants.DOWNLOAD,\r\n closable: false,\r\n };\r\n\r\n const hasFileBrowserAccess = hasAccess(API.AccessEnum.FILESYSTEM_VIEW);\r\n return (\r\n <Routes>\r\n <Route\r\n path=\"browse/*\"\r\n element={\r\n <FileBrowserDialog\r\n onConfirm={async (path) => {\r\n await handleDownload(getFilePath(path), getFileName(path));\r\n }}\r\n initialPath={getInitialBrowsePath()}\r\n selectMode={\r\n itemInfo.type.id === 'directory'\r\n ? UI.FileSelectModeEnum.DIRECTORY\r\n : UI.FileSelectModeEnum.FILE\r\n }\r\n historyId={FilesystemConstants.LOCATION_DOWNLOAD}\r\n approveCaption={translate('Download', t, UI.Modules.COMMON)}\r\n modalComponent={RouteModal}\r\n {...commonDialogProps}\r\n />\r\n }\r\n />\r\n <Route\r\n index\r\n element={\r\n <RouteModal\r\n className=\"download-dialog\"\r\n fullHeight={true}\r\n {...commonDialogProps}\r\n {...other}\r\n >\r\n <DownloadLayout\r\n downloadHandler={async (targetPath, targetFilename) => {\r\n await handleDownload(targetPath, targetFilename);\r\n await handleClose();\r\n }}\r\n handleBrowse={hasFileBrowserAccess ? handleBrowse : undefined}\r\n historyPaths={historyPaths}\r\n itemInfo={itemInfo}\r\n />\r\n </RouteModal>\r\n }\r\n />\r\n </Routes>\r\n );\r\n};\r\n\r\nexport default ModalRouteDecorator<DownloadDialogProps>(\r\n DataProviderDecorator<\r\n DownloadDialogProps & DownloadDialogRouteProps,\r\n DownloadDialogDataProps\r\n >(DownloadDialog, {\r\n urls: {\r\n historyPaths: `${HistoryConstants.STRINGS_URL}/${HistoryStringEnum.DOWNLOAD_DIR}`,\r\n itemInfo: ({ params, itemDataGetter }, socket) => {\r\n return itemDataGetter(params.downloadItemId!, socket);\r\n },\r\n },\r\n }),\r\n '/download/:downloadItemId',\r\n);\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","addHistory","socket","historyId","text","post","STRINGS_URL","string","formatText","i18nKey","COMMON","Row","title","className","titleWidth","noText","style","overflow","Header","Grid","children","columns","stackable","other","MODULE_URL","GROUPED_DIRECTORIES_URL","DIRECTORIES_URL","DIRECTORIES_UPDATED","formatFreeSpace","pathInfo","t","formatSize","free_space","path","defaultValue","replace","freeSpace","PathListItem","downloadHandler","formatter","Icon","icon","IconConstants","FOLDER","LinkButton","onClick","caption","PathListWithData","DataProviderDecorator","pathInfos","map","urls","paths","FilesystemConstants","DISK_INFO_URL","props","length","Message","AccordionTargets","Component","formatParent","parent","this","DROPDOWN","name","render","groupedPaths","Accordion","appendBrowseItem","menuItems","handleBrowse","MenuItemLink","BROWSE","MobileDownloadLayout","Dropdown","selection","NormalDownloadLayout","Button","DownloadLayoutDecorated","activeSectionKey","setActiveSectionKey","useState","sections","historyPaths","sharePaths","favoritePaths","itemInfo","dupePaths","key","list","component","getDownloadSections","dupe","activeSection","find","s","section","active","getMenuItem","ShareConstants","GROUPED_ROOTS_GET_URL","FavoriteDirectoryConstants","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","ModalRouteDecorator","navigate","hasAccess","userGetter","params","session","handleClose","handleDownload","targetPath","targetFilename","downloadItemId","undefined","target_name","target_directory","priority","DEFAULT","e","NotificationActions","error","item","message","DOWNLOAD_DIR","commonDialogProps","subHeader","DOWNLOAD","closable","hasFileBrowserAccess","FILESYSTEM_VIEW","element","onConfirm","initialPath","type","getInitialBrowsePath","selectMode","DIRECTORY","FILE","LOCATION_DOWNLOAD","approveCaption","modalComponent","RouteModal","index","fullHeight","HistoryConstants","itemDataGetter"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[580],{19430:(e,t,n)=>{n.d(t,{T:()=>o,v:()=>a});var r=n(86818);const a=(e,{formatSize:t})=>{let n=e.str;return e.id!==r.A.HIDDEN_PROFILE_ID&&(n+=` (${t(e.size)})`),n},o=(e,t)=>({id:e.id,name:a(e,t)})},23896:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(71354),a=n.n(r),o=n(76314),i=n.n(o)()(a());i.push([e.id,".virtual-table .cell-wrapper.connected,\n.virtual-table .cell-wrapper.connected span,\n.virtual-table .cell-wrapper.connected strong {\n color: green;\n}\n\n.virtual-table .cell-wrapper.connecting,\n.virtual-table .cell-wrapper.connecting span,\n.virtual-table .cell-wrapper.connecting strong {\n color: orange;\n}\n\n.virtual-table .cell-wrapper.disconnected,\n.virtual-table .cell-wrapper.disconnected span,\n.virtual-table .cell-wrapper.disconnected strong {\n color: dimslategray;\n}\n","",{version:3,sources:["webpack://./src/routes/FavoriteHubs/style.css"],names:[],mappings:"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB",sourcesContent:[".virtual-table .cell-wrapper.connected,\r\n.virtual-table .cell-wrapper.connected span,\r\n.virtual-table .cell-wrapper.connected strong {\r\n color: green;\r\n}\r\n\r\n.virtual-table .cell-wrapper.connecting,\r\n.virtual-table .cell-wrapper.connecting span,\r\n.virtual-table .cell-wrapper.connecting strong {\r\n color: orange;\r\n}\r\n\r\n.virtual-table .cell-wrapper.disconnected,\r\n.virtual-table .cell-wrapper.disconnected span,\r\n.virtual-table .cell-wrapper.disconnected strong {\r\n color: dimslategray;\r\n}\r\n"],sourceRoot:""}]);const s=i},54248:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ie});var r=n(74848),a=n(96540),o=n(22005),i=n.n(o);const s="favorite_hubs",c=s,l=s;var d=n(52267);const p=i().createStore({_viewName:"favorite_hub_view",_apiUrl:c,mixins:[(0,d.A)("name")]});var u=n(99671),v=n(65385),m=n(86818),h=n(71299),A=n(4425),E=n(6061),_=n(94413),y=n(47456),O=n(86038);const f=({locals:e})=>{const t=(0,a.useRef)(null);return(0,a.useEffect)(()=>{t.current&&("boolean"==typeof e.value?t.current.indeterminate=!1:t.current.indeterminate=!0)},[e.value]),(0,r.jsx)("input",Object.assign({ref:t,type:"checkbox"},e.attrs,{onChange:t=>{!1===e.value?e.onChange(null):e.onChange(t.target.checked)}}))},I={renderCheckbox:e=>(0,r.jsx)(f,{locals:e})},w=E.Ay.form.Form.templates.checkbox.clone(I);var b=n(19430),D=n(74416);const g=[{id:O.uu.DISABLED,name:"Disabled"},{id:O.uu.ACTIVE_MODE,name:"Active mode"},{id:O.uu.PASSIVE_MODE,name:"Passive mode"}],T=[{key:"generic",title:"Hub properties",type:O.OP.STRUCT,definitions:[{key:"name",title:"Name",type:O.OP.STRING},{key:"hub_url",title:"Hub URL",type:O.OP.STRING},{key:"hub_description",title:"Hub description",type:O.OP.STRING,optional:!0},{key:"share_profile",title:"Share profile",type:O.OP.NUMBER,help:"Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)",optional:!0},{key:"auto_connect",title:"Auto connect",type:O.OP.BOOLEAN}]},{key:"user",title:"User setting overrides",type:O.OP.STRUCT,definitions:[{key:"nick",title:"Nick",type:O.OP.STRING,optional:!0},{key:"user_description",title:"User description",type:O.OP.STRING,optional:!0}]},{key:"connectivityV4",title:"Connectivity setting overrides (IPv4)",type:O.OP.STRUCT,definitions:[{key:"connection_mode_v4",title:"Connectivity mode",type:O.OP.NUMBER,optional:!0,options:g},{key:"connection_ip_v4",title:"IP address",type:O.OP.STRING,optional:!0}]},{key:"connectivityV6",title:"Connectivity setting overrides (IPv6)",type:O.OP.STRUCT,definitions:[{key:"connection_mode_v6",title:"Connectivity mode",type:O.OP.NUMBER,optional:!0,options:g},{key:"connection_ip_v6",title:"IP address",type:O.OP.STRING,optional:!0}]},{key:"misc",title:"Miscellaneous overrides",type:O.OP.STRUCT,definitions:[{key:"use_main_chat_notify",title:"Use chat notification",type:O.OP.BOOLEAN,optional:!0},{key:"show_joins",title:"Show joins/parts",type:O.OP.BOOLEAN,optional:!0},{key:"away_message",title:"Away message",type:O.OP.TEXT,optional:!0}]}],R=e=>!!e&&(e.startsWith("adc://")||e.startsWith("adcs://")),S=(e,t,n)=>e.filter(e=>R(t)||e.id===m.A.HIDDEN_PROFILE_ID).map(e=>(0,b.T)(e,n)).map(y.UM),C=(0,v.A)((0,h.A)(({hubEntry:e,favT:t,profiles:n,socket:o})=>{const i=(0,D.k)(),s=(0,a.useMemo)(()=>(e=>{if(e)return{generic:e,user:e,connectivityV4:e,connectivityV6:e,misc:e}})(e),[]),c=(0,a.useMemo)(()=>(0,y.Nn)(T,t),[]),d=(0,a.useMemo)(()=>({value:"null",text:t.translate("Global default")}),[]),p=!e,v=(0,a.useRef)(null),{translate:h}=t,O=h(p?"Add favorite hub":"Edit favorite hub");return(0,r.jsx)(u.A,{className:"fav-hub",title:O,onApprove:()=>v.current.save(),closable:!1,icon:A.A.FAVORITE,children:(0,r.jsx)(_.A,{ref:v,onFieldChanged:(e,t,n)=>e.includes("hub_url")&&!R(t.generic.hub_url)&&t.share_profile!==m.A.HIDDEN_PROFILE_ID?Promise.resolve({share_profile:null}):null,onFieldSetting:(e,t,r)=>{if("share_profile"===e){const e=r.generic?r.generic.hub_url:void 0;Object.assign(t,{nullOption:d,factory:E.Ay.form.Select,options:S(n,e,i),transformer:y.xs})}else"connection_mode_v4"===e||"connection_mode_v6"===e?Object.assign(t,{nullOption:d,transformer:y.xs}):"use_main_chat_notify"!==e&&"show_joins"!==e||Object.assign(t,{template:w,transformer:{format:e=>void 0===e?null:e,parse:e=>e}})},onSave:t=>{const n=(r=t,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r.generic),r.user),r.connectivityV4),r.connectivityV6),r.misc));var r;return p?o.post(l,n):o.patch(`${l}/${e.id}`,n)},fieldDefinitions:c,sourceValue:s})})},!0,{urls:{hubEntry:({params:e},t)=>e.entryId?t.get(`${l}/${e.entryId}`):Promise.resolve(void 0)}}),"entries/:entryId?");var N=n(22373),P=n(68465),U=n(44247),k=n(46942),V=n.n(k),j=n(83994),x=n(85788),F=n(44657),L=n(4245),B=n(48249),H=n(32389);const G=e=>{switch(e.id){case O.uv.CONNECTING:return"yellow remove";case O.uv.CONNECTED:return"grey remove";case O.uv.DISCONNECTED:return"green video play"}return""},M=({width:e,cellData:t,rowDataGetter:n})=>{const a=(0,x.Zp)(),o=(0,L.CU)(),i=(0,B.F)(),{t:s}=(0,H.Bd)(),c=()=>{const e={hubUrl:n().hub_url};F.$.createSession(e,{navigate:a,store:o,socket:i,t:s})},l=()=>{F.$.removeSession({id:t.current_hub_id})};return(0,r.jsxs)("div",{className:"connect-state",children:[(0,r.jsx)(j.A,{icon:V()("icon large link",G(t)),onClick:(()=>{switch(t.id){case O.uv.CONNECTING:case O.uv.CONNECTED:return l;case O.uv.DISCONNECTED:default:return c}})()}),e>120&&t.str]})};var K=n(71352),$=n(85072),W=n.n($),z=n(97825),Y=n.n(z),J=n(77659),X=n.n(J),Z=n(55056),q=n.n(Z),Q=n(10540),ee=n.n(Q),te=n(41113),ne=n.n(te),re=n(23896),ae={};ae.styleTagTransform=ne(),ae.setAttributes=q(),ae.insert=X().bind(null,"head"),ae.domAPI=Y(),ae.insertStyleElement=ee(),W()(re.A,ae),re.A&&re.A.locals&&re.A.locals;var oe=n(67749),ie=n(42695),se=n(32811),ce=n(36076),le=n(39115);const de={create:{id:"create",displayName:"Add new",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.CREATE,handler:({navigate:e})=>{e("/favorite-hubs/entries")}}},pe={edit:{id:"edit",displayName:"Edit",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.EDIT,handler:({itemData:e,navigate:t})=>{t(`/favorite-hubs/entries/${e.id}`)}},remove:{id:"remove",displayName:"Remove",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the favorite hub {{item.name}}?",approveCaption:"Remove favorite hub",rejectCaption:"Don't remove"},handler:({itemData:e,socket:t})=>t.delete(l+"/"+e.id)}},ue={moduleId:oe.KV.FAVORITE_HUBS},ve={moduleData:ue,actions:pe},me={moduleData:ue,actions:de},he=(e,t,n)=>e.patch(l+"/"+t.id,{password:n}),Ae=({itemData:e,socket:t},n)=>he(t,e,n),Ee=({itemData:e})=>e.has_password,_e={create:{id:"create",displayName:"Set password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.LOCK,filter:e=>!Ee(e),input:{content:"Set password for the hub {{item.name}}",approveCaption:"Set password",inputProps:{placeholder:"Enter password",type:"password"}},handler:Ae},change:{id:"change",displayName:"Change password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.EDIT,filter:Ee,input:{content:"Enter new password for the hub {{item.name}}",approveCaption:"Update password",inputProps:{placeholder:"Enter password",type:"password"}},handler:Ae},remove:{id:"remove",displayName:"Remove password",access:O.US.FAVORITE_HUBS_EDIT,icon:A.A.REMOVE,filter:Ee,confirmation:{content:"Are you sure that you want to reset the password of the hub {{item.name}}?",approveCaption:"Remove password",rejectCaption:"Don't remove"},handler:({itemData:e,socket:t})=>he(t,e,null)}},ye={moduleData:{moduleId:oe.KV.FAVORITE_HUBS,subId:"password"},actions:_e};var Oe=n(28286);const fe=({cellData:e,rowDataGetter:t,t:n})=>(0,r.jsx)(K.yj,{caption:e?(0,r.jsx)("strong",{children:(0,ie.Tl)("Set",n,oe.KV.FAVORITE_HUBS)}):(0,ie.Tl)("Not set",n,oe.KV.FAVORITE_HUBS),actions:ye,itemData:t}),Ie=()=>{const{t:e}=(0,H.Bd)(),t=(0,ie.lw)(e,oe.KV.FAVORITE_HUBS),{hasAccess:n}=(0,Oe.w)(),{translate:a}=t,o=n(O.US.HUBS_EDIT);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(N.A,{rowClassNameGetter:e=>{switch(e.connect_state.id){case O.uv.CONNECTING:return"connecting";case O.uv.CONNECTED:return"connected";case O.uv.DISCONNECTED:return"disconnected"}return""},footerData:(0,r.jsx)(K.Wy,{className:"top left pointing",caption:a("Actions..."),actions:me,header:a("Favorite hub actions"),triggerIcon:"chevron up",button:!0,remoteMenuId:"favorite_hubs",direction:"upward"}),store:p,moduleId:oe.KV.FAVORITE_HUBS,children:[(0,r.jsx)(P.VP,{name:"State",width:45,columnKey:"connect_state",cell:o?(0,r.jsx)(M,{}):void 0,flexGrow:3}),(0,r.jsx)(P.VP,{name:"Name",width:150,columnKey:"name",flexGrow:6,cell:(0,r.jsx)(U.K,{actions:ve,remoteMenuId:le.Ay.FAVORITE_HUB})}),(0,r.jsx)(P.VP,{name:"Address",width:270,columnKey:"hub_url",flexGrow:3,hideWidth:700}),(0,r.jsx)(P.VP,{name:"Auto connect",width:65,columnKey:"auto_connect",cell:o?(0,r.jsx)(U.AJ,{onChange:(t,n)=>(0,ce.bd)(()=>{return e=n,r={auto_connect:t},se.A.patch(l+"/"+e.id,r);var e,r},e),type:"toggle"}):void 0}),(0,r.jsx)(P.VP,{name:"Share profile",width:100,columnKey:"share_profile",flexGrow:1}),(0,r.jsx)(P.VP,{name:"Nick",width:100,columnKey:"nick",flexGrow:1}),(0,r.jsx)(P.VP,{name:"Password",width:100,columnKey:"has_password",cell:(0,r.jsx)(fe,{})})]}),(0,r.jsx)(C,{favT:t})]})}},71299:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(2543),a=n(86818),o=n(56484);const i=function(e,t,n){return(0,o.A)(e,(0,r.merge)(n,{urls:{profiles:a.A.PROFILES_URL},dataConverters:{profiles:(e,{t:n})=>e.filter(e=>t||e.id!==a.A.HIDDEN_PROFILE_ID)},onSocketConnected:(e,{refetchData:t})=>{e(a.A.MODULE_URL,a.A.PROFILE_ADDED,()=>t()),e(a.A.MODULE_URL,a.A.PROFILE_UPDATED,()=>t()),e(a.A.MODULE_URL,a.A.PROFILE_REMOVED,()=>t())}}))}},86818:(e,t,n)=>{n.d(t,{A:()=>a});const r="share_profiles",a={MODULE_URL:r,PROFILES_URL:r,PROFILE_ADDED:"share_profile_added",PROFILE_UPDATED:"share_profile_updated",PROFILE_REMOVED:"share_profile_removed",HIDDEN_PROFILE_ID:1}}}]);
|
|
2
|
-
//# sourceMappingURL=favorite-hubs.
|
|
2
|
+
//# sourceMappingURL=favorite-hubs.b435e52e7a89e94f29d3.chunk.js.map
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js/favorite-hubs.b27996a4b16db08060e3.chunk.js","mappings":"sJAMO,MAAMA,EAA4B,CACvCC,GACEC,iBAEF,IAAIC,EAAMF,EAAQE,IAKlB,OAJIF,EAAQG,KAAO,IAAsBC,oBACvCF,GAAO,KAAKD,EAAWD,EAAQK,UAG1BH,GAGII,EAAqB,CAACN,EAA2BO,KACrD,CACLJ,GAAIH,EAAQG,GACZK,KAAMT,EAA0BC,EAASO,I,sEClBzCE,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOR,GAAI,+eAiBtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,yEAAyE,eAAiB,CAAC,khBAAkhB,WAAa,MAE/tB,S,+FCxBA,MAAMS,EAAa,gBAEnB,EACcA,EADd,EAEYA,E,eCCZ,QAAe,gBAAmB,CAChCC,UAAW,oBACXC,QAASC,EACTC,OAAQ,EAAC,EAAAC,EAAA,GAAe,W,qGCG1B,MAAMC,EAA8D,EAAGC,aACrE,MAAMC,GAAW,IAAAC,QAAyB,MAc1C,OAZA,IAAAC,WAAU,KACHF,EAASG,UAIc,kBAAjBJ,EAAOK,MAChBJ,EAASG,QAAQE,eAAgB,EAEjCL,EAASG,QAAQE,eAAgB,IAElC,CAACN,EAAOK,SAGT,gCACEE,IAAKN,EACLO,KAAK,YACDR,EAAOS,MAAK,CAChBC,SAAWC,KAEY,IAAjBX,EAAOK,MACTL,EAAOU,SAAS,MAEhBV,EAAOU,SAASC,EAAIC,OAAOC,cAa/BC,EAA+C,CACnDC,eAAef,IACN,SAACD,EAAqB,CAACC,OAAQA,KAI7BgB,EAA6B,KAAMC,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AAkBmK,KACtC,SACL,KACEe,OC9DNlD,ED8DwBmC,EC7DxB3D,ED6DiC,CACzB2E,aAAcnL,GC5DfoL,GAAA,EAAc/F,MAAMtG,EAAgC,IAAMiJ,EAAI7J,GAAIqI,GAJ1C,IAC/BwB,EACAxB,GDgEIF,GA4DqD3G,KAAK,gBAChD6E,KAGR,SAAC,KAAM,CAAChG,KAAK,gBAAgByH,MAAO,IAAK2E,UAAU,gBAAgBE,SAAU,KAC7E,SAAC,KAAM,CAACtM,KAAK,OAAOyH,MAAO,IAAK2E,UAAU,OAAOE,SAAU,KAC3D,SAAC,KAAM,CACLtM,KAAK,WACLyH,MAAO,IACP2E,UAAU,eACVC,MAAM,SAACjB,GAAY,UAGvB,SAAC,EAAiB,CAACtH,KAAMA,O,uEE5H/B,MA8CA,EA9C8B,SAC5B+I,EACAC,EACAC,GAaA,OAAO,OACLF,GACA,IAAAG,OAAMD,EAA+B,CACnC/F,KAAM,CACJ3D,SAAU,IAAsB4J,cAElCC,eAAgB,CACd7J,SAfyC,CAAC2E,GAA4BF,OACzDE,EAAKzE,OACnBC,GAAMsJ,GAActJ,EAAE7D,KAAO,IAAsBC,oBAepDuN,kBAAmB,CAACC,GAAqBC,kBACvCD,EACE,IAAsBhN,WACtB,IAAsBkN,cACtB,IAAMD,KAERD,EACE,IAAsBhN,WACtB,IAAsBmN,gBACtB,IAAMF,KAERD,EACE,IAAsBhN,WACtB,IAAsBoN,gBACtB,IAAMH,QAKhB,C,mCChEA,MAAMjN,EAAa,iBACnB,GACEA,WAAYA,EACZ6M,aAAc7M,EAEdkN,cAAe,sBACfC,gBAAiB,wBACjBC,gBAAiB,wBAEjB5N,kBAAmB,E","sources":["webpack://airdcpp-webui/./src/utils/ShareProfileUtils.ts","webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css","webpack://airdcpp-webui/./src/constants/FavoriteHubConstants.ts","webpack://airdcpp-webui/./src/stores/views/FavoriteHubStore.js","webpack://airdcpp-webui/./src/components/form/fields/IndeterminateCheckboxField.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubDialog.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/ConnectStateCell.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css?f7f3","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubActions.ts","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubPasswordActions.ts","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubs.tsx","webpack://airdcpp-webui/./src/services/api/FavoriteHubApi.ts","webpack://airdcpp-webui/./src/decorators/ShareProfileDecorator.tsx","webpack://airdcpp-webui/./src/constants/ShareProfileConstants.ts"],"sourcesContent":["import ShareProfileConstants from '@/constants/ShareProfileConstants';\r\n\r\nimport { Formatter } from '@/context/FormatterContext';\r\n\r\nimport * as API from '@/types/api';\r\n\r\nexport const formatProfileNameWithSize = (\r\n profile: API.ShareProfile,\r\n { formatSize }: Formatter,\r\n) => {\r\n let str = profile.str;\r\n if (profile.id !== ShareProfileConstants.HIDDEN_PROFILE_ID) {\r\n str += ` (${formatSize(profile.size)})`;\r\n }\r\n\r\n return str;\r\n};\r\n\r\nexport const profileToEnumValue = (profile: API.ShareProfile, formatter: Formatter) => {\r\n return {\r\n id: profile.id,\r\n name: formatProfileNameWithSize(profile, formatter),\r\n };\r\n};\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.virtual-table .cell-wrapper.connected,\r\n.virtual-table .cell-wrapper.connected span,\r\n.virtual-table .cell-wrapper.connected strong {\r\n color: green;\r\n}\r\n\r\n.virtual-table .cell-wrapper.connecting,\r\n.virtual-table .cell-wrapper.connecting span,\r\n.virtual-table .cell-wrapper.connecting strong {\r\n color: orange;\r\n}\r\n\r\n.virtual-table .cell-wrapper.disconnected,\r\n.virtual-table .cell-wrapper.disconnected span,\r\n.virtual-table .cell-wrapper.disconnected strong {\r\n color: dimslategray;\r\n}\r\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/FavoriteHubs/style.css\"],\"names\":[],\"mappings\":\"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB\",\"sourcesContent\":[\".virtual-table .cell-wrapper.connected,\\r\\n.virtual-table .cell-wrapper.connected span,\\r\\n.virtual-table .cell-wrapper.connected strong {\\r\\n color: green;\\r\\n}\\r\\n\\r\\n.virtual-table .cell-wrapper.connecting,\\r\\n.virtual-table .cell-wrapper.connecting span,\\r\\n.virtual-table .cell-wrapper.connecting strong {\\r\\n color: orange;\\r\\n}\\r\\n\\r\\n.virtual-table .cell-wrapper.disconnected,\\r\\n.virtual-table .cell-wrapper.disconnected span,\\r\\n.virtual-table .cell-wrapper.disconnected strong {\\r\\n color: dimslategray;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","const MODULE_URL = 'favorite_hubs';\r\n\r\nexport default {\r\n MODULE_URL: MODULE_URL,\r\n HUBS_URL: MODULE_URL,\r\n};\r\n","import Reflux from 'reflux';\r\n\r\nimport FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\nimport ViewStoreMixin from '@/mixins/ViewStoreMixin';\r\n\r\nexport default Reflux.createStore({\r\n _viewName: 'favorite_hub_view',\r\n _apiUrl: FavoriteHubConstants.MODULE_URL,\r\n mixins: [ViewStoreMixin('name')],\r\n});\r\n","import { useEffect, useRef } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport * as UI from '@/types/ui';\r\n\r\nimport tcomb from '@/utils/tcomb-form';\r\n\r\ninterface IndeterminateCheckboxProps {\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>;\r\n}\r\n\r\nconst IndeterminateCheckbox: React.FC<IndeterminateCheckboxProps> = ({ locals }) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (!inputRef.current) {\r\n return;\r\n }\r\n\r\n if (typeof locals.value === 'boolean') {\r\n inputRef.current.indeterminate = false;\r\n } else {\r\n inputRef.current.indeterminate = true;\r\n }\r\n }, [locals.value]);\r\n\r\n return (\r\n <input\r\n ref={inputRef}\r\n type=\"checkbox\"\r\n {...locals.attrs}\r\n onChange={(evt) => {\r\n // Toggle between true/false/indeterminate\r\n if (locals.value === false) {\r\n locals.onChange(null);\r\n } else {\r\n locals.onChange(evt.target.checked);\r\n }\r\n }}\r\n />\r\n );\r\n};\r\n\r\ntype TCombTemplate = {\r\n renderCheckbox: (\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>,\r\n ) => React.ReactNode;\r\n};\r\n\r\nconst IndeterminateCheckboxTemplate: TCombTemplate = {\r\n renderCheckbox(locals) {\r\n return <IndeterminateCheckbox locals={locals} />;\r\n },\r\n};\r\n\r\nexport const IndeterminateCheckboxField = tcomb.form.Form.templates.checkbox.clone(\r\n IndeterminateCheckboxTemplate,\r\n);\r\n","import { useMemo, useRef } from 'react';\r\nimport RouteModal from '@/components/semantic/RouteModal';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from '@/decorators/ModalRouteDecorator';\r\n\r\nimport ShareProfileConstants from '@/constants/ShareProfileConstants';\r\nimport FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\n\r\nimport ShareProfileDecorator, {\r\n ShareProfileDecoratorChildProps,\r\n} from '@/decorators/ShareProfileDecorator';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport t from '@/utils/tcomb-form';\r\n\r\nimport Form, {\r\n FormFieldChangeHandler,\r\n FormFieldSettingHandler,\r\n FormSaveHandler,\r\n} from '@/components/form/Form';\r\nimport { normalizeEnumValue, intTransformer, translateForm } from '@/utils/FormUtils';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { FavoriteHubEntry } from '@/types/api';\r\nimport { IndeterminateCheckboxField } from '@/components/form/fields/IndeterminateCheckboxField';\r\nimport { profileToEnumValue } from '@/utils/ShareProfileUtils';\r\nimport { Formatter, useFormatter } from '@/context/FormatterContext';\r\n\r\nconst ConnectivityModeOptions: API.SettingEnumOption[] = [\r\n {\r\n id: API.ConnectivityModeEnum.DISABLED,\r\n name: 'Disabled',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.ACTIVE_MODE,\r\n name: 'Active mode',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.PASSIVE_MODE,\r\n name: 'Passive mode',\r\n },\r\n];\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'generic',\r\n title: 'Hub properties',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'name',\r\n title: 'Name',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_url',\r\n title: 'Hub URL',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_description',\r\n title: 'Hub description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'share_profile',\r\n title: 'Share profile',\r\n type: API.SettingTypeEnum.NUMBER,\r\n // eslint-disable-next-line max-len\r\n help: 'Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)',\r\n optional: true,\r\n },\r\n {\r\n key: 'auto_connect',\r\n title: 'Auto connect',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'user',\r\n title: 'User setting overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'nick',\r\n title: 'Nick',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'user_description',\r\n title: 'User description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV4',\r\n title: 'Connectivity setting overrides (IPv4)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v4',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v4',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV6',\r\n title: 'Connectivity setting overrides (IPv6)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v6',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v6',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'misc',\r\n title: 'Miscellaneous overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'use_main_chat_notify',\r\n title: 'Use chat notification',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'show_joins',\r\n title: 'Show joins/parts',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'away_message',\r\n title: 'Away message',\r\n type: API.SettingTypeEnum.TEXT,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n];\r\n\r\ninterface Entry extends UI.FormValueMap {\r\n generic: Pick<\r\n FavoriteHubEntry,\r\n 'name' | 'hub_url' | 'hub_description' | 'auto_connect' | 'share_profile'\r\n >;\r\n user: Pick<FavoriteHubEntry, 'nick' | 'user_description'>;\r\n connectivityV4: Pick<FavoriteHubEntry, 'connection_mode_v4' | 'connection_ip_v4'>;\r\n connectivityV6: Pick<FavoriteHubEntry, 'connection_mode_v6' | 'connection_ip_v6'>;\r\n misc: Pick<FavoriteHubEntry, 'use_main_chat_notify' | 'show_joins' | 'away_message'>;\r\n}\r\n\r\nconst toFormEntry = (entry?: API.FavoriteHubEntry): Entry | undefined => {\r\n if (!entry) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n generic: entry,\r\n user: entry,\r\n connectivityV4: entry,\r\n connectivityV6: entry,\r\n misc: entry,\r\n };\r\n};\r\n\r\nconst toFavoriteHub = (\r\n entry: RecursivePartial<Entry>,\r\n): RecursivePartial<API.FavoriteHubEntry> => {\r\n return {\r\n ...entry.generic,\r\n ...entry.user,\r\n ...entry.connectivityV4,\r\n ...entry.connectivityV6,\r\n ...entry.misc,\r\n };\r\n};\r\n\r\nconst isAdcHub = (hubUrl?: string) =>\r\n !!hubUrl && (hubUrl.startsWith('adc://') || hubUrl.startsWith('adcs://'));\r\n\r\n// Get selection values for the profiles field\r\nconst getFieldProfiles = (\r\n profiles: API.ShareProfile[],\r\n url: string | undefined,\r\n formatter: Formatter,\r\n): UI.FormOption[] => {\r\n return profiles\r\n .filter((p) => isAdcHub(url) || p.id === ShareProfileConstants.HIDDEN_PROFILE_ID)\r\n .map((p) => profileToEnumValue(p, formatter))\r\n .map(normalizeEnumValue);\r\n};\r\n\r\ninterface FavoriteHubDialogProps {\r\n favT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps {\r\n hubEntry?: API.FavoriteHubEntry;\r\n}\r\n\r\ntype Props = FavoriteHubDialogProps &\r\n DataProps &\r\n ShareProfileDecoratorChildProps &\r\n ModalRouteDecoratorChildProps;\r\n\r\nconst FavoriteHubDialog: React.FC<Props> = ({ hubEntry, favT, profiles, socket }) => {\r\n const formatter = useFormatter();\r\n\r\n const formValue = useMemo<Entry | undefined>(() => toFormEntry(hubEntry), []);\r\n const formDefinitions = useMemo<UI.FormFieldDefinition[]>(\r\n () => translateForm(Fields, favT),\r\n [],\r\n );\r\n const nullOption = useMemo<UI.FormOption<string>>(\r\n () => ({\r\n value: 'null',\r\n text: favT.translate('Global default'),\r\n }),\r\n [],\r\n );\r\n\r\n const isNew = !hubEntry;\r\n\r\n const formRef = useRef<Form<Entry>>(null);\r\n\r\n const onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n if (id.includes('hub_url')) {\r\n if (\r\n !isAdcHub(value.generic!.hub_url) &&\r\n value.share_profile !== ShareProfileConstants.HIDDEN_PROFILE_ID\r\n ) {\r\n // Reset share profile\r\n return Promise.resolve({\r\n share_profile: null,\r\n });\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const handleSave = () => {\r\n return formRef.current!.save();\r\n };\r\n\r\n const onSave: FormSaveHandler<Entry> = (changedFields) => {\r\n const updatedEntryFields = toFavoriteHub(changedFields);\r\n if (isNew) {\r\n return socket.post(FavoriteHubConstants.HUBS_URL, updatedEntryFields);\r\n }\r\n\r\n return socket.patch(\r\n `${FavoriteHubConstants.HUBS_URL}/${hubEntry.id}`,\r\n updatedEntryFields,\r\n );\r\n };\r\n\r\n const onFieldSetting: FormFieldSettingHandler<Entry> = (\r\n id,\r\n fieldOptions,\r\n formValue,\r\n ) => {\r\n if (id === 'share_profile') {\r\n const hubUrl = formValue.generic ? formValue.generic.hub_url : undefined;\r\n\r\n // Since the options are added dynamically based on the URL protocol, they must be\r\n // normalized to use the tcomb format\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n factory: t.form.Select,\r\n options: getFieldProfiles(profiles, hubUrl, formatter),\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'connection_mode_v4' || id === 'connection_mode_v6') {\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'use_main_chat_notify' || id === 'show_joins') {\r\n Object.assign(fieldOptions, {\r\n template: IndeterminateCheckboxField,\r\n transformer: {\r\n format: (value: boolean | null) => (value === undefined ? null : value),\r\n parse: (value: boolean | null) => value,\r\n },\r\n });\r\n }\r\n };\r\n\r\n const { translate } = favT;\r\n const title = translate(isNew ? 'Add favorite hub' : 'Edit favorite hub');\r\n return (\r\n <RouteModal\r\n className=\"fav-hub\"\r\n title={title}\r\n onApprove={handleSave}\r\n closable={false}\r\n icon={IconConstants.FAVORITE}\r\n >\r\n <Form<Entry>\r\n ref={formRef}\r\n onFieldChanged={onFieldChanged}\r\n onFieldSetting={onFieldSetting}\r\n onSave={onSave}\r\n fieldDefinitions={formDefinitions}\r\n sourceValue={formValue}\r\n />\r\n </RouteModal>\r\n );\r\n};\r\n\r\nexport default ModalRouteDecorator<FavoriteHubDialogProps>(\r\n ShareProfileDecorator(FavoriteHubDialog, true, {\r\n urls: {\r\n hubEntry: ({ params }, socket) => {\r\n if (!params.entryId) {\r\n return Promise.resolve(undefined);\r\n }\r\n\r\n return socket.get(`${FavoriteHubConstants.HUBS_URL}/${params.entryId}`);\r\n },\r\n },\r\n }),\r\n 'entries/:entryId?',\r\n);\r\n","import classNames from 'classnames';\r\n\r\nimport Icon from '@/components/semantic/Icon';\r\nimport { RowWrapperCellChildProps } from '@/components/table/RowWrapperCell';\r\n\r\nimport * as API from '@/types/api';\r\n\r\nimport { useNavigate } from 'react-router';\r\nimport { HubAPIActions } from '@/actions/store/HubActions';\r\nimport { useAppStore } from '@/context/StoreContext';\r\nimport { useSocket } from '@/context/SocketContext';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport type ConnectStateCellProps = RowWrapperCellChildProps<\r\n API.FavoriteHubConnectState,\r\n API.FavoriteHubEntry\r\n>;\r\n\r\nconst getIcon = (state: API.FavoriteHubConnectState) => {\r\n switch (state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'yellow remove';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'grey remove';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'green video play';\r\n default:\r\n }\r\n\r\n return '';\r\n};\r\n\r\nconst ConnectStateCell: React.FC<ConnectStateCellProps> = ({\r\n width,\r\n cellData,\r\n rowDataGetter,\r\n}) => {\r\n const navigate = useNavigate();\r\n const store = useAppStore();\r\n const socket = useSocket();\r\n const { t } = useTranslation();\r\n\r\n const handleCreateSession = () => {\r\n const data = {\r\n hubUrl: rowDataGetter!().hub_url,\r\n };\r\n\r\n HubAPIActions.createSession(data, {\r\n navigate,\r\n store,\r\n socket,\r\n t,\r\n });\r\n };\r\n\r\n const handleRemoveSession = () => {\r\n HubAPIActions.removeSession({ id: cellData!.current_hub_id });\r\n };\r\n\r\n const getClickAction = () => {\r\n switch (cellData!.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return handleRemoveSession;\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n default:\r\n return handleCreateSession;\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"connect-state\">\r\n <Icon\r\n icon={classNames('icon large link', getIcon(cellData!))}\r\n onClick={getClickAction()}\r\n />\r\n {width! > 120 && cellData!.str}\r\n </div>\r\n );\r\n};\r\n\r\nexport default ConnectStateCell;\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nconst handleCreate: UI.ActionHandler<undefined> = ({ navigate }) => {\r\n navigate('/favorite-hubs/entries');\r\n};\r\n\r\nconst handleEdit: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n navigate,\r\n}) => {\r\n navigate(`/favorite-hubs/entries/${hub.id}`);\r\n};\r\n\r\nconst handleRemove: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return socket.delete(FavoriteHubConstants.HUBS_URL + '/' + hub.id);\r\n};\r\n\r\nexport const FavoriteHubCreateAction = {\r\n id: 'create',\r\n displayName: 'Add new',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleCreate,\r\n};\r\n\r\nexport const FavoriteHubEditAction = {\r\n id: 'edit',\r\n displayName: 'Edit',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n handler: handleEdit,\r\n};\r\n\r\nexport const FavoriteHubRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the favorite hub {{item.name}}?',\r\n approveCaption: 'Remove favorite hub',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst FavoriteHubCreateActions: UI.ActionListType<undefined> = {\r\n create: FavoriteHubCreateAction,\r\n};\r\n\r\nconst FavoriteHubEditActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n edit: FavoriteHubEditAction,\r\n remove: FavoriteHubRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n};\r\n\r\nexport const FavoriteHubEditActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubEditActions,\r\n};\r\n\r\nexport const FavoriteHubActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubCreateActions,\r\n};\r\n","import FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\nimport IconConstants from '@/constants/IconConstants';\r\nimport { APISocket } from '@/services/SocketService';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nconst sendPassword = (\r\n socket: APISocket,\r\n hub: API.FavoriteHubEntry,\r\n password: string | null,\r\n) => {\r\n return socket.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, {\r\n password,\r\n });\r\n};\r\n\r\nconst handleSetPassword: UI.ActionHandler<API.FavoriteHubEntry> = (\r\n { itemData: hub, socket },\r\n password: string,\r\n) => {\r\n return sendPassword(socket, hub, password);\r\n};\r\n\r\nconst handleRemovePassword: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return sendPassword(socket, hub, null);\r\n};\r\n\r\ntype Filter = UI.ActionFilter<API.FavoriteHubEntry>;\r\nconst hasPassword: Filter = ({ itemData: data }) => data.has_password;\r\nconst noPassword: Filter = (data) => !hasPassword(data);\r\n\r\nconst FavoriteHubPasswordCreateAction = {\r\n id: 'create',\r\n displayName: 'Set password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.LOCK,\r\n filter: noPassword,\r\n input: {\r\n content: 'Set password for the hub {{item.name}}',\r\n approveCaption: 'Set password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordChangeAction = {\r\n id: 'change',\r\n displayName: 'Change password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n filter: hasPassword,\r\n input: {\r\n content: 'Enter new password for the hub {{item.name}}',\r\n approveCaption: 'Update password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n filter: hasPassword,\r\n confirmation: {\r\n content: 'Are you sure that you want to reset the password of the hub {{item.name}}?',\r\n approveCaption: 'Remove password',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemovePassword,\r\n};\r\n\r\nconst FavoriteHubPasswordActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n create: FavoriteHubPasswordCreateAction,\r\n change: FavoriteHubPasswordChangeAction,\r\n remove: FavoriteHubPasswordRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubPasswordActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n subId: 'password',\r\n};\r\n\r\nexport const FavoriteHubPasswordActionMenu = {\r\n moduleData: FavoriteHubPasswordActionModule,\r\n actions: FavoriteHubPasswordActions,\r\n};\r\n","import * as React from 'react';\r\n\r\nimport FavoriteHubStore from '@/stores/views/FavoriteHubStore';\r\nimport FavoriteHubDialog from './FavoriteHubDialog';\r\n\r\nimport VirtualTable from '@/components/table/VirtualTable';\r\nimport { Column } from 'fixed-data-table-2';\r\nimport { CheckboxCell, ActionMenuCell } from '@/components/table/Cell';\r\nimport ConnectStateCell from './ConnectStateCell';\r\n\r\nimport { ActionMenu, TableActionMenu } from '@/components/action-menu';\r\nimport { RowWrapperCellChildProps } from '@/components/table/RowWrapperCell';\r\n\r\nimport '../style.css';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { translate, getModuleT } from '@/utils/TranslationUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { updateFavoriteHub } from '@/services/api/FavoriteHubApi';\r\nimport { runBackgroundSocketAction } from '@/utils/ActionUtils';\r\nimport MenuConstants from '@/constants/MenuConstants';\r\nimport {\r\n FavoriteHubActionMenu,\r\n FavoriteHubEditActionMenu,\r\n FavoriteHubPasswordActionMenu,\r\n} from '@/actions/ui/favorite-hub';\r\nimport { useSession } from '@/context/SessionContext';\r\n\r\nconst PasswordCell: React.FC<RowWrapperCellChildProps<string, API.FavoriteHubEntry>> = ({\r\n cellData,\r\n rowDataGetter,\r\n t,\r\n}) => (\r\n <TableActionMenu\r\n caption={\r\n cellData ? (\r\n <strong>{translate('Set', t!, UI.Modules.FAVORITE_HUBS)}</strong>\r\n ) : (\r\n translate('Not set', t!, UI.Modules.FAVORITE_HUBS)\r\n )\r\n }\r\n actions={FavoriteHubPasswordActionMenu}\r\n itemData={rowDataGetter!}\r\n />\r\n);\r\n\r\nconst FavoriteHubs: React.FC = () => {\r\n const { t } = useTranslation();\r\n\r\n const rowClassNameGetter = (rowData: API.FavoriteHubEntry) => {\r\n switch (rowData.connect_state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'connecting';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'connected';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'disconnected';\r\n default:\r\n }\r\n\r\n return '';\r\n };\r\n\r\n const onChangeAutoConnect = (checked: boolean, rowData: API.FavoriteHubEntry) => {\r\n return runBackgroundSocketAction(\r\n () =>\r\n updateFavoriteHub(rowData, {\r\n auto_connect: checked,\r\n }),\r\n t,\r\n );\r\n };\r\n\r\n const favT = getModuleT(t, UI.Modules.FAVORITE_HUBS);\r\n\r\n const { hasAccess } = useSession();\r\n const { translate } = favT;\r\n const editAccess = hasAccess(API.AccessEnum.HUBS_EDIT);\r\n return (\r\n <>\r\n <VirtualTable\r\n rowClassNameGetter={rowClassNameGetter}\r\n footerData={\r\n <ActionMenu\r\n className=\"top left pointing\"\r\n caption={translate('Actions...')}\r\n actions={FavoriteHubActionMenu}\r\n header={translate('Favorite hub actions')}\r\n triggerIcon=\"chevron up\"\r\n button={true}\r\n remoteMenuId=\"favorite_hubs\"\r\n direction=\"upward\"\r\n />\r\n }\r\n store={FavoriteHubStore}\r\n moduleId={UI.Modules.FAVORITE_HUBS}\r\n >\r\n <Column\r\n name=\"State\"\r\n width={45}\r\n columnKey=\"connect_state\"\r\n cell={editAccess ? <ConnectStateCell /> : undefined}\r\n flexGrow={3}\r\n />\r\n <Column\r\n name=\"Name\"\r\n width={150}\r\n columnKey=\"name\"\r\n flexGrow={6}\r\n cell={\r\n <ActionMenuCell\r\n actions={FavoriteHubEditActionMenu}\r\n remoteMenuId={MenuConstants.FAVORITE_HUB}\r\n />\r\n }\r\n />\r\n <Column\r\n name=\"Address\"\r\n width={270}\r\n columnKey=\"hub_url\"\r\n flexGrow={3}\r\n hideWidth={700}\r\n />\r\n <Column\r\n name=\"Auto connect\"\r\n width={65}\r\n columnKey=\"auto_connect\"\r\n cell={\r\n editAccess ? (\r\n <CheckboxCell onChange={onChangeAutoConnect} type=\"toggle\" />\r\n ) : undefined\r\n }\r\n />\r\n <Column name=\"Share profile\" width={100} columnKey=\"share_profile\" flexGrow={1} />\r\n <Column name=\"Nick\" width={100} columnKey=\"nick\" flexGrow={1} />\r\n <Column\r\n name=\"Password\"\r\n width={100}\r\n columnKey=\"has_password\"\r\n cell={<PasswordCell />}\r\n />\r\n </VirtualTable>\r\n <FavoriteHubDialog favT={favT} />\r\n </>\r\n );\r\n};\r\n\r\nexport default FavoriteHubs;\r\n","import * as API from '@/types/api';\r\n\r\nimport SocketService from '@/services/SocketService';\r\nimport FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\n\r\nexport const updateFavoriteHub = (\r\n hub: API.FavoriteHubEntry,\r\n data: Partial<API.FavoriteHubEntryBase>,\r\n) => {\r\n return SocketService.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, data);\r\n};\r\n","import * as React from 'react';\r\nimport { merge } from 'lodash';\r\n\r\nimport ShareProfileConstants from '@/constants/ShareProfileConstants';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n DataProviderDecoratorSettings,\r\n DataConverter,\r\n} from '@/decorators/DataProviderDecorator';\r\n\r\nimport * as API from '@/types/api';\r\n\r\ninterface ShareProfileDecoratorDataProps {\r\n profiles: API.ShareProfile[];\r\n}\r\n\r\nexport type ShareProfileDecoratorChildProps = DataProviderDecoratorChildProps &\r\n ShareProfileDecoratorDataProps;\r\n\r\nconst ShareProfileDecorator = function <PropsT extends object>(\r\n Component: React.ComponentType<PropsT & ShareProfileDecoratorChildProps>,\r\n listHidden: boolean,\r\n dataProviderDecoratorSettings?: DataProviderDecoratorSettings<\r\n PropsT,\r\n ShareProfileDecoratorDataProps\r\n >,\r\n) {\r\n const convertProfiles: DataConverter<PropsT> = (data: API.ShareProfile[], { t }) => {\r\n const profiles = data.filter(\r\n (p) => listHidden || p.id !== ShareProfileConstants.HIDDEN_PROFILE_ID,\r\n );\r\n\r\n return profiles;\r\n };\r\n\r\n return DataProviderDecorator<PropsT, ShareProfileDecoratorDataProps>(\r\n Component,\r\n merge(dataProviderDecoratorSettings, {\r\n urls: {\r\n profiles: ShareProfileConstants.PROFILES_URL,\r\n },\r\n dataConverters: {\r\n profiles: convertProfiles,\r\n },\r\n onSocketConnected: (addSocketListener, { refetchData }) => {\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_ADDED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_UPDATED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_REMOVED,\r\n () => refetchData(),\r\n );\r\n },\r\n } as DataProviderDecoratorSettings<PropsT, ShareProfileDecoratorDataProps>),\r\n );\r\n};\r\n\r\nexport default ShareProfileDecorator;\r\n","const MODULE_URL = 'share_profiles';\r\nexport default {\r\n MODULE_URL: MODULE_URL,\r\n PROFILES_URL: MODULE_URL,\r\n\r\n PROFILE_ADDED: 'share_profile_added',\r\n PROFILE_UPDATED: 'share_profile_updated',\r\n PROFILE_REMOVED: 'share_profile_removed',\r\n\r\n HIDDEN_PROFILE_ID: 1,\r\n};\r\n"],"names":["formatProfileNameWithSize","profile","formatSize","str","id","HIDDEN_PROFILE_ID","size","profileToEnumValue","formatter","name","___CSS_LOADER_EXPORT___","push","module","MODULE_URL","_viewName","_apiUrl","FavoriteHubConstants","mixins","ViewStoreMixin","IndeterminateCheckbox","locals","inputRef","useRef","useEffect","current","value","indeterminate","ref","type","attrs","onChange","evt","target","checked","IndeterminateCheckboxTemplate","renderCheckbox","IndeterminateCheckboxField","form","Form","templates","checkbox","clone","ConnectivityModeOptions","DISABLED","ACTIVE_MODE","PASSIVE_MODE","Fields","key","title","STRUCT","definitions","STRING","optional","NUMBER","help","BOOLEAN","options","TEXT","isAdcHub","hubUrl","startsWith","getFieldProfiles","profiles","url","filter","p","ShareProfileConstants","map","ModalRouteDecorator","ShareProfileDecorator","hubEntry","favT","socket","formValue","useMemo","entry","generic","user","connectivityV4","connectivityV6","misc","toFormEntry","formDefinitions","nullOption","text","translate","isNew","formRef","RouteModal","className","onApprove","save","closable","icon","IconConstants","FAVORITE","onFieldChanged","hasChanges","includes","hub_url","share_profile","Promise","resolve","onFieldSetting","fieldOptions","undefined","Object","assign","factory","Select","transformer","template","format","parse","onSave","changedFields","updatedEntryFields","post","patch","fieldDefinitions","sourceValue","urls","params","entryId","get","getIcon","state","CONNECTING","CONNECTED","DISCONNECTED","width","cellData","rowDataGetter","navigate","store","t","handleCreateSession","data","createSession","handleRemoveSession","removeSession","current_hub_id","Icon","onClick","getClickAction","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","FavoriteHubCreateActions","create","displayName","access","FAVORITE_HUBS_EDIT","CREATE","handler","FavoriteHubEditActions","edit","EDIT","itemData","hub","remove","REMOVE","confirmation","content","approveCaption","rejectCaption","delete","FavoriteHubActionModule","moduleId","FAVORITE_HUBS","FavoriteHubEditActionMenu","moduleData","actions","FavoriteHubActionMenu","sendPassword","password","handleSetPassword","hasPassword","has_password","FavoriteHubPasswordActions","LOCK","input","inputProps","placeholder","change","FavoriteHubPasswordActionMenu","subId","PasswordCell","caption","hasAccess","editAccess","HUBS_EDIT","VirtualTable","rowClassNameGetter","rowData","connect_state","footerData","header","triggerIcon","button","remoteMenuId","direction","FavoriteHubStore","columnKey","cell","flexGrow","MenuConstants","FAVORITE_HUB","hideWidth","updateFavoriteHub","auto_connect","SocketService","Component","listHidden","dataProviderDecoratorSettings","merge","PROFILES_URL","dataConverters","onSocketConnected","addSocketListener","refetchData","PROFILE_ADDED","PROFILE_UPDATED","PROFILE_REMOVED"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/favorite-hubs.b435e52e7a89e94f29d3.chunk.js","mappings":"sJAMO,MAAMA,EAA4B,CACvCC,GACEC,iBAEF,IAAIC,EAAMF,EAAQE,IAKlB,OAJIF,EAAQG,KAAO,IAAsBC,oBACvCF,GAAO,KAAKD,EAAWD,EAAQK,UAG1BH,GAGII,EAAqB,CAACN,EAA2BO,KACrD,CACLJ,GAAIH,EAAQG,GACZK,KAAMT,EAA0BC,EAASO,I,sEClBzCE,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOR,GAAI,+eAiBtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,yEAAyE,eAAiB,CAAC,khBAAkhB,WAAa,MAE/tB,S,+FCxBA,MAAMS,EAAa,gB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J,GAActJ,EAAE7D,KAAO,IAAsBC,oBAepDuN,kBAAmB,CAACC,GAAqBC,kBACvCD,EACE,IAAsBhN,WACtB,IAAsBkN,cACtB,IAAMD,KAERD,EACE,IAAsBhN,WACtB,IAAsBmN,gBACtB,IAAMF,KAERD,EACE,IAAsBhN,WACtB,IAAsBoN,gBACtB,IAAMH,QAKhB,C,mCChEA,MAAMjN,EAAa,iBACnB,GACEA,WAAYA,EACZ6M,aAAc7M,EAEdkN,cAAe,sBACfC,gBAAiB,wBACjBC,gBAAiB,wBAEjB5N,kBAAmB,E","sources":["webpack://airdcpp-webui/./src/utils/ShareProfileUtils.ts","webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css","webpack://airdcpp-webui/./src/constants/FavoriteHubConstants.ts","webpack://airdcpp-webui/./src/stores/views/FavoriteHubStore.js","webpack://airdcpp-webui/./src/components/form/fields/IndeterminateCheckboxField.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubDialog.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/ConnectStateCell.tsx","webpack://airdcpp-webui/./src/routes/FavoriteHubs/style.css?f7f3","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubActions.ts","webpack://airdcpp-webui/./src/actions/ui/favorite-hub/FavoriteHubPasswordActions.ts","webpack://airdcpp-webui/./src/routes/FavoriteHubs/components/FavoriteHubs.tsx","webpack://airdcpp-webui/./src/services/api/FavoriteHubApi.ts","webpack://airdcpp-webui/./src/decorators/ShareProfileDecorator.tsx","webpack://airdcpp-webui/./src/constants/ShareProfileConstants.ts"],"sourcesContent":["import ShareProfileConstants from '@/constants/ShareProfileConstants';\r\n\r\nimport { Formatter } from '@/context/FormatterContext';\r\n\r\nimport * as API from '@/types/api';\r\n\r\nexport const formatProfileNameWithSize = (\r\n profile: API.ShareProfile,\r\n { formatSize }: Formatter,\r\n) => {\r\n let str = profile.str;\r\n if (profile.id !== ShareProfileConstants.HIDDEN_PROFILE_ID) {\r\n str += ` (${formatSize(profile.size)})`;\r\n }\r\n\r\n return str;\r\n};\r\n\r\nexport const profileToEnumValue = (profile: API.ShareProfile, formatter: Formatter) => {\r\n return {\r\n id: profile.id,\r\n name: formatProfileNameWithSize(profile, formatter),\r\n };\r\n};\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.virtual-table .cell-wrapper.connected,\r\n.virtual-table .cell-wrapper.connected span,\r\n.virtual-table .cell-wrapper.connected strong {\r\n color: green;\r\n}\r\n\r\n.virtual-table .cell-wrapper.connecting,\r\n.virtual-table .cell-wrapper.connecting span,\r\n.virtual-table .cell-wrapper.connecting strong {\r\n color: orange;\r\n}\r\n\r\n.virtual-table .cell-wrapper.disconnected,\r\n.virtual-table .cell-wrapper.disconnected span,\r\n.virtual-table .cell-wrapper.disconnected strong {\r\n color: dimslategray;\r\n}\r\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/FavoriteHubs/style.css\"],\"names\":[],\"mappings\":\"AAAA;;;EAGE,YAAY;AACd;;AAEA;;;EAGE,aAAa;AACf;;AAEA;;;EAGE,mBAAmB;AACrB\",\"sourcesContent\":[\".virtual-table .cell-wrapper.connected,\\r\\n.virtual-table .cell-wrapper.connected span,\\r\\n.virtual-table .cell-wrapper.connected strong {\\r\\n color: green;\\r\\n}\\r\\n\\r\\n.virtual-table .cell-wrapper.connecting,\\r\\n.virtual-table .cell-wrapper.connecting span,\\r\\n.virtual-table .cell-wrapper.connecting strong {\\r\\n color: orange;\\r\\n}\\r\\n\\r\\n.virtual-table .cell-wrapper.disconnected,\\r\\n.virtual-table .cell-wrapper.disconnected span,\\r\\n.virtual-table .cell-wrapper.disconnected strong {\\r\\n color: dimslategray;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","const MODULE_URL = 'favorite_hubs';\r\n\r\nexport default {\r\n MODULE_URL: MODULE_URL,\r\n HUBS_URL: MODULE_URL,\r\n};\r\n","import Reflux from 'reflux';\r\n\r\nimport FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\nimport ViewStoreMixin from '@/mixins/ViewStoreMixin';\r\n\r\nexport default Reflux.createStore({\r\n _viewName: 'favorite_hub_view',\r\n _apiUrl: FavoriteHubConstants.MODULE_URL,\r\n mixins: [ViewStoreMixin('name')],\r\n});\r\n","import { useEffect, useRef } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport * as UI from '@/types/ui';\r\n\r\nimport tcomb from '@/utils/tcomb-form';\r\n\r\ninterface IndeterminateCheckboxProps {\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>;\r\n}\r\n\r\nconst IndeterminateCheckbox: React.FC<IndeterminateCheckboxProps> = ({ locals }) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (!inputRef.current) {\r\n return;\r\n }\r\n\r\n if (typeof locals.value === 'boolean') {\r\n inputRef.current.indeterminate = false;\r\n } else {\r\n inputRef.current.indeterminate = true;\r\n }\r\n }, [locals.value]);\r\n\r\n return (\r\n <input\r\n ref={inputRef}\r\n type=\"checkbox\"\r\n {...locals.attrs}\r\n onChange={(evt) => {\r\n // Toggle between true/false/indeterminate\r\n if (locals.value === false) {\r\n locals.onChange(null);\r\n } else {\r\n locals.onChange(evt.target.checked);\r\n }\r\n }}\r\n />\r\n );\r\n};\r\n\r\ntype TCombTemplate = {\r\n renderCheckbox: (\r\n locals: UI.FormLocals<any, boolean | null, UI.EmptyObject>,\r\n ) => React.ReactNode;\r\n};\r\n\r\nconst IndeterminateCheckboxTemplate: TCombTemplate = {\r\n renderCheckbox(locals) {\r\n return <IndeterminateCheckbox locals={locals} />;\r\n },\r\n};\r\n\r\nexport const IndeterminateCheckboxField = tcomb.form.Form.templates.checkbox.clone(\r\n IndeterminateCheckboxTemplate,\r\n);\r\n","import { useMemo, useRef } from 'react';\r\nimport RouteModal from '@/components/semantic/RouteModal';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from '@/decorators/ModalRouteDecorator';\r\n\r\nimport ShareProfileConstants from '@/constants/ShareProfileConstants';\r\nimport FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\n\r\nimport ShareProfileDecorator, {\r\n ShareProfileDecoratorChildProps,\r\n} from '@/decorators/ShareProfileDecorator';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport t from '@/utils/tcomb-form';\r\n\r\nimport Form, {\r\n FormFieldChangeHandler,\r\n FormFieldSettingHandler,\r\n FormSaveHandler,\r\n} from '@/components/form/Form';\r\nimport { normalizeEnumValue, intTransformer, translateForm } from '@/utils/FormUtils';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { FavoriteHubEntry } from '@/types/api';\r\nimport { IndeterminateCheckboxField } from '@/components/form/fields/IndeterminateCheckboxField';\r\nimport { profileToEnumValue } from '@/utils/ShareProfileUtils';\r\nimport { Formatter, useFormatter } from '@/context/FormatterContext';\r\n\r\nconst ConnectivityModeOptions: API.SettingEnumOption[] = [\r\n {\r\n id: API.ConnectivityModeEnum.DISABLED,\r\n name: 'Disabled',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.ACTIVE_MODE,\r\n name: 'Active mode',\r\n },\r\n {\r\n id: API.ConnectivityModeEnum.PASSIVE_MODE,\r\n name: 'Passive mode',\r\n },\r\n];\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'generic',\r\n title: 'Hub properties',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'name',\r\n title: 'Name',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_url',\r\n title: 'Hub URL',\r\n type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'hub_description',\r\n title: 'Hub description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'share_profile',\r\n title: 'Share profile',\r\n type: API.SettingTypeEnum.NUMBER,\r\n // eslint-disable-next-line max-len\r\n help: 'Custom share profiles can be selected only after entering an ADC hub address (starting with adc:// or adcs://)',\r\n optional: true,\r\n },\r\n {\r\n key: 'auto_connect',\r\n title: 'Auto connect',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'user',\r\n title: 'User setting overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'nick',\r\n title: 'Nick',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'user_description',\r\n title: 'User description',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV4',\r\n title: 'Connectivity setting overrides (IPv4)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v4',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v4',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'connectivityV6',\r\n title: 'Connectivity setting overrides (IPv6)',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'connection_mode_v6',\r\n title: 'Connectivity mode',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n options: ConnectivityModeOptions,\r\n },\r\n {\r\n key: 'connection_ip_v6',\r\n title: 'IP address',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n {\r\n key: 'misc',\r\n title: 'Miscellaneous overrides',\r\n type: API.SettingTypeEnum.STRUCT,\r\n definitions: [\r\n {\r\n key: 'use_main_chat_notify',\r\n title: 'Use chat notification',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'show_joins',\r\n title: 'Show joins/parts',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n optional: true,\r\n },\r\n {\r\n key: 'away_message',\r\n title: 'Away message',\r\n type: API.SettingTypeEnum.TEXT,\r\n optional: true,\r\n },\r\n ],\r\n },\r\n];\r\n\r\ninterface Entry extends UI.FormValueMap {\r\n generic: Pick<\r\n FavoriteHubEntry,\r\n 'name' | 'hub_url' | 'hub_description' | 'auto_connect' | 'share_profile'\r\n >;\r\n user: Pick<FavoriteHubEntry, 'nick' | 'user_description'>;\r\n connectivityV4: Pick<FavoriteHubEntry, 'connection_mode_v4' | 'connection_ip_v4'>;\r\n connectivityV6: Pick<FavoriteHubEntry, 'connection_mode_v6' | 'connection_ip_v6'>;\r\n misc: Pick<FavoriteHubEntry, 'use_main_chat_notify' | 'show_joins' | 'away_message'>;\r\n}\r\n\r\nconst toFormEntry = (entry?: API.FavoriteHubEntry): Entry | undefined => {\r\n if (!entry) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n generic: entry,\r\n user: entry,\r\n connectivityV4: entry,\r\n connectivityV6: entry,\r\n misc: entry,\r\n };\r\n};\r\n\r\nconst toFavoriteHub = (\r\n entry: RecursivePartial<Entry>,\r\n): RecursivePartial<API.FavoriteHubEntry> => {\r\n return {\r\n ...entry.generic,\r\n ...entry.user,\r\n ...entry.connectivityV4,\r\n ...entry.connectivityV6,\r\n ...entry.misc,\r\n };\r\n};\r\n\r\nconst isAdcHub = (hubUrl?: string) =>\r\n !!hubUrl && (hubUrl.startsWith('adc://') || hubUrl.startsWith('adcs://'));\r\n\r\n// Get selection values for the profiles field\r\nconst getFieldProfiles = (\r\n profiles: API.ShareProfile[],\r\n url: string | undefined,\r\n formatter: Formatter,\r\n): UI.FormOption[] => {\r\n return profiles\r\n .filter((p) => isAdcHub(url) || p.id === ShareProfileConstants.HIDDEN_PROFILE_ID)\r\n .map((p) => profileToEnumValue(p, formatter))\r\n .map(normalizeEnumValue);\r\n};\r\n\r\ninterface FavoriteHubDialogProps {\r\n favT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps {\r\n hubEntry?: API.FavoriteHubEntry;\r\n}\r\n\r\ntype Props = FavoriteHubDialogProps &\r\n DataProps &\r\n ShareProfileDecoratorChildProps &\r\n ModalRouteDecoratorChildProps;\r\n\r\nconst FavoriteHubDialog: React.FC<Props> = ({ hubEntry, favT, profiles, socket }) => {\r\n const formatter = useFormatter();\r\n\r\n const formValue = useMemo<Entry | undefined>(() => toFormEntry(hubEntry), []);\r\n const formDefinitions = useMemo<UI.FormFieldDefinition[]>(\r\n () => translateForm(Fields, favT),\r\n [],\r\n );\r\n const nullOption = useMemo<UI.FormOption<string>>(\r\n () => ({\r\n value: 'null',\r\n text: favT.translate('Global default'),\r\n }),\r\n [],\r\n );\r\n\r\n const isNew = !hubEntry;\r\n\r\n const formRef = useRef<Form<Entry>>(null);\r\n\r\n const onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n if (id.includes('hub_url')) {\r\n if (\r\n !isAdcHub(value.generic!.hub_url) &&\r\n value.share_profile !== ShareProfileConstants.HIDDEN_PROFILE_ID\r\n ) {\r\n // Reset share profile\r\n return Promise.resolve({\r\n share_profile: null,\r\n });\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const handleSave = () => {\r\n return formRef.current!.save();\r\n };\r\n\r\n const onSave: FormSaveHandler<Entry> = (changedFields) => {\r\n const updatedEntryFields = toFavoriteHub(changedFields);\r\n if (isNew) {\r\n return socket.post(FavoriteHubConstants.HUBS_URL, updatedEntryFields);\r\n }\r\n\r\n return socket.patch(\r\n `${FavoriteHubConstants.HUBS_URL}/${hubEntry.id}`,\r\n updatedEntryFields,\r\n );\r\n };\r\n\r\n const onFieldSetting: FormFieldSettingHandler<Entry> = (\r\n id,\r\n fieldOptions,\r\n formValue,\r\n ) => {\r\n if (id === 'share_profile') {\r\n const hubUrl = formValue.generic ? formValue.generic.hub_url : undefined;\r\n\r\n // Since the options are added dynamically based on the URL protocol, they must be\r\n // normalized to use the tcomb format\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n factory: t.form.Select,\r\n options: getFieldProfiles(profiles, hubUrl, formatter),\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'connection_mode_v4' || id === 'connection_mode_v6') {\r\n Object.assign(fieldOptions, {\r\n nullOption,\r\n transformer: intTransformer,\r\n });\r\n } else if (id === 'use_main_chat_notify' || id === 'show_joins') {\r\n Object.assign(fieldOptions, {\r\n template: IndeterminateCheckboxField,\r\n transformer: {\r\n format: (value: boolean | null) => (value === undefined ? null : value),\r\n parse: (value: boolean | null) => value,\r\n },\r\n });\r\n }\r\n };\r\n\r\n const { translate } = favT;\r\n const title = translate(isNew ? 'Add favorite hub' : 'Edit favorite hub');\r\n return (\r\n <RouteModal\r\n className=\"fav-hub\"\r\n title={title}\r\n onApprove={handleSave}\r\n closable={false}\r\n icon={IconConstants.FAVORITE}\r\n >\r\n <Form<Entry>\r\n ref={formRef}\r\n onFieldChanged={onFieldChanged}\r\n onFieldSetting={onFieldSetting}\r\n onSave={onSave}\r\n fieldDefinitions={formDefinitions}\r\n sourceValue={formValue}\r\n />\r\n </RouteModal>\r\n );\r\n};\r\n\r\nexport default ModalRouteDecorator<FavoriteHubDialogProps>(\r\n ShareProfileDecorator(FavoriteHubDialog, true, {\r\n urls: {\r\n hubEntry: ({ params }, socket) => {\r\n if (!params.entryId) {\r\n return Promise.resolve(undefined);\r\n }\r\n\r\n return socket.get(`${FavoriteHubConstants.HUBS_URL}/${params.entryId}`);\r\n },\r\n },\r\n }),\r\n 'entries/:entryId?',\r\n);\r\n","import classNames from 'classnames';\r\n\r\nimport Icon from '@/components/semantic/Icon';\r\nimport { RowWrapperCellChildProps } from '@/components/table/RowWrapperCell';\r\n\r\nimport * as API from '@/types/api';\r\n\r\nimport { useNavigate } from 'react-router';\r\nimport { HubAPIActions } from '@/actions/store/HubActions';\r\nimport { useAppStore } from '@/context/StoreContext';\r\nimport { useSocket } from '@/context/SocketContext';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport type ConnectStateCellProps = RowWrapperCellChildProps<\r\n API.FavoriteHubConnectState,\r\n API.FavoriteHubEntry\r\n>;\r\n\r\nconst getIcon = (state: API.FavoriteHubConnectState) => {\r\n switch (state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'yellow remove';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'grey remove';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'green video play';\r\n default:\r\n }\r\n\r\n return '';\r\n};\r\n\r\nconst ConnectStateCell: React.FC<ConnectStateCellProps> = ({\r\n width,\r\n cellData,\r\n rowDataGetter,\r\n}) => {\r\n const navigate = useNavigate();\r\n const store = useAppStore();\r\n const socket = useSocket();\r\n const { t } = useTranslation();\r\n\r\n const handleCreateSession = () => {\r\n const data = {\r\n hubUrl: rowDataGetter!().hub_url,\r\n };\r\n\r\n HubAPIActions.createSession(data, {\r\n navigate,\r\n store,\r\n socket,\r\n t,\r\n });\r\n };\r\n\r\n const handleRemoveSession = () => {\r\n HubAPIActions.removeSession({ id: cellData!.current_hub_id });\r\n };\r\n\r\n const getClickAction = () => {\r\n switch (cellData!.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return handleRemoveSession;\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n default:\r\n return handleCreateSession;\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"connect-state\">\r\n <Icon\r\n icon={classNames('icon large link', getIcon(cellData!))}\r\n onClick={getClickAction()}\r\n />\r\n {width! > 120 && cellData!.str}\r\n </div>\r\n );\r\n};\r\n\r\nexport default ConnectStateCell;\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\nimport IconConstants from '@/constants/IconConstants';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nconst handleCreate: UI.ActionHandler<undefined> = ({ navigate }) => {\r\n navigate('/favorite-hubs/entries');\r\n};\r\n\r\nconst handleEdit: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n navigate,\r\n}) => {\r\n navigate(`/favorite-hubs/entries/${hub.id}`);\r\n};\r\n\r\nconst handleRemove: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return socket.delete(FavoriteHubConstants.HUBS_URL + '/' + hub.id);\r\n};\r\n\r\nexport const FavoriteHubCreateAction = {\r\n id: 'create',\r\n displayName: 'Add new',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleCreate,\r\n};\r\n\r\nexport const FavoriteHubEditAction = {\r\n id: 'edit',\r\n displayName: 'Edit',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n handler: handleEdit,\r\n};\r\n\r\nexport const FavoriteHubRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the favorite hub {{item.name}}?',\r\n approveCaption: 'Remove favorite hub',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst FavoriteHubCreateActions: UI.ActionListType<undefined> = {\r\n create: FavoriteHubCreateAction,\r\n};\r\n\r\nconst FavoriteHubEditActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n edit: FavoriteHubEditAction,\r\n remove: FavoriteHubRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n};\r\n\r\nexport const FavoriteHubEditActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubEditActions,\r\n};\r\n\r\nexport const FavoriteHubActionMenu = {\r\n moduleData: FavoriteHubActionModule,\r\n actions: FavoriteHubCreateActions,\r\n};\r\n","import FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\nimport IconConstants from '@/constants/IconConstants';\r\nimport { APISocket } from '@/services/SocketService';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nconst sendPassword = (\r\n socket: APISocket,\r\n hub: API.FavoriteHubEntry,\r\n password: string | null,\r\n) => {\r\n return socket.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, {\r\n password,\r\n });\r\n};\r\n\r\nconst handleSetPassword: UI.ActionHandler<API.FavoriteHubEntry> = (\r\n { itemData: hub, socket },\r\n password: string,\r\n) => {\r\n return sendPassword(socket, hub, password);\r\n};\r\n\r\nconst handleRemovePassword: UI.ActionHandler<API.FavoriteHubEntry> = ({\r\n itemData: hub,\r\n socket,\r\n}) => {\r\n return sendPassword(socket, hub, null);\r\n};\r\n\r\ntype Filter = UI.ActionFilter<API.FavoriteHubEntry>;\r\nconst hasPassword: Filter = ({ itemData: data }) => data.has_password;\r\nconst noPassword: Filter = (data) => !hasPassword(data);\r\n\r\nconst FavoriteHubPasswordCreateAction = {\r\n id: 'create',\r\n displayName: 'Set password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.LOCK,\r\n filter: noPassword,\r\n input: {\r\n content: 'Set password for the hub {{item.name}}',\r\n approveCaption: 'Set password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordChangeAction = {\r\n id: 'change',\r\n displayName: 'Change password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.EDIT,\r\n filter: hasPassword,\r\n input: {\r\n content: 'Enter new password for the hub {{item.name}}',\r\n approveCaption: 'Update password',\r\n inputProps: {\r\n placeholder: 'Enter password',\r\n type: 'password',\r\n },\r\n },\r\n handler: handleSetPassword,\r\n};\r\n\r\nconst FavoriteHubPasswordRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove password',\r\n access: API.AccessEnum.FAVORITE_HUBS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n filter: hasPassword,\r\n confirmation: {\r\n content: 'Are you sure that you want to reset the password of the hub {{item.name}}?',\r\n approveCaption: 'Remove password',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemovePassword,\r\n};\r\n\r\nconst FavoriteHubPasswordActions: UI.ActionListType<API.FavoriteHubEntry> = {\r\n create: FavoriteHubPasswordCreateAction,\r\n change: FavoriteHubPasswordChangeAction,\r\n remove: FavoriteHubPasswordRemoveAction,\r\n};\r\n\r\nexport const FavoriteHubPasswordActionModule = {\r\n moduleId: UI.Modules.FAVORITE_HUBS,\r\n subId: 'password',\r\n};\r\n\r\nexport const FavoriteHubPasswordActionMenu = {\r\n moduleData: FavoriteHubPasswordActionModule,\r\n actions: FavoriteHubPasswordActions,\r\n};\r\n","import * as React from 'react';\r\n\r\nimport FavoriteHubStore from '@/stores/views/FavoriteHubStore';\r\nimport FavoriteHubDialog from './FavoriteHubDialog';\r\n\r\nimport VirtualTable from '@/components/table/VirtualTable';\r\nimport { Column } from 'fixed-data-table-2';\r\nimport { CheckboxCell, ActionMenuCell } from '@/components/table/Cell';\r\nimport ConnectStateCell from './ConnectStateCell';\r\n\r\nimport { ActionMenu, TableActionMenu } from '@/components/action-menu';\r\nimport { RowWrapperCellChildProps } from '@/components/table/RowWrapperCell';\r\n\r\nimport '../style.css';\r\n\r\nimport * as API from '@/types/api';\r\nimport * as UI from '@/types/ui';\r\n\r\nimport { translate, getModuleT } from '@/utils/TranslationUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { updateFavoriteHub } from '@/services/api/FavoriteHubApi';\r\nimport { runBackgroundSocketAction } from '@/utils/ActionUtils';\r\nimport MenuConstants from '@/constants/MenuConstants';\r\nimport {\r\n FavoriteHubActionMenu,\r\n FavoriteHubEditActionMenu,\r\n FavoriteHubPasswordActionMenu,\r\n} from '@/actions/ui/favorite-hub';\r\nimport { useSession } from '@/context/SessionContext';\r\n\r\nconst PasswordCell: React.FC<RowWrapperCellChildProps<string, API.FavoriteHubEntry>> = ({\r\n cellData,\r\n rowDataGetter,\r\n t,\r\n}) => (\r\n <TableActionMenu\r\n caption={\r\n cellData ? (\r\n <strong>{translate('Set', t!, UI.Modules.FAVORITE_HUBS)}</strong>\r\n ) : (\r\n translate('Not set', t!, UI.Modules.FAVORITE_HUBS)\r\n )\r\n }\r\n actions={FavoriteHubPasswordActionMenu}\r\n itemData={rowDataGetter!}\r\n />\r\n);\r\n\r\nconst FavoriteHubs: React.FC = () => {\r\n const { t } = useTranslation();\r\n\r\n const rowClassNameGetter = (rowData: API.FavoriteHubEntry) => {\r\n switch (rowData.connect_state.id) {\r\n case API.FavoriteHubConnectStateEnum.CONNECTING:\r\n return 'connecting';\r\n case API.FavoriteHubConnectStateEnum.CONNECTED:\r\n return 'connected';\r\n case API.FavoriteHubConnectStateEnum.DISCONNECTED:\r\n return 'disconnected';\r\n default:\r\n }\r\n\r\n return '';\r\n };\r\n\r\n const onChangeAutoConnect = (checked: boolean, rowData: API.FavoriteHubEntry) => {\r\n return runBackgroundSocketAction(\r\n () =>\r\n updateFavoriteHub(rowData, {\r\n auto_connect: checked,\r\n }),\r\n t,\r\n );\r\n };\r\n\r\n const favT = getModuleT(t, UI.Modules.FAVORITE_HUBS);\r\n\r\n const { hasAccess } = useSession();\r\n const { translate } = favT;\r\n const editAccess = hasAccess(API.AccessEnum.HUBS_EDIT);\r\n return (\r\n <>\r\n <VirtualTable\r\n rowClassNameGetter={rowClassNameGetter}\r\n footerData={\r\n <ActionMenu\r\n className=\"top left pointing\"\r\n caption={translate('Actions...')}\r\n actions={FavoriteHubActionMenu}\r\n header={translate('Favorite hub actions')}\r\n triggerIcon=\"chevron up\"\r\n button={true}\r\n remoteMenuId=\"favorite_hubs\"\r\n direction=\"upward\"\r\n />\r\n }\r\n store={FavoriteHubStore}\r\n moduleId={UI.Modules.FAVORITE_HUBS}\r\n >\r\n <Column\r\n name=\"State\"\r\n width={45}\r\n columnKey=\"connect_state\"\r\n cell={editAccess ? <ConnectStateCell /> : undefined}\r\n flexGrow={3}\r\n />\r\n <Column\r\n name=\"Name\"\r\n width={150}\r\n columnKey=\"name\"\r\n flexGrow={6}\r\n cell={\r\n <ActionMenuCell\r\n actions={FavoriteHubEditActionMenu}\r\n remoteMenuId={MenuConstants.FAVORITE_HUB}\r\n />\r\n }\r\n />\r\n <Column\r\n name=\"Address\"\r\n width={270}\r\n columnKey=\"hub_url\"\r\n flexGrow={3}\r\n hideWidth={700}\r\n />\r\n <Column\r\n name=\"Auto connect\"\r\n width={65}\r\n columnKey=\"auto_connect\"\r\n cell={\r\n editAccess ? (\r\n <CheckboxCell onChange={onChangeAutoConnect} type=\"toggle\" />\r\n ) : undefined\r\n }\r\n />\r\n <Column name=\"Share profile\" width={100} columnKey=\"share_profile\" flexGrow={1} />\r\n <Column name=\"Nick\" width={100} columnKey=\"nick\" flexGrow={1} />\r\n <Column\r\n name=\"Password\"\r\n width={100}\r\n columnKey=\"has_password\"\r\n cell={<PasswordCell />}\r\n />\r\n </VirtualTable>\r\n <FavoriteHubDialog favT={favT} />\r\n </>\r\n );\r\n};\r\n\r\nexport default FavoriteHubs;\r\n","import * as API from '@/types/api';\r\n\r\nimport SocketService from '@/services/SocketService';\r\nimport FavoriteHubConstants from '@/constants/FavoriteHubConstants';\r\n\r\nexport const updateFavoriteHub = (\r\n hub: API.FavoriteHubEntry,\r\n data: Partial<API.FavoriteHubEntryBase>,\r\n) => {\r\n return SocketService.patch(FavoriteHubConstants.HUBS_URL + '/' + hub.id, data);\r\n};\r\n","import * as React from 'react';\r\nimport { merge } from 'lodash';\r\n\r\nimport ShareProfileConstants from '@/constants/ShareProfileConstants';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n DataProviderDecoratorSettings,\r\n DataConverter,\r\n} from '@/decorators/DataProviderDecorator';\r\n\r\nimport * as API from '@/types/api';\r\n\r\ninterface ShareProfileDecoratorDataProps {\r\n profiles: API.ShareProfile[];\r\n}\r\n\r\nexport type ShareProfileDecoratorChildProps = DataProviderDecoratorChildProps &\r\n ShareProfileDecoratorDataProps;\r\n\r\nconst ShareProfileDecorator = function <PropsT extends object>(\r\n Component: React.ComponentType<PropsT & ShareProfileDecoratorChildProps>,\r\n listHidden: boolean,\r\n dataProviderDecoratorSettings?: DataProviderDecoratorSettings<\r\n PropsT,\r\n ShareProfileDecoratorDataProps\r\n >,\r\n) {\r\n const convertProfiles: DataConverter<PropsT> = (data: API.ShareProfile[], { t }) => {\r\n const profiles = data.filter(\r\n (p) => listHidden || p.id !== ShareProfileConstants.HIDDEN_PROFILE_ID,\r\n );\r\n\r\n return profiles;\r\n };\r\n\r\n return DataProviderDecorator<PropsT, ShareProfileDecoratorDataProps>(\r\n Component,\r\n merge(dataProviderDecoratorSettings, {\r\n urls: {\r\n profiles: ShareProfileConstants.PROFILES_URL,\r\n },\r\n dataConverters: {\r\n profiles: convertProfiles,\r\n },\r\n onSocketConnected: (addSocketListener, { refetchData }) => {\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_ADDED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_UPDATED,\r\n () => refetchData(),\r\n );\r\n addSocketListener(\r\n ShareProfileConstants.MODULE_URL,\r\n ShareProfileConstants.PROFILE_REMOVED,\r\n () => refetchData(),\r\n );\r\n },\r\n } as DataProviderDecoratorSettings<PropsT, ShareProfileDecoratorDataProps>),\r\n );\r\n};\r\n\r\nexport default ShareProfileDecorator;\r\n","const MODULE_URL = 'share_profiles';\r\nexport default {\r\n MODULE_URL: MODULE_URL,\r\n PROFILES_URL: MODULE_URL,\r\n\r\n PROFILE_ADDED: 'share_profile_added',\r\n PROFILE_UPDATED: 'share_profile_updated',\r\n PROFILE_REMOVED: 'share_profile_removed',\r\n\r\n HIDDEN_PROFILE_ID: 1,\r\n};\r\n"],"names":["formatProfileNameWithSize","profile","formatSize","str","id","HIDDEN_PROFILE_ID","size","profileToEnumValue","formatter","name","___CSS_LOADER_EXPORT___","push","module","MODULE_URL","_viewName","_apiUrl","FavoriteHubConstants","mixins","ViewStoreMixin","IndeterminateCheckbox","locals","inputRef","useRef","useEffect","current","value","indeterminate","ref","type","attrs","onChange","evt","target","checked","IndeterminateCheckboxTemplate","renderCheckbox","IndeterminateCheckboxField","form","Form","templates","checkbox","clone","ConnectivityModeOptions","DISABLED","ACTIVE_MODE","PASSIVE_MODE","Fields","key","title","STRUCT","definitions","STRING","optional","NUMBER","help","BOOLEAN","options","TEXT","isAdcHub","hubUrl","startsWith","getFieldProfiles","profiles","url","filter","p","ShareProfileConstants","map","ModalRouteDecorator","ShareProfileDecorator","hubEntry","favT","socket","formValue","useMemo","entry","generic","user","connectivityV4","connectivityV6","misc","toFormEntry","formDefinitions","nullOption","text","translate","isNew","formRef","RouteModal","className","onApprove","save","closable","icon","IconConstants","FAVORITE","onFieldChanged","hasChanges","includes","hub_url","share_profile","Promise","resolve","onFieldSetting","fieldOptions","undefined","Object","assign","factory","Select","transformer","template","format","parse","onSave","changedFields","updatedEntryFields","post","patch","fieldDefinitions","sourceValue","urls","params","entryId","get","getIcon","state","CONNECTING","CONNECTED","DISCONNECTED","width","cellData","rowDataGetter","navigate","store","t","handleCreateSession","data","createSession","handleRemoveSession","removeSession","current_hub_id","Icon","onClick","getClickAction","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","FavoriteHubCreateActions","create","displayName","access","FAVORITE_HUBS_EDIT","CREATE","handler","FavoriteHubEditActions","edit","EDIT","itemData","hub","remove","REMOVE","confirmation","content","approveCaption","rejectCaption","delete","FavoriteHubActionModule","moduleId","FAVORITE_HUBS","FavoriteHubEditActionMenu","moduleData","actions","FavoriteHubActionMenu","sendPassword","password","handleSetPassword","hasPassword","has_password","FavoriteHubPasswordActions","LOCK","input","inputProps","placeholder","change","FavoriteHubPasswordActionMenu","subId","PasswordCell","caption","hasAccess","editAccess","HUBS_EDIT","VirtualTable","rowClassNameGetter","rowData","connect_state","footerData","header","triggerIcon","button","remoteMenuId","direction","FavoriteHubStore","columnKey","cell","flexGrow","MenuConstants","FAVORITE_HUB","hideWidth","updateFavoriteHub","auto_connect","SocketService","Component","listHidden","dataProviderDecoratorSettings","merge","PROFILES_URL","dataConverters","onSocketConnected","addSocketListener","refetchData","PROFILE_ADDED","PROFILE_UPDATED","PROFILE_REMOVED"],"sourceRoot":""}
|
package/dist/js/{filelists.6fcc193dfe9850d6be17.chunk.js → filelists.3e9317b5397551364a0a.chunk.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[760],{19430:(e,t,n)=>{n.d(t,{T:()=>r,v:()=>i});var s=n(86818);const i=(e,{formatSize:t})=>{let n=e.str;return e.id!==s.A.HIDDEN_PROFILE_ID&&(n+=` (${t(e.size)})`),n},r=(e,t)=>({id:e.id,name:i(e,t)})},22187:(e,t,n)=>{n.d(t,{A:()=>l});var s=n(74848),i=n(77856),r=n(71352),o=n(93866),a=n(39115);function l(e){return{itemNameGetter:e=>e.user.nicks,itemStatusGetter(e){const{flags:t}=e.user;return(0,i.Z)(t)},itemHeaderDescriptionGetter:e=>e.user.hub_names,itemHeaderIconGetter:e=>(0,s.jsx)(o.A,{flags:e.user.flags}),itemHeaderTitleGetter(t,n,i){const{user:o}=t;return(0,s.jsx)(r.Bg,{user:o,ids:e,remoteMenuId:a.Ay.HINTED_USER,children:i})}}}},38686:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Te});var s=n(74848),i=n(96540),r=n(91950),o=n(22187),a=n(62705),l=n(90425),c=n(27725),d=n(71299),A=n(19430),u=n(74416);const m=(0,d.A)(({sessionT:e,profiles:t,onProfileChanged:n})=>{const i=(0,u.k)();return(0,s.jsx)(l.A,{className:"profile top right pointing",caption:e.translate("Browse own share..."),triggerIcon:"",children:t.map(e=>(0,s.jsx)(c.A,{onClick:()=>n(e.id),children:(0,A.v)(e,i)},e.id))})},!1);var f=n(93226),p=n(4425),h=n(16674),E=n(50489),x=n(94310),y=n(4245),g=n(48249);const I=({navigate:e,sessionT:t})=>{const n=(0,y.CU)(),i=(0,g.F)(),r={store:n,socket:i,navigate:e,t:t.plainT},o=e=>{x.u.createRemoteSession({user:e},r)};return(0,s.jsxs)("div",{className:"filelist session new",children:[(0,s.jsx)(h.M,{onChange:o,offlineMessage:t.t("offlineMessage","You must to be connected to at least one hub in order to download filelists from other users"),isClearable:!1,autoFocus:!0}),(0,s.jsx)(m,{onProfileChanged:e=>{x.u.createLocalSession({shareProfileId:e},r)},sessionT:t}),(0,s.jsx)(a.A,{entryType:f.iM.FILELIST,hasSession:e=>!!n.filelists.getSession(e.user.cid),entryTitleRenderer:e=>{const t=e.user.nicks+(e.description?` (${e.description})`:"");return(0,s.jsx)(E.A,{onClick:t=>o(e.user),caption:t})},entryIcon:p.A.FILELISTS_PLAIN})]})};var S=n(38453),w=n(8098);const v=({session:e,sessionT:t})=>{const{formatSize:n}=(0,u.k)();if((0,w.vU)())return null;let i=e.location.type.str;return i.length>0&&(i=`${n(e.location.size)} (${i})`),(0,s.jsxs)(S.q,{children:[(0,s.jsx)(S.J,{label:t.translate("Directory size"),text:i}),(0,s.jsx)(S.J,{label:t.translate("Total list size"),text:n(e.total_size)})]})};var b=n(99347),j=n(32728),L=n(46942),_=n.n(L),D=n(85035),T=n(71352),C=n(88544),R=n(99671),B=n(5945),O=n(65385),F=n(56484),U=n(90264),P=n(34792),N=n(50915);const H=e=>(t,n)=>n.get(`${P.A.MODULE_URL}/${e.id}/items/${t}`);class k extends i.Component{render(){const{fileItem:e,session:t}=this.props;return(0,s.jsxs)(R.A,Object.assign({className:"filelist-item",title:e.name,closable:!0,icon:(0,s.jsx)(B.A,{typeInfo:e.type}),fullHeight:!0},this.props,{children:[(0,s.jsx)(C.A,{downloadHandler:N.jJ,itemDataGetter:H(t),userGetter:()=>t.user,session:t}),(0,s.jsx)(U.G,{fileItem:e,downloadHandler:N.jJ,user:t.user,session:t})]}))}}k.displayName="FilelistItemInfoDialog";const G=(0,O.A)((0,F.A)(k,{urls:{fileItem:({params:e,session:t},n)=>H(t)(e.itemId,n)}}),"item/:itemId");var M=n(77856),$=n(52267),z=n(22005);const V=n.n(z)().createStore({_viewName:"filelist_view",_apiUrl:P.A.SESSIONS_URL,mixins:[(0,$.A)("name")]});var Y=n(22373),K=n(44247),Q=n(68465),J=n(67749),q=n(39115),W=n(86038),X=n(59548);const Z={reloadDirectory:{id:"reloadDirectory",displayName:"Reload",access:W.US.FILELISTS_VIEW,icon:p.A.RELOAD,filter:e=>(({entity:e})=>e.partial_list)(e)&&(({itemData:e})=>"directory"===e.type.id)(e),handler:({itemData:e,entity:t,socket:n})=>n.post(`${P.A.SESSIONS_URL}/${t.id}/directory`,{list_path:e.path,reload:!0})},refreshShare:{id:"refreshShare",displayName:"Refresh in share",access:W.US.SETTINGS_EDIT,icon:p.A.REFRESH_COLORED,filter:({entity:e})=>e.user.flags.includes("self"),handler:({itemData:e})=>(0,X.t7)(e.path)},details:{id:"details",displayName:"Details",icon:p.A.DETAILS,handler:({itemData:e,navigate:t})=>{t(`item/${e.id}`)},filter:e=>!(({itemData:e})=>"/"===e.path)(e)}},ee={moduleData:{moduleId:J.KV.FILELISTS,subId:"item"},actions:Z},te={remove:(0,n(4112).R)(P.A.SESSIONS_URL,W.US.FILELISTS_EDIT)},ne={moduleData:{moduleId:J.KV.FILELISTS},actions:te};var se=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n};const ie=e=>{var{rowDataGetter:t,onClickDirectory:n,session:i}=e,r=se(e,["rowDataGetter","onClickDirectory","session"]);return(0,s.jsx)(K.BH,Object.assign({clickHandlerGetter:n,userGetter:()=>i.user,downloadHandler:N.jJ,rowDataGetter:t,entity:i,remoteMenuId:q.Ay.FILELIST_ITEM},r,{children:(0,s.jsx)(T.yj,{actions:ee,itemData:t,ids:["refreshShare","details"],entity:i})}))},re=e=>{var{session:t,sessionT:n,onClickDirectory:i}=e;se(e,["session","sessionT","onClickDirectory"]);const r=(0,y.CU)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Y.A,{emptyRowsNodeGetter:()=>{const{location:e,state:i}=t,{translate:r}=n;if("download_failed"===i.id)return(0,s.jsx)(j.A,{icon:p.A.ERROR,title:r("Download failed"),description:i.str});const{files:o,directories:a}=e.type;return 0!==o||0!==a?(0,s.jsx)(b.A,{text:r("Updating view")}):e.complete?(0,s.jsx)(j.A,{title:r("No content to display"),description:r("The directory is empty")}):(0,s.jsx)(b.A,{text:r("Preparing download")})},rowClassNameGetter:e=>t.user.flags.includes("self")?"":(0,M.L5)(e.dupe),store:V,entityId:t.id,viewId:t.location.path,sessionStore:r.filelists,moduleId:J.KV.FILELISTS,textFilterProps:{autoFocus:!0},children:[(0,s.jsx)(Q.VP,{name:"Name",width:200,columnKey:"name",cell:(0,s.jsx)(ie,{onClickDirectory:(e,n)=>{if("directory"===n().type.id)return()=>i(t.location.path+e+"/")},session:t}),flexGrow:8}),(0,s.jsx)(Q.VP,{name:"Size",width:60,columnKey:"size",cell:(0,s.jsx)(K.us,{}),flexGrow:1}),(0,s.jsx)(Q.VP,{name:"Type",width:70,columnKey:"type",flexGrow:1,hideWidth:500}),(0,s.jsx)(Q.VP,{name:"Last modified",width:80,columnKey:"time",cell:(0,s.jsx)(K.Jo,{}),flexGrow:1})]}),(0,s.jsx)(G,{session:t})]})};var oe=n(85788),ae=n(36076);var le=n(88939);const ce=e=>{const{sessionT:t,session:n}=e,[r,o]=i.useState(!1),a=(({session:e,location:t,sessionT:n})=>{var s,r;const o=(0,oe.Zp)(),a=(e,n)=>{const s=t.state;if(e===(null==s?void 0:s.directory))return;const i={directory:e};o(t.pathname,{state:i,replace:n})};return i.useEffect(()=>{const n=t.state;n?n.directory!==e.location.path&&a(e.location.path,!0):a(e.location.path,!0)},[null===(s=e.location)||void 0===s?void 0:s.path]),i.useEffect(()=>{const s=t.state;if(!s)return;const i=s.directory;i!==e.location.path&&i&&(t=>{(0,ae.bd)(()=>(0,N.Qs)(e,t),n.plainT)})(i)},[null===(r=t.state)||void 0===r?void 0:r.directory]),a})(e),l=e=>{r||o(!0),a(e,!1)};(0,oe.KP)(({currentLocation:e,nextLocation:n,historyAction:s})=>!("POP"!==s||!r||n.pathname===e.pathname||(o(!1),le.A.info({title:t.t("confirmLeave","Confirm action"),message:t.t("confirmLeaveDesc","Click the back button again to leave this filelist")}),0)));const c=()=>n.location,d=H(n);return(0,s.jsxs)("div",{className:"browser",children:[(0,s.jsx)(D.A,{path:n.location.path,separator:"/",rootPath:"/",rootName:t.translate("Root"),itemClickHandler:l,selectedNameFormatter:e=>(0,s.jsx)(T.gU,{caption:e,user:n.user,itemInfoGetter:c,downloadHandler:N.jJ,contextElement:".session-container",entity:n,remoteMenuId:q.Ay.FILELIST_ITEM,children:(0,s.jsx)(T.Wy,{itemData:n.location,actions:ee,entity:n})}),entityId:n.id}),(0,s.jsx)(re,{session:n,sessionT:t,onClickDirectory:l}),(0,s.jsx)(C.A,{downloadHandler:N.jJ,itemDataGetter:d,userGetter:()=>n.user,session:n})]})};var de=n(80783),Ae=n(17400);const ue=({session:e,sessionT:t,location:n})=>{(0,de.q)(e,x.u,Ae.fD);const{user:i,location:r,state:o}=e,a=i.flags.includes("self"),l=_()("filelist session",{self:a});return i.flags.includes("offline")&&!a?(0,s.jsx)("div",{className:l,children:(0,s.jsx)(j.A,{title:t.t("userOffline","User offline"),description:t.t("userOfflineDesc","You will be able to continue browsing when the user comes back online")})}):"loaded"!==o.id&&"download_failed"!==o.id||!r?(0,s.jsx)("div",{className:l,children:(0,s.jsx)(b.A,{text:o.str})}):(0,s.jsxs)("div",{className:l,children:[(0,s.jsx)(ce,{location:n,session:e,sessionT:t}),(0,s.jsx)(v,{session:e,sessionT:t})]})};var me=n(85072),fe=n.n(me),pe=n(97825),he=n.n(pe),Ee=n(77659),xe=n.n(Ee),ye=n(55056),ge=n.n(ye),Ie=n(10540),Se=n.n(Ie),we=n(41113),ve=n.n(we),be=n(98737),je={};je.styleTagTransform=ve(),je.setAttributes=ge(),je.insert=xe().bind(null,"head"),je.domAPI=he(),je.insertStyleElement=Se(),fe()(be.A,je),be.A&&be.A.locals&&be.A.locals;var Le=n(78046);const _e=(0,o.A)(["message"]),De={itemLabelGetter:()=>null,itemNameGetter:e=>e.share_profile?e.share_profile.str:_e.itemNameGetter(e),itemStatusGetter:e=>e.share_profile?"blue":_e.itemStatusGetter(e),itemHeaderTitleGetter:(e,t,n)=>e.share_profile?n:_e.itemHeaderTitleGetter(e,t,n),itemHeaderDescriptionGetter:e=>e.share_profile?null:_e.itemHeaderDescriptionGetter(e),itemHeaderIconGetter:e=>e.share_profile?"green server":_e.itemHeaderIconGetter(e)},Te=(0,Le.Z)(e=>{const{params:t,sessionT:n}=e,i=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n}(e,["params","sessionT"]);return(0,s.jsx)(r.A,Object.assign({activeId:t.id,baseUrl:"filelists",newCaption:n.t("new","Open filelist"),newDescription:n.t("newDesc","Start browsing a new filelist"),newIcon:p.A.FILELISTS_PLAIN,disableSideMenu:!0,editAccess:W.US.FILELISTS_EDIT,uiActions:ne,sessionApi:x.u,sessionStoreSelector:Ae.fD,sessionItemLayout:ue,newLayout:I,sessionT:n,remoteMenuId:"filelist"},De,i))},Ae.fD,J.KV.FILELISTS)},52237:(e,t,n)=>{n.d(t,{A:()=>a});var s=n(71354),i=n.n(s),r=n(76314),o=n.n(r)()(i());o.push([e.id,".fileitem.info.segment .dupe-paths .path {\n overflow-x: hidden;\n}\n\n.fileitem.info.segment .download.ui.dropdown {\n max-width: 150px;\n margin-top: 10px;\n}\n\n.fileitem.info.segment .title.column {\n margin-top: auto;\n margin-bottom: auto;\n}\n\n.fileitem.info.segment .value.column {\n word-break: break-all;\n}\n","",{version:3,sources:["webpack://./src/components/file-item-info/style.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB",sourcesContent:[".fileitem.info.segment .dupe-paths .path {\r\n overflow-x: hidden;\r\n}\r\n\r\n.fileitem.info.segment .download.ui.dropdown {\r\n max-width: 150px;\r\n margin-top: 10px;\r\n}\r\n\r\n.fileitem.info.segment .title.column {\r\n margin-top: auto;\r\n margin-bottom: auto;\r\n}\r\n\r\n.fileitem.info.segment .value.column {\r\n word-break: break-all;\r\n}\r\n"],sourceRoot:""}]);const a=o},59548:(e,t,n)=>{n.d(t,{Lt:()=>d,eo:()=>a,sf:()=>l,t7:()=>c});var s=n(42191),i=n(32811),r=n(88569),o=n(86038);const a=(e,t,n,o)=>{return a=void 0,l=[e,t,n,o],d=function*(e,t,n,{authToken:o}){try{const a=yield(0,r.U)(e,o);return yield i.A.post(s.A.TEMP_SHARES_URL,{name:e.name,file_id:a,hub_url:t,cid:n})}catch(e){throw e}},new((c=void 0)||(c=Promise))(function(e,t){function n(e){try{i(d.next(e))}catch(e){t(e)}}function s(e){try{i(d.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c(function(e){e(i)})).then(n,s)}i((d=d.apply(a,l||[])).next())});var a,l,c,d},l=e=>i.A.post(s.A.REFRESH_PATHS_URL,{paths:e,priority:o.DH.MANUAL}),c=e=>i.A.post(s.A.REFRESH_VIRTUAL_URL,{path:e}),d=e=>i.A.delete(`${s.A.REFRESH_TASKS_URL}/${e}`)},62705:(e,t,n)=>{n.d(t,{A:()=>u});var s=n(74848),i=(n(96540),n(56484)),r=n(74416),o=n(31224),a=n(2253),l=n(93226),c=n(67749),d=n(42695),A=n(32389);const u=(0,i.A)(({entries:e,entryTitleRenderer:t,hasSession:n,entryIcon:i})=>{const{formatRelativeTime:l}=(0,r.k)(),{t:u}=(0,A.Bd)();return 0===e.length?null:(0,s.jsxs)("div",{className:"recents",children:[(0,s.jsx)(o.A,{title:(0,d.Tl)("Recent sessions",u,c.KV.COMMON),size:""}),(0,s.jsx)("div",{className:"ui relaxed divided list",children:e.map((e,r)=>(0,s.jsx)(a.c,{header:t(e),description:!!e.last_opened&&u((0,d.j2)("openedAgo",c.KV.COMMON),{defaultValue:"Opened {{timeAgo}}",replace:{timeAgo:l(e.last_opened)}}),icon:(n(e)?"green ":"")+i},r))})]})},{urls:{entries:({entryType:e},t)=>t.get(`${l.Ay.SESSIONS_URL}/${e}/0`)}})},71299:(e,t,n)=>{n.d(t,{A:()=>o});var s=n(2543),i=n(86818),r=n(56484);const o=function(e,t,n){return(0,r.A)(e,(0,s.merge)(n,{urls:{profiles:i.A.PROFILES_URL},dataConverters:{profiles:(e,{t:n})=>e.filter(e=>t||e.id!==i.A.HIDDEN_PROFILE_ID)},onSocketConnected:(e,{refetchData:t})=>{e(i.A.MODULE_URL,i.A.PROFILE_ADDED,()=>t()),e(i.A.MODULE_URL,i.A.PROFILE_UPDATED,()=>t()),e(i.A.MODULE_URL,i.A.PROFILE_REMOVED,()=>t())}}))}},86818:(e,t,n)=>{n.d(t,{A:()=>i});const s="share_profiles",i={MODULE_URL:s,PROFILES_URL:s,PROFILE_ADDED:"share_profile_added",PROFILE_UPDATED:"share_profile_updated",PROFILE_REMOVED:"share_profile_removed",HIDDEN_PROFILE_ID:1}},88569:(e,t,n)=>{n.d(t,{H:()=>a,U:()=>o});var s=n(50753),i=n(41110),r=function(e,t,n,s){return new(n||(n=Promise))(function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};const o=(e,t)=>r(void 0,void 0,void 0,function*(){try{return(yield(0,i.F)(`${getBasePath()}temp`,{method:"POST",headers:{"X-Authorization":t,Authorization:t},body:e})).headers.get("Location")}catch(e){throw e}}),a=(e,t,n)=>r(void 0,void 0,void 0,function*(){try{const r=yield(0,i.F)((e=>`${window.location.origin}${getBasePath()}proxy?url=${encodeURIComponent(e)}`)(e),Object.assign({headers:{"X-Authorization":s.A.authToken,"Cache-Control":"no-store, must-revalidate, max-age=0"}},n));return(yield t)?r.json():r.text()}catch(t){throw console.error(`CORS HTTP request failed (${e})`,t),t}})},90264:(e,t,n)=>{n.d(t,{G:()=>L});var s=n(74848),i=(n(96540),n(74416)),r=n(71352),o=n(86038),a=n(67749),l=n(32389),c=n(42695),d=n(85072),A=n.n(d),u=n(97825),m=n.n(u),f=n(77659),p=n.n(f),h=n(55056),E=n.n(h),x=n(10540),y=n.n(x),g=n(41113),I=n.n(g),S=n(52237),w={};w.styleTagTransform=I(),w.setAttributes=E(),w.insert=p().bind(null,"head"),w.domAPI=m(),w.insertStyleElement=y(),A()(S.A,w),S.A&&S.A.locals&&S.A.locals;var v=n(73070);const b={[o.YF.SHARE_PARTIAL]:"Share (partial)",[o.YF.SHARE_FULL]:"Share (full)",[o.YF.QUEUE_PARTIAL]:"Queue (partial)",[o.YF.QUEUE_FULL]:"Queue (full)",[o.YF.FINISHED_PARTIAL]:"Finished (partial)",[o.YF.FINISHED_FULL]:"Finished (full)",[o.YF.SHARE_QUEUE]:"Share and queue",[o.YF.SHARE_FINISHED]:"Share and finished",[o.YF.QUEUE_FINISHED]:"Queue and finished",[o.YF.SHARE_QUEUE_FINISHED]:"Share, queue and finished"},j=({paths:e})=>(0,s.jsx)("div",{className:"dupe-paths",children:e.map(e=>(0,s.jsx)("div",{className:"path",children:e},e))}),L=({session:e,fileItem:t,user:n,downloadHandler:o,showPath:d=!0})=>{const{t:A}=(0,l.Bd)(),u=e=>(0,c.Tl)(e,A,a.KV.COMMON),{formatSize:m,formatRelativeTime:f}=(0,i.k)();return(0,s.jsxs)("div",{className:"ui fileitem info segment",children:[(0,s.jsxs)(v.xA,{columns:"two",stackable:!0,children:[(0,s.jsx)(v.fI,{title:u("Name"),text:t.name}),(0,s.jsx)(v.fI,{title:u("Type/content"),text:t.type.str}),(0,s.jsx)(v.fI,{title:u("Size"),text:m(t.size,2,!0)}),(0,s.jsx)(v.fI,{title:u("Last modified"),text:f(t.time||0)}),"file"===t.type.id&&(0,s.jsx)(v.fI,{title:u("TTH"),text:t.tth}),!!t.dupe&&(0,s.jsx)(v.fI,{title:u("Dupe type"),text:u(b[t.dupe.id])}),!!t.dupe&&(0,s.jsx)(v.fI,{title:u("Dupe paths"),text:(0,s.jsx)(j,{paths:t.dupe.paths})}),d&&(0,s.jsx)(v.fI,{title:u("Path"),text:t.path})]}),(0,s.jsx)(r.gU,{caption:u("Actions..."),button:!0,user:n,itemInfoGetter:()=>t,downloadHandler:o,contextElement:".ui.modal > .content",entity:e})]})}},98737:(e,t,n)=>{n.d(t,{A:()=>a});var s=n(71354),i=n.n(s),r=n(76314),o=n.n(r)()(i());o.push([e.id,"#sidebar .virtual-table {\n flex: 1 100 100%;\n}\n\n.filelist.session .browser,\n.filelist.session .browser .virtual-table {\n height: calc(100% - 35px);\n}\n\n#mobile-layout .filelist.session .browser {\n height: 100%;\n}\n\n#mobile-layout .filelist.session .browser {\n height: calc(100% - 10px);\n}\n\n@media screen and (min-color-index: 0) and(-webkit-min-device-pixel-ratio:0) {\n /* Safari specific CSS */\n .filelist.session .browser {\n height: calc(100% - 95px);\n }\n\n #mobile-layout .filelist.session .browser {\n height: calc(100% - 60px);\n }\n}\n\n.filelist.session .browser .ui.segment {\n margin-bottom: 10px;\n}\n\n.filelist.session {\n max-height: 100%;\n overflow: hidden;\n margin-top: 10px;\n flex: 1 1 100%;\n}\n\n.session.new .profile.ui.dropdown {\n margin-top: 10px;\n color: gray;\n align-self: flex-end;\n}\n","",{version:3,sources:["webpack://./src/routes/Sidebar/routes/Filelists/style.css"],names:[],mappings:"AAAA;EACE,gBAAgB;AAClB;;AAEA;;EAEE,yBAAyB;AAC3B;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,wBAAwB;EACxB;IACE,yBAAyB;EAC3B;;EAEA;IACE,yBAAyB;EAC3B;AACF;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;EAChB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,gBAAgB;EAChB,WAAW;EACX,oBAAoB;AACtB",sourcesContent:["#sidebar .virtual-table {\r\n flex: 1 100 100%;\r\n}\r\n\r\n.filelist.session .browser,\r\n.filelist.session .browser .virtual-table {\r\n height: calc(100% - 35px);\r\n}\r\n\r\n#mobile-layout .filelist.session .browser {\r\n height: 100%;\r\n}\r\n\r\n#mobile-layout .filelist.session .browser {\r\n height: calc(100% - 10px);\r\n}\r\n\r\n@media screen and (min-color-index: 0) and(-webkit-min-device-pixel-ratio:0) {\r\n /* Safari specific CSS */\r\n .filelist.session .browser {\r\n height: calc(100% - 95px);\r\n }\r\n\r\n #mobile-layout .filelist.session .browser {\r\n height: calc(100% - 60px);\r\n }\r\n}\r\n\r\n.filelist.session .browser .ui.segment {\r\n margin-bottom: 10px;\r\n}\r\n\r\n.filelist.session {\r\n max-height: 100%;\r\n overflow: hidden;\r\n margin-top: 10px;\r\n flex: 1 1 100%;\r\n}\r\n\r\n.session.new .profile.ui.dropdown {\r\n margin-top: 10px;\r\n color: gray;\r\n align-self: flex-end;\r\n}\r\n"],sourceRoot:""}]);const a=o}}]);
|
|
2
|
-
//# sourceMappingURL=filelists.
|
|
2
|
+
//# sourceMappingURL=filelists.3e9317b5397551364a0a.chunk.js.map
|