1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[24357],{36720:function(e,t,n){n.d(t,{_r:function(){return o},t5:function(){return i}});var a=n(94732),r=n(80401),l=n(69410),i="Configuration",o=function(){var e=(0,l.gf)().api;return(0,r.I)({queryKey:[i],queryFn:function(t){var n=t.signal;return function(e,t){return n=void 0,r=void 0,i=function(){return function(e,t){var n,a,r,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(l=0)),l;)try{if(n=1,a&&(r=2&o[0]?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return l.label++,{value:o[1],done:!1};case 5:l.label++,a=o[1],o=[0];continue;case 7:o=l.ops.pop(),l.trys.pop();continue;default:if(!((r=(r=l.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){l=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){l.label=o[1];break}if(6===o[0]&&l.label<r[1]){l.label=r[1],r=o;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(o);break}r[2]&&l.ops.pop(),l.trys.pop();continue}o=t.call(e,l)}catch(e){o=[6,e],a=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}(this,(function(n){switch(n.label){case 0:return[4,(0,a.T)(e).getConfiguration(t)];case 1:return[2,n.sent().data]}}))},new((l=void 0)||(l=Promise))((function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function o(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof l?n:new l((function(e){e(n)}))).then(a,o)}c((i=i.apply(n,r||[])).next())}));var n,r,l,i}(e,{signal:n})},enabled:!!e})}},78963:function(e,t,n){n.r(t),n.d(t,{Component:function(){return O},action:function(){return F}});var a=n(62540),r=n(47891),l=n(92779),i=n(75487),o=n(85637),c=n(70140),u=n(57836),s=n(89348),f=n(99193),d=n(80401),h=n(69410),p=function(){var e=(0,h.gf)().api;return(0,d.I)({queryKey:["LocalizationOptions"],queryFn:function(t){var n=t.signal;return function(e,t){return n=void 0,a=void 0,l=function(){return function(e,t){var n,a,r,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(l=0)),l;)try{if(n=1,a&&(r=2&o[0]?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return l.label++,{value:o[1],done:!1};case 5:l.label++,a=o[1],o=[0];continue;case 7:o=l.ops.pop(),l.trys.pop();continue;default:if(!((r=(r=l.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){l=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){l.label=o[1];break}if(6===o[0]&&l.label<r[1]){l.label=r[1],r=o;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(o);break}r[2]&&l.ops.pop(),l.trys.pop();continue}o=t.call(e,l)}catch(e){o=[6,e],a=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}(this,(function(n){switch(n.label){case 0:return[4,(0,f.S)(e).getLocalizationOptions(t)];case 1:return[2,n.sent().data]}}))},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{c(l.next(e))}catch(e){t(e)}}function o(e){try{c(l.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,o)}c((l=l.apply(n,a||[])).next())}));var n,a,r,l}(e,{signal:n})},enabled:!!e})},y=n(84849),b=n(65242),v=n(36720),g=n(5898),A=n(67430),m=n(63696),x=n(87404),S=n(9055),C=n(43361),w=n(6725),P=n(31720),j=n(96441),k=n(70564),L=n(63703),I=n(68700),H=n(21840),E=n(94732),T=n(31297),N=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var a,r,l=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(a=l.next()).done;)i.push(a.value)}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return i},F=function(e){return t=void 0,n=[e],r=function(e){var t,n,a,r,l,i,o,c,u,s,f=e.request;return function(e,t){var n,a,r,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(l=0)),l;)try{if(n=1,a&&(r=2&o[0]?a.return:o[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;switch(a=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return l.label++,{value:o[1],done:!1};case 5:l.label++,a=o[1],o=[0];continue;case 7:o=l.ops.pop(),l.trys.pop();continue;default:if(!((r=(r=l.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){l=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){l.label=o[1];break}if(6===o[0]&&l.label<r[1]){l.label=r[1],r=o;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(o);break}r[2]&&l.ops.pop(),l.trys.pop();continue}o=t.call(e,l)}catch(e){o=[6,e],a=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}(this,(function(e){switch(e.label){case 0:if(!(t=A.tF.getCurrentApi()))throw new Error("No Api instance available");return[4,(0,E.T)(t).getConfiguration()];case 1:return n=e.sent().data,[4,f.formData()];case 2:return a=e.sent(),n.ServerName=null===(r=a.get("ServerName"))||void 0===r?void 0:r.toString(),n.UICulture=null===(l=a.get("UICulture"))||void 0===l?void 0:l.toString(),n.CachePath=null===(i=a.get("CachePath"))||void 0===i?void 0:i.toString(),n.MetadataPath=null===(o=a.get("MetadataPath"))||void 0===o?void 0:o.toString(),n.QuickConnectAvailable="on"===(null===(c=a.get("QuickConnectAvailable"))||void 0===c?void 0:c.toString()),n.LibraryScanFanoutConcurrency=parseInt((null===(u=a.get("LibraryScanFanoutConcurrency"))||void 0===u?void 0:u.toString())||"0",10),n.ParallelImageEncodingLimit=parseInt((null===(s=a.get("ParallelImageEncodingLimit"))||void 0===s?void 0:s.toString())||"0",10),[4,(0,E.T)(t).updateConfiguration({serverConfiguration:n})];case 3:return e.sent(),T.q.invalidateQueries({queryKey:[v.t5]}),[2,{isSaved:!0}]}}))},new((a=void 0)||(a=Promise))((function(e,l){function i(e){try{c(r.next(e))}catch(e){l(e)}}function o(e){try{c(r.throw(e))}catch(e){l(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(e){e(n)}))).then(i,o)}c((r=r.apply(t,n||[])).next())}));var t,n,a,r},O=function(){var e=(0,v._r)(),t=e.data,n=e.isPending,f=e.isError,d=p(),h=d.data,A=d.isPending,E=d.isError,T=(0,x.cq)(),F=(0,x.mP)(),O="submitting"===T.state,q=N((0,m.useState)(""),2),M=q[0],Q=q[1],V=N((0,m.useState)(""),2),G=V[0],U=V[1],z=(0,m.useCallback)((function(e){Q(e.target.value)}),[]),D=(0,m.useCallback)((function(e){U(e.target.value)}),[]),K=(0,m.useCallback)((function(){var e=new H.default;e.show({callback:function(t){t&&Q(t),e.close()},validateWriteable:!0,header:g.Ay.translate("HeaderSelectServerCachePath"),instruction:g.Ay.translate("HeaderSelectServerCachePathHelp")})}),[]),_=(0,m.useCallback)((function(){var e=new H.default;e.show({path:G,callback:function(t){t&&U(t),e.close()},validateWriteable:!0,header:g.Ay.translate("HeaderSelectMetadataPath"),instruction:g.Ay.translate("HeaderSelectMetadataPathHelp")})}),[G]);return(0,m.useEffect)((function(){n||f||(Q(t.CachePath),U(t.MetadataPath))}),[t,n,f]),n||A?(0,a.jsx)(y.A,{}):(0,a.jsx)(b.A,{id:"dashboardGeneralPage",title:g.Ay.translate("General"),className:"type-interior mainAnimatedPage",children:(0,a.jsx)(l.A,{className:"content-primary",children:f||E?(0,a.jsx)(r.A,{severity:"error",children:g.Ay.translate("SettingsPageLoadError")}):(0,a.jsx)(S.lV,{method:"POST",children:(0,a.jsxs)(c.A,{spacing:3,children:[(0,a.jsx)(s.A,{variant:"h1",children:g.Ay.translate("Settings")}),!O&&(null==F?void 0:F.isSaved)&&(0,a.jsx)(r.A,{severity:"success",children:g.Ay.translate("SettingsSaved")}),(0,a.jsx)(u.A,{name:"ServerName",label:g.Ay.translate("LabelServerName"),helperText:g.Ay.translate("LabelServerNameHelp"),defaultValue:t.ServerName}),(0,a.jsx)(u.A,{select:!0,name:"UICulture",label:g.Ay.translate("LabelPreferredDisplayLanguage"),helperText:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:g.Ay.translate("LabelDisplayLanguageHelp")}),(0,a.jsx)(I.A,{href:"https://jellyfin.org/docs/general/contributing/#translating",target:"_blank",children:g.Ay.translate("LearnHowYouCanContribute")})]}),defaultValue:t.UICulture,slotProps:{formHelperText:{component:c.A}},children:h.map((function(e){return(0,a.jsx)(o.A,{value:e.Value||"",children:e.Name},e.Name)}))}),(0,a.jsx)(s.A,{variant:"h2",children:g.Ay.translate("HeaderPaths")}),(0,a.jsx)(u.A,{name:"CachePath",label:g.Ay.translate("LabelCachePath"),helperText:g.Ay.translate("LabelCachePathHelp"),value:M,onChange:z,slotProps:{input:{endAdornment:(0,a.jsx)(w.A,{position:"end",children:(0,a.jsx)(i.A,{edge:"end",onClick:K,children:(0,a.jsx)(C.A,{})})})}}}),(0,a.jsx)(u.A,{name:"MetadataPath",label:g.Ay.translate("LabelMetadataPath"),helperText:g.Ay.translate("LabelMetadataPathHelp"),value:G,onChange:D,slotProps:{input:{endAdornment:(0,a.jsx)(w.A,{position:"end",children:(0,a.jsx)(i.A,{edge:"end",onClick:_,children:(0,a.jsx)(C.A,{})})})}}}),(0,a.jsx)(s.A,{variant:"h2",children:g.Ay.translate("QuickConnect")}),(0,a.jsx)(P.A,{children:(0,a.jsx)(j.A,{control:(0,a.jsx)(k.A,{name:"QuickConnectAvailable",defaultChecked:t.QuickConnectAvailable}),label:g.Ay.translate("EnableQuickConnect")})}),(0,a.jsx)(s.A,{variant:"h2",children:g.Ay.translate("HeaderPerformance")}),(0,a.jsx)(u.A,{name:"LibraryScanFanoutConcurrency",type:"number",label:g.Ay.translate("LibraryScanFanoutConcurrency"),helperText:g.Ay.translate("LibraryScanFanoutConcurrencyHelp"),defaultValue:t.LibraryScanFanoutConcurrency||"",slotProps:{htmlInput:{min:0,step:1}}}),(0,a.jsx)(u.A,{name:"ParallelImageEncodingLimit",type:"number",label:g.Ay.translate("LabelParallelImageEncodingLimit"),helperText:g.Ay.translate("LabelParallelImageEncodingLimitHelp"),defaultValue:t.ParallelImageEncodingLimit||"",slotProps:{htmlInput:{min:0,step:1}}}),(0,a.jsx)(L.A,{type:"submit",size:"large",children:g.Ay.translate("Save")})]})})})})};O.displayName="SettingsPage"}}]); |