Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
7db1d9d7
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
10 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7db1d9d7
编写于
6月 10, 2022
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issues
上级
1ec5a4f7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
54 addition
and
20 deletion
+54
-20
internal/comm/helper/config/config.go
internal/comm/helper/config/config.go
+6
-5
internal/comm/helper/stdin/stdin.go
internal/comm/helper/stdin/stdin.go
+8
-0
internal/command/config/config.go
internal/command/config/config.go
+5
-2
internal/pkg/lib/http/http.go
internal/pkg/lib/http/http.go
+33
-11
ui/src/layouts/MainLayout/Main.vue
ui/src/layouts/MainLayout/Main.vue
+1
-1
ui/src/layouts/MainLayout/style/var.css
ui/src/layouts/MainLayout/style/var.css
+1
-1
未找到文件。
internal/comm/helper/config/config.go
浏览文件 @
7db1d9d7
...
...
@@ -25,14 +25,15 @@ func LoadBySite(site model.Site) (config commDomain.WorkspaceConf) {
return
config
}
func
LoadByWorkspacePath
(
workspacePath
string
)
(
config
commDomain
.
WorkspaceConf
)
{
pth
:=
filepath
.
Join
(
workspacePath
,
commConsts
.
ConfigDir
,
commConsts
.
ConfigFile
)
ini
.
MapTo
(
&
config
,
pth
)
func
LoadByConfigPath
(
configPath
string
)
(
config
commDomain
.
WorkspaceConf
)
{
ini
.
MapTo
(
&
config
,
configPath
)
config
.
Url
=
commonUtils
.
AddSlashForUrl
(
config
.
Url
)
return
config
}
func
LoadByWorkspacePath
(
workspacePath
string
)
(
config
commDomain
.
WorkspaceConf
)
{
pth
:=
filepath
.
Join
(
workspacePath
,
commConsts
.
ConfigDir
,
commConsts
.
ConfigFile
)
return
LoadByConfigPath
(
pth
)
}
func
UpdateSite
(
site
model
.
Site
,
workspacePath
string
)
(
err
error
)
{
config
:=
LoadByWorkspacePath
(
workspacePath
)
...
...
internal/comm/helper/stdin/stdin.go
浏览文件 @
7db1d9d7
...
...
@@ -6,6 +6,7 @@ import (
commDomain
"github.com/easysoft/zentaoatf/internal/comm/domain"
configHelper
"github.com/easysoft/zentaoatf/internal/comm/helper/config"
scriptHelper
"github.com/easysoft/zentaoatf/internal/comm/helper/script"
zentaoHelper
"github.com/easysoft/zentaoatf/internal/comm/helper/zentao"
commonUtils
"github.com/easysoft/zentaoatf/internal/pkg/lib/common"
i118Utils
"github.com/easysoft/zentaoatf/internal/pkg/lib/i118"
logUtils
"github.com/easysoft/zentaoatf/internal/pkg/lib/log"
...
...
@@ -120,11 +121,18 @@ func InputForSet(dir string) {
stdinUtils
.
InputForBool
(
&
configSite
,
true
,
"config_zentao_site"
)
if
configSite
{
SetZentao
:
conf
.
Url
=
stdinUtils
.
GetInput
(
"((http|https)://.*)"
,
conf
.
Url
,
"enter_url"
,
conf
.
Url
)
conf
.
Url
=
getZenTaoBaseUrl
(
conf
.
Url
)
conf
.
Username
=
stdinUtils
.
GetInput
(
"(.{2,})"
,
conf
.
Username
,
"enter_account"
,
conf
.
Username
)
conf
.
Password
=
stdinUtils
.
GetInput
(
"(.{2,})"
,
conf
.
Password
,
"enter_password"
,
conf
.
Password
)
err
:=
zentaoHelper
.
Login
(
conf
)
if
err
!=
nil
{
goto
SetZentao
}
}
if
commonUtils
.
IsWin
()
{
...
...
internal/command/config/config.go
浏览文件 @
7db1d9d7
...
...
@@ -27,11 +27,14 @@ func InitConfig() {
commConsts
.
WorkDir
=
fileUtils
.
GetWorkDir
()
commConsts
.
ZtfDir
=
fileUtils
.
GetZTFDir
()
commConsts
.
ConfigPath
=
commConsts
.
WorkDir
+
commConsts
.
ConfigFile
commConsts
.
ConfigPath
=
filepath
.
Join
(
commConsts
.
WorkDir
,
commConsts
.
ConfigDir
,
commConsts
.
ConfigFile
)
if
commConsts
.
IsRelease
{
commConsts
.
ConfigPath
=
commConsts
.
ZtfDir
+
commConsts
.
ConfigFile
commConsts
.
ConfigPath
=
filepath
.
Join
(
commConsts
.
ZtfDir
,
commConsts
.
ConfigDir
,
commConsts
.
ConfigFile
)
}
config
:=
configHelper
.
LoadByConfigPath
(
commConsts
.
ConfigPath
)
commConsts
.
Language
=
config
.
Language
v
:=
viper
.
New
()
serverConfig
.
VIPER
=
v
serverConfig
.
VIPER
.
SetConfigType
(
"yaml"
)
...
...
internal/pkg/lib/http/http.go
浏览文件 @
7db1d9d7
...
...
@@ -13,13 +13,17 @@ import (
)
func
Get
(
url
string
)
(
ret
[]
byte
,
err
error
)
{
logUtils
.
Infof
(
"===DEBUG=== request: %s"
,
url
)
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
"===DEBUG=== request: %s"
,
url
)
}
client
:=
&
http
.
Client
{}
req
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
nil
)
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"get request failed, error: %s."
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"get request failed, error: %s."
,
err
.
Error
()))
}
return
}
...
...
@@ -30,12 +34,16 @@ func Get(url string) (ret []byte, err error) {
resp
,
err
:=
client
.
Do
(
req
)
defer
resp
.
Body
.
Close
()
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"get request failed, error: %s."
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"get request failed, error: %s."
,
err
.
Error
()))
}
return
}
if
!
IsSuccessCode
(
resp
.
StatusCode
)
{
logUtils
.
Infof
(
color
.
RedString
(
"read response failed, StatusCode: %d."
,
resp
.
StatusCode
))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"read response failed, StatusCode: %d."
,
resp
.
StatusCode
))
}
err
=
errors
.
New
(
resp
.
Status
)
return
}
...
...
@@ -46,7 +54,9 @@ func Get(url string) (ret []byte, err error) {
}
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"read response failed, error "
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"read response failed, error "
,
err
.
Error
()))
}
return
}
...
...
@@ -75,7 +85,9 @@ func Put(url string, data interface{}) (ret []byte, err error) {
}
func
PostOrPut
(
url
string
,
method
string
,
data
interface
{})
(
ret
[]
byte
,
err
error
)
{
logUtils
.
Infof
(
"===DEBUG=== request: %s"
,
url
)
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
"===DEBUG=== request: %s"
,
url
)
}
client
:=
&
http
.
Client
{}
...
...
@@ -85,7 +97,9 @@ func PostOrPut(url string, method string, data interface{}) (ret []byte, err err
}
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"marshal request failed, error: %s."
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"marshal request failed, error: %s."
,
err
.
Error
()))
}
return
}
...
...
@@ -93,7 +107,9 @@ func PostOrPut(url string, method string, data interface{}) (ret []byte, err err
req
,
err
:=
http
.
NewRequest
(
method
,
url
,
strings
.
NewReader
(
dataStr
))
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"post request failed, error: %s."
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"post request failed, error: %s."
,
err
.
Error
()))
}
return
}
...
...
@@ -105,12 +121,16 @@ func PostOrPut(url string, method string, data interface{}) (ret []byte, err err
resp
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"post request failed, error: %s."
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"post request failed, error: %s."
,
err
.
Error
()))
}
return
}
if
!
IsSuccessCode
(
resp
.
StatusCode
)
{
logUtils
.
Infof
(
color
.
RedString
(
"post request return '%s'."
,
resp
.
Status
))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"post request return '%s'."
,
resp
.
Status
))
}
err
=
errors
.
New
(
resp
.
Status
)
return
}
...
...
@@ -123,7 +143,9 @@ func PostOrPut(url string, method string, data interface{}) (ret []byte, err err
}
if
err
!=
nil
{
logUtils
.
Infof
(
color
.
RedString
(
"read response failed, error: %s."
,
err
.
Error
()))
if
commConsts
.
Verbose
{
logUtils
.
Infof
(
color
.
RedString
(
"read response failed, error: %s."
,
err
.
Error
()))
}
return
}
...
...
ui/src/layouts/MainLayout/Main.vue
浏览文件 @
7db1d9d7
...
...
@@ -109,7 +109,7 @@ onBeforeUnmount( () => {
}
#centerPane {
min-width:
var(--pane-center-min-width, 100px)
;
min-width:
500px
;
#tabsPane {
min-width: var(--pane-tabs-min-width, 100px);
...
...
ui/src/layouts/MainLayout/style/var.css
浏览文件 @
7db1d9d7
...
...
@@ -158,7 +158,7 @@
/* Panel settings 面板设置 */
--pane-left-min-width
:
230px
;
--pane-center-min-width
:
1
00px
;
--pane-center-min-width
:
5
00px
;
--pane-right-min-width
:
200px
;
--pane-tabs-min-height
:
200px
;
--pane-bottom-min-height
:
200px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录