feat: 修复网络拓扑匹配逻辑,使用双向LLDP对称匹配策略
This commit is contained in:
@@ -908,3 +908,81 @@ async function saveEditDevice(event) {
|
||||
alert('修改失败: ' + error.message);
|
||||
}
|
||||
}
|
||||
|
||||
// 面板拖拽调整大小功能
|
||||
(function() {
|
||||
// 左侧面板拖拽
|
||||
var resizerLeft = document.getElementById('resizer-left');
|
||||
var sidebar = document.getElementById('sidebar');
|
||||
|
||||
if (resizerLeft && sidebar) {
|
||||
var isResizingLeft = false;
|
||||
|
||||
resizerLeft.addEventListener('mousedown', function(e) {
|
||||
isResizingLeft = true;
|
||||
resizerLeft.classList.add('resizing');
|
||||
document.body.style.cursor = 'col-resize';
|
||||
document.body.style.userSelect = 'none';
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
document.addEventListener('mousemove', function(e) {
|
||||
if (!isResizingLeft) return;
|
||||
|
||||
var newWidth = e.clientX;
|
||||
var minWidth = 200;
|
||||
var maxWidth = 600;
|
||||
|
||||
if (newWidth >= minWidth && newWidth <= maxWidth) {
|
||||
sidebar.style.width = newWidth + 'px';
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('mouseup', function() {
|
||||
if (isResizingLeft) {
|
||||
isResizingLeft = false;
|
||||
resizerLeft.classList.remove('resizing');
|
||||
document.body.style.cursor = '';
|
||||
document.body.style.userSelect = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 右侧面板拖拽
|
||||
var resizerRight = document.getElementById('resizer-right');
|
||||
var detailPanel = document.getElementById('detail-panel');
|
||||
|
||||
if (resizerRight && detailPanel) {
|
||||
var isResizingRight = false;
|
||||
|
||||
resizerRight.addEventListener('mousedown', function(e) {
|
||||
isResizingRight = true;
|
||||
resizerRight.classList.add('resizing');
|
||||
document.body.style.cursor = 'col-resize';
|
||||
document.body.style.userSelect = 'none';
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
document.addEventListener('mousemove', function(e) {
|
||||
if (!isResizingRight) return;
|
||||
|
||||
var containerWidth = document.querySelector('.main-content').offsetWidth;
|
||||
var newWidth = containerWidth - e.clientX;
|
||||
var minWidth = 300;
|
||||
var maxWidth = 1000;
|
||||
|
||||
if (newWidth >= minWidth && newWidth <= maxWidth) {
|
||||
detailPanel.style.width = newWidth + 'px';
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('mouseup', function() {
|
||||
if (isResizingRight) {
|
||||
isResizingRight = false;
|
||||
resizerRight.classList.remove('resizing');
|
||||
document.body.style.cursor = '';
|
||||
document.body.style.userSelect = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user