DashboardListPage.4edf25537c58e0b7c069.js 3.2 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4074],{3847:(e,a,n)=>{n.r(a),n.d(a,{DashboardListPage:()=>S,default:()=>T});var s=n(36636),o=n(68404),r=n(18745),t=n(94087),l=n(43215),d=n(90923),i=n(33801),c=n(8674),u=n(28659),p=n(49545);var h=n(45704),g=n(40652),f=n(17873),m=n(69783),v=n(61959),x=n(97621),b=n(51189),y=n(71625),j=n(28237),w=n(13407),N=n(45916);const k=o.memo((e=>{var a;let{folder:n}=e;const r=(0,m.useStyles2)(M),{query:t,onQueryChange:l}=(0,y.A)({}),{onKeyDown:i,keyboardEvents:c}=(0,b.A)(),u=null==n?void 0:n.id,p=null==n?void 0:n.canSave,h=n?p:v.Vt.hasEditPermissionInFolders;let[k,C]=(0,g.Z)(x.to,!0);d.config.featureToggles.panelTitleSearch||(k=!1);const{isEditor:S}=v.Vt,[T,Z]=(0,o.useState)(null!==(a=t.query)&&void 0!==a?a:"");return(0,f.Z)((()=>l(T)),200,[T]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:(0,s.cx)(r.actionBar,"page-action-bar"),children:[(0,N.jsx)("div",{className:(0,s.cx)(r.inputWrapper,"gf-form gf-form--grow m-r-2"),children:(0,N.jsx)(m.Input,{value:T,onChange:e=>{e.preventDefault(),Z(e.currentTarget.value)},onKeyDown:i,autoFocus:!0,spellCheck:!1,placeholder:k?"Search for dashboards and panels":"Search for dashboards",className:r.searchInput,suffix:null})}),(0,N.jsx)(w.F,{isEditor:S,canEdit:h||p,folderId:u})]}),(0,N.jsx)(j.Z,{showManage:S||h||p,folderDTO:n,queryText:t.query,onQueryTextChange:e=>{Z(e)},hidePseudoFolders:!0,includePanels:k,setIncludePanels:C,keyboardEvents:c})]})}));k.displayName="ManageDashboardsNew";const C=k,M=e=>({actionBar:s.css`
  2. ${e.breakpoints.down("sm")} {
  3. flex-wrap: wrap;
  4. }
  5. `,inputWrapper:s.css`
  6. ${e.breakpoints.down("sm")} {
  7. margin-right: 0 !important;
  8. }
  9. `,searchInput:s.css`
  10. margin-bottom: 6px;
  11. min-height: ${e.spacing(4)};
  12. `,unsupported:s.css`
  13. padding: 10px;
  14. display: flex;
  15. align-items: center;
  16. justify-content: center;
  17. height: 100%;
  18. font-size: 18px;
  19. `,noResults:s.css`
  20. padding: ${e.v1.spacing.md};
  21. background: ${e.v1.colors.bg2};
  22. font-style: italic;
  23. margin-top: ${e.v1.spacing.md};
  24. `}),S=(0,o.memo)((e=>{var a;let{navModel:n,match:o,location:r}=e;const{loading:c,value:g}=(0,t.Z)((()=>{const e=o.params.uid,a=r.pathname;return e&&a.startsWith("/dashboards")?(e=>u.ae.getFolderByUid(e).then((e=>{const a=(0,p.B)(e);return a.children[0].active=!0,{folder:e,folderNav:a}})))(e).then((e=>{let{folder:a,folderNav:s}=e;const o=l.locationUtil.stripBaseFromUrl(a.url);return o!==r.pathname&&d.locationService.push(o),{folder:a,pageNavModel:Object.assign({},n,{main:s})}})):Promise.resolve({pageNavModel:n})}),[o.params.uid]);return(0,N.jsx)(i.Z,{navModel:null!==(a=null==g?void 0:g.pageNavModel)&&void 0!==a?a:n,children:Boolean(d.config.featureToggles.panelTitleSearch)?(0,N.jsx)(i.Z.Contents,{isLoading:c,className:s.css`
  25. display: flex;
  26. flex-direction: column;
  27. overflow: hidden;
  28. `,children:(0,N.jsx)(C,{folder:null==g?void 0:g.folder})}):(0,N.jsx)(i.Z.Contents,{isLoading:c,children:(0,N.jsx)(h.Z,{folder:null==g?void 0:g.folder})})})}));S.displayName="DashboardListPage";const T=(0,r.connect)((e=>({navModel:(0,c.h)(e.navIndex,"manage-dashboards")})))(S)}}]);
  29. //# sourceMappingURL=DashboardListPage.4edf25537c58e0b7c069.js.map