Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Kornkitt Poolsup
nexpie-grafana-theme
Commits
24c0f28f
Commit
24c0f28f
authored
Mar 19, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mssql: allow host without port and fallback to default port 1433
parent
2802fe3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
pkg/tsdb/mssql/mssql.go
+7
-4
public/app/plugins/datasource/mssql/partials/config.html
+1
-1
No files found.
pkg/tsdb/mssql/mssql.go
View file @
24c0f28f
...
...
@@ -38,10 +38,13 @@ func NewMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
MacroEngine
:
NewMssqlMacroEngine
(),
}
serport
:=
datasource
.
Url
// fix me: need to have a default port if user did not provide. i.e. 1433
words
:=
strings
.
Split
(
serport
,
":"
)
server
,
port
:=
words
[
0
],
words
[
1
]
hostParts
:=
strings
.
Split
(
datasource
.
Url
,
":"
)
if
len
(
hostParts
)
<
2
{
hostParts
=
append
(
hostParts
,
"1433"
)
}
server
,
port
:=
hostParts
[
0
],
hostParts
[
1
]
endpoint
.
log
.
Debug
(
"cnnstr"
,
"hostParts len"
,
len
(
hostParts
))
cnnstr
:=
fmt
.
Sprintf
(
"server=%s;port=%s;database=%s;user id=%s;password=%s;"
,
server
,
port
,
...
...
public/app/plugins/datasource/mssql/partials/config.html
View file @
24c0f28f
...
...
@@ -4,7 +4,7 @@
<div
class=
"gf-form-group"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-7"
>
Host
</span>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
'ctrl.current.url'
placeholder=
"localhost:1433"
bs-typeahead=
"{{['localhost:1433']}}"
required
></input>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
'ctrl.current.url'
placeholder=
"localhost:1433"
bs-typeahead=
"{{['localhost
', 'localhost
:1433']}}"
required
></input>
</div>
<div
class=
"gf-form max-width-30"
>
...
...
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