Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/server/nginx_conf/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ location ^~ /test {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_http_version 1.1;
add_header X-Cache $upstream_cache_status;
add_header Cache-Control no-cache;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/modules/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const GlobalStore = defineStore({
state.themeConfig.theme === 'dark' ||
(state.themeConfig.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches),
isDarkGoldTheme: (state) => state.themeConfig.primary === '#F0BE96' && state.isProductPro,
docsUrl: (state) => (state.isIntl ? 'https://docs.1panel.pro' : 'https://1panel.cn/docs'),
docsUrl: (state) => (state.isIntl ? 'https://docs.1panel.pro' : 'https://1panel.cn/docs/v1'),
},
actions: {
setOpenMenuTabs(openMenuTabs: boolean) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be an issue with modifying the docsUrl getter function in your Vuex store. Currently, it's returning different URLs based on whether state.isIntl is true or false, but this does not account for the version change from v1 to v2.

Suggested Changes:

@@ -49,7 +49,7 @@ const GlobalStore = defineStore({
             state.themeConfig.theme === 'dark' ||
             (state.themeConfig.theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches),
         isDarkGoldTheme: (state) => state.themeConfig.primary === '#F0BE96' && state.isProductPro,
-        docsUrl: (state) => (state.isIntl ? 'https://docs.1panel.pro' : 'https://1panel.cn/docs'),
+        docsUrl: (state) => (state.isIntl ? 'https://docs.1panel.pro' : `https://1panel.cn/docs/v${parseInt(state.versionNumber[1])}`), // Assuming state.versionNumber contains a string representation of the current version
     },

Explanation:

The new suggestion assumes that there is a property called versionNumber within your state which represents the current application version number as a dotted decimal string ("vX.Y"). This allows you to dynamically construct the documentation URL depending on the specific version being used instead of always returning the same fixed URL.

Replace "v1" in the example with 'v' + parseInt(state.versionNumber[1]), assuming state.versionNumber looks like ["", "1"]. The first element of versionNumber will be empty by default when versionNumber is undefined or null, avoiding any potential errors with indexing. Make sure to adjust this logic if your implementation structure differs from what I have described here.

Expand Down
Loading