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
e37fa486
Commit
e37fa486
authored
Nov 01, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove replaced components
parent
16d41095
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
252 deletions
+0
-252
public/app/features/plugins/all.ts
+0
-1
public/app/features/plugins/partials/ds_edit.html
+0
-72
public/app/features/plugins/plugin_edit_ctrl.ts
+0
-179
No files found.
public/app/features/plugins/all.ts
View file @
e37fa486
import
'./plugin_edit_ctrl'
;
import
'./plugin_page_ctrl'
;
import
'./import_list/import_list'
;
import
'./ds_edit_ctrl'
;
...
...
public/app/features/plugins/partials/ds_edit.html
deleted
100644 → 0
View file @
16d41095
<page-header
model=
"ctrl.navModel"
></page-header>
<div
class=
"page-container page-body"
>
<h3
class=
"page-sub-heading"
>
Settings
</h3>
<form
name=
"ctrl.editForm"
ng-if=
"ctrl.current"
>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-10"
>
Name
</span>
<input
class=
"gf-form-input max-width-23"
type=
"text"
ng-model=
"ctrl.current.name"
placeholder=
"name"
required
>
<info-popover
offset=
"0px -135px"
mode=
"right-absolute"
>
The name is used when you select the data source in panels.
The
<em>
Default
</em>
data source is preselected in new
panels.
</info-popover>
</div>
<gf-form-switch
class=
"gf-form"
label=
"Default"
checked=
"ctrl.current.isDefault"
switch-class=
"max-width-6"
></gf-form-switch>
</div>
</div>
<div
class=
"grafana-info-box"
ng-if=
"ctrl.datasourceMeta.state === 'alpha'"
>
This plugin is marked as being in alpha state, which means it is in early development phase and
updates will include breaking changes.
</div>
<div
class=
"grafana-info-box"
ng-if=
"ctrl.datasourceMeta.state === 'beta'"
>
This plugin is marked as being in a beta development state. This means it is in currently in active development and could be
missing important features.
</div>
<rebuild-on-change
property=
"ctrl.datasourceMeta.id"
>
<plugin-component
type=
"datasource-config-ctrl"
>
</plugin-component>
</rebuild-on-change>
<div
ng-if=
"ctrl.hasDashboards"
>
<h3
class=
"section-heading"
>
Bundled Plugin Dashboards
</h3>
<div
class=
"section"
>
<dashboard-import-list
plugin=
"ctrl.datasourceMeta"
datasource=
"ctrl.current"
></dashboard-import-list>
</div>
</div>
<div
ng-if=
"ctrl.testing"
class=
"gf-form-group section"
>
<h5
ng-show=
"!ctrl.testing.done"
>
Testing....
<i
class=
"fa fa-spiner fa-spin"
></i></h5>
<div
class=
"alert-{{ctrl.testing.status}} alert"
ng-show=
"ctrl.testing.done"
>
<div
class=
"alert-icon"
>
<i
class=
"fa fa-exclamation-triangle"
ng-show=
"ctrl.testing.status === 'error'"
></i>
<i
class=
"fa fa-check"
ng-show=
"ctrl.testing.status !== 'error'"
></i>
</div>
<div
class=
"alert-body"
>
<div
class=
"alert-title"
>
{{ctrl.testing.message}}
</div>
</div>
</div>
</div>
<div
class=
"grafana-info-box span8"
ng-if=
"ctrl.current.readOnly"
>
This datasource was added by config and cannot be modified using the UI. Please contact your server admin to update this datasource.
</div>
<div
class=
"gf-form-button-row"
>
<button
type=
"submit"
class=
"btn btn-success"
ng-disabled=
"ctrl.current.readOnly"
ng-click=
"ctrl.saveChanges()"
>
Save
&
Test
</button>
<button
type=
"submit"
class=
"btn btn-danger"
ng-disabled=
"ctrl.current.readOnly"
ng-show=
"!ctrl.isNew"
ng-click=
"ctrl.delete()"
>
Delete
</button>
<a
class=
"btn btn-inverse"
href=
"datasources"
>
Back
</a>
</div>
<br
/>
<br
/>
<br
/>
</form>
</div>
public/app/features/plugins/plugin_edit_ctrl.ts
deleted
100644 → 0
View file @
16d41095
import
angular
from
'angular'
;
import
_
from
'lodash'
;
import
Remarkable
from
'remarkable'
;
export
class
PluginEditCtrl
{
model
:
any
;
pluginIcon
:
string
;
pluginId
:
any
;
includes
:
any
;
readmeHtml
:
any
;
includedDatasources
:
any
;
tab
:
string
;
navModel
:
any
;
hasDashboards
:
any
;
preUpdateHook
:
()
=>
any
;
postUpdateHook
:
()
=>
any
;
/** @ngInject */
constructor
(
private
$scope
,
private
$rootScope
,
private
backendSrv
,
private
$sce
,
private
$routeParams
,
navModelSrv
)
{
this
.
pluginId
=
$routeParams
.
pluginId
;
this
.
preUpdateHook
=
()
=>
Promise
.
resolve
();
this
.
postUpdateHook
=
()
=>
Promise
.
resolve
();
this
.
init
();
}
setNavModel
(
model
)
{
let
defaultTab
=
'readme'
;
this
.
navModel
=
{
main
:
{
img
:
model
.
info
.
logos
.
large
,
subTitle
:
model
.
info
.
author
.
name
,
url
:
''
,
text
:
model
.
name
,
breadcrumbs
:
[{
title
:
'Plugins'
,
url
:
'plugins'
}],
children
:
[
{
icon
:
'fa fa-fw fa-file-text-o'
,
id
:
'readme'
,
text
:
'Readme'
,
url
:
`plugins/
${
this
.
model
.
id
}
/edit?tab=readme`
,
},
],
},
};
if
(
model
.
type
===
'app'
)
{
this
.
navModel
.
main
.
children
.
push
({
icon
:
'gicon gicon-cog'
,
id
:
'config'
,
text
:
'Config'
,
url
:
`plugins/
${
this
.
model
.
id
}
/edit?tab=config`
,
});
const
hasDashboards
=
_
.
find
(
model
.
includes
,
{
type
:
'dashboard'
});
if
(
hasDashboards
)
{
this
.
navModel
.
main
.
children
.
push
({
icon
:
'gicon gicon-dashboard'
,
id
:
'dashboards'
,
text
:
'Dashboards'
,
url
:
`plugins/
${
this
.
model
.
id
}
/edit?tab=dashboards`
,
});
}
defaultTab
=
'config'
;
}
this
.
tab
=
this
.
$routeParams
.
tab
||
defaultTab
;
for
(
const
tab
of
this
.
navModel
.
main
.
children
)
{
if
(
tab
.
id
===
this
.
tab
)
{
tab
.
active
=
true
;
}
}
}
init
()
{
return
this
.
backendSrv
.
get
(
`/api/plugins/
${
this
.
pluginId
}
/settings`
).
then
(
result
=>
{
this
.
model
=
result
;
this
.
pluginIcon
=
this
.
getPluginIcon
(
this
.
model
.
type
);
this
.
model
.
dependencies
.
plugins
.
forEach
(
plug
=>
{
plug
.
icon
=
this
.
getPluginIcon
(
plug
.
type
);
});
this
.
includes
=
_
.
map
(
result
.
includes
,
plug
=>
{
plug
.
icon
=
this
.
getPluginIcon
(
plug
.
type
);
return
plug
;
});
this
.
setNavModel
(
this
.
model
);
return
this
.
initReadme
();
});
}
initReadme
()
{
return
this
.
backendSrv
.
get
(
`/api/plugins/
${
this
.
pluginId
}
/markdown/readme`
).
then
(
res
=>
{
const
md
=
new
Remarkable
({
linkify
:
true
,
});
this
.
readmeHtml
=
this
.
$sce
.
trustAsHtml
(
md
.
render
(
res
));
});
}
getPluginIcon
(
type
)
{
switch
(
type
)
{
case
'datasource'
:
return
'icon-gf icon-gf-datasources'
;
case
'panel'
:
return
'icon-gf icon-gf-panel'
;
case
'app'
:
return
'icon-gf icon-gf-apps'
;
case
'page'
:
return
'icon-gf icon-gf-endpoint-tiny'
;
case
'dashboard'
:
return
'icon-gf icon-gf-dashboard'
;
default
:
return
'icon-gf icon-gf-apps'
;
}
}
update
()
{
this
.
preUpdateHook
()
.
then
(()
=>
{
const
updateCmd
=
_
.
extend
(
{
enabled
:
this
.
model
.
enabled
,
pinned
:
this
.
model
.
pinned
,
jsonData
:
this
.
model
.
jsonData
,
secureJsonData
:
this
.
model
.
secureJsonData
,
},
{}
);
return
this
.
backendSrv
.
post
(
`/api/plugins/
${
this
.
pluginId
}
/settings`
,
updateCmd
);
})
.
then
(
this
.
postUpdateHook
)
.
then
(
res
=>
{
window
.
location
.
href
=
window
.
location
.
href
;
});
}
importDashboards
()
{
return
Promise
.
resolve
();
}
setPreUpdateHook
(
callback
:
()
=>
any
)
{
this
.
preUpdateHook
=
callback
;
}
setPostUpdateHook
(
callback
:
()
=>
any
)
{
this
.
postUpdateHook
=
callback
;
}
updateAvailable
()
{
const
modalScope
=
this
.
$scope
.
$new
(
true
);
modalScope
.
plugin
=
this
.
model
;
this
.
$rootScope
.
appEvent
(
'show-modal'
,
{
src
:
'public/app/features/plugins/partials/update_instructions.html'
,
scope
:
modalScope
,
});
}
enable
()
{
this
.
model
.
enabled
=
true
;
this
.
model
.
pinned
=
true
;
this
.
update
();
}
disable
()
{
this
.
model
.
enabled
=
false
;
this
.
model
.
pinned
=
false
;
this
.
update
();
}
}
angular
.
module
(
'grafana.controllers'
).
controller
(
'PluginEditCtrl'
,
PluginEditCtrl
);
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