File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const props = defineProps<{
1414}>()
1515
1616const { server } = useOpenApi (inject (' collectionName' ))
17+ const { replaceVariables } = useVariableReplacement ()
1718
1819const colorsMap: colorsProps = {
1920 get: {
@@ -52,7 +53,7 @@ function isParameter(path: string) {
5253
5354// Copy full path
5455function handleCopy() {
55- const baseUrl = server .value ?? ' '
56+ const baseUrl = replaceVariables ( server .value ?? ' ' )
5657
5758 copyText (baseUrl + props .path )
5859 isCopy .value = true
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ export const useVariableReplacement = () => {
1111 'https://statics.memtensor.com.cn' : config . public . staticCdnUrl as string ,
1212 'https://memos-playground.openmem.net' : config . public . playgroundUrl as string ,
1313 'https://memos-dashboard.openmem.net' : config . public . dashboardUrl as string ,
14- 'https://memos.openmem.net' : config . public . homeDomain as string
14+ 'https://memos.openmem.net' : config . public . homeDomain as string ,
15+ 'https://memos.memtensor.cn' : config . public . baseUrl as string
1516 }
1617
1718 Object . keys ( domains ) . forEach ( ( key ) => {
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ export default {
66 dashboardUrl : 'https://memos-dashboard.memtensor.net' ,
77 playgroundUrl : 'https://memos-playground.memtensor.net' ,
88 staticCdnUrl : 'https://cdn.memt.ai/static' ,
9- cdnUrl : 'https://cdn.memt.ai'
9+ cdnUrl : 'https://cdn.memt.ai' ,
10+ baseUrl : 'https://api.memt.ai'
1011}
Original file line number Diff line number Diff line change @@ -5,5 +5,6 @@ export default {
55 openMemUrl : 'https://pre.openmem.net' ,
66 githubMemosUrl : 'https://github.com/MemTensor/MemOS' ,
77 dashboardUrl : 'https://memos-dashboard-pre.openmem.net' ,
8- playgroundUrl : 'https://memos-playground-pre.openmem.net'
8+ playgroundUrl : 'https://memos-playground-pre.openmem.net' ,
9+ baseUrl : 'https://apigw-pre.memtensor.cn'
910}
Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ export default {
44 openMemUrl : 'https://openmem.net' ,
55 githubMemosUrl : 'https://github.com/MemTensor/MemOS' ,
66 dashboardUrl : 'https://memos-dashboard.openmem.net' ,
7- playgroundUrl : 'https://memos-playground.openmem.net'
7+ playgroundUrl : 'https://memos-playground.openmem.net' ,
8+ baseUrl : 'https://memos.memtensor.cn'
89}
Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ const config: NuxtConfig = {
109109 linkDomains : {
110110 'https://memos-playground.openmem.net' : envConfig . playgroundUrl ,
111111 'https://memos-dashboard.openmem.net' : envConfig . dashboardUrl ,
112- 'https://memos.openmem.net' : envConfig . homeDomain
112+ 'https://memos.openmem.net' : envConfig . homeDomain ,
113+ 'https://memos.memtensor.cn' : envConfig . baseUrl
113114 }
114115 }
115116 }
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ export default function remarkReplaceDomains(options = {}) {
2626 } )
2727 }
2828
29+ // Handle code blocks
30+ if ( node . type === 'code' && node . value && typeof node . value === 'string' ) {
31+ Object . keys ( linkDomains ) . forEach ( ( key ) => {
32+ const regex = new RegExp ( escapeRegExp ( key ) , 'g' )
33+ node . value = node . value . replace ( regex , linkDomains [ key ] )
34+ } )
35+ }
36+
2937 // Handle HTML nodes for both images and links
3038 if ( node . type === 'html' && node . value && typeof node . value === 'string' ) {
3139 // Replace image sources
You can’t perform that action at this time.
0 commit comments