Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
3bf85616
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
11 个月 前同步成功
通知
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 搜索 >>
提交
3bf85616
编写于
9月 29, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the scroll bug caused by new gocui lib
上级
8e3e950c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
8 deletion
+16
-8
src/service/zentao/field.go
src/service/zentao/field.go
+11
-7
src/ui/page/cui.go
src/ui/page/cui.go
+0
-1
src/ui/widget/widgetSelect.go
src/ui/widget/widgetSelect.go
+3
-0
src/utils/stdin/stdin.go
src/utils/stdin/stdin.go
+2
-0
未找到文件。
src/service/zentao/field.go
浏览文件 @
3bf85616
...
...
@@ -34,16 +34,16 @@ func GetBugFiledOptions(productId int) {
bugFields
.
Modules
=
fieldMapToListOrderByInt
(
mp
)
mp
,
_
=
jsonData
.
Get
(
"categories"
)
.
Map
()
bugFields
.
Categories
=
fieldMapToListOrderByStr
(
mp
)
bugFields
.
Categories
=
fieldMapToListOrderByStr
(
mp
,
false
)
mp
,
_
=
jsonData
.
Get
(
"versions"
)
.
Map
()
bugFields
.
Versions
=
fieldMapToListOrderByStr
(
mp
)
bugFields
.
Versions
=
fieldMapToListOrderByStr
(
mp
,
true
)
mp
,
_
=
jsonData
.
Get
(
"severities"
)
.
Map
()
bugFields
.
Severities
=
fieldMapToListOrderByInt
(
mp
)
arr
,
_
:=
jsonData
.
Get
(
"priorities"
)
.
Array
()
bugFields
.
Priorities
=
fieldArrToListKeyStr
(
arr
)
bugFields
.
Priorities
=
fieldArrToListKeyStr
(
arr
,
true
)
}
else
{
logUtils
.
PrintToCmd
(
err
.
Error
(),
color
.
FgRed
)
...
...
@@ -95,7 +95,7 @@ func fieldMapToListOrderByInt(mp map[string]interface{}) []model.Option {
return
arr
}
func
fieldMapToListOrderByStr
(
mp
map
[
string
]
interface
{})
[]
model
.
Option
{
func
fieldMapToListOrderByStr
(
mp
map
[
string
]
interface
{}
,
notNull
bool
)
[]
model
.
Option
{
arr
:=
make
([]
model
.
Option
,
0
)
keys
:=
make
([]
string
,
0
)
...
...
@@ -108,7 +108,9 @@ func fieldMapToListOrderByStr(mp map[string]interface{}) []model.Option {
for
_
,
key
:=
range
keys
{
name
:=
strings
.
TrimSpace
(
mp
[
key
]
.
(
string
))
if
name
==
""
{
name
=
"-"
if
notNull
{
continue
}
}
opt
:=
model
.
Option
{
Id
:
key
,
Name
:
name
}
...
...
@@ -118,7 +120,7 @@ func fieldMapToListOrderByStr(mp map[string]interface{}) []model.Option {
return
arr
}
func
fieldArrToListKeyStr
(
arr0
[]
interface
{})
[]
model
.
Option
{
func
fieldArrToListKeyStr
(
arr0
[]
interface
{}
,
notNull
bool
)
[]
model
.
Option
{
arr
:=
make
([]
model
.
Option
,
0
)
keys
:=
make
([]
string
,
0
)
...
...
@@ -131,7 +133,9 @@ func fieldArrToListKeyStr(arr0 []interface{}) []model.Option {
for
_
,
val
:=
range
arr0
{
name
:=
val
.
(
string
)
if
name
==
""
{
name
=
"-"
if
notNull
{
continue
}
}
opt
:=
model
.
Option
{
Id
:
val
.
(
string
),
Name
:
name
}
...
...
src/ui/page/cui.go
浏览文件 @
3bf85616
...
...
@@ -24,7 +24,6 @@ func CuiReportBug(dir string, id string) error {
vari
.
RunFromCui
=
true
InitMainPage
()
InitReportBugPage
(
dir
,
id
)
if
err
:=
g
.
MainLoop
();
err
!=
nil
&&
err
!=
gocui
.
ErrQuit
{
...
...
src/ui/widget/widgetSelect.go
浏览文件 @
3bf85616
...
...
@@ -5,6 +5,7 @@ import (
"github.com/awesome-gocui/gocui"
"github.com/easysoft/zentaoatf/src/model"
"github.com/easysoft/zentaoatf/src/ui"
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
"github.com/easysoft/zentaoatf/src/utils/vari"
"strings"
)
...
...
@@ -52,6 +53,8 @@ func (w *SelectWidget) Layout() (*gocui.View, error) {
v
.
Title
=
w
.
title
logUtils
.
PrintToCmd
(
fmt
.
Sprintf
(
"%s: defalut=%s"
,
v
.
Name
(),
w
.
defaultt
),
-
1
)
labels
:=
make
([]
string
,
0
)
defaultValIndex
:=
-
1
for
idx
,
opt
:=
range
w
.
options
{
...
...
src/utils/stdin/stdin.go
浏览文件 @
3bf85616
...
...
@@ -107,6 +107,8 @@ func GetInput(regx string, defaultVal string, fmtStr string, params ...interface
// fmt.Scanln(&ret)
Scanf
(
&
ret
)
//logUtils.PrintToStdOut(fmt.Sprintf("%v", ret), -1)
if
strings
.
TrimSpace
(
ret
)
==
""
&&
defaultVal
!=
""
{
ret
=
defaultVal
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录