diff --git a/app/middleware/proxy.js b/app/middleware/proxy.js index ba2200c..353619e 100644 --- a/app/middleware/proxy.js +++ b/app/middleware/proxy.js @@ -42,6 +42,8 @@ module.exports = async function httpproxy(ctx, next) { pathRewrite:{ [`^/proxy/${serverId}`]:'' }, + timeout: 33000, + proxyTimeout: 36000, changeOrigin: true }))(ctx,next) } diff --git a/app/utils/articleSubscription.js b/app/utils/articleSubscription.js index 57d4ee1..35a3995 100644 --- a/app/utils/articleSubscription.js +++ b/app/utils/articleSubscription.js @@ -56,7 +56,7 @@ const getGithubTrendingFromJueJin = async (id, groupName, siteName, topicName, t } } -// github trending from Serverless +// github trending from Serverless,目前使用的是该方法 const getGithubTrendingFromServerless = async (id, groupName, siteName, topicName, topicUrl, webHook, app) => { try { const pageSize = app.config.articleSubscription.pageSize diff --git a/app/web/pages/proxyServer/index.tsx b/app/web/pages/proxyServer/index.tsx index dd99fb5..90e3d28 100644 --- a/app/web/pages/proxyServer/index.tsx +++ b/app/web/pages/proxyServer/index.tsx @@ -97,7 +97,7 @@ class ProxyServer extends React.PureComponent { }) } getProxyServerList = (checked?: boolean) => { - const { mainTableParams } = this.state; + const { mainTableParams, collectTagList } = this.state; this.setState({ mainTableLoading: true }); @@ -114,6 +114,18 @@ class ProxyServer extends React.PureComponent { if (data?.data?.length === 1) { this.handleTableExpandChange(true, data.data[0]) } + + // 项目被删除,但是收藏还在,这种历史数据的兼容处理。再次点击收藏的项目时去除该收藏的项目 + if (!data?.data?.length && mainTableParams.projectId !== undefined) { + localStorage.setItem('collection-tags', JSON.stringify(collectTagList.filter(item => item.id !== mainTableParams.projectId))); + this.getCollectTagList(); + this.setState({ + mainTableParams: { + ...mainTableParams, + projectId: undefined + } + }, this.getProxyServerList); + } } }).finally(() => { this.setState({ @@ -239,6 +251,7 @@ class ProxyServer extends React.PureComponent { }); } handleProxyServerDelete = (row: any) => { + const { collectTagList } = this.state; const { id, name } = row; confirm({ title: '确认', @@ -250,6 +263,8 @@ class ProxyServer extends React.PureComponent { const { success } = response; if (success) { Message.success('代理服务删除成功'); + localStorage.setItem('collection-tags', JSON.stringify(collectTagList.filter(item => item.id !== id))); + this.getCollectTagList(); this.getProxyServerList(); } }); diff --git a/app/web/pages/webTerminal/index.tsx b/app/web/pages/webTerminal/index.tsx index d1bdfcf..41accc5 100644 --- a/app/web/pages/webTerminal/index.tsx +++ b/app/web/pages/webTerminal/index.tsx @@ -133,7 +133,7 @@ const WebTerminal: React.FC = (props: any) => { const cursorOffSetLength = getCursorOffsetLength(totalOffsetLength - currentOffsetLength, '\x1b[D') terminal.write( '\x1b[?K' + `${key}${inputText.slice(currentOffsetLength - prefix.length)}`) // 在当前的坐标写上 key 和坐标后面的字符 terminal.write(cursorOffSetLength) // 移动停留在当前位置的光标 - inputText = inputText.slice(0, currentOffsetLength) + key + inputText.slice(totalOffsetLength - currentOffsetLength) + inputText = inputText.slice(0, currentOffsetLength - prefix.length) + key + inputText.slice(currentOffsetLength - prefix.length) } }) } diff --git a/config/config.prod.js b/config/config.prod.js index fcd0676..f9ab3c7 100644 --- a/config/config.prod.js +++ b/config/config.prod.js @@ -24,10 +24,10 @@ module.exports = () => { password: password || '', // 设置连接池 pool: { - max: 10, //最大连接个数 - min: 0, - acquire: 30000, // 从连接池获取连接的最长等待时间(毫秒) - idle: 10000 // 连接池中空闲连接的最长存活时间(毫秒) + max: 140, //最大连接个数 + min: 50, + acquire: 40000, // 从连接池获取连接的最长等待时间(毫秒) + idle: 15000 // 连接池中空闲连接的最长存活时间(毫秒) } } ] diff --git "a/docs/docsify/zh-cn/guide/\351\205\215\347\275\256\344\270\255\345\277\203.md" "b/docs/docsify/zh-cn/guide/\351\205\215\347\275\256\344\270\255\345\277\203.md" index c86b608..f8bd5f1 100644 --- "a/docs/docsify/zh-cn/guide/\351\205\215\347\275\256\344\270\255\345\277\203.md" +++ "b/docs/docsify/zh-cn/guide/\351\205\215\347\275\256\344\270\255\345\277\203.md" @@ -18,6 +18,6 @@ ## 编辑配置 -点击编辑文件,修改当前文件配置。 +点击编辑文件,修改当前文件配置,点击右上角的应用按钮即可生效。 -![配置详情](../../imgs/config_detail.png) \ No newline at end of file +![配置详情](../../imgs/config_detail.png)