mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
Feature/import export encryption (#1533)
Add option to encrypt repository exports with a password and add possibility to decrypt them on repository import. Also make the repository export asynchronous. This implies that the repository export will be created on the server and can be downloaded multiple times. The repository export will be deleted automatically 10 days after creation.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
import React, { FC } from "react";
|
||||
import { FileUpload, LabelWithHelpIcon, Checkbox } from "@scm-manager/ui-components";
|
||||
import { FileUpload, LabelWithHelpIcon, Checkbox, InputField } from "@scm-manager/ui-components";
|
||||
import { File } from "@scm-manager/ui-types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -32,34 +32,57 @@ type Props = {
|
||||
setValid: (valid: boolean) => void;
|
||||
compressed: boolean;
|
||||
setCompressed: (compressed: boolean) => void;
|
||||
password: string;
|
||||
setPassword: (password: string) => void;
|
||||
disabled: boolean;
|
||||
};
|
||||
|
||||
const ImportFromBundleForm: FC<Props> = ({ setFile, setValid, compressed, setCompressed, disabled }) => {
|
||||
const ImportFromBundleForm: FC<Props> = ({
|
||||
setFile,
|
||||
setValid,
|
||||
compressed,
|
||||
setCompressed,
|
||||
password,
|
||||
setPassword,
|
||||
disabled
|
||||
}) => {
|
||||
const [t] = useTranslation("repos");
|
||||
|
||||
return (
|
||||
<div className="columns">
|
||||
<div className="column is-half is-vcentered">
|
||||
<LabelWithHelpIcon label={t("import.bundle.title")} helpText={t("import.bundle.helpText")} />
|
||||
<FileUpload
|
||||
handleFile={(file: File) => {
|
||||
setFile(file);
|
||||
setValid(!!file);
|
||||
}}
|
||||
/>
|
||||
<>
|
||||
<div className="columns">
|
||||
<div className="column is-half is-vcentered">
|
||||
<LabelWithHelpIcon label={t("import.bundle.title")} helpText={t("import.bundle.helpText")} />
|
||||
<FileUpload
|
||||
handleFile={(file: File) => {
|
||||
setFile(file);
|
||||
setValid(!!file);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="column is-half is-vcentered">
|
||||
<Checkbox
|
||||
checked={compressed}
|
||||
onChange={(value, name) => setCompressed(value)}
|
||||
label={t("import.compressed.label")}
|
||||
disabled={disabled}
|
||||
helpText={t("import.compressed.helpText")}
|
||||
title={t("import.compressed.label")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="column is-half is-vcentered">
|
||||
<Checkbox
|
||||
checked={compressed}
|
||||
onChange={(value, name) => setCompressed(value)}
|
||||
label={t("import.compressed.label")}
|
||||
disabled={disabled}
|
||||
helpText={t("import.compressed.helpText")}
|
||||
title={t("import.compressed.label")}
|
||||
/>
|
||||
<div className="columns">
|
||||
<div className="column is-half is-vcentered">
|
||||
<InputField
|
||||
value={password}
|
||||
onChange={value => setPassword(value)}
|
||||
type="password"
|
||||
label={t("import.bundle.password.title")}
|
||||
helpText={t("import.bundle.password.helpText")}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user