airdcpp-webui 2.12.1-beta.3 → 2.12.1
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/{223.d8381390628f8a92159f.chunk.js → 223.92cf614c9d87cf67385e.chunk.js} +2 -2
- package/dist/js/223.92cf614c9d87cf67385e.chunk.js.gz +0 -0
- package/dist/js/{223.d8381390628f8a92159f.chunk.js.map → 223.92cf614c9d87cf67385e.chunk.js.map} +1 -1
- package/dist/js/{236.a5df8c51dbebe95cc268.chunk.js → 236.6b4fd58c10a23138b7d8.chunk.js} +2 -2
- package/dist/js/236.6b4fd58c10a23138b7d8.chunk.js.gz +0 -0
- package/dist/js/236.6b4fd58c10a23138b7d8.chunk.js.map +1 -0
- package/dist/js/{544.58de40c388788ce8d588.chunk.js → 544.826a806e4535f09cf100.chunk.js} +2 -2
- package/dist/js/{544.58de40c388788ce8d588.chunk.js.gz → 544.826a806e4535f09cf100.chunk.js.gz} +0 -0
- package/dist/js/{544.58de40c388788ce8d588.chunk.js.map → 544.826a806e4535f09cf100.chunk.js.map} +1 -1
- package/dist/js/{616.6af0b2487703c8da4b2c.chunk.js → 616.57a60c241582d79fa280.chunk.js} +2 -2
- package/dist/js/616.57a60c241582d79fa280.chunk.js.gz +0 -0
- package/dist/js/{616.6af0b2487703c8da4b2c.chunk.js.map → 616.57a60c241582d79fa280.chunk.js.map} +1 -1
- package/dist/js/{favorite-hubs.5d14015c002fab9d6e93.chunk.js → favorite-hubs.f1ced66aa7691eeee525.chunk.js} +2 -2
- package/dist/js/favorite-hubs.f1ced66aa7691eeee525.chunk.js.gz +0 -0
- package/dist/js/{favorite-hubs.5d14015c002fab9d6e93.chunk.js.map → favorite-hubs.f1ced66aa7691eeee525.chunk.js.map} +1 -1
- package/dist/js/{filelists.69f099cbc0bb5b67d1b8.chunk.js → filelists.852a6a879bab1f93854e.chunk.js} +2 -2
- package/dist/js/filelists.852a6a879bab1f93854e.chunk.js.gz +0 -0
- package/dist/js/{filelists.69f099cbc0bb5b67d1b8.chunk.js.map → filelists.852a6a879bab1f93854e.chunk.js.map} +1 -1
- package/dist/js/{home.ccd57551ac01ff4fc4ba.chunk.js → home.9a37f3a3c78cb9b3f45c.chunk.js} +3 -3
- package/dist/js/home.9a37f3a3c78cb9b3f45c.chunk.js.gz +0 -0
- package/dist/js/home.9a37f3a3c78cb9b3f45c.chunk.js.map +1 -0
- package/dist/js/{hubs.c2b8880d6d8ccfc9eb3a.chunk.js → hubs.c21b941c411425d4852f.chunk.js} +2 -2
- package/dist/js/hubs.c21b941c411425d4852f.chunk.js.gz +0 -0
- package/dist/js/hubs.c21b941c411425d4852f.chunk.js.map +1 -0
- package/dist/js/main.7a746a54efc4bf96cd20.entry.js +3 -0
- package/dist/js/{main.a7216efbb2c5cd34c7e5.entry.js.LICENSE.txt → main.7a746a54efc4bf96cd20.entry.js.LICENSE.txt} +3 -3
- package/dist/js/main.7a746a54efc4bf96cd20.entry.js.gz +0 -0
- package/dist/js/main.7a746a54efc4bf96cd20.entry.js.map +1 -0
- package/dist/js/{messages.980fd246050252a227cd.chunk.js → messages.6ed02d7d7ec7e06a93f2.chunk.js} +2 -2
- package/dist/js/messages.6ed02d7d7ec7e06a93f2.chunk.js.gz +0 -0
- package/dist/js/{messages.980fd246050252a227cd.chunk.js.map → messages.6ed02d7d7ec7e06a93f2.chunk.js.map} +1 -1
- package/dist/js/{queue.31409106566ce8e19fc3.chunk.js → queue.c73112a5c40baeee7c54.chunk.js} +2 -2
- package/dist/js/queue.c73112a5c40baeee7c54.chunk.js.gz +0 -0
- package/dist/js/{queue.31409106566ce8e19fc3.chunk.js.map → queue.c73112a5c40baeee7c54.chunk.js.map} +1 -1
- package/dist/js/{search.d724d4a3b2c8f3fe2768.chunk.js → search.66bbb5aead0f68100e76.chunk.js} +2 -2
- package/dist/js/search.66bbb5aead0f68100e76.chunk.js.gz +0 -0
- package/dist/js/{search.d724d4a3b2c8f3fe2768.chunk.js.map → search.66bbb5aead0f68100e76.chunk.js.map} +1 -1
- package/dist/js/settings.a509b3c48b03452b6783.chunk.js +2 -0
- package/dist/js/settings.a509b3c48b03452b6783.chunk.js.gz +0 -0
- package/dist/js/settings.a509b3c48b03452b6783.chunk.js.map +1 -0
- package/dist/js/{share.a35d32796acde4fc3d59.chunk.js → share.6efce937acbd036d089d.chunk.js} +2 -2
- package/dist/js/share.6efce937acbd036d089d.chunk.js.gz +0 -0
- package/dist/js/{share.a35d32796acde4fc3d59.chunk.js.map → share.6efce937acbd036d089d.chunk.js.map} +1 -1
- package/dist/js/{system-log.2d9af5f3372752909d83.chunk.js → system-log.3efd872fbf4a90cde8d5.chunk.js} +2 -2
- package/dist/js/system-log.3efd872fbf4a90cde8d5.chunk.js.gz +0 -0
- package/dist/js/{system-log.2d9af5f3372752909d83.chunk.js.map → system-log.3efd872fbf4a90cde8d5.chunk.js.map} +1 -1
- package/dist/js/{transfers.22bad3799f0455da946b.chunk.js → transfers.326119d8de6e6f8176b5.chunk.js} +2 -2
- package/dist/js/transfers.326119d8de6e6f8176b5.chunk.js.gz +0 -0
- package/dist/js/{transfers.22bad3799f0455da946b.chunk.js.map → transfers.326119d8de6e6f8176b5.chunk.js.map} +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.gz +0 -0
- package/jest.config.js +1 -1
- package/package.json +2 -2
- package/tsconfig.json +1 -1
- package/dist/js/223.d8381390628f8a92159f.chunk.js.gz +0 -0
- package/dist/js/236.a5df8c51dbebe95cc268.chunk.js.gz +0 -0
- package/dist/js/236.a5df8c51dbebe95cc268.chunk.js.map +0 -1
- package/dist/js/616.6af0b2487703c8da4b2c.chunk.js.gz +0 -0
- package/dist/js/favorite-hubs.5d14015c002fab9d6e93.chunk.js.gz +0 -0
- package/dist/js/filelists.69f099cbc0bb5b67d1b8.chunk.js.gz +0 -0
- package/dist/js/home.ccd57551ac01ff4fc4ba.chunk.js.gz +0 -0
- package/dist/js/home.ccd57551ac01ff4fc4ba.chunk.js.map +0 -1
- package/dist/js/hubs.c2b8880d6d8ccfc9eb3a.chunk.js.gz +0 -0
- package/dist/js/hubs.c2b8880d6d8ccfc9eb3a.chunk.js.map +0 -1
- package/dist/js/main.a7216efbb2c5cd34c7e5.entry.js +0 -3
- package/dist/js/main.a7216efbb2c5cd34c7e5.entry.js.gz +0 -0
- package/dist/js/main.a7216efbb2c5cd34c7e5.entry.js.map +0 -1
- package/dist/js/messages.980fd246050252a227cd.chunk.js.gz +0 -0
- package/dist/js/queue.31409106566ce8e19fc3.chunk.js.gz +0 -0
- package/dist/js/search.d724d4a3b2c8f3fe2768.chunk.js.gz +0 -0
- package/dist/js/settings.4087d834170e87ff1c53.chunk.js +0 -2
- package/dist/js/settings.4087d834170e87ff1c53.chunk.js.gz +0 -0
- package/dist/js/settings.4087d834170e87ff1c53.chunk.js.map +0 -1
- package/dist/js/share.a35d32796acde4fc3d59.chunk.js.gz +0 -0
- package/dist/js/system-log.2d9af5f3372752909d83.chunk.js.gz +0 -0
- package/dist/js/transfers.22bad3799f0455da946b.chunk.js.gz +0 -0
- /package/dist/js/{home.ccd57551ac01ff4fc4ba.chunk.js.LICENSE.txt → home.9a37f3a3c78cb9b3f45c.chunk.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[976],{39291:(e,t,i)=>{i.d(t,{A:()=>s});var o=i(71354),r=i.n(o),n=i(76314),a=i.n(n)()(r());a.push([e.id,".share-directory .Select {\n margin-bottom: 0px;\n}\n","",{version:3,sources:["webpack://./src/routes/Share/style.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB",sourcesContent:[".share-directory .Select {\n margin-bottom: 0px;\n}\n"],sourceRoot:""}]);const s=a},29112:(e,t,i)=>{i.d(t,{RS:()=>l,eP:()=>d,t6:()=>h});var o=i(26817),r=i(42191),n=i(4425),a=i(86038),s=i(67749);const l={id:"refreshAll",displayName:"Refresh all",access:a.US.SETTINGS_EDIT,icon:n.A.REFRESH_COLORED,handler:()=>o.A.post(r.A.REFRESH_URL)},c={refresh:l},d={moduleId:s.KV.SHARE},h={moduleData:d,actions:c}},91510:(e,t,i)=>{i.d(t,{MB:()=>d,Tw:()=>l,nH:()=>h});var o=i(26817),r=i(42191),n=i(4425),a=i(86038),s=i(67749);const l={id:"add",displayName:"Add path",access:a.US.SETTINGS_EDIT,icon:n.A.CREATE,handler:({navigate:e})=>{e("browse")}},c={remove:{id:"remove",displayName:"Remove path",access:a.US.SETTINGS_EDIT,icon:n.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the excluded path {{item}}?",approveCaption:"Remove path",rejectCaption:"Don't remove"},handler:({itemData:e})=>o.A.post(r.A.EXCLUDES_REMOVE_URL,{path:e})}},d={moduleId:s.KV.SETTINGS,subId:"shareExclude"},h={moduleData:d,actions:c}},94899:(e,t,i)=>{i.d(t,{Ds:()=>E,YS:()=>y,tx:()=>h});var o=i(26817),r=i(40599),n=i(17585),a=i(86818),s=i(4425),l=i(86038),c=i(67749),d=i(48844);const h={id:"create",displayName:"Add profile",access:l.US.SETTINGS_EDIT,icon:s.A.CREATE,input:{approveCaption:"Create",content:"Enter name for the profile",inputProps:{placeholder:"Enter name",required:!0}},handler:(e,t)=>o.A.post(a.A.PROFILES_URL,{name:t})},p={id:"browse",displayName:"Browse files",access:l.US.FILELISTS_VIEW,icon:s.A.FILELIST,handler:({itemData:e,location:t})=>r.A.ownList(t,e.id,n.A)},m={id:"edit",displayName:"Rename profile",access:l.US.SETTINGS_EDIT,icon:s.A.EDIT,input:e=>({approveCaption:"Rename",content:"Enter new name for the profile {{item.name}}",inputProps:{placeholder:"Enter name",defaultValue:e.name,required:!0}}),handler:({itemData:e},t)=>o.A.patch(`${a.A.PROFILES_URL}/${e.id}`,{name:t})},u={id:"default",displayName:"Set as default",access:l.US.SETTINGS_EDIT,filter:({itemData:e})=>!e.default,icon:s.A.DEFAULT,handler:({itemData:e})=>o.A.post(`${a.A.PROFILES_URL}/${e.id}/default`)},A={id:"remove",displayName:"Remove profile",access:l.US.SETTINGS_EDIT,icon:s.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the profile {{item.name}}?",approveCaption:"Remove profile",rejectCaption:"Don't remove"},handler:({itemData:e})=>o.A.delete(a.A.PROFILES_URL+"/"+e.id)},f={browse:p,divider:d.o,edit:m,default:u,remove:A},E={moduleId:c.KV.SETTINGS,subId:"profile"},y={moduleData:E,actions:f}},86818:(e,t,i)=>{i.d(t,{A:()=>r});const o="share_profiles",r={MODULE_URL:o,PROFILES_URL:o,PROFILE_ADDED:"share_profile_added",PROFILE_UPDATED:"share_profile_updated",PROFILE_REMOVED:"share_profile_removed",HIDDEN_PROFILE_ID:1}},53632:(e,t,i)=>{i.d(t,{A:()=>n});var o=i(74848),r=i(96540);function n(e,t=60){class i extends r.Component{constructor(){super(...arguments),this.scheduleComponentRefresh=()=>{this.redrawTimeout=window.setTimeout((()=>{this.forceUpdate(),this.scheduleComponentRefresh()}),1e3*t)}}componentDidMount(){this.scheduleComponentRefresh()}componentWillUnmount(){clearTimeout(this.redrawTimeout)}render(){return(0,o.jsx)(e,Object.assign({},this.props))}}return i}},71299:(e,t,i)=>{i.d(t,{A:()=>l,T:()=>s});var o=i(2543),r=i(86818),n=i(13546),a=i(98573);const s=e=>({id:e.id,name:e.str}),l=function(e,t,i,s=!0){return(0,n.A)(e,(0,o.merge)(i,{urls:{profiles:r.A.PROFILES_URL},dataConverters:{profiles:(e,{t:i})=>{const o=e.filter((e=>t||e.id!==r.A.HIDDEN_PROFILE_ID)).map((e=>((e,t)=>{let i=e.str;return s&&e.id!==r.A.HIDDEN_PROFILE_ID&&(i+=` (${(0,a.Xq)(e.size,t)})`),Object.assign(Object.assign({},e),{str:i})})(e,i)));return o}},onSocketConnected:(e,{refetchData:t})=>{e(r.A.MODULE_URL,r.A.PROFILE_ADDED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_UPDATED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_REMOVED,(()=>t()))}}))}},28121:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ye});var o=i(74848),r=i(96540),n=i(22005),a=i.n(n),s=i(52267);const l="share_roots",c=l,d=l,h=a().createStore({_viewName:"share_root_view",_apiUrl:c,mixins:[(0,s.A)("path")]});var p=i(22373),m=i(44247),u=i(68465),A=i(75662),f=i(42191),E=i(4425),y=i(65385),v=i(71299),S=i(26817),R=i(32728),T=i(51766),I=i(33968),_=i(94413),D=i(59315),O=i(13712),w=i(85072),L=i.n(w),g=i(97825),x=i.n(g),N=i(77659),P=i.n(N),U=i(55056),b=i.n(U),C=i(10540),j=i.n(C),F=i(41113),V=i.n(F),H=i(39291),k={};k.styleTagTransform=V(),k.setAttributes=b(),k.insert=P().bind(null,"head"),k.domAPI=x(),k.insertStyleElement=j(),L()(H.A,k),H.A&&H.A.locals&&H.A.locals;var G=i(86038),M=i(47456),$=i(32389);const K=[{key:"path",title:"Path",type:G.OP.DIRECTORY_PATH},{key:"virtual_name",title:"Virtual name",type:G.OP.STRING,help:"Directories with identical virtual names will be merged in filelist"},{key:"profiles",type:G.OP.LIST,item_type:G.OP.NUMBER,title:"Share profiles",help:"New share profiles can be created from application settings"},{key:"incoming",title:"Incoming",type:G.OP.BOOLEAN}];class B extends r.Component{constructor(e){super(e),this.isNew=()=>!this.props.rootEntry,this.onFieldChanged=(e,t,i)=>{if(e.includes("path")){const e={virtual_name:t.path?(0,I.ap)(t.path):void 0};return Promise.resolve(e)}return null},this.save=()=>this.form.save(),this.onSave=e=>this.isNew()?S.A.post(d,e):S.A.patch(`${d}/${this.props.rootEntry.id}`,e),this.onFieldSetting=(e,t,i)=>{"path"===e?(t.disabled=!this.isNew(),t.config=Object.assign({}||t.config,{historyId:D.A.LOCATION_DOWNLOAD})):"virtual_name"===e&&(t.factory=T.Ay.form.Textbox,t.template=O.I9,t.config={suggestionGetter:()=>this.props.virtualNames})},this.fieldDefinitions=(0,M.Nn)(K,e.shareT);const t=this.fieldDefinitions.find((e=>"profiles"===e.key));Object.assign(t,{options:e.profiles.map(v.T),default_value:[e.profiles.find((e=>e.default)).id]})}render(){const e=this.props,{rootEntry:t,shareT:i}=e,r=function(e,t){var i={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(i[o[r]]=e[o[r]])}return i}(e,["rootEntry","shareT"]),n=i.translate(this.isNew()?"Add share directory":"Edit share directory");return(0,o.jsxs)(A.A,Object.assign({className:"share-directory",title:n,onApprove:this.save,closable:!1,icon:E.A.FOLDER},r,{children:[(0,o.jsx)(R.A,{title:i.translate("Hashing information"),icon:E.A.INFO,description:(0,o.jsx)($.x6,{i18nKey:i.toI18nKey("hashingInformationDesc"),children:(0,o.jsx)("p",{children:"New files will appear in share only after they have finished hashing (the client has calculated checksums for them). Information about hashing progress will be posted to the event log."})})}),(0,o.jsx)(_.A,{ref:e=>this.form=e,fieldDefinitions:this.fieldDefinitions,onFieldChanged:this.onFieldChanged,onFieldSetting:this.onFieldSetting,onSave:this.onSave,sourceValue:t,location:this.props.location})]}))}}B.displayName="ShareDirectoryDialog";const z=(0,y.A)((0,v.A)(B,!1,{urls:{virtualNames:f.A.GROUPED_ROOTS_GET_URL,rootEntry:({params:e},t)=>e.directoryId?t.get(`${d}/${e.directoryId}`):Promise.resolve(void 0)},dataConverters:{virtualNames:e=>e.map((e=>e.name),[])}}),"/directories/:directoryId?");var W=i(31104),q=i(19247),X=i(27725),Y=i(36995),J=i(42695);const Z=(0,r.memo)((function(e){const{t}=(0,$.Bd)(),i={str:(0,J.Tl)("All profiles",t,"table.filter"),id:null},[n,a]=(0,r.useState)(i),s=t=>{e.onFilterUpdated(t.id),a(t)};return(0,o.jsx)(W.A,{className:"top right pointing",caption:n.str,triggerIcon:"filter",button:!0,children:(0,o.jsx)(q.A,{caption:(0,J.Tl)("Filter by profile",t,"table.filter"),icon:E.A.FILTER,children:[i,...e.profiles].map((e=>((e,t,i)=>(0,o.jsx)(X.A,{active:i.id===e.id,onClick:()=>t(e),children:e.str},e.id))(e,s,n)))})})})),Q=(0,v.A)((0,Y.A)(Z,"profiles"),!1);var ee=i(71352),te=i(53632),ie=i(98573),oe=i(99347),re=i(67749),ne=i(59548),ae=i(36076),se=i(83994);const le=(0,te.A)((({rowDataGetter:e,cellData:t,t:i})=>{const r=e().status;return r.id!==G.hZ.NORMAL?(0,o.jsxs)("div",{style:{display:"flex"},children:[(0,o.jsx)(se.A,{icon:E.A.CANCEL,color:"red",size:"large",onClick:()=>{const t=e().status.refresh_task_id;t&&(0,ae.bd)((()=>(0,ne.Lt)(t)),i)}}),(0,o.jsx)(oe.A,{size:"small",inline:!0,text:r.str})]}):(0,o.jsxs)("div",{children:[(0,o.jsx)(se.A,{icon:E.A.REFRESH_COLORED,size:"large",onClick:()=>(0,ae.bd)((()=>(0,ne.sf)([e().path])),i)}),0===t?(0,J.Tl)("Unknown",i,re.KV.SHARE):(0,ie.fw)(t)]})}));var ce=i(41860),de=i(39115),he=i(29112);i(91510),i(94899);const pe={id:"create",displayName:"Add directory",access:G.US.SETTINGS_EDIT,icon:E.A.CREATE,handler:({navigate:e})=>{e("directories")}},me={edit:{id:"edit",displayName:"Edit directory",access:G.US.SETTINGS_EDIT,icon:E.A.EDIT,handler:({itemData:e,navigate:t})=>{t(`directories/${e.id}`)}},remove:{id:"remove",displayName:"Remove directory",access:G.US.SETTINGS_EDIT,icon:E.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the directory {{item.virtual_name}} from share? It will be removed from all share profiles.",approveCaption:"Remove directory",rejectCaption:"Don't remove"},handler:({itemData:e})=>S.A.delete(d+"/"+e.id)}},ue={moduleId:re.KV.SHARE,subId:"root"},Ae={moduleData:ue,actions:me},fe={actions:{create:pe},moduleData:ue};class Ee extends r.Component{constructor(){super(...arguments),this.shareT=(0,J.lw)(this.props.t,re.KV.SHARE)}render(){const{translate:e}=this.shareT,t=ce.A.hasAccess(G.US.SETTINGS_EDIT);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.A,{store:h,customFilter:Q,footerData:(0,o.jsx)(ee.Wy,{className:"top left pointing",caption:e("Actions..."),actions:fe,header:e("Share actions"),triggerIcon:"chevron up",ids:["create"],button:!0,children:(0,o.jsx)(ee.Wy,{actions:he.t6,ids:["refresh"]})}),moduleId:re.KV.SHARE,children:[(0,o.jsx)(u.VP,{name:"Path",width:200,columnKey:"path",cell:(0,o.jsx)(m.tC,{actions:Ae,remoteMenuId:de.Ay.SHARE_ROOT}),flexGrow:10}),(0,o.jsx)(u.VP,{name:"Size",width:60,columnKey:"size",cell:(0,o.jsx)(m.us,{}),flexGrow:2}),(0,o.jsx)(u.VP,{name:"Content",width:150,columnKey:"type",hideWidth:1e3}),(0,o.jsx)(u.VP,{name:"Virtual name",width:120,columnKey:"virtual_name",flexGrow:5}),(0,o.jsx)(u.VP,{name:"Profiles",width:65,columnKey:"profiles"}),(0,o.jsx)(u.VP,{name:"Last refreshed",width:80,flexGrow:3,columnKey:"last_refresh_time",cell:t?(0,o.jsx)(le,{}):(0,o.jsx)(m.Jo,{})})]}),(0,o.jsx)(z,{shareT:this.shareT})]})}}Ee.displayName="Share";const ye=(0,$.CI)()(Ee)},88569:(e,t,i)=>{i.d(t,{H:()=>s,U:()=>a});var o=i(41860),r=i(41110),n=function(e,t,i,o){return new(i||(i=Promise))((function(r,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};const a=e=>n(void 0,void 0,void 0,(function*(){try{return(yield(0,r.F)(`${getBasePath()}temp`,{method:"POST",headers:{"X-Authorization":o.A.authToken,Authorization:o.A.authToken},body:e})).headers.get("Location")}catch(e){throw e}})),s=(e,t,i)=>n(void 0,void 0,void 0,(function*(){try{const n=yield(0,r.F)((e=>`${window.location.origin}${getBasePath()}proxy?url=${encodeURIComponent(e)}`)(e),Object.assign({headers:{"X-Authorization":o.A.authToken,"Cache-Control":"no-store, must-revalidate, max-age=0"}},i));return(yield t)?n.json():n.text()}catch(t){throw console.error(`CORS HTTP request failed (${e})`,t),t}}))},59548:(e,t,i)=>{i.d(t,{Lt:()=>d,eo:()=>s,sf:()=>l,t7:()=>c});var o=i(42191),r=i(26817),n=i(88569),a=i(86038);const s=(e,t,i)=>{return a=void 0,s=void 0,c=function*(){try{const a=yield(0,n.U)(e);return yield r.A.post(o.A.TEMP_SHARES_URL,{name:e.name,file_id:a,hub_url:t,cid:i})}catch(e){throw e}},new((l=void 0)||(l=Promise))((function(e,t){function i(e){try{r(c.next(e))}catch(e){t(e)}}function o(e){try{r(c.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof l?r:new l((function(e){e(r)}))).then(i,o)}r((c=c.apply(a,s||[])).next())}));var a,s,l,c},l=e=>r.A.post(o.A.REFRESH_PATHS_URL,{paths:e,priority:a.DH.MANUAL}),c=e=>r.A.post(o.A.REFRESH_VIRTUAL_URL,{path:e}),d=e=>r.A.delete(`${o.A.REFRESH_TASKS_URL}/${e}`)}}]);
|
|
2
|
-
//# sourceMappingURL=share.
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[976],{39291:(e,t,i)=>{i.d(t,{A:()=>s});var o=i(71354),r=i.n(o),n=i(76314),a=i.n(n)()(r());a.push([e.id,".share-directory .Select {\n margin-bottom: 0px;\n}\n","",{version:3,sources:["webpack://./src/routes/Share/style.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB",sourcesContent:[".share-directory .Select {\n margin-bottom: 0px;\n}\n"],sourceRoot:""}]);const s=a},29112:(e,t,i)=>{i.d(t,{RS:()=>l,eP:()=>d,t6:()=>h});var o=i(32811),r=i(42191),n=i(4425),a=i(86038),s=i(67749);const l={id:"refreshAll",displayName:"Refresh all",access:a.US.SETTINGS_EDIT,icon:n.A.REFRESH_COLORED,handler:()=>o.A.post(r.A.REFRESH_URL)},c={refresh:l},d={moduleId:s.KV.SHARE},h={moduleData:d,actions:c}},91510:(e,t,i)=>{i.d(t,{MB:()=>d,Tw:()=>l,nH:()=>h});var o=i(32811),r=i(42191),n=i(4425),a=i(86038),s=i(67749);const l={id:"add",displayName:"Add path",access:a.US.SETTINGS_EDIT,icon:n.A.CREATE,handler:({navigate:e})=>{e("browse")}},c={remove:{id:"remove",displayName:"Remove path",access:a.US.SETTINGS_EDIT,icon:n.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the excluded path {{item}}?",approveCaption:"Remove path",rejectCaption:"Don't remove"},handler:({itemData:e})=>o.A.post(r.A.EXCLUDES_REMOVE_URL,{path:e})}},d={moduleId:s.KV.SETTINGS,subId:"shareExclude"},h={moduleData:d,actions:c}},94899:(e,t,i)=>{i.d(t,{Ds:()=>E,YS:()=>y,tx:()=>h});var o=i(32811),r=i(40599),n=i(17585),a=i(86818),s=i(4425),l=i(86038),c=i(67749),d=i(48844);const h={id:"create",displayName:"Add profile",access:l.US.SETTINGS_EDIT,icon:s.A.CREATE,input:{approveCaption:"Create",content:"Enter name for the profile",inputProps:{placeholder:"Enter name",required:!0}},handler:(e,t)=>o.A.post(a.A.PROFILES_URL,{name:t})},p={id:"browse",displayName:"Browse files",access:l.US.FILELISTS_VIEW,icon:s.A.FILELIST,handler:({itemData:e,location:t})=>r.A.ownList(t,e.id,n.A)},m={id:"edit",displayName:"Rename profile",access:l.US.SETTINGS_EDIT,icon:s.A.EDIT,input:e=>({approveCaption:"Rename",content:"Enter new name for the profile {{item.name}}",inputProps:{placeholder:"Enter name",defaultValue:e.name,required:!0}}),handler:({itemData:e},t)=>o.A.patch(`${a.A.PROFILES_URL}/${e.id}`,{name:t})},u={id:"default",displayName:"Set as default",access:l.US.SETTINGS_EDIT,filter:({itemData:e})=>!e.default,icon:s.A.DEFAULT,handler:({itemData:e})=>o.A.post(`${a.A.PROFILES_URL}/${e.id}/default`)},A={id:"remove",displayName:"Remove profile",access:l.US.SETTINGS_EDIT,icon:s.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the profile {{item.name}}?",approveCaption:"Remove profile",rejectCaption:"Don't remove"},handler:({itemData:e})=>o.A.delete(a.A.PROFILES_URL+"/"+e.id)},f={browse:p,divider:d.o,edit:m,default:u,remove:A},E={moduleId:c.KV.SETTINGS,subId:"profile"},y={moduleData:E,actions:f}},86818:(e,t,i)=>{i.d(t,{A:()=>r});const o="share_profiles",r={MODULE_URL:o,PROFILES_URL:o,PROFILE_ADDED:"share_profile_added",PROFILE_UPDATED:"share_profile_updated",PROFILE_REMOVED:"share_profile_removed",HIDDEN_PROFILE_ID:1}},53632:(e,t,i)=>{i.d(t,{A:()=>n});var o=i(74848),r=i(96540);function n(e,t=60){class i extends r.Component{constructor(){super(...arguments),this.scheduleComponentRefresh=()=>{this.redrawTimeout=window.setTimeout((()=>{this.forceUpdate(),this.scheduleComponentRefresh()}),1e3*t)}}componentDidMount(){this.scheduleComponentRefresh()}componentWillUnmount(){clearTimeout(this.redrawTimeout)}render(){return(0,o.jsx)(e,Object.assign({},this.props))}}return i}},71299:(e,t,i)=>{i.d(t,{A:()=>l,T:()=>s});var o=i(2543),r=i(86818),n=i(13546),a=i(98573);const s=e=>({id:e.id,name:e.str}),l=function(e,t,i,s=!0){return(0,n.A)(e,(0,o.merge)(i,{urls:{profiles:r.A.PROFILES_URL},dataConverters:{profiles:(e,{t:i})=>{const o=e.filter((e=>t||e.id!==r.A.HIDDEN_PROFILE_ID)).map((e=>((e,t)=>{let i=e.str;return s&&e.id!==r.A.HIDDEN_PROFILE_ID&&(i+=` (${(0,a.Xq)(e.size,t)})`),Object.assign(Object.assign({},e),{str:i})})(e,i)));return o}},onSocketConnected:(e,{refetchData:t})=>{e(r.A.MODULE_URL,r.A.PROFILE_ADDED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_UPDATED,(()=>t())),e(r.A.MODULE_URL,r.A.PROFILE_REMOVED,(()=>t()))}}))}},28121:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ye});var o=i(74848),r=i(96540),n=i(22005),a=i.n(n),s=i(52267);const l="share_roots",c=l,d=l,h=a().createStore({_viewName:"share_root_view",_apiUrl:c,mixins:[(0,s.A)("path")]});var p=i(22373),m=i(44247),u=i(68465),A=i(75662),f=i(42191),E=i(4425),y=i(65385),v=i(71299),S=i(32811),R=i(32728),T=i(51766),I=i(33968),_=i(94413),D=i(59315),O=i(13712),w=i(85072),L=i.n(w),g=i(97825),x=i.n(g),N=i(77659),P=i.n(N),U=i(55056),b=i.n(U),C=i(10540),j=i.n(C),F=i(41113),V=i.n(F),H=i(39291),k={};k.styleTagTransform=V(),k.setAttributes=b(),k.insert=P().bind(null,"head"),k.domAPI=x(),k.insertStyleElement=j(),L()(H.A,k),H.A&&H.A.locals&&H.A.locals;var G=i(86038),M=i(47456),$=i(32389);const K=[{key:"path",title:"Path",type:G.OP.DIRECTORY_PATH},{key:"virtual_name",title:"Virtual name",type:G.OP.STRING,help:"Directories with identical virtual names will be merged in filelist"},{key:"profiles",type:G.OP.LIST,item_type:G.OP.NUMBER,title:"Share profiles",help:"New share profiles can be created from application settings"},{key:"incoming",title:"Incoming",type:G.OP.BOOLEAN}];class B extends r.Component{constructor(e){super(e),this.isNew=()=>!this.props.rootEntry,this.onFieldChanged=(e,t,i)=>{if(e.includes("path")){const e={virtual_name:t.path?(0,I.ap)(t.path):void 0};return Promise.resolve(e)}return null},this.save=()=>this.form.save(),this.onSave=e=>this.isNew()?S.A.post(d,e):S.A.patch(`${d}/${this.props.rootEntry.id}`,e),this.onFieldSetting=(e,t,i)=>{"path"===e?(t.disabled=!this.isNew(),t.config=Object.assign({}||t.config,{historyId:D.A.LOCATION_DOWNLOAD})):"virtual_name"===e&&(t.factory=T.Ay.form.Textbox,t.template=O.I9,t.config={suggestionGetter:()=>this.props.virtualNames})},this.fieldDefinitions=(0,M.Nn)(K,e.shareT);const t=this.fieldDefinitions.find((e=>"profiles"===e.key));Object.assign(t,{options:e.profiles.map(v.T),default_value:[e.profiles.find((e=>e.default)).id]})}render(){const e=this.props,{rootEntry:t,shareT:i}=e,r=function(e,t){var i={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(i[o[r]]=e[o[r]])}return i}(e,["rootEntry","shareT"]),n=i.translate(this.isNew()?"Add share directory":"Edit share directory");return(0,o.jsxs)(A.A,Object.assign({className:"share-directory",title:n,onApprove:this.save,closable:!1,icon:E.A.FOLDER},r,{children:[(0,o.jsx)(R.A,{title:i.translate("Hashing information"),icon:E.A.INFO,description:(0,o.jsx)($.x6,{i18nKey:i.toI18nKey("hashingInformationDesc"),children:(0,o.jsx)("p",{children:"New files will appear in share only after they have finished hashing (the client has calculated checksums for them). Information about hashing progress will be posted to the event log."})})}),(0,o.jsx)(_.A,{ref:e=>this.form=e,fieldDefinitions:this.fieldDefinitions,onFieldChanged:this.onFieldChanged,onFieldSetting:this.onFieldSetting,onSave:this.onSave,sourceValue:t,location:this.props.location})]}))}}B.displayName="ShareDirectoryDialog";const z=(0,y.A)((0,v.A)(B,!1,{urls:{virtualNames:f.A.GROUPED_ROOTS_GET_URL,rootEntry:({params:e},t)=>e.directoryId?t.get(`${d}/${e.directoryId}`):Promise.resolve(void 0)},dataConverters:{virtualNames:e=>e.map((e=>e.name),[])}}),"/directories/:directoryId?");var W=i(31104),q=i(19247),X=i(27725),Y=i(36995),J=i(42695);const Z=(0,r.memo)((function(e){const{t}=(0,$.Bd)(),i={str:(0,J.Tl)("All profiles",t,"table.filter"),id:null},[n,a]=(0,r.useState)(i),s=t=>{e.onFilterUpdated(t.id),a(t)};return(0,o.jsx)(W.A,{className:"top right pointing",caption:n.str,triggerIcon:"filter",button:!0,children:(0,o.jsx)(q.A,{caption:(0,J.Tl)("Filter by profile",t,"table.filter"),icon:E.A.FILTER,children:[i,...e.profiles].map((e=>((e,t,i)=>(0,o.jsx)(X.A,{active:i.id===e.id,onClick:()=>t(e),children:e.str},e.id))(e,s,n)))})})})),Q=(0,v.A)((0,Y.A)(Z,"profiles"),!1);var ee=i(71352),te=i(53632),ie=i(98573),oe=i(99347),re=i(67749),ne=i(59548),ae=i(36076),se=i(83994);const le=(0,te.A)((({rowDataGetter:e,cellData:t,t:i})=>{const r=e().status;return r.id!==G.hZ.NORMAL?(0,o.jsxs)("div",{style:{display:"flex"},children:[(0,o.jsx)(se.A,{icon:E.A.CANCEL,color:"red",size:"large",onClick:()=>{const t=e().status.refresh_task_id;t&&(0,ae.bd)((()=>(0,ne.Lt)(t)),i)}}),(0,o.jsx)(oe.A,{size:"small",inline:!0,text:r.str})]}):(0,o.jsxs)("div",{children:[(0,o.jsx)(se.A,{icon:E.A.REFRESH_COLORED,size:"large",onClick:()=>(0,ae.bd)((()=>(0,ne.sf)([e().path])),i)}),0===t?(0,J.Tl)("Unknown",i,re.KV.SHARE):(0,ie.fw)(t)]})}));var ce=i(41860),de=i(39115),he=i(29112);i(91510),i(94899);const pe={id:"create",displayName:"Add directory",access:G.US.SETTINGS_EDIT,icon:E.A.CREATE,handler:({navigate:e})=>{e("directories")}},me={edit:{id:"edit",displayName:"Edit directory",access:G.US.SETTINGS_EDIT,icon:E.A.EDIT,handler:({itemData:e,navigate:t})=>{t(`directories/${e.id}`)}},remove:{id:"remove",displayName:"Remove directory",access:G.US.SETTINGS_EDIT,icon:E.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the directory {{item.virtual_name}} from share? It will be removed from all share profiles.",approveCaption:"Remove directory",rejectCaption:"Don't remove"},handler:({itemData:e})=>S.A.delete(d+"/"+e.id)}},ue={moduleId:re.KV.SHARE,subId:"root"},Ae={moduleData:ue,actions:me},fe={actions:{create:pe},moduleData:ue};class Ee extends r.Component{constructor(){super(...arguments),this.shareT=(0,J.lw)(this.props.t,re.KV.SHARE)}render(){const{translate:e}=this.shareT,t=ce.A.hasAccess(G.US.SETTINGS_EDIT);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.A,{store:h,customFilter:Q,footerData:(0,o.jsx)(ee.Wy,{className:"top left pointing",caption:e("Actions..."),actions:fe,header:e("Share actions"),triggerIcon:"chevron up",ids:["create"],button:!0,children:(0,o.jsx)(ee.Wy,{actions:he.t6,ids:["refresh"]})}),moduleId:re.KV.SHARE,children:[(0,o.jsx)(u.VP,{name:"Path",width:200,columnKey:"path",cell:(0,o.jsx)(m.tC,{actions:Ae,remoteMenuId:de.Ay.SHARE_ROOT}),flexGrow:10}),(0,o.jsx)(u.VP,{name:"Size",width:60,columnKey:"size",cell:(0,o.jsx)(m.us,{}),flexGrow:2}),(0,o.jsx)(u.VP,{name:"Content",width:150,columnKey:"type",hideWidth:1e3}),(0,o.jsx)(u.VP,{name:"Virtual name",width:120,columnKey:"virtual_name",flexGrow:5}),(0,o.jsx)(u.VP,{name:"Profiles",width:65,columnKey:"profiles"}),(0,o.jsx)(u.VP,{name:"Last refreshed",width:80,flexGrow:3,columnKey:"last_refresh_time",cell:t?(0,o.jsx)(le,{}):(0,o.jsx)(m.Jo,{})})]}),(0,o.jsx)(z,{shareT:this.shareT})]})}}Ee.displayName="Share";const ye=(0,$.CI)()(Ee)},88569:(e,t,i)=>{i.d(t,{H:()=>s,U:()=>a});var o=i(41860),r=i(41110),n=function(e,t,i,o){return new(i||(i=Promise))((function(r,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};const a=e=>n(void 0,void 0,void 0,(function*(){try{return(yield(0,r.F)(`${getBasePath()}temp`,{method:"POST",headers:{"X-Authorization":o.A.authToken,Authorization:o.A.authToken},body:e})).headers.get("Location")}catch(e){throw e}})),s=(e,t,i)=>n(void 0,void 0,void 0,(function*(){try{const n=yield(0,r.F)((e=>`${window.location.origin}${getBasePath()}proxy?url=${encodeURIComponent(e)}`)(e),Object.assign({headers:{"X-Authorization":o.A.authToken,"Cache-Control":"no-store, must-revalidate, max-age=0"}},i));return(yield t)?n.json():n.text()}catch(t){throw console.error(`CORS HTTP request failed (${e})`,t),t}}))},59548:(e,t,i)=>{i.d(t,{Lt:()=>d,eo:()=>s,sf:()=>l,t7:()=>c});var o=i(42191),r=i(32811),n=i(88569),a=i(86038);const s=(e,t,i)=>{return a=void 0,s=void 0,c=function*(){try{const a=yield(0,n.U)(e);return yield r.A.post(o.A.TEMP_SHARES_URL,{name:e.name,file_id:a,hub_url:t,cid:i})}catch(e){throw e}},new((l=void 0)||(l=Promise))((function(e,t){function i(e){try{r(c.next(e))}catch(e){t(e)}}function o(e){try{r(c.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof l?r:new l((function(e){e(r)}))).then(i,o)}r((c=c.apply(a,s||[])).next())}));var a,s,l,c},l=e=>r.A.post(o.A.REFRESH_PATHS_URL,{paths:e,priority:a.DH.MANUAL}),c=e=>r.A.post(o.A.REFRESH_VIRTUAL_URL,{path:e}),d=e=>r.A.delete(`${o.A.REFRESH_TASKS_URL}/${e}`)}}]);
|
|
2
|
+
//# sourceMappingURL=share.6efce937acbd036d089d.chunk.js.map
|
|
Binary file
|
package/dist/js/{share.a35d32796acde4fc3d59.chunk.js.map → share.6efce937acbd036d089d.chunk.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js/share.a35d32796acde4fc3d59.chunk.js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AoB,CAC/BC,EACAC,EACA1J,IACG,OAAD,6BACF,IAGE,MAAM2J,QAAY,OAfA,CAACF,GACJ,GACfvL,OAAO7B,SAASuN,SACfX,0BAA0BY,mBAAmBJ,KAYlBK,CAAcL,GAAM,OAAF,QAC5CN,QAAS,CAEP,kBAAmB,IAAWC,UAK9B,gBAAiB,yCAEhBpJ,IAIL,aADoB0J,GAAUC,EAAII,OAASJ,EAAIvC,MAEjD,CAAE,MAAOmC,GAEP,MADAS,QAAQC,MAAM,6BAA6BR,KAAQF,GAC7CA,CACR,CACF,G,+GC9CO,MAAMW,EAAgB,CAC3BlB,EACAmB,EACAC,KACkC,O,OAAD,E,OAAA,E,EAAA,YAEjC,IACE,MAAMC,QAAe,OAAerB,GAWpC,aAVkB,IAAclP,KAC9B,IAAewQ,gBACf,CACEvO,KAAMiN,EAAKjN,KACXwO,QAASF,EACTG,QAASL,EACTC,OAKN,CAAE,MAAOb,GACP,MAAMA,CACR,CACF,E,YAlBmC,K,6QAkBlC,EASYkB,EAAgBC,GACpB,IAAc5Q,KAAK,IAAe6Q,kBAAmB,CAC1DD,QACAE,SAAU,KAA4BC,SAI7BC,EAAkB3P,GACtB,IAAcrB,KAAK,IAAeiR,oBAAqB,CAC5D5P,SAIS6P,EAAoB1R,GACxB,IAAc0D,OAAO,GAAG,IAAeiO,qBAAqB3R,I","sources":["webpack://airdcpp-webui/./src/routes/Share/style.css","webpack://airdcpp-webui/./src/actions/ui/share/ShareActions.ts","webpack://airdcpp-webui/./src/actions/ui/share/ShareExcludeActions.ts","webpack://airdcpp-webui/./src/actions/ui/share/ShareProfileActions.ts","webpack://airdcpp-webui/./src/constants/ShareProfileConstants.ts","webpack://airdcpp-webui/./src/decorators/RedrawDecorator.tsx","webpack://airdcpp-webui/./src/decorators/ShareProfileDecorator.tsx","webpack://airdcpp-webui/./src/constants/ShareRootConstants.ts","webpack://airdcpp-webui/./src/stores/ShareRootStore.js","webpack://airdcpp-webui/./src/routes/Share/style.css?7048","webpack://airdcpp-webui/./src/routes/Share/components/ShareDirectoryDialog.tsx","webpack://airdcpp-webui/./src/components/table/ShareProfileFilter.tsx","webpack://airdcpp-webui/./src/routes/Share/components/RefreshCell.tsx","webpack://airdcpp-webui/./src/actions/ui/share/ShareRootActions.ts","webpack://airdcpp-webui/./src/routes/Share/components/Share.tsx","webpack://airdcpp-webui/./src/services/HttpService.ts","webpack://airdcpp-webui/./src/services/api/ShareApi.ts"],"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, `.share-directory .Select {\n margin-bottom: 0px;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Share/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,kBAAkB;AACpB\",\"sourcesContent\":[\".share-directory .Select {\\n margin-bottom: 0px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import SocketService from 'services/SocketService';\n\nimport ShareConstants from 'constants/ShareConstants';\nimport IconConstants from 'constants/IconConstants';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nconst handleRefresh = () => {\n return SocketService.post(ShareConstants.REFRESH_URL);\n};\n\nexport const ShareRefreshAction = {\n id: 'refreshAll',\n displayName: 'Refresh all',\n access: API.AccessEnum.SETTINGS_EDIT,\n icon: IconConstants.REFRESH_COLORED,\n handler: handleRefresh,\n};\n\nconst ShareActions: UI.ActionListType<undefined> = {\n refresh: ShareRefreshAction,\n};\n\nexport const ShareActionModule = {\n moduleId: UI.Modules.SHARE,\n};\n\nexport const ShareActionMenu = {\n moduleData: ShareActionModule,\n actions: ShareActions,\n};\n","import SocketService from 'services/SocketService';\r\n\r\nimport ShareConstants from 'constants/ShareConstants';\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 handleAdd: UI.ActionHandler<void> = ({ navigate }) => {\r\n navigate(`browse`);\r\n};\r\n\r\nconst handleRemove: UI.ActionHandler<string> = ({ itemData: path }) => {\r\n return SocketService.post(ShareConstants.EXCLUDES_REMOVE_URL, { path });\r\n};\r\n\r\nexport const ShareExcludeAddAction = {\r\n id: 'add',\r\n displayName: 'Add path',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleAdd,\r\n};\r\n\r\nexport const ShareExcludeRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove path',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the excluded path {{item}}?',\r\n approveCaption: 'Remove path',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst ShareExcludeEditActions: UI.ActionListType<string> = {\r\n remove: ShareExcludeRemoveAction,\r\n};\r\n\r\nexport const ShareExcludeActionModule = {\r\n moduleId: UI.Modules.SETTINGS,\r\n subId: 'shareExclude',\r\n};\r\n\r\nexport const ShareExcludeEditMenu = {\r\n moduleData: ShareExcludeActionModule,\r\n actions: ShareExcludeEditActions,\r\n};\r\n","import SocketService from 'services/SocketService';\r\n\r\nimport FilelistSessionActions from 'actions/reflux/FilelistSessionActions';\r\nimport FilelistSessionStore from 'stores/FilelistSessionStore';\r\n\r\nimport ShareProfileConstants from 'constants/ShareProfileConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\nimport { MENU_DIVIDER } from 'constants/ActionConstants';\r\n\r\ntype Filter = UI.ActionFilter<API.ShareProfile>;\r\nconst notDefault: Filter = ({ itemData: profile }) => !profile.default;\r\n\r\nconst handleCreate: UI.ActionHandler<void> = (data, name: string) => {\r\n return SocketService.post(ShareProfileConstants.PROFILES_URL, { name: name });\r\n};\r\n\r\ntype Handler = UI.ActionHandler<API.ShareProfile>;\r\nconst handleDefault: Handler = ({ itemData: profile }) => {\r\n return SocketService.post(\r\n `${ShareProfileConstants.PROFILES_URL}/${profile.id}/default`,\r\n );\r\n};\r\n\r\nconst handleEdit: Handler = ({ itemData: profile }, name: string) => {\r\n return SocketService.patch(`${ShareProfileConstants.PROFILES_URL}/${profile.id}`, {\r\n name: name,\r\n });\r\n};\r\n\r\nconst handleRemove: Handler = ({ itemData: profile }) => {\r\n return SocketService.delete(ShareProfileConstants.PROFILES_URL + '/' + profile.id);\r\n};\r\n\r\nconst handleBrowse: Handler = ({ itemData: profile, location }) => {\r\n return FilelistSessionActions.ownList(location, profile.id, FilelistSessionStore);\r\n};\r\n\r\nexport const ShareProfileCreateAction = {\r\n id: 'create',\r\n displayName: 'Add profile',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.CREATE,\r\n input: {\r\n approveCaption: 'Create',\r\n content: 'Enter name for the profile',\r\n inputProps: {\r\n placeholder: 'Enter name',\r\n required: true,\r\n },\r\n },\r\n handler: handleCreate,\r\n};\r\n\r\nexport const ShareProfileBrowseAction = {\r\n id: 'browse',\r\n displayName: 'Browse files',\r\n access: API.AccessEnum.FILELISTS_VIEW,\r\n icon: IconConstants.FILELIST,\r\n handler: handleBrowse,\r\n};\r\n\r\nexport const ShareProfileEditAction = {\r\n id: 'edit',\r\n displayName: 'Rename profile',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.EDIT,\r\n input: (profile: API.ShareProfile) => ({\r\n approveCaption: 'Rename',\r\n content: 'Enter new name for the profile {{item.name}}',\r\n inputProps: {\r\n placeholder: 'Enter name',\r\n defaultValue: profile.name,\r\n required: true,\r\n },\r\n }),\r\n handler: handleEdit,\r\n};\r\n\r\nexport const ShareProfileSetDefaultAction = {\r\n id: 'default',\r\n displayName: 'Set as default',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n filter: notDefault,\r\n icon: IconConstants.DEFAULT,\r\n handler: handleDefault,\r\n};\r\n\r\nexport const ShareProfileRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove profile',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the profile {{item.name}}?',\r\n approveCaption: 'Remove profile',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst ShareProfileEditActions: UI.ActionListType<API.ShareProfile> = {\r\n browse: ShareProfileBrowseAction,\r\n divider: MENU_DIVIDER,\r\n edit: ShareProfileEditAction,\r\n default: ShareProfileSetDefaultAction,\r\n remove: ShareProfileRemoveAction,\r\n};\r\n\r\nexport const ShareProfileActionModule = {\r\n moduleId: UI.Modules.SETTINGS,\r\n subId: 'profile',\r\n};\r\n\r\nexport const ShareProfileEditMenu = {\r\n moduleData: ShareProfileActionModule,\r\n actions: ShareProfileEditActions,\r\n};\r\n","const MODULE_URL = 'share_profiles';\nexport default {\n MODULE_URL: MODULE_URL,\n PROFILES_URL: MODULE_URL,\n\n PROFILE_ADDED: 'share_profile_added',\n PROFILE_UPDATED: 'share_profile_updated',\n PROFILE_REMOVED: 'share_profile_removed',\n\n HIDDEN_PROFILE_ID: 1,\n};\n","import * as React from 'react';\r\n\r\nexport default function <PropsT>(\r\n Component: React.ComponentType<PropsT>,\r\n redrawIntervalSeconds = 60,\r\n) {\r\n class RedrawDecorator extends React.Component<PropsT> {\r\n redrawTimeout: number | undefined;\r\n\r\n componentDidMount() {\r\n this.scheduleComponentRefresh();\r\n }\r\n\r\n componentWillUnmount() {\r\n clearTimeout(this.redrawTimeout);\r\n }\r\n\r\n scheduleComponentRefresh = () => {\r\n this.redrawTimeout = window.setTimeout(() => {\r\n this.forceUpdate();\r\n this.scheduleComponentRefresh();\r\n }, redrawIntervalSeconds * 1000);\r\n };\r\n\r\n render() {\r\n return <Component {...this.props} />;\r\n }\r\n }\r\n\r\n return RedrawDecorator;\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 { formatSize } from 'utils/ValueFormat';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\ninterface ShareProfileDecoratorDataProps {\r\n profiles: API.ShareProfile[];\r\n}\r\n\r\nexport const profileToEnumValue = (profile: API.ShareProfile) => {\r\n return {\r\n id: profile.id,\r\n name: profile.str,\r\n };\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 addSize = true,\r\n) {\r\n const convertProfile = (\r\n profile: API.ShareProfile,\r\n t: UI.TranslateF,\r\n ): API.ShareProfile => {\r\n let str = profile.str;\r\n if (addSize && profile.id !== ShareProfileConstants.HIDDEN_PROFILE_ID) {\r\n str += ` (${formatSize(profile.size, t)})`;\r\n }\r\n\r\n return {\r\n ...profile,\r\n str,\r\n };\r\n };\r\n\r\n const convertProfiles: DataConverter<PropsT> = (data: API.ShareProfile[], { t }) => {\r\n const profiles = data\r\n .filter((p) => listHidden || p.id !== ShareProfileConstants.HIDDEN_PROFILE_ID)\r\n .map((p) => convertProfile(p, t));\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_roots';\n\nexport default {\n MODULE_URL: MODULE_URL,\n ROOTS_URL: MODULE_URL,\n\n CREATED: 'share_root_created',\n UPDATED: 'share_root_updated',\n REMOVED: 'share_root_removed',\n};\n","import Reflux from 'reflux';\n\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\nimport ShareRootConstants from 'constants/ShareRootConstants';\n\nexport default Reflux.createStore({\n _viewName: 'share_root_view',\n _apiUrl: ShareRootConstants.MODULE_URL,\n mixins: [ViewStoreMixin('path')],\n});\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 { Component } from 'react';\r\nimport Modal from 'components/semantic/Modal';\r\n\r\nimport ShareConstants from 'constants/ShareConstants';\r\nimport ShareRootConstants from 'constants/ShareRootConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\n\r\nimport ShareProfileDecorator, {\r\n profileToEnumValue,\r\n ShareProfileDecoratorChildProps,\r\n} from 'decorators/ShareProfileDecorator';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport Message from 'components/semantic/Message';\r\n\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport { getLastDirectory } from 'utils/FileUtils';\r\n\r\nimport Form, {\r\n FormSaveHandler,\r\n FormFieldSettingHandler,\r\n FormFieldChangeHandler,\r\n} from 'components/form/Form';\r\nimport FilesystemConstants from 'constants/FilesystemConstants';\r\nimport { AutoSuggestField } from 'components/form/fields';\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 { ShareRootEntryBase } from 'types/api';\r\nimport { translateForm } from 'utils/FormUtils';\r\nimport { Trans } from 'react-i18next';\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'path',\r\n title: 'Path',\r\n type: API.SettingTypeEnum.DIRECTORY_PATH,\r\n },\r\n {\r\n key: 'virtual_name',\r\n title: 'Virtual name',\r\n type: API.SettingTypeEnum.STRING,\r\n help: 'Directories with identical virtual names will be merged in filelist',\r\n },\r\n {\r\n key: 'profiles',\r\n type: API.SettingTypeEnum.LIST,\r\n item_type: API.SettingTypeEnum.NUMBER,\r\n title: 'Share profiles',\r\n help: 'New share profiles can be created from application settings',\r\n },\r\n {\r\n key: 'incoming',\r\n title: 'Incoming',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n },\r\n];\r\n\r\nexport interface ShareDirectoryDialogProps {\r\n shareT: UI.ModuleTranslator;\r\n}\r\n\r\nexport interface DataProps extends ShareProfileDecoratorChildProps {\r\n virtualNames: string[];\r\n rootEntry?: API.ShareRootEntryBase;\r\n}\r\n\r\ninterface Entry extends ShareRootEntryBase, UI.FormValueMap {}\r\n\r\n/*interface RouteProps {\r\n directoryId: string;\r\n}*/\r\n\r\ntype Props = ShareDirectoryDialogProps & DataProps & ModalRouteDecoratorChildProps;\r\n\r\nclass ShareDirectoryDialog extends Component<Props> {\r\n static displayName = 'ShareDirectoryDialog';\r\n\r\n fieldDefinitions: UI.FormFieldDefinition[];\r\n form: Form<Entry>;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n\r\n this.fieldDefinitions = translateForm(Fields, props.shareT);\r\n\r\n // Share profiles shouldn't be translated...\r\n const shareProfileDefinitions = this.fieldDefinitions.find(\r\n (def) => def.key === 'profiles',\r\n )!;\r\n Object.assign(shareProfileDefinitions, {\r\n options: props.profiles.map(profileToEnumValue),\r\n default_value: [props.profiles.find((profile) => profile.default)!.id],\r\n });\r\n }\r\n\r\n isNew = () => {\r\n return !this.props.rootEntry;\r\n };\r\n\r\n onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n if (id.includes('path')) {\r\n const mergeFields = {\r\n virtual_name: !!value.path ? getLastDirectory(value.path) : undefined,\r\n };\r\n\r\n return Promise.resolve(mergeFields);\r\n }\r\n\r\n return null;\r\n };\r\n\r\n save = () => {\r\n return this.form.save();\r\n };\r\n\r\n onSave: FormSaveHandler<Entry> = (changedFields) => {\r\n if (this.isNew()) {\r\n return SocketService.post(ShareRootConstants.ROOTS_URL, changedFields);\r\n }\r\n\r\n return SocketService.patch(\r\n `${ShareRootConstants.ROOTS_URL}/${this.props.rootEntry!.id}`,\r\n changedFields,\r\n );\r\n };\r\n\r\n onFieldSetting: FormFieldSettingHandler<Entry> = (id, fieldOptions, formValue) => {\r\n if (id === 'path') {\r\n fieldOptions.disabled = !this.isNew();\r\n fieldOptions.config = Object.assign({} || fieldOptions.config, {\r\n historyId: FilesystemConstants.LOCATION_DOWNLOAD,\r\n });\r\n } else if (id === 'virtual_name') {\r\n fieldOptions.factory = t.form.Textbox;\r\n fieldOptions.template = AutoSuggestField;\r\n fieldOptions.config = {\r\n suggestionGetter: () => this.props.virtualNames,\r\n };\r\n }\r\n };\r\n\r\n render() {\r\n const { rootEntry, shareT, ...other } = this.props;\r\n const title = shareT.translate(\r\n this.isNew() ? 'Add share directory' : 'Edit share directory',\r\n );\r\n return (\r\n <Modal\r\n className=\"share-directory\"\r\n title={title}\r\n onApprove={this.save}\r\n closable={false}\r\n icon={IconConstants.FOLDER}\r\n {...other}\r\n >\r\n <Message\r\n title={shareT.translate('Hashing information')}\r\n icon={IconConstants.INFO}\r\n description={\r\n <Trans i18nKey={shareT.toI18nKey('hashingInformationDesc')}>\r\n <p>\r\n New files will appear in share only after they have finished hashing (the\r\n client has calculated checksums for them). Information about hashing\r\n progress will be posted to the event log.\r\n </p>\r\n </Trans>\r\n }\r\n />\r\n <Form<Entry>\r\n ref={(c) => (this.form = c!)}\r\n fieldDefinitions={this.fieldDefinitions}\r\n onFieldChanged={this.onFieldChanged}\r\n onFieldSetting={this.onFieldSetting}\r\n onSave={this.onSave}\r\n sourceValue={rootEntry as Entry}\r\n location={this.props.location}\r\n />\r\n </Modal>\r\n );\r\n }\r\n}\r\n\r\nexport default ModalRouteDecorator<ShareDirectoryDialogProps>(\r\n ShareProfileDecorator<Omit<Props, keyof DataProps>>(ShareDirectoryDialog, false, {\r\n urls: {\r\n virtualNames: ShareConstants.GROUPED_ROOTS_GET_URL,\r\n rootEntry: ({ params }, socket) => {\r\n if (!params.directoryId) {\r\n return Promise.resolve(undefined);\r\n }\r\n\r\n return socket.get(`${ShareRootConstants.ROOTS_URL}/${params.directoryId}`);\r\n },\r\n },\r\n dataConverters: {\r\n virtualNames: (data: API.GroupedPath[]) => data.map((item) => item.name, []),\r\n },\r\n }),\r\n '/directories/:directoryId?',\r\n);\r\n","//import PropTypes from 'prop-types';\r\nimport { memo, useState } from 'react';\r\n\r\nimport SectionedDropdown from 'components/semantic/SectionedDropdown';\r\nimport MenuSection from 'components/semantic/MenuSection';\r\nimport MenuItemLink from 'components/semantic/MenuItemLink';\r\n\r\nimport ShareProfileDecorator, {\r\n ShareProfileDecoratorChildProps,\r\n} from 'decorators/ShareProfileDecorator';\r\nimport TableFilterDecorator, {\r\n TableFilterDecoratorChildProps,\r\n TableFilterDecoratorProps,\r\n} from 'decorators/TableFilterDecorator';\r\n\r\nimport * as API from 'types/api';\r\nimport { translate } from 'utils/TranslationUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\ninterface ShareProfileItem {\r\n id: null | number;\r\n str: string;\r\n}\r\n\r\nexport interface ShareProfileFilterProps {}\r\n\r\ntype Props = ShareProfileFilterProps &\r\n TableFilterDecoratorChildProps &\r\n ShareProfileDecoratorChildProps;\r\n\r\nconst getDropdownItem = (\r\n profile: ShareProfileItem,\r\n onClick: (p: ShareProfileItem) => void,\r\n selectedProfile: ShareProfileItem,\r\n) => {\r\n return (\r\n <MenuItemLink\r\n key={profile.id as number}\r\n active={selectedProfile.id === profile.id}\r\n onClick={() => onClick(profile)}\r\n >\r\n {profile.str}\r\n </MenuItemLink>\r\n );\r\n};\r\n\r\nconst ShareProfileFilter = memo<Props>(function ShareProfileFilter(props) {\r\n const { t } = useTranslation();\r\n\r\n const defaultItem: ShareProfileItem = {\r\n str: translate('All profiles', t, 'table.filter'),\r\n id: null,\r\n };\r\n\r\n const [selectedProfile, setSelectedProfile] = useState<ShareProfileItem>(defaultItem);\r\n\r\n const onClick = (profile: API.ShareProfile) => {\r\n props.onFilterUpdated(profile.id);\r\n setSelectedProfile(profile);\r\n };\r\n\r\n return (\r\n <SectionedDropdown\r\n className=\"top right pointing\"\r\n caption={selectedProfile.str}\r\n triggerIcon=\"filter\"\r\n button={true}\r\n >\r\n <MenuSection\r\n caption={translate('Filter by profile', t, 'table.filter')}\r\n icon={IconConstants.FILTER}\r\n >\r\n {[defaultItem, ...props.profiles].map((p) =>\r\n getDropdownItem(p, onClick, selectedProfile),\r\n )}\r\n </MenuSection>\r\n </SectionedDropdown>\r\n );\r\n});\r\n\r\nexport default ShareProfileDecorator<ShareProfileFilterProps & TableFilterDecoratorProps>(\r\n TableFilterDecorator<ShareProfileFilterProps & ShareProfileDecoratorChildProps>(\r\n ShareProfileFilter,\r\n 'profiles',\r\n ),\r\n false,\r\n);\r\n","import * as React from 'react';\n\nimport RedrawDecorator from 'decorators/RedrawDecorator';\nimport { formatRelativeTime } from 'utils/ValueFormat';\nimport Loader from 'components/semantic/Loader';\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport { translate } from 'utils/TranslationUtils';\nimport { abortRefreshTask, refreshPaths } from 'services/api/ShareApi';\nimport { runBackgroundSocketAction } from 'utils/ActionUtils';\nimport Icon from 'components/semantic/Icon';\nimport IconConstants from 'constants/IconConstants';\n\ninterface RefreshCellProps extends RowWrapperCellChildProps<number, API.ShareRootEntry> {}\n\nconst RefreshCell: React.FC<RefreshCellProps> = ({ rowDataGetter, cellData, t }) => {\n const state = rowDataGetter!().status;\n if (state.id !== API.ShareRootStatusEnum.NORMAL) {\n return (\n <div style={{ display: 'flex' }}>\n <Icon\n icon={IconConstants.CANCEL}\n color=\"red\"\n size=\"large\"\n onClick={() => {\n const refreshTaskId = rowDataGetter!().status.refresh_task_id;\n if (!!refreshTaskId) {\n runBackgroundSocketAction(() => abortRefreshTask(refreshTaskId), t!);\n }\n }}\n />\n <Loader size=\"small\" inline={true} text={state.str} />\n </div>\n );\n }\n\n return (\n <div>\n <Icon\n icon={IconConstants.REFRESH_COLORED}\n size=\"large\"\n onClick={() =>\n runBackgroundSocketAction(() => refreshPaths([rowDataGetter!().path]), t!)\n }\n />\n {cellData === 0\n ? translate('Unknown', t!, UI.Modules.SHARE)\n : formatRelativeTime(cellData!)}\n </div>\n );\n};\n\nexport default RedrawDecorator(RefreshCell);\n","import SocketService from 'services/SocketService';\r\n\r\nimport ShareRootConstants from 'constants/ShareRootConstants';\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<void> = ({ navigate }) => {\r\n navigate(`directories`);\r\n};\r\n\r\ntype Handler = UI.ActionHandler<API.ShareRootEntry>;\r\nconst handleEdit: Handler = ({ itemData: root, navigate }) => {\r\n navigate(`directories/${root.id}`);\r\n};\r\n\r\nconst handleRemove: Handler = ({ itemData: root }) => {\r\n return SocketService.delete(ShareRootConstants.ROOTS_URL + '/' + root.id);\r\n};\r\n\r\nexport const ShareRootCreateAction = {\r\n id: 'create',\r\n displayName: 'Add directory',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleCreate,\r\n};\r\n\r\nexport const ShareRootEditAction = {\r\n id: 'edit',\r\n displayName: 'Edit directory',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.EDIT,\r\n handler: handleEdit,\r\n};\r\n\r\nexport const ShareRootRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove directory',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content:\r\n // eslint-disable-next-line max-len\r\n 'Are you sure that you want to remove the directory {{item.virtual_name}} from share? It will be removed from all share profiles.',\r\n approveCaption: 'Remove directory',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst ShareRootEditActions: UI.ActionListType<API.ShareRootEntry> = {\r\n edit: ShareRootEditAction,\r\n remove: ShareRootRemoveAction,\r\n};\r\n\r\nexport const ShareRootActionModule = {\r\n moduleId: UI.Modules.SHARE,\r\n subId: 'root',\r\n};\r\n\r\nexport const ShareRootEditActionMenu = {\r\n moduleData: ShareRootActionModule,\r\n actions: ShareRootEditActions,\r\n};\r\n","import { Component } from 'react';\n\nimport ShareRootStore from 'stores/ShareRootStore';\n\nimport VirtualTable from 'components/table/VirtualTable';\nimport { SizeCell, DurationCell, FileActionCell } from 'components/table/Cell';\nimport { Column } from 'fixed-data-table-2';\n\nimport ShareDirectoryDialog from 'routes/Share/components/ShareDirectoryDialog';\nimport ShareProfileFilter from 'components/table/ShareProfileFilter';\n\nimport { ActionMenu } from 'components/action-menu';\nimport RefreshCell from 'routes/Share/components/RefreshCell';\n\nimport LoginStore from 'stores/LoginStore';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport { withTranslation, WithTranslation } from 'react-i18next';\nimport { getModuleT } from 'utils/TranslationUtils';\nimport MenuConstants from 'constants/MenuConstants';\nimport {\n ShareActionMenu,\n ShareRootActionModule,\n ShareRootCreateAction,\n ShareRootEditActionMenu,\n} from 'actions/ui/share';\n\nconst ShareRootCreateMenu = {\n actions: {\n create: ShareRootCreateAction,\n },\n moduleData: ShareRootActionModule,\n};\n\nclass Share extends Component<WithTranslation> {\n static displayName = 'Share';\n\n shareT = getModuleT(this.props.t, UI.Modules.SHARE);\n render() {\n const { translate } = this.shareT;\n const editAccess = LoginStore.hasAccess(API.AccessEnum.SETTINGS_EDIT);\n return (\n <>\n <VirtualTable\n store={ShareRootStore}\n customFilter={ShareProfileFilter}\n footerData={\n <ActionMenu\n className=\"top left pointing\"\n caption={translate('Actions...')}\n actions={ShareRootCreateMenu}\n header={translate('Share actions')}\n triggerIcon=\"chevron up\"\n ids={['create']}\n button={true}\n >\n <ActionMenu actions={ShareActionMenu} ids={['refresh']} />\n </ActionMenu>\n }\n moduleId={UI.Modules.SHARE}\n >\n <Column\n name=\"Path\"\n width={200}\n columnKey=\"path\"\n cell={\n <FileActionCell\n actions={ShareRootEditActionMenu}\n remoteMenuId={MenuConstants.SHARE_ROOT}\n />\n }\n flexGrow={10}\n />\n <Column\n name=\"Size\"\n width={60}\n columnKey=\"size\"\n cell={<SizeCell />}\n flexGrow={2}\n />\n <Column name=\"Content\" width={150} columnKey=\"type\" hideWidth={1000} />\n <Column\n name=\"Virtual name\"\n width={120}\n columnKey=\"virtual_name\"\n flexGrow={5}\n //hideWidth={600}\n />\n <Column name=\"Profiles\" width={65} columnKey=\"profiles\" />\n <Column\n name=\"Last refreshed\"\n width={80}\n flexGrow={3}\n columnKey=\"last_refresh_time\"\n cell={editAccess ? <RefreshCell /> : <DurationCell />}\n />\n </VirtualTable>\n <ShareDirectoryDialog shareT={this.shareT} />\n </>\n );\n }\n}\n\nexport default withTranslation()(Share);\n","import LoginStore from 'stores/LoginStore';\r\nimport { fetchData } from 'utils/HttpUtils';\r\n\r\nexport const uploadTempFile = async (file: File): Promise<string> => {\r\n // eslint-disable-next-line no-useless-catch\r\n try {\r\n const res = await fetchData(`${getBasePath()}temp`, {\r\n method: 'POST',\r\n headers: {\r\n // https://github.com/airdcpp-web/airdcpp-webclient/issues/330\r\n 'X-Authorization': LoginStore.authToken,\r\n\r\n Authorization: LoginStore.authToken,\r\n },\r\n body: file,\r\n });\r\n\r\n return res.headers.get('Location')!;\r\n } catch (e) {\r\n throw e;\r\n }\r\n};\r\n\r\nconst toCorsSafeUrl = (url: string) => {\r\n const proxyUrl = `${\r\n window.location.origin\r\n }${getBasePath()}proxy?url=${encodeURIComponent(url)}`;\r\n return proxyUrl;\r\n};\r\n\r\nexport const fetchCorsSafeData = async (\r\n url: string,\r\n isJSON: boolean,\r\n options?: RequestInit,\r\n) => {\r\n try {\r\n //console.log(`CORS HTTP request started (${url})`);\r\n\r\n const res = await fetchData(toCorsSafeUrl(url), {\r\n headers: {\r\n // https://github.com/airdcpp-web/airdcpp-webclient/issues/330\r\n 'X-Authorization': LoginStore.authToken,\r\n\r\n // Temp workaround for people upgrading from versions < 2.7.0\r\n // If the new UI was loaded before restarting the app, a cache expiration time of\r\n // one year would have been set for \"Not found\" errors...\r\n 'Cache-Control': 'no-store, must-revalidate, max-age=0',\r\n },\r\n ...options,\r\n });\r\n\r\n const data = (await isJSON) ? res.json() : res.text();\r\n return data;\r\n } catch (e) {\r\n console.error(`CORS HTTP request failed (${url})`, e);\r\n throw e;\r\n }\r\n};\r\n","import ShareConstants from 'constants/ShareConstants';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport { uploadTempFile } from '../HttpService';\r\n\r\nimport * as API from 'types/api';\r\n\r\nexport interface AddTempShareResponse {\r\n magnet: string;\r\n}\r\n\r\nexport const shareTempFile = async (\r\n file: File,\r\n hubUrl: string,\r\n cid: string | undefined,\r\n): Promise<AddTempShareResponse> => {\r\n // eslint-disable-next-line no-useless-catch\r\n try {\r\n const fileId = await uploadTempFile(file);\r\n const res = await SocketService.post<AddTempShareResponse>(\r\n ShareConstants.TEMP_SHARES_URL,\r\n {\r\n name: file.name,\r\n file_id: fileId,\r\n hub_url: hubUrl,\r\n cid,\r\n },\r\n );\r\n\r\n return res;\r\n } catch (e) {\r\n throw e;\r\n }\r\n};\r\n\r\nexport const refresh = (incoming: boolean) => {\r\n return SocketService.post(ShareConstants.REFRESH_URL, {\r\n incoming,\r\n priority: API.RefreshPriorityTypeEnum.MANUAL,\r\n });\r\n};\r\n\r\nexport const refreshPaths = (paths: string[]) => {\r\n return SocketService.post(ShareConstants.REFRESH_PATHS_URL, {\r\n paths,\r\n priority: API.RefreshPriorityTypeEnum.MANUAL,\r\n });\r\n};\r\n\r\nexport const refreshVirtual = (path: string) => {\r\n return SocketService.post(ShareConstants.REFRESH_VIRTUAL_URL, {\r\n path,\r\n });\r\n};\r\n\r\nexport const abortRefreshTask = (id: number) => {\r\n return SocketService.delete(`${ShareConstants.REFRESH_TASKS_URL}/${id}`);\r\n};\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","ShareRefreshAction","displayName","access","SETTINGS_EDIT","icon","REFRESH_COLORED","handler","post","REFRESH_URL","ShareActions","refresh","ShareActionModule","moduleId","SHARE","ShareActionMenu","moduleData","actions","ShareExcludeAddAction","CREATE","navigate","ShareExcludeEditActions","remove","REMOVE","confirmation","content","approveCaption","rejectCaption","itemData","path","EXCLUDES_REMOVE_URL","ShareExcludeActionModule","SETTINGS","subId","ShareExcludeEditMenu","ShareProfileCreateAction","input","inputProps","placeholder","required","data","name","PROFILES_URL","ShareProfileBrowseAction","FILELISTS_VIEW","FILELIST","profile","location","ownList","ShareProfileEditAction","EDIT","defaultValue","patch","ShareProfileSetDefaultAction","filter","default","DEFAULT","ShareProfileRemoveAction","delete","ShareProfileEditActions","browse","divider","edit","ShareProfileActionModule","ShareProfileEditMenu","MODULE_URL","PROFILE_ADDED","PROFILE_UPDATED","PROFILE_REMOVED","HIDDEN_PROFILE_ID","Component","redrawIntervalSeconds","RedrawDecorator","scheduleComponentRefresh","this","redrawTimeout","window","setTimeout","forceUpdate","componentDidMount","componentWillUnmount","clearTimeout","render","props","profileToEnumValue","str","listHidden","dataProviderDecoratorSettings","addSize","merge","urls","profiles","dataConverters","t","p","map","size","convertProfile","onSocketConnected","addSocketListener","refetchData","_viewName","_apiUrl","ShareRootConstants","mixins","ViewStoreMixin","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","Fields","key","title","type","DIRECTORY_PATH","STRING","help","LIST","item_type","NUMBER","BOOLEAN","ShareDirectoryDialog","constructor","super","isNew","rootEntry","onFieldChanged","value","hasChanges","includes","mergeFields","virtual_name","undefined","Promise","resolve","save","form","onSave","changedFields","SocketService","onFieldSetting","fieldOptions","formValue","disabled","config","Object","assign","historyId","FilesystemConstants","LOCATION_DOWNLOAD","factory","Textbox","template","suggestionGetter","virtualNames","fieldDefinitions","shareT","shareProfileDefinitions","find","def","default_value","other","translate","Modal","className","onApprove","closable","IconConstants","FOLDER","Message","INFO","description","i18nKey","toI18nKey","Form","ref","c","sourceValue","ModalRouteDecorator","ShareProfileDecorator","ShareConstants","GROUPED_ROOTS_GET_URL","params","socket","directoryId","get","item","ShareProfileFilter","memo","defaultItem","selectedProfile","setSelectedProfile","useState","onClick","onFilterUpdated","SectionedDropdown","caption","triggerIcon","button","MenuSection","FILTER","MenuItemLink","active","getDropdownItem","TableFilterDecorator","rowDataGetter","cellData","state","status","NORMAL","style","display","Icon","CANCEL","color","refreshTaskId","refresh_task_id","Loader","inline","text","ShareRootCreateAction","ShareRootEditActions","root","ShareRootActionModule","ShareRootEditActionMenu","ShareRootCreateMenu","create","Share","editAccess","LoginStore","hasAccess","VirtualTable","store","ShareRootStore","customFilter","footerData","header","ids","width","columnKey","cell","remoteMenuId","MenuConstants","SHARE_ROOT","flexGrow","hideWidth","uploadTempFile","file","getBasePath","method","headers","authToken","Authorization","body","e","fetchCorsSafeData","url","isJSON","res","origin","encodeURIComponent","toCorsSafeUrl","json","console","error","shareTempFile","hubUrl","cid","fileId","TEMP_SHARES_URL","file_id","hub_url","refreshPaths","paths","REFRESH_PATHS_URL","priority","MANUAL","refreshVirtual","REFRESH_VIRTUAL_URL","abortRefreshTask","REFRESH_TASKS_URL"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/share.6efce937acbd036d089d.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,yDAGtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,0CAA0C,MAAQ,GAAG,SAAW,yBAAyB,eAAiB,CAAC,0DAA0D,WAAa,MAEhN,S,gHCFA,MAIaC,EAAqB,CAChCD,GAAI,aACJE,YAAa,cACbC,OAAQ,KAAeC,cACvBC,KAAM,IAAcC,gBACpBC,QAToB,IACb,IAAcC,KAAK,IAAeC,cAWrCC,EAA6C,CACjDC,QAASV,GAG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C9CO,MAAMW,EAAgB,CAC3BlB,EACAmB,EACAC,KACkC,O,OAAD,E,OAAA,E,EAAA,YAEjC,IACE,MAAMC,QAAe,OAAerB,GAWpC,aAVkB,IAAclP,KAC9B,IAAewQ,gBACf,CACEvO,KAAMiN,EAAKjN,KACXwO,QAASF,EACTG,QAASL,EACTC,OAKN,CAAE,MAAOb,GACP,MAAMA,CACR,CACF,E,YAlBmC,K,6QAkBlC,EASYkB,EAAgBC,GACpB,IAAc5Q,KAAK,IAAe6Q,kBAAmB,CAC1DD,QACAE,SAAU,KAA4BC,SAI7BC,EAAkB3P,GACtB,IAAcrB,KAAK,IAAeiR,oBAAqB,CAC5D5P,SAIS6P,EAAoB1R,GACxB,IAAc0D,OAAO,GAAG,IAAeiO,qBAAqB3R,I","sources":["webpack://airdcpp-webui/./src/routes/Share/style.css","webpack://airdcpp-webui/./src/actions/ui/share/ShareActions.ts","webpack://airdcpp-webui/./src/actions/ui/share/ShareExcludeActions.ts","webpack://airdcpp-webui/./src/actions/ui/share/ShareProfileActions.ts","webpack://airdcpp-webui/./src/constants/ShareProfileConstants.ts","webpack://airdcpp-webui/./src/decorators/RedrawDecorator.tsx","webpack://airdcpp-webui/./src/decorators/ShareProfileDecorator.tsx","webpack://airdcpp-webui/./src/constants/ShareRootConstants.ts","webpack://airdcpp-webui/./src/stores/ShareRootStore.js","webpack://airdcpp-webui/./src/routes/Share/style.css?7048","webpack://airdcpp-webui/./src/routes/Share/components/ShareDirectoryDialog.tsx","webpack://airdcpp-webui/./src/components/table/ShareProfileFilter.tsx","webpack://airdcpp-webui/./src/routes/Share/components/RefreshCell.tsx","webpack://airdcpp-webui/./src/actions/ui/share/ShareRootActions.ts","webpack://airdcpp-webui/./src/routes/Share/components/Share.tsx","webpack://airdcpp-webui/./src/services/HttpService.ts","webpack://airdcpp-webui/./src/services/api/ShareApi.ts"],"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, `.share-directory .Select {\n margin-bottom: 0px;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Share/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,kBAAkB;AACpB\",\"sourcesContent\":[\".share-directory .Select {\\n margin-bottom: 0px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import SocketService from 'services/SocketService';\n\nimport ShareConstants from 'constants/ShareConstants';\nimport IconConstants from 'constants/IconConstants';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nconst handleRefresh = () => {\n return SocketService.post(ShareConstants.REFRESH_URL);\n};\n\nexport const ShareRefreshAction = {\n id: 'refreshAll',\n displayName: 'Refresh all',\n access: API.AccessEnum.SETTINGS_EDIT,\n icon: IconConstants.REFRESH_COLORED,\n handler: handleRefresh,\n};\n\nconst ShareActions: UI.ActionListType<undefined> = {\n refresh: ShareRefreshAction,\n};\n\nexport const ShareActionModule = {\n moduleId: UI.Modules.SHARE,\n};\n\nexport const ShareActionMenu = {\n moduleData: ShareActionModule,\n actions: ShareActions,\n};\n","import SocketService from 'services/SocketService';\r\n\r\nimport ShareConstants from 'constants/ShareConstants';\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 handleAdd: UI.ActionHandler<void> = ({ navigate }) => {\r\n navigate(`browse`);\r\n};\r\n\r\nconst handleRemove: UI.ActionHandler<string> = ({ itemData: path }) => {\r\n return SocketService.post(ShareConstants.EXCLUDES_REMOVE_URL, { path });\r\n};\r\n\r\nexport const ShareExcludeAddAction = {\r\n id: 'add',\r\n displayName: 'Add path',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleAdd,\r\n};\r\n\r\nexport const ShareExcludeRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove path',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the excluded path {{item}}?',\r\n approveCaption: 'Remove path',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst ShareExcludeEditActions: UI.ActionListType<string> = {\r\n remove: ShareExcludeRemoveAction,\r\n};\r\n\r\nexport const ShareExcludeActionModule = {\r\n moduleId: UI.Modules.SETTINGS,\r\n subId: 'shareExclude',\r\n};\r\n\r\nexport const ShareExcludeEditMenu = {\r\n moduleData: ShareExcludeActionModule,\r\n actions: ShareExcludeEditActions,\r\n};\r\n","import SocketService from 'services/SocketService';\r\n\r\nimport FilelistSessionActions from 'actions/reflux/FilelistSessionActions';\r\nimport FilelistSessionStore from 'stores/FilelistSessionStore';\r\n\r\nimport ShareProfileConstants from 'constants/ShareProfileConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\nimport { MENU_DIVIDER } from 'constants/ActionConstants';\r\n\r\ntype Filter = UI.ActionFilter<API.ShareProfile>;\r\nconst notDefault: Filter = ({ itemData: profile }) => !profile.default;\r\n\r\nconst handleCreate: UI.ActionHandler<void> = (data, name: string) => {\r\n return SocketService.post(ShareProfileConstants.PROFILES_URL, { name: name });\r\n};\r\n\r\ntype Handler = UI.ActionHandler<API.ShareProfile>;\r\nconst handleDefault: Handler = ({ itemData: profile }) => {\r\n return SocketService.post(\r\n `${ShareProfileConstants.PROFILES_URL}/${profile.id}/default`,\r\n );\r\n};\r\n\r\nconst handleEdit: Handler = ({ itemData: profile }, name: string) => {\r\n return SocketService.patch(`${ShareProfileConstants.PROFILES_URL}/${profile.id}`, {\r\n name: name,\r\n });\r\n};\r\n\r\nconst handleRemove: Handler = ({ itemData: profile }) => {\r\n return SocketService.delete(ShareProfileConstants.PROFILES_URL + '/' + profile.id);\r\n};\r\n\r\nconst handleBrowse: Handler = ({ itemData: profile, location }) => {\r\n return FilelistSessionActions.ownList(location, profile.id, FilelistSessionStore);\r\n};\r\n\r\nexport const ShareProfileCreateAction = {\r\n id: 'create',\r\n displayName: 'Add profile',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.CREATE,\r\n input: {\r\n approveCaption: 'Create',\r\n content: 'Enter name for the profile',\r\n inputProps: {\r\n placeholder: 'Enter name',\r\n required: true,\r\n },\r\n },\r\n handler: handleCreate,\r\n};\r\n\r\nexport const ShareProfileBrowseAction = {\r\n id: 'browse',\r\n displayName: 'Browse files',\r\n access: API.AccessEnum.FILELISTS_VIEW,\r\n icon: IconConstants.FILELIST,\r\n handler: handleBrowse,\r\n};\r\n\r\nexport const ShareProfileEditAction = {\r\n id: 'edit',\r\n displayName: 'Rename profile',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.EDIT,\r\n input: (profile: API.ShareProfile) => ({\r\n approveCaption: 'Rename',\r\n content: 'Enter new name for the profile {{item.name}}',\r\n inputProps: {\r\n placeholder: 'Enter name',\r\n defaultValue: profile.name,\r\n required: true,\r\n },\r\n }),\r\n handler: handleEdit,\r\n};\r\n\r\nexport const ShareProfileSetDefaultAction = {\r\n id: 'default',\r\n displayName: 'Set as default',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n filter: notDefault,\r\n icon: IconConstants.DEFAULT,\r\n handler: handleDefault,\r\n};\r\n\r\nexport const ShareProfileRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove profile',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the profile {{item.name}}?',\r\n approveCaption: 'Remove profile',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst ShareProfileEditActions: UI.ActionListType<API.ShareProfile> = {\r\n browse: ShareProfileBrowseAction,\r\n divider: MENU_DIVIDER,\r\n edit: ShareProfileEditAction,\r\n default: ShareProfileSetDefaultAction,\r\n remove: ShareProfileRemoveAction,\r\n};\r\n\r\nexport const ShareProfileActionModule = {\r\n moduleId: UI.Modules.SETTINGS,\r\n subId: 'profile',\r\n};\r\n\r\nexport const ShareProfileEditMenu = {\r\n moduleData: ShareProfileActionModule,\r\n actions: ShareProfileEditActions,\r\n};\r\n","const MODULE_URL = 'share_profiles';\nexport default {\n MODULE_URL: MODULE_URL,\n PROFILES_URL: MODULE_URL,\n\n PROFILE_ADDED: 'share_profile_added',\n PROFILE_UPDATED: 'share_profile_updated',\n PROFILE_REMOVED: 'share_profile_removed',\n\n HIDDEN_PROFILE_ID: 1,\n};\n","import * as React from 'react';\r\n\r\nexport default function <PropsT>(\r\n Component: React.ComponentType<PropsT>,\r\n redrawIntervalSeconds = 60,\r\n) {\r\n class RedrawDecorator extends React.Component<PropsT> {\r\n redrawTimeout: number | undefined;\r\n\r\n componentDidMount() {\r\n this.scheduleComponentRefresh();\r\n }\r\n\r\n componentWillUnmount() {\r\n clearTimeout(this.redrawTimeout);\r\n }\r\n\r\n scheduleComponentRefresh = () => {\r\n this.redrawTimeout = window.setTimeout(() => {\r\n this.forceUpdate();\r\n this.scheduleComponentRefresh();\r\n }, redrawIntervalSeconds * 1000);\r\n };\r\n\r\n render() {\r\n return <Component {...this.props} />;\r\n }\r\n }\r\n\r\n return RedrawDecorator;\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 { formatSize } from 'utils/ValueFormat';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\ninterface ShareProfileDecoratorDataProps {\r\n profiles: API.ShareProfile[];\r\n}\r\n\r\nexport const profileToEnumValue = (profile: API.ShareProfile) => {\r\n return {\r\n id: profile.id,\r\n name: profile.str,\r\n };\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 addSize = true,\r\n) {\r\n const convertProfile = (\r\n profile: API.ShareProfile,\r\n t: UI.TranslateF,\r\n ): API.ShareProfile => {\r\n let str = profile.str;\r\n if (addSize && profile.id !== ShareProfileConstants.HIDDEN_PROFILE_ID) {\r\n str += ` (${formatSize(profile.size, t)})`;\r\n }\r\n\r\n return {\r\n ...profile,\r\n str,\r\n };\r\n };\r\n\r\n const convertProfiles: DataConverter<PropsT> = (data: API.ShareProfile[], { t }) => {\r\n const profiles = data\r\n .filter((p) => listHidden || p.id !== ShareProfileConstants.HIDDEN_PROFILE_ID)\r\n .map((p) => convertProfile(p, t));\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_roots';\n\nexport default {\n MODULE_URL: MODULE_URL,\n ROOTS_URL: MODULE_URL,\n\n CREATED: 'share_root_created',\n UPDATED: 'share_root_updated',\n REMOVED: 'share_root_removed',\n};\n","import Reflux from 'reflux';\n\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\nimport ShareRootConstants from 'constants/ShareRootConstants';\n\nexport default Reflux.createStore({\n _viewName: 'share_root_view',\n _apiUrl: ShareRootConstants.MODULE_URL,\n mixins: [ViewStoreMixin('path')],\n});\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 { Component } from 'react';\r\nimport Modal from 'components/semantic/Modal';\r\n\r\nimport ShareConstants from 'constants/ShareConstants';\r\nimport ShareRootConstants from 'constants/ShareRootConstants';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\n\r\nimport ShareProfileDecorator, {\r\n profileToEnumValue,\r\n ShareProfileDecoratorChildProps,\r\n} from 'decorators/ShareProfileDecorator';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport Message from 'components/semantic/Message';\r\n\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport { getLastDirectory } from 'utils/FileUtils';\r\n\r\nimport Form, {\r\n FormSaveHandler,\r\n FormFieldSettingHandler,\r\n FormFieldChangeHandler,\r\n} from 'components/form/Form';\r\nimport FilesystemConstants from 'constants/FilesystemConstants';\r\nimport { AutoSuggestField } from 'components/form/fields';\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 { ShareRootEntryBase } from 'types/api';\r\nimport { translateForm } from 'utils/FormUtils';\r\nimport { Trans } from 'react-i18next';\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'path',\r\n title: 'Path',\r\n type: API.SettingTypeEnum.DIRECTORY_PATH,\r\n },\r\n {\r\n key: 'virtual_name',\r\n title: 'Virtual name',\r\n type: API.SettingTypeEnum.STRING,\r\n help: 'Directories with identical virtual names will be merged in filelist',\r\n },\r\n {\r\n key: 'profiles',\r\n type: API.SettingTypeEnum.LIST,\r\n item_type: API.SettingTypeEnum.NUMBER,\r\n title: 'Share profiles',\r\n help: 'New share profiles can be created from application settings',\r\n },\r\n {\r\n key: 'incoming',\r\n title: 'Incoming',\r\n type: API.SettingTypeEnum.BOOLEAN,\r\n },\r\n];\r\n\r\nexport interface ShareDirectoryDialogProps {\r\n shareT: UI.ModuleTranslator;\r\n}\r\n\r\nexport interface DataProps extends ShareProfileDecoratorChildProps {\r\n virtualNames: string[];\r\n rootEntry?: API.ShareRootEntryBase;\r\n}\r\n\r\ninterface Entry extends ShareRootEntryBase, UI.FormValueMap {}\r\n\r\n/*interface RouteProps {\r\n directoryId: string;\r\n}*/\r\n\r\ntype Props = ShareDirectoryDialogProps & DataProps & ModalRouteDecoratorChildProps;\r\n\r\nclass ShareDirectoryDialog extends Component<Props> {\r\n static displayName = 'ShareDirectoryDialog';\r\n\r\n fieldDefinitions: UI.FormFieldDefinition[];\r\n form: Form<Entry>;\r\n\r\n constructor(props: Props) {\r\n super(props);\r\n\r\n this.fieldDefinitions = translateForm(Fields, props.shareT);\r\n\r\n // Share profiles shouldn't be translated...\r\n const shareProfileDefinitions = this.fieldDefinitions.find(\r\n (def) => def.key === 'profiles',\r\n )!;\r\n Object.assign(shareProfileDefinitions, {\r\n options: props.profiles.map(profileToEnumValue),\r\n default_value: [props.profiles.find((profile) => profile.default)!.id],\r\n });\r\n }\r\n\r\n isNew = () => {\r\n return !this.props.rootEntry;\r\n };\r\n\r\n onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n if (id.includes('path')) {\r\n const mergeFields = {\r\n virtual_name: !!value.path ? getLastDirectory(value.path) : undefined,\r\n };\r\n\r\n return Promise.resolve(mergeFields);\r\n }\r\n\r\n return null;\r\n };\r\n\r\n save = () => {\r\n return this.form.save();\r\n };\r\n\r\n onSave: FormSaveHandler<Entry> = (changedFields) => {\r\n if (this.isNew()) {\r\n return SocketService.post(ShareRootConstants.ROOTS_URL, changedFields);\r\n }\r\n\r\n return SocketService.patch(\r\n `${ShareRootConstants.ROOTS_URL}/${this.props.rootEntry!.id}`,\r\n changedFields,\r\n );\r\n };\r\n\r\n onFieldSetting: FormFieldSettingHandler<Entry> = (id, fieldOptions, formValue) => {\r\n if (id === 'path') {\r\n fieldOptions.disabled = !this.isNew();\r\n fieldOptions.config = Object.assign({} || fieldOptions.config, {\r\n historyId: FilesystemConstants.LOCATION_DOWNLOAD,\r\n });\r\n } else if (id === 'virtual_name') {\r\n fieldOptions.factory = t.form.Textbox;\r\n fieldOptions.template = AutoSuggestField;\r\n fieldOptions.config = {\r\n suggestionGetter: () => this.props.virtualNames,\r\n };\r\n }\r\n };\r\n\r\n render() {\r\n const { rootEntry, shareT, ...other } = this.props;\r\n const title = shareT.translate(\r\n this.isNew() ? 'Add share directory' : 'Edit share directory',\r\n );\r\n return (\r\n <Modal\r\n className=\"share-directory\"\r\n title={title}\r\n onApprove={this.save}\r\n closable={false}\r\n icon={IconConstants.FOLDER}\r\n {...other}\r\n >\r\n <Message\r\n title={shareT.translate('Hashing information')}\r\n icon={IconConstants.INFO}\r\n description={\r\n <Trans i18nKey={shareT.toI18nKey('hashingInformationDesc')}>\r\n <p>\r\n New files will appear in share only after they have finished hashing (the\r\n client has calculated checksums for them). Information about hashing\r\n progress will be posted to the event log.\r\n </p>\r\n </Trans>\r\n }\r\n />\r\n <Form<Entry>\r\n ref={(c) => (this.form = c!)}\r\n fieldDefinitions={this.fieldDefinitions}\r\n onFieldChanged={this.onFieldChanged}\r\n onFieldSetting={this.onFieldSetting}\r\n onSave={this.onSave}\r\n sourceValue={rootEntry as Entry}\r\n location={this.props.location}\r\n />\r\n </Modal>\r\n );\r\n }\r\n}\r\n\r\nexport default ModalRouteDecorator<ShareDirectoryDialogProps>(\r\n ShareProfileDecorator<Omit<Props, keyof DataProps>>(ShareDirectoryDialog, false, {\r\n urls: {\r\n virtualNames: ShareConstants.GROUPED_ROOTS_GET_URL,\r\n rootEntry: ({ params }, socket) => {\r\n if (!params.directoryId) {\r\n return Promise.resolve(undefined);\r\n }\r\n\r\n return socket.get(`${ShareRootConstants.ROOTS_URL}/${params.directoryId}`);\r\n },\r\n },\r\n dataConverters: {\r\n virtualNames: (data: API.GroupedPath[]) => data.map((item) => item.name, []),\r\n },\r\n }),\r\n '/directories/:directoryId?',\r\n);\r\n","//import PropTypes from 'prop-types';\r\nimport { memo, useState } from 'react';\r\n\r\nimport SectionedDropdown from 'components/semantic/SectionedDropdown';\r\nimport MenuSection from 'components/semantic/MenuSection';\r\nimport MenuItemLink from 'components/semantic/MenuItemLink';\r\n\r\nimport ShareProfileDecorator, {\r\n ShareProfileDecoratorChildProps,\r\n} from 'decorators/ShareProfileDecorator';\r\nimport TableFilterDecorator, {\r\n TableFilterDecoratorChildProps,\r\n TableFilterDecoratorProps,\r\n} from 'decorators/TableFilterDecorator';\r\n\r\nimport * as API from 'types/api';\r\nimport { translate } from 'utils/TranslationUtils';\r\nimport { useTranslation } from 'react-i18next';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\ninterface ShareProfileItem {\r\n id: null | number;\r\n str: string;\r\n}\r\n\r\nexport interface ShareProfileFilterProps {}\r\n\r\ntype Props = ShareProfileFilterProps &\r\n TableFilterDecoratorChildProps &\r\n ShareProfileDecoratorChildProps;\r\n\r\nconst getDropdownItem = (\r\n profile: ShareProfileItem,\r\n onClick: (p: ShareProfileItem) => void,\r\n selectedProfile: ShareProfileItem,\r\n) => {\r\n return (\r\n <MenuItemLink\r\n key={profile.id as number}\r\n active={selectedProfile.id === profile.id}\r\n onClick={() => onClick(profile)}\r\n >\r\n {profile.str}\r\n </MenuItemLink>\r\n );\r\n};\r\n\r\nconst ShareProfileFilter = memo<Props>(function ShareProfileFilter(props) {\r\n const { t } = useTranslation();\r\n\r\n const defaultItem: ShareProfileItem = {\r\n str: translate('All profiles', t, 'table.filter'),\r\n id: null,\r\n };\r\n\r\n const [selectedProfile, setSelectedProfile] = useState<ShareProfileItem>(defaultItem);\r\n\r\n const onClick = (profile: API.ShareProfile) => {\r\n props.onFilterUpdated(profile.id);\r\n setSelectedProfile(profile);\r\n };\r\n\r\n return (\r\n <SectionedDropdown\r\n className=\"top right pointing\"\r\n caption={selectedProfile.str}\r\n triggerIcon=\"filter\"\r\n button={true}\r\n >\r\n <MenuSection\r\n caption={translate('Filter by profile', t, 'table.filter')}\r\n icon={IconConstants.FILTER}\r\n >\r\n {[defaultItem, ...props.profiles].map((p) =>\r\n getDropdownItem(p, onClick, selectedProfile),\r\n )}\r\n </MenuSection>\r\n </SectionedDropdown>\r\n );\r\n});\r\n\r\nexport default ShareProfileDecorator<ShareProfileFilterProps & TableFilterDecoratorProps>(\r\n TableFilterDecorator<ShareProfileFilterProps & ShareProfileDecoratorChildProps>(\r\n ShareProfileFilter,\r\n 'profiles',\r\n ),\r\n false,\r\n);\r\n","import * as React from 'react';\n\nimport RedrawDecorator from 'decorators/RedrawDecorator';\nimport { formatRelativeTime } from 'utils/ValueFormat';\nimport Loader from 'components/semantic/Loader';\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport { translate } from 'utils/TranslationUtils';\nimport { abortRefreshTask, refreshPaths } from 'services/api/ShareApi';\nimport { runBackgroundSocketAction } from 'utils/ActionUtils';\nimport Icon from 'components/semantic/Icon';\nimport IconConstants from 'constants/IconConstants';\n\ninterface RefreshCellProps extends RowWrapperCellChildProps<number, API.ShareRootEntry> {}\n\nconst RefreshCell: React.FC<RefreshCellProps> = ({ rowDataGetter, cellData, t }) => {\n const state = rowDataGetter!().status;\n if (state.id !== API.ShareRootStatusEnum.NORMAL) {\n return (\n <div style={{ display: 'flex' }}>\n <Icon\n icon={IconConstants.CANCEL}\n color=\"red\"\n size=\"large\"\n onClick={() => {\n const refreshTaskId = rowDataGetter!().status.refresh_task_id;\n if (!!refreshTaskId) {\n runBackgroundSocketAction(() => abortRefreshTask(refreshTaskId), t!);\n }\n }}\n />\n <Loader size=\"small\" inline={true} text={state.str} />\n </div>\n );\n }\n\n return (\n <div>\n <Icon\n icon={IconConstants.REFRESH_COLORED}\n size=\"large\"\n onClick={() =>\n runBackgroundSocketAction(() => refreshPaths([rowDataGetter!().path]), t!)\n }\n />\n {cellData === 0\n ? translate('Unknown', t!, UI.Modules.SHARE)\n : formatRelativeTime(cellData!)}\n </div>\n );\n};\n\nexport default RedrawDecorator(RefreshCell);\n","import SocketService from 'services/SocketService';\r\n\r\nimport ShareRootConstants from 'constants/ShareRootConstants';\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<void> = ({ navigate }) => {\r\n navigate(`directories`);\r\n};\r\n\r\ntype Handler = UI.ActionHandler<API.ShareRootEntry>;\r\nconst handleEdit: Handler = ({ itemData: root, navigate }) => {\r\n navigate(`directories/${root.id}`);\r\n};\r\n\r\nconst handleRemove: Handler = ({ itemData: root }) => {\r\n return SocketService.delete(ShareRootConstants.ROOTS_URL + '/' + root.id);\r\n};\r\n\r\nexport const ShareRootCreateAction = {\r\n id: 'create',\r\n displayName: 'Add directory',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.CREATE,\r\n handler: handleCreate,\r\n};\r\n\r\nexport const ShareRootEditAction = {\r\n id: 'edit',\r\n displayName: 'Edit directory',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.EDIT,\r\n handler: handleEdit,\r\n};\r\n\r\nexport const ShareRootRemoveAction = {\r\n id: 'remove',\r\n displayName: 'Remove directory',\r\n access: API.AccessEnum.SETTINGS_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content:\r\n // eslint-disable-next-line max-len\r\n 'Are you sure that you want to remove the directory {{item.virtual_name}} from share? It will be removed from all share profiles.',\r\n approveCaption: 'Remove directory',\r\n rejectCaption: `Don't remove`,\r\n },\r\n handler: handleRemove,\r\n};\r\n\r\nconst ShareRootEditActions: UI.ActionListType<API.ShareRootEntry> = {\r\n edit: ShareRootEditAction,\r\n remove: ShareRootRemoveAction,\r\n};\r\n\r\nexport const ShareRootActionModule = {\r\n moduleId: UI.Modules.SHARE,\r\n subId: 'root',\r\n};\r\n\r\nexport const ShareRootEditActionMenu = {\r\n moduleData: ShareRootActionModule,\r\n actions: ShareRootEditActions,\r\n};\r\n","import { Component } from 'react';\n\nimport ShareRootStore from 'stores/ShareRootStore';\n\nimport VirtualTable from 'components/table/VirtualTable';\nimport { SizeCell, DurationCell, FileActionCell } from 'components/table/Cell';\nimport { Column } from 'fixed-data-table-2';\n\nimport ShareDirectoryDialog from 'routes/Share/components/ShareDirectoryDialog';\nimport ShareProfileFilter from 'components/table/ShareProfileFilter';\n\nimport { ActionMenu } from 'components/action-menu';\nimport RefreshCell from 'routes/Share/components/RefreshCell';\n\nimport LoginStore from 'stores/LoginStore';\n\nimport * as API from 'types/api';\nimport * as UI from 'types/ui';\n\nimport { withTranslation, WithTranslation } from 'react-i18next';\nimport { getModuleT } from 'utils/TranslationUtils';\nimport MenuConstants from 'constants/MenuConstants';\nimport {\n ShareActionMenu,\n ShareRootActionModule,\n ShareRootCreateAction,\n ShareRootEditActionMenu,\n} from 'actions/ui/share';\n\nconst ShareRootCreateMenu = {\n actions: {\n create: ShareRootCreateAction,\n },\n moduleData: ShareRootActionModule,\n};\n\nclass Share extends Component<WithTranslation> {\n static displayName = 'Share';\n\n shareT = getModuleT(this.props.t, UI.Modules.SHARE);\n render() {\n const { translate } = this.shareT;\n const editAccess = LoginStore.hasAccess(API.AccessEnum.SETTINGS_EDIT);\n return (\n <>\n <VirtualTable\n store={ShareRootStore}\n customFilter={ShareProfileFilter}\n footerData={\n <ActionMenu\n className=\"top left pointing\"\n caption={translate('Actions...')}\n actions={ShareRootCreateMenu}\n header={translate('Share actions')}\n triggerIcon=\"chevron up\"\n ids={['create']}\n button={true}\n >\n <ActionMenu actions={ShareActionMenu} ids={['refresh']} />\n </ActionMenu>\n }\n moduleId={UI.Modules.SHARE}\n >\n <Column\n name=\"Path\"\n width={200}\n columnKey=\"path\"\n cell={\n <FileActionCell\n actions={ShareRootEditActionMenu}\n remoteMenuId={MenuConstants.SHARE_ROOT}\n />\n }\n flexGrow={10}\n />\n <Column\n name=\"Size\"\n width={60}\n columnKey=\"size\"\n cell={<SizeCell />}\n flexGrow={2}\n />\n <Column name=\"Content\" width={150} columnKey=\"type\" hideWidth={1000} />\n <Column\n name=\"Virtual name\"\n width={120}\n columnKey=\"virtual_name\"\n flexGrow={5}\n //hideWidth={600}\n />\n <Column name=\"Profiles\" width={65} columnKey=\"profiles\" />\n <Column\n name=\"Last refreshed\"\n width={80}\n flexGrow={3}\n columnKey=\"last_refresh_time\"\n cell={editAccess ? <RefreshCell /> : <DurationCell />}\n />\n </VirtualTable>\n <ShareDirectoryDialog shareT={this.shareT} />\n </>\n );\n }\n}\n\nexport default withTranslation()(Share);\n","import LoginStore from 'stores/LoginStore';\r\nimport { fetchData } from 'utils/HttpUtils';\r\n\r\nexport const uploadTempFile = async (file: File): Promise<string> => {\r\n // eslint-disable-next-line no-useless-catch\r\n try {\r\n const res = await fetchData(`${getBasePath()}temp`, {\r\n method: 'POST',\r\n headers: {\r\n // https://github.com/airdcpp-web/airdcpp-webclient/issues/330\r\n 'X-Authorization': LoginStore.authToken,\r\n\r\n Authorization: LoginStore.authToken,\r\n },\r\n body: file,\r\n });\r\n\r\n return res.headers.get('Location')!;\r\n } catch (e) {\r\n throw e;\r\n }\r\n};\r\n\r\nconst toCorsSafeUrl = (url: string) => {\r\n const proxyUrl = `${\r\n window.location.origin\r\n }${getBasePath()}proxy?url=${encodeURIComponent(url)}`;\r\n return proxyUrl;\r\n};\r\n\r\nexport const fetchCorsSafeData = async (\r\n url: string,\r\n isJSON: boolean,\r\n options?: RequestInit,\r\n) => {\r\n try {\r\n //console.log(`CORS HTTP request started (${url})`);\r\n\r\n const res = await fetchData(toCorsSafeUrl(url), {\r\n headers: {\r\n // https://github.com/airdcpp-web/airdcpp-webclient/issues/330\r\n 'X-Authorization': LoginStore.authToken,\r\n\r\n // Temp workaround for people upgrading from versions < 2.7.0\r\n // If the new UI was loaded before restarting the app, a cache expiration time of\r\n // one year would have been set for \"Not found\" errors...\r\n 'Cache-Control': 'no-store, must-revalidate, max-age=0',\r\n },\r\n ...options,\r\n });\r\n\r\n const data = (await isJSON) ? res.json() : res.text();\r\n return data;\r\n } catch (e) {\r\n console.error(`CORS HTTP request failed (${url})`, e);\r\n throw e;\r\n }\r\n};\r\n","import ShareConstants from 'constants/ShareConstants';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport { uploadTempFile } from '../HttpService';\r\n\r\nimport * as API from 'types/api';\r\n\r\nexport interface AddTempShareResponse {\r\n magnet: string;\r\n}\r\n\r\nexport const shareTempFile = async (\r\n file: File,\r\n hubUrl: string,\r\n cid: string | undefined,\r\n): Promise<AddTempShareResponse> => {\r\n // eslint-disable-next-line no-useless-catch\r\n try {\r\n const fileId = await uploadTempFile(file);\r\n const res = await SocketService.post<AddTempShareResponse>(\r\n ShareConstants.TEMP_SHARES_URL,\r\n {\r\n name: file.name,\r\n file_id: fileId,\r\n hub_url: hubUrl,\r\n cid,\r\n },\r\n );\r\n\r\n return res;\r\n } catch (e) {\r\n throw e;\r\n }\r\n};\r\n\r\nexport const refresh = (incoming: boolean) => {\r\n return SocketService.post(ShareConstants.REFRESH_URL, {\r\n incoming,\r\n priority: API.RefreshPriorityTypeEnum.MANUAL,\r\n });\r\n};\r\n\r\nexport const refreshPaths = (paths: string[]) => {\r\n return SocketService.post(ShareConstants.REFRESH_PATHS_URL, {\r\n paths,\r\n priority: API.RefreshPriorityTypeEnum.MANUAL,\r\n });\r\n};\r\n\r\nexport const refreshVirtual = (path: string) => {\r\n return SocketService.post(ShareConstants.REFRESH_VIRTUAL_URL, {\r\n path,\r\n });\r\n};\r\n\r\nexport const abortRefreshTask = (id: number) => {\r\n return SocketService.delete(`${ShareConstants.REFRESH_TASKS_URL}/${id}`);\r\n};\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","ShareRefreshAction","displayName","access","SETTINGS_EDIT","icon","REFRESH_COLORED","handler","post","REFRESH_URL","ShareActions","refresh","ShareActionModule","moduleId","SHARE","ShareActionMenu","moduleData","actions","ShareExcludeAddAction","CREATE","navigate","ShareExcludeEditActions","remove","REMOVE","confirmation","content","approveCaption","rejectCaption","itemData","path","EXCLUDES_REMOVE_URL","ShareExcludeActionModule","SETTINGS","subId","ShareExcludeEditMenu","ShareProfileCreateAction","input","inputProps","placeholder","required","data","name","PROFILES_URL","ShareProfileBrowseAction","FILELISTS_VIEW","FILELIST","profile","location","ownList","ShareProfileEditAction","EDIT","defaultValue","patch","ShareProfileSetDefaultAction","filter","default","DEFAULT","ShareProfileRemoveAction","delete","ShareProfileEditActions","browse","divider","edit","ShareProfileActionModule","ShareProfileEditMenu","MODULE_URL","PROFILE_ADDED","PROFILE_UPDATED","PROFILE_REMOVED","HIDDEN_PROFILE_ID","Component","redrawIntervalSeconds","RedrawDecorator","scheduleComponentRefresh","this","redrawTimeout","window","setTimeout","forceUpdate","componentDidMount","componentWillUnmount","clearTimeout","render","props","profileToEnumValue","str","listHidden","dataProviderDecoratorSettings","addSize","merge","urls","profiles","dataConverters","t","p","map","size","convertProfile","onSocketConnected","addSocketListener","refetchData","_viewName","_apiUrl","ShareRootConstants","mixins","ViewStoreMixin","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","Fields","key","title","type","DIRECTORY_PATH","STRING","help","LIST","item_type","NUMBER","BOOLEAN","ShareDirectoryDialog","constructor","super","isNew","rootEntry","onFieldChanged","value","hasChanges","includes","mergeFields","virtual_name","undefined","Promise","resolve","save","form","onSave","changedFields","SocketService","onFieldSetting","fieldOptions","formValue","disabled","config","Object","assign","historyId","FilesystemConstants","LOCATION_DOWNLOAD","factory","Textbox","template","suggestionGetter","virtualNames","fieldDefinitions","shareT","shareProfileDefinitions","find","def","default_value","other","translate","Modal","className","onApprove","closable","IconConstants","FOLDER","Message","INFO","description","i18nKey","toI18nKey","Form","ref","c","sourceValue","ModalRouteDecorator","ShareProfileDecorator","ShareConstants","GROUPED_ROOTS_GET_URL","params","socket","directoryId","get","item","ShareProfileFilter","memo","defaultItem","selectedProfile","setSelectedProfile","useState","onClick","onFilterUpdated","SectionedDropdown","caption","triggerIcon","button","MenuSection","FILTER","MenuItemLink","active","getDropdownItem","TableFilterDecorator","rowDataGetter","cellData","state","status","NORMAL","style","display","Icon","CANCEL","color","refreshTaskId","refresh_task_id","Loader","inline","text","ShareRootCreateAction","ShareRootEditActions","root","ShareRootActionModule","ShareRootEditActionMenu","ShareRootCreateMenu","create","Share","editAccess","LoginStore","hasAccess","VirtualTable","store","ShareRootStore","customFilter","footerData","header","ids","width","columnKey","cell","remoteMenuId","MenuConstants","SHARE_ROOT","flexGrow","hideWidth","uploadTempFile","file","getBasePath","method","headers","authToken","Authorization","body","e","fetchCorsSafeData","url","isJSON","res","origin","encodeURIComponent","toCorsSafeUrl","json","console","error","shareTempFile","hubUrl","cid","fileId","TEMP_SHARES_URL","file_id","hub_url","refreshPaths","paths","REFRESH_PATHS_URL","priority","MANUAL","refreshVirtual","REFRESH_VIRTUAL_URL","abortRefreshTask","REFRESH_TASKS_URL"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[721],{21029:(n,t,e)=>{e.d(t,{A:()=>o});var s=e(71354),A=e.n(s),i=e(76314),a=e.n(i)()(A());a.push([n.id,".simple-layout {\n height: 100%;\n padding: 20px;\n margin-left: auto;\n margin-right: auto;\n background-color: white;\n}\n\n.simple-layout > div {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.simple-layout .layout-content {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1 1 100%;\n}\n\n.simple-layout .layout-content > div {\n width: 100%;\n}\n\n.simple-layout .divider.top {\n margin-bottom: 0px;\n}\n\n/* Message layout */\n.system-log .message-list {\n width: 100%;\n margin: 10px 0px !important;\n}\n\n.system-log .status.item i {\n float: left;\n}\n\n.system-log .status.item .text {\n margin-top: 5px;\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.system-log .status.item .time {\n color: gray;\n}\n\n.system-log .status.item .label {\n color: gray;\n margin-right: 3px;\n}\n","",{version:3,sources:["webpack://./src/routes/Sidebar/routes/Events/style.css"],names:[],mappings:"AAAA;EACE,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,WAAW;EACX,2BAA2B;AAC7B;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,eAAe;EACf,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,WAAW;EACX,iBAAiB;AACnB",sourcesContent:[".simple-layout {\n height: 100%;\n padding: 20px;\n margin-left: auto;\n margin-right: auto;\n background-color: white;\n}\n\n.simple-layout > div {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.simple-layout .layout-content {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1 1 100%;\n}\n\n.simple-layout .layout-content > div {\n width: 100%;\n}\n\n.simple-layout .divider.top {\n margin-bottom: 0px;\n}\n\n/* Message layout */\n.system-log .message-list {\n width: 100%;\n margin: 10px 0px !important;\n}\n\n.system-log .status.item i {\n float: left;\n}\n\n.system-log .status.item .text {\n margin-top: 5px;\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.system-log .status.item .time {\n color: gray;\n}\n\n.system-log .status.item .label {\n color: gray;\n margin-right: 3px;\n}\n"],sourceRoot:""}]);const o=a},8471:(n,t,e)=>{e.r(t),e.d(t,{default:()=>L});var s=e(74848),A=e(96540),i=e(96577),a=e(13686),o=e(
|
|
2
|
-
//# sourceMappingURL=system-log.
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[721],{21029:(n,t,e)=>{e.d(t,{A:()=>o});var s=e(71354),A=e.n(s),i=e(76314),a=e.n(i)()(A());a.push([n.id,".simple-layout {\n height: 100%;\n padding: 20px;\n margin-left: auto;\n margin-right: auto;\n background-color: white;\n}\n\n.simple-layout > div {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.simple-layout .layout-content {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1 1 100%;\n}\n\n.simple-layout .layout-content > div {\n width: 100%;\n}\n\n.simple-layout .divider.top {\n margin-bottom: 0px;\n}\n\n/* Message layout */\n.system-log .message-list {\n width: 100%;\n margin: 10px 0px !important;\n}\n\n.system-log .status.item i {\n float: left;\n}\n\n.system-log .status.item .text {\n margin-top: 5px;\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.system-log .status.item .time {\n color: gray;\n}\n\n.system-log .status.item .label {\n color: gray;\n margin-right: 3px;\n}\n","",{version:3,sources:["webpack://./src/routes/Sidebar/routes/Events/style.css"],names:[],mappings:"AAAA;EACE,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,WAAW;EACX,2BAA2B;AAC7B;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,eAAe;EACf,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,WAAW;EACX,iBAAiB;AACnB",sourcesContent:[".simple-layout {\n height: 100%;\n padding: 20px;\n margin-left: auto;\n margin-right: auto;\n background-color: white;\n}\n\n.simple-layout > div {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.simple-layout .layout-content {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1 1 100%;\n}\n\n.simple-layout .layout-content > div {\n width: 100%;\n}\n\n.simple-layout .divider.top {\n margin-bottom: 0px;\n}\n\n/* Message layout */\n.system-log .message-list {\n width: 100%;\n margin: 10px 0px !important;\n}\n\n.system-log .status.item i {\n float: left;\n}\n\n.system-log .status.item .text {\n margin-top: 5px;\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.system-log .status.item .time {\n color: gray;\n}\n\n.system-log .status.item .label {\n color: gray;\n margin-right: 3px;\n}\n"],sourceRoot:""}]);const o=a},8471:(n,t,e)=>{e.r(t),e.d(t,{default:()=>L});var s=e(74848),A=e(96540),i=e(96577),a=e(13686),o=e(32811),l=e(97744),m=e(67749),r=e(4425);const c={id:"clear",displayName:"Clear",access:l.A.EVENTS_EDIT,icon:r.A.CLEAR,handler:()=>o.A.delete(a.A.MESSAGES_URL)},d={moduleId:m.KV.EVENTS};var E=e(94743),u=e(31224),g=e(68514),p=e(85072),y=e.n(p),C=e(97825),B=e.n(C),x=e(77659),h=e.n(x),f=e(55056),v=e.n(f),b=e(10540),w=e.n(b),N=e(41113),T=e.n(N),j=e(21029),k={};k.styleTagTransform=T(),k.setAttributes=v(),k.insert=h().bind(null,"head"),k.domAPI=B(),k.insertStyleElement=w(),y()(j.A,k),j.A&&j.A.locals&&j.A.locals;var S=e(99347),V=e(32728),W=e(46120),R=e(42695);const _=({messages:n,t})=>n?0===n.length?(0,s.jsx)(V.A,{description:(0,R.Tl)("No messages to show",t,m.KV.EVENTS)}):(0,s.jsx)(W.A,{className:"events",messages:n,scrollPositionHandler:E.A,t}):(0,s.jsx)(S.A,{text:(0,R.Tl)("Loading messages",t,m.KV.EVENTS)});var I=e(69640),K=e(32389);const L=(0,A.memo)((function(){(0,A.useEffect)((()=>(i.A.setActive(!0),i.A.setRead(),E.A.isInitialized()||i.A.fetchMessages(),()=>i.A.setActive(!1))),[]);const{t:n}=(0,K.Bd)(),t=(0,I.P)(E.A);return(0,s.jsx)("div",{className:"simple-layout",children:(0,s.jsxs)("div",{className:"wrapper",children:[(0,s.jsx)(u.A,{icon:r.A.EVENTS_COLORED,title:(0,R.Tl)("Events",n,m.KV.EVENTS),rightComponent:(0,s.jsx)(g.A,{action:c,moduleData:d,icon:null})}),(0,s.jsx)("div",{className:"ui divider top"}),(0,s.jsx)("div",{className:"layout-content system-log",children:(0,s.jsx)(_,{messages:t,t:n})})]})})}),(()=>!0))}}]);
|
|
2
|
+
//# sourceMappingURL=system-log.3efd872fbf4a90cde8d5.chunk.js.map
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js/system-log.2d9af5f3372752909d83.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,21BAqDtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,0DAA0D,MAAQ,GAAG,SAAW,oYAAoY,eAAiB,CAAC,41BAA41B,WAAa,MAE72C,S,0ICrDO,MAAMC,EAAmB,CAC9BD,GAAI,QACJE,YAAa,QACbC,OAAQC,EAAAC,EAAgBC,YACxBC,KAAMC,EAAA,EAAcC,MACpBC,QAAS,IACAC,EAAA,EAAcC,OAAOC,EAAA,EAAeC,eAQlCC,EAAoB,CAC/BC,SAAU,KAAWC,Q,wKCXnBC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IACxBF,EAAQG,OAAS,SAAc,KAAM,QACrCH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,O,gDCN1D,MAqBA,EArBuD,EAAGC,WAAUC,KAC7DD,EAImB,IAApBA,EAASE,QAET,SAACC,EAAA,EAAO,CAACC,aAAa,QAAU,sBAAuBH,EAAG,KAAWT,WAKvE,SAACa,EAAA,EAAW,CACVC,UAAU,SACVN,SAAUA,EACVO,sBAAuBC,EAAA,EACvBP,KAdK,SAACQ,EAAA,EAAM,CAACC,MAAM,QAAU,mBAAoBT,EAAG,KAAWT,U,0BCCrE,MAwCA,GAxC4B,IAAAmB,OAC1B,YACE,IAAAC,YAAU,KACR,IAAgBC,WAAU,GAC1B,IAAgBC,UAEXN,EAAA,EAAWO,iBACd,IAAgBC,gBAGX,IAAM,IAAgBH,WAAU,KACtC,IAEH,MAAM,EAAEZ,IAAM,UACRD,GAAW,OAA+BQ,EAAA,GAChD,OACE,gBAAKF,UAAU,gBAAe,UAC5B,iBAAKA,UAAU,UAAS,WACtB,SAACW,EAAA,EAAY,CACXnC,KAAMC,EAAA,EAAcmC,eACpBC,OAAO,QAAU,SAAUlB,EAAG,KAAWT,QACzC4B,gBACE,SAACC,EAAAzC,EAAY,CACX0C,OAAQ9C,EACR+C,WAAYjC,EACZR,KAAM,UAIZ,gBAAKwB,UAAU,oBACf,gBAAKA,UAAU,4BAA2B,UACxC,SAAC,EAAgB,CAACN,SAAUA,EAAUC,EAAGA,UAKnD,IACA,KAAM,G","sources":["webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/style.css","webpack://airdcpp-webui/./src/actions/ui/event/EventActions.ts","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/style.css?eea1","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/components/EventMessageView.tsx","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/components/EventsLayout.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, `.simple-layout {\n height: 100%;\n padding: 20px;\n margin-left: auto;\n margin-right: auto;\n background-color: white;\n}\n\n.simple-layout > div {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.simple-layout .layout-content {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1 1 100%;\n}\n\n.simple-layout .layout-content > div {\n width: 100%;\n}\n\n.simple-layout .divider.top {\n margin-bottom: 0px;\n}\n\n/* Message layout */\n.system-log .message-list {\n width: 100%;\n margin: 10px 0px !important;\n}\n\n.system-log .status.item i {\n float: left;\n}\n\n.system-log .status.item .text {\n margin-top: 5px;\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.system-log .status.item .time {\n color: gray;\n}\n\n.system-log .status.item .label {\n color: gray;\n margin-right: 3px;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Sidebar/routes/Events/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,WAAW;EACX,2BAA2B;AAC7B;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,eAAe;EACf,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,WAAW;EACX,iBAAiB;AACnB\",\"sourcesContent\":[\".simple-layout {\\n height: 100%;\\n padding: 20px;\\n margin-left: auto;\\n margin-right: auto;\\n background-color: white;\\n}\\n\\n.simple-layout > div {\\n display: flex;\\n flex-direction: column;\\n height: 100%;\\n}\\n\\n.simple-layout .layout-content {\\n display: flex;\\n flex-direction: column;\\n overflow-y: auto;\\n flex: 1 1 100%;\\n}\\n\\n.simple-layout .layout-content > div {\\n width: 100%;\\n}\\n\\n.simple-layout .divider.top {\\n margin-bottom: 0px;\\n}\\n\\n/* Message layout */\\n.system-log .message-list {\\n width: 100%;\\n margin: 10px 0px !important;\\n}\\n\\n.system-log .status.item i {\\n float: left;\\n}\\n\\n.system-log .status.item .text {\\n margin-top: 5px;\\n margin-bottom: 10px;\\n overflow: hidden;\\n}\\n\\n.system-log .status.item .time {\\n color: gray;\\n}\\n\\n.system-log .status.item .label {\\n color: gray;\\n margin-right: 3px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import EventConstants from 'constants/EventConstants';\nimport SocketService from 'services/SocketService';\nimport AccessConstants from 'constants/AccessConstants';\n\nimport * as UI from 'types/ui';\nimport IconConstants from 'constants/IconConstants';\n\nexport const EventClearAction = {\n id: 'clear',\n displayName: 'Clear',\n access: AccessConstants.EVENTS_EDIT,\n icon: IconConstants.CLEAR,\n handler: () => {\n return SocketService.delete(EventConstants.MESSAGES_URL);\n },\n};\n\nexport const EventActions: UI.ActionListType<undefined> = {\n clear: EventClearAction,\n};\n\nexport const EventActionModule = {\n moduleId: UI.Modules.EVENTS,\n};\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';\n\nimport Loader from 'components/semantic/Loader';\n\nimport Message from 'components/semantic/Message';\nimport MessageView from 'components/messages/MessageView';\n\nimport '../style.css';\n\nimport * as UI from 'types/ui';\nimport { translate } from 'utils/TranslationUtils';\nimport EventStore from 'stores/EventStore';\n\ninterface EventMessagesProps {\n messages: UI.MessageListItem[];\n t: UI.TranslateF;\n}\n\nconst EventMessageView: React.FC<EventMessagesProps> = ({ messages, t }) => {\n if (!messages) {\n return <Loader text={translate('Loading messages', t, UI.Modules.EVENTS)} />;\n }\n\n if (messages.length === 0) {\n return (\n <Message description={translate('No messages to show', t, UI.Modules.EVENTS)} />\n );\n }\n\n return (\n <MessageView\n className=\"events\"\n messages={messages}\n scrollPositionHandler={EventStore}\n t={t}\n />\n );\n};\n\nexport default EventMessageView;\n","import { useEffect, memo } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport EventAPIActions from 'actions/reflux/EventActions';\r\nimport { EventActionModule, EventClearAction } from 'actions/ui/event/EventActions';\r\n\r\nimport EventStore from 'stores/EventStore';\r\n\r\nimport LayoutHeader from 'components/semantic/LayoutHeader';\r\nimport ActionButton from 'components/ActionButton';\r\n\r\nimport '../style.css';\r\nimport EventMessageView from 'routes/Sidebar/routes/Events/components/EventMessageView';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport { useStore } from 'effects/StoreListenerEffect';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translate } from 'utils/TranslationUtils';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nconst SystemLog: React.FC = memo(\r\n function SystemLog() {\r\n useEffect(() => {\r\n EventAPIActions.setActive(true);\r\n EventAPIActions.setRead();\r\n\r\n if (!EventStore.isInitialized()) {\r\n EventAPIActions.fetchMessages();\r\n }\r\n\r\n return () => EventAPIActions.setActive(false);\r\n }, []);\r\n\r\n const { t } = useTranslation();\r\n const messages = useStore<UI.MessageListItem[]>(EventStore);\r\n return (\r\n <div className=\"simple-layout\">\r\n <div className=\"wrapper\">\r\n <LayoutHeader\r\n icon={IconConstants.EVENTS_COLORED}\r\n title={translate('Events', t, UI.Modules.EVENTS)}\r\n rightComponent={\r\n <ActionButton\r\n action={EventClearAction}\r\n moduleData={EventActionModule}\r\n icon={null}\r\n />\r\n }\r\n />\r\n <div className=\"ui divider top\" />\r\n <div className=\"layout-content system-log\">\r\n <EventMessageView messages={messages} t={t} />\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n () => true,\r\n);\r\n\r\nexport default SystemLog;\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","EventClearAction","displayName","access","AccessConstants","A","EVENTS_EDIT","icon","IconConstants","CLEAR","handler","SocketService","delete","EventConstants","MESSAGES_URL","EventActionModule","moduleId","EVENTS","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","messages","t","length","Message","description","MessageView","className","scrollPositionHandler","EventStore","Loader","text","memo","useEffect","setActive","setRead","isInitialized","fetchMessages","LayoutHeader","EVENTS_COLORED","title","rightComponent","ActionButton","action","moduleData"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"js/system-log.3efd872fbf4a90cde8d5.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,21BAqDtC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,0DAA0D,MAAQ,GAAG,SAAW,oYAAoY,eAAiB,CAAC,41BAA41B,WAAa,MAE72C,S,0ICrDO,MAAMC,EAAmB,CAC9BD,GAAI,QACJE,YAAa,QACbC,OAAQC,EAAAC,EAAgBC,YACxBC,KAAMC,EAAA,EAAcC,MACpBC,QAAS,IACAC,EAAA,EAAcC,OAAOC,EAAA,EAAeC,eAQlCC,EAAoB,CAC/BC,SAAU,KAAWC,Q,wKCXnBC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IACxBF,EAAQG,OAAS,SAAc,KAAM,QACrCH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,O,gDCN1D,MAqBA,EArBuD,EAAGC,WAAUC,KAC7DD,EAImB,IAApBA,EAASE,QAET,SAACC,EAAA,EAAO,CAACC,aAAa,QAAU,sBAAuBH,EAAG,KAAWT,WAKvE,SAACa,EAAA,EAAW,CACVC,UAAU,SACVN,SAAUA,EACVO,sBAAuBC,EAAA,EACvBP,KAdK,SAACQ,EAAA,EAAM,CAACC,MAAM,QAAU,mBAAoBT,EAAG,KAAWT,U,0BCCrE,MAwCA,GAxC4B,IAAAmB,OAC1B,YACE,IAAAC,YAAU,KACR,IAAgBC,WAAU,GAC1B,IAAgBC,UAEXN,EAAA,EAAWO,iBACd,IAAgBC,gBAGX,IAAM,IAAgBH,WAAU,KACtC,IAEH,MAAM,EAAEZ,IAAM,UACRD,GAAW,OAA+BQ,EAAA,GAChD,OACE,gBAAKF,UAAU,gBAAe,UAC5B,iBAAKA,UAAU,UAAS,WACtB,SAACW,EAAA,EAAY,CACXnC,KAAMC,EAAA,EAAcmC,eACpBC,OAAO,QAAU,SAAUlB,EAAG,KAAWT,QACzC4B,gBACE,SAACC,EAAAzC,EAAY,CACX0C,OAAQ9C,EACR+C,WAAYjC,EACZR,KAAM,UAIZ,gBAAKwB,UAAU,oBACf,gBAAKA,UAAU,4BAA2B,UACxC,SAAC,EAAgB,CAACN,SAAUA,EAAUC,EAAGA,UAKnD,IACA,KAAM,G","sources":["webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/style.css","webpack://airdcpp-webui/./src/actions/ui/event/EventActions.ts","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/style.css?eea1","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/components/EventMessageView.tsx","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Events/components/EventsLayout.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, `.simple-layout {\n height: 100%;\n padding: 20px;\n margin-left: auto;\n margin-right: auto;\n background-color: white;\n}\n\n.simple-layout > div {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.simple-layout .layout-content {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1 1 100%;\n}\n\n.simple-layout .layout-content > div {\n width: 100%;\n}\n\n.simple-layout .divider.top {\n margin-bottom: 0px;\n}\n\n/* Message layout */\n.system-log .message-list {\n width: 100%;\n margin: 10px 0px !important;\n}\n\n.system-log .status.item i {\n float: left;\n}\n\n.system-log .status.item .text {\n margin-top: 5px;\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.system-log .status.item .time {\n color: gray;\n}\n\n.system-log .status.item .label {\n color: gray;\n margin-right: 3px;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Sidebar/routes/Events/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,WAAW;EACX,2BAA2B;AAC7B;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,eAAe;EACf,mBAAmB;EACnB,gBAAgB;AAClB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,WAAW;EACX,iBAAiB;AACnB\",\"sourcesContent\":[\".simple-layout {\\n height: 100%;\\n padding: 20px;\\n margin-left: auto;\\n margin-right: auto;\\n background-color: white;\\n}\\n\\n.simple-layout > div {\\n display: flex;\\n flex-direction: column;\\n height: 100%;\\n}\\n\\n.simple-layout .layout-content {\\n display: flex;\\n flex-direction: column;\\n overflow-y: auto;\\n flex: 1 1 100%;\\n}\\n\\n.simple-layout .layout-content > div {\\n width: 100%;\\n}\\n\\n.simple-layout .divider.top {\\n margin-bottom: 0px;\\n}\\n\\n/* Message layout */\\n.system-log .message-list {\\n width: 100%;\\n margin: 10px 0px !important;\\n}\\n\\n.system-log .status.item i {\\n float: left;\\n}\\n\\n.system-log .status.item .text {\\n margin-top: 5px;\\n margin-bottom: 10px;\\n overflow: hidden;\\n}\\n\\n.system-log .status.item .time {\\n color: gray;\\n}\\n\\n.system-log .status.item .label {\\n color: gray;\\n margin-right: 3px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import EventConstants from 'constants/EventConstants';\nimport SocketService from 'services/SocketService';\nimport AccessConstants from 'constants/AccessConstants';\n\nimport * as UI from 'types/ui';\nimport IconConstants from 'constants/IconConstants';\n\nexport const EventClearAction = {\n id: 'clear',\n displayName: 'Clear',\n access: AccessConstants.EVENTS_EDIT,\n icon: IconConstants.CLEAR,\n handler: () => {\n return SocketService.delete(EventConstants.MESSAGES_URL);\n },\n};\n\nexport const EventActions: UI.ActionListType<undefined> = {\n clear: EventClearAction,\n};\n\nexport const EventActionModule = {\n moduleId: UI.Modules.EVENTS,\n};\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';\n\nimport Loader from 'components/semantic/Loader';\n\nimport Message from 'components/semantic/Message';\nimport MessageView from 'components/messages/MessageView';\n\nimport '../style.css';\n\nimport * as UI from 'types/ui';\nimport { translate } from 'utils/TranslationUtils';\nimport EventStore from 'stores/EventStore';\n\ninterface EventMessagesProps {\n messages: UI.MessageListItem[];\n t: UI.TranslateF;\n}\n\nconst EventMessageView: React.FC<EventMessagesProps> = ({ messages, t }) => {\n if (!messages) {\n return <Loader text={translate('Loading messages', t, UI.Modules.EVENTS)} />;\n }\n\n if (messages.length === 0) {\n return (\n <Message description={translate('No messages to show', t, UI.Modules.EVENTS)} />\n );\n }\n\n return (\n <MessageView\n className=\"events\"\n messages={messages}\n scrollPositionHandler={EventStore}\n t={t}\n />\n );\n};\n\nexport default EventMessageView;\n","import { useEffect, memo } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport EventAPIActions from 'actions/reflux/EventActions';\r\nimport { EventActionModule, EventClearAction } from 'actions/ui/event/EventActions';\r\n\r\nimport EventStore from 'stores/EventStore';\r\n\r\nimport LayoutHeader from 'components/semantic/LayoutHeader';\r\nimport ActionButton from 'components/ActionButton';\r\n\r\nimport '../style.css';\r\nimport EventMessageView from 'routes/Sidebar/routes/Events/components/EventMessageView';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport { useStore } from 'effects/StoreListenerEffect';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translate } from 'utils/TranslationUtils';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nconst SystemLog: React.FC = memo(\r\n function SystemLog() {\r\n useEffect(() => {\r\n EventAPIActions.setActive(true);\r\n EventAPIActions.setRead();\r\n\r\n if (!EventStore.isInitialized()) {\r\n EventAPIActions.fetchMessages();\r\n }\r\n\r\n return () => EventAPIActions.setActive(false);\r\n }, []);\r\n\r\n const { t } = useTranslation();\r\n const messages = useStore<UI.MessageListItem[]>(EventStore);\r\n return (\r\n <div className=\"simple-layout\">\r\n <div className=\"wrapper\">\r\n <LayoutHeader\r\n icon={IconConstants.EVENTS_COLORED}\r\n title={translate('Events', t, UI.Modules.EVENTS)}\r\n rightComponent={\r\n <ActionButton\r\n action={EventClearAction}\r\n moduleData={EventActionModule}\r\n icon={null}\r\n />\r\n }\r\n />\r\n <div className=\"ui divider top\" />\r\n <div className=\"layout-content system-log\">\r\n <EventMessageView messages={messages} t={t} />\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n () => true,\r\n);\r\n\r\nexport default SystemLog;\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","EventClearAction","displayName","access","AccessConstants","A","EVENTS_EDIT","icon","IconConstants","CLEAR","handler","SocketService","delete","EventConstants","MESSAGES_URL","EventActionModule","moduleId","EVENTS","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","messages","t","length","Message","description","MessageView","className","scrollPositionHandler","EventStore","Loader","text","memo","useEffect","setActive","setRead","isInitialized","fetchMessages","LayoutHeader","EVENTS_COLORED","title","rightComponent","ActionButton","action","moduleData"],"sourceRoot":""}
|
package/dist/js/{transfers.22bad3799f0455da946b.chunk.js → transfers.326119d8de6e6f8176b5.chunk.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[629],{9538:(e,t,s)=>{s.d(t,{A:()=>i});var n=s(71354),r=s.n(n),a=s(76314),o=s.n(a)()(r());o.push([e.id,".status .error {\n color: red;\n}\n\n.transfer.status .target {\n word-break: break-all;\n}\n","",{version:3,sources:["webpack://./src/routes/Transfers/style.css"],names:[],mappings:"AAAA;EACE,UAAU;AACZ;;AAEA;EACE,qBAAqB;AACvB",sourcesContent:[".status .error {\n color: red;\n}\n\n.transfer.status .target {\n word-break: break-all;\n}\n"],sourceRoot:""}]);const i=o},89478:(e,t,s)=>{s.d(t,{Hi:()=>p,ew:()=>m});var n=s(58059),r=s(
|
|
2
|
-
//# sourceMappingURL=transfers.
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[629],{9538:(e,t,s)=>{s.d(t,{A:()=>i});var n=s(71354),r=s.n(n),a=s(76314),o=s.n(a)()(r());o.push([e.id,".status .error {\n color: red;\n}\n\n.transfer.status .target {\n word-break: break-all;\n}\n","",{version:3,sources:["webpack://./src/routes/Transfers/style.css"],names:[],mappings:"AAAA;EACE,UAAU;AACZ;;AAEA;EACE,qBAAqB;AACvB",sourcesContent:[".status .error {\n color: red;\n}\n\n.transfer.status .target {\n word-break: break-all;\n}\n"],sourceRoot:""}]);const i=o},89478:(e,t,s)=>{s.d(t,{Hi:()=>p,ew:()=>m});var n=s(58059),r=s(32811),a=s(4425),o=s(86038),i=s(67749),c=s(47450);const l={id:"search",displayName:"Search (foreground)",access:o.US.SEARCH,icon:a.A.SEARCH,handler:({itemData:e,location:t,navigate:s})=>c.A.search(e,t,s)},d={id:"searchAlternates",displayName:"Search for alternates",access:o.US.QUEUE_EDIT,icon:a.A.SEARCH_ALTERNATES,filter:({itemData:e})=>0===e.time_finished,handler:({itemData:e})=>r.A.post(`${n.A.FILES_URL}/${e.id}/search`)},m={id:"remove",displayName:"Remove",access:o.US.QUEUE_EDIT,icon:a.A.REMOVE,confirmation:{content:"Are you sure that you want to remove the file {{item.name}}?",approveCaption:"Remove file",rejectCaption:"Don't remove",checkboxCaption:"Remove on disk"},handler:({itemData:e},t)=>r.A.post(`${n.A.FILES_URL}/${e.id}/remove`,{remove_finished:t}),notifications:{onSuccess:"File {{item.name}} was removed from queue"}},u={search:l,searchFileAlternates:d,removeFile:m},p={moduleData:{moduleId:i.KV.QUEUE},actions:u}},34395:(e,t,s)=>{s.d(t,{JN:()=>c});var n=s(58059),r=s(32811),a=s(4425),o=s(86038),i=s(67749);const c={id:"removeSource",displayName:"Remove user from queue",access:o.US.QUEUE_EDIT,icon:a.A.REMOVE,handler:({itemData:e})=>r.A.delete(`${n.A.SOURCES_URL}/${e.cid}`),notifications:{onSuccess:"The user {{user.nicks}} was removed from {{result.count}} files"}};i.KV.QUEUE},85208:(e,t,s)=>{s.d(t,{A:()=>y});var n=s(74848),r=s(5556),a=s.n(r),o=s(96540),i=s(82388),c=s(67749),l=s(32389),d=s(42695),m=s(83994),u=s(4425);const p=e=>{const t=e.str.match(/TLSv([\d.]+)/);return t&&2===t.length&&parseFloat(t[1])<1.2?{iconColor:"orange",messageColor:"red",message:"Outdated cryptographic protocol with known security vulnerabilities",cornerIcon:"orange warning",translationKey:"tlsOutdatedWarning"}:e.trusted?{iconColor:"green",messageColor:"green",message:"Authenticity of the certificate is validated",cornerIcon:"",translationKey:"tlsOk"}:{iconColor:"yellow",messageColor:"orange",message:"Authenticity of the certificate could not be validated",cornerIcon:"blue help",translationKey:"tlsAuthenticityWarning"}},A=({info:e,encryption:t})=>(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:t.str}),(0,n.jsx)("p",{style:{color:e.messageColor},children:(0,n.jsx)(l.x6,{i18nKey:(0,d.j2)(e.translationKey,c.KV.COMMON),children:e.message})})]});class h extends o.PureComponent{constructor(){super(...arguments),this.getChildren=()=>{const{encryption:e}=this.props,t=p(e);return(0,n.jsx)(A,{info:t,encryption:e})}}render(){const{encryption:e,alwaysVisible:t,boundary:s}=this.props;if(!e)return!!t&&(0,n.jsx)(m.A,{color:"grey",icon:u.A.LOCK});const r=p(e);return(0,n.jsx)(i.A,{triggerClassName:"encryption",className:"basic encryption content",trigger:(0,n.jsx)(m.A,{color:r.iconColor,icon:u.A.LOCK,cornerIcon:r.cornerIcon}),settings:{boundary:s},children:this.getChildren})}}h.propTypes={encryption:a().object,boundary:a().string,alwaysVisible:a().bool};const y=h},25364:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(74848),r=s(5556),a=s.n(r),o=(s(96540),s(46942)),i=s.n(o);const c=({className:e,percent:t,caption:s})=>(0,n.jsxs)("div",{className:i()("ui progress",e,{indeterminate:void 0===t}),"data-percent":t,children:[(0,n.jsx)("div",{className:"bar",style:{transitionDuration:"300ms",width:void 0===t?void 0:t+"%",minWidth:"0px"},children:(0,n.jsx)("div",{className:"progress"})}),!!s&&(0,n.jsx)("div",{className:"label",children:s})]});c.propTypes={percent:a().number.isRequired,caption:a().node.isRequired,className:a().string};const l=c},52744:(e,t,s)=>{s.r(t),s.d(t,{default:()=>ue});var n=s(74848),r=s(96540),a=s(22005),o=s.n(a),i=s(36671),c=s(52267);const l=o().createStore({_viewName:"transfer_view",_apiUrl:i.A.MODULE_URL,mixins:[(0,c.A)("user")]});var d=s(32728),m=s(39798),u=s(82388);const p=({cellData:e,rowData:t})=>(0,n.jsx)(u.A,{triggerClassName:"name",className:"basic target",trigger:e,children:(0,n.jsx)("div",{children:t.target})});class A extends r.Component{shouldComponentUpdate(e){return e.cellData!==this.props.cellData}render(){const{cellData:e,rowDataGetter:t}=this.props;if(!e)return null;const s=t();return s.type?(0,n.jsx)(m.A,{typeInfo:s.type,caption:(0,n.jsx)(p,{cellData:e,rowData:s})}):null}}const h=A;var y=s(46942),f=s.n(y),g=s(25364),x=s(85208),E=s(99347),v=s(86038);const N=(e,t)=>{const s=e.id;return f()({grey:s===v.ZA.WAITING},{blue:s===v.ZA.RUNNING&&t.download},{red:s===v.ZA.RUNNING&&!t.download},{green:s===v.ZA.FINISHED&&t.download},{brown:s===v.ZA.FINISHED&&!t.download},{red:s===v.ZA.FAILED})},j=({cellData:e,rowDataGetter:t})=>{if(e.id===v.ZA.WAITING)return(0,n.jsx)(E.A,{size:"small",inline:!0,text:e.str});if(e.id===v.ZA.FAILED)return(0,n.jsx)("span",{className:"error",children:e.str});const s=t();let r=e.str;return s.encryption&&(r=(0,n.jsxs)("span",{className:"transfer status encryption",children:[(0,n.jsx)(x.A,{encryption:s.encryption}),r]})),(0,n.jsx)(g.A,{className:N(e,s),caption:r,percent:100*s.bytes_transferred/s.size})};var w=s(86668),D=s(71352),S=s(4425),R=s(39115),b=s(32811),C=s(34395),I=s(89478),U=s(67749),O=s(48844),T=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(s[n[r]]=e[n[r]])}return s};const F=({itemData:e})=>e.download,_=({itemData:e})=>e.status.id===i.S.FINISHED,K={id:"force",displayName:"Force connect",access:v.US.TRANSFERS,icon:S.A.REFRESH_COLORED,filter:F,handler:({itemData:e})=>b.A.post(`${i.A.TRANSFERS_URL}/${e.id}/force`)},V={id:"disconnect",displayName:"Disconnect",access:v.US.TRANSFERS,icon:S.A.DISCONNECT,filter:F,handler:({itemData:e})=>b.A.post(`${i.A.TRANSFERS_URL}/${e.id}/disconnect`)},L={id:"removeFile",displayName:"Remove file from queue",access:v.US.QUEUE_EDIT,icon:S.A.REMOVE,filter:e=>F(e)&&(({itemData:e})=>!!e.type&&"filelist"===e.type.content_type)(e)&&!_(e),handler:e=>{var{itemData:t}=e,s=T(e,["itemData"]);return I.ew.handler(Object.assign({itemData:{id:t.queue_file_id,target:t.target,name:t.name}},s))},notifications:{onSuccess:"File {{item.name}} was removed from queue"}},P={id:"removeSource",displayName:"Remove user from queue",access:v.US.QUEUE_EDIT,icon:S.A.REMOVE,filter:e=>F(e)&&!_(e),handler:e=>{var{itemData:t}=e,s=T(e,["itemData"]);return C.JN.handler(Object.assign({itemData:Object.assign(Object.assign({},t.user),{id:t.user.cid,hub_urls:[t.user.hub_url],flags:t.user.flags})},s))},notifications:{onSuccess:"The user {{item.user.nicks}} was removed from {{result.count}} files"}},k={force:K,disconnect:V,divider:O.o,removeFile:L,removeSource:P},G={moduleData:{moduleId:U.KV.TRANSFERS},actions:k},$=({cellData:e,rowData:t})=>(0,n.jsxs)("div",{className:"transfer-user icon-caption",children:[(0,n.jsx)("i",{className:f()(t.download?S.A.DOWNLOAD:S.A.UPLOAD,"large icon")}),e.nicks]});class q extends r.Component{shouldComponentUpdate(e){return e.cellData!==this.props.cellData}render(){const{cellData:e,rowDataGetter:t}=this.props;return(0,n.jsx)(D.F$,{user:e,userIcon:null,ids:w.F9,text:(0,n.jsx)($,{rowData:t(),cellData:e}),remoteMenuId:R.Ay.HINTED_USER,children:(0,n.jsx)(D.yj,{itemData:t,actions:G,remoteMenuId:R.Ay.TRANSFER})})}}const H=q;var M=s(68465),W=s(22373),Z=s(44247),Q=s(85072),z=s.n(Q),B=s(97825),J=s.n(B),X=s(77659),Y=s.n(X),ee=s(55056),te=s.n(ee),se=s(10540),ne=s.n(se),re=s(41113),ae=s.n(re),oe=s(9538),ie={};ie.styleTagTransform=ae(),ie.setAttributes=te(),ie.insert=Y().bind(null,"head"),ie.domAPI=J(),ie.insertStyleElement=ne(),z()(oe.A,ie),oe.A&&oe.A.locals&&oe.A.locals;var ce=s(32389),le=s(42695);const de=({cellData:e})=>(0,n.jsx)("span",{className:"plain flags cell",children:e.join("")});class me extends r.Component{constructor(){super(...arguments),this.isPositive=e=>e>0,this.isRunning=(e,t)=>t.speed>0,this.emptyRowsNodeGetter=()=>{const{t:e}=this.props;return(0,n.jsx)(d.A,{title:(0,le.Tl)("No active transfers",e,U.KV.TRANSFERS),icon:S.A.TRANSFERS_PLAIN})}}render(){return(0,n.jsxs)(W.A,{emptyRowsNodeGetter:this.emptyRowsNodeGetter,store:l,moduleId:U.KV.TRANSFERS,children:[(0,n.jsx)(M.VP,{name:"User",width:150,flexGrow:4,columnKey:"user",cell:(0,n.jsx)(H,{})}),(0,n.jsx)(M.VP,{name:"Name",width:150,flexGrow:4,columnKey:"name",cell:(0,n.jsx)(h,{})}),(0,n.jsx)(M.VP,{name:"Segment",width:65,columnKey:"size",cell:(0,n.jsx)(Z.us,{}),renderCondition:this.isPositive,flexGrow:1}),(0,n.jsx)(M.VP,{name:"Status",width:140,flexGrow:4,columnKey:"status",cell:(0,n.jsx)(j,{})}),(0,n.jsx)(M.VP,{name:"Time left",width:50,columnKey:"seconds_left",renderCondition:this.isRunning,cell:(0,n.jsx)(Z.WQ,{})}),(0,n.jsx)(M.VP,{name:"Speed",width:50,columnKey:"speed",cell:(0,n.jsx)(Z.kF,{}),renderCondition:this.isRunning,flexGrow:1}),(0,n.jsx)(M.VP,{name:"Flags",width:50,columnKey:"flags",cell:(0,n.jsx)(de,{}),renderCondition:this.isRunning,flexGrow:1,hideWidth:800}),(0,n.jsx)(M.VP,{name:"IP",width:120,columnKey:"ip",flexGrow:1,cell:(0,n.jsx)(Z.In,{}),hideWidth:1e3})]})}}me.displayName="Transfers";const ue=(0,ce.CI)()(me)}}]);
|
|
2
|
+
//# sourceMappingURL=transfers.326119d8de6e6f8176b5.chunk.js.map
|
|
Binary file
|