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
6dfad3b3
Unverified
Commit
6dfad3b3
authored
Apr 26, 2020
by
Dominik Prokop
Committed by
GitHub
Apr 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grafana/toolkit: Do not suggest Angular panel anymore, add note about Grafana tutorials (#23902)
parent
20286dac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
packages/grafana-toolkit/src/cli/tasks/plugin.create.ts
+4
-0
packages/grafana-toolkit/src/cli/tasks/plugin/create.ts
+31
-8
No files found.
packages/grafana-toolkit/src/cli/tasks/plugin.create.ts
View file @
6dfad3b3
...
...
@@ -6,6 +6,7 @@ import {
formatPluginDetails
,
getPluginIdFromName
,
prepareJsonFiles
,
printGrafanaTutorialsDetails
,
promptPluginDetails
,
promptPluginType
,
removeGitFiles
,
...
...
@@ -41,6 +42,9 @@ const pluginCreateRunner: TaskRunner<PluginCreateOptions> = async ({ name }) =>
// 6. Remove cloned repository .git dir
await
removeGitFiles
(
destPath
);
// 7. Promote Grafana Tutorials :)
printGrafanaTutorialsDetails
(
type
);
};
export
const
pluginCreateTask
=
new
Task
<
PluginCreateOptions
>
(
'plugin:create task'
,
pluginCreateRunner
);
packages/grafana-toolkit/src/cli/tasks/plugin/create.ts
View file @
6dfad3b3
...
...
@@ -20,14 +20,23 @@ interface PluginDetails {
keywords
:
string
;
}
type
PluginType
=
'
angular-panel'
|
'react-panel
'
|
'datasource-plugin'
|
'backend-datasource-plugin'
;
type
PluginType
=
'
panel-plugin
'
|
'datasource-plugin'
|
'backend-datasource-plugin'
;
const
RepositoriesPaths
=
{
'angular-panel'
:
'https://github.com/grafana/simple-angular-panel.git'
,
'react-panel'
:
'https://github.com/grafana/simple-react-panel.git'
,
const
PluginNames
:
Record
<
PluginType
,
string
>
=
{
'panel-plugin'
:
'Grafana Panel Plugin'
,
'datasource-plugin'
:
'Grafana Data Source Plugin'
,
'backend-datasource-plugin'
:
'Grafana Backend Datasource Plugin'
,
};
const
RepositoriesPaths
:
Record
<
PluginType
,
string
>
=
{
'panel-plugin'
:
'https://github.com/grafana/simple-react-panel.git'
,
'datasource-plugin'
:
'https://github.com/grafana/simple-datasource.git'
,
'backend-datasource-plugin'
:
'https://github.com/grafana/simple-datasource-backend.git'
,
};
const
TutorialPaths
:
Record
<
PluginType
,
string
>
=
{
'panel-plugin'
:
'https://grafana.com/tutorials/build-a-panel-plugin'
,
'datasource-plugin'
:
'https://grafana.com/tutorials/build-a-data-source-plugin'
,
'backend-datasource-plugin'
:
'TODO'
,
};
export
const
getGitUsername
=
async
()
=>
{
const
name
=
await
simpleGit
.
raw
([
'config'
,
'--global'
,
'user.name'
]);
...
...
@@ -61,10 +70,9 @@ export const promptPluginType = async () =>
message
:
'Select plugin type'
,
name
:
'type'
,
choices
:
[
{
name
:
'Angular panel'
,
value
:
'angular-panel'
},
{
name
:
'React panel'
,
value
:
'react-panel'
},
{
name
:
'Datasource plugin'
,
value
:
'datasource-plugin'
},
{
name
:
'Backend datasource plugin'
,
value
:
'backend-datasource-plugin'
},
{
name
:
'Panel Plugin'
,
value
:
'panel-plugin'
},
{
name
:
'Datasource Plugin'
,
value
:
'datasource-plugin'
},
{
name
:
'Backend Datasource Plugin'
,
value
:
'backend-datasource-plugin'
},
],
},
]);
...
...
@@ -159,4 +167,19 @@ export const formatPluginDetails = (details: PluginDetails) => {
console
.
log
();
console
.
groupEnd
();
};
export
const
printGrafanaTutorialsDetails
=
(
type
:
PluginType
)
=>
{
console
.
group
();
console
.
log
();
console
.
log
(
chalk
.
bold
.
yellow
(
`Congrats! You have just created
${
PluginNames
[
type
]}
.`
));
console
.
log
();
if
(
type
!==
'backend-datasource-plugin'
)
{
console
.
log
(
`
${
PluginNames
[
type
]}
tutorial:
${
TutorialPaths
[
type
]}
`
);
}
console
.
log
(
'Learn more about Grafana Plugins at https://grafana.com/docs/grafana/latest/plugins/developing/development/'
);
console
.
log
();
console
.
groupEnd
();
};
/* eslint-enable no-console */
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