Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Us10.1 filter panel new design #159

Draft
wants to merge 88 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
dcd567d
frontend/LineInputList.svelte:modify the filter option list according…
hry625 Nov 8, 2022
0e55e49
frontend/FilterWidget.svelte:modify the filter option list according …
hry625 Nov 8, 2022
a06cc57
build(deps): bump loader-utils from 2.0.2 to 2.0.3 in /frontend
dependabot[bot] Nov 8, 2022
f6f5369
frontend: highlight edges of node on hover (#123)
alrapal Nov 16, 2022
9cad863
backend/event_sender: add eiffelvis vocabulary and improve sending op…
alrapal Nov 16, 2022
33187c8
backend: Update Cargo.lock (#138)
RuthgerD Nov 29, 2022
ce9a092
build(deps): bump minimatch from 3.0.4 to 3.1.2 in /frontend (#140)
dependabot[bot] Nov 29, 2022
92338be
build(deps): bump loader-utils from 2.0.3 to 2.0.4 in /frontend (#128)
dependabot[bot] Nov 29, 2022
432fce0
Frontend: Graph Legend Update (#124)
ktpa Nov 29, 2022
49594a6
backend/domain: split out filter and collection
RuthgerD Nov 20, 2022
84edf60
backend: allow client to somewhat control string matching
RuthgerD Nov 20, 2022
0380422
FrontEnd: Re-factor the overall layout (#141)
kam56 Dec 6, 2022
59654d8
Frontend:uitypes.ts: add FilterInput interface
hry625 Dec 7, 2022
85e674f
frontend/FilterWidget.svelte: implement add_filter_to_TempFilterArray…
hry625 Dec 8, 2022
55c7769
frontend/LineInputList.svelte: change the LineInputList into table
hry625 Dec 8, 2022
0466813
frontend/Panel.svelte: call filterpanel's function from Panel component
hry625 Dec 8, 2022
8728f3c
frontend/QueryForm.svelte:connect FilterWidget with QueryForm
hry625 Dec 8, 2022
fc4303a
frontend/LineInputList.svelte: change wildcard to substring
hry625 Dec 13, 2022
f38f6f2
frontend:apidefinition.ts: change event_filter_type_eq function on id…
hry625 Dec 18, 2022
aceca2a
frontend/uitypes.ts: update fixed_query_to_norm function to fit new q…
hry625 Dec 24, 2022
3cf1b42
frontend/FilterWidget.svelte:update empty filter datastructure
hry625 Dec 24, 2022
81c6d00
frontend/App.svelte: update use_selected_as_root function to fit new …
hry625 Dec 24, 2022
9f1cefe
frontend/Panel.svelte:fix bind warning
hry625 Dec 26, 2022
0dc90c9
frontend/Panel.svelte&QueryForm.svelte:remove outbound expose of filt…
hry625 Dec 26, 2022
d3923e2
frontend/LineInputList.svelte:update lineinput layout to make it thinner
hry625 Dec 26, 2022
6c6cc50
frontend/App.svelte: implement add_filter_set function
hry625 Dec 26, 2022
8e665bd
frontend/Panel.svelte: connect add_filter_set function with the button
hry625 Dec 26, 2022
755ae65
update filterWidet
hry625 Jan 2, 2023
6bb781d
frontend/QueryForm.svelte: change filter sets to sub graph filters
hry625 Jan 2, 2023
3c9c064
frontend/apidefinition.ts:remove unnecessary import
hry625 Jan 2, 2023
35a84fd
frontend/App.svelte:bind value with its child
hry625 Jan 2, 2023
e3eadca
frontend:FilterWidget.svelte:code clean up
hry625 Jan 2, 2023
f18a532
frontend/QueryForm.svelte:code clean up
hry625 Jan 2, 2023
3c33fe2
frontend/App.svelte:code clean up
hry625 Jan 2, 2023
fc1c331
build(deps): bump loader-utils from 2.0.2 to 2.0.3 in /frontend
dependabot[bot] Nov 8, 2022
2e48528
frontend: highlight edges of node on hover (#123)
alrapal Nov 16, 2022
7a95bda
backend/event_sender: add eiffelvis vocabulary and improve sending op…
alrapal Nov 16, 2022
f2a8bc2
build(deps): bump loader-utils from 2.0.3 to 2.0.4 in /frontend (#128)
dependabot[bot] Nov 29, 2022
1c12aca
Frontend: Graph Legend Update (#124)
ktpa Nov 29, 2022
efb319c
backend: allow client to somewhat control string matching
RuthgerD Nov 20, 2022
b6d0a1c
FrontEnd: Re-factor the overall layout (#141)
kam56 Dec 6, 2022
ad9521f
docs: Clarify procedure for SSL-able Docker build
AeroStun Dec 9, 2022
804bfb2
frontend: Add non-Interactive mode (#142)
Asiya-Ismail Dec 13, 2022
c8922fe
frontend: allow filter panel to be toggled from sidebar (#145)
kam56 Dec 14, 2022
8a817e2
build(deps): bump loader-utils from 2.0.2 to 2.0.3 in /frontend
dependabot[bot] Nov 8, 2022
0334b5e
frontend: highlight edges of node on hover (#123)
alrapal Nov 16, 2022
1fc2b75
backend/event_sender: add eiffelvis vocabulary and improve sending op…
alrapal Nov 16, 2022
e091850
build(deps): bump loader-utils from 2.0.3 to 2.0.4 in /frontend (#128)
dependabot[bot] Nov 29, 2022
db702ac
Frontend: Graph Legend Update (#124)
ktpa Nov 29, 2022
c8eb65c
backend/domain: split out filter and collection
RuthgerD Nov 20, 2022
3a76f47
backend: allow client to somewhat control string matching
RuthgerD Nov 20, 2022
6986433
FrontEnd: Re-factor the overall layout (#141)
kam56 Dec 6, 2022
3243655
frontend: Add non-Interactive mode (#142)
Asiya-Ismail Dec 13, 2022
d15ab68
frontend: allow filter panel to be toggled from sidebar (#145)
kam56 Dec 14, 2022
0982d13
Revert "frontend/App.svelte:code clean up"
hry625 Jan 2, 2023
dd8f21b
Revert "frontend/QueryForm.svelte:code clean up"
hry625 Jan 2, 2023
505004b
frontend:revert to latest changes on filter panel new design branch.
hry625 Jan 2, 2023
8db98e2
Revert "frontend/QueryForm.svelte:code clean up"
hry625 Jan 2, 2023
5a1726a
build(deps): bump loader-utils from 2.0.2 to 2.0.3 in /frontend
dependabot[bot] Nov 8, 2022
1ddf03c
backend/event_sender: add eiffelvis vocabulary and improve sending op…
alrapal Nov 16, 2022
b19ace1
backend: allow client to somewhat control string matching
RuthgerD Nov 20, 2022
c2500dc
frontend: Add non-Interactive mode (#142)
Asiya-Ismail Dec 13, 2022
dda6330
frontend: allow filter panel to be toggled from sidebar (#145)
kam56 Dec 14, 2022
35bf76c
Frontend: Refactor layout and implementation of setting component (#146)
alrapal Dec 23, 2022
e3ae799
frontend/App.svelte&Panel.svelte:code clean up after merge master to …
hry625 Jan 5, 2023
81a41a6
backend/event_filter.rs:fix error caused by merge
hry625 Jan 5, 2023
80c1733
frontend/QueryForm.svelte:fix the substring filter bug
hry625 Jan 5, 2023
0328f0c
frontend/QueryForm.svelte:code clean up and capitalize filters sets t…
hry625 Jan 5, 2023
cade6b4
frontend/FilterWidget.svelte&LineInputList.svelte: lineinput layout u…
hry625 Jan 5, 2023
be7d9e1
frontend/Panel.svelte: change button content so that the user could r…
hry625 Jan 5, 2023
055dac3
frontend/App.svelte&Panel.svelte&QueryForm.svelte: implement update f…
hry625 Jan 9, 2023
88ba81c
frontend/Panel.svelte:fix submit button disable bug
hry625 Jan 9, 2023
18b3639
build(deps): bump loader-utils from 2.0.2 to 2.0.3 in /frontend
dependabot[bot] Nov 8, 2022
da02322
backend/event_sender: add eiffelvis vocabulary and improve sending op…
alrapal Nov 16, 2022
389e7a5
build(deps): bump loader-utils from 2.0.3 to 2.0.4 in /frontend (#128)
dependabot[bot] Nov 29, 2022
5ec8f46
backend/domain: split out filter and collection
RuthgerD Nov 20, 2022
3dce226
backend: allow client to somewhat control string matching
RuthgerD Nov 20, 2022
1b83973
Frontend: Refactor layout and implementation of setting component (#146)
alrapal Dec 23, 2022
bf9b063
frontend: Make keyboard navigation play nice with auto scroll (#148)
Asiya-Ismail Jan 5, 2023
aaf5261
frontend: keybind and shortcut panel (#149)
ktpa Jan 9, 2023
4c9452b
fix after merge error
hry625 Jan 9, 2023
9da9ac4
Merge branch 'master' into US10.1-filter-panel-new-design
hry625 Jan 12, 2023
1c9849a
format and bug fix after merge
hry625 Jan 12, 2023
225ab3b
Frontend/QueryForm.svelte:fix typo
hry625 Jan 17, 2023
43c898f
frontend/FilterWidget.svelte: change default isWildCard value is fals…
hry625 Jan 17, 2023
49dc547
frontend/LineInputList.svelte:disable substring toggle button when fi…
hry625 Jan 17, 2023
49d987b
frontend/App.svelte:update add_selected_node_as_root_to_filter functi…
hry625 Jan 17, 2023
9846da7
frontend/LineInputlist.svelte:fix filter panel layout inconsistency w…
hry625 Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EiffelVis is a scalable Eiffel pipeline traffic visualization stack built on Rus

The Eiffel Protocol consists of multiple [Eiffel Events](https://github.com/eiffel-community/eiffel/tree/master/eiffel-vocabulary) which each have a defined purpose and structure. In a typical CI pipeline which uses the Eiffel Protocol, there can be hundreds of events which are generated over a short time period. Visualizing large amounts of data such as thousands of Eiffel Events can be difficult, and that's where EiffelVis stands out. EiffelVis is a data visualization and data manipulation tool for Eiffel Events.

# Useful Links:
# Useful Links

- [How to contribute](./CONTRIBUTING.md)
- [Issue tracker](https://github.com/ItJustWorksTM/EiffelVis/issues)
Expand All @@ -33,21 +33,28 @@ These instructions are an example of how you may run EiffelVis locally.
## Installation

1. Clone the repository using SSH (or HTTP)

```bash
git clone git@github.com:ItJustWorksTM/EiffelVis.git
```

2. After going to the root folder where the repository was cloned, install dependencies for the frontend

```bash
cd EiffelVis/frontend
npm install
```

3. Compile and run the frontend

```bash
npm run dev
```

4. The frontend will now be running on port `localhost:8080`. If you go to this address in your browser, you should be able to view the EiffelVis client. As you will see, there are no events and there is no graph. To see events we need to set up the backend through which we will also load the graph data.

5. As the client will be running in the current terminal, open a new terminal to run the backend. Go to the root directory of EiffelVis and run the commands

```bash
cd EiffelVis/backend
cargo run -- --help
Expand Down Expand Up @@ -77,14 +84,14 @@ Copyright © 2022, EiffelVis. EiffelVis is a product by ItJustWorks™.

# Event Sender and testing instructions (for default rabbitmq configuration)

1. start your rabbitmq server
`rabbitmq server` or `brew services start rabbitmq` if you are using homebrew on mac.
1. start your rabbitmq server
`rabbitmq server` or `brew services start rabbitmq` if you are using homebrew on mac.
2. If not activated, activate the management pluggin by running `rabbitmq-plugins enable rabbitmq_management`
3. go to `http://localhost:15672`to enter the rabbitMQ management page. (default credentials are username & password: `guest`)
4. go to the queue panel and create a new queue. The queue has to use the same name as the one you are going to use with the backend (default `hello`)
5 go to the exchange panel and select `amq.fanout`in the list.
6. Click on `Bindings`and add the binding of this exchange to the queue using the same name as step 3.
6. Click on `Bindings`and add the binding of this exchange to the queue using the same name as step 3.
7. go into `EiffelVis/backend/tools/event_sender`and run the command `cargo run -- -r <any_routing_key>` (you can also add other options, run to `cargo run -- --help`for more info)
8. go into `EiffelVis/backend`and run `cargo run`
9. go into `EiffelVis/frontend`and run `npm run dev`
10. open your browser to `localhost:8080`and you should have nodes coming and being displayed on the graph.
10. open your browser to `localhost:8080`and you should have nodes coming and being displayed on the graph.
1 change: 1 addition & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"postcss": "^8.4.4",
"postcss-loader": "^6.2.1",
"precss": "^4.0.0",
"prettier": "^2.8.1",
"style-loader": "^3.3.1",
"tailwindcss": "^3.0.12"
}
}
}
65 changes: 54 additions & 11 deletions frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@
import { FullEvent, query_eq } from './apidefinition';
import { deep_copy } from './utils';
import config from './config.json';
import { empty_fixed_event_filters, FixedQuery, fixed_query_to_norm } from './uitypes';
import {
empty_fixed_event_filters,
FilterInput,
FilterType,
FixedQuery,
fixed_query_to_norm,
TemperateFilterArray,
} from './uitypes';
import Settings from './components/settings/Settings.svelte';

export let connection: EiffelVisConnection;

let event_filters_sets: TemperateFilterArray[] = [[]];
$: event_filters_sets;
let select_filter_set = 0;
$: select_filter_set;
let graph_elem: G6Graph = null;
let active_stream: QueryStream = null;
let awaiting_query_request: boolean = false;
Expand Down Expand Up @@ -172,7 +182,14 @@
graph_elem.updateTimeBar(show_timebar);
};

const add_filter = () => {};
const add_filter_set = () => {
if (event_filters_sets) {
let empty_filter_set = [];
event_filters_sets.push(empty_filter_set);
} else {
event_filters_sets = [];
}
};

// TODO: add loading for this
const on_node_selected = async (e: any) => {
Expand All @@ -188,10 +205,34 @@
current_query.range_filter = { begin: null, end: null };

const filters = empty_fixed_event_filters();
filters.ids.pred.ids = [selected_node.meta.id];
filters.ids[0] = {
rev: false,
pred: { type: 'Id', ids: [selected_node.meta.id] },
};
current_query.event_filters = [filters];

submit_state_query();
add_selected_node_as_root_to_filter();
};
const add_selected_node_as_root_to_filter = () => {
let new_filter = <FilterInput>{
active: true,
isWildCard: false,
exclude: false,
filterField: FilterType.ID,
value: selected_node.meta.id,
};
console.log(select_filter_set);
let target_filter_set = event_filters_sets[select_filter_set];
target_filter_set.forEach((filter, i) => {
if (filter.filterField == FilterType.ID) {
target_filter_set.splice(i, 1);
target_filter_set = [...target_filter_set];
console.log(target_filter_set);
}
});
console.log(target_filter_set);
target_filter_set = [...target_filter_set, new_filter];
event_filters_sets[select_filter_set] = target_filter_set;
};

const reset_graph_options = () => {
Expand Down Expand Up @@ -351,16 +392,18 @@
<!-- panels -->
<Panel
{show_filter_panel}
bind:event_filters_sets
show_legend_placeholder={show_legend}
{use_selected_as_root}
{current_query}
{current_query_changed}
{add_filter}
{qhistory}
{awaiting_query_request}
bind:current_query
bind:current_query_changed
{add_filter_set}
bind:qhistory
bind:awaiting_query_request
submit_state_query_placeholder={submit_state_query}
{selected_node}
{styles}
bind:select_filter_set
/>
</div>
<div class="flex flex-col fixed z-0 items-center">
Expand All @@ -381,7 +424,7 @@
class="flex flex-wrap content-center justify-center z-30 absolute w-screen h-screen pointer-events-none rounded-lg"
>
<div
class="pointer-events-auto rounded-lg w-3/6 min-w-min h-3/6 relative"
class="pointer-events-auto rounded-lg w-3/6 max-w-screen-sm min-w-min h-2/6 relative overflow-y-auto"
class:hidden={!show_settings}
>
<Settings
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/apidefinition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* eslint-disable camelcase */

import type { TemperateFilterArray } from './uitypes';

// Interally tagged type for types that are part of a enum
type TypeTag<T, K> = K & { type: T };

Expand Down Expand Up @@ -78,7 +81,7 @@ export const event_filter_type_eq = (lhs: EventFilterType, rhs: EventFilterType)
((): boolean => {
switch (lhs.type) {
case 'Id':
return lhs.ids.every(val => (rhs as Id).ids.includes(val));
return lhs.ids.every(val => (rhs as Id).ids.every(rhs_val => val == rhs_val));
case 'SourceHost':
return lhs.hosts.every(val =>
(rhs as SourceHost).hosts.every(rhs_val => string_compare_eq(val, rhs_val)),
Expand Down
146 changes: 42 additions & 104 deletions frontend/src/components/FilterWidget.svelte
Original file line number Diff line number Diff line change
@@ -1,117 +1,55 @@
<!-- svelte-ignore a11y-missing-attribute -->
<script lang="ts">
import {
EventFilter,
Id,
SourceHost,
SourceName,
string_compare_default,
Tag,
Type,
} from '../apidefinition';

import LineInputList from './LineInputList.svelte';
import Input from './TextInput.svelte';

const filter_types: string[] = ['Id', 'Type', 'Source', 'Host', 'Tag'];
let active_filter: string = 'Id';

// TODO: Maybe just fixed filter?
export let ids: EventFilter<Id>;
export let tags: EventFilter<Tag>;
export let types: EventFilter<Type>;
export let sourcehosts: EventFilter<SourceHost>;
export let sourcenames: EventFilter<SourceName>;
import type { FilterInput, TemperateFilterArray } from "../uitypes";
import LineInputList from "./LineInputList.svelte";

const filter_types: string[] = ["ID", "Type", "Source", "Host", "Tag"];

let selected = filter_types[0];
let inputValue = "";
export let tempFilterArray: TemperateFilterArray = [];
const add_filter_to_TempFilterArray = () => {
let newFilter = <FilterInput>{
active: true,
isWildCard: false,
exclude: false,
filterField: selected,
value: inputValue,
};
tempFilterArray = [...tempFilterArray, newFilter];
inputValue = "";
};
</script>

<div class="w-full h-full flex flex-col">
<div class="tabs tabs-boxed">
<div class="w-full h-auto">
<LineInputList bind:values={tempFilterArray} />
<select class="select select-primary" bind:value={selected}>
{#each filter_types as type}
<a
class="tab"
class:tab-active={active_filter == type}
on:click={() => (active_filter = type)}>{type}</a
>
<option>{type}</option>
{/each}
</div>
<div class:hidden={active_filter != 'Id'}>
<label class="cursor-pointer label" class:hidden={ids.pred.ids.length == 0}>
<span class="label-text">Reversed</span>
<input type="checkbox" class="toggle toggle-primary" bind:checked={ids.rev} />
</label>
<LineInputList bind:values={ids.pred.ids} let:index={i}>
<Input placeholder={'uuid'} bind:value={ids.pred.ids[i]} />
</LineInputList>
<button class="btn btn-xs w-full" on:click={() => (ids.pred.ids = [...ids.pred.ids, ''])}
>+</button
>
</div>

<div class:hidden={active_filter != 'Type'}>
<label class="cursor-pointer label" class:hidden={types.pred.names.length == 0}>
<span class="label-text">Reversed</span>
<input type="checkbox" class="toggle toggle-primary" bind:checked={types.rev} />
</label>
<LineInputList bind:values={types.pred.names} let:index={i}>
<Input placeholder={'type name'} bind:value={types.pred.names[i].value} />
</LineInputList>
<button
class="btn btn-xs w-full"
on:click={() => (types.pred.names = [...types.pred.names, string_compare_default()])}
>+</button
>
</div>

<div class:hidden={active_filter != 'Source'}>
<label class="cursor-pointer label" class:hidden={sourcenames.pred.names.length == 0}>
<span class="label-text">Reversed</span>
<input type="checkbox" class="toggle toggle-primary" bind:checked={sourcenames.rev} />
</label>
<LineInputList bind:values={sourcenames.pred.names} let:index={i}>
<Input placeholder={'source name'} bind:value={sourcenames.pred.names[i].value} />
</LineInputList>
<button
class="btn btn-xs w-full"
on:click={() =>
(sourcenames.pred.names = [...sourcenames.pred.names, string_compare_default()])}
>+</button
>
</div>

<div class:hidden={active_filter != 'Host'}>
<label class="cursor-pointer label" class:hidden={sourcehosts.pred.hosts.length == 0}>
<span class="label-text">Reversed</span>
<input type="checkbox" class="toggle toggle-primary" bind:checked={sourcehosts.rev} />
</label>
<LineInputList values={sourcehosts.pred.hosts} let:index={i}>
<Input placeholder={'host name'} bind:value={sourcehosts.pred.hosts[i].value} />
</LineInputList>
<button
class="btn btn-xs w-full"
on:click={() =>
(sourcehosts.pred.hosts = [...sourcehosts.pred.hosts, string_compare_default()])}
>+</button
>
</div>

<div class:hidden={active_filter != 'Tag'}>
<label class="cursor-pointer label" class:hidden={tags.pred.tags.length == 0}>
<span class="label-text">Reversed</span>
<input type="checkbox" class="toggle toggle-primary" bind:checked={tags.rev} />
</label>
<LineInputList bind:values={tags.pred.tags} let:index={i}>
<Input placeholder={'tag name'} bind:value={tags.pred.tags[i].value} />
</LineInputList>
<button
class="btn btn-xs w-full"
on:click={() => (tags.pred.tags = [...tags.pred.tags, string_compare_default()])}
>+</button
>
</div>
</select>
<input
type="text"
placeholder={selected}
bind:value={inputValue}
class="input input-sm input-bordered basis-2/3 h-8"
/>
<button
class="btn btn-xs"
on:click={() => add_filter_to_TempFilterArray()}
disabled={inputValue == ""}>+</button
>
</div>

<style lang="postcss" global>
.hidden {
display: none;
}
.select.select-primary {
min-height: 2rem;
padding-left: 0.6rem;
padding-right: 1.7rem;
margin-right: 0.5rem;
height: 2rem;
}
</style>
Loading