-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
- Loading branch information
Showing
15 changed files
with
202 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ apps: | |
logo: '' | ||
maxRenderWorkers: 2 | ||
persistData: false | ||
remoteChromeAddr: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.tsx] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package chrome | ||
|
||
import ( | ||
"github.com/chromedp/chromedp" | ||
"github.com/grafana/grafana-plugin-sdk-go/backend/log" | ||
"github.com/mahendrapaipuri/grafana-dashboard-reporter-app/pkg/plugin/internal/config" | ||
"golang.org/x/net/context" | ||
) | ||
|
||
type RemoteInstance struct { | ||
browserCtx context.Context | ||
|
||
browserCtxCancel context.CancelFunc | ||
allocCtxCancel context.CancelFunc | ||
} | ||
|
||
// NewRemoteBrowserInstance creates a new remote browser instance | ||
func NewRemoteBrowserInstance(_ context.Context, _ log.Logger, _ bool) (*RemoteInstance, error) { | ||
// we don't need to do anything here. We are connecting to a remote browser if needed. | ||
return &RemoteInstance{}, nil | ||
} | ||
|
||
func (i *RemoteInstance) NewTab(ctx context.Context, logger log.Logger, conf config.Config) *Tab { | ||
allocCtx, allocCtxCancel := chromedp.NewRemoteAllocator(ctx, conf.RemoteChromeAddr) | ||
|
||
chromeLogger := logger.With("subsystem", "chromium") | ||
browserCtx, browserCtxCancel := chromedp.NewContext(allocCtx, | ||
chromedp.WithErrorf(chromeLogger.Error), | ||
chromedp.WithLogf(chromeLogger.Debug), | ||
) | ||
|
||
return &Tab{ | ||
parentCtxCancel: allocCtxCancel, | ||
ctx: browserCtx, | ||
cancel: browserCtxCancel, | ||
} | ||
} | ||
|
||
func (i *RemoteInstance) Close() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.