Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
front-backend
Commits
c7518278
Commit
c7518278
authored
Nov 27, 2019
by
zhanghouying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提供测试连接按钮,测试配置信息是否正确
parent
2d1d4e82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
src/api/mnt/serverDeploy.js
+8
-0
src/views/mnt/server/index.vue
+22
-3
No files found.
src/api/mnt/serverDeploy.js
View file @
c7518278
...
...
@@ -23,4 +23,12 @@ export function edit(data) {
})
}
export
function
testConnect
(
data
)
{
return
request
({
url
:
'api/serverDeploy/testConnect'
,
method
:
'post'
,
data
})
}
export
default
{
add
,
edit
,
del
}
src/views/mnt/server/index.vue
View file @
c7518278
...
...
@@ -24,7 +24,8 @@
type=
"primary"
icon=
"el-icon-plus"
@
click=
"showAddFormDialog"
>
新增
</el-button>
>
新增
</el-button>
</div>
<!--表单组件-->
<el-dialog
:append-to-body=
"true"
:close-on-click-modal=
"false"
:visible
.
sync=
"dialog"
:title=
"getFormTitle()"
width=
"470px"
>
...
...
@@ -42,7 +43,8 @@
<el-input
v-model=
"form.account"
style=
"width: 370px"
/>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form.password"
type=
"password"
style=
"width: 370px"
/>
<el-input
v-model=
"form.password"
type=
"password"
style=
"width: 200px"
/>
<el-button
:loading=
"loading"
type=
"success"
style=
"align: right;"
@
click=
"testConnectServer"
>
测试连接
</el-button>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -94,7 +96,7 @@
<
script
>
import
crud
from
'@/mixins/crud'
import
crudServer
from
'@/api/mnt/serverDeploy'
import
{
crudServer
,
testConnect
}
from
'@/api/mnt/serverDeploy'
import
{
validateIP
}
from
'@/utils/validate'
export
default
{
mixins
:
[
crud
],
...
...
@@ -134,6 +136,23 @@ export default {
async
beforeInit
()
{
this
.
url
=
'api/serverDeploy'
return
true
},
testConnectServer
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
loading
=
true
testConnect
(
this
.
form
).
then
((
res
)
=>
{
this
.
loading
=
false
this
.
$notify
({
title
:
res
?
'连接成功'
:
'连接失败'
,
type
:
res
?
'success'
:
'error'
,
duration
:
2500
})
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
})
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment