Fix view-tab reactivity using direct onclick binding
- Change view-tabs from delegateEvent to direct onclick like hst-frontend - Remove hardcoded 'active' class from grid tab in HTML - Update active class immediately on click before state update - Update proxy target to tzrtech.org Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@
|
|||||||
<span id="sel-count"></span>
|
<span id="sel-count"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="view-tabs">
|
<div class="view-tabs">
|
||||||
<button class="view-tab active" data-view="grid">Grid</button>
|
<button class="view-tab" data-view="grid">Grid</button>
|
||||||
<button class="view-tab" data-view="tree">Tree</button>
|
<button class="view-tab" data-view="tree">Tree</button>
|
||||||
<button class="view-tab" data-view="graph">Graph</button>
|
<button class="view-tab" data-view="graph">Graph</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -212,16 +212,21 @@ class App {
|
|||||||
await this.init();
|
await this.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
// View tabs
|
// View tabs - direct binding like hst-frontend
|
||||||
delegateEvent<MouseEvent>(document.body, '.view-tab', 'click', (_, target) => {
|
$$('.view-tab').forEach(tab => {
|
||||||
const view = target.dataset.view as ViewType;
|
tab.onclick = () => {
|
||||||
if (!view) return;
|
const view = tab.dataset.view as ViewType;
|
||||||
|
if (!view) return;
|
||||||
|
|
||||||
store.setState({ view });
|
// Update active class immediately
|
||||||
this.router.updateHash();
|
$$('.view-tab').forEach(t => t.classList.remove('active'));
|
||||||
this.detailPanel?.close();
|
tab.classList.add('active');
|
||||||
this.updateViewTabs();
|
|
||||||
this.renderView();
|
store.setState({ view });
|
||||||
|
this.router.updateHash();
|
||||||
|
this.detailPanel?.close();
|
||||||
|
this.renderView();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ export default defineConfig({
|
|||||||
port: 3000,
|
port: 3000,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://72.62.1.113:3000',
|
target: 'https://tzrtech.org',
|
||||||
changeOrigin: true
|
changeOrigin: true,
|
||||||
|
secure: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user