Commit 32234d02 authored by Zeynep Cankara's avatar Zeynep Cankara Committed by Commit Bot

[tools][system-analyzer] Create an app class

This CL attaches global functions of the panels
as instance variables of an app class.

Bug: v8:10667, v8:10644

Change-Id: Ib76730652f977ac81e3558ddb18165e938859512
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2297476
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68867}
parent 52ce0774
...@@ -53,25 +53,22 @@ dd { ...@@ -53,25 +53,22 @@ dd {
} }
</style> </style>
<script type="module" > <script type="module" >
import {globalSearchBarEvent, globalDataUpload, showMaps, handleSelectIcEvents} from './index.mjs'; import {App} from './index.mjs';
//TODO(zcankara): Build an App component that has these methods, rather than using globals
globalThis.globalDataUpload = globalDataUpload; globalThis.app = new App();
globalThis.globalSearchBarEvent = globalSearchBarEvent;
globalThis.showMaps = showMaps;
globalThis.handleSelectIcEvents = handleSelectIcEvents;
</script> </script>
</head> </head>
<body> <body>
<div id="content"> <div id="content">
<section id="file-reader"> <section id="file-reader">
<br></br> <br></br>
<log-file-reader id="log-file-reader" onchange="globalDataUpload(event)"></log-file-reader> <log-file-reader id="log-file-reader" onchange="app.globalDataUpload(event)"></log-file-reader>
<br></br> <br></br>
</section> </section>
<div id="container" style="display: none;"> <div id="container" style="display: none;">
<timeline-panel id="timeline-panel"></timeline-panel> <timeline-panel id="timeline-panel"></timeline-panel>
<map-panel id="map-panel" onclick="globalSearchBarEvent(event)" onchange="showMaps(event)"></map-panel> <map-panel id="map-panel" onclick="app.globalSearchBarEvent(event)" onchange="showMaps(event)"></map-panel>
<ic-panel id="ic-panel" onchange="handleSelectIcEvents(event)"></ic-panel> <ic-panel id="ic-panel" onchange="app.handleSelectIcEvents(event)"></ic-panel>
</div> </div>
</div> </div>
......
...@@ -114,4 +114,11 @@ function handleSelectIcEvents(e){ ...@@ -114,4 +114,11 @@ function handleSelectIcEvents(e){
document.state.filteredEntries = e.detail; document.state.filteredEntries = e.detail;
} }
export {globalSearchBarEvent, globalDataUpload, showMaps, handleSelectIcEvents}; class App {
globalDataUpload = globalDataUpload;
globalSearchBarEvent = globalSearchBarEvent;
showMaps = showMaps;
handleSelectIcEvents = handleSelectIcEvents;
}
export {App};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment