From 7529296dd54df6727a4ab1502cfd82e0b68bc9cf Mon Sep 17 00:00:00 2001 From: Zeng1998 Date: Sat, 18 Mar 2023 22:06:15 +0800 Subject: [PATCH] chore: remove {filetype} in path template (#1377) * chore: remove {filetype} in path template * fix go-static-check * update --- server/resource.go | 2 -- store/idp.go | 4 +++- .../components/CreateStorageServiceDialog.tsx | 19 ++++++++++++++++--- web/src/components/RequiredBadge.tsx | 11 +++++++++++ 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 web/src/components/RequiredBadge.tsx diff --git a/server/resource.go b/server/resource.go index a463ac59..f638bc94 100644 --- a/server/resource.go +++ b/server/resource.go @@ -147,8 +147,6 @@ func (s *Server) registerResourceRoutes(g *echo.Group) { switch s { case "{filename}": return filename - case "{filetype}": - return filetype case "{timestamp}": return fmt.Sprintf("%d", t.Unix()) case "{year}": diff --git a/store/idp.go b/store/idp.go index 72b0ca3d..9958757b 100644 --- a/store/idp.go +++ b/store/idp.go @@ -289,6 +289,8 @@ func listIdentityProviders(ctx context.Context, tx *sql.Tx, find *FindIdentityPr } identityProviderMessages = append(identityProviderMessages, &identityProviderMessage) } - + if err := rows.Err(); err != nil { + return nil, FormatError(err) + } return identityProviderMessages, nil } diff --git a/web/src/components/CreateStorageServiceDialog.tsx b/web/src/components/CreateStorageServiceDialog.tsx index 6cae3377..72f99828 100644 --- a/web/src/components/CreateStorageServiceDialog.tsx +++ b/web/src/components/CreateStorageServiceDialog.tsx @@ -4,6 +4,7 @@ import { Button, Input, Typography } from "@mui/joy"; import * as api from "../helpers/api"; import { generateDialog } from "./Dialog"; import Icon from "./Icon"; +import RequiredBadge from "./RequiredBadge"; interface Props extends DialogProps { storage?: ObjectStorage; @@ -48,7 +49,13 @@ const CreateStorageServiceDialog: React.FC = (props: Props) => { return false; } 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; } } @@ -113,6 +120,7 @@ const CreateStorageServiceDialog: React.FC = (props: Props) => {
Name + = (props: Props) => { /> EndPoint + (S3-compatible server URL) = (props: Props) => { /> Region + (Region name) = (props: Props) => { /> AccessKey + (Access Key / Access ID) = (props: Props) => { /> SecretKey + (Secret Key / Secret Access Key) = (props: Props) => { /> Bucket + (Bucket name) = (props: Props) => {

{"You can use {year}, {month}, {day}, {hour}, {minute}, {second},"}

-

{"{filetype}, {filename}, {timestamp} and any other words."}

-

{"e.g., {year}/{month}/{day}/your/path/{filename}.{filetype}"}

+

{"{filename}, {timestamp} and any other words."}

+

{"e.g., {year}/{month}/{day}/your/path/{filename}"}

= (props: Props) => { + const { className } = props; + + return *; +}; + +export default RequiredBadge;