mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 16:12:14 +08:00

Removes all references and usage of PhantomJS #23375. Remove direct link rendered image e2e smoke test for now. Docker: Fix installing chrome in ubuntu custom docker image. Improve handling of image renderer not available/installed #23593. Add PhantomJS breaking change and upgrading notes. Use grabpl v0.2.10. Closes #13802 Co-authored-by: Kyle Brandt <kyle@grafana.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
40 lines
1010 B
Go
40 lines
1010 B
Go
package rendering
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"time"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
var ErrTimeout = errors.New("Timeout error. You can set timeout in seconds with &timeout url parameter")
|
|
var ErrNoRenderer = errors.New("No renderer plugin found nor is an external render server configured")
|
|
var ErrPhantomJSNotInstalled = errors.New("PhantomJS executable not found")
|
|
|
|
type Opts struct {
|
|
Width int
|
|
Height int
|
|
Timeout time.Duration
|
|
OrgId int64
|
|
UserId int64
|
|
OrgRole models.RoleType
|
|
Path string
|
|
Encoding string
|
|
Timezone string
|
|
ConcurrentLimit int
|
|
}
|
|
|
|
type RenderResult struct {
|
|
FilePath string
|
|
}
|
|
|
|
type renderFunc func(ctx context.Context, renderKey string, options Opts) (*RenderResult, error)
|
|
|
|
type Service interface {
|
|
IsAvailable() bool
|
|
Render(ctx context.Context, opts Opts) (*RenderResult, error)
|
|
RenderErrorImage(error error) (*RenderResult, error)
|
|
GetRenderUser(key string) (*RenderUser, bool)
|
|
}
|