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
ef7d8ab9
Commit
ef7d8ab9
authored
Mar 12, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
parents
28f4f3a8
c1e4d059
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
5 deletions
+19
-5
pkg/cmd/grafana-cli/commands/commands.go
+1
-0
pkg/cmd/grafana-cli/commands/install_command.go
+9
-1
pkg/cmd/grafana-cli/main.go
+1
-1
pkg/cmd/grafana-cli/services/services.go
+6
-1
public/app/features/plugins/plugin_edit_ctrl.ts
+1
-1
public/app/features/plugins/plugin_page_ctrl.ts
+1
-1
No files found.
pkg/cmd/grafana-cli/commands/commands.go
View file @
ef7d8ab9
...
...
@@ -11,6 +11,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C
cmd
:=
&
contextCommandLine
{
context
}
if
err
:=
command
(
cmd
);
err
!=
nil
{
log
.
Error
(
"
\n
Error: "
)
log
.
Errorf
(
"%s
\n\n
"
,
err
)
cmd
.
ShowHelp
()
...
...
pkg/cmd/grafana-cli/commands/install_command.go
View file @
ef7d8ab9
...
...
@@ -28,7 +28,15 @@ func validateInput(c CommandLine, pluginFolder string) error {
}
fileInfo
,
err
:=
os
.
Stat
(
pluginDir
)
if
err
!=
nil
&&
!
fileInfo
.
IsDir
()
{
if
err
!=
nil
{
if
err
=
os
.
MkdirAll
(
pluginDir
,
os
.
ModePerm
);
err
!=
nil
{
return
errors
.
New
(
"path is not a directory"
)
}
return
nil
}
if
!
fileInfo
.
IsDir
()
{
return
errors
.
New
(
"path is not a directory"
)
}
...
...
pkg/cmd/grafana-cli/main.go
View file @
ef7d8ab9
...
...
@@ -41,7 +41,7 @@ func main() {
cli
.
StringFlag
{
Name
:
"repo"
,
Usage
:
"url to the plugin repository"
,
Value
:
""
,
Value
:
"
https://grafana-net.raintank.io/api/plugins
"
,
},
cli
.
BoolFlag
{
Name
:
"debug, d"
,
...
...
pkg/cmd/grafana-cli/services/services.go
View file @
ef7d8ab9
...
...
@@ -3,6 +3,7 @@ package services
import
(
"encoding/json"
"errors"
"fmt"
"github.com/franela/goreq"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log"
m
"github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
...
...
@@ -12,8 +13,12 @@ import (
var
IoHelper
m
.
IoUtil
=
IoUtilImp
{}
func
ListAllPlugins
(
repoUrl
string
)
(
m
.
PluginRepo
,
error
)
{
fullUrl
:=
repoUrl
+
"/repo"
res
,
_
:=
goreq
.
Request
{
Uri
:
fullUrl
,
MaxRedirects
:
3
}
.
Do
()
res
,
_
:=
goreq
.
Request
{
Uri
:
repoUrl
+
"/repo"
,
MaxRedirects
:
3
}
.
Do
()
if
res
.
StatusCode
!=
200
{
return
m
.
PluginRepo
{},
fmt
.
Errorf
(
"Could not access %s statuscode %v"
,
fullUrl
,
res
.
StatusCode
)
}
var
resp
m
.
PluginRepo
err
:=
res
.
Body
.
FromJsonTo
(
&
resp
)
...
...
public/app/features/plugins/plugin_edit_ctrl.ts
View file @
ef7d8ab9
...
...
@@ -78,7 +78,7 @@ export class PluginEditCtrl {
secureJsonData
:
self
.
model
.
secureJsonData
,
},
{});
return
self
.
backendSrv
.
post
(
`/api/
org/
plugins/
${
self
.
pluginId
}
/settings`
,
updateCmd
);
return
self
.
backendSrv
.
post
(
`/api/plugins/
${
self
.
pluginId
}
/settings`
,
updateCmd
);
});
// if set, performt he postUpdate hook. If a promise is returned it will block
...
...
public/app/features/plugins/plugin_page_ctrl.ts
View file @
ef7d8ab9
...
...
@@ -11,7 +11,7 @@ export class AppPageCtrl {
/** @ngInject */
constructor
(
private
backendSrv
,
private
$routeParams
:
any
,
private
$rootScope
)
{
this
.
pluginId
=
$routeParams
.
pluginId
;
this
.
backendSrv
.
get
(
`/api/
org/
plugins/
${
this
.
pluginId
}
/settings`
).
then
(
app
=>
{
this
.
backendSrv
.
get
(
`/api/plugins/
${
this
.
pluginId
}
/settings`
).
then
(
app
=>
{
this
.
appModel
=
app
;
this
.
page
=
_
.
findWhere
(
app
.
pages
,
{
slug
:
this
.
$routeParams
.
slug
});
if
(
!
this
.
page
)
{
...
...
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