Linux ip-172-26-2-223 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64
Apache
: 172.26.2.223 | : 3.12.123.254
Cant Read [ /etc/named.conf ]
8.1.13
www
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
snap /
lxd /
33246 /
share /
lxd-ui /
assets /
[ HOME SHELL ]
Name
Size
Permission
Action
font
[ DIR ]
drwxr-xr-x
img
[ DIR ]
drwxr-xr-x
js
[ DIR ]
drwxr-xr-x
scripts
[ DIR ]
drwxr-xr-x
AutoExpandingTextArea-BXFyAEiG...
151
B
-rw-r--r--
BaseLayout-CiF2D8RH.js
280
B
-rw-r--r--
BulkDeleteButton-B-fvVwh0.js
1.08
KB
-rw-r--r--
CancelOperationBtn-BW2TAzI_.js
1.08
KB
-rw-r--r--
CertificateAdd-BGVwf-VB.js
2.84
KB
-rw-r--r--
CertificateGenerate-bNGS6BFl.j...
9.87
KB
-rw-r--r--
ClusterGroupForm-BiXmM-NU.js
3.25
KB
-rw-r--r--
ClusterList-CZFDB46f.js
5.17
KB
-rw-r--r--
ClusterMemberSelector-B2lzDpCI...
3.71
KB
-rw-r--r--
ClusterSpecificInput-BdiLVA9B....
1.97
KB
-rw-r--r--
ClusterSpecificSelect-DrKUzNev...
2.2
KB
-rw-r--r--
ConfigFieldDescription-BnRkdbo...
335
B
-rw-r--r--
CreateClusterGroup-C6s3qbZf.js
463
B
-rw-r--r--
CreateInstance-BXX4Xa4W.js
27.97
KB
-rw-r--r--
CreateInstanceFromImageBtn-BiE...
527
B
-rw-r--r--
CreateNetwork-BQw2A27w.js
2.88
KB
-rw-r--r--
CreateNetworkForward-BgZF8duA....
1.71
KB
-rw-r--r--
CreateProfile-CCJYKSCK.js
4.04
KB
-rw-r--r--
CreateProject-DTBqJzUb.js
2.83
KB
-rw-r--r--
CreateStoragePool-CuOutvs3.js
2.46
KB
-rw-r--r--
CreateStorageVolume-B0HvyGnH.j...
2.47
KB
-rw-r--r--
CustomIsoList-CQVv4whx.js
5.48
KB
-rw-r--r--
DeleteStoragePoolBtn-BeXLuEnA....
1.62
KB
-rw-r--r--
DeleteStorageVolumeBtn-DIIVYGa...
1.88
KB
-rw-r--r--
DiskSizeSelector-IT5APek6.js
1010
B
-rw-r--r--
EditClusterGroup-DiNIL0Lx.js
761
B
-rw-r--r--
EditNetworkForward-DtcWepYC.js
1.99
KB
-rw-r--r--
ExpandableList-EDeaeb6c.js
323
B
-rw-r--r--
FormEditButton-Cs2eW7Js.js
278
B
-rw-r--r--
FormFooterLayout-B3kcadYt.js
738
B
-rw-r--r--
FormLink-BaU-zsbe.js
879
B
-rw-r--r--
FormMenuItem-ChXfQsFA.js
2.23
MB
-rw-r--r--
FormMenuItem-DyX1CsEw.css
66.66
KB
-rw-r--r--
GroupOrIdentityChangesTable-DQ...
5.11
KB
-rw-r--r--
GroupSelectionActions-Dq47oQd-...
3.18
KB
-rw-r--r--
HelpLink-4LTOsqZO.js
294
B
-rw-r--r--
ImageList-yKBGTFZU.js
11.7
KB
-rw-r--r--
InstanceDetail-BV9hr65t.js
481.49
KB
-rw-r--r--
InstanceDetail-Beg8tuEN.css
3.88
KB
-rw-r--r--
InstanceLinkChip-DfVC8U01.js
4.24
KB
-rw-r--r--
InstanceList-CTEYE5e7.js
24.67
KB
-rw-r--r--
ItemName-DSOx0T0r.js
185
B
-rw-r--r--
Login-CsUYa7ns.js
1.41
KB
-rw-r--r--
Meter-BsdJ73XW.js
487
B
-rw-r--r--
NetworkDetail-RgSS_6Vw.js
12.8
KB
-rw-r--r--
NetworkForwardForm-C18aehvo.js
6.49
KB
-rw-r--r--
NetworkList-B4gWmGGm.js
6.32
KB
-rw-r--r--
NetworkListTable-Ba2LzF-J.js
3.31
KB
-rw-r--r--
NotificationRow-CotZPNAQ.js
157
B
-rw-r--r--
OperationList-D4--05cO.js
3.35
KB
-rw-r--r--
PageHeader-CExPjRLH.js
549
B
-rw-r--r--
PermissionGroups-CkGxgQmn.js
30.89
KB
-rw-r--r--
PermissionIdentities-DDmb7V-C....
12.93
KB
-rw-r--r--
PermissionIdpGroups-yggiVbcG.j...
13.38
KB
-rw-r--r--
ProfileDetail-CQHhNWwW.js
10.94
KB
-rw-r--r--
ProfileDetailsForm-C-rMcUGO.js
2.45
KB
-rw-r--r--
ProfileInstances-DeravO8Q.js
1.46
KB
-rw-r--r--
ProfileList-C7yC3g6E.js
7.11
KB
-rw-r--r--
ProgressBar-CQ2HKUqQ.js
170
B
-rw-r--r--
ProjectConfiguration-rKP8dZtz....
9.04
KB
-rw-r--r--
ProjectForm-GhClr0iv.js
15.12
KB
-rw-r--r--
ProtectedRoute-DYKGChU3.js
214
B
-rw-r--r--
ProxyDeviceForm-B5UDgi1V.js
38.9
KB
-rw-r--r--
RenameHeader-fmgiouA6.js
13.29
KB
-rw-r--r--
ResourceIcon-DZQOrBLA.js
532
B
-rw-r--r--
ResourceLabel-PzB_6v5p.js
317
B
-rw-r--r--
ResourceLink-CS7mH0C3.js
302
B
-rw-r--r--
ScrollableContainer-MJpEXCww.j...
646
B
-rw-r--r--
ScrollableTable-DWT33Lms.js
561
B
-rw-r--r--
SelectableMainTable-C8l8QdDe.j...
2.21
KB
-rw-r--r--
SelectedTableNotification-2DZb...
974
B
-rw-r--r--
Settings-BYi8qROs.js
9.75
KB
-rw-r--r--
SidePanel-DNeaRMst.js
2.84
KB
-rw-r--r--
SnapshotForm-DF9sGEzn.js
1.49
KB
-rw-r--r--
StoragePoolDetail-DT58PBIr.js
6.45
KB
-rw-r--r--
StoragePoolForm-Z62B6Fuh.js
17.07
KB
-rw-r--r--
StoragePoolSelectTable-CXuxJSN...
1.61
KB
-rw-r--r--
StoragePoolSelector-DEvMjaMu.j...
1.48
KB
-rw-r--r--
StoragePoolSize-DyBNKBKy.js
467
B
-rw-r--r--
StoragePools-DK0Gkjq9.js
3.99
KB
-rw-r--r--
StorageUsedBy-sdKGRlgM.js
2.12
KB
-rw-r--r--
StorageVolumeDetail-fQzbPWNW.j...
24.87
KB
-rw-r--r--
StorageVolumeForm-ZPfwK39D.js
8.42
KB
-rw-r--r--
StorageVolumes-DPotlIN6.js
7.26
KB
-rw-r--r--
StorageVolumesFilter-B7pR3OeF....
1.01
KB
-rw-r--r--
TabLinks-BIG_Rdvk.js
360
B
-rw-r--r--
UploadCustomIso-DG12FhN0.js
2.83
KB
-rw-r--r--
UsedByItem-VHA3kVFG.js
945
B
-rw-r--r--
VolumeAddSnapshotBtn-8Qz9xFE-....
4.87
KB
-rw-r--r--
WarningList-DZNTQSpg.js
1.99
KB
-rw-r--r--
YamlNotification-BnmI52ws.js
634
B
-rw-r--r--
YamlSwitch-BXLuxWUh.js
40.62
KB
-rw-r--r--
certificate-kcThcTS9.js
279.99
KB
-rw-r--r--
clusterGroups-BWQNdGSD.js
3.63
KB
-rw-r--r--
images-Du2fhDUO.js
1.22
KB
-rw-r--r--
index-BeIaaTgz.css
661.94
KB
-rw-r--r--
index-BkTFFYvy.js
690.52
KB
-rw-r--r--
index-DW_MHI2K.js
34.19
KB
-rw-r--r--
index.esm-auJ3G_FM.js
38.36
KB
-rw-r--r--
instanceDelete-Bn3xn_NE.js
12.2
KB
-rw-r--r--
instanceOptions-BuFjjn-P.js
1.19
KB
-rw-r--r--
network-forwards-B-h1Yzp9.js
856
B
-rw-r--r--
operations-DIvBacJG.js
757
B
-rw-r--r--
projects-CvA2zMPN.js
789
B
-rw-r--r--
scroll-DPmbgfny.js
26.97
KB
-rw-r--r--
searchAndFilter-DtC_P-vv.js
361
B
-rw-r--r--
snapshots-CEDJtMaf.js
670
B
-rw-r--r--
storage-volumes-tfXkh9eB.js
2.46
KB
-rw-r--r--
useGroups-CCX3qCzO.js
2.91
KB
-rw-r--r--
useImages-LgCYWVgs.js
1.64
KB
-rw-r--r--
useNetworks-D3nHf8AE.js
3.63
KB
-rw-r--r--
useSmallScreen-BvsjT919.js
169
B
-rw-r--r--
useSortTableData-BoXaK1oA.js
393
B
-rw-r--r--
useVolumes-BvpfNVaA.js
1.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : InstanceList-CTEYE5e7.js
import{ak as Fe,j as e,d as h,y as _,a5 as I,aq as Ce,r as $,ar as Je,x as Te,k as Ee,l as Pe,as as Ze,a6 as Re,at as Ge,q as ce,au as Be,p as pe,s as De,f as xe,av as Xe,al as et,e as O,a8 as he,n as tt,w as st,B as ye,g as nt,C as at,L as lt,aw as we,ao as it,ax as rt}from"./index-BkTFFYvy.js";import{u as Ae,S as Y,p as ot}from"./SidePanel-DNeaRMst.js";import{i as Me}from"./instanceOptions-BuFjjn-P.js";import{c as ze,C as Ie,f as ct,b as $e,i as dt,h as Oe,e as ut,I as ht,a as mt}from"./instanceDelete-Bn3xn_NE.js";import{I as _e,C as pt}from"./CancelOperationBtn-BW2TAzI_.js";import{S as ke}from"./SelectableMainTable-C8l8QdDe.js";import{k as xt,l as gt}from"./InstanceLinkChip-DfVC8U01.js";import{B as jt}from"./BulkDeleteButton-B-fvVwh0.js";import{s as ft,p as bt}from"./searchAndFilter-DtC_P-vv.js";import{g as me}from"./operations-DIvBacJG.js";import{S as Nt}from"./ScrollableTable-DWT33Lms.js";import{N as St}from"./NotificationRow-CotZPNAQ.js";import{S as Ct}from"./SelectedTableNotification-2DZbBMZx.js";import{H as yt}from"./HelpLink-4LTOsqZO.js";import{u as wt}from"./useSortTableData-BoXaK1oA.js";import{P as ne}from"./PageHeader-CExPjRLH.js";import{I as It}from"./ItemName-DSOx0T0r.js";import{u as $t}from"./useSmallScreen-BvsjT919.js";import{u as kt}from"./projects-CvA2zMPN.js";import"./Meter-BsdJ73XW.js";import"./ExpandableList-EDeaeb6c.js";import"./index-DW_MHI2K.js";import"./ResourceLink-CS7mH0C3.js";import"./ResourceIcon-DZQOrBLA.js";const He=({instance:t})=>{const m=Fe().getType(t),r=n=>({Error:"status-failed-small",Frozen:"status-in-progress-small",Freezing:"spinner",Ready:"status-waiting-small",Running:"status-succeeded-small",Stopped:"status-queued-small"})[n]??"";return m?e.jsxs(e.Fragment,{children:[e.jsx(h.Icon,{className:"u-animation--spin status-icon",name:"spinner"}),e.jsx("i",{children:m})]}):e.jsxs(e.Fragment,{children:[e.jsx(h.Icon,{name:r(t.status),className:_("status-icon",{"u-animation--spin":t.status==="Freezing"})}),t.status]})},vt=({className:t,columns:d,hidden:m,sizeHidden:r,setHidden:n})=>{const l=d.length-m.length,N=o=>{m.includes(o)?n(m.filter(i=>i!==o)):n([...m,o])},u=(o,i)=>r.includes(i)?e.jsx(h.Tooltip,{message:e.jsxs(e.Fragment,{children:["Screen is too narrow to fit the column.",e.jsx("br",{}),"Disable columns above or use a bigger screen."]}),position:"left",children:o}):o;return e.jsx(h.ContextualMenu,{className:_(t,"configurable-table-toggle"),dropdownProps:{"aria-label":"columns menu"},position:"right",toggleClassName:"has-icon",toggleProps:{"aria-label":"Columns selection toggle"},toggleLabel:e.jsx(h.Icon,{name:"settings"}),toggleAppearance:"base",title:"Columns",children:e.jsxs("div",{className:"table-column-select-list",children:[e.jsx(h.CheckboxInput,{checked:m.length===0,indeterminate:l>0&&l<d.length,label:`${l} out of ${d.length} columns selected`,onChange:()=>{m.length>0?n([]):n(d)}}),e.jsx("hr",{}),d.map(o=>e.jsx("div",{children:u(e.jsx(h.CheckboxInput,{"aria-label":o,checked:!m.includes(o),label:o,onChange:()=>{N(o)},disabled:r.includes(o)}),o)},o))]})})},re=({action:t,confirmAppearance:d,confirmExtra:m,confirmLabel:r,icon:n,instances:l,isLoading:N,isDisabled:u,onClick:o,restrictedInstances:i})=>{const S=new Set(l.map(g=>g.status)),T=S.size>1,p=T?e.jsxs(e.Fragment,{children:[e.jsx("b",{children:l.length})," ",I("instance",l.length)," ","selected:",e.jsx("br",{}),e.jsx("br",{})]}):null,j=[...S].some(g=>Ce(t,g)!==void 0),v=(g,y)=>{const w=l.filter(Q=>Q.status===g&&!i.includes(Q.name)).length;if(w===0)return null;const D=Je(g)??"";if(Ce(y,g)===void 0){const Q=w===1?"instance that is":"instances that are",ge=y!=="restart"?"already ":"";return e.jsxs($.Fragment,{children:["- No action for ",e.jsx("b",{children:w})," ",Q," ",ge,g.toLowerCase(),".",e.jsx("br",{})]},g+y)}const G=T?"- ":"";return e.jsxs($.Fragment,{children:[G,"This will ",y," ",e.jsx("b",{children:w}),` ${D} ${I("instance",w)}.`,e.jsx("br",{})]},g+y)},f=()=>{switch(t){case"start":return["Frozen","Stopped","Running"];case"restart":return["Running","Freezing","Stopped","Frozen"];case"freeze":return["Running","Stopped","Frozen"];case"stop":return["Frozen","Freezing","Running","Starting","Stopped"];default:return[]}},B=i.length===l.length,c=()=>i.length===0?null:e.jsxs($.Fragment,{children:["- No action for ",e.jsx("b",{children:i.length})," ",I("instance",i.length)," that you do not have permission to ",r.toLowerCase(),".",e.jsx("br",{})]},"restricted");return e.jsxs(h.ConfirmationButton,{appearance:"base",disabled:u||!j||B,loading:N,className:"u-no-margin--right u-no-margin--bottom bulk-action has-icon",confirmationModalProps:{title:`Confirm ${r.toLowerCase()}`,children:e.jsxs("p",{children:[p,f().map(g=>v(g,t)),c()]}),confirmExtra:m,onConfirm:o,confirmButtonLabel:r,confirmButtonAppearance:d},shiftClickEnabled:!0,showShiftClickHint:!0,onHoverText:B?`You do not have permission to ${r.toLowerCase()} the selected ${I("instance",l.length)}`:r,children:[e.jsx(h.Icon,{name:n}),e.jsx("span",{children:r})]})},Lt=({instances:t,onStart:d,onFinish:m})=>{const r=Te(),n=Ee(),l=Pe(),[N,u]=$.useState(null),[o,i]=$.useState(!1),{canUpdateInstanceState:S}=ze(),T=()=>{l.invalidateQueries({queryKey:[ce.instances]})},p=()=>{setTimeout(T,1500)},j=f=>{u(f),d();const B=t.filter(S),c=Ze(B,f);xt(c,o,r).then(g=>{const y=Ge(f),w=c.length,{fulfilledCount:D,rejectedCount:k}=Re(g);D===w?(n.success(e.jsxs(e.Fragment,{children:[e.jsx("b",{children:w})," ",I("instance",w)," ",y,"."]})),T()):k===w?(n.failure(`Instance ${f} failed`,void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:w})," ",I("instance",w)," could not be"," ",y,"."]})),p()):(n.failure(`Instance ${f} partially failed`,void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:D})," ",I("instance",D)," ",y,".",e.jsx("br",{}),e.jsx("b",{children:k})," ",I("instance",k)," ","could not be ",y,"."]})),p()),i(!1),m(),u(null)}).catch(g=>{n.failure(`Instance ${f} failed`,g),p()})},v=t.filter(f=>!S(f)).map(f=>f.name);return e.jsx("div",{className:"p-segmented-control bulk-actions",children:e.jsxs("div",{className:"p-segmented-control__list bulk-action-frame",children:[e.jsx(re,{icon:"play",isLoading:N==="start",isDisabled:N==="start",onClick:()=>{j("start")},confirmAppearance:"positive",action:"start",instances:t,confirmLabel:"Start",restrictedInstances:v}),e.jsx(re,{icon:"restart",isLoading:N==="restart",isDisabled:N==="restart",onClick:()=>{j("restart")},action:"restart",instances:t,confirmLabel:"Restart",confirmExtra:e.jsx(Ie,{label:"Force restart",force:[o,i]}),restrictedInstances:v}),e.jsx(re,{icon:"pause",isLoading:N==="freeze",isDisabled:N==="freeze",onClick:()=>{j("freeze")},action:"freeze",instances:t,confirmLabel:"Freeze",restrictedInstances:v}),e.jsx(re,{icon:"stop",isLoading:N==="stop",isDisabled:!1,onClick:()=>{j("stop")},action:"stop",instances:t,confirmLabel:"Stop",confirmExtra:e.jsx(Ie,{label:"Force stop",force:[o,i]}),restrictedInstances:v})]})})},Ft=({instances:t,onStart:d,onFinish:m})=>{const r=Te(),n=Ee(),l=Pe(),[N,u]=$.useState(!1),{canDeleteInstance:o}=ze(),i=t.filter(c=>!o(c)),S=t.filter(c=>ct.includes(c.status)&&o(c)),T=t.length,p=S.length,j=i.length,v=T-p-j,f=()=>{u(!0),d(S.map(c=>c.name)),gt(S,r).then(c=>{const{fulfilledCount:g,rejectedCount:y}=Re(c);g===p?n.success(`${p} ${I("instance",p)} deleted`):y===p?n.failure("Instance bulk deletion failed",void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:p})," ",I("instance",p)," could not be deleted."]})):n.failure("Instance bulk deletion partially failed",void 0,e.jsxs(e.Fragment,{children:[e.jsx("b",{children:g})," ",I("instance",g)," ","deleted.",e.jsx("br",{}),e.jsx("b",{children:y})," ",I("instance",y)," ","could not be deleted."]})),l.invalidateQueries({queryKey:[ce.instances]}),l.invalidateQueries({queryKey:[ce.projects,t[0].project]}),u(!1),m()}).catch(c=>{n.failure("Instance bulk deletion failed",c),u(!1)})},B=()=>{if(v+j===0)return;const c=[];return p&&c.push(`${p} stopped ${I("instance",p)} will be deleted`),j&&c.push(`${j} ${I("instance",j)} that you do not have permission to delete will be ignored`),v&&c.push(`${v} other ${I("instance",v)} will be ignored`),c};return e.jsx("div",{className:"p-segmented-control bulk-actions",children:e.jsx("div",{className:"p-segmented-control__list bulk-action-frame",children:e.jsx(jt,{entities:t,deletableEntities:S,entityType:"instance",onDelete:f,disabledReason:j===T?`You do not have permission to delete the selected ${I("instance",t.length)}`:void 0,confirmationButtonProps:{loading:N,appearance:"base"},bulkDeleteBreakdown:B(),className:"u-no-margin--bottom"})})})},Tt=["Running","Stopped","Frozen","Error"],Et=["Container","VM"],Pt=t=>(t.includes("Frozen")&&t.push("Freezing"),t.includes("Running")&&t.push("Restarting","Starting"),t.includes("Stopped")&&t.push("Stopping"),t),Rt="query",Ue="status",qe="type",Ke="profile",Qe="member",ve=[Rt,Ue,qe,Ke,Qe],Bt=({instances:t})=>{const[d,m]=Be(),{data:r}=pe(),n=De(r),l=[...new Set(t.flatMap(i=>i.profiles))],N=[...new Set(t.flatMap(i=>i.location))],u=[{id:1,heading:"Status",chips:Tt.map(i=>({lead:Ue,value:i}))},{id:2,heading:"Instance type",chips:Et.map(i=>({lead:qe,value:i}))},{id:3,heading:"Profile",chips:l.map(i=>({lead:Ke,value:i}))},...n?[{id:4,heading:"Cluster member",chips:N.map(i=>({lead:Qe,value:i}))}]:[]],o=i=>{const S=bt(i,d,ve);S.toString()!==d.toString()&&m(S)};return e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"u-off-screen",children:"Search and filter"}),e.jsx(h.SearchAndFilter,{existingSearchData:ft(d,ve),filterPanelData:u,returnSearchData:o,onExpandChange:()=>{window.dispatchEvent(new CustomEvent("resize",{detail:"search-and-filter"}))},onPanelToggle:()=>{window.dispatchEvent(new CustomEvent("sfp-toggle"))}})]})},Dt=$.memo(Bt),E="Status",V="Name",H="Type",J="Cluster member",Z="Description",P="Memory",R="Disk",U="IPv4",q="IPv6",K="Snapshots",oe="Actions",x={[V]:170,[H]:130,[J]:150,[P]:150,[R]:150,[Z]:150,[U]:150,[q]:330,[K]:110,[E]:160,[oe]:210},At=[K,q,U,Z,P,R,H,E],Mt=[H,P,R,U,q,K],zt=({instance:t})=>{const d=xe(),m=()=>{d(`/ui/project/${t.project}/instance/${t.name}/terminal`)},r=t.status!=="Running";return e.jsx(h.Button,{appearance:"base",dense:!0,hasIcon:!0,onClick:m,disabled:r,title:"Terminal","aria-label":"Open Terminal",children:e.jsx(h.Icon,{name:"code"})})},Ot=({instance:t})=>{const d=xe(),m=()=>{d(`/ui/project/${t.project}/instance/${t.name}/console`)};return e.jsx(h.Button,{"aria-label":"Open console",appearance:"base",dense:!0,hasIcon:!0,onClick:m,title:"Console",children:e.jsx(h.Icon,{name:"canvas"})})},Le=5,_t=({instance:t})=>{var l,N;const{data:d}=pe(),m=Object.values((t==null?void 0:t.expanded_devices)??{}).filter(Xe),r=!t.state||t.state.pid===0?"-":t.state.pid,n=et(t);return e.jsx("table",{className:"u-table-layout--auto u-no-margin--bottom",children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Name"}),e.jsx("td",{children:e.jsx(_e,{instance:t})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Base image"}),e.jsx("td",{children:e.jsx("div",{className:"u-truncate base-image",title:t.config["image.description"],children:t.config["image.description"]??"-"})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Status"}),e.jsx("td",{children:e.jsx(He,{instance:t})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Description"}),e.jsx("td",{children:t.description?t.description:"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Type"}),e.jsx("td",{children:Me.filter(u=>u.value===t.type)[0].label})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"IPv4"}),e.jsx("td",{children:e.jsx($e,{instance:t,family:"inet"})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"IPv6"}),e.jsx("td",{children:e.jsx($e,{instance:t,family:"inet6"})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Architecture"}),e.jsx("td",{children:t.architecture})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Cluster member"}),e.jsx("td",{children:(l=d==null?void 0:d.environment)!=null&&l.server_clustered?t.location:"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Root storage pool"}),e.jsx("td",{children:e.jsx(O,{to:`/ui/project/${t.project}/storage/pool/${n}`,children:n})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"PID"}),e.jsx("td",{children:r})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Created"}),e.jsx("td",{children:he(t.created_at)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted last-used",children:"Last used"}),e.jsx("td",{children:he(t.last_used_at)})]}),e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx("h3",{className:"p-muted-heading p-heading--5",children:e.jsx(O,{to:`/ui/project/${t.project}/instance/${t.name}/configuration`,children:"Profiles"})})}),e.jsx("td",{children:e.jsx(h.List,{className:"list",items:t.profiles.map(u=>e.jsx(O,{to:`/ui/project/${t.project}/profile/${u}`,children:u},u))})})]}),m.length>0?e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx("h3",{className:"p-muted-heading p-heading--5",children:"Networks"})}),e.jsx("td",{children:e.jsx(h.List,{className:"list",items:m.map(u=>e.jsx(O,{to:`/ui/project/${t.project}/network/${u.network}`,children:u.network},u.network))})})]}):e.jsx("tr",{children:e.jsxs("td",{colSpan:2,children:[e.jsx("h3",{className:"p-muted-heading p-heading--5",children:"Networks"}),e.jsxs("p",{children:["No networks found.",e.jsx("br",{}),e.jsx(O,{to:`/ui/project/${t.project}/instance/${t.name}/configuration/networks`,children:"Configure instance networks"})]})]})}),e.jsx("tr",{className:"u-no-border",children:e.jsx("th",{colSpan:2,className:"snapshots-header",children:e.jsx("h3",{className:"p-muted-heading p-heading--5",children:e.jsx(O,{to:`/ui/project/${t.project}/instance/${t.name}/snapshots`,children:"Snapshots"})})})}),(N=t.snapshots)!=null&&N.length?e.jsxs(e.Fragment,{children:[t.snapshots.slice().sort((u,o)=>{const i=u.created_at,S=o.created_at;return i>S?-1:i<S?1:0}).slice(0,Le).map(u=>e.jsxs("tr",{className:"u-no-border",children:[e.jsx("th",{title:u.name,className:"snapshot-name u-truncate",children:e.jsx(It,{item:u})}),e.jsx("td",{className:"u-text--muted",children:e.jsx("i",{children:he(u.created_at)})})]},u.name)),t.snapshots.length>Le&&e.jsx("tr",{children:e.jsx("td",{colSpan:2,children:e.jsx(O,{to:`/ui/project/${t.project}/instance/${t.name}/snapshots`,children:`View all (${t.snapshots.length})`})})})]}):e.jsx("tr",{children:e.jsx("td",{colSpan:2,children:e.jsxs("p",{className:"no-snapshots",children:["No snapshots found.",e.jsx("br",{}),e.jsx(O,{to:`/ui/project/${t.project}/instance/${t.name}/snapshots`,children:"Manage instance snapshots"})]})})})]})})},Ht=()=>{const t=h.useNotify(),d=Ae(),m=d.instance!==null,{data:r,error:n,isLoading:l}=dt(d.instance??"",d.project,m);return n&&t.failure("Loading instance failed",n),e.jsx(Y,{loading:l,hasError:!r,className:"u-hide--medium u-hide--small",width:"narrow",pinned:!0,children:e.jsxs(Y.Container,{className:"detail-panel instance-detail-panel",children:[e.jsxs(Y.Sticky,{children:[e.jsxs(Y.Header,{children:[e.jsx(Y.HeaderTitle,{children:"Instance summary"}),e.jsx(Y.HeaderControls,{children:e.jsx(h.Button,{appearance:"base",className:"u-no-margin--bottom",hasIcon:!0,onClick:d.clear,"aria-label":"Close",children:e.jsx(h.Icon,{name:"close"})})})]}),r&&e.jsxs("div",{className:"actions",children:[e.jsx(h.List,{inline:!0,className:"primary actions-list",items:[e.jsx(zt,{instance:r},"terminal"),e.jsx(Ot,{instance:r},"console")]}),e.jsx("div",{className:"state",children:e.jsx(Oe,{instance:r})})]})]}),e.jsx(Y.Content,{children:r&&e.jsx(_t,{instance:r})})]})})},Ut=()=>{const t=localStorage.getItem("instanceListHiddenColumns");return t?JSON.parse(t):[P,R]},qt=t=>{localStorage.setItem("instanceListHiddenColumns",JSON.stringify(t))},Kt=()=>it(820),gs=()=>{const t=tt(),d=Fe(),m=xe(),r=h.useNotify(),n=Ae(),{project:l}=st(),[N,u]=$.useState("Create instance"),[o]=Be(),{data:i}=pe(),S=De(i),{canCreateInstances:T}=kt(),p={queries:o.getAll("query"),statuses:Pt(o.getAll("status")),types:o.getAll("type").map(s=>s==="VM"?"virtual-machine":"container"),profiles:o.getAll("profile"),clusterMembers:o.getAll("member")},[j,v]=$.useState(Ut()),[f,B]=$.useState([]),[c,g]=$.useState([]),[y,w]=$.useState([]),D=$t();if(!l)return e.jsx(e.Fragment,{children:"Missing project"});const{data:k=[],error:G,isLoading:Q}=ut(l.name);G&&r.failure("Loading instances failed",G),ye("resize",()=>{u(Kt()?"Create":"Create instance")});const We=s=>{v(s),qt(s)},{data:X}=nt({queryKey:[ce.operations,l],queryFn:async()=>rt(l.name)});G&&r.failure("Loading operations failed",G);const de=[],ae=((X==null?void 0:X.running)??[]).concat((X==null?void 0:X.success)??[]).filter(s=>{const b=me(s),L=s.description==="Creating instance",te=y.includes(b);if(!L||te)return!1;const ee=k.some(C=>C.name===b);return!(s.status==="Running")&&ee?!1:(de.push(b),!0)}),W=k.filter(s=>!(de.includes(s.name)||!p.queries.every(b=>{var L;return s.name.toLowerCase().includes(b)||s.description.toLowerCase().includes(b)||((L=s.config["image.description"])==null?void 0:L.toLowerCase().includes(b))})||p.statuses.length>0&&!p.statuses.includes(s.status)||p.types.length>0&&!p.types.includes(s.type)||p.profiles.length>0&&!p.profiles.every(b=>s.profiles.includes(b))||p.clusterMembers.length>0&&!p.clusterMembers.includes(s.location)));$.useEffect(()=>{const s=new Set(W.map(L=>L.name)),b=c.filter(L=>s.has(L));b.length!==c.length&&g(b)},[W]),$.useEffect(()=>{n.instance&&(k.some(s=>s.name===n.instance)||n.clear())},[k]);const ue=s=>[{content:V,sortKey:"name",style:{width:`${x[V]}px`}},{content:H,sortKey:"type",style:{width:`${x[H]}px`}},...S?[{content:J,sortKey:"member",style:{width:`${x[J]}px`}}]:[],{content:P,style:{width:`${x[P]}px`}},{content:R,style:{width:`${x[R]}px`}},{content:Z,sortKey:"description",style:{width:`${x[Z]}px`}},{content:U,className:"u-align--right",style:{width:`${x[U]}px`}},{content:q,id:"header-ipv6",style:{width:`${x[q]}px`}},{content:K,sortKey:"snapshots",className:"u-align--right",style:{width:`${x[K]}px`}},{content:E,sortKey:"status",className:"status-header status",style:{width:`${x[E]}px`}},{"aria-label":"Actions",className:_({"u-hide":n.instance}),style:{width:`${x[oe]}px`}}].filter(b=>typeof b.content!="string"||!s.includes(b.content)),je=s=>{const b=Mt.filter(a=>!s.includes(a)).concat(...S?[J]:[]).reduce((a,C)=>a+x[C],0),L=ue(j.concat(f)).length,te=ae.map(a=>({key:a.id,className:"u-row",columns:[{content:me(a),className:"u-truncate",title:me(a),role:"cell","aria-label":V,style:{width:`${x[V]}px`}},...L>3?[{content:e.jsx("i",{children:Object.entries(a.metadata??{}).slice(0,1).map(([C,A],M)=>e.jsxs("div",{children:[C,": ",A]},M))}),role:"cell",colSpan:L-3,style:{width:`${b}px`}}]:[],...f.includes(E)?[]:[{content:e.jsxs(e.Fragment,{children:[e.jsx(h.Spinner,{className:"status-icon"})," Setting up"]}),role:"cell","aria-label":E,style:{width:`${x[E]}px`}}],{content:e.jsx(pt,{operation:a,project:l.name}),role:"cell",className:_("u-align--right",{"u-hide":n.instance}),"aria-label":"Actions",style:{width:`${x[oe]}px`}}],sortData:{name:null}})),ee=W.map(a=>{var z,se,ie;const C=()=>{n.openInstanceSummary(a.name,l.name)},A=we(a,"inet").filter(F=>!F.address.startsWith("127")).map(F=>F.address),M=we(a,"inet6").filter(F=>!F.address.startsWith("fe80")).map(F=>F.address);return{key:a.name,className:n.instance===a.name?"u-row-selected":"u-row",name:a.name,columns:[{content:e.jsx(_e,{instance:a}),className:"u-truncate",title:`Instance ${a.name}`,role:"cell",style:{width:`${x[V]}px`},"aria-label":V,onClick:C},{content:e.jsx(e.Fragment,{children:(z=Me.find(F=>F.value===a.type))==null?void 0:z.label}),role:"cell","aria-label":H,onClick:C,className:"clickable-cell",style:{width:`${x[H]}px`}},...S?[{content:a.location,role:"cell","aria-label":J,onClick:C,className:"clickable-cell u-truncate",title:a.location,style:{width:`${x[J]}px`}}]:[],{content:e.jsx(ht,{instance:a}),role:"cell","aria-label":P,onClick:C,className:"clickable-cell",style:{width:`${x[P]}px`}},{content:e.jsx(mt,{instance:a}),role:"cell","aria-label":R,onClick:C,className:"clickable-cell",style:{width:`${x[R]}px`}},{content:e.jsx("div",{className:"u-truncate",title:a.description,children:a.description}),role:"cell","aria-label":Z,onClick:C,className:"clickable-cell",style:{width:`${x[Z]}px`}},{content:A.length>1?`${A.length} addresses`:A,role:"cell",className:"u-align--right clickable-cell","aria-label":U,onClick:C,style:{width:`${x[U]}px`}},{content:M.length>1?`${M.length} addresses`:M,role:"cell","aria-label":q,onClick:C,className:"clickable-cell",style:{width:`${x[q]}px`}},{content:((se=a.snapshots)==null?void 0:se.length)??"0",role:"cell",className:"u-align--right clickable-cell","aria-label":K,onClick:C,style:{width:`${x[K]}px`}},{content:e.jsx(He,{instance:a}),role:"cell",className:"clickable-cell","aria-label":E,onClick:C,style:{width:`${x[E]}px`}},{content:e.jsx(Oe,{className:_("instance-actions","u-no-margin--bottom",{"u-hide":!!d.getType(a)}),instance:a}),role:"cell",className:_("u-align--right",{"u-hide":n.instance}),"aria-label":"Actions",style:{width:`${x[oe]}px`}}].filter(F=>!s.includes(F["aria-label"])),sortData:{name:a.name.toLowerCase(),member:a.location,description:a.description.toLowerCase(),status:a.status,type:a.type,snapshots:((ie=a.snapshots)==null?void 0:ie.length)??0}}});return te.concat(ee)},{rows:fe,updateSort:Ye}=wt({rows:je(j.concat(f))}),be=()=>{var A,M;const s=document.getElementById("instance-table-measure"),b=(M=(A=s==null?void 0:s.children[0])==null?void 0:A.children[0])==null?void 0:M.children[0];if(!s||!b)return;const L=s.getBoundingClientRect().width,te=b.getBoundingClientRect().width,ee=new Map;b.childNodes.forEach(z=>{const se=z,ie=se.innerHTML,F=se.getBoundingClientRect().width;ee.set(ie,F)});let a=0;const C=[];At.forEach(z=>{te-a>L&&!j.includes(z)&&(a+=ee.get(z),C.push(z))}),JSON.stringify(C)!==JSON.stringify(f)&&B(C)};ye("resize",be),$.useEffect(be,[n.instance,j,k,ae]);const le=Q||k.length>0||ae.length>0,Ne=k.filter(s=>c.includes(s.name)),Ve=k.filter(s=>!de.includes(s.name)).length+ae.length,Se=T(l)?"":`You do not have permission to create instances in project ${l.name}`;return e.jsxs(e.Fragment,{children:[e.jsxs(at,{mainClassName:_("instance-list",{"has-side-panel":!!n.instance}),contentClassName:"instance-content",header:e.jsxs(ne,{children:[e.jsxs(ne.Left,{children:[e.jsx(ne.Title,{children:e.jsx(yt,{href:`${t}/explanation/instances/#expl-instances`,title:"Learn more about instances",children:"Instances"})}),le&&c.length===0&&e.jsx(ne.Search,{children:e.jsx(Dt,{instances:k},l.name)}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Lt,{instances:Ne,onStart:()=>{w(c)},onFinish:()=>{w([])}}),e.jsx(Ft,{instances:Ne,onStart:w,onFinish:()=>{w([])}})]})]}),le&&c.length===0&&e.jsx(ne.BaseActions,{children:e.jsxs(h.Button,{appearance:"positive",className:"u-float-right u-no-margin--bottom",onClick:async()=>m(`/ui/project/${l.name}/instances/create`),hasIcon:!D,disabled:!T(l),title:Se,children:[!D&&e.jsx(h.Icon,{name:"plus",light:!0}),e.jsx("span",{children:N})]})})]}),children:[e.jsx(St,{}),e.jsx(h.Row,{className:"no-grid-gap",children:e.jsxs(h.Col,{size:12,children:[le&&e.jsxs(e.Fragment,{children:[e.jsx(Nt,{dependencies:[W,r.notification],tableId:"instances-table",belowIds:["status-bar"],children:e.jsxs(h.TablePagination,{data:fe,id:"pagination",itemName:"instance",className:"u-no-margin--top","aria-label":"Table pagination control",description:c.length>0&&e.jsx(Ct,{totalCount:Ve,itemName:"instance",parentName:`project: ${l.name}`,selectedNames:c,setSelectedNames:g,filteredNames:W.map(s=>s.name)}),children:[e.jsx(vt,{columns:[H,P,R,J,Z,U,q,K],hidden:j,sizeHidden:f,setHidden:We,className:_({"u-hide":n.instance})}),e.jsx(ke,{id:"instances-table",headers:ue(j.concat(f)),rows:fe,sortable:!0,emptyStateMsg:Q?e.jsx(lt,{text:"Loading instances..."}):e.jsx(e.Fragment,{children:"No instance found matching this search"}),itemName:"instance",parentName:"project",selectedNames:c,setSelectedNames:g,disabledNames:y,filteredNames:W.map(s=>s.name),onUpdateSort:Ye})]})}),e.jsx("div",{id:"instance-table-measure",children:e.jsx(ke,{headers:ue(j),rows:je(j),className:"scrollable-table",itemName:"instance",parentName:"project",selectedNames:c,setSelectedNames:g,disabledNames:y,filteredNames:W.map(s=>s.name)})})]}),!le&&e.jsxs(h.EmptyState,{className:"empty-state",image:e.jsx(h.Icon,{name:"pods",className:"empty-state-icon"}),title:"No instances found",children:[e.jsx("p",{children:"There are no instances in this project. Spin up your first instance!"}),e.jsx("p",{children:e.jsxs("a",{href:`${t}/howto/instances_create/`,target:"_blank",rel:"noopener noreferrer",children:["How to create instances",e.jsx(h.Icon,{className:"external-link-icon",name:"external-link"})]})}),e.jsx(h.Button,{className:"empty-state-button",appearance:"positive",onClick:async()=>m(`/ui/project/${l.name}/instances/create`),disabled:!T(l),title:Se,children:"Create instance"})]})]})})]}),n.panel===ot.instanceSummary&&e.jsx(Ht,{})]})};export{gs as default};
Close