mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 12:02:30 +08:00
Plugins: Refactor Grafana and Plugin version update checkers (#44529)
* refactor * rework plugin update checking * make smarter * simplify * fix linter issue * make use of mutex * apply feedback to simplify * format imports * fix tests
This commit is contained in:
@ -32,10 +32,6 @@ type Plugin struct {
|
||||
SignedFiles PluginFiles
|
||||
SignatureError *SignatureError
|
||||
|
||||
// GCOM update checker fields
|
||||
GrafanaComVersion string
|
||||
GrafanaComHasUpdate bool
|
||||
|
||||
// SystemJS fields
|
||||
Module string
|
||||
BaseURL string
|
||||
@ -63,10 +59,6 @@ type PluginDTO struct {
|
||||
SignedFiles PluginFiles
|
||||
SignatureError *SignatureError
|
||||
|
||||
// GCOM update checker fields
|
||||
GrafanaComVersion string
|
||||
GrafanaComHasUpdate bool
|
||||
|
||||
// SystemJS fields
|
||||
Module string
|
||||
BaseURL string
|
||||
@ -326,22 +318,20 @@ func (p *Plugin) ToDTO() PluginDTO {
|
||||
c, _ := p.Client()
|
||||
|
||||
return PluginDTO{
|
||||
JSONData: p.JSONData,
|
||||
PluginDir: p.PluginDir,
|
||||
Class: p.Class,
|
||||
IncludedInAppID: p.IncludedInAppID,
|
||||
DefaultNavURL: p.DefaultNavURL,
|
||||
Pinned: p.Pinned,
|
||||
Signature: p.Signature,
|
||||
SignatureType: p.SignatureType,
|
||||
SignatureOrg: p.SignatureOrg,
|
||||
SignedFiles: p.SignedFiles,
|
||||
SignatureError: p.SignatureError,
|
||||
GrafanaComVersion: p.GrafanaComVersion,
|
||||
GrafanaComHasUpdate: p.GrafanaComHasUpdate,
|
||||
Module: p.Module,
|
||||
BaseURL: p.BaseURL,
|
||||
StreamHandler: c,
|
||||
JSONData: p.JSONData,
|
||||
PluginDir: p.PluginDir,
|
||||
Class: p.Class,
|
||||
IncludedInAppID: p.IncludedInAppID,
|
||||
DefaultNavURL: p.DefaultNavURL,
|
||||
Pinned: p.Pinned,
|
||||
Signature: p.Signature,
|
||||
SignatureType: p.SignatureType,
|
||||
SignatureOrg: p.SignatureOrg,
|
||||
SignedFiles: p.SignedFiles,
|
||||
SignatureError: p.SignatureError,
|
||||
Module: p.Module,
|
||||
BaseURL: p.BaseURL,
|
||||
StreamHandler: c,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user