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

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

There is a newer version: 26.0.7
Show newest version
import{jsxs as n,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,j 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 j,af as w,A as E,h as d,L as M}from"./index-C1LIsRX7.js";import{b as N,F as P}from"./FormAccess-BcY70QlP.js";import{T as G}from"./TimeSelectorControl-BQB3aFfv.js";import{V as K}from"./ViewHeader-qjLr6U82.js";import"react-dom";import"./copy-icon-DOS8MmN7.js";import"./TimeSelector-yr8Y_36J.js";const L=({token:i,toggleDialog:a})=>{const{t}=u();return n(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(N,{id:"initialAccessToken",isReadOnly:!0,children:i})})})]})};function Y(){const{adminClient:i}=V(),{t:a}=u(),t=x({mode:"onChange"}),{handleSubmit:k,formState:{isValid:f}}=t,{realm:s}=F(),{addAlert:h,addError:v}=I(),A=H(),[l,c]=b("");return n(D,{...t,children:[l&&e(L,{token:l,toggleDialog:()=>{c(""),h(a("tokenSaveSuccess"),p.success),A(m({realm:s,tab:"initial-access-token"}))}}),e(K,{titleKey:"createToken",subKey:"createTokenHelp"}),e(j,{variant:"light",children:n(P,{isHorizontal:!0,role:"create-client",onSubmit:k(async o=>{try{const r=await i.realms.createClientsInitialAccess({realm:s},o);c(r.token)}catch(r){v("tokenSaveError",r)}}),children:[e(G,{name:"expiration",label:a("expiration"),labelIcon:a("tokenExpirationHelp"),controller:{defaultValue:86400,rules:{min:{value:1,message:a("expirationValueNotValid")}}}}),e(w,{name:"count",label:a("count"),labelIcon:a("countHelp"),controller:{defaultValue:1},min:1}),n(E,{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(M,{...o,to:m({realm:s,tab:"initial-access-token"})}),children:a("cancel")})]})]})})]})}export{Y as default};
//# sourceMappingURL=CreateInitialAccessToken-DYR7I42X.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy