Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
5fb08ba3
Commit
5fb08ba3
authored
Mar 06, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:Database) 新增「测试连接」功能
parent
ca4510a0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
193 additions
and
2 deletions
+193
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
en.js
source/language/en.js
+4
-1
zh.js
source/language/zh.js
+4
-1
index.js
source/modules/database/asp/index.js
+60
-0
index.js
source/modules/database/custom/index.js
+60
-0
index.js
source/modules/database/php/index.js
+64
-0
No files found.
CHANGELOG.md
View file @
5fb08ba3
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
### 数据管理
### 数据管理
*
新增「测试连接」功能
*
新增「检测」功能, 检测支持的数据库函数(目前仅 PHP 有效)
*
新增「检测」功能, 检测支持的数据库函数(目前仅 PHP 有效)
*
新增 php sqlsrv 连接方式, php5.3之后 mssql 默认不存在,可使用该类型连接 sqlserver >= 2008
*
新增 php sqlsrv 连接方式, php5.3之后 mssql 默认不存在,可使用该类型连接 sqlserver >= 2008
...
...
source/language/en.js
View file @
5fb08ba3
...
@@ -438,7 +438,8 @@ module.exports = {
...
@@ -438,7 +438,8 @@ module.exports = {
toolbar
:
{
toolbar
:
{
add
:
'Add'
,
add
:
'Add'
,
clear
:
'Clear'
,
clear
:
'Clear'
,
edit
:
'Edit'
edit
:
'Edit'
,
test
:
'Test connect'
},
},
conn
:
'Connection String'
,
conn
:
'Connection String'
,
type
:
'Database type'
,
type
:
'Database type'
,
...
@@ -448,6 +449,8 @@ module.exports = {
...
@@ -448,6 +449,8 @@ module.exports = {
passwd
:
'Password'
,
passwd
:
'Password'
,
warning
:
'Please fill in the complete!'
,
warning
:
'Please fill in the complete!'
,
success
:
'Successful add configuration!'
,
success
:
'Successful add configuration!'
,
test_success
:
'Connection Successful!'
,
test_warning
:
'Response is null!'
,
del
:
{
del
:
{
title
:
'Delete configuration'
,
title
:
'Delete configuration'
,
confirm
:
'Determine delete this configuration?'
,
confirm
:
'Determine delete this configuration?'
,
...
...
source/language/zh.js
View file @
5fb08ba3
...
@@ -439,7 +439,8 @@ module.exports = {
...
@@ -439,7 +439,8 @@ module.exports = {
toolbar
:
{
toolbar
:
{
add
:
'添加'
,
add
:
'添加'
,
clear
:
'清空'
,
clear
:
'清空'
,
edit
:
'编辑'
edit
:
'编辑'
,
test
:
'测试连接'
},
},
conn
:
'连接字符串'
,
conn
:
'连接字符串'
,
type
:
'数据库类型'
,
type
:
'数据库类型'
,
...
@@ -449,6 +450,8 @@ module.exports = {
...
@@ -449,6 +450,8 @@ module.exports = {
passwd
:
'连接密码'
,
passwd
:
'连接密码'
,
warning
:
'请填写完整!'
,
warning
:
'请填写完整!'
,
success
:
'成功添加配置!'
,
success
:
'成功添加配置!'
,
test_success
:
'连接成功!'
,
test_warning
:
'返回数据为空'
,
del
:
{
del
:
{
title
:
'删除配置'
,
title
:
'删除配置'
,
confirm
:
'确定删除此配置吗?'
,
confirm
:
'确定删除此配置吗?'
,
...
...
source/modules/database/asp/index.js
View file @
5fb08ba3
...
@@ -168,6 +168,13 @@ class ASP {
...
@@ -168,6 +168,13 @@ class ASP {
type
:
'button'
,
type
:
'button'
,
icon
:
'remove'
,
icon
:
'remove'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
},
{
type
:
'separator'
},
{
id
:
'test'
,
type
:
'button'
,
icon
:
'spinner'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'test'
]
}]);
}]);
// form
// form
...
@@ -225,6 +232,29 @@ class ASP {
...
@@ -225,6 +232,29 @@ class ASP {
this
.
manager
.
list
.
imgs
[
0
]
this
.
manager
.
list
.
imgs
[
0
]
);
);
break
;
break
;
case
'test'
:
if
(
!
form
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'form'
][
'warning'
],
LANG_T
[
'warning'
]);
};
// 解析数据
let
_data
=
form
.
getValues
();
win
.
progressOn
();
this
.
core
.
request
(
this
.
core
[
`database_
${
_data
[
'type'
]}
`
].
show_databases
({
conn
:
_data
[
'conn'
]
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
}
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
break
;
}
}
});
});
}
}
...
@@ -259,6 +289,13 @@ class ASP {
...
@@ -259,6 +289,13 @@ class ASP {
type
:
'button'
,
type
:
'button'
,
icon
:
'remove'
,
icon
:
'remove'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
},
{
type
:
'separator'
},
{
id
:
'test'
,
type
:
'button'
,
icon
:
'spinner'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'test'
]
}]);
}]);
// form
// form
...
@@ -310,6 +347,29 @@ class ASP {
...
@@ -310,6 +347,29 @@ class ASP {
// 刷新 UI
// 刷新 UI
this
.
parse
();
this
.
parse
();
break
;
break
;
case
'test'
:
if
(
!
form
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'form'
][
'warning'
],
LANG_T
[
'warning'
]);
};
// 解析数据
let
_data
=
form
.
getValues
();
win
.
progressOn
();
this
.
core
.
request
(
this
.
core
[
`database_
${
_data
[
'type'
]}
`
].
show_databases
({
conn
:
_data
[
'conn'
]
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
}
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
break
;
}
}
});
});
}
}
...
...
source/modules/database/custom/index.js
View file @
5fb08ba3
...
@@ -164,6 +164,13 @@ class CUSTOM {
...
@@ -164,6 +164,13 @@ class CUSTOM {
type
:
'button'
,
type
:
'button'
,
icon
:
'remove'
,
icon
:
'remove'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
},
{
type
:
'separator'
},
{
id
:
'test'
,
type
:
'button'
,
icon
:
'spinner'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'test'
]
}]);
}]);
// form
// form
...
@@ -221,6 +228,29 @@ class CUSTOM {
...
@@ -221,6 +228,29 @@ class CUSTOM {
this
.
manager
.
list
.
imgs
[
0
]
this
.
manager
.
list
.
imgs
[
0
]
);
);
break
;
break
;
case
'test'
:
if
(
!
form
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'form'
][
'warning'
],
LANG_T
[
'warning'
]);
};
// 解析数据
let
_data
=
form
.
getValues
();
win
.
progressOn
();
this
.
core
.
request
(
this
.
core
[
`database_
${
_data
[
'type'
]}
`
].
show_databases
({
conn
:
_data
[
'conn'
]
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
}
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
break
;
}
}
});
});
}
}
...
@@ -255,6 +285,13 @@ class CUSTOM {
...
@@ -255,6 +285,13 @@ class CUSTOM {
type
:
'button'
,
type
:
'button'
,
icon
:
'remove'
,
icon
:
'remove'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
},
{
type
:
'separator'
},
{
id
:
'test'
,
type
:
'button'
,
icon
:
'spinner'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'test'
]
}]);
}]);
// form
// form
...
@@ -307,6 +344,29 @@ class CUSTOM {
...
@@ -307,6 +344,29 @@ class CUSTOM {
// 刷新 UI
// 刷新 UI
this
.
parse
();
this
.
parse
();
break
;
break
;
case
'test'
:
if
(
!
form
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'form'
][
'warning'
],
LANG_T
[
'warning'
]);
};
// 解析数据
let
_data
=
form
.
getValues
();
win
.
progressOn
();
this
.
core
.
request
(
this
.
core
[
`database_
${
_data
[
'type'
]}
`
].
show_databases
({
conn
:
_data
[
'conn'
]
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
}
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
break
;
}
}
});
});
}
}
...
...
source/modules/database/php/index.js
View file @
5fb08ba3
...
@@ -308,6 +308,13 @@ class PHP {
...
@@ -308,6 +308,13 @@ class PHP {
type
:
'button'
,
type
:
'button'
,
icon
:
'remove'
,
icon
:
'remove'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
},
{
type
:
'separator'
},
{
id
:
'test'
,
type
:
'button'
,
icon
:
'spinner'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'test'
]
}]);
}]);
// form
// form
...
@@ -436,6 +443,31 @@ class PHP {
...
@@ -436,6 +443,31 @@ class PHP {
this
.
manager
.
list
.
imgs
[
0
]
this
.
manager
.
list
.
imgs
[
0
]
);
);
break
;
break
;
case
'test'
:
if
(
!
form
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'form'
][
'warning'
],
LANG_T
[
'warning'
]);
};
// 解析数据
let
_data
=
form
.
getValues
();
win
.
progressOn
();
this
.
core
.
request
(
this
.
core
[
`database_
${
_data
[
'type'
]}
`
].
show_databases
({
host
:
_data
[
'host'
],
user
:
_data
[
'user'
],
passwd
:
_data
[
'passwd'
]
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
}
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
break
;
}
}
});
});
}
}
...
@@ -470,6 +502,13 @@ class PHP {
...
@@ -470,6 +502,13 @@ class PHP {
type
:
'button'
,
type
:
'button'
,
icon
:
'remove'
,
icon
:
'remove'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
text
:
LANG
[
'form'
][
'toolbar'
][
'clear'
]
},
{
type
:
'separator'
},
{
id
:
'test'
,
type
:
'button'
,
icon
:
'spinner'
,
text
:
LANG
[
'form'
][
'toolbar'
][
'test'
]
}]);
}]);
// form
// form
...
@@ -605,6 +644,31 @@ class PHP {
...
@@ -605,6 +644,31 @@ class PHP {
// 刷新 UI
// 刷新 UI
this
.
parse
();
this
.
parse
();
break
;
break
;
case
'test'
:
if
(
!
form
.
validate
())
{
return
toastr
.
warning
(
LANG
[
'form'
][
'warning'
],
LANG_T
[
'warning'
]);
};
// 解析数据
let
_data
=
form
.
getValues
();
win
.
progressOn
();
this
.
core
.
request
(
this
.
core
[
`database_
${
_data
[
'type'
]}
`
].
show_databases
({
host
:
_data
[
'host'
],
user
:
_data
[
'user'
],
passwd
:
_data
[
'passwd'
]
})
).
then
((
res
)
=>
{
if
(
res
[
'text'
].
length
>
0
){
toastr
.
success
(
LANG
[
'form'
][
'test_success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
warning
(
LANG
[
'form'
][
'test_warning'
],
LANG_T
[
'warning'
]);
}
win
.
progressOff
();
}).
catch
((
err
)
=>
{
toastr
.
error
(
JSON
.
stringify
(
err
),
LANG_T
[
'error'
]);
win
.
progressOff
();
});
break
;
}
}
});
});
}
}
...
...
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