(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/services/list"],{893:(e,t,a)=>{"use strict";a.r(t);var s=a(153),r=a(143),n=a(260),o=a.n(n),i=a(608),l=a(576);const p=r.Locale.getSection("admin.controllers.services.operation"),d=r.Locale.getSection("admin.components.lists.services"),c=async(e,t)=>{const a=(0,r.prepareUrl)(`/admin/services/operation/id/${encodeURIComponent(t.id)}/act/${e}`);(0,r.getComponent)("admin-services-list").disable();try{const e=await r.api.post(a);e.redirect?(0,r.redirect)(e.redirect):(0,r.getComponent)("admin-services-list").reload(),e.statusMessages.forEach((function(e){(0,r.addStatusMessage)(e.status,e.content)}))}catch(a){(0,r.getComponent)("admin-services-list").reload(),["nginx","web"].includes(t.id)?(0,r.addStatusMessage)("info",p.lmsg(`${e}ServiceMessage`)):(0,r.addStatusMessage)("error",p.lmsg(`${e}ActionError`,{error:a.message}))}},u=({data:e,searchFilters:t,dataUrl:a,groupsDescriptions:n,showStartupTypeColumn:o})=>(0,s.createElement)(l.default,null,(()=>new r.Panel({cls:"list-box",items:[new r.GroupsList({id:"admin-services-list",pageable:!1,data:e,dataUrl:a,searchFilters:t,searchOverall:"name",operations:[{componentType:"Jsw.SmallButton",id:"buttonRefreshComponents",title:d.lmsg("buttonRefreshComponents"),description:d.lmsg("hintRefreshComponents"),addCls:"sb-refresh",handler(){(0,r.getComponent)("admin-services-list").reload()}}],...n&&{groupBy:"group",groupsConfig:n,getGroupRowClass:()=>"group-header-row"},itemActions:{changeStartupType({id:e,name:t,startupType:a}){new r.AjaxPopupForm({cls:"popup-panel",title:t,url:`/admin/services/change-startup-type/id/${encodeURIComponent(e)}/current-startup-type/${a}`,locale:{waitMsg:d.lmsg("waitMessage")}})},start:c.bind(null,"start"),stop:c.bind(null,"stop"),restart:c.bind(null,"restart")},columns:[{header:d.lmsg("nameColumnHeader"),sortable:!1,dataIndex:"name",renderer:({state:e,name:t})=>[(0,r.createElement)("span.tooltipData",d.lmsg(`${e}State`)),(0,r.createElement)("i.icon-"+("active"===e?"on":"off")),` ${t}`]},o?{header:d.lmsg("startupTypeColumnHeader"),sortable:!1,dataIndex:"startupType",renderer:({startupType:e})=>(0,r.createElement)("a",{href:"#","data-action-name":"changeStartupType"},(0,r.createElement)("span.tooltipData",d.lmsg("changeStartupTypeTooltip")),d.lmsg(`${e}StartupType`))}:null,{header:"",sortable:!1,dataIndex:"status",cls:"action-icon-set t-r",renderer:({state:e,status:t})=>["start","stop","restart"].map((a=>{let s,n;return["notInstalled","notConfigured"].includes(e)?(s=d.lmsg("serviceDisabled"),n=!0):(s=d.lmsg(t+a.capitalize()),n="running"===t?"start"===a:"start"!==a),(0,r.createElement)("span",(0,r.createElement)("span.tooltipData",s),(0,r.createElement)("a"+(n?".disabled":""),n?{}:{"data-action-name":a},(0,r.createElement)(`i.icon-${a}`)))}))}].filter(Boolean)})]})));u.propTypes={data:o().object.isRequired,searchFilters:o().object.isRequired,dataUrl:o().string.isRequired,groupsDescriptions:o().array,showStartupTypeColumn:o().bool.isRequired},u.defaultProps={groupsDescriptions:void 0},t.default=(0,i.withPageLayout)(u)},892:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s.default});var s=a(893)}}]);
//# sourceMappingURL=list.js.map?00e2368bae21d6060a02