update
This commit is contained in:
@@ -87,6 +87,9 @@ export class OpsDashboard extends DeesElement {
|
||||
{
|
||||
name: 'Network',
|
||||
element: OpsViewNetwork,
|
||||
action: () => {
|
||||
appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, 'network');
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Emails',
|
||||
|
@@ -66,6 +66,9 @@ export class OpsViewNetwork extends DeesElement {
|
||||
async connectedCallback() {
|
||||
await super.connectedCallback();
|
||||
|
||||
// Force the activeView to be 'network' when this component connects
|
||||
await appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, 'network');
|
||||
|
||||
// When network view becomes visible, ensure we fetch network data
|
||||
await appstate.networkStatePart.dispatchAction(appstate.fetchNetworkStatsAction, null);
|
||||
}
|
||||
@@ -73,6 +76,12 @@ export class OpsViewNetwork extends DeesElement {
|
||||
async disconnectedCallback() {
|
||||
await super.disconnectedCallback();
|
||||
this.stopTrafficUpdateTimer();
|
||||
|
||||
// When network view disconnects, reset activeView if it's still 'network'
|
||||
const currentView = appstate.uiStatePart.getState().activeView;
|
||||
if (currentView === 'network') {
|
||||
await appstate.uiStatePart.dispatchAction(appstate.setActiveViewAction, 'overview');
|
||||
}
|
||||
}
|
||||
|
||||
private subscribeToStateParts() {
|
||||
@@ -183,13 +192,6 @@ export class OpsViewNetwork extends DeesElement {
|
||||
];
|
||||
|
||||
public render() {
|
||||
console.log('Network view render - chart data points:', {
|
||||
inPoints: this.trafficDataIn.length,
|
||||
outPoints: this.trafficDataOut.length,
|
||||
lastInValue: this.trafficDataIn[this.trafficDataIn.length - 1]?.y,
|
||||
lastOutValue: this.trafficDataOut[this.trafficDataOut.length - 1]?.y
|
||||
});
|
||||
|
||||
return html`
|
||||
<ops-sectionheading>Network Activity</ops-sectionheading>
|
||||
|
||||
@@ -527,7 +529,6 @@ export class OpsViewNetwork extends DeesElement {
|
||||
private updateTrafficData() {
|
||||
// This method is called when network data updates
|
||||
// The actual chart updates are handled by the timer calling addTrafficDataPoint()
|
||||
console.log('UpdateTrafficData called - network data updated');
|
||||
}
|
||||
|
||||
private startTrafficUpdateTimer() {
|
||||
|
Reference in New Issue
Block a user