-
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
1 parent
aa8de9e
commit dc6936b
Showing
9 changed files
with
464 additions
and
151 deletions.
There are no files selected for viewing
Binary file not shown.
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,65 @@ | ||
/* === This file is part of bxt === | ||
* | ||
* SPDX-FileCopyrightText: 2024 Artem Grinev <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
* | ||
*/ | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faArrowsLeftRight } from "@fortawesome/free-solid-svg-icons"; | ||
import React, { HTMLProps, useState } from "react"; | ||
|
||
type DateRangeInputProps = HTMLProps<HTMLDivElement> & { | ||
since: Date; | ||
until: Date; | ||
onDateChange: (since: Date, until: Date) => void; | ||
}; | ||
const className = | ||
"text-base-content text-sm border-none input join-item rounded-xl px-1 focus:-outline-offset-1 focus:outline-[2.5px] text-inherit"; | ||
const DateRangeInput: React.FC<DateRangeInputProps> = ({ | ||
since: from, | ||
until: to, | ||
onDateChange, | ||
...props | ||
}) => { | ||
const [fromValue, setFromValue] = useState(from.toISOString().slice(0, 16)); | ||
const [toValue, setToValue] = useState(to.toISOString().slice(0, 16)); | ||
|
||
const handleFromChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const newFromValue = event.target.value; | ||
setFromValue(newFromValue); | ||
onDateChange(new Date(newFromValue), new Date(toValue)); | ||
}; | ||
|
||
const handleToChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const newToValue = event.target.value; | ||
setToValue(newToValue); | ||
onDateChange(new Date(fromValue), new Date(newToValue)); | ||
}; | ||
|
||
return ( | ||
<div className="flex items-center gap-2" {...props}> | ||
<input | ||
className={className} | ||
aria-label="From" | ||
type="datetime-local" | ||
value={fromValue} | ||
onChange={handleFromChange} | ||
max={toValue} | ||
/> | ||
<FontAwesomeIcon | ||
className="text-base-content w-10 text-inherit" | ||
icon={faArrowsLeftRight} | ||
/> | ||
<input | ||
className={className} | ||
aria-label="To" | ||
type="datetime-local" | ||
value={toValue} | ||
onChange={handleToChange} | ||
min={fromValue} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DateRangeInput; |
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,52 @@ | ||
/* === This file is part of bxt === | ||
* | ||
* SPDX-FileCopyrightText: 2023 Artem Grinev <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
* | ||
*/ | ||
|
||
export enum LogEntryType { | ||
Add = "Add", | ||
Remove = "Remove", | ||
Update = "Update" | ||
} | ||
export type PackageLogEntry = { | ||
type: LogEntryType; | ||
section: Section; | ||
name: string; | ||
location: string; | ||
version?: string; | ||
}; | ||
|
||
export type CommitLogEntry = { | ||
time: Date; | ||
commiterUsername: string; | ||
added: PackageLogEntry[]; | ||
deleted: PackageLogEntry[]; | ||
moved: [PackageLogEntry, PackageLogEntry][]; | ||
copied: [PackageLogEntry, PackageLogEntry][]; | ||
}; | ||
|
||
export type SyncLogEntry = { | ||
time: Date; | ||
syncTriggerUsername: string; | ||
added: PackageLogEntry[]; | ||
deleted: PackageLogEntry[]; | ||
}; | ||
|
||
export type DeployLogEntry = { | ||
time: Date; | ||
runnerUrl: string; | ||
added: PackageLogEntry[]; | ||
}; | ||
|
||
export type Log = { | ||
commits: CommitLogEntry[]; | ||
syncs: SyncLogEntry[]; | ||
deploys: DeployLogEntry[]; | ||
}; | ||
|
||
export type LogEntry = (CommitLogEntry | SyncLogEntry | DeployLogEntry) & { | ||
type: string; | ||
icon: IconProp; | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.