⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.72
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
build
/
View File Name :
DashboardImport.06e6c4c03113061aae6c.js
"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[2550],{86474:(_,L,t)=>{t.d(L,{E:()=>W});var c=t(32196),e=t(96540),r=t(70255),F=t(32264),E=t(40845),b=t(14578),O=t(50720),N=t(72129),S=t(41394),$=t(25701),v=t(39070),p=t(37390),R=t(55852),g=t(43535),D=t(38928),K=t(57767),G=t(30038);const V={loadingState:v.Gu.Loading,dashboardTitles:[]},l=(0,G.VP)("libraryPanels/delete/searchCompleted"),x=(n=V,h)=>l.match(h)?{...n,dashboardTitles:h.payload.dashboards.map(P=>P.title),loadingState:v.Gu.Done}:n;function j(n){return async function(h){const P=await(0,K.xV)(n.uid);h(l({dashboards:P}))}}const I=({libraryPanel:n,onDismiss:h,onConfirm:P})=>{const M=(0,E.of)(g.o),[{dashboardTitles:J,loadingState:A},H]=(0,e.useReducer)(x,V),Q=(0,e.useMemo)(()=>(0,D.QC)(H),[H]);(0,e.useEffect)(()=>{Q(j(n))},[Q,n]);const X=!!J.length,Y=A===v.Gu.Done;return e.createElement(p.a,{className:M.modal,title:"Delete library panel",icon:"trash-alt",onDismiss:h,isOpen:!0},Y?null:e.createElement(u,null),Y?e.createElement("div",null,X?e.createElement(y,{dashboardTitles:J}):null,X?null:e.createElement(B,null),e.createElement(p.a.ButtonRow,null,e.createElement(R.$n,{variant:"secondary",onClick:h,fill:"outline"},"Cancel"),e.createElement(R.$n,{variant:"destructive",onClick:P,disabled:X},"Delete"))):null)},u=()=>e.createElement("span",null,"Loading library panel..."),B=()=>{const n=(0,E.of)(g.o);return e.createElement("div",{className:n.modalText},"Do you want to delete this panel?")},y=({dashboardTitles:n})=>{const h=(0,E.of)(g.o),P=n.length===1?"dashboard.":"dashboards.",M=`${n.length} ${P}`;return n.length===0?null:e.createElement("div",null,e.createElement("p",{className:h.textInfo},"This library panel can not be deleted because it is connected to ",e.createElement("strong",null,M)," Remove the library panel from the dashboards listed below and retry."),e.createElement("table",{className:h.myTable},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Dashboard name"))),e.createElement("tbody",null,n.map((J,A)=>e.createElement("tr",{key:`dash-title-${A}`},e.createElement("td",null,J))))))},C=({libraryPanel:n,onClick:h,onDelete:P,showSecondaryActions:M})=>{const[J,A]=(0,e.useState)(!1),H=()=>{P?.(n),A(!1)},Q=F.$.panels[n.model.type]??(0,S.$)(n.model.type).meta;return e.createElement(e.Fragment,null,e.createElement($.b,{isCurrent:!1,title:n.name,description:n.description,plugin:Q,onClick:()=>h?.(n),onDelete:M?()=>A(!0):void 0},e.createElement(z,{libraryPanel:n})),J&&e.createElement(I,{libraryPanel:n,onConfirm:H,onDismiss:()=>A(!1)}))},T=({showSecondaryActions:n,rootProps:h})=>{const P=(0,E.of)(ee);return e.createElement($.b.Skeleton,{hasDelete:n,...h},e.createElement(r.A,{containerClassName:P.metaContainer,width:80}))},W=(0,N.j)(C,T);function z({libraryPanel:n}){const h=(0,E.of)(ee);return!n.meta?.folderUid&&!n.meta?.folderName?null:n.meta.folderUid?e.createElement("span",{className:h.metaContainer},e.createElement(O.N,{href:`/dashboards/f/${n.meta.folderUid}`},e.createElement(b.I,{name:"folder-upload",size:"sm"}),e.createElement("span",null,n.meta.folderName))):e.createElement("span",{className:h.metaContainer},e.createElement(b.I,{name:"folder",size:"sm"}),e.createElement("span",null,n.meta.folderName))}function ee(n){return{metaContainer:(0,c.css)({display:"flex",alignItems:"center",color:n.colors.text.secondary,fontSize:n.typography.bodySmall.fontSize,paddingTop:n.spacing(.5),svg:{marginRight:n.spacing(.5),marginBottom:3}})}}},38928:(_,L,t)=>{t.d(L,{IF:()=>K,QC:()=>V,h4:()=>G});var c=t(64423),e=t(65474),r=t(62467),F=t(44240),E=t(39697),b=t(69862),O=t(66847),N=t(69850),S=t(1005),$=t(65961),v=t(67791),p=t(32264),R=t(17706),g=t(57767),D=t(8184);function K(l){const x=(I,u)=>I.id===u.type,j=(I,u)=>{const B=(0,R.A4)();return I.filter(y=>{const C=B.find(T=>x(T,y));return u?!!C?.skipDataQuery:!C?.skipDataQuery})};return function(I){const u=new c.yU,B=(0,e.H)((0,g.dq)({searchString:l.searchString,perPage:l.perPage,page:l.page,excludeUid:l.currentPanelId,sortDirection:l.sortDirection,typeFilter:l.panelFilter,folderFilterUIDs:l.folderFilterUIDs})).pipe((0,b.Z)(y=>{const{elements:C}=y;if(p.$.featureToggles.vizAndWidgetSplit&&l.isWidget!==void 0){const T=j(C,l.isWidget);return(0,r.of)({...y,elements:T})}return(0,r.of)({...y,elements:C})}),(0,b.Z)(({perPage:y,elements:C,page:T,totalCount:W})=>(0,r.of)((0,D.c4)({libraryPanels:C,page:T,perPage:y,totalCount:W}))),(0,O.W)(y=>(console.error(y),(0,r.of)((0,D.c4)({...D.Xb,page:l.page,perPage:l.perPage})))),(0,N.j)(()=>u.unsubscribe()),(0,S.u)());u.add((0,F.h)((0,E.O)(50).pipe((0,$.u)((0,D.d9)()),(0,v.Q)(B)),B).subscribe(I))}}function G(l,x){return async function(j){try{await(0,g.h4)(l),K(x)(j)}catch(I){console.error(I)}}}function V(l){return function(x){return x instanceof Function?x(l):l(x)}}},8184:(_,L,t)=>{t.d(L,{Xb:()=>r,c4:()=>E,d9:()=>F,w_:()=>O,yd:()=>b});var c=t(30038),e=t(39070);const r={loadingState:e.Gu.Loading,libraryPanels:[],totalCount:0,perPage:40,page:1,numberOfPages:0,currentPanelId:void 0},F=(0,c.VP)("libraryPanels/view/initSearch"),E=(0,c.VP)("libraryPanels/view/searchCompleted"),b=(0,c.VP)("libraryPanels/view/changePage"),O=(N,S)=>{if(F.match(S))return{...N,loadingState:e.Gu.Loading};if(E.match(S)){const{libraryPanels:$,page:v,perPage:p,totalCount:R}=S.payload,g=Math.ceil(R/p);return{...N,libraryPanels:$,perPage:p,totalCount:R,loadingState:e.Gu.Done,numberOfPages:g,page:v>g?v-1:v}}return b.match(S)?{...N,page:S.payload.page}:N}},43535:(_,L,t)=>{t.d(L,{o:()=>e});var c=t(32196);function e(r){return{myTable:(0,c.css)` max-height: 204px; overflow-y: auto; margin-top: 11px; margin-bottom: 28px; border-radius: ${r.shape.radius.default}; border: 1px solid ${r.colors.action.hover}; background: ${r.colors.background.primary}; color: ${r.colors.text.secondary}; font-size: ${r.typography.h6.fontSize}; width: 100%; thead { color: #538ade; font-size: ${r.typography.bodySmall.fontSize}; } th, td { padding: 6px 13px; height: ${r.spacing(4)}; } tbody > tr:nth-child(odd) { background: ${r.colors.background.secondary}; } `,noteTextbox:(0,c.css)` margin-bottom: ${r.spacing(4)}; `,textInfo:(0,c.css)` color: ${r.colors.text.secondary}; font-size: ${r.typography.size.sm}; `,dashboardSearch:(0,c.css)` margin-top: ${r.spacing(2)}; `,modal:(0,c.css)` width: 500px; `,modalText:(0,c.css)` font-size: ${r.typography.h4.fontSize}; color: ${r.colors.text.primary}; margin-bottom: ${r.spacing(4)}; padding-top: ${r.spacing(2)}; `}}},23390:(_,L,t)=>{t.r(L),t.d(L,{default:()=>xe});var c=t(32196),e=t(96540),r=t(69733),F=t(26272),E=t(39070),b=t(13544),O=t(14110),N=t(32264),S=t(72109),$=t(37270),v=t(51253),p=t(88575),R=t(60029),g=t(10354),D=t(55852),K=t(21744),G=t(66864),V=t(62930),l=t(40845),x=t(3911),j=t(28138),I=t(36830),u=t(44836),B=t(97007),y=t(72724),C=t(12131),T=t(17408),W=t(11230),z=t(88264),ee=t(26657),n=t(16504),h=t(85242),P=t(51612),M=t(72635),J=t(17172),A=t(71500);const H=o=>{let a;try{a=JSON.parse(o)}catch{return(0,M.t)("dashboard.validation.invalid-json","Not valid JSON")}if(a&&a.hasOwnProperty("tags"))if(Array.isArray(a.tags)){if(a.tags.some(d=>typeof d!="string"))return(0,M.t)("dashboard.validation.tags-expected-strings","tags expected array of strings")}else return(0,M.t)("dashboard.validation.tags-expected-array","tags expected array");return!0},Q=o=>{const a=/(^\d+$)|dashboards\/(\d+)/.exec(o);return a&&(a[1]||a[2])?!0:(0,M.t)("dashboard.validation.invalid-dashboard-id","Could not find a valid Grafana.com ID")},X=(o,a)=>A.P.validateNewDashboardName(a,o).then(()=>!0).catch(f=>{if(f.type==="EXISTING")return f.message}),Y=o=>(0,J.AI)().get(`/api/dashboards/uid/${o}`).then(a=>`Dashboard named '${a?.dashboard.title}' in folder '${a?.meta.folderTitle}' has the same UID`).catch(a=>(a.isHandled=!0,!0));var ie=t(86474);function re({inputs:o,label:a,description:f,folderName:d}){const s=(0,l.of)(ce);return o?.length?e.createElement("div",{className:s.spacer},e.createElement(p.D,{label:a,description:f},e.createElement(e.Fragment,null,o.map((i,Z)=>{const w=`elements[${Z}]`,k=i.state===z.J7.New?{...i.model,meta:{...i.model.meta,folderName:d??"General"}}:{...i.model};return e.createElement("div",{className:s.item,key:w},e.createElement(ie.E,{libraryPanel:k,onClick:()=>{}}))})))):null}function ce(o){return{spacer:(0,c.css)` margin-bottom: ${o.spacing(2)}; `,item:(0,c.css)` margin-bottom: ${o.spacing(1)}; `}}const me=({register:o,errors:a,control:f,getValues:d,uidReset:s,inputs:i,initialFolderUid:Z,onUidReset:w,onCancel:k,onSubmit:te,watch:ae})=>{const[ne,Le]=(0,e.useState)(!1),Oe=ae("dataSources"),de=ae("folder");(0,e.useEffect)(()=>{ne&&(a.title||a.uid)&&te(d())},[a,d,ne,te]);const Ne=i?.libraryPanels?.filter(m=>m.state===z.J7.New)??[],Te=i?.libraryPanels?.filter(m=>m.state===z.J7.Exists)??[];return e.createElement(e.Fragment,null,e.createElement(T.s,null,"Options"),e.createElement(p.D,{label:"Name",invalid:!!a.title,error:a.title&&a.title.message},e.createElement(g.p,{...o("title",{required:"Name is required",validate:async m=>await X(m,d().folder.uid)}),type:"text","data-testid":b.Tp.components.ImportDashboardForm.name})),e.createElement(p.D,{label:"Folder"},e.createElement(n.e,{render:({field:{ref:m,...U}})=>e.createElement(h.sR,{...U,enableCreateNew:!0,initialFolderUid:Z}),name:"folder",control:f})),e.createElement(p.D,{label:"Unique identifier (UID)",description:`The unique identifier (UID) of a dashboard can be used for uniquely identify a dashboard between multiple Grafana installs. The UID allows having consistent URLs for accessing dashboards so changing the title of a dashboard will not break any bookmarked links to that dashboard.`,invalid:!!a.uid,error:a.uid&&a.uid.message},e.createElement(e.Fragment,null,s?e.createElement(g.p,{...o("uid",{required:!0,validate:async m=>await Y(m)})}):e.createElement(g.p,{disabled:!0,...o("uid",{validate:async m=>await Y(m)}),addonAfter:!s&&e.createElement(D.$n,{onClick:w},"Change uid")}))),i.dataSources&&i.dataSources.map((m,U)=>{if(m.pluginId===ee.dR.type)return null;const q=`dataSources.${U}`,Me=Oe??[];return e.createElement(p.D,{label:m.label,description:m.description,key:q,invalid:a.dataSources&&!!a.dataSources[U],error:a.dataSources&&a.dataSources[U]&&"A data source is required"},e.createElement(n.e,{name:q,render:({field:{ref:$e,...Ue}})=>e.createElement(P.s,{...Ue,noDefault:!0,placeholder:m.info,pluginId:m.pluginId,current:Me[U]?.uid}),control:f,rules:{required:!0}}))}),i.constants&&i.constants.map((m,U)=>{const q=`constants.${U}`;return e.createElement(p.D,{label:m.label,error:a.constants&&a.constants[U]&&`${m.label} needs a value`,invalid:a.constants&&!!a.constants[U],key:q},e.createElement(g.p,{...o(q,{required:!0}),defaultValue:m.value}))}),e.createElement(re,{inputs:Ne,label:"New library panels",description:"List of new library panels that will get imported.",folderName:de.title}),e.createElement(re,{inputs:Te,label:"Existing library panels",description:"List of existing library panels. These panels are not affected by the import.",folderName:de.title}),e.createElement(G.Gy,null,e.createElement(D.$n,{type:"submit","data-testid":b.Tp.components.ImportDashboardForm.submit,variant:ue(a),onClick:()=>{Le(!0)}},he(a)),e.createElement(D.$n,{type:"reset",variant:"secondary",onClick:k},"Cancel")))};function ue(o){return o&&(o.title||o.uid)?"destructive":"primary"}function he(o){return o&&(o.title||o.uid)?"Import (Overwrite)":"Import"}const pe="dashboard_import_imported",fe=o=>{const a=C.Ny.getSearchObject();return{dashboard:o.importDashboard.dashboard,meta:o.importDashboard.meta,source:o.importDashboard.source,inputs:o.importDashboard.inputs,folder:a.folderUid?{uid:String(a.folderUid)}:{uid:""}}},Ee={clearLoadedDashboard:W.FG,importDashboard:W.Q9},ge=(0,r.connect)(fe,Ee);class be extends e.PureComponent{constructor(){super(...arguments),this.state={uidReset:!1},this.onSubmit=a=>{(0,O.rR)(pe),this.props.importDashboard(a)},this.onCancel=()=>{this.props.clearLoadedDashboard()},this.onUidReset=()=>{this.setState({uidReset:!0})}}render(){const{dashboard:a,inputs:f,meta:d,source:s,folder:i}=this.props,{uidReset:Z}=this.state;return e.createElement(e.Fragment,null,s===z.qx.Gcom&&e.createElement("div",{style:{marginBottom:"24px"}},e.createElement("div",null,e.createElement(T.s,null,"Importing dashboard from"," ",e.createElement("a",{href:`https://grafana.com/dashboards/${a.gnetId}`,className:"external-link",target:"_blank",rel:"noreferrer"},"Grafana.com"))),e.createElement("table",{className:"filter-table form-inline"},e.createElement("tbody",null,e.createElement("tr",null,e.createElement("td",null,"Published by"),e.createElement("td",null,d.orgName)),e.createElement("tr",null,e.createElement("td",null,"Updated on"),e.createElement("td",null,(0,y.LE)(d.updatedAt)))))),e.createElement(v.l,{onSubmit:this.onSubmit,defaultValues:{...a,constants:[],dataSources:[],elements:[],folder:i},validateOnMount:!0,validateFieldsOnMount:["title","uid"],validateOn:"onChange"},({register:w,errors:k,control:te,watch:ae,getValues:ne})=>e.createElement(me,{register:w,errors:k,control:te,getValues:ne,uidReset:Z,inputs:f,onCancel:this.onCancel,onUidReset:this.onUidReset,onSubmit:this.onSubmit,watch:ae,initialFolderUid:i.uid})))}}const se=ge(be);se.displayName="ImportDashboardOverview";const oe="dashboard_import_loaded",ve=`{ "title": "Example - Repeating Dictionary variables", "uid": "_0HnEoN4z", "panels": [...] ... } `,De=o=>({loadingState:o.importDashboard.state}),ye={fetchGcomDashboard:W.rw,importDashboardJson:W.iP,cleanUpAction:B.N},Pe=(0,r.connect)(De,ye);class Ie extends e.PureComponent{constructor(a){super(a),this.fileListRenderer=(d,s)=>null,this.onFileUpload=d=>{(0,O.rR)(oe,{import_source:"json_uploaded"});try{this.props.importDashboardJson(JSON.parse(String(d)))}catch(s){s instanceof Error&&j.A.emit(F.r1.alertError,["Import failed","JSON -> JS Serialization failed: "+s.message]);return}},this.getDashboardFromJson=d=>{(0,O.rR)(oe,{import_source:"json_pasted"}),this.props.importDashboardJson(JSON.parse(d.dashboardJson))},this.getGcomDashboard=d=>{(0,O.rR)(oe,{import_source:"gcom"});let s;const i=/(^\d+$)|dashboards\/(\d+)/.exec(d.gcomDashboard);i&&i[1]?s=i[1]:i&&i[2]&&(s=i[2]),s&&this.props.fetchGcomDashboard(s)},this.pageNav={text:"Import dashboard",subTitle:"Import dashboard from file or Grafana.com"};const{gcomDashboardId:f}=this.props.queryParams;if(f){this.getGcomDashboard({gcomDashboard:f});return}}componentWillUnmount(){this.props.cleanUpAction({cleanupAction:a=>a.importDashboard=z.V9})}renderImportForm(){const a=Ce(this.props.theme),f=()=>e.createElement(S.Y,{variant:"bodySmall",href:"https://grafana.com/grafana/dashboards/",external:!0},"grafana.com/dashboards");return e.createElement(e.Fragment,null,e.createElement("div",{className:a.option},e.createElement($.gH,{options:{multiple:!1,accept:[".json",".txt"]},readAs:"readAsText",fileListRenderer:this.fileListRenderer,onLoad:this.onFileUpload},e.createElement($.wI,{primaryText:(0,u.t)("dashboard-import.file-dropzone.primary-text","Upload dashboard JSON file"),secondaryText:(0,u.t)("dashboard-import.file-dropzone.secondary-text","Drag and drop here or click to browse")}))),e.createElement("div",{className:a.option},e.createElement(v.l,{onSubmit:this.getGcomDashboard,defaultValues:{gcomDashboard:""}},({register:d,errors:s})=>e.createElement(p.D,{label:e.createElement(R.J,{className:a.labelWithLink,htmlFor:"url-input"},e.createElement("span",null,e.createElement(u.x6,{i18nKey:"dashboard-import.gcom-field.label"},"Find and import dashboards for common applications at ",e.createElement(f,null)))),invalid:!!s.gcomDashboard,error:s.gcomDashboard&&s.gcomDashboard.message},e.createElement(g.p,{id:"url-input",placeholder:(0,u.t)("dashboard-import.gcom-field.placeholder","Grafana.com dashboard URL or ID"),type:"text",...d("gcomDashboard",{required:(0,u.t)("dashboard-import.gcom-field.validation-required","A Grafana dashboard URL or ID is required"),validate:Q}),addonAfter:e.createElement(D.$n,{type:"submit"},e.createElement(u.x6,{i18nKey:"dashboard-import.gcom-field.load-button"},"Load"))})))),e.createElement("div",{className:a.option},e.createElement(v.l,{onSubmit:this.getDashboardFromJson,defaultValues:{dashboardJson:""}},({register:d,errors:s})=>e.createElement(e.Fragment,null,e.createElement(p.D,{label:(0,u.t)("dashboard-import.json-field.label","Import via dashboard JSON model"),invalid:!!s.dashboardJson,error:s.dashboardJson&&s.dashboardJson.message},e.createElement(K.f,{...d("dashboardJson",{required:(0,u.t)("dashboard-import.json-field.validation-required","Need a dashboard JSON model"),validate:H}),"data-testid":b.Tp.components.DashboardImportPage.textarea,id:"dashboard-json-textarea",rows:10,placeholder:ve})),e.createElement(G.Gy,null,e.createElement(D.$n,{type:"submit","data-testid":b.Tp.components.DashboardImportPage.submit},e.createElement(u.x6,{i18nKey:"dashboard-import.form-actions.load"},"Load")),e.createElement(D.z9,{variant:"secondary",href:`${N.$.appSubUrl}/dashboards`},e.createElement(u.x6,{i18nKey:"dashboard-import.form-actions.cancel"},"Cancel")))))))}render(){const{loadingState:a}=this.props;return e.createElement(I.Y,{navId:"dashboards/browse",pageNav:this.pageNav},e.createElement(I.Y.Contents,null,a===E.Gu.Loading&&e.createElement(G.gW,{justify:"center"},e.createElement(G.Gy,{justify:"center"},e.createElement(V.y,{size:"xxl"}))),[E.Gu.Error,E.Gu.NotStarted].includes(a)&&this.renderImportForm(),a===E.Gu.Done&&e.createElement(se,null)))}}const Se=(0,l.cV)(Ie),le=Pe(Se);le.displayName="DashboardImport";const xe=le,Ce=(0,x.N)(o=>({option:(0,c.css)` margin-bottom: ${o.spacing(4)}; max-width: 600px; `,labelWithLink:(0,c.css)` max-width: 100%; `,linkWithinLabel:(0,c.css)` font-size: inherit; `}))}}]); //# sourceMappingURL=DashboardImport.06e6c4c03113061aae6c.js.map