airdcpp-webui 2.12.0-beta.3 → 2.12.0
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/.eslintrc.js +61 -61
- package/dist/index.html +1 -1
- package/dist/js/285.f568d215104be4fb06eb.chunk.js +2 -0
- package/dist/js/285.f568d215104be4fb06eb.chunk.js.gz +0 -0
- package/dist/js/285.f568d215104be4fb06eb.chunk.js.map +1 -0
- package/dist/js/317.54d6dded7430f84fd4a7.chunk.js +2 -0
- package/dist/js/317.54d6dded7430f84fd4a7.chunk.js.gz +0 -0
- package/dist/js/317.54d6dded7430f84fd4a7.chunk.js.map +1 -0
- package/dist/js/424.b9b775d50fbed2ec85ca.chunk.js +2 -0
- package/dist/js/424.b9b775d50fbed2ec85ca.chunk.js.gz +0 -0
- package/dist/js/424.b9b775d50fbed2ec85ca.chunk.js.map +1 -0
- package/dist/js/668.0d2ed46d1147385f6482.chunk.js +2 -0
- package/dist/js/668.0d2ed46d1147385f6482.chunk.js.gz +0 -0
- package/dist/js/668.0d2ed46d1147385f6482.chunk.js.map +1 -0
- package/dist/js/69.00e5adf1f76437e343f2.chunk.js +2 -0
- package/dist/js/69.00e5adf1f76437e343f2.chunk.js.gz +0 -0
- package/dist/js/69.00e5adf1f76437e343f2.chunk.js.map +1 -0
- package/dist/js/{702.2a6693aead40337b625c.chunk.js → 702.87b71d34ebd167d76c3b.chunk.js} +1 -1
- package/dist/js/702.87b71d34ebd167d76c3b.chunk.js.gz +0 -0
- package/dist/js/{702.2a6693aead40337b625c.chunk.js.map → 702.87b71d34ebd167d76c3b.chunk.js.map} +1 -1
- package/dist/js/{760.774900fa62b9e66b5ff7.chunk.js → 760.1679cba4f653d07819f3.chunk.js} +3 -3
- package/dist/js/760.1679cba4f653d07819f3.chunk.js.gz +0 -0
- package/dist/js/760.1679cba4f653d07819f3.chunk.js.map +1 -0
- package/dist/js/favorite-hubs.9c69b40155edc72e69bb.chunk.js +2 -0
- package/dist/js/favorite-hubs.9c69b40155edc72e69bb.chunk.js.gz +0 -0
- package/dist/js/favorite-hubs.9c69b40155edc72e69bb.chunk.js.map +1 -0
- package/dist/js/filelists.799bae07549950c8bdce.chunk.js +2 -0
- package/dist/js/filelists.799bae07549950c8bdce.chunk.js.gz +0 -0
- package/dist/js/filelists.799bae07549950c8bdce.chunk.js.map +1 -0
- package/dist/js/files.c723dabab26e48d06683.chunk.js +2 -0
- package/dist/js/files.c723dabab26e48d06683.chunk.js.gz +0 -0
- package/dist/js/files.c723dabab26e48d06683.chunk.js.map +1 -0
- package/dist/js/home.1bfba76cdbb2fc7194dc.chunk.js +3 -0
- package/dist/js/home.1bfba76cdbb2fc7194dc.chunk.js.gz +0 -0
- package/dist/js/{home.7b6595492d6f4a0507e5.chunk.js.map → home.1bfba76cdbb2fc7194dc.chunk.js.map} +1 -1
- package/dist/js/hubs.99a089268648607f734d.chunk.js +2 -0
- package/dist/js/hubs.99a089268648607f734d.chunk.js.gz +0 -0
- package/dist/js/hubs.99a089268648607f734d.chunk.js.map +1 -0
- package/dist/js/main.560335911ba879ef8877.entry.js +3 -0
- package/dist/js/{main.01d94b76f3ff04c0ccd0.entry.js.LICENSE.txt → main.560335911ba879ef8877.entry.js.LICENSE.txt} +2 -16
- package/dist/js/main.560335911ba879ef8877.entry.js.gz +0 -0
- package/dist/js/main.560335911ba879ef8877.entry.js.map +1 -0
- package/dist/js/messages.1fff9c30585362386309.chunk.js +2 -0
- package/dist/js/messages.1fff9c30585362386309.chunk.js.gz +0 -0
- package/dist/js/messages.1fff9c30585362386309.chunk.js.map +1 -0
- package/dist/js/queue.822b774c6541212741c2.chunk.js +2 -0
- package/dist/js/queue.822b774c6541212741c2.chunk.js.gz +0 -0
- package/dist/js/queue.822b774c6541212741c2.chunk.js.map +1 -0
- package/dist/js/search.6a9813389fd4fec46997.chunk.js +2 -0
- package/dist/js/search.6a9813389fd4fec46997.chunk.js.gz +0 -0
- package/dist/js/search.6a9813389fd4fec46997.chunk.js.map +1 -0
- package/dist/js/settings.809f0f5d0b8ca408ae54.chunk.js +2 -0
- package/dist/js/settings.809f0f5d0b8ca408ae54.chunk.js.gz +0 -0
- package/dist/js/settings.809f0f5d0b8ca408ae54.chunk.js.map +1 -0
- package/dist/js/share.d66035dc828b2f3c8bb0.chunk.js +2 -0
- package/dist/js/share.d66035dc828b2f3c8bb0.chunk.js.gz +0 -0
- package/dist/js/share.d66035dc828b2f3c8bb0.chunk.js.map +1 -0
- package/dist/js/system-log.b6bc274d7fb71714ca24.chunk.js +2 -0
- package/dist/js/system-log.b6bc274d7fb71714ca24.chunk.js.gz +0 -0
- package/dist/js/system-log.b6bc274d7fb71714ca24.chunk.js.map +1 -0
- package/dist/js/transfers.8d1840e604ad0e4c0c15.chunk.js +2 -0
- package/dist/js/transfers.8d1840e604ad0e4c0c15.chunk.js.gz +0 -0
- package/dist/js/transfers.8d1840e604ad0e4c0c15.chunk.js.map +1 -0
- package/dist/sw.js +1 -1
- package/dist/sw.js.gz +0 -0
- package/dist/sw.js.map +1 -1
- package/jest.config.js +18 -18
- package/package.json +1 -1
- package/dist/js/285.4cfd5122e0b82af77eb1.chunk.js +0 -2
- package/dist/js/285.4cfd5122e0b82af77eb1.chunk.js.gz +0 -0
- package/dist/js/285.4cfd5122e0b82af77eb1.chunk.js.map +0 -1
- package/dist/js/317.97fabbc4a91be88219d3.chunk.js +0 -2
- package/dist/js/317.97fabbc4a91be88219d3.chunk.js.gz +0 -0
- package/dist/js/317.97fabbc4a91be88219d3.chunk.js.map +0 -1
- package/dist/js/424.5cc8383701bc3226c5ff.chunk.js +0 -2
- package/dist/js/424.5cc8383701bc3226c5ff.chunk.js.gz +0 -0
- package/dist/js/424.5cc8383701bc3226c5ff.chunk.js.map +0 -1
- package/dist/js/668.294ae7e2a9db78b421b0.chunk.js +0 -2
- package/dist/js/668.294ae7e2a9db78b421b0.chunk.js.gz +0 -0
- package/dist/js/668.294ae7e2a9db78b421b0.chunk.js.map +0 -1
- package/dist/js/69.3e693915ecfb45fce6ea.chunk.js +0 -2
- package/dist/js/69.3e693915ecfb45fce6ea.chunk.js.gz +0 -0
- package/dist/js/69.3e693915ecfb45fce6ea.chunk.js.map +0 -1
- package/dist/js/702.2a6693aead40337b625c.chunk.js.gz +0 -0
- package/dist/js/760.774900fa62b9e66b5ff7.chunk.js.gz +0 -0
- package/dist/js/760.774900fa62b9e66b5ff7.chunk.js.map +0 -1
- package/dist/js/favorite-hubs.ddb9d9755d235cae74ad.chunk.js +0 -2
- package/dist/js/favorite-hubs.ddb9d9755d235cae74ad.chunk.js.gz +0 -0
- package/dist/js/favorite-hubs.ddb9d9755d235cae74ad.chunk.js.map +0 -1
- package/dist/js/filelists.938ca2c1834d7e4b5f31.chunk.js +0 -2
- package/dist/js/filelists.938ca2c1834d7e4b5f31.chunk.js.gz +0 -0
- package/dist/js/filelists.938ca2c1834d7e4b5f31.chunk.js.map +0 -1
- package/dist/js/files.c17b77223a4f8de80f1b.chunk.js +0 -2
- package/dist/js/files.c17b77223a4f8de80f1b.chunk.js.gz +0 -0
- package/dist/js/files.c17b77223a4f8de80f1b.chunk.js.map +0 -1
- package/dist/js/home.7b6595492d6f4a0507e5.chunk.js +0 -3
- package/dist/js/home.7b6595492d6f4a0507e5.chunk.js.gz +0 -0
- package/dist/js/hubs.2dbce9b35aa07bab9189.chunk.js +0 -2
- package/dist/js/hubs.2dbce9b35aa07bab9189.chunk.js.gz +0 -0
- package/dist/js/hubs.2dbce9b35aa07bab9189.chunk.js.map +0 -1
- package/dist/js/locales/en-webui-main-missing-json.0a7b6ea1f0a5eeaa5735.chunk.js +0 -1
- package/dist/js/locales/en-webui-main-missing-json.0a7b6ea1f0a5eeaa5735.chunk.js.gz +0 -0
- package/dist/js/main.01d94b76f3ff04c0ccd0.entry.js +0 -3
- package/dist/js/main.01d94b76f3ff04c0ccd0.entry.js.gz +0 -0
- package/dist/js/main.01d94b76f3ff04c0ccd0.entry.js.map +0 -1
- package/dist/js/messages.a761c7b81ebb0be1c6b9.chunk.js +0 -2
- package/dist/js/messages.a761c7b81ebb0be1c6b9.chunk.js.gz +0 -0
- package/dist/js/messages.a761c7b81ebb0be1c6b9.chunk.js.map +0 -1
- package/dist/js/queue.20fe8967cbdac914688a.chunk.js +0 -2
- package/dist/js/queue.20fe8967cbdac914688a.chunk.js.gz +0 -0
- package/dist/js/queue.20fe8967cbdac914688a.chunk.js.map +0 -1
- package/dist/js/search.62d97eef6ffbc4438ca7.chunk.js +0 -2
- package/dist/js/search.62d97eef6ffbc4438ca7.chunk.js.gz +0 -0
- package/dist/js/search.62d97eef6ffbc4438ca7.chunk.js.map +0 -1
- package/dist/js/settings.b9a77fec5bd9bf0f744c.chunk.js +0 -2
- package/dist/js/settings.b9a77fec5bd9bf0f744c.chunk.js.gz +0 -0
- package/dist/js/settings.b9a77fec5bd9bf0f744c.chunk.js.map +0 -1
- package/dist/js/share.3f04c8697ad367c0ecf6.chunk.js +0 -2
- package/dist/js/share.3f04c8697ad367c0ecf6.chunk.js.gz +0 -0
- package/dist/js/share.3f04c8697ad367c0ecf6.chunk.js.map +0 -1
- package/dist/js/system-log.9ccbd9a5982afcb71dfa.chunk.js +0 -2
- package/dist/js/system-log.9ccbd9a5982afcb71dfa.chunk.js.gz +0 -0
- package/dist/js/system-log.9ccbd9a5982afcb71dfa.chunk.js.map +0 -1
- package/dist/js/transfers.5fbe0929649dc0893737.chunk.js +0 -2
- package/dist/js/transfers.5fbe0929649dc0893737.chunk.js.gz +0 -0
- package/dist/js/transfers.5fbe0929649dc0893737.chunk.js.map +0 -1
- package/package - Copy.json +0 -156
- /package/dist/js/{760.774900fa62b9e66b5ff7.chunk.js.LICENSE.txt → 760.1679cba4f653d07819f3.chunk.js.LICENSE.txt} +0 -0
- /package/dist/js/{home.7b6595492d6f4a0507e5.chunk.js.LICENSE.txt → home.1bfba76cdbb2fc7194dc.chunk.js.LICENSE.txt} +0 -0
- /package/dist/js/locales/{ca-webui-main-json.6c149a10d6e263315d7f.chunk.js → ca-webui-main-json.e4a9ae36d6beb98c0057.chunk.js} +0 -0
- /package/dist/js/locales/{ca-webui-main-json.6c149a10d6e263315d7f.chunk.js.gz → ca-webui-main-json.e4a9ae36d6beb98c0057.chunk.js.gz} +0 -0
- /package/dist/js/locales/{da-webui-main-json.0ceb448ebe8d59d24573.chunk.js → da-webui-main-json.a08bb8db90fc33844135.chunk.js} +0 -0
- /package/dist/js/locales/{da-webui-main-json.0ceb448ebe8d59d24573.chunk.js.gz → da-webui-main-json.a08bb8db90fc33844135.chunk.js.gz} +0 -0
- /package/dist/js/locales/{de-webui-main-json.5f98884f26442cd6079a.chunk.js → de-webui-main-json.6763aab78d26033bc160.chunk.js} +0 -0
- /package/dist/js/locales/{de-webui-main-json.5f98884f26442cd6079a.chunk.js.gz → de-webui-main-json.6763aab78d26033bc160.chunk.js.gz} +0 -0
- /package/dist/js/locales/{el-webui-main-json.9b9f976001b216a51d60.chunk.js → el-webui-main-json.33c629aa295c990b6816.chunk.js} +0 -0
- /package/dist/js/locales/{el-webui-main-json.9b9f976001b216a51d60.chunk.js.gz → el-webui-main-json.33c629aa295c990b6816.chunk.js.gz} +0 -0
- /package/dist/js/locales/{en-webui-main-json.d1845c8535d9a1be9ef6.chunk.js → en-webui-main-json.ae2216f8443c16155761.chunk.js} +0 -0
- /package/dist/js/locales/{en-webui-main-json.d1845c8535d9a1be9ef6.chunk.js.gz → en-webui-main-json.ae2216f8443c16155761.chunk.js.gz} +0 -0
- /package/dist/js/locales/{es-webui-main-json.c0a7f4edfd71f660b005.chunk.js → es-webui-main-json.cef003aeaf6a8669aa55.chunk.js} +0 -0
- /package/dist/js/locales/{es-webui-main-json.c0a7f4edfd71f660b005.chunk.js.gz → es-webui-main-json.cef003aeaf6a8669aa55.chunk.js.gz} +0 -0
- /package/dist/js/locales/{eu-webui-main-json.eb0383952c8ab4fb9f36.chunk.js → eu-webui-main-json.f390f35c92cc5e80723e.chunk.js} +0 -0
- /package/dist/js/locales/{eu-webui-main-json.eb0383952c8ab4fb9f36.chunk.js.gz → eu-webui-main-json.f390f35c92cc5e80723e.chunk.js.gz} +0 -0
- /package/dist/js/locales/{fi-webui-main-json.f9ff02a0b28a5fd85a5d.chunk.js → fi-webui-main-json.2c0e54d1e586d6d4cdf4.chunk.js} +0 -0
- /package/dist/js/locales/{fi-webui-main-json.f9ff02a0b28a5fd85a5d.chunk.js.gz → fi-webui-main-json.2c0e54d1e586d6d4cdf4.chunk.js.gz} +0 -0
- /package/dist/js/locales/{fr-webui-main-json.53bc9323af23410d639f.chunk.js → fr-webui-main-json.eb58b9782b184c5bd0e7.chunk.js} +0 -0
- /package/dist/js/locales/{fr-webui-main-json.53bc9323af23410d639f.chunk.js.gz → fr-webui-main-json.eb58b9782b184c5bd0e7.chunk.js.gz} +0 -0
- /package/dist/js/locales/{hu-webui-main-json.c63e9fcc09558b4fe41e.chunk.js → hu-webui-main-json.6a8b4be95cd392319f00.chunk.js} +0 -0
- /package/dist/js/locales/{hu-webui-main-json.c63e9fcc09558b4fe41e.chunk.js.gz → hu-webui-main-json.6a8b4be95cd392319f00.chunk.js.gz} +0 -0
- /package/dist/js/locales/{it-webui-main-json.59aad6c34cdff2085157.chunk.js → it-webui-main-json.ace514cb8dbf846f7bb2.chunk.js} +0 -0
- /package/dist/js/locales/{it-webui-main-json.59aad6c34cdff2085157.chunk.js.gz → it-webui-main-json.ace514cb8dbf846f7bb2.chunk.js.gz} +0 -0
- /package/dist/js/locales/{nl-webui-main-json.f4e1772f9d507c339583.chunk.js → nl-webui-main-json.99f14f67e7f7f523f435.chunk.js} +0 -0
- /package/dist/js/locales/{nl-webui-main-json.f4e1772f9d507c339583.chunk.js.gz → nl-webui-main-json.99f14f67e7f7f523f435.chunk.js.gz} +0 -0
- /package/dist/js/locales/{no-webui-main-json.7637dd19134c84061d14.chunk.js → no-webui-main-json.14d6b98f5aeac4ae328e.chunk.js} +0 -0
- /package/dist/js/locales/{no-webui-main-json.7637dd19134c84061d14.chunk.js.gz → no-webui-main-json.14d6b98f5aeac4ae328e.chunk.js.gz} +0 -0
- /package/dist/js/locales/{pl-webui-main-json.10a0a30720b516cefda5.chunk.js → pl-webui-main-json.df98b2ed00d38e386747.chunk.js} +0 -0
- /package/dist/js/locales/{pl-webui-main-json.10a0a30720b516cefda5.chunk.js.gz → pl-webui-main-json.df98b2ed00d38e386747.chunk.js.gz} +0 -0
- /package/dist/js/locales/{pt-br-webui-main-json.cc946648a521c27b5a79.chunk.js → pt-br-webui-main-json.b06c253e99d8eb8a971d.chunk.js} +0 -0
- /package/dist/js/locales/{pt-br-webui-main-json.cc946648a521c27b5a79.chunk.js.gz → pt-br-webui-main-json.b06c253e99d8eb8a971d.chunk.js.gz} +0 -0
- /package/dist/js/locales/{pt-webui-main-json.5bed5158082678ceb16b.chunk.js → pt-webui-main-json.5278c6a5afa09777b453.chunk.js} +0 -0
- /package/dist/js/locales/{pt-webui-main-json.5bed5158082678ceb16b.chunk.js.gz → pt-webui-main-json.5278c6a5afa09777b453.chunk.js.gz} +0 -0
- /package/dist/js/locales/{ro-webui-main-json.d68cbb01175c7f6e2b53.chunk.js → ro-webui-main-json.24ab9a55725a9fc18299.chunk.js} +0 -0
- /package/dist/js/locales/{ro-webui-main-json.d68cbb01175c7f6e2b53.chunk.js.gz → ro-webui-main-json.24ab9a55725a9fc18299.chunk.js.gz} +0 -0
- /package/dist/js/locales/{ru-webui-main-json.c399c20411213c872e7b.chunk.js → ru-webui-main-json.e9ab289b5a1b70abdccf.chunk.js} +0 -0
- /package/dist/js/locales/{ru-webui-main-json.c399c20411213c872e7b.chunk.js.gz → ru-webui-main-json.e9ab289b5a1b70abdccf.chunk.js.gz} +0 -0
- /package/dist/js/locales/{sv-webui-main-json.bc915cd441a54413b67c.chunk.js → sv-webui-main-json.9ad571819cde0158829a.chunk.js} +0 -0
- /package/dist/js/locales/{sv-webui-main-json.bc915cd441a54413b67c.chunk.js.gz → sv-webui-main-json.9ad571819cde0158829a.chunk.js.gz} +0 -0
- /package/dist/js/locales/{tr-webui-main-json.a8c83f88e88d42ffca40.chunk.js → tr-webui-main-json.68bb926adc13e8952b47.chunk.js} +0 -0
- /package/dist/js/locales/{tr-webui-main-json.a8c83f88e88d42ffca40.chunk.js.gz → tr-webui-main-json.68bb926adc13e8952b47.chunk.js.gz} +0 -0
- /package/dist/js/locales/{uk_UA-webui-main-json.cbc43c57307c9f8134a6.chunk.js → uk_UA-webui-main-json.f4098f3ea96407bf804e.chunk.js} +0 -0
- /package/dist/js/locales/{uk_UA-webui-main-json.cbc43c57307c9f8134a6.chunk.js.gz → uk_UA-webui-main-json.f4098f3ea96407bf804e.chunk.js.gz} +0 -0
- /package/dist/js/locales/{zh_CN-webui-main-json.b963220181e25b6e6fcd.chunk.js → zh_CN-webui-main-json.6250a926eeea9fda0697.chunk.js} +0 -0
- /package/dist/js/locales/{zh_CN-webui-main-json.b963220181e25b6e6fcd.chunk.js.gz → zh_CN-webui-main-json.6250a926eeea9fda0697.chunk.js.gz} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[158],{60725:(e,s,n)=>{n.d(s,{Z:()=>a});var t=n(87537),i=n.n(t),r=n(23645),c=n.n(r)()(i());c.push([e.id,".ccpm-state {\r\n display: flex;\r\n}\r\n\r\n.ccpm-state > i {\r\n align-self: center;\r\n}\r\n","",{version:3,sources:["webpack://./src/routes/Sidebar/routes/Messages/style.css"],names:[],mappings:"AAAA;EACE,aAAa;AACf;;AAEA;EACE,kBAAkB;AACpB",sourcesContent:[".ccpm-state {\r\n display: flex;\r\n}\r\n\r\n.ccpm-state > i {\r\n align-self: center;\r\n}\r\n"],sourceRoot:""}]);const a=c},203:(e,s,n)=>{n.d(s,{Z:()=>o});var t=n(85893),i=n(55019),r=n(84613),c=n(54578),a=n(4333);function o(e){return{itemNameGetter:e=>e.user.nicks,itemStatusGetter(e){const{flags:s}=e.user;return(0,i.zg)(s)},itemHeaderDescriptionGetter:e=>e.user.hub_names,itemHeaderIconGetter:e=>(0,t.jsx)(c.Z,{flags:e.user.flags}),itemHeaderTitleGetter(s,n,i){const{user:c}=s;return(0,t.jsx)(r.Ie,Object.assign({user:c,ids:e,remoteMenuId:a.Z.HINTED_USER},{children:i}))}}}},30916:(e,s,n)=>{n.r(s),n.d(s,{default:()=>oe});var t=n(85893),i=n(67294),r=n(10907),c=n(203),a=n(40279),o=n(14695),l=n(518),d=n(48117),u=n(50566),p=n(38982),S=n(76249),h=n(32347);const E={connectCCPM:{displayName:"Connect",access:S.PS.PRIVATE_CHAT_EDIT,icon:d.Z.PLAY,handler:({data:e})=>l.Z.post(`${o.Z.SESSIONS_URL}/${e.id}/ccpm`),filter:e=>e.ccpm_state.id===S.ZY.DISCONNECTED},disconnectCCPM:{access:S.PS.PRIVATE_CHAT_EDIT,displayName:"Disconnect",icon:d.Z.REMOVE,handler:({data:e})=>l.Z.delete(`${o.Z.SESSIONS_URL}/${e.id}/ccpm`),filter:e=>e.ccpm_state.id===S.ZY.CONNECTED}},A=(0,p.Z)((0,u.Z)(E,o.Z.SESSIONS_URL,S.PS.PRIVATE_CHAT_EDIT),o.Z.SESSIONS_URL,S.PS.PRIVATE_CHAT_EDIT),m={moduleId:h.jv.MESSAGES,actions:A};var C=n(6654),Z=n(3267),I=n(15479),T=n(15614);const _=e=>a.Z.getSession(e.user.cid);class g extends i.Component{constructor(){super(...arguments),this.handleSubmit=e=>{C.Z.createSession(this.props.location,e,a.Z)},this.recentUserRender=e=>(0,t.jsx)("a",Object.assign({onClick:s=>this.handleSubmit(e.user)},{children:e.user.nicks}))}render(){const{sessionT:e}=this.props;return(0,t.jsxs)("div",Object.assign({className:"private chat session new"},{children:[(0,t.jsx)(T.v,{onChange:this.handleSubmit,offlineMessage:e.t("offlineMessage","You must to be connected to at least one hub in order to send private messages"),isClearable:!1,autoFocus:!0}),(0,t.jsx)(Z.Z,{entryType:I.WJ.PRIVATE_CHAT,hasSession:_,entryTitleRenderer:this.recentUserRender,entryIcon:d.Z.MESSAGES_PLAIN})]}))}}const b=g;var f=n(40479),N=n(88998),v=n(54883),O=n(84613),P=n(68325);const y=(e,s)=>{const{translate:n}=s;switch(e){case S.ZY.CONNECTED:return n("Direct encrypted channel established");case S.ZY.CONNECTING:return(0,t.jsx)(v.Z,{size:"mini",inline:!0,text:n("Establishing connection...")});case S.ZY.DISCONNECTED:return n("Direct encrypted channel available");default:return null}},j=({session:e,sessionT:s})=>{const{flags:n}=e.user;if(!n.includes("ccpm"))return null;const i=e.ccpm_state.id;return i===S.ZY.DISCONNECTED&&n.includes("offline")?null:(0,t.jsx)(N.C,{children:(0,t.jsxs)("div",Object.assign({className:"ccpm-state"},{children:[(0,t.jsx)(P.Z,{encryption:e.ccpm_state.encryption,alwaysVisible:!0,boundary:".session-container"}),(0,t.jsx)(O.PC,{caption:y(i,s),actions:m,ids:["disconnectCCPM","connectCCPM"],itemData:e})]}))})};var D=n(10293),x=n.n(D),R=n(41143),M=n.n(R),w=n(14936),H=n(94897),U=n(46614);const G=x().createStore({scroll:(0,U.$)(),onSocketConnected(e){M()(!this.hasMessages(),"No existing private messages should exist on socket connect"),M()(!this.hasInitializedSessions(),"No initialized private message sessions should exist on socket connect");const s=o.Z.MODULE_URL;e(s,o.Z.MESSAGE,this._onChatMessage),e(s,o.Z.STATUS,this._onStatusMessage),e(s,o.Z.SESSION_REMOVED,this._onSessionRemoved),e(s,o.Z.SESSION_UPDATED,this._onSessionUpdated)}}),k=(0,w.Z)(G,C.Z,H.Z.PRIVATE_CHAT_VIEW);var V=n(74225),L=n(4333);class Y extends i.Component{constructor(){super(...arguments),this.handleFileUpload=e=>{const{cid:s,hub_url:n,flags:t}=this.props.session.user,i=!t.includes("nmdc")&&!t.includes("bot");return(0,V.Pd)(e,n,i?s:void 0)}}render(){const{session:e,sessionApi:s,sessionT:n,uiActions:i}=this.props;return(0,t.jsxs)("div",Object.assign({className:"private chat session"},{children:[(0,t.jsx)(f.Z,{chatAccess:S.PS.PRIVATE_CHAT_SEND,chatActions:i,chatApi:C.Z,sessionApi:s,messageStore:k,session:e,handleFileUpload:this.handleFileUpload,highlightRemoteMenuId:L.Z.PRIVATE_CHAT_MESSAGE_HIGHLIGHT}),(0,t.jsx)(j,{session:e,sessionT:n})]}))}}Y.displayName="PrivateChatSession";const z=Y;var $=n(93379),F=n.n($),B=n(7795),J=n.n(B),W=n(90569),q=n.n(W),K=n(3565),Q=n.n(K),X=n(19216),ee=n.n(X),se=n(44589),ne=n.n(se),te=n(60725),ie={};ie.styleTagTransform=ne(),ie.setAttributes=Q(),ie.insert=q().bind(null,"head"),ie.domAPI=J(),ie.insertStyleElement=ee(),F()(te.Z,ie),te.Z&&te.Z.locals&&te.Z.locals;var re=n(93101),ce=n(8717);const ae=["clear"],oe=(0,re.J)((e=>{const{match:s,t:n}=e,i=function(e,s){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&s.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)s.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(e,["match","t"]);return(0,t.jsx)(r.Z,Object.assign({activeId:s.params.id,baseUrl:"messages",newCaption:n((0,ce.zS)("new",h.jv.MESSAGES),"New session"),newDescription:n((0,ce.zS)("newDesc",h.jv.MESSAGES),"Open a new private chat session"),newIcon:d.Z.MESSAGES_PLAIN,unreadInfoStore:a.Z,editAccess:S.PS.PRIVATE_CHAT_EDIT,uiActions:m,sessionApi:C.Z,actionIds:ae,sessionItemLayout:z,newLayout:b,t:n},(0,c.Z)(["browse","ignore","unignore"]),i))}),a.Z)}}]);
|
|
2
|
+
//# sourceMappingURL=messages.1fff9c30585362386309.chunk.js.map
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/messages.1fff9c30585362386309.chunk.js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,SA8BxB,IAAe,EAAAC,GAAA,IA3BbpE,IAEA,MAAM,MAAEqE,EAAK,EAAE5D,GAAgBT,EAAVsE,E,yUAAK,CAAKtE,EAAzB,eACN,OACE,SAACuE,EAAA,EAAa,eACZC,SAAUH,EAAMI,OAAOnH,GACvBoH,QAAQ,WACRC,WAAYlE,GAAE,SAAU,MAAO,eAAsB,eACrDmE,eAAgBnE,GACd,SAAU,UAAW,eACrB,mCAEFoE,QAASlG,EAAA,iBACTmG,gBAAiBpF,EAAA,EACjBqF,WAAY,uBACZ3B,UAAW,EACXD,WAAY,IACZ6B,UAAWb,GACXc,kBAAmB,EACnBC,UAAW,EACXzE,EAAGA,IACC,EAAA0E,EAAA,GAAyB,CAAC,SAAU,SAAU,aAC9Cb,GAEP,GAG+C5E,EAAA,E","sources":["webpack://airdcpp-webui/./src/routes/Sidebar/routes/Messages/style.css","webpack://airdcpp-webui/./src/routes/Sidebar/decorators/UserItemHandlerDecorator.tsx","webpack://airdcpp-webui/./src/actions/ui/PrivateChatActions.ts","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Messages/components/MessageNew.tsx","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Messages/components/MessageFooter.tsx","webpack://airdcpp-webui/./src/stores/PrivateChatMessageStore.ts","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Messages/components/PrivateChatSession.tsx","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Messages/style.css?55a2","webpack://airdcpp-webui/./src/routes/Sidebar/routes/Messages/components/Messages.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, \".ccpm-state {\\r\\n display: flex;\\r\\n}\\r\\n\\r\\n.ccpm-state > i {\\r\\n align-self: center;\\r\\n}\\r\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Sidebar/routes/Messages/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,aAAa;AACf;;AAEA;EACE,kBAAkB;AACpB\",\"sourcesContent\":[\".ccpm-state {\\r\\n display: flex;\\r\\n}\\r\\n\\r\\n.ccpm-state > i {\\r\\n align-self: center;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { userOnlineStatusToColor } from 'utils/TypeConvert';\r\nimport { UserMenu } from 'components/action-menu';\r\nimport UserIcon from 'components/icon/UserIcon';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\nimport MenuConstants from 'constants/MenuConstants';\r\n\r\ninterface UserSessionBase {\r\n user: API.HintedUser;\r\n}\r\n\r\nexport default function <SessionT extends UI.SessionItemBase & UserSessionBase>(\r\n itemMenuIds: string[]\r\n) {\r\n const UserItemHandlerDecorator: UI.SessionInfoGetter<SessionT> = {\r\n itemNameGetter(session) {\r\n return session.user.nicks;\r\n },\r\n\r\n itemStatusGetter(session) {\r\n const { flags } = session.user;\r\n return userOnlineStatusToColor(flags);\r\n },\r\n\r\n itemHeaderDescriptionGetter(session) {\r\n return session.user.hub_names;\r\n },\r\n\r\n itemHeaderIconGetter(session) {\r\n return <UserIcon flags={session.user.flags} />;\r\n },\r\n\r\n itemHeaderTitleGetter(session, location, actionMenu) {\r\n const { user } = session;\r\n return (\r\n <UserMenu user={user} ids={itemMenuIds} remoteMenuId={MenuConstants.HINTED_USER}>\r\n {actionMenu}\r\n </UserMenu>\r\n );\r\n },\r\n };\r\n\r\n return UserItemHandlerDecorator;\r\n}\r\n","import PrivateChatConstants from 'constants/PrivateChatConstants';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport ChatActionDecorator from './decorators/ChatActionDecorator';\r\nimport SessionActionDecorator from './decorators/SessionActionDecorator';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst handleConnectCCPM: UI.ActionHandler<API.PrivateChat> = ({ data: session }) => {\r\n return SocketService.post(`${PrivateChatConstants.SESSIONS_URL}/${session.id}/ccpm`);\r\n};\r\n\r\nconst handleDisconnectCCPM: UI.ActionHandler<API.PrivateChat> = ({ data: session }) => {\r\n return SocketService.delete(`${PrivateChatConstants.SESSIONS_URL}/${session.id}/ccpm`);\r\n};\r\n\r\nconst ccpmConnected = (data: API.PrivateChat) =>\r\n data.ccpm_state.id === API.CCPMStateEnum.CONNECTED;\r\nconst ccpmDisconnected = (data: API.PrivateChat) =>\r\n data.ccpm_state.id === API.CCPMStateEnum.DISCONNECTED;\r\n\r\nconst PrivateChatActions: UI.ActionListType<API.PrivateChat> = {\r\n connectCCPM: {\r\n displayName: 'Connect',\r\n access: API.AccessEnum.PRIVATE_CHAT_EDIT,\r\n icon: IconConstants.PLAY,\r\n handler: handleConnectCCPM,\r\n filter: ccpmDisconnected,\r\n },\r\n disconnectCCPM: {\r\n access: API.AccessEnum.PRIVATE_CHAT_EDIT,\r\n displayName: 'Disconnect',\r\n icon: IconConstants.REMOVE,\r\n handler: handleDisconnectCCPM,\r\n filter: ccpmConnected,\r\n },\r\n};\r\n\r\nconst PrivateChatActionsDecorated = SessionActionDecorator(\r\n ChatActionDecorator(\r\n PrivateChatActions,\r\n PrivateChatConstants.SESSIONS_URL,\r\n API.AccessEnum.PRIVATE_CHAT_EDIT\r\n ),\r\n PrivateChatConstants.SESSIONS_URL,\r\n API.AccessEnum.PRIVATE_CHAT_EDIT\r\n);\r\n\r\nexport default {\r\n moduleId: UI.Modules.MESSAGES,\r\n actions: PrivateChatActionsDecorated,\r\n};\r\n","import { Component } from 'react';\r\n\r\nimport RecentLayout from 'routes/Sidebar/components/RecentLayout';\r\n\r\nimport PrivateChatActions from 'actions/reflux/PrivateChatActions';\r\nimport PrivateChatSessionStore from 'stores/PrivateChatSessionStore';\r\n\r\nimport { HistoryEntryEnum } from 'constants/HistoryConstants';\r\n\r\nimport * as API from 'types/api';\r\n\r\nimport { NewSessionLayoutProps } from 'routes/Sidebar/components/SessionLayout';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport { UserSelectField } from 'components/select';\r\n\r\nconst hasSession = (entry: API.HistoryItem) => {\r\n return PrivateChatSessionStore.getSession(entry.user!.cid);\r\n};\r\n\r\nclass MessageNew extends Component<NewSessionLayoutProps> {\r\n handleSubmit = (user: API.HintedUser) => {\r\n PrivateChatActions.createSession(this.props.location, user, PrivateChatSessionStore);\r\n };\r\n\r\n recentUserRender = (entry: API.HistoryItem) => {\r\n return <a onClick={(_) => this.handleSubmit(entry.user!)}>{entry.user!.nicks}</a>;\r\n };\r\n\r\n render() {\r\n const { sessionT } = this.props;\r\n return (\r\n <div className=\"private chat session new\">\r\n <UserSelectField\r\n onChange={this.handleSubmit}\r\n offlineMessage={sessionT.t<string>(\r\n 'offlineMessage',\r\n 'You must to be connected to at least one hub in order to send private messages'\r\n )}\r\n isClearable={false}\r\n autoFocus={true}\r\n />\r\n <RecentLayout\r\n entryType={HistoryEntryEnum.PRIVATE_CHAT}\r\n hasSession={hasSession}\r\n entryTitleRenderer={this.recentUserRender}\r\n entryIcon={IconConstants.MESSAGES_PLAIN}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default MessageNew;\r\n","import * as React from 'react';\r\n\r\nimport PrivateChatActions from 'actions/ui/PrivateChatActions';\r\n\r\nimport { SessionFooter } from 'routes/Sidebar/components/SessionFooter';\r\nimport Loader from 'components/semantic/Loader';\r\nimport { ActionMenu } from 'components/action-menu';\r\nimport EncryptionState from 'components/EncryptionState';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst getCaption = (state: API.CCPMStateEnum, sessionT: UI.ModuleTranslator) => {\r\n const { translate } = sessionT;\r\n switch (state) {\r\n case API.CCPMStateEnum.CONNECTED:\r\n return translate('Direct encrypted channel established');\r\n case API.CCPMStateEnum.CONNECTING:\r\n return (\r\n <Loader\r\n size=\"mini\"\r\n inline={true}\r\n text={translate('Establishing connection...')}\r\n />\r\n );\r\n case API.CCPMStateEnum.DISCONNECTED:\r\n return translate('Direct encrypted channel available');\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\ninterface CCPMStateProps {\r\n session: API.PrivateChat;\r\n sessionT: UI.ModuleTranslator;\r\n}\r\n\r\nconst CCPMState: React.FC<CCPMStateProps> = ({ session, sessionT }) => {\r\n const { flags } = session.user;\r\n if (!flags.includes('ccpm')) {\r\n return null;\r\n }\r\n\r\n const state = session.ccpm_state.id;\r\n if (state === API.CCPMStateEnum.DISCONNECTED && flags.includes('offline')) {\r\n return null;\r\n }\r\n\r\n return (\r\n <SessionFooter>\r\n <div className=\"ccpm-state\">\r\n <EncryptionState\r\n encryption={session.ccpm_state.encryption}\r\n alwaysVisible={true}\r\n boundary=\".session-container\"\r\n />\r\n <ActionMenu\r\n caption={getCaption(state, sessionT)}\r\n actions={PrivateChatActions}\r\n ids={['disconnectCCPM', 'connectCCPM']}\r\n itemData={session}\r\n />\r\n </div>\r\n </SessionFooter>\r\n );\r\n};\r\n\r\nexport default CCPMState;\r\n","//@ts-ignore\r\nimport Reflux from 'reflux';\r\nimport invariant from 'invariant';\r\n\r\nimport PrivateChatConstants from 'constants/PrivateChatConstants';\r\nimport PrivateChatActions from 'actions/reflux/PrivateChatActions';\r\n\r\nimport MessageStoreDecorator from './decorators/MessageStoreDecorator';\r\n\r\nimport AccessConstants from 'constants/AccessConstants';\r\nimport { AddSocketListener } from 'decorators/SocketSubscriptionDecorator';\r\nimport { SessionScrollPositionKeeper } from './helpers/SessionScrollPositionKeeper';\r\n\r\nconst PrivateChatMessageStore = Reflux.createStore({\r\n scroll: SessionScrollPositionKeeper(),\r\n\r\n onSocketConnected(addSocketListener: AddSocketListener) {\r\n invariant(\r\n !this.hasMessages(),\r\n 'No existing private messages should exist on socket connect'\r\n );\r\n invariant(\r\n !this.hasInitializedSessions(),\r\n 'No initialized private message sessions should exist on socket connect'\r\n );\r\n\r\n const url = PrivateChatConstants.MODULE_URL;\r\n addSocketListener(url, PrivateChatConstants.MESSAGE, this._onChatMessage);\r\n addSocketListener(url, PrivateChatConstants.STATUS, this._onStatusMessage);\r\n\r\n addSocketListener(url, PrivateChatConstants.SESSION_REMOVED, this._onSessionRemoved);\r\n addSocketListener(url, PrivateChatConstants.SESSION_UPDATED, this._onSessionUpdated);\r\n },\r\n});\r\n\r\nexport default MessageStoreDecorator(\r\n PrivateChatMessageStore,\r\n PrivateChatActions,\r\n AccessConstants.PRIVATE_CHAT_VIEW\r\n);\r\n","import { Component } from 'react';\r\n\r\nimport ChatLayout, {\r\n ChatAPI,\r\n ChatActionList,\r\n} from 'routes/Sidebar/components/chat/ChatLayout';\r\nimport MessageFooter from 'routes/Sidebar/routes/Messages/components/MessageFooter';\r\n\r\nimport PrivateChatMessageStore from 'stores/PrivateChatMessageStore';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { SessionChildProps } from 'routes/Sidebar/components/SessionLayout';\r\nimport { shareTempFile } from 'services/api/ShareApi';\r\nimport PrivateChatActions from 'actions/reflux/PrivateChatActions';\r\nimport MenuConstants from 'constants/MenuConstants';\r\n\r\ntype PrivateChatSessionProps = SessionChildProps<\r\n API.PrivateChat,\r\n UI.EmptyObject,\r\n ChatActionList\r\n>;\r\n\r\nclass PrivateChatSession extends Component<PrivateChatSessionProps> {\r\n static displayName = 'PrivateChatSession';\r\n\r\n handleFileUpload = (file: File) => {\r\n const { cid, hub_url, flags } = this.props.session.user;\r\n\r\n const isPrivate = !flags.includes('nmdc') && !flags.includes('bot');\r\n return shareTempFile(file, hub_url, isPrivate ? cid : undefined);\r\n };\r\n\r\n render() {\r\n const { session, sessionApi, sessionT, uiActions } = this.props;\r\n return (\r\n <div className=\"private chat session\">\r\n <ChatLayout\r\n chatAccess={API.AccessEnum.PRIVATE_CHAT_SEND}\r\n chatActions={uiActions}\r\n chatApi={PrivateChatActions as ChatAPI}\r\n sessionApi={sessionApi}\r\n messageStore={PrivateChatMessageStore}\r\n session={session}\r\n handleFileUpload={this.handleFileUpload}\r\n highlightRemoteMenuId={MenuConstants.PRIVATE_CHAT_MESSAGE_HIGHLIGHT}\r\n />\r\n\r\n <MessageFooter session={session} sessionT={sessionT} />\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default PrivateChatSession;\r\n","\n import API from \"!../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\n\r\nimport SessionLayout from 'routes/Sidebar/components/SessionLayout';\r\nimport UserItemHandlerDecorator from 'routes/Sidebar/decorators/UserItemHandlerDecorator';\r\n\r\nimport PrivateChatSessionStore from 'stores/PrivateChatSessionStore';\r\nimport PrivateChatUIActions from 'actions/ui/PrivateChatActions';\r\nimport PrivateChatAPIActions from 'actions/reflux/PrivateChatActions';\r\n\r\nimport MessageNew from 'routes/Sidebar/routes/Messages/components/MessageNew';\r\nimport PrivateChatSession from 'routes/Sidebar/routes/Messages/components/PrivateChatSession';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport '../style.css';\r\nimport {\r\n SessionProviderDecoratorChildProps,\r\n SessionProviderDecorator,\r\n} from 'routes/Sidebar/decorators/SessionProviderDecorator';\r\nimport { toI18nKey } from 'utils/TranslationUtils';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nconst sessionActions = ['clear'];\r\n\r\nconst Messages: React.FC<SessionProviderDecoratorChildProps<API.PrivateChat>> = (\r\n props\r\n) => {\r\n const { match, t, ...other } = props;\r\n return (\r\n <SessionLayout\r\n activeId={match.params.id}\r\n baseUrl=\"messages\"\r\n newCaption={t(toI18nKey('new', UI.Modules.MESSAGES), 'New session')}\r\n newDescription={t(\r\n toI18nKey('newDesc', UI.Modules.MESSAGES),\r\n 'Open a new private chat session'\r\n )}\r\n newIcon={IconConstants.MESSAGES_PLAIN}\r\n unreadInfoStore={PrivateChatSessionStore}\r\n editAccess={API.AccessEnum.PRIVATE_CHAT_EDIT}\r\n uiActions={PrivateChatUIActions}\r\n sessionApi={PrivateChatAPIActions as UI.SessionActions<API.PrivateChat>}\r\n actionIds={sessionActions}\r\n sessionItemLayout={PrivateChatSession}\r\n newLayout={MessageNew}\r\n t={t}\r\n {...UserItemHandlerDecorator(['browse', 'ignore', 'unignore'])}\r\n {...other}\r\n />\r\n );\r\n};\r\n\r\nexport default SessionProviderDecorator(Messages, PrivateChatSessionStore);\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","itemMenuIds","itemNameGetter","session","user","nicks","itemStatusGetter","flags","itemHeaderDescriptionGetter","hub_names","itemHeaderIconGetter","itemHeaderTitleGetter","location","actionMenu","ids","remoteMenuId","PrivateChatActions","connectCCPM","displayName","access","icon","IconConstants","handler","data","SocketService","PrivateChatConstants","filter","ccpm_state","disconnectCCPM","PrivateChatActionsDecorated","SessionActionDecorator","ChatActionDecorator","moduleId","actions","hasSession","entry","PrivateChatSessionStore","cid","MessageNew","Component","handleSubmit","this","props","recentUserRender","onClick","_","render","sessionT","className","onChange","offlineMessage","t","isClearable","autoFocus","RecentLayout","entryType","entryTitleRenderer","entryIcon","getCaption","state","translate","Loader","size","inline","text","includes","SessionFooter","EncryptionState","encryption","alwaysVisible","boundary","caption","itemData","PrivateChatMessageStore","scroll","SessionScrollPositionKeeper","onSocketConnected","addSocketListener","hasMessages","hasInitializedSessions","url","_onChatMessage","_onStatusMessage","_onSessionRemoved","_onSessionUpdated","MessageStoreDecorator","AccessConstants","PrivateChatSession","handleFileUpload","file","hub_url","isPrivate","undefined","sessionApi","uiActions","ChatLayout","chatAccess","chatActions","chatApi","messageStore","highlightRemoteMenuId","MenuConstants","MessageFooter","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","sessionActions","SessionProviderDecorator","match","other","SessionLayout","activeId","params","baseUrl","newCaption","newDescription","newIcon","unreadInfoStore","editAccess","actionIds","sessionItemLayout","newLayout","UserItemHandlerDecorator"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[618],{24751:(e,s,t)=>{t.d(s,{Z:()=>a});var n=t(87537),i=t.n(n),r=t(23645),o=t.n(r)()(i());o.push([e.id,".status .error {\r\n color: red;\r\n}\r\n\r\n@media only screen and (min-width: 767px) {\r\n .source.modal td {\r\n max-width: 250px;\r\n }\r\n\r\n /* Can't be applied to dropdown cells */\r\n .source.modal td:not(.user) {\r\n overflow-x: hidden;\r\n }\r\n}\r\n","",{version:3,sources:["webpack://./src/routes/Queue/style.css"],names:[],mappings:"AAAA;EACE,UAAU;AACZ;;AAEA;EACE;IACE,gBAAgB;EAClB;;EAEA,uCAAuC;EACvC;IACE,kBAAkB;EACpB;AACF",sourcesContent:[".status .error {\r\n color: red;\r\n}\r\n\r\n@media only screen and (min-width: 767px) {\r\n .source.modal td {\r\n max-width: 250px;\r\n }\r\n\r\n /* Can't be applied to dropdown cells */\r\n .source.modal td:not(.user) {\r\n overflow-x: hidden;\r\n }\r\n}\r\n"],sourceRoot:""}]);const a=o},80218:(e,s,t)=>{t.d(s,{Z:()=>l});var n=t(1087),i=t(518),r=t(48117),o=t(76249),a=t(32347);const d=e=>i.Z.post(n.Z.BUNDLES_URL+"/priority",{priority:e}),c={removeCompleted:{access:o.PS.QUEUE_EDIT,displayName:"Remove completed bundles",icon:r.Z.REMOVE,handler:()=>i.Z.post(n.Z.BUNDLES_URL+"/remove_completed"),notifications:{onSuccess:"{{result.count}} completed bundles were removed"}},divider:null,pause:{displayName:"Pause all bundles",access:o.PS.QUEUE_EDIT,icon:r.Z.PAUSE,handler:()=>d(o.gg.PAUSED_FORCED)},resume:{displayName:"Resume all bundles",access:o.PS.QUEUE_EDIT,icon:r.Z.PLAY,handler:()=>d(o.gg.DEFAULT)}},l={moduleId:a.jv.QUEUE,actions:c}},49133:(e,s,t)=>{t.d(s,{Z:()=>l});var n=t(1087),i=t(518),r=t(48117),o=t(76249),a=t(32347),d=t(60160);const c={search:{access:o.PS.SEARCH,displayName:"Search (foreground)",icon:r.Z.SEARCH,handler:({data:e,location:s})=>d.Z.search(e,s)},searchFileAlternates:{access:o.PS.QUEUE_EDIT,displayName:"Search for alternates",icon:r.Z.SEARCH_ALTERNATES,filter:e=>0===e.time_finished,handler:({data:e})=>i.Z.post(`${n.Z.FILES_URL}/${e.id}/search`),notifications:{onSuccess:"File {{item.name}} was searched for alternates"}},removeFile:{displayName:"Remove",access:o.PS.QUEUE_EDIT,icon:r.Z.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:({data:e},s)=>i.Z.post(`${n.Z.FILES_URL}/${e.id}/remove`,{remove_finished:s}),notifications:{onSuccess:"File {{item.name}} was removed from queue"}}},l={moduleId:a.jv.QUEUE,actions:c}},43231:(e,s,t)=>{t.d(s,{Z:()=>c});var n=t(85893),i=t(45697),r=t.n(i),o=(t(67294),t(94184)),a=t.n(o);const d=({className:e,percent:s,caption:t})=>(0,n.jsxs)("div",Object.assign({className:a()("ui progress",e,{indeterminate:void 0===s}),"data-percent":s},{children:[(0,n.jsx)("div",Object.assign({className:"bar",style:{transitionDuration:"300ms",width:void 0===s?void 0:s+"%",minWidth:"0px"}},{children:(0,n.jsx)("div",{className:"progress"})})),!!t&&(0,n.jsx)("div",Object.assign({className:"label"},{children:t}))]}));d.propTypes={percent:r().number.isRequired,caption:r().node.isRequired,className:r().string};const c=d},67635:(e,s,t)=>{t.r(s),t.d(s,{default:()=>Ne});var n=t(85893),i=t(67294),r=t(35108),o=t(80218),a=t(1087),d=t(518),c=t(20097),l=t(48117),u=t(76249),m=t(32347),h=t(60160);const p=e=>e.status.id===a.s.COMPLETION_VALIDATION_ERROR,E=e=>0===e.time_finished,j=(e,s)=>d.Z.post(`${a.Z.BUNDLES_URL}/${e.id}/share`,{skip_validation:s}),x={sources:{displayName:"Manage sources...",icon:l.Z.USER,filter:e=>e.sources.total>0&&E(e),handler:({data:e,location:s})=>{c.Z.push(`${s.pathname}/sources/${e.id}`)}},content:{displayName:"Manage files...",icon:l.Z.FILE,filter:e=>"directory"===e.type.id,handler:({data:e,location:s})=>{c.Z.push(`${s.pathname}/content/${e.id}`)}},divider:null,search:{access:u.PS.SEARCH,displayName:"Search (foreground)",icon:l.Z.SEARCH,handler:({data:e,location:s})=>h.Z.search(e,s)},searchBundleAlternates:{access:u.PS.QUEUE_EDIT,displayName:"Search for alternates",icon:l.Z.SEARCH_ALTERNATES,filter:E,handler:({data:e})=>d.Z.post(`${a.Z.BUNDLES_URL}/${e.id}/search`),notifications:{onSuccess:"The bundle {{item.name}} was searched for alternates"}},divider2:null,removeBundle:{displayName:"Remove",access:u.PS.QUEUE_EDIT,icon:l.Z.REMOVE,confirmation:{content:"Are you sure that you want to remove the bundle {{item.name}}?",approveCaption:"Remove bundle",rejectCaption:"Don't remove",checkboxCaption:"Remove finished files"},handler:({data:e},s)=>d.Z.post(`${a.Z.BUNDLES_URL}/${e.id}/remove`,{remove_finished:s})},divider3:null,rescan:{displayName:"Rescan for errors",access:u.PS.QUEUE_EDIT,icon:l.Z.REFRESH_COLORED,filter:p,handler:({data:e})=>j(e,!1)},forceShare:{displayName:"Force in share",access:u.PS.QUEUE_EDIT,icon:l.Z.ERROR,filter:p,handler:({data:e})=>j(e,!0)}},U={moduleId:m.jv.QUEUE,actions:x};var y=t(78230),v=t(45697),b=t.n(v),g=t(18446),C=t.n(g);const f={[u.gg.PAUSED_FORCED]:{str:"Paused (forced)",id:0},[u.gg.PAUSED]:{str:"Paused",id:1},[u.gg.LOWEST]:{str:"Lowest",id:2},[u.gg.LOW]:{str:"Low",id:3},[u.gg.NORMAL]:{str:"Normal",id:4},[u.gg.HIGH]:{str:"High",id:5},[u.gg.HIGHEST]:{str:"Highest",id:6}};var Z=t(9453),S=t(66883),A=t(8717),w=t(89519),R=t(40051),N=t(95345);class _ extends i.Component{constructor(){super(...arguments),this.setPriority=e=>{const{item:s,prioAction:t,t:n}=this.props;return(0,w.h9)((()=>t(s,e)),n)},this.setAutoPriority=()=>{this.setPriority(u.gg.DEFAULT)},this.getPriorityListItem=(e,s)=>{const t=this.props.item.priority.id;return{id:e.id.toString(),item:{active:t===e.id,onClick:()=>{this.setPriority(e.id)},children:(0,A.Iu)(e.str,s,m.jv.QUEUE)}}},this.getChildren=e=>{const{t:s}=this.props,t=Object.keys(f).map(Number).map((e=>this.getPriorityListItem(f[e],s)));return t.push({id:"divider"}),t.push({id:"auto",item:{active:this.props.itemPrio.auto,onClick:()=>{this.setPriority(u.gg.DEFAULT)},children:(0,A.Iu)("Auto",s,m.jv.QUEUE)}}),(0,N.E)(t,e)}}shouldComponentUpdate(e){return!C()(e.item.priority,this.props.item.priority)}render(){const{itemPrio:e,t:s}=this.props;let t=(0,A.Iu)(f[e.id].str,s,m.jv.QUEUE);return e.auto&&(t+=` (${(0,A.Iu)("Auto",s,m.jv.QUEUE).toLocaleLowerCase()})`),S.Z.hasAccess(u.PS.QUEUE_EDIT)?(0,n.jsx)(Z.Z,Object.assign({caption:t,className:"priority-menu"},{children:this.getChildren})):(0,n.jsx)(R.H,{caption:t})}}_.propTypes={itemPrio:b().object.isRequired,item:b().object.isRequired,prioAction:b().func.isRequired};const D=_;var L=t(94184),I=t.n(L),O=t(43231);const P=(e,s)=>{if(e.completed)return"success";const t=e.id;return I()({grey:(!t||t===u.gT.QUEUED)&&0===s.speed},{blue:(!t||t===u.gT.QUEUED)&&s.speed>0})},T=({cellData:e,rowDataGetter:s})=>{if(e.failed)return(0,n.jsx)("span",Object.assign({className:"error"},{children:e.str}));const t=s();return(0,n.jsx)(O.Z,{className:P(e,t),caption:e.str,percent:100*t.downloaded_bytes/t.size})};var Q=t(10293),B=t.n(Q),$=t(93836);const q=B().createStore({_viewName:"queue_bundle_view",_apiUrl:a.Z.MODULE_URL,mixins:[(0,$.Z)("name")]});var F=t(28427),H=t(92245),K=t(20368),k=t(49133);const G=B().createStore({_viewName:"queue_file_view",_apiUrl:a.Z.MODULE_URL,mixins:[(0,$.Z)("name")]});var M=t(68126),V=t(93379),z=t.n(V),W=t(7795),Y=t.n(W),X=t(90569),J=t.n(X),ee=t(3565),se=t.n(ee),te=t(19216),ne=t.n(te),ie=t(44589),re=t.n(ie),oe=t(24751),ae={};ae.styleTagTransform=re(),ae.setAttributes=se(),ae.insert=J().bind(null,"head"),ae.domAPI=Y(),ae.insertStyleElement=ne(),z()(oe.Z,ae),oe.Z&&oe.Z.locals&&oe.Z.locals;var de=t(19072),ce=t(4333);const le=({cellData:e,rowDataGetter:s,t})=>(0,n.jsx)(D,{itemPrio:e,item:s(),prioAction:de.YU,t});class ue extends i.Component{constructor(){super(...arguments),this.isActive=(e,s)=>!s.status.downloaded,this.isRunning=(e,s)=>s.speed>0}render(){return(0,n.jsxs)(y.Z,Object.assign({store:G,sourceFilter:{pattern:this.props.bundle.id,method:u.V3.EXACT,property:"bundle"},moduleId:k.Z.moduleId},{children:[(0,n.jsx)(r.Column,{name:"Name",width:200,flexGrow:20,columnKey:"name",cell:(0,n.jsx)(M.Nq,{actions:k.Z,remoteMenuId:ce.Z.QUEUE_FILE})}),(0,n.jsx)(r.Column,{name:"Size",width:70,columnKey:"size",cell:(0,n.jsx)(M.Eh,{}),flexGrow:1}),(0,n.jsx)(r.Column,{name:"Status",width:120,columnKey:"status",cell:(0,n.jsx)(T,{})}),(0,n.jsx)(r.Column,{name:"Sources",width:65,columnKey:"sources",renderCondition:this.isActive}),(0,n.jsx)(r.Column,{name:"Time left",width:50,columnKey:"seconds_left",renderCondition:this.isRunning,cell:(0,n.jsx)(M.VL,{})}),(0,n.jsx)(r.Column,{name:"Speed",width:55,columnKey:"speed",cell:(0,n.jsx)(M.LV,{}),renderCondition:this.isRunning}),(0,n.jsx)(r.Column,{name:"Priority",width:80,columnKey:"priority",renderCondition:this.isActive,cell:(0,n.jsx)(le,{}),flexGrow:1})]}))}}const me=ue;var he=t(42090);class pe extends i.Component{render(){const e=this.props,{bundle:s}=e,t=function(e,s){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&s.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)s.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(t[n[i]]=e[n[i]])}return t}(e,["bundle"]);return(0,n.jsx)(F.Z,Object.assign({className:"source",title:s.name,subHeader:s.target,closable:!0,icon:(0,n.jsx)(K.Z,{typeInfo:s.type}),fullHeight:!0},t,{children:(0,n.jsx)(me,{bundle:s})}))}}pe.displayName="BundleFileDialog";const Ee=(0,H.ZP)((0,he.Z)(pe,{urls:{bundle:({match:e},s)=>s.get(`${a.Z.BUNDLES_URL}/${e.params.bundleId}`)}}),"content/:bundleId"),je={removeBundleSource:{access:u.PS.QUEUE_EDIT,displayName:"Remove source",icon:l.Z.REMOVE,handler:({data:e})=>{const{source:s,bundle:t}=e;return d.Z.delete(`${a.Z.BUNDLES_URL}/${t.id}/sources/${s.user.cid}`)}}},xe={moduleId:m.jv.QUEUE,subId:"bundleSource",actions:je};var Ue=t(2445),ye=t(84613),ve=t(90195);const be=({source:e,bundle:s,t})=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",Object.assign({className:"user dropdown"},{children:(0,n.jsx)(ye.Ie,Object.assign({userIcon:!0,user:e.user,ids:ve.D,contextElement:".source.modal",remoteMenuId:ce.Z.HINTED_USER},{children:(0,n.jsx)(ye.PC,{actions:xe,itemData:{source:e,bundle:s}})}))})),(0,n.jsx)("td",Object.assign({className:"hubs"},{children:e.user.hub_names})),(0,n.jsx)("td",Object.assign({className:"speed"},{children:e.last_speed>0&&(0,Ue.CY)(e.last_speed,t)})),(0,n.jsx)("td",Object.assign({className:"files"},{children:e.files})),(0,n.jsx)("td",Object.assign({className:"size"},{children:(0,Ue.BU)(e.size,t)}))]}),ge=(e,s)=>e.user.nicks.localeCompare(s.user.nicks),Ce=(0,he.Z)((({sources:e,bundle:s,queueT:t})=>{const{translate:i}=t;return(0,n.jsxs)("div",Object.assign({className:"sources"},{children:[(0,n.jsx)("h2",{children:i("Sources")}),(0,n.jsxs)("table",Object.assign({className:"ui striped table"},{children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:i("User")}),(0,n.jsx)("th",{children:i("Hubs")}),(0,n.jsx)("th",{children:i("Last known speed")}),(0,n.jsx)("th",{children:i("Files")}),(0,n.jsx)("th",{children:i("Size")})]})}),(0,n.jsx)("tbody",{children:e.sort(ge).map((e=>(0,n.jsx)(be,{source:e,bundle:s,t:t.plainT},e.user.cid)))})]}))]}))}),{urls:{sources:({bundle:e},s)=>s.get(`${a.Z.BUNDLES_URL}/${e.id}/sources`)},onSocketConnected:(e,{refetchData:s,props:t})=>{e(a.Z.MODULE_URL,a.Z.BUNDLE_SOURCES,(e=>{e.id===t.bundle.id&&s()}))}});class fe extends i.Component{render(){const{bundle:e,queueT:s}=this.props;return(0,n.jsx)(F.Z,Object.assign({className:"source",title:e.name,subHeader:e.target,closable:!0,icon:(0,n.jsx)(K.Z,{typeInfo:e.type}),fullHeight:!0},this.props,{children:(0,n.jsx)(Ce,{bundle:e,queueT:s})}))}}fe.displayName="SourceDialog";const Ze=(0,H.ZP)((0,he.Z)(fe,{urls:{bundle:({match:e},s)=>s.get(`${a.Z.BUNDLES_URL}/${e.params.bundleId}`)}}),"sources/:bundleId");var Se=t(27695),Ae=t(91072);const we=({cellData:e,rowDataGetter:s,t})=>(0,n.jsx)(D,{itemPrio:e,item:s(),prioAction:de.aR,t});class Re extends i.Component{constructor(){super(...arguments),this.isActive=(e,s)=>!s.status.downloaded,this.isDownloaded=(e,s)=>s.status.downloaded,this.isRunning=(e,s)=>s.speed>0,this.emptyRowsNodeGetter=()=>{const{t:e}=this.queueT;return(0,n.jsx)(Se.Z,{title:e("queueEmpty","The queue is empty"),icon:l.Z.FILE,description:e("queueEmptyDesc","New items can be queued from search or filelists")})},this.queueT=(0,A.HY)(this.props.t,m.jv.QUEUE)}render(){const{translate:e}=this.queueT;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(y.Z,Object.assign({emptyRowsNodeGetter:this.emptyRowsNodeGetter,store:q,footerData:(0,n.jsx)(ye.PC,{className:"top left pointing",caption:e("Actions..."),actions:o.Z,header:e("Queue actions"),triggerIcon:"chevron up",button:!0}),moduleId:o.Z.moduleId},{children:[(0,n.jsx)(r.Column,{name:"Name",width:200,flexGrow:4,columnKey:"name",cell:(0,n.jsx)(M.Nq,{actions:U,remoteMenuId:ce.Z.QUEUE_BUNDLE,ids:["content","sources","divider","search","searchBundleAlternates","divider","removeBundle","divider","rescan","forceShare"]})}),(0,n.jsx)(r.Column,{name:"Size",width:60,columnKey:"size",cell:(0,n.jsx)(M.Eh,{}),flexGrow:1}),(0,n.jsx)(r.Column,{name:"Type/content",width:150,columnKey:"type",hideWidth:1e3,cell:(0,n.jsx)(M.DS,{actions:U,actionId:"content"})}),(0,n.jsx)(r.Column,{name:"Status",width:120,flexGrow:3,columnKey:"status",cell:(0,n.jsx)(T,{})}),(0,n.jsx)(r.Column,{name:"Sources",width:60,columnKey:"sources",renderCondition:this.isActive,flexGrow:1,cell:(0,n.jsx)(M.DS,{actions:U,actionId:"sources"})}),(0,n.jsx)(r.Column,{name:"Time left",width:50,columnKey:"seconds_left",renderCondition:this.isRunning,cell:(0,n.jsx)(M.VL,{})}),(0,n.jsx)(r.Column,{name:"Speed",width:50,columnKey:"speed",cell:(0,n.jsx)(M.LV,{}),renderCondition:this.isRunning,flexGrow:1}),(0,n.jsx)(r.Column,{name:"Priority",width:80,columnKey:"priority",renderCondition:this.isActive,cell:(0,n.jsx)(we,{}),flexGrow:1}),(0,n.jsx)(r.Column,{name:"Added",width:100,columnKey:"time_added",cell:(0,n.jsx)(M.Ks,{}),hideWidth:1400}),(0,n.jsx)(r.Column,{name:"Finished",width:100,columnKey:"time_finished",cell:(0,n.jsx)(M.Ks,{}),renderCondition:this.isDownloaded,hideWidth:1200})]})),(0,n.jsx)(Ze,{queueT:this.queueT}),(0,n.jsx)(Ee,{})]})}}Re.displayName="Queue";const Ne=(0,Ae.Zh)()(Re)}}]);
|
|
2
|
+
//# sourceMappingURL=queue.822b774c6541212741c2.chunk.js.map
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/queue.822b774c6541212741c2.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,oRAAqR,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,0CAA0C,MAAQ,GAAG,SAAW,6FAA6F,eAAiB,CAAC,qRAAqR,WAAa,MAE1yB,S,2FCCA,MAAMC,EA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AAM,CACLC,KAAK,QACL9F,MAAO,GACPgG,UAAU,QACVC,MAAM,SAAC,KAAS,IAChBG,gBAAiBlE,KAAKmD,UACtBU,SAAU,KAEZ,SAAC,EAAAF,OAAM,CACLC,KAAK,WACL9F,MAAO,GACPgG,UAAU,WACVI,gBAAiBlE,KAAKiD,SACtBc,MAAM,SAAC,GAAY,IACnBF,SAAU,KAEZ,SAAC,EAAAF,OAAM,CACLC,KAAK,QACL9F,MAAO,IACPgG,UAAU,aACVC,MAAM,SAAC,KAAY,IACnB4D,UAAW,QAEb,SAAC,EAAAhE,OAAM,CACLC,KAAK,WACL9F,MAAO,IACPgG,UAAU,gBACVC,MAAM,SAAC,KAAY,IACnBG,gBAAiBlE,KAAKkH,aACtBS,UAAW,YAGf,SAAC,GAAY,CAAClB,OAAQzG,KAAKyG,UAC3B,SAAC,GAAgB,MAGvB,EAhJO,GAAA/K,YAAc,QAmJvB,UAAe,UAAf,CAAiCuL,G","sources":["webpack://airdcpp-webui/./src/routes/Queue/style.css","webpack://airdcpp-webui/./src/actions/ui/QueueActions.ts","webpack://airdcpp-webui/./src/actions/ui/QueueFileActions.ts","webpack://airdcpp-webui/./src/components/semantic/Progress.tsx","webpack://airdcpp-webui/./src/actions/ui/QueueBundleActions.ts","webpack://airdcpp-webui/./src/constants/PriorityConstants.ts","webpack://airdcpp-webui/./src/routes/Queue/components/PriorityMenu.tsx","webpack://airdcpp-webui/./src/routes/Queue/components/StatusCell.tsx","webpack://airdcpp-webui/./src/stores/QueueBundleViewStore.js","webpack://airdcpp-webui/./src/stores/QueueFileViewStore.js","webpack://airdcpp-webui/./src/routes/Queue/style.css?62bc","webpack://airdcpp-webui/./src/routes/Queue/components/BundleFileTable.tsx","webpack://airdcpp-webui/./src/routes/Queue/components/BundleFileDialog.tsx","webpack://airdcpp-webui/./src/actions/ui/QueueBundleSourceActions.ts","webpack://airdcpp-webui/./src/routes/Queue/components/BundleSourceTable.tsx","webpack://airdcpp-webui/./src/routes/Queue/components/BundleSourceDialog.tsx","webpack://airdcpp-webui/./src/routes/Queue/components/Queue.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, \".status .error {\\r\\n color: red;\\r\\n}\\r\\n\\r\\n@media only screen and (min-width: 767px) {\\r\\n .source.modal td {\\r\\n max-width: 250px;\\r\\n }\\r\\n\\r\\n /* Can't be applied to dropdown cells */\\r\\n .source.modal td:not(.user) {\\r\\n overflow-x: hidden;\\r\\n }\\r\\n}\\r\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Queue/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,UAAU;AACZ;;AAEA;EACE;IACE,gBAAgB;EAClB;;EAEA,uCAAuC;EACvC;IACE,kBAAkB;EACpB;AACF\",\"sourcesContent\":[\".status .error {\\r\\n color: red;\\r\\n}\\r\\n\\r\\n@media only screen and (min-width: 767px) {\\r\\n .source.modal td {\\r\\n max-width: 250px;\\r\\n }\\r\\n\\r\\n /* Can't be applied to dropdown cells */\\r\\n .source.modal td:not(.user) {\\r\\n overflow-x: hidden;\\r\\n }\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import QueueConstants from 'constants/QueueConstants';\r\nimport SocketService from 'services/SocketService';\r\n\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 setBundlePriorities = (prio: API.QueuePriorityEnum) => {\r\n return SocketService.post(QueueConstants.BUNDLES_URL + '/priority', {\r\n priority: prio,\r\n });\r\n};\r\n\r\nconst handlePause = () => {\r\n return setBundlePriorities(API.QueuePriorityEnum.PAUSED_FORCED);\r\n};\r\n\r\nconst handleResume = () => {\r\n return setBundlePriorities(API.QueuePriorityEnum.DEFAULT);\r\n};\r\n\r\nconst handleRemoveCompleted = () => {\r\n return SocketService.post(QueueConstants.BUNDLES_URL + '/remove_completed');\r\n};\r\n\r\nconst QueueActions: UI.ActionListType<null> = {\r\n removeCompleted: {\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n displayName: 'Remove completed bundles',\r\n icon: IconConstants.REMOVE,\r\n handler: handleRemoveCompleted,\r\n notifications: {\r\n onSuccess: '{{result.count}} completed bundles were removed',\r\n },\r\n },\r\n divider: null,\r\n pause: {\r\n displayName: 'Pause all bundles',\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n icon: IconConstants.PAUSE,\r\n handler: handlePause,\r\n },\r\n resume: {\r\n displayName: 'Resume all bundles',\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n icon: IconConstants.PLAY,\r\n handler: handleResume,\r\n },\r\n};\r\n\r\nexport default {\r\n moduleId: UI.Modules.QUEUE,\r\n actions: QueueActions,\r\n};\r\n","import QueueConstants from 'constants/QueueConstants';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\nimport SearchActions from 'actions/reflux/SearchActions';\r\n\r\nconst itemNotFinished = (item: API.QueueFile) => item.time_finished === 0;\r\n\r\nconst handleSearch: UI.ActionHandler<API.QueueFile> = ({ data: itemInfo, location }) => {\r\n return SearchActions.search(itemInfo, location);\r\n};\r\n\r\nconst handleRemoveFile: UI.ActionHandler<API.QueueFile> = (\r\n { data: file },\r\n removeFinished: boolean\r\n) => {\r\n return SocketService.post(`${QueueConstants.FILES_URL}/${file.id}/remove`, {\r\n remove_finished: removeFinished,\r\n });\r\n};\r\n\r\nconst handleSearchFileAlternates: UI.ActionHandler<API.QueueFile> = ({ data: file }) => {\r\n return SocketService.post(`${QueueConstants.FILES_URL}/${file.id}/search`);\r\n};\r\n\r\nconst QueueFileActions: UI.ActionListType<API.QueueFile> = {\r\n search: {\r\n access: API.AccessEnum.SEARCH,\r\n displayName: 'Search (foreground)',\r\n icon: IconConstants.SEARCH,\r\n handler: handleSearch,\r\n },\r\n searchFileAlternates: {\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n displayName: 'Search for alternates',\r\n icon: IconConstants.SEARCH_ALTERNATES,\r\n filter: itemNotFinished,\r\n handler: handleSearchFileAlternates,\r\n notifications: {\r\n onSuccess: 'File {{item.name}} was searched for alternates',\r\n },\r\n },\r\n removeFile: {\r\n displayName: 'Remove',\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the file {{item.name}}?',\r\n approveCaption: 'Remove file',\r\n rejectCaption: `Don't remove`,\r\n checkboxCaption: 'Remove on disk',\r\n },\r\n handler: handleRemoveFile,\r\n notifications: {\r\n onSuccess: 'File {{item.name}} was removed from queue',\r\n },\r\n },\r\n};\r\n\r\nexport default {\r\n moduleId: UI.Modules.QUEUE,\r\n //subId: 'file',\r\n actions: QueueFileActions,\r\n} as UI.ModuleActions<API.QueueFile>;\r\n","import PropTypes from 'prop-types';\r\nimport * as React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nexport interface ProgressProps {\r\n caption?: React.ReactNode;\r\n className?: string | null;\r\n percent?: number;\r\n}\r\n\r\nconst Progress: React.FC<ProgressProps> = ({ className, percent, caption }) => (\r\n <div\r\n className={classNames('ui progress', className, {\r\n indeterminate: percent === undefined,\r\n })}\r\n data-percent={percent}\r\n >\r\n <div\r\n className=\"bar\"\r\n style={{\r\n transitionDuration: 300 + 'ms',\r\n width: percent === undefined ? undefined : percent + '%',\r\n minWidth: '0px',\r\n }}\r\n >\r\n <div className=\"progress\" />\r\n </div>\r\n {!!caption && <div className=\"label\">{caption}</div>}\r\n </div>\r\n);\r\n\r\nProgress.propTypes = {\r\n percent: PropTypes.number.isRequired,\r\n caption: PropTypes.node.isRequired,\r\n className: PropTypes.string,\r\n};\r\n\r\nexport default Progress;\r\n","import { default as QueueConstants, StatusEnum } from 'constants/QueueConstants';\r\nimport SocketService from 'services/SocketService';\r\nimport History from 'utils/History';\r\n\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\nimport SearchActions from 'actions/reflux/SearchActions';\r\n\r\nconst bundleValidationFailed = (bundle: API.QueueBundle) =>\r\n bundle.status.id === StatusEnum.COMPLETION_VALIDATION_ERROR;\r\nconst itemNotFinished = (bundle: API.QueueBundle) => bundle.time_finished === 0;\r\nconst isDirectoryBundle = (bundle: API.QueueBundle) => bundle.type.id === 'directory';\r\nconst hasSources = (bundle: API.QueueBundle) =>\r\n bundle.sources.total > 0 && itemNotFinished(bundle);\r\n\r\nconst shareBundle = (bundle: API.QueueBundle, skipValidation: boolean) => {\r\n return SocketService.post(`${QueueConstants.BUNDLES_URL}/${bundle.id}/share`, {\r\n skip_validation: skipValidation,\r\n });\r\n};\r\n\r\nconst handleRescan: UI.ActionHandler<API.QueueBundle> = ({ data: bundle }) => {\r\n return shareBundle(bundle, false);\r\n};\r\n\r\nconst handleForceShare: UI.ActionHandler<API.QueueBundle> = ({ data: bundle }) => {\r\n return shareBundle(bundle, true);\r\n};\r\n\r\nconst handleRemoveBundle: UI.ActionHandler<API.QueueBundle> = (\r\n { data: bundle },\r\n removeFinished\r\n) => {\r\n return SocketService.post(`${QueueConstants.BUNDLES_URL}/${bundle.id}/remove`, {\r\n remove_finished: removeFinished,\r\n });\r\n};\r\n\r\nconst handleSearch: UI.ActionHandler<API.QueueBundle> = ({\r\n data: itemInfo,\r\n location,\r\n}) => {\r\n return SearchActions.search(itemInfo, location);\r\n};\r\n\r\nconst handleSearchBundleAlternates: UI.ActionHandler<API.QueueBundle> = ({\r\n data: bundle,\r\n}) => {\r\n return SocketService.post(`${QueueConstants.BUNDLES_URL}/${bundle.id}/search`);\r\n};\r\n\r\nconst handleSources: UI.ActionHandler<API.QueueBundle> = ({ data, location }) => {\r\n History.push(`${location.pathname}/sources/${data.id}`);\r\n};\r\n\r\nconst handleContent: UI.ActionHandler<API.QueueBundle> = ({ data, location }) => {\r\n History.push(`${location.pathname}/content/${data.id}`);\r\n};\r\n\r\nconst QueueBundleActions: UI.ActionListType<API.QueueBundle> = {\r\n sources: {\r\n displayName: 'Manage sources...',\r\n icon: IconConstants.USER,\r\n filter: hasSources,\r\n handler: handleSources,\r\n },\r\n content: {\r\n displayName: 'Manage files...',\r\n icon: IconConstants.FILE,\r\n filter: isDirectoryBundle,\r\n handler: handleContent,\r\n },\r\n divider: null,\r\n search: {\r\n access: API.AccessEnum.SEARCH,\r\n displayName: 'Search (foreground)',\r\n icon: IconConstants.SEARCH,\r\n handler: handleSearch,\r\n },\r\n searchBundleAlternates: {\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n displayName: 'Search for alternates',\r\n icon: IconConstants.SEARCH_ALTERNATES,\r\n filter: itemNotFinished,\r\n handler: handleSearchBundleAlternates,\r\n notifications: {\r\n onSuccess: 'The bundle {{item.name}} was searched for alternates',\r\n },\r\n },\r\n divider2: null,\r\n removeBundle: {\r\n displayName: 'Remove',\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n icon: IconConstants.REMOVE,\r\n confirmation: {\r\n content: 'Are you sure that you want to remove the bundle {{item.name}}?',\r\n approveCaption: 'Remove bundle',\r\n rejectCaption: `Don't remove`,\r\n checkboxCaption: 'Remove finished files',\r\n },\r\n handler: handleRemoveBundle,\r\n },\r\n divider3: null,\r\n rescan: {\r\n displayName: 'Rescan for errors',\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n icon: IconConstants.REFRESH_COLORED,\r\n filter: bundleValidationFailed,\r\n handler: handleRescan,\r\n },\r\n forceShare: {\r\n displayName: 'Force in share',\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n icon: IconConstants.ERROR,\r\n filter: bundleValidationFailed,\r\n handler: handleForceShare,\r\n },\r\n};\r\n\r\nexport default {\r\n moduleId: UI.Modules.QUEUE,\r\n //subId: 'bundle',\r\n actions: QueueBundleActions,\r\n} as UI.ModuleActions<API.QueueBundle>;\r\n","import { QueuePriorityEnum } from 'types/api';\r\n\r\nexport const PriorityEnum = {\r\n [QueuePriorityEnum.PAUSED_FORCED]: { str: 'Paused (forced)', id: 0 },\r\n [QueuePriorityEnum.PAUSED]: { str: 'Paused', id: 1 },\r\n [QueuePriorityEnum.LOWEST]: { str: 'Lowest', id: 2 },\r\n [QueuePriorityEnum.LOW]: { str: 'Low', id: 3 },\r\n [QueuePriorityEnum.NORMAL]: { str: 'Normal', id: 4 },\r\n [QueuePriorityEnum.HIGH]: { str: 'High', id: 5 },\r\n [QueuePriorityEnum.HIGHEST]: { str: 'Highest', id: 6 },\r\n};\r\n","import PropTypes from 'prop-types';\r\nimport { Component } from 'react';\r\nimport isEqual from 'lodash/isEqual';\r\n\r\nimport { PriorityEnum } from 'constants/PriorityConstants';\r\n\r\nimport TableDropdown, { DropdownCloseHandler } from 'components/semantic/TableDropdown';\r\n\r\nimport LoginStore from 'stores/LoginStore';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { translate } from 'utils/TranslationUtils';\r\nimport { runBackgroundSocketAction } from 'utils/ActionUtils';\r\nimport { EmptyDropdownCaption } from 'components/semantic/EmptyDropdown';\r\nimport { buildMenu } from 'components/action-menu/builder/slidingMenuBuilder';\r\n\r\ninterface PriorityMenuProps {\r\n itemPrio: API.QueuePriority;\r\n item: API.QueueItemBase;\r\n prioAction: (item: API.QueueItemBase, priority: API.QueuePriorityEnum) => Promise<any>;\r\n t: UI.TranslateF;\r\n}\r\n\r\nclass PriorityMenu extends Component<PriorityMenuProps> {\r\n static propTypes = {\r\n /**\r\n * Priority object\r\n */\r\n itemPrio: PropTypes.object.isRequired,\r\n\r\n /**\r\n * Item with priority properties\r\n */\r\n item: PropTypes.object.isRequired,\r\n\r\n prioAction: PropTypes.func.isRequired,\r\n };\r\n\r\n setPriority = (priorityId: API.QueuePriorityEnum) => {\r\n const { item, prioAction, t } = this.props;\r\n return runBackgroundSocketAction(() => prioAction(item, priorityId), t);\r\n };\r\n\r\n setAutoPriority = () => {\r\n this.setPriority(API.QueuePriorityEnum.DEFAULT);\r\n };\r\n\r\n shouldComponentUpdate(nextProps: PriorityMenuProps) {\r\n return !isEqual(nextProps.item.priority, this.props.item.priority);\r\n }\r\n\r\n getPriorityListItem = (\r\n priority: Omit<API.QueuePriority, 'auto'>,\r\n t: UI.TranslateF\r\n ): UI.ActionMenuItem => {\r\n const currentPrio = this.props.item.priority.id;\r\n return {\r\n id: priority.id.toString(),\r\n item: {\r\n active: currentPrio === priority.id,\r\n onClick: () => {\r\n this.setPriority(priority.id);\r\n },\r\n children: translate(priority.str, t, UI.Modules.QUEUE),\r\n },\r\n };\r\n };\r\n\r\n getChildren = (onClose: DropdownCloseHandler) => {\r\n const { t } = this.props;\r\n\r\n const children = Object.keys(PriorityEnum)\r\n .map(Number)\r\n .map((prioKey) =>\r\n this.getPriorityListItem(PriorityEnum[prioKey as keyof typeof PriorityEnum], t)\r\n );\r\n\r\n children.push({ id: 'divider' });\r\n children.push({\r\n id: 'auto',\r\n item: {\r\n active: this.props.itemPrio.auto,\r\n onClick: () => {\r\n this.setPriority(API.QueuePriorityEnum.DEFAULT);\r\n },\r\n children: translate('Auto', t, UI.Modules.QUEUE),\r\n },\r\n });\r\n\r\n return buildMenu(children, onClose);\r\n };\r\n\r\n render() {\r\n const { itemPrio, t } = this.props;\r\n let caption = translate(\r\n PriorityEnum[itemPrio.id as keyof typeof PriorityEnum].str,\r\n t,\r\n UI.Modules.QUEUE\r\n );\r\n if (itemPrio.auto) {\r\n caption += ` (${translate('Auto', t, UI.Modules.QUEUE).toLocaleLowerCase()})`;\r\n }\r\n\r\n if (!LoginStore.hasAccess(API.AccessEnum.QUEUE_EDIT)) {\r\n return <EmptyDropdownCaption caption={caption} />;\r\n }\r\n\r\n return (\r\n <TableDropdown caption={caption} className=\"priority-menu\">\r\n {this.getChildren}\r\n </TableDropdown>\r\n );\r\n }\r\n}\r\n\r\nexport default PriorityMenu;\r\n","import * as React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nimport Progress from 'components/semantic/Progress';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport * as API from 'types/api';\r\n\r\nconst getStatusClass = (cellData: API.QueueBundleStatus, rowData: API.QueueBundle) => {\r\n if (cellData.completed) {\r\n return 'success';\r\n }\r\n\r\n const statusId = cellData.id;\r\n return classNames(\r\n {\r\n grey:\r\n (!statusId || statusId === API.QueueBundleStatusEnum.QUEUED) &&\r\n rowData.speed === 0,\r\n },\r\n {\r\n blue:\r\n (!statusId || statusId === API.QueueBundleStatusEnum.QUEUED) && rowData.speed > 0,\r\n }\r\n );\r\n};\r\n\r\nconst StatusCell: React.FC<\r\n RowWrapperCellChildProps<API.QueueBundleStatus, API.QueueBundle>\r\n> = ({ cellData, rowDataGetter }) => {\r\n if (cellData!.failed) {\r\n // There isn't much space for other information\r\n return <span className=\"error\">{cellData!.str}</span>;\r\n }\r\n\r\n const rowData = rowDataGetter!();\r\n return (\r\n <Progress\r\n className={getStatusClass(cellData!, rowData)}\r\n caption={cellData!.str}\r\n percent={(rowData.downloaded_bytes * 100) / rowData.size}\r\n />\r\n );\r\n};\r\n\r\nexport default StatusCell;\r\n","import Reflux from 'reflux';\r\n\r\nimport QueueConstants from 'constants/QueueConstants';\r\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\r\n\r\nexport default Reflux.createStore({\r\n _viewName: 'queue_bundle_view',\r\n _apiUrl: QueueConstants.MODULE_URL,\r\n mixins: [ViewStoreMixin('name')],\r\n});\r\n","import Reflux from 'reflux';\r\n\r\nimport QueueConstants from 'constants/QueueConstants';\r\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\r\n\r\nexport default Reflux.createStore({\r\n _viewName: 'queue_file_view',\r\n _apiUrl: QueueConstants.MODULE_URL,\r\n mixins: [ViewStoreMixin('name')],\r\n});\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\nimport { Column } from 'fixed-data-table-2';\r\n\r\nimport QueueFileUIActions from 'actions/ui/QueueFileActions';\r\n\r\nimport VirtualTable from 'components/table/VirtualTable';\r\n\r\nimport PriorityMenu from 'routes/Queue/components/PriorityMenu';\r\nimport StatusCell from 'routes/Queue/components/StatusCell';\r\n\r\nimport QueueFileViewStore from 'stores/QueueFileViewStore';\r\n\r\nimport {\r\n FileActionCell,\r\n SizeCell,\r\n SpeedCell,\r\n AbbreviatedDurationCell,\r\n} from 'components/table/Cell';\r\n\r\nimport '../style.css';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport * as API from 'types/api';\r\nimport { setFilePriority } from 'services/api/QueueApi';\r\nimport MenuConstants from 'constants/MenuConstants';\r\n\r\nconst PriorityCell: React.FC<\r\n RowWrapperCellChildProps<API.QueuePriority, API.QueueBundle>\r\n> = ({ cellData, rowDataGetter, t }) => (\r\n <PriorityMenu\r\n itemPrio={cellData!}\r\n item={rowDataGetter!()}\r\n prioAction={setFilePriority}\r\n t={t!}\r\n />\r\n);\r\n\r\ninterface BundleFileTableProps {\r\n bundle: API.QueueBundle;\r\n}\r\n\r\nclass BundleFileTable extends React.Component<BundleFileTableProps> {\r\n isActive = (cellData: any, rowData: API.QueueFile) => {\r\n return !rowData.status.downloaded;\r\n };\r\n\r\n isRunning = (cellData: any, rowData: API.QueueFile) => {\r\n return rowData.speed > 0;\r\n };\r\n\r\n render() {\r\n return (\r\n <VirtualTable\r\n store={QueueFileViewStore}\r\n sourceFilter={{\r\n pattern: this.props.bundle.id,\r\n method: API.FilterMethod.EXACT,\r\n property: 'bundle',\r\n }}\r\n moduleId={QueueFileUIActions.moduleId}\r\n >\r\n <Column\r\n name=\"Name\"\r\n width={200}\r\n flexGrow={20}\r\n columnKey=\"name\"\r\n cell={\r\n <FileActionCell\r\n actions={QueueFileUIActions}\r\n remoteMenuId={MenuConstants.QUEUE_FILE}\r\n />\r\n }\r\n />\r\n <Column\r\n name=\"Size\"\r\n width={70}\r\n columnKey=\"size\"\r\n cell={<SizeCell />}\r\n flexGrow={1}\r\n />\r\n <Column name=\"Status\" width={120} columnKey=\"status\" cell={<StatusCell />} />\r\n <Column\r\n name=\"Sources\"\r\n width={65}\r\n columnKey=\"sources\"\r\n renderCondition={this.isActive}\r\n />\r\n <Column\r\n name=\"Time left\"\r\n width={50}\r\n columnKey=\"seconds_left\"\r\n renderCondition={this.isRunning}\r\n cell={<AbbreviatedDurationCell />}\r\n />\r\n <Column\r\n name=\"Speed\"\r\n width={55}\r\n columnKey=\"speed\"\r\n cell={<SpeedCell />}\r\n renderCondition={this.isRunning}\r\n />\r\n <Column\r\n name=\"Priority\"\r\n width={80}\r\n columnKey=\"priority\"\r\n renderCondition={this.isActive}\r\n cell={<PriorityCell />}\r\n flexGrow={1}\r\n />\r\n </VirtualTable>\r\n );\r\n }\r\n}\r\n\r\nexport default BundleFileTable;\r\n","import { Component } from 'react';\r\nimport Modal from 'components/semantic/Modal';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\n\r\nimport FileIcon from 'components/icon/FileIcon';\r\nimport BundleFileTable from 'routes/Queue/components/BundleFileTable';\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport QueueConstants from 'constants/QueueConstants';\r\n\r\nimport * as API from 'types/api';\r\n\r\ninterface BundleFileDialogProps {}\r\n\r\ninterface DataProps extends DataProviderDecoratorChildProps {\r\n bundle: API.QueueBundle;\r\n}\r\n\r\ninterface RouteProps {\r\n bundleId: string;\r\n}\r\n\r\ntype Props = BundleFileDialogProps &\r\n DataProps &\r\n ModalRouteDecoratorChildProps<RouteProps>;\r\n\r\nclass BundleFileDialog extends Component<Props> {\r\n static displayName = 'BundleFileDialog';\r\n\r\n render() {\r\n const { bundle, ...other } = this.props;\r\n return (\r\n <Modal\r\n className=\"source\"\r\n title={bundle.name}\r\n subHeader={bundle.target}\r\n closable={true}\r\n icon={<FileIcon typeInfo={bundle.type} />}\r\n fullHeight={true}\r\n {...other}\r\n >\r\n <BundleFileTable bundle={bundle} />\r\n </Modal>\r\n );\r\n }\r\n}\r\n\r\nexport default ModalRouteDecorator<BundleFileDialogProps, RouteProps>(\r\n DataProviderDecorator<Omit<Props, keyof DataProps>, DataProps>(BundleFileDialog, {\r\n urls: {\r\n bundle: ({ match }, socket) =>\r\n socket.get(`${QueueConstants.BUNDLES_URL}/${match.params.bundleId}`),\r\n },\r\n }),\r\n 'content/:bundleId'\r\n);\r\n","import { default as QueueConstants } from 'constants/QueueConstants';\r\nimport SocketService from 'services/SocketService';\r\n\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\ninterface ActionBundleSourceData {\r\n source: API.QueueBundleSource;\r\n bundle: API.QueueBundle;\r\n}\r\n\r\nconst handleRemoveBundleSource: UI.ActionHandler<ActionBundleSourceData> = ({ data }) => {\r\n const { source, bundle } = data;\r\n return SocketService.delete(\r\n `${QueueConstants.BUNDLES_URL}/${bundle.id}/sources/${source.user.cid}`\r\n );\r\n};\r\n\r\nconst BundleSourceActions: UI.ActionListType<ActionBundleSourceData> = {\r\n removeBundleSource: {\r\n access: API.AccessEnum.QUEUE_EDIT,\r\n displayName: 'Remove source',\r\n icon: IconConstants.REMOVE,\r\n handler: handleRemoveBundleSource,\r\n },\r\n};\r\n\r\nexport default {\r\n moduleId: UI.Modules.QUEUE,\r\n subId: 'bundleSource',\r\n actions: BundleSourceActions,\r\n};\r\n","import * as React from 'react';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\n\r\nimport QueueBundleSourceActions from 'actions/ui/QueueBundleSourceActions';\r\nimport QueueConstants from 'constants/QueueConstants';\r\n\r\nimport { formatSize, formatSpeed } from 'utils/ValueFormat';\r\n\r\nimport { ActionMenu, UserMenu } from 'components/action-menu';\r\nimport { UserFileActions } from 'actions/ui/UserActions';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\nimport MenuConstants from 'constants/MenuConstants';\r\n\r\ninterface SourceProps {\r\n bundle: API.QueueBundle;\r\n source: API.QueueBundleSource;\r\n t: UI.TranslateF;\r\n}\r\n\r\nconst Source: React.FC<SourceProps> = ({ source, bundle, t }) => (\r\n <tr>\r\n <td className=\"user dropdown\">\r\n <UserMenu\r\n userIcon={true}\r\n user={source.user}\r\n ids={UserFileActions}\r\n contextElement=\".source.modal\"\r\n remoteMenuId={MenuConstants.HINTED_USER}\r\n >\r\n <ActionMenu\r\n actions={QueueBundleSourceActions}\r\n //ids={ [ 'removeBundleSource' ]}\r\n itemData={{\r\n source,\r\n bundle,\r\n }}\r\n />\r\n </UserMenu>\r\n </td>\r\n <td className=\"hubs\">{source.user.hub_names}</td>\r\n <td className=\"speed\">\r\n {source.last_speed > 0 && formatSpeed(source.last_speed, t)}\r\n </td>\r\n <td className=\"files\">{source.files}</td>\r\n <td className=\"size\">{formatSize(source.size, t)}</td>\r\n </tr>\r\n);\r\n\r\nconst userSort = (a: API.QueueBundleSource, b: API.QueueBundleSource) =>\r\n a.user.nicks.localeCompare(b.user.nicks);\r\n\r\ninterface BundleSourceTableProps {\r\n bundle: API.QueueBundle;\r\n queueT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface BundleSourceTableDataProps extends DataProviderDecoratorChildProps {\r\n sources: API.QueueBundleSource[];\r\n}\r\n\r\nconst BundleSourceTable: React.FC<\r\n BundleSourceTableProps & BundleSourceTableDataProps\r\n> = ({ sources, bundle, queueT }) => {\r\n const { translate } = queueT;\r\n\r\n return (\r\n <div className=\"sources\">\r\n <h2>{translate('Sources')}</h2>\r\n <table className=\"ui striped table\">\r\n <thead>\r\n <tr>\r\n <th>{translate('User')}</th>\r\n <th>{translate('Hubs')}</th>\r\n <th>{translate('Last known speed')}</th>\r\n <th>{translate('Files')}</th>\r\n <th>{translate('Size')}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {sources.sort(userSort).map((source) => (\r\n <Source\r\n key={source.user.cid}\r\n source={source}\r\n bundle={bundle!}\r\n t={queueT.plainT}\r\n />\r\n ))}\r\n </tbody>\r\n </table>\r\n </div>\r\n );\r\n};\r\n\r\nexport default DataProviderDecorator<BundleSourceTableProps, BundleSourceTableDataProps>(\r\n BundleSourceTable,\r\n {\r\n urls: {\r\n sources: ({ bundle }, socket) =>\r\n socket.get(`${QueueConstants.BUNDLES_URL}/${bundle!.id}/sources`),\r\n },\r\n onSocketConnected: (addSocketListener, { refetchData, props }) => {\r\n addSocketListener<API.QueueBundle>(\r\n QueueConstants.MODULE_URL,\r\n QueueConstants.BUNDLE_SOURCES,\r\n (data) => {\r\n // Avoid flickering when there are many bundles running\r\n if (data.id === props.bundle!.id) {\r\n refetchData();\r\n }\r\n }\r\n );\r\n },\r\n }\r\n);\r\n","import { Component } from 'react';\r\nimport Modal from 'components/semantic/Modal';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\n\r\nimport FileIcon from 'components/icon/FileIcon';\r\n\r\nimport SourceTable from 'routes/Queue/components/BundleSourceTable';\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport QueueConstants from 'constants/QueueConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\ninterface BundleSourceDialogProps {\r\n queueT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps extends DataProviderDecoratorChildProps {\r\n bundle: API.QueueBundle;\r\n}\r\n\r\ninterface RouteProps {\r\n bundleId: string;\r\n}\r\n\r\ntype Props = BundleSourceDialogProps & ModalRouteDecoratorChildProps<RouteProps>;\r\n\r\nclass SourceDialog extends Component<Props & DataProps> {\r\n static displayName = 'SourceDialog';\r\n\r\n render() {\r\n const { bundle, queueT } = this.props;\r\n return (\r\n <Modal\r\n className=\"source\"\r\n title={bundle.name}\r\n subHeader={bundle.target}\r\n closable={true}\r\n icon={<FileIcon typeInfo={bundle.type} />}\r\n fullHeight={true}\r\n {...this.props}\r\n >\r\n <SourceTable bundle={bundle} queueT={queueT} />\r\n </Modal>\r\n );\r\n }\r\n}\r\n\r\nexport default ModalRouteDecorator<BundleSourceDialogProps, RouteProps>(\r\n DataProviderDecorator<Props, DataProps>(SourceDialog, {\r\n urls: {\r\n bundle: ({ match }, socket) =>\r\n socket.get(`${QueueConstants.BUNDLES_URL}/${match.params.bundleId}`),\r\n },\r\n }),\r\n 'sources/:bundleId'\r\n);\r\n","import * as React from 'react';\r\nimport { Column } from 'fixed-data-table-2';\r\n\r\nimport QueueActions from 'actions/ui/QueueActions';\r\nimport QueueBundleActions from 'actions/ui/QueueBundleActions';\r\nimport VirtualTable from 'components/table/VirtualTable';\r\n\r\nimport PriorityMenu from 'routes/Queue/components/PriorityMenu';\r\nimport StatusCell from 'routes/Queue/components/StatusCell';\r\nimport QueueBundleViewStore from 'stores/QueueBundleViewStore';\r\n\r\nimport BundleFileDialog from 'routes/Queue/components/BundleFileDialog';\r\nimport SourceDialog from 'routes/Queue/components/BundleSourceDialog';\r\n\r\nimport { ActionMenu } from 'components/action-menu';\r\nimport Message from 'components/semantic/Message';\r\n\r\nimport {\r\n ActionLinkCell,\r\n FileActionCell,\r\n SizeCell,\r\n SpeedCell,\r\n AbbreviatedDurationCell,\r\n DurationCell,\r\n} from 'components/table/Cell';\r\n\r\nimport '../style.css';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { withTranslation, WithTranslation } from 'react-i18next';\r\nimport { getModuleT } from 'utils/TranslationUtils';\r\nimport { setBundlePriority } from 'services/api/QueueApi';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport MenuConstants from 'constants/MenuConstants';\r\n\r\nconst PriorityCell: React.FC<\r\n RowWrapperCellChildProps<API.QueuePriority, API.QueueBundle>\r\n> = ({ cellData, rowDataGetter, t }) => (\r\n <PriorityMenu\r\n itemPrio={cellData!}\r\n item={rowDataGetter!()}\r\n prioAction={setBundlePriority}\r\n t={t!}\r\n />\r\n);\r\n\r\nclass Queue extends React.Component<WithTranslation> {\r\n static displayName = 'Queue';\r\n\r\n isActive = (cellData: any, rowData: API.QueueBundle) => {\r\n return !rowData.status.downloaded;\r\n };\r\n\r\n isDownloaded = (cellData: any, rowData: API.QueueBundle) => {\r\n return rowData.status.downloaded;\r\n };\r\n\r\n isRunning = (cellData: any, rowData: API.QueueBundle) => {\r\n return rowData.speed > 0;\r\n };\r\n\r\n emptyRowsNodeGetter = () => {\r\n const { t } = this.queueT;\r\n return (\r\n <Message\r\n title={t('queueEmpty', 'The queue is empty')}\r\n icon={IconConstants.FILE}\r\n description={t<string>(\r\n 'queueEmptyDesc',\r\n 'New items can be queued from search or filelists'\r\n )}\r\n />\r\n );\r\n };\r\n\r\n queueT = getModuleT(this.props.t, UI.Modules.QUEUE);\r\n render() {\r\n const { translate } = this.queueT;\r\n return (\r\n <>\r\n <VirtualTable\r\n emptyRowsNodeGetter={this.emptyRowsNodeGetter}\r\n store={QueueBundleViewStore}\r\n footerData={\r\n <ActionMenu\r\n className=\"top left pointing\"\r\n caption={translate('Actions...')}\r\n actions={QueueActions}\r\n header={translate('Queue actions')}\r\n triggerIcon=\"chevron up\"\r\n button={true}\r\n />\r\n }\r\n moduleId={QueueActions.moduleId}\r\n >\r\n <Column\r\n name=\"Name\"\r\n width={200}\r\n flexGrow={4}\r\n columnKey=\"name\"\r\n cell={\r\n <FileActionCell\r\n actions={QueueBundleActions}\r\n remoteMenuId={MenuConstants.QUEUE_BUNDLE}\r\n ids={[\r\n 'content',\r\n 'sources',\r\n 'divider',\r\n 'search',\r\n 'searchBundleAlternates',\r\n 'divider',\r\n 'removeBundle',\r\n 'divider',\r\n 'rescan',\r\n 'forceShare',\r\n ]}\r\n />\r\n }\r\n />\r\n <Column\r\n name=\"Size\"\r\n width={60}\r\n columnKey=\"size\"\r\n cell={<SizeCell />}\r\n flexGrow={1}\r\n />\r\n <Column\r\n name=\"Type/content\"\r\n width={150}\r\n columnKey=\"type\"\r\n hideWidth={1000}\r\n cell={<ActionLinkCell actions={QueueBundleActions} actionId=\"content\" />}\r\n />\r\n <Column\r\n name=\"Status\"\r\n width={120}\r\n flexGrow={3}\r\n columnKey=\"status\"\r\n cell={<StatusCell />}\r\n />\r\n <Column\r\n name=\"Sources\"\r\n width={60}\r\n columnKey=\"sources\"\r\n renderCondition={this.isActive}\r\n flexGrow={1}\r\n cell={<ActionLinkCell actions={QueueBundleActions} actionId=\"sources\" />}\r\n />\r\n <Column\r\n name=\"Time left\"\r\n width={50}\r\n columnKey=\"seconds_left\"\r\n renderCondition={this.isRunning}\r\n cell={<AbbreviatedDurationCell />}\r\n />\r\n <Column\r\n name=\"Speed\"\r\n width={50}\r\n columnKey=\"speed\"\r\n cell={<SpeedCell />}\r\n renderCondition={this.isRunning}\r\n flexGrow={1}\r\n />\r\n <Column\r\n name=\"Priority\"\r\n width={80}\r\n columnKey=\"priority\"\r\n renderCondition={this.isActive}\r\n cell={<PriorityCell />}\r\n flexGrow={1}\r\n />\r\n <Column\r\n name=\"Added\"\r\n width={100}\r\n columnKey=\"time_added\"\r\n cell={<DurationCell />}\r\n hideWidth={1400}\r\n />\r\n <Column\r\n name=\"Finished\"\r\n width={100}\r\n columnKey=\"time_finished\"\r\n cell={<DurationCell />}\r\n renderCondition={this.isDownloaded}\r\n hideWidth={1200}\r\n />\r\n </VirtualTable>\r\n <SourceDialog queueT={this.queueT} />\r\n <BundleFileDialog />\r\n </>\r\n );\r\n }\r\n}\r\n\r\nexport default withTranslation()(Queue);\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","setBundlePriorities","prio","priority","QueueActions","removeCompleted","access","displayName","icon","handler","notifications","onSuccess","divider","pause","resume","moduleId","actions","QueueFileActions","search","data","itemInfo","location","searchFileAlternates","filter","item","time_finished","file","removeFile","confirmation","content","approveCaption","rejectCaption","checkboxCaption","removeFinished","remove_finished","Progress","className","percent","caption","indeterminate","undefined","style","transitionDuration","width","minWidth","propTypes","bundleValidationFailed","bundle","status","itemNotFinished","shareBundle","skipValidation","SocketService","QueueConstants","skip_validation","QueueBundleActions","sources","IconConstants","total","History","pathname","type","SearchActions","searchBundleAlternates","divider2","removeBundle","divider3","rescan","forceShare","PriorityEnum","str","PriorityMenu","Component","setPriority","priorityId","prioAction","t","this","props","setAutoPriority","getPriorityListItem","currentPrio","toString","active","onClick","children","getChildren","onClose","Object","keys","map","Number","prioKey","itemPrio","auto","shouldComponentUpdate","nextProps","render","toLocaleLowerCase","LoginStore","TableDropdown","EmptyDropdown","getStatusClass","cellData","rowData","completed","statusId","grey","speed","blue","rowDataGetter","failed","downloaded_bytes","size","_viewName","_apiUrl","mixins","ViewStoreMixin","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","PriorityCell","BundleFileTable","isActive","downloaded","isRunning","VirtualTable","store","QueueFileViewStore","sourceFilter","pattern","method","property","Column","name","flexGrow","columnKey","cell","remoteMenuId","MenuConstants","renderCondition","BundleFileDialog","other","Modal","title","subHeader","target","closable","FileIcon","typeInfo","fullHeight","ModalRouteDecorator","DataProviderDecorator","urls","match","socket","get","params","bundleId","BundleSourceActions","removeBundleSource","source","user","cid","subId","Source","userIcon","ids","contextElement","QueueBundleSourceActions","itemData","hub_names","last_speed","files","userSort","a","b","nicks","localeCompare","queueT","translate","sort","plainT","onSocketConnected","addSocketListener","refetchData","SourceDialog","Queue","isDownloaded","emptyRowsNodeGetter","Message","description","QueueBundleViewStore","footerData","header","triggerIcon","button","hideWidth","actionId"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkairdcpp_webui=self.webpackChunkairdcpp_webui||[]).push([[464],{48366:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(87537),r=n.n(s),i=n(23645),a=n.n(i)()(r());a.push([e.id,".fileitem.info.segment .dupe-paths .path {\r\n overflow-x: hidden;\r\n}\r\n\r\n.fileitem.info.segment .download.ui.dropdown {\r\n max-width: 150px;\r\n margin-top: 10px;\r\n}\r\n\r\n.fileitem.info.segment .title.column {\r\n margin-top: auto;\r\n margin-bottom: auto;\r\n}\r\n\r\n.fileitem.info.segment .value.column {\r\n word-break: break-all;\r\n}\r\n","",{version:3,sources:["webpack://./src/components/file-item-info/style.css"],names:[],mappings:"AAAA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB",sourcesContent:[".fileitem.info.segment .dupe-paths .path {\r\n overflow-x: hidden;\r\n}\r\n\r\n.fileitem.info.segment .download.ui.dropdown {\r\n max-width: 150px;\r\n margin-top: 10px;\r\n}\r\n\r\n.fileitem.info.segment .title.column {\r\n margin-top: auto;\r\n margin-bottom: auto;\r\n}\r\n\r\n.fileitem.info.segment .value.column {\r\n word-break: break-all;\r\n}\r\n"],sourceRoot:""}]);const o=a},48931:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(87537),r=n.n(s),i=n(23645),a=n.n(i)()(r());a.push([e.id,".search-container {\r\n width: 100%;\r\n height: 50px;\r\n}\r\n\r\n#mobile-layout .search-container {\r\n margin-top: 10px;\r\n}\r\n\r\n.search-container .search-area {\r\n width: 90%;\r\n max-width: 600px;\r\n margin-left: auto;\r\n margin-right: auto;\r\n display: flex;\r\n}\r\n\r\n.search-container .search-area .options.trigger {\r\n margin-left: 5px;\r\n}\r\n\r\n.search-container .search-area .options.trigger .button {\r\n padding-left: 15px;\r\n padding-right: 5px;\r\n height: 100%;\r\n}\r\n\r\n.search-container .search-area .ui.input.action {\r\n flex: 1;\r\n}\r\n\r\n.search-area,\r\n.search-area .react-autosuggest__container,\r\n.search-container .search-area .ui.input.action {\r\n flex: 1;\r\n}\r\n\r\n.search-area,\r\n.search-area input {\r\n width: 100%;\r\n}\r\n\r\n.search-area button {\r\n display: inline-block !important;\r\n}\r\n\r\n.search-layout {\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n}\r\n\r\n.search-layout .virtual-table {\r\n height: calc(100% - 50px);\r\n}\r\n\r\n@media only screen and (min-width: 767px) {\r\n .result.modal td {\r\n max-width: 250px;\r\n }\r\n}\r\n\r\n.search-options {\r\n min-width: 300px;\r\n}\r\n\r\n.search-options .field-hub_urls {\r\n max-height: 180px;\r\n overflow-y: auto;\r\n}\r\n","",{version:3,sources:["webpack://./src/routes/Search/style.css"],names:[],mappings:"AAAA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,UAAU;EACV,gBAAgB;EAChB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;AACf;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,OAAO;AACT;;AAEA;;;EAGE,OAAO;AACT;;AAEA;;EAEE,WAAW;AACb;;AAEA;EACE,gCAAgC;AAClC;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE;IACE,gBAAgB;EAClB;AACF;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;AAClB",sourcesContent:[".search-container {\r\n width: 100%;\r\n height: 50px;\r\n}\r\n\r\n#mobile-layout .search-container {\r\n margin-top: 10px;\r\n}\r\n\r\n.search-container .search-area {\r\n width: 90%;\r\n max-width: 600px;\r\n margin-left: auto;\r\n margin-right: auto;\r\n display: flex;\r\n}\r\n\r\n.search-container .search-area .options.trigger {\r\n margin-left: 5px;\r\n}\r\n\r\n.search-container .search-area .options.trigger .button {\r\n padding-left: 15px;\r\n padding-right: 5px;\r\n height: 100%;\r\n}\r\n\r\n.search-container .search-area .ui.input.action {\r\n flex: 1;\r\n}\r\n\r\n.search-area,\r\n.search-area .react-autosuggest__container,\r\n.search-container .search-area .ui.input.action {\r\n flex: 1;\r\n}\r\n\r\n.search-area,\r\n.search-area input {\r\n width: 100%;\r\n}\r\n\r\n.search-area button {\r\n display: inline-block !important;\r\n}\r\n\r\n.search-layout {\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n}\r\n\r\n.search-layout .virtual-table {\r\n height: calc(100% - 50px);\r\n}\r\n\r\n@media only screen and (min-width: 767px) {\r\n .result.modal td {\r\n max-width: 250px;\r\n }\r\n}\r\n\r\n.search-options {\r\n min-width: 300px;\r\n}\r\n\r\n.search-options .field-hub_urls {\r\n max-height: 180px;\r\n overflow-y: auto;\r\n}\r\n"],sourceRoot:""}]);const o=a},28252:(e,t,n)=>{n.d(t,{Y:()=>w});var s=n(85893),r=(n(67294),n(2445)),i=n(84613),a=n(76249),o=n(32347),l=n(91072),c=n(8717),u=n(93379),d=n.n(u),h=n(7795),p=n.n(h),m=n(90569),g=n.n(m),A=n(3565),x=n.n(A),j=n(19216),f=n.n(j),b=n(44589),y=n.n(b),E=n(48366),v={};v.styleTagTransform=y(),v.setAttributes=x(),v.insert=g().bind(null,"head"),v.domAPI=p(),v.insertStyleElement=f(),d()(E.Z,v),E.Z&&E.Z.locals&&E.Z.locals;var S=n(24101);const C={[a.V9.SHARE_PARTIAL]:"Share (partial)",[a.V9.SHARE_FULL]:"Share (full)",[a.V9.QUEUE_PARTIAL]:"Queue (partial)",[a.V9.QUEUE_FULL]:"Queue (full)",[a.V9.FINISHED_PARTIAL]:"Finished (partial)",[a.V9.FINISHED_FULL]:"Finished (full)",[a.V9.SHARE_QUEUE]:"Share and queue"},O=({paths:e})=>(0,s.jsx)("div",Object.assign({className:"dupe-paths"},{children:e.map((e=>(0,s.jsx)("div",Object.assign({className:"path"},{children:e}),e)))})),w=({session:e,fileItem:t,user:n,downloadHandler:a,showPath:u=!0})=>{const{t:d}=(0,l.$G)(),h=e=>(0,c.Iu)(e,d,o.jv.COMMON);return(0,s.jsxs)("div",Object.assign({className:"ui fileitem info segment"},{children:[(0,s.jsxs)(S.rj,Object.assign({columns:"two",stackable:!0},{children:[(0,s.jsx)(S.X2,{title:h("Name"),text:t.name}),(0,s.jsx)(S.X2,{title:h("Type/content"),text:t.type.str}),(0,s.jsx)(S.X2,{title:h("Size"),text:(0,r.BU)(t.size,d,!0)}),(0,s.jsx)(S.X2,{title:h("Last modified"),text:(0,r.SY)(t.time||0)}),"file"===t.type.id&&(0,s.jsx)(S.X2,{title:h("TTH"),text:t.tth}),!!t.dupe&&(0,s.jsx)(S.X2,{title:h("Dupe type"),text:h(C[t.dupe.id])}),!!t.dupe&&(0,s.jsx)(S.X2,{title:h("Dupe paths"),text:(0,s.jsx)(O,{paths:t.dupe.paths})}),u&&(0,s.jsx)(S.X2,{title:h("Path"),text:t.path})]})),(0,s.jsx)(i.Yk,{caption:h("Actions..."),button:!0,user:n,itemInfoGetter:()=>t,downloadHandler:a,contextElement:".ui.modal > .content",session:e})]}))}},48005:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(85893),r=(n(67294),n(35936)),i=n(55019);const a=e=>{var{hub:t}=e,n=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(e,["hub"]);return(0,s.jsx)(r.Z,Object.assign({},n,{icon:(0,i.iU)(t.connect_state.id)+" sitemap"}))}},14954:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Je});var s=n(85893),r=n(67294),i=n(38423),a=n(20097),o=n(69767),l=n(93379),c=n.n(l),u=n(7795),d=n.n(u),h=n(90569),p=n.n(h),m=n(3565),g=n.n(m),A=n(19216),x=n.n(A),j=n(44589),f=n.n(j),b=n(48931),y={};y.styleTagTransform=f(),y.setAttributes=g(),y.insert=p().bind(null,"head"),y.domAPI=d(),y.insertStyleElement=x(),c()(b.Z,y),b.Z&&b.Z.locals&&b.Z.locals;var E=n(48117),v=n(45241),S=n(77744),C=n(76249),O=n(32347);const w={result:{displayName:"Result details",icon:E.Z.DETAILS,handler:({data:e,location:t})=>{a.Z.push(`${t.pathname}/result/${e.id}`)}},browseContent:{displayName:"Browse content",access:C.PS.FILELISTS_EDIT,icon:E.Z.FILELIST,handler:({data:e,location:t})=>v.Z.createSession(t,e.users.user,S.Z,e.path)}},_={moduleId:O.jv.SEARCH,actions:w};var Z=n(28427),N=n(20368),I=n(62285),T=n(42090),R=n(91780),B=n(2445),U=n(84613),P=n(90195),k=n(91072),D=n(8717),L=n(4333);const H=({result:e,t})=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",Object.assign({className:"user dropdown"},{children:(0,s.jsx)(U.Ie,{userIcon:!0,user:e.user,directory:e.path,ids:P.D,contextElement:".ui.modal > .content",remoteMenuId:L.Z.HINTED_USER})})),(0,s.jsx)("td",Object.assign({className:"hubs"},{children:e.user.hub_names})),(0,s.jsx)("td",Object.assign({className:"connection"},{children:(0,B.Nh)(e.connection,t)})),(0,s.jsx)("td",Object.assign({className:"slots"},{children:e.slots.str})),(0,s.jsx)("td",Object.assign({className:"ip"},{children:(0,s.jsx)(R.Z,{item:e.ip})})),(0,s.jsx)("td",Object.assign({className:"path",title:e.path},{children:e.path}))]}),F=(e,t)=>e.user.nicks.localeCompare(t.user.nicks),G=(0,T.Z)((({results:e})=>{const{t}=(0,k.$G)();return(0,s.jsxs)("div",Object.assign({className:"users"},{children:[(0,s.jsx)("h2",{children:t((0,D.zS)("usersCount",O.jv.SEARCH),{defaultValue:"User ({{count}})",defaultValue_plural:"Users ({{count}})",count:e.length})}),(0,s.jsxs)("table",Object.assign({className:"ui striped table"},{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:(0,D.Iu)("User",t,O.jv.SEARCH)}),(0,s.jsx)("th",{children:(0,D.Iu)("Hubs",t,O.jv.SEARCH)}),(0,s.jsx)("th",Object.assign({style:{width:"70px"}},{children:(0,D.Iu)("Connection",t,O.jv.SEARCH)})),(0,s.jsx)("th",Object.assign({style:{width:"50px"}},{children:(0,D.Iu)("Slots",t,O.jv.SEARCH)})),(0,s.jsx)("th",{children:(0,D.Iu)("IP",t,O.jv.SEARCH)}),(0,s.jsx)("th",{children:(0,D.Iu)("Path",t,O.jv.SEARCH)})]})}),(0,s.jsx)("tbody",{children:e.sort(F).map((e=>(0,s.jsx)(H,{result:e,t},e.user.cid)))})]}))]}))}),{urls:{results:({parentResult:e,instanceId:t},n)=>n.get(`${i.Z.INSTANCES_URL}/${t}/results/${e.id}/children`)}});var $=n(92245),z=n(28252),Y=n(518);const V=(e,t,n,s)=>Y.Z.post(`${i.Z.MODULE_URL}/${s.id}/results/${e.id}/download`,n);class M extends r.Component{constructor(){super(...arguments),this.itemDataGetter=(e,t)=>{const{instance:n}=this.props;return t.get(`${i.Z.INSTANCES_URL}/${n.id}/results/${e}`)}}render(){const{parentResult:e,instance:t}=this.props;return(0,s.jsxs)(Z.Z,Object.assign({className:"result",title:e.name,closable:!0,icon:(0,s.jsx)(N.Z,{typeInfo:e.type}),fullHeight:!0},this.props,{children:[(0,s.jsx)(I.Z,{downloadHandler:V,itemDataGetter:this.itemDataGetter,session:t}),(0,s.jsx)(z.Y,{fileItem:e,downloadHandler:V,user:e.users.user,showPath:!1,session:t}),(0,s.jsx)(G,{parentResult:e,instanceId:t.id})]}))}}M.displayName="ResultDialog";const W=(0,$.ZP)((0,T.Z)(M,{urls:{parentResult:({match:e,instance:t},n)=>n.get(`${i.Z.INSTANCES_URL}/${t.id}/results/${e.params.resultId}`)}}),"result/:resultId");var K=n(10293),X=n.n(K),q=n(93836);const Q=X().createStore({_viewName:"search_view",_apiUrl:i.Z.INSTANCES_URL,mixins:[(0,q.Z)("relevance",!1)]});var J=n(35108),ee=n(78230),te=n(68126),ne=n(55019),se=n(27695);const re=({count:e,user:t},n)=>e>1?n((0,D.zS)("xUsersNicks",O.jv.SEARCH),{defaultValue:"{{count}} user ({{user.nicks}})",defaultValue_plural:"{{count}} users ({{user.nicks}})",count:e,replace:{count:e,user:t}}):t.nicks,ie=({cellData:e,rowDataGetter:t,t:n})=>(0,s.jsx)(U.cG,Object.assign({text:re(e,n),user:e.user,directory:t().path,userIcon:"simple",ids:P.D,remoteMenuId:L.Z.HINTED_USER},{children:(0,s.jsx)(U.B2,{actions:_,itemData:t,ids:["result"]})})),ae=e=>(e&&e.users,e.users.user),oe=e=>{var{rowDataGetter:t,instance:n}=e,r=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(e,["rowDataGetter","instance"]);return(0,s.jsx)(te.iK,Object.assign({userGetter:ae,rowDataGetter:t,downloadHandler:V,session:n},r,{children:(0,s.jsx)(U.B2,{actions:_,itemData:t,remoteMenuId:L.Z.GROUPED_SEARCH_RESULT,entityId:n.id})}))};class le extends r.Component{constructor(){super(...arguments),this.rowClassNameGetter=e=>(0,ne.r)(e.dupe),this.emptyRowsNodeGetter=()=>{const{running:e,searchString:t,searchT:n}=this.props;return e?null:!!t&&(0,s.jsx)(se.Z,{title:n.t("noResults",{defaultValue:'No results found for "{{searchString}}"',replace:{searchString:t}}),description:(0,s.jsx)(k.cC,Object.assign({i18nKey:n.toI18nKey("noResultsHint")},{children:(0,s.jsxs)("div",Object.assign({className:"ui bulleted list"},{children:[(0,s.jsx)("div",Object.assign({className:"item"},{children:"Ensure that you spelled the words correctly"})),(0,s.jsx)("div",Object.assign({className:"item"},{children:"Use different keywords"})),(0,s.jsx)("div",Object.assign({className:"item"},{children:"You are searching too frequently (hubs often have a minimum search interval)"})),(0,s.jsx)("div",Object.assign({className:"item"},{children:"If you never receive results for common search terms, make sure that your connectivity settings are configured properly"}))]}))}))})},this.itemDataGetter=(e,t)=>{const{instance:n}=this.props;return t.get(`${i.Z.INSTANCES_URL}/${n.id}/results/${e}`)}}render(){const{searchT:e,instance:t}=this.props;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(ee.Z,Object.assign({emptyRowsNodeGetter:this.emptyRowsNodeGetter,rowClassNameGetter:this.rowClassNameGetter,store:Q,textFilterProps:{autoFocus:!1},entityId:t.id,moduleId:_.moduleId},{children:[(0,s.jsx)(J.Column,{name:"Name",width:200,columnKey:"name",flexGrow:8,cell:(0,s.jsx)(oe,{instance:t})}),(0,s.jsx)(J.Column,{name:"Size",width:60,columnKey:"size",cell:(0,s.jsx)(te.Eh,{}),flexGrow:1}),(0,s.jsx)(J.Column,{name:"Type",width:80,columnKey:"type",flexGrow:1,hideWidth:600}),(0,s.jsx)(J.Column,{name:"Relevance",width:60,columnKey:"relevance",cell:(0,s.jsx)(te.uL,{}),flexGrow:1}),(0,s.jsx)(J.Column,{name:"Connection",width:60,columnKey:"connection",cell:(0,s.jsx)(te.$A,{}),flexGrow:2,hideWidth:600}),(0,s.jsx)(J.Column,{name:"Users",width:120,columnKey:"users",flexGrow:3,cell:(0,s.jsx)(ie,{}),hideWidth:600}),(0,s.jsx)(J.Column,{name:"Last modified",width:80,columnKey:"time",cell:(0,s.jsx)(te.Ks,{}),flexGrow:1,hideWidth:800}),(0,s.jsx)(J.Column,{name:"Slots",width:60,columnKey:"slots",flexGrow:1,hideWidth:800})]})),(0,s.jsx)(I.Z,{downloadHandler:V,itemDataGetter:this.itemDataGetter,session:t}),(0,s.jsx)(W,{searchT:e,instance:t})]})}}le.displayName="ResultTable";const ce=le;var ue=n(15479),de=n(26435),he=n(3629),pe=n(89519);const me=(0,T.Z)((e=>{var{submitHandler:t,historyId:n,history:r,refetchData:i}=e,a=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(e,["submitHandler","historyId","history","refetchData"]);const{t:o}=(0,k.$G)();return(0,s.jsx)(de.Z,Object.assign({},a,{data:r,submitHandler:e=>{return s=void 0,r=void 0,l=function*(){const s=e.trim();yield(0,pe.h9)((()=>(0,he.V)(n,s)),o),i(),t(s)},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(t){var s;t.done?e(t.value):(s=t.value,s instanceof a?s:new a((function(e){e(s)}))).then(n,i)}o((l=l.apply(s,r||[])).next())}));var s,r,a,l}}))}),{urls:{history:({historyId:e},t)=>t.get(ue.ZP.STRINGS_URL+"/"+e)},loaderText:null});var ge=n(84807),Ae=n(10606),xe=n(18758),je=n(70516),fe=n(18603),be=n(48005),ye=n(35451),Ee=n(35936);const ve=({locals:e,children:t})=>{const{label:n}=e,r=(0,fe.T7)(e.value);return(0,s.jsxs)(ye.ZP,Object.assign({className:"field",defaultActiveIndexes:r?[0]:void 0},{children:[(0,s.jsxs)(ye.il,{children:[(0,s.jsx)(Ee.Z,{icon:E.Z.DROPDOWN}),(0,s.jsx)("span",Object.assign({style:r?{fontWeight:"bold"}:void 0},{children:n}))]}),(0,s.jsx)(ye.vF,{children:t})]}))},Se=({hubs:e,value:t,onChange:n})=>{const r=e.filter((e=>e.connect_state.id===C.XF.CONNECTED)),i=t&&t.length?t:r.map((e=>e.hub_url)),a=()=>{if(1===i.length)return!1};return(0,s.jsx)(s.Fragment,{children:r.map((e=>(0,s.jsx)("div",Object.assign({className:"field"},{children:(0,s.jsx)(je.Z,{caption:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(be.Z,{hub:e}),e.identity.name]}),beforeUnchecked:a,checked:i.includes(e.hub_url),onChange:t=>{const s=(0,fe.Nl)(i,e.hub_url,t);n(s.length===r.length?null:s)},style:{maxWidth:"300px"}})}),e.id)))})},Ce={renderSelect:e=>(0,s.jsx)(ve,Object.assign({locals:e},{children:(0,s.jsx)(Se,{onChange:e.onChange,value:e.value,hubs:e.options})})),renderLabel:e=>null},Oe=xe.ZP.form.Form.templates.select.clone(Ce),we=e=>{const{value:t,unitIndex:n}=(0,B.n2)(e,B.U5,1024);return{value:t,unitIndex:e?n:2}},_e=({inputProps:e,moduleT:t,onChange:n,value:i})=>{const a=we(i),[o,l]=(0,r.useState)(a.value),[c,u]=(0,r.useState)(a.unitIndex),d=()=>{let e=o||0;if(c)for(let t=1;t<=c;t++)e*=1024;return e};return(0,r.useEffect)((()=>{const e=d();e!==i&&n(e)}),[c,o]),(0,r.useEffect)((()=>{const e=d();if(i!==e){const e=we(i);l(e.value),u(e.unitIndex)}}),[i]),(0,s.jsxs)("div",Object.assign({style:{display:"flex"}},{children:[(0,s.jsx)("input",Object.assign({className:"ui input",type:"number"},e,{min:0,value:o||"",onChange:e=>{const t=e.target.value?parseInt(e.target.value):null;l(t||void 0)}})),(0,s.jsx)("select",Object.assign({className:"ui select",style:{maxWidth:"100px"},value:B.U5[c],onChange:e=>{u(e.target.selectedIndex)}},{children:B.U5.map(((e,n)=>(0,s.jsx)("option",Object.assign({value:e},{children:(0,B.Ac)(e,t.plainT)}),e)))}))]}))},Ze={renderInput:e=>(0,s.jsx)(_e,{onChange:e.onChange,value:e.value?parseInt(e.value):0,moduleT:e.context.formT})},Ne=xe.ZP.form.Form.templates.textbox.clone(Ze);var Ie=n(68662),Te=n(98374);const Re=({type:e,size:t="large"})=>{return e.id?(0,s.jsx)(N.Z,{typeInfo:(n=e,"directory"===n.id?{id:"directory",str:"",files:0,directories:0}:{id:"file",str:"",content_type:n.id}),size:t}):(0,s.jsx)(Ee.Z,{icon:E.Z.ANY,size:t});var n},Be=(e,t,n)=>(0,s.jsx)(Te.Z,Object.assign({onClick:()=>t(e.id),icon:(0,s.jsx)(Re,{type:e}),active:n.id===e.id},{children:e.str}),e.id||i.Z.DEFAULT_SEARCH_TYPE),Ue=(0,T.Z)((({searchTypes:e,value:t,onChange:n,moduleT:r})=>{const i=(e=>[{id:null,str:e.translate("Any")},{id:"directory",str:e.translate("Directory")},{id:"file",str:e.translate("File")}])(r),a=e.find((e=>t===e.id))||i.find((e=>t===e.id))||i[0];return(0,s.jsxs)(Ie.Z,Object.assign({selection:!0,caption:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Re,{type:a,size:""}),a.str]})},{children:[i.map((e=>Be(e,n,a))),(0,s.jsx)("div",{className:"ui divider"},"divider"),e.map((e=>Be(e,n,a)))]}))}),{urls:{searchTypes:i.Z.SEARCH_TYPES_URL}}),Pe={renderSelect:e=>(0,s.jsx)(Ue,{onChange:e.onChange,value:e.value||null,moduleT:e.context.formT})},ke=xe.ZP.form.Form.templates.select.clone(Pe);var De=n(43496);const Le={renderFieldset(e,t){const{label:n}=t,r=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(t,["label"]);return(0,s.jsx)(ve,Object.assign({locals:t},{children:xe.ZP.form.Form.templates.struct.renderFieldset(e,r)}))},renderLabel:e=>null},He=xe.ZP.form.Form.templates.struct.clone(Le),Fe=[{key:"file_type",title:"File type",type:C.Y2.STRING,optional:!0},{key:"hub_urls",title:"Hubs",type:C.Y2.LIST,item_type:C.Y2.STRING},{key:"size_limits",title:"Size limits",type:C.Y2.STRUCT,optional:!0,definitions:[{key:"min_size",title:"Minimum size",type:C.Y2.NUMBER,optional:!0},{key:"max_size",title:"Maximum size",type:C.Y2.NUMBER,optional:!0}]}];class Ge extends r.PureComponent{constructor(e){super(e),this.onFieldChanged=(e,t,n)=>{const s=(r=t,Object.keys(r).reduce(((e,t)=>{const n=r[t];return(0,fe.T7)(n)&&(e[t]=n),e}),{}));var r;return this.props.onChange(Object.keys(s).length?s:null),null},this.save=()=>this.form.save(),this.onSave=e=>Promise.resolve(),this.onFieldSetting=(e,t,n)=>{"hub_urls"===e?Object.assign(t,{factory:xe.ZP.form.Select,template:Oe,options:this.props.hubs}):"min_size"===e||"max_size"===e?Object.assign(t,{template:Ne}):"excluded"===e?Object.assign(t,{disableOrder:!0}):"file_type"===e?Object.assign(t,{template:ke}):"size_limits"===e&&Object.assign(t,{template:He})},this.definitions=(0,fe.rv)(Fe,e.moduleT)}render(){const{value:e,onChange:t,location:n,moduleT:r}=this.props;return(0,s.jsxs)("div",{children:[(0,s.jsx)(De.Z,{ref:e=>this.form=e,onFieldChanged:this.onFieldChanged,onFieldSetting:this.onFieldSetting,onSave:this.onSave,fieldDefinitions:this.definitions,sourceValue:e,location:n,optionTitleFormatter:e=>e.title,className:"search-options"}),(0,s.jsx)(ge.Z,{caption:r.translate("Reset all"),onClick:()=>t(null),disabled:!e,style:{marginTop:"10px"}})]})}}Ge.displayName="SearchOptionForm";var $e=n(27835),ze=n(21222);const Ye=(0,T.Z)((({moduleT:e,location:t,onChange:n,value:i,hubs:a})=>{const o=e=>{if(e){const t=(e=>Object.keys(e).reduce(((t,n)=>((Array.isArray(e[n])?e[n].length:e[n])&&(t[n]=e[n]),t)),{}))(e);n(Object.keys(t).length?t:null)}else n(null)};(0,r.useEffect)((()=>{if(i&&i.hub_urls&&i.hub_urls.length){const e=i.hub_urls,t=e.filter((e=>a.find((t=>t.hub_url===e))));t.length!==e.length&&o(Object.assign(Object.assign({},i),{hub_urls:t.length?t:null}))}}),[a]);const l=i?Object.keys(i).filter((e=>{const t=i[e];return(0,fe.T7)(t)})).length:null;return(0,s.jsx)($e.Z,Object.assign({triggerClassName:"options",className:"options",trigger:(0,s.jsx)(ge.Z,{caption:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ee.Z,{icon:E.Z.OPTIONS}),!!l&&(0,s.jsx)("span",Object.assign({style:{fontWeight:"bold",marginRight:"3px",color:"black"}},{children:`(${l})`})),(0,s.jsx)(Ee.Z,{icon:E.Z.EXPAND})]})}),contentUpdateTrigger:i},{children:n=>(0,s.jsx)(Ge,{moduleT:e,location:t,onChange:o,value:i,hubs:a})}))}),{urls:{hubs:ze.Z.SESSIONS_URL},onSocketConnected:(e,{refetchData:t})=>{e(ze.Z.MODULE_URL,ze.Z.SESSION_CREATED,(()=>t())),e(ze.Z.MODULE_URL,ze.Z.SESSION_UPDATED,(e=>{e.connect_state&&t()})),e(ze.Z.MODULE_URL,ze.Z.SESSION_REMOVED,(()=>t()))},dataConverters:{hubs:e=>e.filter((e=>e.connect_state.id===C.XF.CONNECTED))}}),Ve=({moduleT:e,defaultValue:t,running:n,handleSubmit:i,location:a,defaultOptions:o})=>{const[l,c]=(0,r.useState)(o),u=(0,Ae.wd)();return(0,s.jsx)("div",Object.assign({className:"search-container"},{children:(0,s.jsxs)("div",Object.assign({className:"search-area"},{children:[(0,s.jsx)(me,{historyId:ue.n0.SEARCH,submitHandler:e=>i(e,l||void 0),disabled:n,defaultValue:t,placeholder:e.translate("Enter search string..."),button:(0,s.jsx)(ge.Z,{className:"blue",icon:E.Z.SEARCH,caption:u?void 0:e.translate("Search"),loading:n})}),(0,s.jsx)(Ye,{moduleT:e,location:a,onChange:c,value:l})]}))}))};var Me=n(57136),We=n(66883),Ke=function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((s=s.apply(e,t||[])).next())}))};const Xe="search_hubs";class qe extends r.Component{constructor(){super(...arguments),this.state={searchString:"",running:!1},this.checkLocationState=e=>{const{state:t}=e.location;t&&t.searchString&&t.searchString!==this.state.searchString&&(this.search(t.searchString),a.Z.replace({pathname:e.location.pathname}))},this.search=(e,t)=>Ke(this,void 0,void 0,(function*(){var n;console.log("Searching"),clearTimeout(this.searchTimeout),(n=(null==t?void 0:t.hub_urls)||null)&&n.length?(0,Ae.nG)(Xe,n):(0,Ae.BS)(Xe);const s=t||{},{hub_urls:r,size_limits:a}=s,o=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(s,["hub_urls","size_limits"]);try{const t=yield(l=this.props.instance,c={query:Object.assign(Object.assign({pattern:e},a),o),priority:C.Gu.HIGH,hub_urls:r},Y.Z.post(`${i.Z.INSTANCES_URL}/${l.id}/hub_search`,c));this.onSearchPosted(t),this.setState({searchString:e,running:!0})}catch(e){Me.Z.apiError("Search failed",e)}var l,c})),this.onSearchPosted=e=>{this.searchTimeout=window.setTimeout((()=>{this.setState({running:!1})}),e.queue_time+4e3)},this.parseOptions=()=>{const{query:e}=this.props.instance;return e?{excluded:e.excluded,size_limits:{min_size:e.min_size,max_size:e.max_size},file_type:e.file_type===i.Z.DEFAULT_SEARCH_TYPE||"tth"===e.file_type?null:e.file_type,hub_urls:(0,Ae.TG)(Xe,null)}:null},this.searchT=(0,D.HY)(this.props.t,O.jv.SEARCH)}componentDidMount(){this.checkLocationState(this.props);const{query:e}=this.props.instance;e&&this.setState({searchString:e.pattern})}componentDidUpdate(e){this.checkLocationState(this.props)}render(){const{instance:e,location:t}=this.props,{searchString:n,running:r}=this.state,{t:i}=this.searchT;return(0,s.jsx)(o.Z,Object.assign({offlineMessage:i("searchOffline","You must to be connected to at least one hub in order to perform searches")},{children:(0,s.jsxs)("div",Object.assign({className:"search-layout"},{children:[(0,s.jsx)(Ve,{moduleT:this.searchT,running:r,defaultValue:n,handleSubmit:this.search,location:t,defaultOptions:this.parseOptions()}),(0,s.jsx)(ce,{searchString:n,running:r,searchT:this.searchT,instance:e})]}))}))}}const Qe="webui",Je=(0,T.Z)(qe,{urls:{instance:(e,t)=>Ke(void 0,void 0,void 0,(function*(){const e=(yield t.get(`${i.Z.INSTANCES_URL}`)).find((e=>e.owner===`session:${We.Z.sessionId}:${Qe}`));if(e)return e;const n=(yield t.post(i.Z.INSTANCES_URL,{owner_suffix:Qe,expiration:0})).id;return t.get(`${i.Z.INSTANCES_URL}/${n}`)}))}})}}]);
|
|
2
|
+
//# sourceMappingURL=search.6a9813389fd4fec46997.chunk.js.map
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js/search.6a9813389fd4fec46997.chunk.js","mappings":"kKAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,2WAA4W,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,uDAAuD,MAAQ,GAAG,SAAW,2HAA2H,eAAiB,CAAC,4WAA4W,WAAa,MAEngC,S,sECJIH,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,wxCAAyxC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,2CAA2C,MAAQ,GAAG,SAAW,kcAAkc,eAAiB,CAAC,yxCAAyxC,WAAa,MAExpG,S,8PCIIC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,YAAiB,W,eCXlD,MAAMM,EAAc,CAElB,CAAC,oBAA6B,kBAC9B,CAAC,iBAA0B,eAC3B,CAAC,oBAA6B,kBAC9B,CAAC,iBAA0B,eAC3B,CAAC,uBAAgC,qBACjC,CAAC,oBAA6B,kBAC9B,CAAC,kBAA2B,mBAGxBC,EAA2C,EAAGC,YAClD,8BAAKC,UAAU,cAAY,UACxBD,EAAME,KAAKC,IACV,8BAAgBF,UAAU,QAAM,UAC7BE,IADOA,QAeVC,EAAoD,EACxDC,UACAC,WACAC,OACAC,kBACAC,YAAW,MAEX,MAAM,EAAEC,IAAM,UACRC,EAASC,IACN,QAAUA,EAAMF,EAAG,aAG5B,OACE,+BAAKT,UAAU,4B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E,SAACsM,EAAA,EAA0B,eACzBC,eAAgBzT,EACd,gBACA,8EACD,WAED,+BAAKT,UAAU,iBAAe,YAC5B,SAAC4R,GAAW,CACVxG,QAAS3F,KAAKkC,QACdF,QAASA,EACTvD,aAAcwD,EACdmK,aAAcpM,KAAK8M,OACnBlQ,SAAUA,EACVyP,eAAgBrM,KAAKgO,kBAEvB,SAAC,GAAW,CACV/L,aAAcA,EACdD,QAASA,EACTE,QAASlC,KAAKkC,QACdxC,SAAUA,UAKpB,EAGF,MAAMgP,GAAkB,QAExB,IAAe,EAAAnQ,EAAA,GAAoDoO,GAAQ,CACzE1N,KAAM,CACJS,SAAU,CAAOO,EAAOb,IAAW,qCAEjC,MAIMM,SAJkBN,EAAOC,IAC7B,GAAGC,EAAA,oBAGsB4I,MACxB/B,GAAMA,EAAEwI,QAAU,WAAWC,GAAA,eAAwBF,OAExD,GAAMhP,EACJ,OAAOA,EAIT,MAAMP,SACEC,EAAOyP,KAAqBvP,EAAA,gBAA+B,CAC/DwP,aAAcJ,GACdK,WAAY,KAEdlV,GAEF,OAAOuF,EAAOC,IAAI,GAAGC,EAAA,mBAAiCH,IACxD,M","sources":["webpack://airdcpp-webui/./src/components/file-item-info/style.css","webpack://airdcpp-webui/./src/routes/Search/style.css","webpack://airdcpp-webui/./src/components/file-item-info/style.css?a322","webpack://airdcpp-webui/./src/components/file-item-info/FileItemInfoGrid.tsx","webpack://airdcpp-webui/./src/components/icon/HubIcon.tsx","webpack://airdcpp-webui/./src/routes/Search/style.css?d43b","webpack://airdcpp-webui/./src/actions/ui/SearchActions.ts","webpack://airdcpp-webui/./src/routes/Search/components/result-dialog/UserResultTable.tsx","webpack://airdcpp-webui/./src/services/api/SearchApi.ts","webpack://airdcpp-webui/./src/routes/Search/components/result-dialog/ResultDialog.tsx","webpack://airdcpp-webui/./src/stores/SearchViewStore.js","webpack://airdcpp-webui/./src/routes/Search/components/ResultTable.tsx","webpack://airdcpp-webui/./src/components/autosuggest/HistoryInput.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/AccordionField.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/HubSelectField.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/SizeField.tsx","webpack://airdcpp-webui/./src/components/icon/SearchTypeIcon.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/FileTypeField.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/AccordionStructField.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/SearchOptionsForm.tsx","webpack://airdcpp-webui/./src/routes/Search/components/options-panel/SearchOptionsButton.tsx","webpack://airdcpp-webui/./src/routes/Search/components/SearchInput.tsx","webpack://airdcpp-webui/./src/routes/Search/components/Search.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, \".fileitem.info.segment .dupe-paths .path {\\r\\n overflow-x: hidden;\\r\\n}\\r\\n\\r\\n.fileitem.info.segment .download.ui.dropdown {\\r\\n max-width: 150px;\\r\\n margin-top: 10px;\\r\\n}\\r\\n\\r\\n.fileitem.info.segment .title.column {\\r\\n margin-top: auto;\\r\\n margin-bottom: auto;\\r\\n}\\r\\n\\r\\n.fileitem.info.segment .value.column {\\r\\n word-break: break-all;\\r\\n}\\r\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/file-item-info/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB\",\"sourcesContent\":[\".fileitem.info.segment .dupe-paths .path {\\r\\n overflow-x: hidden;\\r\\n}\\r\\n\\r\\n.fileitem.info.segment .download.ui.dropdown {\\r\\n max-width: 150px;\\r\\n margin-top: 10px;\\r\\n}\\r\\n\\r\\n.fileitem.info.segment .title.column {\\r\\n margin-top: auto;\\r\\n margin-bottom: auto;\\r\\n}\\r\\n\\r\\n.fileitem.info.segment .value.column {\\r\\n word-break: break-all;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".search-container {\\r\\n width: 100%;\\r\\n height: 50px;\\r\\n}\\r\\n\\r\\n#mobile-layout .search-container {\\r\\n margin-top: 10px;\\r\\n}\\r\\n\\r\\n.search-container .search-area {\\r\\n width: 90%;\\r\\n max-width: 600px;\\r\\n margin-left: auto;\\r\\n margin-right: auto;\\r\\n display: flex;\\r\\n}\\r\\n\\r\\n.search-container .search-area .options.trigger {\\r\\n margin-left: 5px;\\r\\n}\\r\\n\\r\\n.search-container .search-area .options.trigger .button {\\r\\n padding-left: 15px;\\r\\n padding-right: 5px;\\r\\n height: 100%;\\r\\n}\\r\\n\\r\\n.search-container .search-area .ui.input.action {\\r\\n flex: 1;\\r\\n}\\r\\n\\r\\n.search-area,\\r\\n.search-area .react-autosuggest__container,\\r\\n.search-container .search-area .ui.input.action {\\r\\n flex: 1;\\r\\n}\\r\\n\\r\\n.search-area,\\r\\n.search-area input {\\r\\n width: 100%;\\r\\n}\\r\\n\\r\\n.search-area button {\\r\\n display: inline-block !important;\\r\\n}\\r\\n\\r\\n.search-layout {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n height: 100%;\\r\\n}\\r\\n\\r\\n.search-layout .virtual-table {\\r\\n height: calc(100% - 50px);\\r\\n}\\r\\n\\r\\n@media only screen and (min-width: 767px) {\\r\\n .result.modal td {\\r\\n max-width: 250px;\\r\\n }\\r\\n}\\r\\n\\r\\n.search-options {\\r\\n min-width: 300px;\\r\\n}\\r\\n\\r\\n.search-options .field-hub_urls {\\r\\n max-height: 180px;\\r\\n overflow-y: auto;\\r\\n}\\r\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/routes/Search/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,UAAU;EACV,gBAAgB;EAChB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;AACf;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,OAAO;AACT;;AAEA;;;EAGE,OAAO;AACT;;AAEA;;EAEE,WAAW;AACb;;AAEA;EACE,gCAAgC;AAClC;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;AACd;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE;IACE,gBAAgB;EAClB;AACF;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;AAClB\",\"sourcesContent\":[\".search-container {\\r\\n width: 100%;\\r\\n height: 50px;\\r\\n}\\r\\n\\r\\n#mobile-layout .search-container {\\r\\n margin-top: 10px;\\r\\n}\\r\\n\\r\\n.search-container .search-area {\\r\\n width: 90%;\\r\\n max-width: 600px;\\r\\n margin-left: auto;\\r\\n margin-right: auto;\\r\\n display: flex;\\r\\n}\\r\\n\\r\\n.search-container .search-area .options.trigger {\\r\\n margin-left: 5px;\\r\\n}\\r\\n\\r\\n.search-container .search-area .options.trigger .button {\\r\\n padding-left: 15px;\\r\\n padding-right: 5px;\\r\\n height: 100%;\\r\\n}\\r\\n\\r\\n.search-container .search-area .ui.input.action {\\r\\n flex: 1;\\r\\n}\\r\\n\\r\\n.search-area,\\r\\n.search-area .react-autosuggest__container,\\r\\n.search-container .search-area .ui.input.action {\\r\\n flex: 1;\\r\\n}\\r\\n\\r\\n.search-area,\\r\\n.search-area input {\\r\\n width: 100%;\\r\\n}\\r\\n\\r\\n.search-area button {\\r\\n display: inline-block !important;\\r\\n}\\r\\n\\r\\n.search-layout {\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n height: 100%;\\r\\n}\\r\\n\\r\\n.search-layout .virtual-table {\\r\\n height: calc(100% - 50px);\\r\\n}\\r\\n\\r\\n@media only screen and (min-width: 767px) {\\r\\n .result.modal td {\\r\\n max-width: 250px;\\r\\n }\\r\\n}\\r\\n\\r\\n.search-options {\\r\\n min-width: 300px;\\r\\n}\\r\\n\\r\\n.search-options .field-hub_urls {\\r\\n max-height: 180px;\\r\\n overflow-y: auto;\\r\\n}\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\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;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import * as React from 'react';\r\n\r\nimport { formatRelativeTime, formatSize } from 'utils/ValueFormat';\r\n\r\nimport { DownloadMenu } from 'components/action-menu';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translate } from 'utils/TranslationUtils';\r\n\r\nimport './style.css';\r\nimport { Row, Grid } from 'components/semantic/Grid';\r\n\r\nconst DupeStrings = {\r\n //[API.DupeEnum.NONE]: 'None',\r\n [API.DupeEnum.SHARE_PARTIAL]: 'Share (partial)',\r\n [API.DupeEnum.SHARE_FULL]: 'Share (full)',\r\n [API.DupeEnum.QUEUE_PARTIAL]: 'Queue (partial)',\r\n [API.DupeEnum.QUEUE_FULL]: 'Queue (full)',\r\n [API.DupeEnum.FINISHED_PARTIAL]: 'Finished (partial)',\r\n [API.DupeEnum.FINISHED_FULL]: 'Finished (full)',\r\n [API.DupeEnum.SHARE_QUEUE]: 'Share and queue',\r\n};\r\n\r\nconst DupePaths: React.FC<{ paths: string[] }> = ({ paths }) => (\r\n <div className=\"dupe-paths\">\r\n {paths.map((path) => (\r\n <div key={path} className=\"path\">\r\n {path}\r\n </div>\r\n ))}\r\n </div>\r\n);\r\n\r\ninterface FileItemInfoGridProps {\r\n fileItem: UI.DownloadableItemInfo;\r\n user: API.HintedUser;\r\n downloadHandler: UI.DownloadHandler<UI.DownloadableItemInfo>;\r\n showPath?: boolean;\r\n session: UI.SessionItemBase;\r\n}\r\n\r\nconst FileItemInfoGrid: React.FC<FileItemInfoGridProps> = ({\r\n session,\r\n fileItem,\r\n user,\r\n downloadHandler,\r\n showPath = true,\r\n}) => {\r\n const { t } = useTranslation();\r\n const gridT = (text: string) => {\r\n return translate(text, t, UI.Modules.COMMON);\r\n };\r\n\r\n return (\r\n <div className=\"ui fileitem info segment\">\r\n <Grid columns=\"two\" stackable={true}>\r\n <Row title={gridT('Name')} text={fileItem.name} />\r\n <Row title={gridT('Type/content')} text={fileItem.type.str} />\r\n <Row title={gridT('Size')} text={formatSize(fileItem.size, t, true)} />\r\n <Row\r\n title={gridT('Last modified')}\r\n text={formatRelativeTime(fileItem.time || 0)}\r\n />\r\n {fileItem.type.id === 'file' && <Row title={gridT('TTH')} text={fileItem.tth} />}\r\n {!!fileItem.dupe && (\r\n <Row title={gridT('Dupe type')} text={gridT(DupeStrings[fileItem.dupe.id])} />\r\n )}\r\n {!!fileItem.dupe && (\r\n <Row\r\n title={gridT('Dupe paths')}\r\n text={<DupePaths paths={fileItem.dupe.paths} />}\r\n />\r\n )}\r\n {showPath && <Row title={gridT('Path')} text={fileItem.path} />}\r\n </Grid>\r\n\r\n <DownloadMenu\r\n caption={gridT('Actions...')}\r\n button={true}\r\n user={user}\r\n itemInfoGetter={() => fileItem}\r\n downloadHandler={downloadHandler}\r\n contextElement=\".ui.modal > .content\"\r\n session={session}\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nexport { FileItemInfoGrid };\r\n","//import PropTypes from 'prop-types';\r\nimport * as React from 'react';\r\n\r\nimport Icon, { IconProps } from 'components/semantic/Icon';\r\nimport { hubOnlineStatusToColor } from 'utils/TypeConvert';\r\n\r\nimport * as API from 'types/api';\r\n\r\ninterface HubIconProps extends IconProps {\r\n hub: API.Hub;\r\n}\r\n\r\nconst HubIcon: React.FC<HubIconProps> = ({ hub, ...other }) => (\r\n <Icon {...other} icon={hubOnlineStatusToColor(hub.connect_state.id) + ' sitemap'} />\r\n);\r\n\r\n/*HubIcon.propTypes = {\r\n // Hub object\r\n hub: PropTypes.object.isRequired,\r\n};*/\r\n\r\nexport default HubIcon;\r\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \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 History from 'utils/History';\r\n\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nimport FilelistSessionActions from 'actions/reflux/FilelistSessionActions';\r\nimport FilelistSessionStore from 'stores/FilelistSessionStore';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nconst handleBrowseContent: UI.ActionHandler<API.GroupedSearchResult> = ({\r\n data,\r\n location,\r\n}) => {\r\n return FilelistSessionActions.createSession(\r\n location,\r\n data.users.user,\r\n FilelistSessionStore,\r\n data.path\r\n );\r\n};\r\n\r\nconst handleResult: UI.ActionHandler<API.GroupedSearchResult> = ({ data, location }) => {\r\n History.push(`${location.pathname}/result/${data.id}`);\r\n};\r\n\r\nconst SearchActions: UI.ActionListType<API.GroupedSearchResult> = {\r\n result: {\r\n displayName: 'Result details',\r\n icon: IconConstants.DETAILS,\r\n handler: handleResult,\r\n },\r\n browseContent: {\r\n displayName: 'Browse content',\r\n access: API.AccessEnum.FILELISTS_EDIT,\r\n icon: IconConstants.FILELIST,\r\n handler: handleBrowseContent,\r\n },\r\n};\r\n\r\nexport default {\r\n moduleId: UI.Modules.SEARCH,\r\n actions: SearchActions,\r\n};\r\n","import * as React from 'react';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport FormattedIp from 'components/format/FormattedIp';\r\nimport { formatConnection } from 'utils/ValueFormat';\r\n\r\nimport SearchConstants from 'constants/SearchConstants';\r\n\r\nimport { UserMenu } from 'components/action-menu';\r\nimport { UserFileActions } from 'actions/ui/UserActions';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translate, toI18nKey } from 'utils/TranslationUtils';\r\nimport MenuConstants from 'constants/MenuConstants';\r\n\r\ninterface UserResultProps {\r\n result: API.ChildSearchResult;\r\n t: UI.TranslateF;\r\n}\r\n\r\nconst UserResult: React.FC<UserResultProps> = ({ result, t }) => (\r\n <tr>\r\n <td className=\"user dropdown\">\r\n <UserMenu\r\n userIcon={true}\r\n user={result.user}\r\n directory={result.path}\r\n ids={UserFileActions}\r\n contextElement=\".ui.modal > .content\"\r\n remoteMenuId={MenuConstants.HINTED_USER}\r\n />\r\n </td>\r\n <td className=\"hubs\">{result.user.hub_names}</td>\r\n <td className=\"connection\">{formatConnection(result.connection, t)}</td>\r\n <td className=\"slots\">{result.slots.str}</td>\r\n <td className=\"ip\">\r\n <FormattedIp item={result.ip} />\r\n </td>\r\n <td className=\"path\" title={result.path}>\r\n {result.path}\r\n </td>\r\n </tr>\r\n);\r\n\r\nconst resultSort = (a: API.ChildSearchResult, b: API.ChildSearchResult) =>\r\n a.user.nicks.localeCompare(b.user.nicks);\r\n\r\ninterface UserResultTableProps {\r\n parentResult: API.GroupedSearchResult;\r\n instanceId: number;\r\n}\r\n\r\ninterface UserResultTableDataProps extends DataProviderDecoratorChildProps {\r\n results: API.ChildSearchResult[];\r\n}\r\n\r\nconst UserResultTable: React.FC<UserResultTableProps & UserResultTableDataProps> = ({\r\n results,\r\n}) => {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"users\">\r\n <h2>\r\n {t(toI18nKey('usersCount', UI.Modules.SEARCH), {\r\n defaultValue: 'User ({{count}})',\r\n defaultValue_plural: 'Users ({{count}})',\r\n count: results.length,\r\n })}\r\n </h2>\r\n <table className=\"ui striped table\">\r\n <thead>\r\n <tr>\r\n <th>{translate('User', t, UI.Modules.SEARCH)}</th>\r\n <th>{translate('Hubs', t, UI.Modules.SEARCH)}</th>\r\n <th style={{ width: '70px' }}>\r\n {translate('Connection', t, UI.Modules.SEARCH)}\r\n </th>\r\n <th style={{ width: '50px' }}>{translate('Slots', t, UI.Modules.SEARCH)}</th>\r\n <th>{translate('IP', t, UI.Modules.SEARCH)}</th>\r\n <th>{translate('Path', t, UI.Modules.SEARCH)}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {results.sort(resultSort).map((result) => (\r\n <UserResult key={result.user.cid} result={result} t={t} />\r\n ))}\r\n </tbody>\r\n </table>\r\n </div>\r\n );\r\n};\r\n\r\nexport default DataProviderDecorator<UserResultTableProps, UserResultTableDataProps>(\r\n UserResultTable,\r\n {\r\n urls: {\r\n results: ({ parentResult, instanceId }, socket) =>\r\n socket.get(\r\n `${SearchConstants.INSTANCES_URL}/${instanceId}/results/${parentResult.id}/children`\r\n ),\r\n },\r\n }\r\n);\r\n","import SearchConstants from 'constants/SearchConstants';\r\nimport SocketService from 'services/SocketService';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nexport const searchDownloadHandler: UI.DownloadHandler<API.GroupedSearchResult> = (\r\n itemInfo,\r\n user,\r\n downloadData,\r\n instance\r\n) => {\r\n return SocketService.post(\r\n `${SearchConstants.MODULE_URL}/${instance!.id}/results/${itemInfo.id}/download`,\r\n downloadData\r\n );\r\n};\r\n\r\ninterface SearchData {\r\n query: Pick<API.SearchQuery, 'pattern'> & Partial<Omit<API.SearchQuery, 'pattern'>>;\r\n hub_urls: string[] | undefined | null;\r\n priority: API.PriorityEnum;\r\n}\r\n\r\nexport const search = (instance: API.SearchInstance, data: SearchData) => {\r\n return SocketService.post<API.SearchResponse>(\r\n `${SearchConstants.INSTANCES_URL}/${instance.id}/hub_search`,\r\n data\r\n );\r\n};\r\n","import { Component } from 'react';\r\nimport Modal from 'components/semantic/Modal';\r\n\r\nimport FileIcon from 'components/icon/FileIcon';\r\n\r\nimport DownloadDialog from 'components/download/DownloadDialog';\r\n\r\nimport UserResultTable from './UserResultTable';\r\n\r\nimport ModalRouteDecorator, {\r\n ModalRouteDecoratorChildProps,\r\n} from 'decorators/ModalRouteDecorator';\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport SearchConstants from 'constants/SearchConstants';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\nimport { FileItemInfoGrid } from 'components/file-item-info';\r\nimport { searchDownloadHandler } from 'services/api/SearchApi';\r\n\r\ninterface ResultDialogProps {\r\n searchT: UI.ModuleTranslator;\r\n instance: API.SearchInstance;\r\n}\r\n\r\ninterface DataProps extends DataProviderDecoratorChildProps {\r\n parentResult: API.GroupedSearchResult;\r\n}\r\n\r\ninterface RouteProps {\r\n resultId: string;\r\n}\r\n\r\ntype Props = ResultDialogProps & ModalRouteDecoratorChildProps<RouteProps>;\r\n\r\nclass ResultDialog extends Component<Props & DataProps> {\r\n static displayName = 'ResultDialog';\r\n\r\n itemDataGetter: UI.DownloadItemDataGetter<API.GroupedSearchResult> = (\r\n itemId,\r\n socket\r\n ) => {\r\n const { instance } = this.props;\r\n return socket.get(\r\n `${SearchConstants.INSTANCES_URL}/${instance.id}/results/${itemId}`\r\n );\r\n };\r\n\r\n render() {\r\n const { parentResult, instance } = this.props;\r\n return (\r\n <Modal\r\n className=\"result\"\r\n title={parentResult.name}\r\n closable={true}\r\n icon={<FileIcon typeInfo={parentResult.type} />}\r\n fullHeight={true}\r\n {...this.props}\r\n >\r\n <DownloadDialog\r\n downloadHandler={searchDownloadHandler}\r\n itemDataGetter={this.itemDataGetter}\r\n session={instance}\r\n />\r\n <FileItemInfoGrid\r\n fileItem={parentResult}\r\n downloadHandler={searchDownloadHandler}\r\n user={parentResult.users.user}\r\n showPath={false}\r\n session={instance}\r\n />\r\n <UserResultTable parentResult={parentResult} instanceId={instance.id} />\r\n </Modal>\r\n );\r\n }\r\n}\r\n\r\nconst Decorated = ModalRouteDecorator<ResultDialogProps, RouteProps>(\r\n DataProviderDecorator<Props, DataProps>(ResultDialog, {\r\n urls: {\r\n parentResult: ({ match, instance }, socket) =>\r\n socket.get(\r\n `${SearchConstants.INSTANCES_URL}/${instance.id}/results/${match.params.resultId}`\r\n ),\r\n },\r\n }),\r\n 'result/:resultId'\r\n);\r\n\r\nexport { Decorated as ResultDialog };\r\n","import Reflux from 'reflux';\r\n\r\nimport SearchConstants from 'constants/SearchConstants';\r\nimport ViewStoreMixin from 'mixins/ViewStoreMixin';\r\n\r\nexport default Reflux.createStore({\r\n _viewName: 'search_view',\r\n _apiUrl: SearchConstants.INSTANCES_URL,\r\n mixins: [ViewStoreMixin('relevance', false)],\r\n});\r\n","import * as React from 'react';\r\n\r\nimport SearchActions from 'actions/ui/SearchActions';\r\n\r\nimport { ResultDialog } from './result-dialog';\r\n\r\nimport SearchViewStore from 'stores/SearchViewStore';\r\n\r\nimport { Column } from 'fixed-data-table-2';\r\nimport VirtualTable from 'components/table/VirtualTable';\r\nimport {\r\n SizeCell,\r\n DurationCell,\r\n ConnectionCell,\r\n FileDownloadCell,\r\n DecimalCell,\r\n} from 'components/table/Cell';\r\nimport { TableActionMenu, TableUserMenu } from 'components/action-menu';\r\n\r\nimport { dupeToStringType } from 'utils/TypeConvert';\r\nimport { UserFileActions } from 'actions/ui/UserActions';\r\nimport Message from 'components/semantic/Message';\r\n\r\nimport DownloadDialog from 'components/download/DownloadDialog';\r\nimport { RowWrapperCellChildProps } from 'components/table/RowWrapperCell';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { Trans } from 'react-i18next';\r\nimport { toI18nKey } from 'utils/TranslationUtils';\r\nimport { searchDownloadHandler } from 'services/api/SearchApi';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport MenuConstants from 'constants/MenuConstants';\r\nimport SearchConstants from 'constants/SearchConstants';\r\n\r\nconst getUserCaption = ({ count, user }: API.SearchResultUserInfo, t: UI.TranslateF) => {\r\n if (count > 1) {\r\n return t(toI18nKey('xUsersNicks', UI.Modules.SEARCH), {\r\n defaultValue: `{{count}} user ({{user.nicks}})`,\r\n defaultValue_plural: `{{count}} users ({{user.nicks}})`,\r\n count,\r\n replace: {\r\n count,\r\n user,\r\n },\r\n });\r\n }\r\n\r\n return user.nicks;\r\n};\r\n\r\nconst UserCell: React.FC<\r\n RowWrapperCellChildProps<API.SearchResultUserInfo, API.GroupedSearchResult>\r\n> = ({ cellData, rowDataGetter, t }) => (\r\n <TableUserMenu\r\n text={getUserCaption(cellData!, t!)}\r\n user={cellData!.user}\r\n directory={rowDataGetter!().path}\r\n userIcon=\"simple\"\r\n ids={UserFileActions}\r\n remoteMenuId={MenuConstants.HINTED_USER}\r\n >\r\n <TableActionMenu actions={SearchActions} itemData={rowDataGetter} ids={['result']} />\r\n </TableUserMenu>\r\n);\r\n\r\nconst resultUserGetter = (rowData: API.GroupedSearchResult) => {\r\n if (!rowData || !rowData.users) {\r\n return rowData.users.user;\r\n }\r\n\r\n return rowData.users.user;\r\n};\r\n\r\ninterface NameCellProps\r\n extends RowWrapperCellChildProps<string, API.GroupedSearchResult> {\r\n instance: API.SearchInstance;\r\n}\r\n\r\nconst NameCell: React.FC<NameCellProps> = ({ rowDataGetter, instance, ...props }) => (\r\n <FileDownloadCell\r\n userGetter={resultUserGetter}\r\n rowDataGetter={rowDataGetter}\r\n downloadHandler={searchDownloadHandler}\r\n session={instance}\r\n {...props}\r\n >\r\n <TableActionMenu\r\n actions={SearchActions}\r\n itemData={rowDataGetter}\r\n remoteMenuId={MenuConstants.GROUPED_SEARCH_RESULT}\r\n entityId={instance.id}\r\n />\r\n </FileDownloadCell>\r\n);\r\n\r\nexport interface ResultTableProps {\r\n running: boolean;\r\n searchString: string;\r\n searchT: UI.ModuleTranslator;\r\n instance: API.SearchInstance;\r\n}\r\n\r\nclass ResultTable extends React.Component<ResultTableProps> {\r\n static displayName = 'ResultTable';\r\n\r\n rowClassNameGetter = (rowData: API.GroupedSearchResult) => {\r\n return dupeToStringType(rowData.dupe);\r\n };\r\n\r\n emptyRowsNodeGetter = () => {\r\n const { running, searchString, searchT } = this.props;\r\n if (running) {\r\n return null;\r\n }\r\n\r\n if (!searchString) {\r\n return (\r\n process.env.DEMO_MODE === '1' && (\r\n <Message\r\n title=\"Demo content available\"\r\n icon={IconConstants.TIP}\r\n description={\r\n 'Use the search string \"demo\" to receive results from the demo share'\r\n }\r\n />\r\n )\r\n );\r\n }\r\n\r\n return (\r\n <Message\r\n title={searchT.t('noResults', {\r\n defaultValue: `No results found for \"{{searchString}}\"`,\r\n replace: {\r\n searchString,\r\n },\r\n })}\r\n description={\r\n <Trans i18nKey={searchT.toI18nKey('noResultsHint')}>\r\n <div className=\"ui bulleted list\">\r\n <div className=\"item\">Ensure that you spelled the words correctly</div>\r\n <div className=\"item\">Use different keywords</div>\r\n <div className=\"item\">\r\n You are searching too frequently (hubs often have a minimum search\r\n interval)\r\n </div>\r\n <div className=\"item\">\r\n If you never receive results for common search terms, make sure that your\r\n connectivity settings are configured properly\r\n </div>\r\n </div>\r\n </Trans>\r\n }\r\n />\r\n );\r\n };\r\n\r\n itemDataGetter: UI.DownloadItemDataGetter<API.GroupedSearchResult> = (\r\n itemId,\r\n socket\r\n ) => {\r\n const { instance } = this.props;\r\n return socket.get(\r\n `${SearchConstants.INSTANCES_URL}/${instance.id}/results/${itemId}`\r\n );\r\n };\r\n\r\n render() {\r\n const { searchT, instance } = this.props;\r\n return (\r\n <>\r\n <VirtualTable\r\n emptyRowsNodeGetter={this.emptyRowsNodeGetter}\r\n rowClassNameGetter={this.rowClassNameGetter}\r\n store={SearchViewStore}\r\n textFilterProps={{\r\n autoFocus: false,\r\n }}\r\n entityId={instance.id}\r\n moduleId={SearchActions.moduleId}\r\n >\r\n <Column\r\n name=\"Name\"\r\n width={200}\r\n columnKey=\"name\"\r\n flexGrow={8}\r\n cell={<NameCell instance={instance} />}\r\n />\r\n <Column\r\n name=\"Size\"\r\n width={60}\r\n columnKey=\"size\"\r\n cell={<SizeCell />}\r\n flexGrow={1}\r\n />\r\n <Column name=\"Type\" width={80} columnKey=\"type\" flexGrow={1} hideWidth={600} />\r\n <Column\r\n name=\"Relevance\"\r\n width={60}\r\n columnKey=\"relevance\"\r\n cell={<DecimalCell />}\r\n flexGrow={1}\r\n />\r\n <Column\r\n name=\"Connection\"\r\n width={60}\r\n columnKey=\"connection\"\r\n cell={<ConnectionCell />}\r\n flexGrow={2}\r\n hideWidth={600}\r\n />\r\n <Column\r\n name=\"Users\"\r\n width={120}\r\n columnKey=\"users\"\r\n flexGrow={3}\r\n cell={<UserCell />}\r\n hideWidth={600}\r\n />\r\n <Column\r\n name=\"Last modified\"\r\n width={80}\r\n columnKey=\"time\"\r\n cell={<DurationCell />}\r\n flexGrow={1}\r\n hideWidth={800}\r\n />\r\n <Column\r\n name=\"Slots\"\r\n width={60}\r\n columnKey=\"slots\"\r\n flexGrow={1}\r\n hideWidth={800}\r\n />\r\n </VirtualTable>\r\n <DownloadDialog\r\n downloadHandler={searchDownloadHandler}\r\n itemDataGetter={this.itemDataGetter}\r\n session={instance}\r\n />\r\n <ResultDialog searchT={searchT} instance={instance} />\r\n </>\r\n );\r\n }\r\n}\r\n\r\nexport default ResultTable;\r\n","import * as React from 'react';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\n\r\nimport HistoryConstants from 'constants/HistoryConstants';\r\n\r\nimport LocalSuggestField, { LocalSuggestFieldProps } from './LocalSuggestField';\r\nimport { addHistory } from 'services/api/HistoryApi';\r\nimport { runBackgroundSocketAction } from 'utils/ActionUtils';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport interface HistoryInputProps\r\n extends Omit<LocalSuggestFieldProps, 'data' | 'submitHandler'> {\r\n historyId: string;\r\n submitHandler: (text: string) => void;\r\n}\r\n\r\ninterface HistoryInputDataProps extends DataProviderDecoratorChildProps {\r\n history: string[];\r\n}\r\n\r\nconst HistoryInput: React.FC<HistoryInputProps & HistoryInputDataProps> = ({\r\n submitHandler,\r\n historyId,\r\n history,\r\n refetchData,\r\n ...other\r\n}) => {\r\n const { t } = useTranslation();\r\n const handleSubmit = async (value: string) => {\r\n const text = value.trim();\r\n await runBackgroundSocketAction(() => addHistory(historyId, text), t);\r\n\r\n refetchData();\r\n submitHandler(text);\r\n };\r\n\r\n return <LocalSuggestField {...other} data={history} submitHandler={handleSubmit} />;\r\n};\r\n\r\nexport default DataProviderDecorator<HistoryInputProps, HistoryInputDataProps>(\r\n HistoryInput,\r\n {\r\n urls: {\r\n history: ({ historyId }, socket) =>\r\n socket.get(HistoryConstants.STRINGS_URL + '/' + historyId),\r\n },\r\n loaderText: null,\r\n }\r\n);\r\n","import * as React from 'react';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport Accordion, {\r\n AccordionContent,\r\n AccordionTitle,\r\n} from 'components/semantic/Accordion';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport Icon from 'components/semantic/Icon';\r\nimport { isValueSet } from 'utils/FormUtils';\r\n\r\ntype FormAccordionProps = React.PropsWithChildren<{\r\n locals: UI.FormLocals;\r\n}>;\r\n\r\nexport const FormAccordion: React.FC<FormAccordionProps> = ({ locals, children }) => {\r\n const { label } = locals;\r\n const active = isValueSet(locals.value);\r\n return (\r\n <Accordion className=\"field\" defaultActiveIndexes={active ? [0] : undefined}>\r\n <AccordionTitle>\r\n <Icon icon={IconConstants.DROPDOWN} />\r\n <span style={active ? { fontWeight: 'bold' } : undefined}>{label}</span>\r\n </AccordionTitle>\r\n <AccordionContent>{children}</AccordionContent>\r\n </Accordion>\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport Checkbox from 'components/semantic/Checkbox';\r\nimport { updateMultiselectValues } from 'utils/FormUtils';\r\nimport HubIcon from 'components/icon/HubIcon';\r\nimport { FormAccordion } from './AccordionField';\r\n\r\ninterface HubSelectFieldProps {\r\n value: string[] | null;\r\n onChange: (hubUrls: string[] | null) => void;\r\n}\r\n\r\ninterface DataProps {\r\n hubs: API.Hub[];\r\n}\r\n\r\ntype Props = HubSelectFieldProps & DataProps;\r\n\r\nconst HubSelectField: React.FC<Props> = ({ hubs, value, onChange }) => {\r\n const onlineHubs = hubs.filter(\r\n (hub) => hub.connect_state.id === API.HubConnectStateEnum.CONNECTED\r\n );\r\n const selectedUrls =\r\n !!value && !!value.length ? value : onlineHubs.map((hub) => hub.hub_url);\r\n\r\n const beforeUnchecked = () => {\r\n if (selectedUrls.length === 1) {\r\n return false;\r\n }\r\n\r\n return;\r\n };\r\n\r\n return (\r\n <>\r\n {onlineHubs.map((hub) => (\r\n <div key={hub.id} className=\"field\">\r\n <Checkbox\r\n caption={\r\n <>\r\n <HubIcon hub={hub} />\r\n {hub.identity.name}\r\n </>\r\n }\r\n beforeUnchecked={beforeUnchecked}\r\n checked={selectedUrls.includes(hub.hub_url)}\r\n onChange={(checked) => {\r\n const newValue = updateMultiselectValues(\r\n selectedUrls,\r\n hub.hub_url,\r\n checked\r\n );\r\n onChange(newValue.length === onlineHubs.length ? null : newValue);\r\n }}\r\n style={{\r\n maxWidth: '300px',\r\n }}\r\n />\r\n </div>\r\n ))}\r\n </>\r\n );\r\n};\r\n\r\ntype TCombTemplate = {\r\n renderSelect: (locals: UI.FormLocals<API.Hub, string[]>) => React.ReactNode;\r\n renderLabel: (locals: UI.FormLocals<API.Hub, string[]>) => React.ReactNode;\r\n};\r\n\r\nconst HubsSelectField: TCombTemplate = {\r\n renderSelect(locals) {\r\n return (\r\n <FormAccordion locals={locals}>\r\n <HubSelectField\r\n onChange={locals.onChange}\r\n value={locals.value}\r\n hubs={locals.options}\r\n />\r\n </FormAccordion>\r\n );\r\n },\r\n renderLabel(locals) {\r\n return null;\r\n },\r\n};\r\n\r\nexport default t.form.Form.templates.select.clone(HubsSelectField);\r\n","import { useState, useEffect } from 'react';\r\nimport * as React from 'react';\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport { ByteUnits, formatUnit, parseUnit } from 'utils/ValueFormat';\r\n\r\ninterface SizeFieldProps {\r\n moduleT: UI.ModuleTranslator;\r\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\r\n onChange: (size: number | null) => void;\r\n value: number;\r\n}\r\n\r\ntype Props = SizeFieldProps;\r\n\r\nconst DEFAULT_UNIT_INDEX = 2;\r\n\r\nconst toFieldValues = (initialValue: number) => {\r\n const { value, unitIndex } = parseUnit(initialValue, ByteUnits, 1024);\r\n return {\r\n value,\r\n unitIndex: !!initialValue ? unitIndex : DEFAULT_UNIT_INDEX,\r\n };\r\n};\r\n\r\nconst SizeField: React.FC<Props> = ({ inputProps, moduleT, onChange, value }) => {\r\n const initialData = toFieldValues(value);\r\n const [displayValue, setDisplayValue] = useState<number | undefined>(initialData.value);\r\n const [unitIndex, setUnitIndex] = useState<number>(initialData.unitIndex);\r\n\r\n const valueToBytes = () => {\r\n let ret = displayValue || 0;\r\n if (!!unitIndex) {\r\n for (let i = 1; i <= unitIndex; i++) {\r\n ret *= 1024;\r\n }\r\n }\r\n\r\n return ret;\r\n };\r\n\r\n // Fire internal changes\r\n useEffect(() => {\r\n const newValue = valueToBytes();\r\n if (newValue !== value) {\r\n onChange(newValue);\r\n }\r\n }, [unitIndex, displayValue]);\r\n\r\n // Update fields on external changes\r\n useEffect(() => {\r\n const curBytes = valueToBytes();\r\n if (value !== curBytes) {\r\n const newData = toFieldValues(value);\r\n setDisplayValue(newData.value);\r\n setUnitIndex(newData.unitIndex);\r\n }\r\n }, [value]);\r\n\r\n return (\r\n <div style={{ display: 'flex' }}>\r\n <input\r\n className=\"ui input\"\r\n type=\"number\"\r\n {...inputProps}\r\n min={0}\r\n value={displayValue || ''}\r\n onChange={(evt) => {\r\n const newValue = !!evt.target.value ? parseInt(evt.target.value) : null;\r\n if (!!newValue) {\r\n setDisplayValue(newValue);\r\n } else {\r\n setDisplayValue(undefined);\r\n }\r\n }}\r\n />\r\n <select\r\n className=\"ui select\"\r\n style={{ maxWidth: '100px' }}\r\n value={ByteUnits[unitIndex]}\r\n onChange={(evt) => {\r\n setUnitIndex(evt.target.selectedIndex);\r\n }}\r\n >\r\n {ByteUnits.map((unit, index) => (\r\n <option key={unit} value={unit}>\r\n {formatUnit(unit, moduleT.plainT)}\r\n </option>\r\n ))}\r\n </select>\r\n </div>\r\n );\r\n};\r\n\r\ntype TCombTemplate = {\r\n renderInput: (locals: UI.FormLocals<any, number>) => React.ReactNode;\r\n};\r\n\r\nconst FileTypeField: TCombTemplate = {\r\n renderInput(locals) {\r\n return (\r\n <SizeField\r\n onChange={locals.onChange}\r\n value={!!locals.value ? parseInt(locals.value as any) : 0}\r\n moduleT={locals.context.formT}\r\n />\r\n );\r\n },\r\n};\r\n\r\nexport default t.form.Form.templates.textbox.clone(FileTypeField);\r\n","import * as React from 'react';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport FileIcon from 'components/icon/FileIcon';\r\nimport Icon from 'components/semantic/Icon';\r\nimport IconConstants from 'constants/IconConstants';\r\n\r\nconst searchTypeToFileItem = (searchType: UI.SearchTypeItem): API.FileItemType => {\r\n if (searchType.id === 'directory') {\r\n return {\r\n id: 'directory',\r\n str: '',\r\n files: 0,\r\n directories: 0,\r\n };\r\n }\r\n\r\n return {\r\n id: 'file',\r\n str: '',\r\n content_type: searchType.id as API.FileContentType,\r\n };\r\n};\r\n\r\ninterface SearchTypeIconProps {\r\n type: UI.SearchTypeItem;\r\n size?: string;\r\n}\r\n\r\nexport const SearchTypeIcon: React.FC<SearchTypeIconProps> = ({\r\n type,\r\n size = 'large',\r\n}) => {\r\n if (!type.id) {\r\n return <Icon icon={IconConstants.ANY} size={size} />;\r\n }\r\n\r\n return <FileIcon typeInfo={searchTypeToFileItem(type)} size={size} />;\r\n};\r\n","import * as React from 'react';\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport SearchConstants from 'constants/SearchConstants';\r\nimport Dropdown from 'components/semantic/Dropdown';\r\nimport MenuItemLink from 'components/semantic/MenuItemLink';\r\nimport { SearchTypeIcon } from 'components/icon/SearchTypeIcon';\r\n\r\ntype OnChangeHandler = (value: string | null) => void;\r\n\r\ninterface SearchTypeDropdownProps {\r\n onChange: OnChangeHandler;\r\n value: string | null;\r\n moduleT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps {\r\n searchTypes: API.SearchType[];\r\n}\r\n\r\nconst getCommonItems = (moduleT: UI.ModuleTranslator): UI.SearchTypeItem[] => [\r\n {\r\n id: null,\r\n str: moduleT.translate('Any'),\r\n },\r\n {\r\n id: 'directory',\r\n str: moduleT.translate('Directory'),\r\n },\r\n {\r\n id: 'file',\r\n str: moduleT.translate('File'),\r\n },\r\n];\r\n\r\nconst typeToMenuItem = (\r\n type: UI.SearchTypeItem,\r\n onChange: OnChangeHandler,\r\n selectedItem: UI.SearchTypeItem\r\n) => (\r\n <MenuItemLink\r\n key={type.id || SearchConstants.DEFAULT_SEARCH_TYPE}\r\n onClick={() => onChange(type.id)}\r\n icon={<SearchTypeIcon type={type} />}\r\n active={selectedItem.id === type.id}\r\n >\r\n {type.str}\r\n </MenuItemLink>\r\n);\r\n\r\ntype Props = SearchTypeDropdownProps & DataProviderDecoratorChildProps & DataProps;\r\n\r\nconst SearchTypeDropdown: React.FC<Props> = ({\r\n searchTypes,\r\n value,\r\n onChange,\r\n moduleT,\r\n}) => {\r\n const commonItems = getCommonItems(moduleT);\r\n const selectedItem =\r\n searchTypes.find((i) => value === i.id) ||\r\n commonItems.find((i) => value === i.id) ||\r\n commonItems[0];\r\n return (\r\n <Dropdown\r\n selection={true}\r\n caption={\r\n <>\r\n <SearchTypeIcon type={selectedItem} size=\"\" />\r\n {selectedItem.str}\r\n </>\r\n }\r\n >\r\n {commonItems.map((type) => typeToMenuItem(type, onChange, selectedItem))}\r\n <div key=\"divider\" className=\"ui divider\" />\r\n {searchTypes.map((type) => typeToMenuItem(type, onChange, selectedItem))}\r\n </Dropdown>\r\n );\r\n};\r\n\r\nconst SearchTypeDropdownDecorated = DataProviderDecorator<\r\n SearchTypeDropdownProps,\r\n DataProps\r\n>(SearchTypeDropdown, {\r\n urls: {\r\n searchTypes: SearchConstants.SEARCH_TYPES_URL,\r\n },\r\n});\r\n\r\ntype TCombTemplate = {\r\n renderSelect: (locals: UI.FormLocals<any, string>) => React.ReactNode;\r\n};\r\n\r\nconst FileTypeField: TCombTemplate = {\r\n renderSelect(locals) {\r\n return (\r\n <SearchTypeDropdownDecorated\r\n onChange={locals.onChange}\r\n value={locals.value || null}\r\n moduleT={locals.context.formT}\r\n />\r\n );\r\n },\r\n};\r\n\r\nexport default t.form.Form.templates.select.clone(FileTypeField);\r\n","import * as React from 'react';\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport { FormAccordion } from './AccordionField';\r\n\r\ntype TCombTemplate = {\r\n renderFieldset: (children: React.ReactNode, locals: UI.FormLocals) => React.ReactNode;\r\n renderLabel: (locals: UI.FormLocals) => React.ReactNode;\r\n};\r\n\r\nconst AccordionStruct: TCombTemplate = {\r\n renderFieldset(children, locals) {\r\n const { label, ...childLocals } = locals;\r\n return (\r\n <FormAccordion locals={locals}>\r\n {(t.form.Form.templates.struct as any).renderFieldset(children, childLocals)}\r\n </FormAccordion>\r\n );\r\n },\r\n renderLabel(locals) {\r\n return null;\r\n },\r\n};\r\n\r\nexport default t.form.Form.templates.struct.clone(AccordionStruct);\r\n","import { PureComponent } from 'react';\r\nimport t from 'utils/tcomb-form';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport HubSelectField from './HubSelectField';\r\nimport SizeField from './SizeField';\r\nimport FileTypeField from './FileTypeField';\r\n\r\nimport Form, {\r\n FormFieldChangeHandler,\r\n FormSaveHandler,\r\n FormFieldSettingHandler,\r\n} from 'components/form/Form';\r\nimport { isValueSet, translateForm } from 'utils/FormUtils';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport Button from 'components/semantic/Button';\r\nimport AccordionStructField from './AccordionStructField';\r\n\r\ninterface Entry extends Pick<API.SearchQuery, 'file_type'>, UI.FormValueMap {\r\n hub_urls: string[] | null;\r\n size_limits: null | {\r\n min_size: number | null;\r\n max_size: number | null;\r\n };\r\n // excluded: string[] | null;\r\n}\r\n\r\nexport interface SearchOptionsFormProps extends Pick<RouteComponentProps, 'location'> {\r\n moduleT: UI.ModuleTranslator;\r\n onChange: (value: Entry | null) => void;\r\n value: Entry | null;\r\n hubs: API.Hub[];\r\n}\r\n\r\nconst Fields: UI.FormFieldDefinition[] = [\r\n {\r\n key: 'file_type',\r\n title: 'File type',\r\n type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n },\r\n {\r\n key: 'hub_urls',\r\n title: 'Hubs',\r\n type: API.SettingTypeEnum.LIST,\r\n item_type: API.SettingTypeEnum.STRING,\r\n },\r\n {\r\n key: 'size_limits',\r\n title: 'Size limits',\r\n type: API.SettingTypeEnum.STRUCT,\r\n optional: true,\r\n definitions: [\r\n {\r\n key: 'min_size',\r\n title: 'Minimum size',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n },\r\n {\r\n key: 'max_size',\r\n title: 'Maximum size',\r\n type: API.SettingTypeEnum.NUMBER,\r\n optional: true,\r\n },\r\n ],\r\n } /*, {\r\n key: 'excluded',\r\n title: 'Excluded words',\r\n type: API.SettingTypeEnum.LIST,\r\n item_type: API.SettingTypeEnum.STRING,\r\n optional: true,\r\n }*/,\r\n];\r\n\r\nconst removeEmptyProperties = (formValue: Entry) => {\r\n const ret = Object.keys(formValue).reduce((reduced, key) => {\r\n const value = formValue[key];\r\n if (isValueSet(value)) {\r\n reduced[key] = value;\r\n }\r\n\r\n return reduced;\r\n }, {} as Entry);\r\n\r\n return ret;\r\n};\r\n\r\nclass SearchOptionsForm extends PureComponent<SearchOptionsFormProps> {\r\n static displayName = 'SearchOptionForm';\r\n\r\n constructor(props: SearchOptionsFormProps) {\r\n super(props);\r\n\r\n this.definitions = translateForm(Fields, props.moduleT);\r\n }\r\n\r\n definitions: UI.FormFieldDefinition[];\r\n form: Form<Entry>;\r\n\r\n onFieldChanged: FormFieldChangeHandler<Entry> = (id, value, hasChanges) => {\r\n const ret = removeEmptyProperties(value as Entry);\r\n this.props.onChange(!!Object.keys(ret).length ? ret : null);\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 return Promise.resolve();\r\n };\r\n\r\n onFieldSetting: FormFieldSettingHandler<Entry> = (id, fieldOptions, formValue) => {\r\n if (id === 'hub_urls') {\r\n Object.assign(fieldOptions, {\r\n factory: t.form.Select,\r\n template: HubSelectField,\r\n options: this.props.hubs,\r\n });\r\n } else if (id === 'min_size' || id === 'max_size') {\r\n Object.assign(fieldOptions, {\r\n // factory: t.form.List,\r\n template: SizeField,\r\n });\r\n } else if (id === 'excluded') {\r\n Object.assign(fieldOptions, {\r\n disableOrder: true,\r\n });\r\n } else if (id === 'file_type') {\r\n Object.assign(fieldOptions, {\r\n template: FileTypeField,\r\n });\r\n } else if (id === 'size_limits') {\r\n Object.assign(fieldOptions, {\r\n template: AccordionStructField,\r\n });\r\n }\r\n };\r\n\r\n render() {\r\n const { value, onChange, location, moduleT } = this.props;\r\n return (\r\n <div>\r\n <Form<Entry>\r\n ref={(c) => (this.form = c!)}\r\n onFieldChanged={this.onFieldChanged}\r\n onFieldSetting={this.onFieldSetting}\r\n onSave={this.onSave}\r\n fieldDefinitions={this.definitions}\r\n sourceValue={value} // This gets updated on every change at the moment...\r\n location={location}\r\n optionTitleFormatter={(def) => def.title}\r\n className=\"search-options\"\r\n />\r\n <Button\r\n caption={moduleT.translate('Reset all')}\r\n onClick={() => onChange(null)}\r\n disabled={!value}\r\n style={{\r\n marginTop: '10px',\r\n }}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport { SearchOptionsForm, Entry as SearchOptions };\r\n","import { useEffect } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport Button from 'components/semantic/Button';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport Popup from 'components/semantic/Popup';\r\nimport {\r\n SearchOptionsForm,\r\n SearchOptionsFormProps,\r\n SearchOptions,\r\n} from './SearchOptionsForm';\r\nimport IconConstants from 'constants/IconConstants';\r\nimport Icon from 'components/semantic/Icon';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport HubConstants from 'constants/HubConstants';\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport { isValueSet } from 'utils/FormUtils';\r\n\r\ninterface SearchOptionsButtonProps\r\n extends Pick<RouteComponentProps, 'location'>,\r\n Pick<SearchOptionsFormProps, 'onChange' | 'value'> {\r\n moduleT: UI.ModuleTranslator;\r\n}\r\n\r\ninterface DataProps {\r\n hubs: API.Hub[];\r\n}\r\n\r\ntype Props = SearchOptionsButtonProps & DataProviderDecoratorChildProps & DataProps;\r\n\r\nconst removeEmptyProperties = (value: SearchOptions) => {\r\n const ret = Object.keys(value).reduce((reduced, key) => {\r\n if (Array.isArray(value[key]) ? !!(value[key] as Array<any>).length : !!value[key]) {\r\n reduced[key] = value[key] as any;\r\n }\r\n\r\n return reduced;\r\n }, {} as SearchOptions);\r\n\r\n return ret;\r\n};\r\n\r\nconst SearchOptionsButton: React.FC<Props> = ({\r\n moduleT,\r\n location,\r\n onChange,\r\n value,\r\n hubs,\r\n}) => {\r\n const onValueChanged = (newValue: SearchOptions | null) => {\r\n if (newValue) {\r\n const ret = removeEmptyProperties(newValue);\r\n onChange(!!Object.keys(ret).length ? ret : null);\r\n } else {\r\n onChange(null);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n // Remove obsolete hubs from the options\r\n if (!!value && !!value.hub_urls && !!value.hub_urls.length) {\r\n const selectedUrls = value.hub_urls;\r\n const selectedUrlsNew = selectedUrls.filter((url) =>\r\n hubs.find((hub) => hub.hub_url === url)\r\n );\r\n if (selectedUrlsNew.length !== selectedUrls.length) {\r\n onValueChanged({\r\n ...value,\r\n hub_urls: !!selectedUrlsNew.length ? selectedUrlsNew : null,\r\n });\r\n }\r\n }\r\n }, [hubs]);\r\n\r\n const filterCount = !value\r\n ? null\r\n : Object.keys(value).filter((key) => {\r\n const curValue = value[key];\r\n return isValueSet(curValue);\r\n }).length;\r\n\r\n return (\r\n <Popup\r\n triggerClassName=\"options\"\r\n className=\"options\"\r\n trigger={\r\n <Button\r\n caption={\r\n <>\r\n <Icon icon={IconConstants.OPTIONS} />\r\n {!!filterCount && (\r\n <span\r\n style={{\r\n fontWeight: 'bold',\r\n marginRight: '3px',\r\n color: 'black',\r\n }}\r\n >\r\n {`(${filterCount})`}\r\n </span>\r\n )}\r\n <Icon icon={IconConstants.EXPAND} />\r\n </>\r\n }\r\n />\r\n }\r\n contentUpdateTrigger={value}\r\n >\r\n {(hide) => (\r\n <SearchOptionsForm\r\n moduleT={moduleT}\r\n location={location}\r\n onChange={onValueChanged}\r\n value={value}\r\n hubs={hubs}\r\n />\r\n )}\r\n </Popup>\r\n );\r\n};\r\n\r\nconst SearchOptionsButtonDecorated = DataProviderDecorator<\r\n SearchOptionsButtonProps,\r\n DataProps\r\n>(SearchOptionsButton, {\r\n urls: {\r\n hubs: HubConstants.SESSIONS_URL,\r\n },\r\n onSocketConnected: (addSocketListener, { refetchData }) => {\r\n addSocketListener(HubConstants.MODULE_URL, HubConstants.SESSION_CREATED, () =>\r\n refetchData()\r\n );\r\n addSocketListener<Partial<API.Hub>>(\r\n HubConstants.MODULE_URL,\r\n HubConstants.SESSION_UPDATED,\r\n (hub) => {\r\n if (!!hub.connect_state) {\r\n refetchData();\r\n }\r\n }\r\n );\r\n addSocketListener(HubConstants.MODULE_URL, HubConstants.SESSION_REMOVED, () =>\r\n refetchData()\r\n );\r\n },\r\n dataConverters: {\r\n hubs: (hubs: API.Hub[]) =>\r\n hubs.filter((hub) => hub.connect_state.id === API.HubConnectStateEnum.CONNECTED),\r\n },\r\n});\r\n\r\nexport { SearchOptionsButtonDecorated as SearchOptionsButton };\r\n","import { useState } from 'react';\r\nimport * as React from 'react';\r\n\r\nimport HistoryInput from 'components/autosuggest/HistoryInput';\r\nimport { HistoryStringEnum } from 'constants/HistoryConstants';\r\nimport Button from 'components/semantic/Button';\r\n\r\nimport * as UI from 'types/ui';\r\n\r\nimport IconConstants from 'constants/IconConstants';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { useMobileLayout } from 'utils/BrowserUtils';\r\nimport { SearchOptionsButton, SearchOptions } from './options-panel';\r\n\r\ninterface SearchInputProps extends Pick<RouteComponentProps, 'location'> {\r\n running: boolean;\r\n moduleT: UI.ModuleTranslator;\r\n defaultValue?: string;\r\n handleSubmit: (text: string, options?: SearchOptions) => void;\r\n defaultOptions: SearchOptions | null;\r\n}\r\n\r\nconst SearchInput: React.FC<SearchInputProps> = ({\r\n moduleT,\r\n defaultValue,\r\n running,\r\n handleSubmit,\r\n location,\r\n defaultOptions,\r\n}) => {\r\n const [options, setOptions] = useState<SearchOptions | null>(defaultOptions);\r\n\r\n const mobile = useMobileLayout();\r\n return (\r\n <div className=\"search-container\">\r\n <div className=\"search-area\">\r\n <HistoryInput\r\n historyId={HistoryStringEnum.SEARCH}\r\n submitHandler={(value) => handleSubmit(value, options || undefined)}\r\n disabled={running}\r\n defaultValue={defaultValue}\r\n placeholder={moduleT.translate('Enter search string...')}\r\n button={\r\n <Button\r\n className=\"blue\"\r\n icon={IconConstants.SEARCH}\r\n caption={!mobile ? moduleT.translate('Search') : undefined}\r\n loading={running}\r\n />\r\n }\r\n />\r\n <SearchOptionsButton\r\n moduleT={moduleT}\r\n location={location}\r\n onChange={setOptions}\r\n value={options}\r\n />\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport { SearchInput };\r\n","import { Component } from 'react';\r\n\r\nimport SearchConstants from 'constants/SearchConstants';\r\n\r\nimport History from 'utils/History';\r\n\r\nimport OfflineHubMessageDecorator from 'decorators/OfflineHubMessageDecorator';\r\n\r\nimport '../style.css';\r\nimport ResultTable from 'routes/Search/components/ResultTable';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\n\r\nimport * as API from 'types/api';\r\nimport * as UI from 'types/ui';\r\n\r\nimport { WithTranslation } from 'react-i18next';\r\nimport { getModuleT } from 'utils/TranslationUtils';\r\nimport { SearchInput } from './SearchInput';\r\nimport { SearchOptions } from './options-panel';\r\nimport NotificationActions from 'actions/NotificationActions';\r\nimport DataProviderDecorator, {\r\n DataProviderDecoratorChildProps,\r\n} from 'decorators/DataProviderDecorator';\r\nimport LoginStore from 'stores/LoginStore';\r\nimport { search } from 'services/api/SearchApi';\r\nimport {\r\n loadSessionProperty,\r\n removeSessionProperty,\r\n saveSessionProperty,\r\n} from 'utils/BrowserUtils';\r\n\r\nconst RESULT_WAIT_PERIOD = 4000;\r\n\r\ninterface SearchLocationState {\r\n searchString?: string;\r\n}\r\n\r\ntype SearchProps = RouteComponentProps<UI.EmptyObject, any, SearchLocationState>;\r\n\r\ninterface SearchDataProps extends DataProviderDecoratorChildProps, WithTranslation {\r\n instance: API.SearchInstance;\r\n}\r\n\r\nconst SEARCH_HUBS_KEY = 'search_hubs';\r\n\r\nconst loadHubOptions = () => {\r\n const options = loadSessionProperty<string[] | null>(SEARCH_HUBS_KEY, null);\r\n return options;\r\n};\r\n\r\nconst saveHubOptions = (hubs: string[] | null) => {\r\n if (!hubs || !hubs.length) {\r\n removeSessionProperty(SEARCH_HUBS_KEY);\r\n } else {\r\n saveSessionProperty(SEARCH_HUBS_KEY, hubs);\r\n }\r\n};\r\n\r\nclass Search extends Component<SearchProps & SearchDataProps> {\r\n state = {\r\n searchString: '',\r\n running: false,\r\n };\r\n\r\n searchTimeout: number | undefined;\r\n\r\n componentDidMount() {\r\n this.checkLocationState(this.props);\r\n\r\n const { query } = this.props.instance;\r\n if (!!query) {\r\n this.setState({\r\n searchString: query.pattern,\r\n });\r\n }\r\n }\r\n\r\n componentDidUpdate(prevProps: SearchProps) {\r\n this.checkLocationState(this.props);\r\n }\r\n\r\n checkLocationState = (props: SearchProps) => {\r\n const { state } = props.location;\r\n if (state && state.searchString && state.searchString !== this.state.searchString) {\r\n this.search(state.searchString);\r\n\r\n // Avoid searching for it again\r\n History.replace({\r\n pathname: props.location.pathname,\r\n });\r\n }\r\n };\r\n\r\n search = async (searchString: string, options?: SearchOptions) => {\r\n console.log('Searching');\r\n\r\n clearTimeout(this.searchTimeout);\r\n saveHubOptions(options?.hub_urls || null);\r\n\r\n const { hub_urls, size_limits, ...queryOptions } = options || {};\r\n try {\r\n const res = await search(this.props.instance, {\r\n query: {\r\n pattern: searchString,\r\n ...size_limits,\r\n ...queryOptions,\r\n },\r\n priority: API.PriorityEnum.HIGH,\r\n hub_urls,\r\n });\r\n\r\n this.onSearchPosted(res);\r\n this.setState({\r\n searchString,\r\n running: true,\r\n });\r\n } catch (error) {\r\n NotificationActions.apiError('Search failed', error);\r\n }\r\n };\r\n\r\n onSearchPosted = (data: API.SearchResponse) => {\r\n this.searchTimeout = window.setTimeout(() => {\r\n this.setState({\r\n running: false,\r\n });\r\n }, data.queue_time + RESULT_WAIT_PERIOD);\r\n };\r\n\r\n parseOptions = (): SearchOptions | null => {\r\n const { query } = this.props.instance;\r\n if (!query) {\r\n return null;\r\n }\r\n\r\n return {\r\n excluded: query.excluded,\r\n size_limits: {\r\n min_size: query.min_size,\r\n max_size: query.max_size,\r\n },\r\n file_type:\r\n query.file_type === SearchConstants.DEFAULT_SEARCH_TYPE ||\r\n query.file_type === 'tth'\r\n ? null\r\n : query.file_type,\r\n hub_urls: loadHubOptions(),\r\n };\r\n };\r\n\r\n searchT = getModuleT(this.props.t, UI.Modules.SEARCH);\r\n render() {\r\n const { instance, location } = this.props;\r\n const { searchString, running } = this.state;\r\n const { t } = this.searchT;\r\n return (\r\n <OfflineHubMessageDecorator\r\n offlineMessage={t<string>(\r\n 'searchOffline',\r\n 'You must to be connected to at least one hub in order to perform searches'\r\n )}\r\n >\r\n <div className=\"search-layout\">\r\n <SearchInput\r\n moduleT={this.searchT}\r\n running={running}\r\n defaultValue={searchString}\r\n handleSubmit={this.search}\r\n location={location}\r\n defaultOptions={this.parseOptions()}\r\n />\r\n <ResultTable\r\n searchString={searchString}\r\n running={running}\r\n searchT={this.searchT}\r\n instance={instance}\r\n />\r\n </div>\r\n </OfflineHubMessageDecorator>\r\n );\r\n }\r\n}\r\n\r\nconst OWNER_ID_SUFFIX = 'webui';\r\n\r\nexport default DataProviderDecorator<SearchProps, SearchDataProps>(Search, {\r\n urls: {\r\n instance: async (props, socket) => {\r\n // Try to use a previously created instance for this session\r\n const instances = await socket.get<API.SearchInstance[]>(\r\n `${SearchConstants.INSTANCES_URL}`\r\n );\r\n\r\n const instance = instances.find(\r\n (i) => i.owner === `session:${LoginStore.sessionId}:${OWNER_ID_SUFFIX}`\r\n );\r\n if (!!instance) {\r\n return instance;\r\n }\r\n\r\n // Create new instance\r\n const instanceId = (\r\n await socket.post<{ id: number }>(SearchConstants.INSTANCES_URL, {\r\n owner_suffix: OWNER_ID_SUFFIX,\r\n expiration: 0,\r\n })\r\n ).id;\r\n\r\n return socket.get(`${SearchConstants.INSTANCES_URL}/${instanceId}`);\r\n },\r\n },\r\n});\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","DupeStrings","DupePaths","paths","className","map","path","FileItemInfoGrid","session","fileItem","user","downloadHandler","showPath","t","gridT","text","Grid","columns","stackable","title","name","type","str","size","time","tth","dupe","caption","button","itemInfoGetter","contextElement","hub","other","icon","connect_state","SearchActions","result","displayName","IconConstants","handler","data","location","History","pathname","browseContent","access","FilelistSessionActions","users","FilelistSessionStore","moduleId","actions","UserResult","userIcon","directory","ids","remoteMenuId","MenuConstants","hub_names","connection","slots","FormattedIp","item","ip","resultSort","a","b","nicks","localeCompare","DataProviderDecorator","results","defaultValue","defaultValue_plural","count","length","style","width","sort","cid","urls","parentResult","instanceId","socket","get","SearchConstants","searchDownloadHandler","itemInfo","downloadData","instance","SocketService","ResultDialog","Component","itemDataGetter","itemId","this","props","render","Modal","closable","FileIcon","typeInfo","fullHeight","DownloadDialog","Decorated","ModalRouteDecorator","match","params","resultId","_viewName","_apiUrl","mixins","ViewStoreMixin","getUserCaption","replace","UserCell","cellData","rowDataGetter","itemData","resultUserGetter","rowData","NameCell","userGetter","entityId","ResultTable","rowClassNameGetter","emptyRowsNodeGetter","running","searchString","searchT","Message","description","i18nKey","toI18nKey","VirtualTable","store","SearchViewStore","textFilterProps","autoFocus","Column","columnKey","flexGrow","cell","hideWidth","submitHandler","historyId","history","refetchData","LocalSuggestField","value","trim","HistoryConstants","loaderText","FormAccordion","locals","children","label","active","Accordion","defaultActiveIndexes","undefined","Icon","fontWeight","HubSelectField","hubs","onChange","onlineHubs","filter","selectedUrls","hub_url","beforeUnchecked","Checkbox","HubIcon","identity","checked","includes","newValue","maxWidth","HubsSelectField","renderSelect","renderLabel","toFieldValues","initialValue","unitIndex","SizeField","inputProps","moduleT","initialData","displayValue","setDisplayValue","useState","setUnitIndex","valueToBytes","ret","i","useEffect","curBytes","newData","display","min","evt","target","parseInt","selectedIndex","unit","index","plainT","FileTypeField","renderInput","context","formT","SearchTypeIcon","searchType","files","directories","content_type","typeToMenuItem","selectedItem","MenuItemLink","onClick","SearchTypeDropdownDecorated","searchTypes","commonItems","translate","getCommonItems","find","Dropdown","selection","AccordionStruct","renderFieldset","childLocals","Fields","key","optional","item_type","definitions","SearchOptionsForm","PureComponent","constructor","super","onFieldChanged","hasChanges","formValue","Object","keys","reduce","reduced","save","form","onSave","changedFields","Promise","resolve","onFieldSetting","fieldOptions","assign","factory","template","disableOrder","AccordionStructField","Form","ref","c","fieldDefinitions","sourceValue","optionTitleFormatter","def","Button","disabled","marginTop","SearchOptionsButtonDecorated","onValueChanged","Array","isArray","hub_urls","selectedUrlsNew","url","filterCount","curValue","Popup","triggerClassName","trigger","marginRight","color","contentUpdateTrigger","hide","HubConstants","onSocketConnected","addSocketListener","dataConverters","SearchInput","handleSubmit","defaultOptions","setOptions","mobile","placeholder","loading","SEARCH_HUBS_KEY","Search","state","checkLocationState","search","console","log","clearTimeout","searchTimeout","size_limits","queryOptions","res","query","pattern","priority","onSearchPosted","setState","error","NotificationActions","window","setTimeout","queue_time","parseOptions","excluded","min_size","max_size","file_type","componentDidMount","componentDidUpdate","prevProps","OfflineHubMessageDecorator","offlineMessage","OWNER_ID_SUFFIX","owner","LoginStore","post","owner_suffix","expiration"],"sourceRoot":""}
|