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
4cc06ad7
Commit
4cc06ad7
authored
Dec 14, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
parents
79d56f77
280f9bef
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
47 additions
and
8 deletions
+47
-8
conf/defaults.ini
+6
-0
conf/sample.ini
+6
-0
pkg/api/api.go
+1
-0
pkg/api/dashboard_snapshot.go
+8
-0
pkg/api/frontendsettings.go
+1
-0
pkg/setting/setting.go
+11
-0
public/app/core/controllers/sidemenu_ctrl.js
+1
-0
public/app/features/dashboard/partials/shareModal.html
+3
-4
public/app/features/dashboard/shareSnapshotCtrl.js
+8
-1
public/app/partials/sidemenu.html
+2
-3
No files found.
conf/defaults.ini
View file @
4cc06ad7
...
...
@@ -125,6 +125,12 @@ disable_gravatar = false
# data source proxy whitelist (ip_or_domain:port seperated by spaces)
data_source_proxy_whitelist
=
[snapshots]
# snapshot sharing options
external_enabled
=
true
external_snapshot_url
=
https://snapshots-origin.raintank.io
external_snapshot_name
=
Publish to snapshot.raintank.io
#################################### Users ####################################
[users]
# disable user signup / registration
...
...
conf/sample.ini
View file @
4cc06ad7
...
...
@@ -120,6 +120,12 @@
# data source proxy whitelist (ip_or_domain:port seperated by spaces)
;data_source_proxy_whitelist =
[snapshots]
# snapshot sharing options
;external_enabled = true
;external_snapshot_url = https://snapshots-origin.raintank.io
;external_snapshot_name = Publish to snapshot.raintank.io
#################################### Users ####################################
[users]
# disable user signup / registration
...
...
pkg/api/api.go
View file @
4cc06ad7
...
...
@@ -65,6 +65,7 @@ func Register(r *macaron.Macaron) {
r
.
Post
(
"/api/snapshots/"
,
bind
(
m
.
CreateDashboardSnapshotCommand
{}),
CreateDashboardSnapshot
)
r
.
Get
(
"/dashboard/snapshot/*"
,
Index
)
r
.
Get
(
"/api/snapshot/shared-options/"
,
GetSharingOptions
)
r
.
Get
(
"/api/snapshots/:key"
,
GetDashboardSnapshot
)
r
.
Get
(
"/api/snapshots-delete/:key"
,
DeleteDashboardSnapshot
)
...
...
pkg/api/dashboard_snapshot.go
View file @
4cc06ad7
...
...
@@ -12,6 +12,14 @@ import (
"github.com/grafana/grafana/pkg/util"
)
func
GetSharingOptions
(
c
*
middleware
.
Context
)
{
c
.
JSON
(
200
,
util
.
DynMap
{
"externalSnapshotURL"
:
setting
.
ExternalSnapshotUrl
,
"externalSnapshotName"
:
setting
.
ExternalSnapshotName
,
"externalEnabled"
:
setting
.
ExternalEnabled
,
})
}
func
CreateDashboardSnapshot
(
c
*
middleware
.
Context
,
cmd
m
.
CreateDashboardSnapshotCommand
)
{
if
cmd
.
External
{
// external snapshot ref requires key and delete key
...
...
pkg/api/frontendsettings.go
View file @
4cc06ad7
...
...
@@ -114,6 +114,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"datasources"
:
datasources
,
"appSubUrl"
:
setting
.
AppSubUrl
,
"allowOrgCreate"
:
(
setting
.
AllowUserOrgCreate
&&
c
.
IsSignedIn
)
||
c
.
IsGrafanaAdmin
,
"authProxyEnabled"
:
setting
.
AuthProxyEnabled
,
"buildInfo"
:
map
[
string
]
interface
{}{
"version"
:
setting
.
BuildVersion
,
"commit"
:
setting
.
BuildCommit
,
...
...
pkg/setting/setting.go
View file @
4cc06ad7
...
...
@@ -76,6 +76,11 @@ var (
EmailCodeValidMinutes
int
DataProxyWhiteList
map
[
string
]
bool
// Snapshots
ExternalSnapshotUrl
string
ExternalSnapshotName
string
ExternalEnabled
bool
// User settings
AllowUserSignUp
bool
AllowUserOrgCreate
bool
...
...
@@ -421,6 +426,12 @@ func NewConfigContext(args *CommandLineArgs) error {
CookieRememberName
=
security
.
Key
(
"cookie_remember_name"
)
.
String
()
DisableGravatar
=
security
.
Key
(
"disable_gravatar"
)
.
MustBool
(
true
)
// read snapshots settings
snapshots
:=
Cfg
.
Section
(
"snapshots"
)
ExternalSnapshotUrl
=
snapshots
.
Key
(
"external_snapshot_url"
)
.
String
()
ExternalSnapshotName
=
snapshots
.
Key
(
"external_snapshot_name"
)
.
String
()
ExternalEnabled
=
snapshots
.
Key
(
"external_enabled"
)
.
MustBool
(
true
)
// read data source proxy white list
DataProxyWhiteList
=
make
(
map
[
string
]
bool
)
for
_
,
hostAndIp
:=
range
security
.
Key
(
"data_source_proxy_whitelist"
)
.
Strings
(
" "
)
{
...
...
public/app/core/controllers/sidemenu_ctrl.js
View file @
4cc06ad7
...
...
@@ -120,6 +120,7 @@ function (angular, _, $, coreModule, config) {
};
$scope
.
init
=
function
()
{
$scope
.
showSignout
=
contextSrv
.
isSignedIn
&&
!
config
[
'authProxyEnabled'
];
$scope
.
updateMenu
();
$scope
.
$on
(
'$routeChangeSuccess'
,
$scope
.
updateMenu
);
};
...
...
public/app/features/dashboard/partials/shareModal.html
View file @
4cc06ad7
...
...
@@ -107,7 +107,7 @@
</script>
<script
type=
"text/ng-template"
id=
"shareSnapshot.html"
>
<
div
class
=
"ng-cloak"
ng
-
cloak
ng
-
controller
=
"ShareSnapshotCtrl"
>
<
div
class
=
"ng-cloak"
ng
-
cloak
ng
-
controller
=
"ShareSnapshotCtrl"
ng
-
init
=
"init()"
>
<
div
class
=
"share-modal-big-icon"
>
<
i
ng
-
if
=
"loading"
class
=
"fa fa-spinner fa-spin"
><
/i
>
<
i
ng
-
if
=
"!loading"
class
=
"gf-icon gf-icon-snap-multi"
><
/i
>
...
...
@@ -175,10 +175,9 @@
<
i
class
=
"fa fa-save"
><
/i
>
Local
Snapshot
<
/button
>
<
button
class
=
"btn btn-primary btn-large"
ng
-
click
=
"createSnapshot(true)"
ng
-
disabled
=
"loading"
>
<
button
class
=
"btn btn-primary btn-large"
ng
-
if
=
"externalEnabled"
ng
-
click
=
"createSnapshot(true)"
ng
-
disabled
=
"loading"
>
<
i
class
=
"fa fa-cloud-upload"
><
/i
>
Publish
to
snapshot
.
raintank
.
io
{{
sharingButtonText
}}
<
/button
>
<
/div
>
...
...
public/app/features/dashboard/shareSnapshotCtrl.js
View file @
4cc06ad7
...
...
@@ -29,7 +29,14 @@ function (angular, _) {
{
text
:
'Public on the web'
,
value
:
3
},
];
$scope
.
externalUrl
=
'//snapshots-origin.raintank.io'
;
$scope
.
init
=
function
()
{
backendSrv
.
get
(
'/api/snapshot/shared-options'
).
then
(
function
(
options
)
{
$scope
.
externalUrl
=
options
[
'externalSnapshotURL'
];
$scope
.
sharingButtonText
=
options
[
'externalSnapshotName'
];
$scope
.
externalEnabled
=
options
[
'externalEnabled'
];
});
};
$scope
.
apiUrl
=
'/api/snapshots'
;
$scope
.
createSnapshot
=
function
(
external
)
{
...
...
public/app/partials/sidemenu.html
View file @
4cc06ad7
...
...
@@ -60,8 +60,7 @@
<span
class=
"sidemenu-item-text"
>
Grafana admin
</span>
</a>
</li>
<li
ng-if=
"contextSrv.isSignedIn"
>
<li
ng-if=
"showSignout"
>
<a
href=
"logout"
class=
"sidemenu-item"
target=
"_self"
>
<span
class=
"icon-circle sidemenu-icon"
><i
class=
"fa fa-fw fa-sign-out"
></i></span>
<span
class=
"sidemenu-item-text"
>
Sign out
</span>
...
...
@@ -83,7 +82,7 @@
<span
class=
"sidemenu-item-text"
>
Exit admin
</span>
</a>
</li>
<li>
<li
ng-if=
"showSignout"
>
<a
href=
"logout"
class=
"sidemenu-item"
target=
"_self"
>
<span
class=
"icon-circle sidemenu-icon"
><i
class=
"fa fa-fw fa-sign-out"
></i></span>
<span
class=
"sidemenu-item-text"
>
Sign out
</span>
...
...
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