Skip to content

Commit

Permalink
working on graph
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Oct 17, 2022
1 parent 36eb2ac commit ec29622
Show file tree
Hide file tree
Showing 14 changed files with 481 additions and 2 deletions.
1 change: 1 addition & 0 deletions x-pack/plugins/graph/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"kibanaVersion": "kibana",
"server": true,
"ui": true,
"extraPublicDirs": ["public/components/graph_visualization", "public/services/workspace"],
"requiredPlugins": [
"licensing",
"data",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function GraphVisualization({
onSetControl,
onSetMergeCandidates,
}: GraphVisualizationProps) {
console.log("WORKSPACE VISUALIZATION: ", workspace);
const svgRoot = useRef<SVGSVGElement | null>(null);

const nodeClick = (n: WorkspaceNode, event: React.MouseEvent) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ function GraphWorkspace(options) {
const visibleNodes = self.nodes.filter(function (n) {
return n.parent === undefined;
});
console.log("VISIBLE NODES: ", visibleNodes);
//reset then roll-up all the counts
const allNodes = self.nodes;
allNodes.forEach((node) => {
Expand Down Expand Up @@ -890,6 +891,7 @@ function GraphWorkspace(options) {
self.addUndoLogEntry(lastOps);
}

console.log("MERGED!!: ", this);
this.runLayout();
};

Expand Down
10 changes: 10 additions & 0 deletions x-pack/plugins/graph/public/services/workspace/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { Workspace, WorkspaceOptions } from '../../types';

declare function createWorkspace(options: WorkspaceOptions): Workspace;
8 changes: 8 additions & 0 deletions x-pack/plugins/graph/public/services/workspace/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export * from './graph_client_workspace';
1 change: 1 addition & 0 deletions x-pack/plugins/security_solution/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"embeddable",
"eventLog",
"features",
"graph",
"inspector",
"kubernetesSecurity",
"lens",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@font-face {
font-family: 'FontAwesome';
src: url('~font-awesome/fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('~font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),
url('~font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),
url('~font-awesome/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),
url('~font-awesome/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),
url('~font-awesome/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}

@import 'font-awesome/scss/variables';
@import 'font-awesome/scss/core';
@import 'font-awesome/scss/icons';

// new file icon
.#{$fa-css-prefix}-file-new-o:before { content: $fa-var-file-o; }
.#{$fa-css-prefix}-file-new-o:after { content: $fa-var-plus; position: relative; margin-left: -1.0em; font-size: .5em; }

// alias for alert types - allows class="fa fa-{{alertType}}"
.fa-success:before { content: $fa-var-check; }
.fa-danger:before { content: $fa-var-exclamation-circle; }

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import './font-awesome.scss';
1 change: 1 addition & 0 deletions x-pack/plugins/security_solution/public/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Route } from '@kbn/kibana-react-plugin/public';
import { NotFoundPage } from './404';
import { SecurityApp } from './app';
import type { RenderAppProps } from './types';
import('./font_awesome');

export const renderApp = ({
element,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const AlertDetailsPage = memo(() => {
{loading && <AlertDetailsLoadingPage eventId={eventId} />}
{dataNotFound && <AlertDetailsErrorPage eventId={eventId} />}
{hasData && (
<>
<div>
<AlertDetailsHeader loading={loading} ruleName={ruleName} timestamp={timestamp} />
<SecuritySolutionTabNavigation navTabs={getAlertDetailsNavTabs(eventId)} />
<EuiSpacer size="l" />
Expand All @@ -86,7 +86,7 @@ export const AlertDetailsPage = memo(() => {
<AlertDetailsVisualizeTab data={detailsData} id={eventId} searchHit={searchHit} />
</Route>
</Switch>
</>
</div>
)}
<SpyRoute pageName={SecurityPageName.alerts} state={{ ruleName }} />
</>
Expand Down
Loading

0 comments on commit ec29622

Please sign in to comment.