PageSourceSearch

https://berlio.by/assets/LogBookLoginPage-Bw7koyrw.js

js berlio.by collected 2026-10-04 16:36:29 UTC 2,005 bytes, 2 lines download raw bytes

1import{r as t,j as e,B as x,P as j,u as b,H as f}from"./index-DKASuTQ_.js";function m({onLogin:n}){const[s,r]=t.useState(""),[c,p]=t.useState(""),[g,l]=t.useState(null),[o,i]=t.useState(!1);async function h(a){a.preventDefault(),l(null),i(!0);try{const u=await fetch("/api/log-book-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:c})}),d=await u.json();if(!u.ok){l(d.message||"Ошибка авторизации"),i(!1);return}n(d.token,d.user)}catch{l("Ошибка сети. Попробуйте позже."),i(!1)}}return e.jsxs("form",{onSubmit:h,className:"aam_logbook-login__form",noValidate:!0,children:[e.jsxs("div",{className:"aam_logbook-login__form--input",children:[e.jsx("label",{htmlFor:"username",children:"Логин"}),e.jsx("input",{id:"username",type:"text",value:s,onChange:a=>r(a.target.value),disabled:o,required:!0,autoComplete:"username"})]}),e.jsxs("div",{className:"aam_logbook-login__form--input",children:[e.jsx("label",{htmlFor:"password",children:"Пароль"}),e.jsx("input",{id:"password",type:"password",value:c,onChange:a=>p(a.target.value),disabled:o,required:!0,autoComplete:"current-password"})]}),e.jsx(x,{type:"submit",disabled:o,variant:"gray",label:o?"Вход...":"Войти",children:o?"Вход...":"Войти"}),g&&e.jsx("p",{role:"alert",className:"aam_logbook-login__error",children:g})]})}m.propTypes={onLogin:j.func.isRequired};function k(){const n=b(),s=r=>{localStorage.setItem("logBookToken",r),n("/log-book")};return e.jsxs("div",{className:"aam_logbook-login-page",children:[e.jsxs(f,{children:[e.jsx("title",{children:"Журнал учёта — вход"}),e.jsx("meta",{name:"description",content:"Авторизация для доступа к журналу учёта."})]}),e.jsx("h1",{className:"aam_logbook-login-page__title",children:"Вход в журнал учёта"}),e.jsx(m,{onLogin:s})]})}export{k as default};
2//# sourceMappingURL=LogBookLoginPage-Bw7koyrw.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.