/
proc
/
3430793
/
root
/
snap
/
lxd
/
current
/
share
/
lxd-ui
/
assets
/
File Upload :
llllll
Current File: //proc/3430793/root/snap/lxd/current/share/lxd-ui/assets/CertificateAdd-Cburgay7.js
import{d as t,r as c,j as e,a as d,u as l,b as u,c as h,N as p,e as m}from"./index-dL2n30-Z.js";const x=()=>{const o=t.useNotify(),[s,a]=c.useState(""),n=()=>{const i=s.trim().split(/\r?\n|\r|\n/g).at(-1)??"";d(i).then(()=>{location.reload()}).catch(r=>o.failure("Error using token",r))};return e.jsxs(t.Form,{children:[e.jsx(t.Textarea,{id:"token",name:"token",label:"Paste the trust token below:",placeholder:"Paste trust token here",rows:5,onChange:i=>{a(i.target.value)}}),e.jsx(t.Button,{appearance:"positive",disabled:s.length<1,type:"button",onClick:n,children:"Connect"})]})},f=()=>{const{isAuthenticated:o,isAuthLoading:s}=l(),a=t.useNotify(),{data:n}=u(),i=n==null?void 0:n.client_certificate,r=h();return s?e.jsx(t.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0}):o?e.jsx(p,{to:"/ui",replace:!0}):e.jsx(t.CustomLayout,{mainClassName:"certificate-generate",children:e.jsxs(t.Row,{children:[e.jsx(t.Col,{size:2}),e.jsxs(t.Col,{size:8,children:[a.notification?e.jsx(m,{}):e.jsxs(t.Row,{children:[e.jsx(t.Notification,{title:"Trust token",severity:"information",children:"In order for your browser certificate to be added to the server’s trust store, you must present a trust token generated by the server."}),i===!1&&e.jsx(t.Notification,{severity:"caution",title:"Missing client certificate",actions:[{label:"Go back to step 1",onClick:()=>{r("/ui/login/certificate-generate")}}],children:"You are missing an installed client certificate. You may not be able to authenticate."})]}),e.jsxs("div",{className:"p-stepped-list__content",children:[e.jsx("div",{children:"Run the following command on the LXD server to create a new identity and generate a trust token."}),e.jsx(t.CodeSnippet,{className:"u-no-margin--bottom",blocks:[{code:"lxc auth identity create tls/lxd-ui --group admins",wrapLines:!0}]}),e.jsxs("div",{children:["You can replace ",e.jsx("code",{children:"lxd-ui"})," with the name you want to give to the identity."]})]}),e.jsxs("div",{className:"p-stepped-list__content",children:[e.jsx("br",{}),e.jsx(x,{})]}),e.jsx(t.Accordion,{sections:[{title:e.jsxs(e.Fragment,{children:["If you encounter:"," ",e.jsx("code",{children:"Failed to create pending TLS identity: One or more groups were not found: 'admins'."})]}),content:e.jsxs(e.Fragment,{children:[e.jsx("div",{children:"Older versions of LXD are not pre-configured with an admin group. To create one, run the following commands. Then, try the first step again."}),e.jsx(t.CodeSnippet,{blocks:[{code:`# Create a group called admins. lxc auth group create admins`,wrapLines:!0},{code:`# Assign admin permissions to the admins group. lxc auth group permission add admins server admin`,wrapLines:!0}]})]})}]})]})]})})};export{f as default};
Copyright ©2k19 -
Hexid
|
Tex7ure