提交 32954c37 编写于 作者: 雨爱无痕

Fix issue

上级 b831982e
......@@ -61,7 +61,7 @@ func (r *ProxyRepo) Create(proxy model.Proxy) (id uint, err error) {
func (r *ProxyRepo) Update(proxy model.Proxy) error {
po, err := r.FindDuplicate(proxy.Path, proxy.ID)
if po.ID != 0 {
return errors.New(fmt.Sprintf("%s远程代理已存在", proxy.Path))
return errors.New(fmt.Sprintf("%s执行节点已存在", proxy.Path))
}
err = r.DB.Model(&model.Proxy{}).Where("id = ?", proxy.ID).Updates(&proxy).Error
......
......@@ -86,14 +86,14 @@ export default {
'interpreter_path': '可执行文件路径',
'script_lang': '脚本语言',
'remote_proxy': '远程代理',
'remote_proxy': '执行节点',
'proxy_desc': '执行脚本会上传到代理服务器(用户根目录/ztf/proxyExecDir),请提前将脚本依赖部署于代理服务器',
'create_remote_proxy': '新建远程代理',
'edit_remote_proxy': '编辑远程代理',
'proxy_link': '远程代理地址',
'create_remote_proxy': '新建执行节点',
'edit_remote_proxy': '编辑执行节点',
'proxy_link': '执行节点地址',
'proxy_lang': '代理语言',
'copy_from': '复制自',
'pls_input_proxy_link': '请输入远程代理地址',
'pls_input_proxy_link': '请输入执行节点地址',
'git_auth_type': 'git 登录方式',
'rsa_path': '密钥路径',
......
......@@ -5,6 +5,7 @@
suffix-icon="caret-down"/>
<DropdownMenu
v-if="proxies.length>0"
toggle="#proxyMenuToggle"
class="padding-0-bottom"
:items="proxies"
......@@ -30,7 +31,9 @@ const store = useStore<{ proxy: ProxyData }>();
store.dispatch("proxy/fetchProxies");
const proxies = computed<any[]>(() => {
const proxiesList = [...store.state.proxy.proxies]
proxiesList.push({id:0, name: t('local'), path: 'local'})
if(proxiesList.length > 0){
proxiesList.push({id:0, name: t('local_proxy'), path: 'local'})
}
return proxiesList
});
const currProxy = computed<any>(() => store.state.proxy.currProxy);
......
......@@ -206,7 +206,7 @@ const store = useStore<{ global: GlobalData, proxy: ProxyData }>();
store.dispatch("proxy/fetchProxies");
const remoteProxies = computed<any[]>(() => {
const proxiesList = [...store.state.proxy.proxies]
proxiesList.push({id:0, name: t('local'), path: 'local'})
proxiesList.push({id:0, name: t('local_proxy'), path: 'local'})
return proxiesList
});
const serverUrl = computed<any>(() => store.state.global.serverUrl);
......@@ -427,6 +427,7 @@ const handleRemoveProxy = (item) => {
cancelText: t("cancel"),
onOk: async () => {
await removeProxy(item.value.id);
store.dispatch("proxy/fetchProxies");
list();
},
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册