-
-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): add nextjs env viriable & fix next build errors(#517)
* feat: function deploy * feat: add file upload * update: edit bucket modal * refactor: react query best practice * fix: add nextjs env viriable & fix next build errors
- Loading branch information
Showing
14 changed files
with
217 additions
and
25 deletions.
There are no files selected for viewing
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,2 @@ | ||
NEXT_PUBLIC_API_SERVER=http://localhost:3000 | ||
NEXT_PUBLIC_LOGIN_PATH=http://localhost:3000/v1/login |
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
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,32 @@ | ||
import AWS from "aws-sdk"; | ||
import useGlobalStore from "pages/globalStore"; | ||
type Credentials = { | ||
accessKeyId: string; | ||
secretAccessKey: string; | ||
sessionToken: string; | ||
}; | ||
|
||
const useOss = (credentials: Credentials) => { | ||
const { currentApp } = useGlobalStore(); | ||
const region = "us-east-1"; | ||
const endpoint = `http://${currentApp.name}.oss-${region}.com`; | ||
|
||
AWS.config.update({ | ||
accessKeyId: "YOUR_ACCESS_KEY_HERE", | ||
secretAccessKey: "YOUR_SECRET_ACCESS_KEY_HERE", | ||
}); | ||
|
||
const myBucket = new AWS.S3({ | ||
accessKeyId: credentials.accessKeyId, | ||
secretAccessKey: credentials.secretAccessKey, | ||
sessionToken: credentials.sessionToken, | ||
endpoint: endpoint, | ||
s3ForcePathStyle: true, | ||
signatureVersion: "v4", | ||
region, | ||
}); | ||
|
||
return myBucket; | ||
}; | ||
|
||
export default useOss; |
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
4 changes: 2 additions & 2 deletions
4
web/pages/app/[app_id]/database/CollectionDataList/mods/IndexPannel/index.tsx
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
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
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 |
---|---|---|
|
@@ -95,3 +95,8 @@ export const useFileListQuery = () => { | |
{}, | ||
); | ||
}; | ||
|
||
const server = () => { | ||
return null; | ||
}; | ||
export default server; |
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
Oops, something went wrong.