@@ -28,6 +28,7 @@ export class RightBar {
2828 const infoContent = document . createElement ( "div" ) ;
2929 infoContent . id = "info-content" ;
3030 this . rightBar . appendChild ( infoContent ) ;
31+ this . showDefaultInfo ( ) ;
3132 }
3233
3334 // Method to clear only the content of info-content
@@ -36,6 +37,7 @@ export class RightBar {
3637 if ( infoContent ) {
3738 infoContent . innerHTML = "" ; // Clears only the content of info-content
3839 }
40+ this . showDefaultInfo ( ) ; // Show default info
3941 }
4042
4143 // Shows specific information of an element in info-content
@@ -45,4 +47,81 @@ export class RightBar {
4547 infoContent . replaceChildren ( ...info . toHTML ( ) ) ;
4648 }
4749 }
50+
51+ getDefaultInfoHtml ( ) : string {
52+ return `
53+ <div id="default-info" class="default-info">
54+ <h2 class="default-info-title">Welcome to GEduNet! <span class="default-info-emoji">🌐</span></h2>
55+ <p class="default-info-lead">
56+ <strong>GEduNet</strong> is a <b>Graphical Educational Computer Network Simulator</b>.
57+ </p>
58+ <p class="default-info-lead">
59+ It's meant as an aid to students trying to understand computer networks, along with their teachers.
60+ </p>
61+
62+ <h3 class="default-info-section">User Manual</h3>
63+ <p>GEduNet consists of four main on-screen components:</p>
64+ <ul>
65+ <li><b>Right bar:</b> Shows information about the selected device, edge or packet.</li>
66+ <li><b>Left bar:</b> Contains buttons to add devices to the network.</li>
67+ <li><b>Canvas:</b> The main area where the network is built and displayed.</li>
68+ <li><b>Top bar:</b> Simulation controls, file operations, help, and settings.</li>
69+ </ul>
70+
71+ <h4 class="default-info-subsection">Left Bar</h4>
72+ <p>Add devices by clicking their buttons. Devices appear in the center of the canvas.</p>
73+ <ul>
74+ <li><b>Host:</b> End device that sends/receives packets.</li>
75+ <li><b>Router:</b> Forwards packets between networks.</li>
76+ <li><b>Switch:</b> Forwards packets within a local network using MAC addresses.</li>
77+ </ul>
78+ <p>The available devices depend on the selected network layer:</p>
79+ <ul>
80+ <li><b>App Layer:</b> Host</li>
81+ <li><b>Transport Layer:</b> Host</li>
82+ <li><b>Network Layer:</b> Host, Router</li>
83+ <li><b>Link Layer:</b> Host, Router, Switch</li>
84+ </ul>
85+
86+ <h4 class="default-info-subsection">Right Bar</h4>
87+ <p>Displays context-sensitive information for the selected item in the canvas. Click a device, edge or packet to inspect it.</p>
88+
89+ <h4 class="default-info-subsection">Top Bar</h4>
90+ <p>Provides control over the simulation and file operations:</p>
91+ <ul>
92+ <li><b>New:</b> Reset the current network.</li>
93+ <li><b>Save:</b> Download the network as a JSON file.</li>
94+ <li><b>Load:</b> Upload a network from a JSON file.</li>
95+ <li><b>Print:</b> Save a PNG snapshot of the canvas.</li>
96+ <li><b>Help:</b> View shortcuts and settings.</li>
97+ </ul>
98+
99+ <h4 class="default-info-subsection">Canvas</h4>
100+ <p>The main area where you interact with the network. You can:</p>
101+ <ul>
102+ <li>Drag and position devices</li>
103+ <li>Zoom in/out with the mouse wheel</li>
104+ <li>Observe packet flow across the network</li>
105+ </ul>
106+ <p>Canvas controls above the network area include:</p>
107+ <ul>
108+ <li><b>Play/Pause:</b> Start or stop the simulation</li>
109+ <li><b>Undo/Redo:</b> Fix recent actions</li>
110+ <li><b>Packet Speed:</b> Adjust how fast packets travel</li>
111+ <li><b>Layer Selection:</b> Switch between OSI layers</li>
112+ </ul>
113+
114+ <h3 class="default-info-section">GitHub</h3>
115+ <p>GEduNet is open-source! You can find the full project on GitHub:</p>
116+ <a class="default-info-link" href="https://github.com/MegaRedHand/network-simulator" target="_blank" rel="noopener">View on GitHub</a>
117+ </div>
118+ ` ;
119+ }
120+
121+ showDefaultInfo ( ) {
122+ const infoContent = document . getElementById ( "info-content" ) ;
123+ if ( infoContent ) {
124+ infoContent . innerHTML = this . getDefaultInfoHtml ( ) ;
125+ }
126+ }
48127}
0 commit comments