-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92693c1
commit 78a6bcc
Showing
15 changed files
with
327 additions
and
125 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
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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import os | ||
|
||
import imgui | ||
|
||
from shark.data import Share_Data | ||
from shark.statistics import statistics | ||
from util.load_img import load_img | ||
|
||
|
||
def g_statistics(m: imgui, share_data: Share_Data, consola_font): | ||
# flags = imgui.WINDOW_NO_COLLAPSE | imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | ||
m.set_next_window_size(*share_data.windows_size) | ||
with m.begin("统计"): | ||
m.text("") | ||
flags = imgui.WINDOW_NO_COLLAPSE | ||
with (m.begin("统计", flags=flags)): | ||
if share_data.file_path and share_data.pcap_file: | ||
m.text(share_data.file_path) | ||
m.text(share_data.pcap_file.__str__()) | ||
statistics(share_data.pcap_file, share_data.result_image_path) | ||
if m.button("show"): | ||
load_img(share_data.result_image_path, 1) | ||
|
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,27 @@ | ||
import imgui | ||
|
||
from g_live_sniffer import g_live_sniffer | ||
from g_show_pcap import g_show_pcap | ||
from g_statistics import g_statistics | ||
|
||
|
||
def menu(share_data, consola_font): | ||
with imgui.begin_main_menu_bar() as main_menu_bar: | ||
if main_menu_bar.opened: | ||
for i, m in enumerate(share_data.show_view): | ||
o = share_data.show_view[i] | ||
is_selected = imgui.menu_item(o[0], f'{i}', o[1], True)[0] | ||
if is_selected: | ||
share_data.show_view[i][1] = not o[1] | ||
if imgui.begin_popup_context_item(f'Context{i}'): | ||
imgui.menu_item("Close") | ||
imgui.end_popup() | ||
|
||
if share_data.show_view[0][1]: | ||
imgui.show_demo_window() | ||
if share_data.show_view[1][1]: | ||
g_live_sniffer(imgui, share_data, consola_font) | ||
if share_data.show_view[2][1]: | ||
g_show_pcap(imgui, share_data, consola_font) | ||
if share_data.show_view[3][1]: | ||
g_statistics(imgui, share_data, consola_font) |
Oops, something went wrong.