PageSourceSearch

https://app.timavera.com/assets/index-Dk1q2VGN.js

js timavera.com collected 2026-10-02 15:58:10 UTC 6,537 bytes, 1 lines download raw bytes

1import{a as u,j as e,t as L,ai as K,J as R,D as X,E as B,$ as Z,u as S,L as T,Z as O,X as Q,Y as U,aj as ee,a0 as te,aa as r,h as oe,q as E,l as se,ak as ne}from"./index-C-EqDXQc.js";import{A as re}from"./AlertDismissible-Dh3Bx1k6.js";import{B as D}from"./Button-Cgo4JSoQ.js";import{M as g}from"./Modal-Cxtv_dSP.js";import{F as le,a as ie}from"./FormGroup-BicKPQZx.js";import{I as ae}from"./Image-zTfhAuzQ.js";import{N as f,t as de,a as ce,L as ue,c as me}from"./LangMenu-pwrIAi86.js";import"./style-Bu0Ku9R8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"ed4d7404667ecdd7dde651e1cfd90b2db83d83c9"}}catch{}})();try{(function(){var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new o.Error().stack;l&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[l]="157e772d-9ba9-4831-9821-850602e52ec5",o._sentryDebugIdIdentifier="sentry-dbid-157e772d-9ba9-4831-9821-850602e52ec5")})()}catch{}const he={"Add Comment":{is:"Bæta við athugsemd",pt:"Adicionar Comentário"},"Your comment ...":{is:"Þín athugasemd ...",pt:"O seu comentário ..."},"Close window":{is:"Loka glugga",pt:"Fechar janela"}},w=o=>L(o,he);function pe(o){const{show:l,onCloseModal:j,onSubmit:x}=o,[i,C]=u.useState(""),c=()=>{C(""),j()},n=a=>{a.preventDefault(),x(i),c()};return e.jsxs(g,{show:l,onHide:c,children:[e.jsx(g.Header,{closeButton:!0,children:e.jsx(g.Title,{children:w("Add Comment")})}),e.jsxs(le,{onSubmit:n,children:[e.jsx(g.Body,{children:e.jsx(ie,{controlId:"formWorkLogCommentControl",children:e.jsx(K,{type:"text",value:i,onChange:a=>C(a.target.value),placeholder:w("Your comment ...")})})}),e.jsxs(g.Footer,{children:[e.jsx(D,{type:"submit",bsStyle:"success",disabled:!i.length,block:!0,onClick:n,children:w("Add Comment")}),e.jsx(D,{block:!0,onClick:c,children:w("Close window")})]})]})]})}const ge={"Log out":{is:"Útskrá",pt:"Terminar Sessão"}},fe=o=>L(o,ge);function je(o){const l=R();return e.jsxs(f,{inverse:!0,fixedTop:!0,collapseOnSelect:!0,className:"seeThroughNavBar",children:[e.jsxs(f.Header,{style:{marginLeft:"-1.3em"},children:[e.jsx(f.Brand,{children:e.jsxs(X,{children:[e.jsx(B,{xs:4,children:e.jsx(ae,{src:de,className:"img-centered",responsive:!0})}),e.jsx(B,{xs:8,style:{marginLeft:"-1em"},children:"Tímavera"})]})}),e.jsx(f.Toggle,{})]}),e.jsx(f.Collapse,{children:e.jsxs(ce,{pullRight:!0,children:[e.jsx(ue,{}),e.jsx(me,{eventKey:1,onSelect:()=>l(Z()),children:fe("Log out")})]})})]})}const xe={"Clock In":{is:"Stimpla Inn",pt:"Registar Entrada"},"Clock Out":{is:"Stimpla Út",pt:"Registar Saída"},"Add Comment":{is:"Búa til athugasemd",pt:"Adicionar Comentário"},In:{is:"Inn",pt:"Entrada"},Employee:{is:"Starfsmaður",pt:"Funcionário"},Project:{is:"Verkefni",pt:"Projeto"},betaNotice:{en:"To clock in select an employee and a project.",is:"Veljið starfsmann og verkefni til að stimpla inn.",pt:"Para registar entrada, selecione um funcionário e um projeto."}},d=o=>L(o,xe),Ee=()=>{const o=R(),l=S(t=>t.error),j=S(t=>t.projects),x=S(t=>t.employees),i=S(t=>t.transactions),[C,c]=u.useState(!1),[n,a]=u.useState(null),[m,v]=u.useState(null),[A,h]=u.useState(!1);u.useEffect(()=>{const t=T().add(-24,"hours").toISOString(),s=T().toISOString();o(O({from:t,to:s,open:!0,created_by:"CompanyTimeClock"})),o(Q()),o(U())},[o]);const b={fontSize:"25px",verticalAlign:"middle",height:"35px"},F=t=>{t.id===n?a(null):a(t.id)},_=t=>{t.id===m?v(null):v(t.id)},I=()=>{const t=T().add(-24,"hours").toISOString(),s=T().add(60,"seconds").toISOString();o(O({from:t,to:s,open:!0,created_by:"CompanyTimeClock"})).then(()=>h(!1),y),a(null)},y=t=>{h(!1),a(null),o({type:"REJECTED",payload:t})},P=()=>{h(!0),E.addWorkLogTimeClock({employee_id:n,project_id:m}).then(I,y)},W=()=>{h(!0),E.closeWorkLogTimeClock({employee_id:n}).then(I,y)},M=t=>{h(!0),E.addWorkLogCommentTimeClock({employee_id:n,comment:t}).then(I,y)},$=t=>{if(n===t.id)return"lightblue";if(i.data.some(s=>s.employee.id===t.id))return"lightgreen"},H=()=>
1{let t=!n||!m||A,s=d("Clock In"),p="success",k=P;return i.data.some(q=>q.employee.id===n)&&(t=!1,s=d("Clock Out"),p="danger",k=W),e.jsx(r.Button,{bsStyle:p,disabled:t,onClick:k,bsSize:"large",block:!0,children:s})},Y=()=>{const t=n&&i.data.some(s=>s.employee.id===n);return e.jsx(r.Button,{bsStyle:"info",disabled:!t,onClick:()=>c(!0),bsSize:"large",block:!0,children:d("Add Comment")})},z=t=>{const s=i.data.find(k=>k.employee.id===t.id);return s?e.jsx("p",{style:{float:"right"},children:`${d("In")}: ${ne(s.start_time)}`}):null},N=(t,s,p)=>A||t.fetching||i.fetching?e.jsx("tr",{children:e.jsx("td",{children:e.jsx(oe,{})})}):t.fetched?s.map(p):null,G=x.data.filter(t=>!t.disabled),J=j.data.filter(t=>t.is_open),V=ee(J);return e.jsxs("div",{className:"bg-white navigation-bar-padding",children:[e.jsx(je,{}),e.jsx(re,{message:l.message,show:l.message,onDismiss:()=>o(te())}),e.jsxs(r.Grid,{children:[e.jsx(r.Row,{children:e.jsx(r.Col,{xs:12,children:e.jsx(r.Alert,{children:e.jsx("p",{className:"text-center",children:d("betaNotice")})})})}),e.jsxs(r.Row,{children:[e.jsxs(r.Col,{lg:6,xs:6,sm:6,children:[H(),e.jsxs(r.Table,{responsive:!0,striped:!0,bordered:!0,condensed:!0,hover:!0,style:{marginTop:"1em"},children:[e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{className:"text-center",children:d("Employee")})})}),e.jsx("tbody",{children:N(x,G,t=>e.jsx("tr",{onClick:()=>F(t),style:{backgroundColor:$(t)},children:e.jsxs("td",{style:b,children:[e.jsx("p",{style:{float:"left"},children:t.name}),z(t)]})},t.id))})]})]}),e.jsxs(r.Col,{lg:6,xs:6,sm:6,children:[Y(),e.jsxs(r.Table,{responsive:!0,striped:!0,bordered:!0,condensed:!0,hover:!0,style:{marginTop:"1em"},children:[e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{className:"text-center",children:d("Project")})})}),e.jsx("tbody",{children:N(j,V,t=>t.is_parent?e.jsxs(se.Fragment,{children:[e.jsx("tr",{style:{backgroundColor:"#f5f5f5"},children:e.jsx("td",{style:{...b,fontWeight:"bold",cursor:"default"},children:t.name})}),t.children&&t.children.filter(s=>s.is_open).map(s=>e.jsx("tr",{onClick:()=>_(s),style:{backgroundColor:m===s.id?"lightblue":null},children:e.jsx("td",{style:{...b,paddingLeft:"2em"},children:s.name})},s.id))]},t.id):e.jsx("tr",{onClick:()=>_(t),style:{backgroundColor:m===t.id?"lightblue":null},children:e.jsx("td",{style:b,children:t.name})},t.id))})]})]})]})]}),e.jsx(pe,{show:C,onCloseModal:()=>c(!1),onSubmit:M})]})};export{Ee as default};

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.