From d73445d8681f08fe0f26b5782d81235b35c104b7 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 10 Aug 2025 17:07:00 +0200 Subject: [PATCH] Support interesting modules and ignored functions --- page/src/components/item-list.tsx | 81 +++++++++++++++++++++++++++ page/src/components/settings-menu.tsx | 48 ++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 page/src/components/item-list.tsx diff --git a/page/src/components/item-list.tsx b/page/src/components/item-list.tsx new file mode 100644 index 00000000..855d7c63 --- /dev/null +++ b/page/src/components/item-list.tsx @@ -0,0 +1,81 @@ +import { Input } from "./ui/input"; +import { Button } from "./ui/button"; +import { Plus, Trash } from "react-bootstrap-icons"; +import { Label } from "./ui/label"; + +interface ItemListProps { + title: string; + items: string[]; + onChange: (items: string[]) => void; +} + +export function ItemList(props: ItemListProps) { + const removeItem = (index: number) => { + const newItems = [...props.items]; + newItems.splice(index, 1); + props.onChange(newItems); + }; + + const addItem = (item: string) => { + if (item.length == 0) { + return; + } + + const newItems = props.items.concat(item); + props.onChange(newItems); + }; + + return ( +
+
+

{props.title}

+ {/*

+ Set the settings for the emulation. +

*/} +
+ +
+ {props.items.map((item, index) => { + return ( +
+ + +
+ ); + })} +
+ +
{ + const nameInput = (e.target as any).elements.name; + const newItem = nameInput.value; + nameInput.value = ""; + + addItem(newItem); + e.preventDefault(); + }} + > +
+ + +
+
+
+ ); +} diff --git a/page/src/components/settings-menu.tsx b/page/src/components/settings-menu.tsx index 5ff10b12..f080f33c 100644 --- a/page/src/components/settings-menu.tsx +++ b/page/src/components/settings-menu.tsx @@ -4,6 +4,14 @@ import { Label } from "./ui/label"; import { Settings } from "@/settings"; import { TextTooltip } from "./text-tooltip"; +import { ItemList } from "./item-list"; + +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { ChevronDown } from "react-bootstrap-icons"; interface SettingsMenuProps { settings: Settings; @@ -167,6 +175,46 @@ export class SettingsMenu extends React.Component { } /> + + + + +
+ + +
+
+
+ + this.setState({ ignoredFunctions: items })} + /> + +
+ + + + +
+ + +
+
+
+ + this.setState({ interestingModules: items })} + /> + +
); }