Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from coreyja/ca/main/checkin-duration
Record Duration and Rebrand as UpGuradian
- Loading branch information
Showing
21 changed files
with
235 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/target | ||
.envrc | ||
|
||
/public/frontend |
8 changes: 7 additions & 1 deletion
8
.sqlx/query-110727bf8db2b15e50a755397eef76df66ef4963fe7dd8e6818d778de132ab7c.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
...008a7bd66b76f9df17d88f8218af5e6bb645.json → ...e2959741ccd15196c7db0ed90a453248caf0.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use std::process::Command; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed=frontend/**/*"); | ||
Command::new("bun") | ||
.args(["build", "frontend/index.ts", "--outdir", "public/frontend/"]) | ||
.status() | ||
.expect("Failed to build frontend"); | ||
} |
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,19 @@ | ||
document.addEventListener("click", function (e) { | ||
if (!e.target) return; | ||
|
||
const clickedElement = (e.target as HTMLElement).closest( | ||
"[data-app='ToggleClass']" | ||
); | ||
if (clickedElement) { | ||
const className = clickedElement.getAttribute("data-class")!; | ||
const targetSelector = clickedElement.getAttribute("data-target")!; | ||
|
||
const targetElement = | ||
clickedElement.closest(targetSelector) || | ||
document.querySelector(targetSelector); | ||
|
||
if (targetElement) { | ||
targetElement.classList.toggle(className); | ||
} | ||
} | ||
}); |
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 @@ | ||
DROP TABLE Crons; |
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 @@ | ||
CREATE TABLE | ||
Crons ( | ||
cron_id UUID PRIMARY KEY, | ||
name TEXT NOT NULL, | ||
last_run_at TIMESTAMP | ||
WITH | ||
TIME ZONE NOT NULL, | ||
created_at TIMESTAMP | ||
WITH | ||
TIME ZONE NOT NULL, | ||
updated_at TIMESTAMP | ||
WITH | ||
TIME ZONE NOT NULL | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_crons_name ON Crons (name); |
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,5 @@ | ||
-- Add migration script here | ||
-- Add a new column to the checkin table | ||
-- `duration_ms` stores the duration of the checkin in milliseconds | ||
ALTER TABLE Checkins | ||
DROP COLUMN duration_nanos; |
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,5 @@ | ||
-- Add migration script here | ||
-- Add a new column to the checkin table | ||
-- `duration_ms` stores the duration of the checkin in milliseconds | ||
ALTER TABLE Checkins | ||
ADD COLUMN duration_nanos BIGINT; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.