fix: http type of test suite cannot save (#276)
This commit is contained in:
parent
375d48add4
commit
7124dc4e29
|
@ -32,6 +32,7 @@ You could choose the alternative images:
|
|||
Docker Hub: docker.io/linuxsuren/api-testing
|
||||
GitHub Container Registry: ghcr.io/linuxsuren/api-testing
|
||||
Scarf: linuxsuren.docker.scarf.sh/linuxsuren/api-testing
|
||||
AliYun: registry.aliyuncs.com/linuxsuren/api-testing
|
||||
DaoCloud: docker.m.daocloud.io/linuxsuren/api-testing`,
|
||||
PreRunE: opt.preRunE,
|
||||
RunE: opt.runE,
|
||||
|
|
|
@ -53,11 +53,16 @@ watch(props, () => {
|
|||
})
|
||||
|
||||
function save() {
|
||||
const oldImportPath = suite.value.spec.rpc.import
|
||||
let oldImportPath = ""
|
||||
let hasImport = false
|
||||
if (suite.value.spec && suite.value.spec.rpc) {
|
||||
oldImportPath = suite.value.spec.rpc.import
|
||||
hasImport = true
|
||||
if (typeof oldImportPath === 'string' && oldImportPath !== '') {
|
||||
const importPath = oldImportPath.split(',')
|
||||
suite.value.spec.rpc.import = importPath
|
||||
}
|
||||
}
|
||||
|
||||
API.UpdateTestSuite(suite.value, (e) => {
|
||||
if (e.error === "") {
|
||||
|
@ -69,9 +74,13 @@ function save() {
|
|||
ElMessage.error('Oops, ' + e.message)
|
||||
}
|
||||
|
||||
if (hasImport) {
|
||||
suite.value.spec.rpc.import = oldImportPath
|
||||
}
|
||||
}, (e) => {
|
||||
if (hasImport) {
|
||||
suite.value.spec.rpc.import = oldImportPath
|
||||
}
|
||||
ElMessage.error('Oops, ' + e)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ interface ImportSource {
|
|||
}
|
||||
|
||||
function UpdateTestSuite(suite: any,
|
||||
callback: (d: any) => {}, errHandle?: (e: any) => {} | null) {
|
||||
callback: (d: any) => void, errHandle?: (e: any) => void | null) {
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
|
|
@ -190,7 +190,7 @@ func (g *gRPCLoader) DeleteSuite(name string) (err error) {
|
|||
|
||||
func (g *gRPCLoader) Verify() (readOnly bool, err error) {
|
||||
// avoid to long to wait the response
|
||||
ctx, cancel := context.WithTimeout(g.ctx, time.Second*3)
|
||||
ctx, cancel := context.WithTimeout(g.ctx, time.Second*5)
|
||||
defer cancel()
|
||||
|
||||
var result *server.ExtensionStatus
|
||||
|
|
Loading…
Reference in New Issue