mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: remove {filetype} in path template (#1377)
* chore: remove {filetype} in path template * fix go-static-check * update
This commit is contained in:
@@ -147,8 +147,6 @@ func (s *Server) registerResourceRoutes(g *echo.Group) {
|
|||||||
switch s {
|
switch s {
|
||||||
case "{filename}":
|
case "{filename}":
|
||||||
return filename
|
return filename
|
||||||
case "{filetype}":
|
|
||||||
return filetype
|
|
||||||
case "{timestamp}":
|
case "{timestamp}":
|
||||||
return fmt.Sprintf("%d", t.Unix())
|
return fmt.Sprintf("%d", t.Unix())
|
||||||
case "{year}":
|
case "{year}":
|
||||||
|
@@ -289,6 +289,8 @@ func listIdentityProviders(ctx context.Context, tx *sql.Tx, find *FindIdentityPr
|
|||||||
}
|
}
|
||||||
identityProviderMessages = append(identityProviderMessages, &identityProviderMessage)
|
identityProviderMessages = append(identityProviderMessages, &identityProviderMessage)
|
||||||
}
|
}
|
||||||
|
if err := rows.Err(); err != nil {
|
||||||
|
return nil, FormatError(err)
|
||||||
|
}
|
||||||
return identityProviderMessages, nil
|
return identityProviderMessages, nil
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ import { Button, Input, Typography } from "@mui/joy";
|
|||||||
import * as api from "../helpers/api";
|
import * as api from "../helpers/api";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
import RequiredBadge from "./RequiredBadge";
|
||||||
|
|
||||||
interface Props extends DialogProps {
|
interface Props extends DialogProps {
|
||||||
storage?: ObjectStorage;
|
storage?: ObjectStorage;
|
||||||
@@ -48,7 +49,13 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (type === "S3") {
|
if (type === "S3") {
|
||||||
if (s3Config.endPoint === "" || s3Config.region === "" || s3Config.accessKey === "" || s3Config.bucket === "") {
|
if (
|
||||||
|
s3Config.endPoint === "" ||
|
||||||
|
s3Config.region === "" ||
|
||||||
|
s3Config.accessKey === "" ||
|
||||||
|
s3Config.secretKey === "" ||
|
||||||
|
s3Config.bucket === ""
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,6 +120,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
<div className="dialog-content-container">
|
<div className="dialog-content-container">
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
Name
|
Name
|
||||||
|
<RequiredBadge />
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
className="mb-2"
|
className="mb-2"
|
||||||
@@ -128,6 +136,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
EndPoint
|
EndPoint
|
||||||
|
<RequiredBadge />
|
||||||
<span className="text-sm text-gray-400 ml-1">(S3-compatible server URL)</span>
|
<span className="text-sm text-gray-400 ml-1">(S3-compatible server URL)</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
@@ -139,6 +148,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
Region
|
Region
|
||||||
|
<RequiredBadge />
|
||||||
<span className="text-sm text-gray-400 ml-1">(Region name)</span>
|
<span className="text-sm text-gray-400 ml-1">(Region name)</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
@@ -150,6 +160,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
AccessKey
|
AccessKey
|
||||||
|
<RequiredBadge />
|
||||||
<span className="text-sm text-gray-400 ml-1">(Access Key / Access ID)</span>
|
<span className="text-sm text-gray-400 ml-1">(Access Key / Access ID)</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
@@ -161,6 +172,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
SecretKey
|
SecretKey
|
||||||
|
<RequiredBadge />
|
||||||
<span className="text-sm text-gray-400 ml-1">(Secret Key / Secret Access Key)</span>
|
<span className="text-sm text-gray-400 ml-1">(Secret Key / Secret Access Key)</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
@@ -172,6 +184,7 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
Bucket
|
Bucket
|
||||||
|
<RequiredBadge />
|
||||||
<span className="text-sm text-gray-400 ml-1">(Bucket name)</span>
|
<span className="text-sm text-gray-400 ml-1">(Bucket name)</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
@@ -187,8 +200,8 @@ const CreateStorageServiceDialog: React.FC<Props> = (props: Props) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography className="!mb-1" level="body2">
|
<Typography className="!mb-1" level="body2">
|
||||||
<p className="text-sm text-gray-400 ml-1">{"You can use {year}, {month}, {day}, {hour}, {minute}, {second},"}</p>
|
<p className="text-sm text-gray-400 ml-1">{"You can use {year}, {month}, {day}, {hour}, {minute}, {second},"}</p>
|
||||||
<p className="text-sm text-gray-400 ml-1">{"{filetype}, {filename}, {timestamp} and any other words."}</p>
|
<p className="text-sm text-gray-400 ml-1">{"{filename}, {timestamp} and any other words."}</p>
|
||||||
<p className="text-sm text-gray-400 ml-1">{"e.g., {year}/{month}/{day}/your/path/{filename}.{filetype}"}</p>
|
<p className="text-sm text-gray-400 ml-1">{"e.g., {year}/{month}/{day}/your/path/{filename}"}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Input
|
<Input
|
||||||
className="mb-2"
|
className="mb-2"
|
||||||
|
11
web/src/components/RequiredBadge.tsx
Normal file
11
web/src/components/RequiredBadge.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
interface Props {
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const RequiredBadge: React.FC<Props> = (props: Props) => {
|
||||||
|
const { className } = props;
|
||||||
|
|
||||||
|
return <span className={`mx-0.5 text-red-500 font-bold ${className ?? ""}`}>*</span>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RequiredBadge;
|
Reference in New Issue
Block a user