botserver/web/desktop/shared/resizable.html
Rodrigo Rodriguez (Pragmatismo) 4b185f00f9 feat: add HTTP server and refactor initialization
- Added HTTP server with CORS support and various endpoints
- Introduced http_tx/http_rx channels for HTTP server control
- Cleaned up build.rs by removing commented code
- Updated .gitignore to use *.rdb pattern instead of .rdb
- Simplified capabilities.json to empty object
- Improved UI initialization with better error handling
- Reorganized module imports in main.rs
- Added worker count configuration for HTTP server

The changes introduce a new HTTP server capability while cleaning up and improving existing code structure. The HTTP server includes authentication, session management, and websocket support.
2025-11-15 09:48:46 -03:00

79 lines
1.7 KiB
HTML

<div x-data="{
leftWidth: '30%',
rightWidth: '70%',
isDragging: false,
startDrag() {
this.isDragging = true;
document.body.style.cursor = 'col-resize';
document.addEventListener('mousemove', this.drag.bind(this));
document.addEventListener('mouseup', this.stopDrag.bind(this));
},
drag(e) {
if (!this.isDragging) return;
const container = this.$el.parentElement;
const containerRect = container.getBoundingClientRect();
const newLeftWidth = ((e.clientX - containerRect.left) / containerRect.width) * 100;
if (newLeftWidth > 20 && newLeftWidth < 80) {
this.leftWidth = `${newLeftWidth}%`;
this.rightWidth = `${100 - newLeftWidth}%`;
}
},
stopDrag() {
this.isDragging = false;
document.body.style.cursor = '';
document.removeEventListener('mousemove', this.drag);
document.removeEventListener('mouseup', this.stopDrag);
}
}" class="resizable-container">
<div class="resizable-panel left" :style="{ width: leftWidth }">
<slot name="left"></slot>
</div>
<div class="resizable-handle" @mousedown="startDrag"></div>
<div class="resizable-panel right" :style="{ width: rightWidth }">
<slot name="right"></slot>
</div>
</div>
<style>
.resizable-container {
display: flex;
height: 100%;
width: 100%;
}
.resizable-panel {
height: 100%;
overflow: auto;
}
.resizable-handle {
width: 8px;
background: var(--border);
cursor: col-resize;
transition: background 0.2s;
}
.resizable-handle:hover {
background: var(--primary);
}
@media (max-width: 768px) {
.resizable-container {
flex-direction: column;
}
.resizable-panel {
width: 100% !important;
height: auto;
}
.resizable-handle {
width: 100%;
height: 8px;
}
}
</style>