Creating new /api/archive/upload which accepts a file from the SingleFile browser extension and converts it to an Archive.

This commit is contained in:
Roland 2025-01-26 12:44:16 -07:00
parent 01338e4d89
commit 531ec3d65e
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
62 changed files with 1000 additions and 562 deletions

View file

@ -10,6 +10,8 @@ import {
Container,
Dimmer,
DimmerDimmable,
GridColumn,
GridRow,
Icon as SIcon,
IconGroup,
Input,
@ -48,6 +50,7 @@ import {FilePreviewContext} from "./FilePreview";
import _ from "lodash";
import {killDownloads, startDownloads} from "../api";
import {allFrequencyOptions, NAME, semanticUIColorMap, validUrlRegex} from "./Vars";
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
export function Paginator({activePage, onPageChange, totalPages, showFirstAndLast, size = 'mini'}) {
const handlePageChange = (e, {activePage}) => {
@ -1960,14 +1963,22 @@ export function getDistinctColor(hexColors) {
return hslToHex(newColor.h, newColor.s, newColor.l);
}
export const DismissibleMessage = ({storageName, children}) => {
const [dismissed, setDismissed] = useLocalStorage(storageName, false);
if (dismissed) {
return <React.Fragment/>
export const RefreshHeader = ({header, headerSize = 'h2', onRefresh, popupContents}) => {
const refreshButton = <APIButton icon='refresh' onClick={onRefresh}/>;
let popup;
if (popupContents) {
popup = <Popup
content={popupContents}
on='hover'
trigger={refreshButton}
/>;
}
return <Message onDismiss={() => setDismissed(true)}>
{children}
</Message>
return <Grid columns={2}>
<GridRow>
<GridColumn>
<Header as={headerSize}>{header}</Header>
</GridColumn>
<GridColumn textAlign='right'>{popup || refreshButton}</GridColumn>
</GridRow>
</Grid>
}