-
-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: fix envs like
CUSTOM_MODELS
don't work with docker deployment (
#773) * ♻️ refactor: refactor the FileList * 🐛 fix: fix agent market index not work with docker * 🐛 fix: fix CUSTOM_MODEL don't work with docker deployment * ✅ test: add test * 📝 docs: update docs
- Loading branch information
Showing
35 changed files
with
243 additions
and
264 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
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
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,15 @@ | ||
import { getServerConfig } from '@/config/server'; | ||
import { GlobalServerConfig } from '@/types/settings'; | ||
|
||
export const runtime = 'edge'; | ||
|
||
/** | ||
* get Server config to client | ||
*/ | ||
export const GET = async () => { | ||
const { CUSTOM_MODELS } = getServerConfig(); | ||
|
||
const config: GlobalServerConfig = { customModelName: CUSTOM_MODELS }; | ||
|
||
return new Response(JSON.stringify(config)); | ||
}; |
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,25 @@ | ||
import urlJoin from 'url-join'; | ||
|
||
import { getServerConfig } from '@/config/server'; | ||
import { DEFAULT_LANG, checkLang } from '@/const/locale'; | ||
import { Locales } from '@/locales/resources'; | ||
|
||
export class AgentMarket { | ||
private readonly baseUrl: string; | ||
|
||
constructor(baseUrl?: string) { | ||
this.baseUrl = baseUrl || getServerConfig().AGENTS_INDEX_URL; | ||
} | ||
|
||
getAgentIndexUrl = (lang: Locales = DEFAULT_LANG) => { | ||
if (checkLang(lang)) return this.baseUrl; | ||
|
||
return urlJoin(this.baseUrl, `index.${lang}.json`); | ||
}; | ||
|
||
getAgentUrl = (identifier: string, lang: Locales = DEFAULT_LANG) => { | ||
if (checkLang(lang)) return urlJoin(this.baseUrl, `${identifier}.json`); | ||
|
||
return urlJoin(this.baseUrl, `${identifier}.${lang}.json`); | ||
}; | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,24 +1 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
export const MIN_IMAGE_SIZE = 64; | ||
export const MAX_SIZE_DESKTOP = 640; | ||
export const MAX_SIZE_MOBILE = 280; | ||
export const useStyles = createStyles( | ||
({ css }, { col, gap, max, min }: { col: number; gap: number; max: number; min: number }) => ({ | ||
container: css` | ||
display: grid; | ||
grid-gap: ${gap}px; | ||
grid-template-columns: repeat(${col}, 1fr); | ||
width: 100%; | ||
max-width: ${max}px; | ||
& > div { | ||
width: 100%; | ||
min-width: ${min}px; | ||
min-height: ${min}px; | ||
max-height: ${(max - gap * (col - 1)) / col}px; | ||
} | ||
`, | ||
}), | ||
); |
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
Oops, something went wrong.