mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 18:27:59 -04:00
* initial version of the screenshot mode service * First iteration of client side of screenshot mode plugin Also hooked it up to the chromium browser imitating the preload functionality of electron to set up the environment before code runs. * First implementation of server-side logic for detecting screenshot mode * fix some type issues and do a small refactor * fix size limits, docs and ts issues * fixed types issues and made sure screenshot mode is correctly detected on the client * Moved the screenshot mode header definition to common Added a server-side example for screenshot mode Export the screenshot mode header in both public and server * move require() to screenshotMode plugin * Update chromium_driver.ts * cleaned up some comments, minor refactor in ReportingCore and changed the screenshotmode detection function to check for a specific value. * fix export * Expanded server-side screenshot mode contract with function that checks a kibana request to determine whether we in screenshot mode * added comments to explain use of literal value rather than external reference * updated comment * update reporting example Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Timothy Sullivan <tsullivan@elastic.co> Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
* Side Public License, v 1.
|
|
*/
|
|
|
|
import { Plugin, PluginInitializerContext, CoreSetup, Logger } from 'kibana/server';
|
|
import { ScreenshotModePluginSetup } from '../../../src/plugins/screenshot_mode/server';
|
|
import { RouteDependencies } from './types';
|
|
import { registerRoutes } from './routes';
|
|
|
|
export class ScreenshotModeExamplePlugin implements Plugin<void, void> {
|
|
log: Logger;
|
|
constructor(ctx: PluginInitializerContext) {
|
|
this.log = ctx.logger.get();
|
|
}
|
|
setup(core: CoreSetup, { screenshotMode }: { screenshotMode: ScreenshotModePluginSetup }): void {
|
|
const deps: RouteDependencies = {
|
|
screenshotMode,
|
|
router: core.http.createRouter(),
|
|
log: this.log,
|
|
};
|
|
|
|
registerRoutes(deps);
|
|
}
|
|
|
|
start() {}
|
|
stop() {}
|
|
}
|