-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
518 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
<!doctype html> | ||
<html lang="en-us"> | ||
<head> | ||
<title>Certs</title> | ||
<title>Meetings</title> | ||
<link rel="stylesheet" href="/static/app.css" /> | ||
<!-- <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">--> | ||
</head> | ||
|
||
<body class="bg-gray-800"> | ||
<div class="flex flex-col p-4 gap-4 absolute top-0 bottom-0 left-0 right-0"> | ||
<div id="mygrid" class="ag-theme-quartz-dark" style="height: 100%"></div> | ||
<div class="flex flex-row gap-4"> | ||
<button class="border-green-400 text-sm text-green-200 hover:text-green-50 px-2 py-1 rounded-md border bg-transparent hover:bg-green-500 transition-colors duration-300" id="btn-create">Create Meeting</button> | ||
</div> | ||
</div> | ||
|
||
<script src="./index.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* exported clock cluckedIn ping refreshMemberList getApiKey checkAuth*/ | ||
|
||
import type { APIClockLabRequest, APIMember, APILoggedIn, APIMeetingAttendance } from '~types' | ||
import { apiFetch } from '~views/util' | ||
import { getClockMode } from '~views/grid/style' | ||
import { enum_MeetingAttendances_state } from '@prisma/client' | ||
|
||
export type MemberState = enum_MeetingAttendances_state | ||
|
||
export async function clock(email: string, clockingIn: boolean): Promise<boolean> { | ||
const outMode = getClockMode() == 'normal' ? 'out' : 'void' | ||
const body: APIClockLabRequest = { | ||
email: email, | ||
action: clockingIn ? 'in' : outMode | ||
} | ||
const res = await apiFetch('/clock/lab', 'POST', body) | ||
return res?.success ?? false | ||
} | ||
|
||
export async function setAttendance(email: string, state: MemberState): Promise<boolean> { | ||
const body: APIMeetingAttendance = { | ||
meeting: window.meeting_id, | ||
email: email, | ||
state: state | ||
} | ||
const res = await apiFetch('/attendance', 'POST', body) | ||
return res?.success ?? false | ||
} | ||
|
||
export async function getAttendance() { | ||
const res = await apiFetch('/attendance', 'GET', null) | ||
if (!res) { | ||
throw new Error('error loading data') | ||
} | ||
return res | ||
} | ||
|
||
export async function getLoggedIn(): Promise<APILoggedIn[]> { | ||
const res = await apiFetch('/clock/lab', 'GET', null) | ||
if (!res) { | ||
throw new Error('error loading data') | ||
} | ||
return res | ||
} | ||
|
||
export async function refreshMemberList(): Promise<APIMember[]> { | ||
const res = await apiFetch('/members/refresh', 'GET', null) | ||
if (!res) { | ||
throw new Error('error loading data') | ||
} | ||
return res | ||
} | ||
|
||
export async function getMemberList(): Promise<APIMember[]> { | ||
const res = await apiFetch('/members', 'GET', null) | ||
if (!res) { | ||
throw new Error('error loading data') | ||
} | ||
return res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en-us"> | ||
<head> | ||
<title>Cluck Grid</title> | ||
<link rel="stylesheet" href="./style.scss" /> | ||
<!-- <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">--> | ||
</head> | ||
|
||
<body> | ||
<div id="title">December 5</div> | ||
<div id="noconnect">NOT CONNECTED TO CLUCK API!</div> | ||
<div class="button-grid" id="button-grid"></div> | ||
<script src="/static/js/moses.js"></script> | ||
<script src="./index.ts"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.