All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.CreateInitialAccessToken-CGVDEXvq.js Maven / Gradle / Ivy

import{jsxs as i,jsx as e}from"react/jsx-runtime";import{useState as b}from"react";import{a as u,M as T,q as g,ay as y,k as p,r as C,ac as S,u as V,g as x,c as F,f as I,d as H,F as D,aQ as m,P as w,af as E,A as M,i as d,L as N}from"./main-C7ps2lmX.js";import{b as P,F as j}from"./FormAccess-DyLNkc18.js";import{T as G}from"./TimeSelectorControl-BxG2OWnt.js";import{V as K}from"./ViewHeader-B7eeFzFA.js";import"react-dom";import"./copy-icon-ACZmDH8e.js";import"./TimeSelector-DcQmr_f3.js";const L=({token:n,toggleDialog:a})=>{const{t}=u();return i(T,{title:t("initialAccessTokenDetails"),isOpen:!0,onClose:a,variant:g.medium,children:[e(y,{title:t("copyInitialAccessToken"),component:"h2",isInline:!0,variant:p.warning}),e(C,{className:"pf-v5-u-mt-md",children:e(S,{label:t("initialAccessToken"),fieldId:"initialAccessToken",children:e(P,{id:"initialAccessToken",isReadOnly:!0,children:n})})})]})};function Y(){const{adminClient:n}=V(),{t:a}=u(),t=x({mode:"onChange"}),{handleSubmit:k,formState:{isValid:f}}=t,{realm:s}=F(),{addAlert:v,addError:A}=I(),h=H(),[l,c]=b("");return i(D,{...t,children:[l&&e(L,{token:l,toggleDialog:()=>{c(""),v(a("tokenSaveSuccess"),p.success),h(m({realm:s,tab:"initial-access-token"}))}}),e(K,{titleKey:"createToken",subKey:"createTokenHelp"}),e(w,{variant:"light",children:i(j,{isHorizontal:!0,role:"create-client",onSubmit:k(async o=>{try{const r=await n.realms.createClientsInitialAccess({realm:s},o);c(r.token)}catch(r){A("tokenSaveError",r)}}),children:[e(G,{name:"expiration",label:a("expiration"),labelIcon:a("tokenExpirationHelp"),controller:{defaultValue:86400,rules:{min:{value:1,message:a("expirationValueNotValid")}}}}),e(E,{name:"count",label:a("count"),labelIcon:a("countHelp"),controller:{rules:{min:1},defaultValue:1}}),i(M,{children:[e(d,{variant:"primary",type:"submit","data-testid":"save",isDisabled:!f,children:a("save")}),e(d,{"data-testid":"cancel",variant:"link",component:o=>e(N,{...o,to:m({realm:s,tab:"initial-access-token"})}),children:a("cancel")})]})]})})]})}export{Y as default};
//# sourceMappingURL=CreateInitialAccessToken-CGVDEXvq.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy