fix-broker-VP-dots

This commit is contained in:
deploy 2026-06-27 21:43:45 +00:00
parent e2f5026591
commit 0d8cf8a7e5
2 changed files with 8 additions and 9 deletions

View File

@ -137,13 +137,10 @@ ob_start();
<button class="btn btn-danger btn-sm" data-uid="<?= h($uid) ?>" data-act="delete"></button> <button class="btn btn-danger btn-sm" data-uid="<?= h($uid) ?>" data-act="delete"></button>
</td> </td>
<td style="text-align:center"> <td style="text-align:center">
<div style="font-size:10px;color:var(--muted);margin-bottom:3px"><?= $isVps?'VPS':($isPmx?'PMX':'—') ?></div>
<span title="VPS" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="0" <span title="VPS" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="0"
style="cursor:pointer;display:inline-block;width:10px;height:10px;border-radius:50%;margin:0 3px; style="cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;font-size:9px;font-weight:700;margin:0 3px;background:<?= $isVps?'#3fb950':'#333' ?>;color:<?= $isVps?'#0d1117':'#666' ?>;<?= $isVps?'box-shadow:0 0 5px #3fb950;':'' ?>">V</span>
background:<?= $isVps?'#3fb950':'#333' ?>;<?= $isVps?'box-shadow:0 0 5px #3fb950;':'' ?>"></span>
<span title="Proxmox" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="1" <span title="Proxmox" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="1"
style="cursor:pointer;display:inline-block;width:10px;height:10px;border-radius:50%;margin:0 3px; style="cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;font-size:9px;font-weight:700;margin:0 3px;background:<?= $isPmx?'#3fb950':'#333' ?>;color:<?= $isPmx?'#0d1117':'#666' ?>;<?= $isPmx?'box-shadow:0 0 5px #3fb950;':'' ?>">P</span>
background:<?= $isPmx?'#3fb950':'#333' ?>;<?= $isPmx?'box-shadow:0 0 5px #3fb950;':'' ?>"></span>
</td> </td>
</tr> </tr>
<?php endforeach;?> <?php endforeach;?>

View File

@ -94,9 +94,11 @@ ob_start();
<button class="btn btn-secondary btn-sm" data-uid="<?= h($uid) ?>" data-act="cmd" data-cmd="REBOOT">Reboot</button> <button class="btn btn-secondary btn-sm" data-uid="<?= h($uid) ?>" data-act="cmd" data-cmd="REBOOT">Reboot</button>
<button class="btn btn-danger btn-sm" data-uid="<?= h($uid) ?>" data-act="delete"></button> <button class="btn btn-danger btn-sm" data-uid="<?= h($uid) ?>" data-act="delete"></button>
</td> </td>
<td style="white-space:nowrap"> <td style="text-align:center">
<button class="btn btn-secondary btn-sm" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="0"><?= $isVps?$dot:'' ?>→ VPS</button> <span title="VPS" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="0"
<button class="btn btn-secondary btn-sm" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="1"><?= $isPmx?$dot:'' ?>→ Proxmox</button> style="cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;font-size:9px;font-weight:700;margin:0 3px;background:<?= $isVps?'#3fb950':'#333' ?>;color:<?= $isVps?'#0d1117':'#666' ?>;<?= $isVps?'box-shadow:0 0 5px #3fb950;':'' ?>">V</span>
<span title="Proxmox" data-uid="<?= h($uid) ?>" data-act="switch_pair" data-pair="1"
style="cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;font-size:9px;font-weight:700;margin:0 3px;background:<?= $isPmx?'#3fb950':'#333' ?>;color:<?= $isPmx?'#0d1117':'#666' ?>;<?= $isPmx?'box-shadow:0 0 5px #3fb950;':'' ?>">P</span>
</td> </td>
</tr> </tr>
<?php endforeach;?> <?php endforeach;?>
@ -114,7 +116,7 @@ function act(uid, action, extra){
fetch('/esp_vps.php',{method:'POST',body:fd}).then(()=>location.reload()); fetch('/esp_vps.php',{method:'POST',body:fd}).then(()=>location.reload());
} }
document.addEventListener('click',function(e){ document.addEventListener('click',function(e){
const b=e.target.closest('button[data-act]'); if(!b) return; const b=e.target.closest('[data-act]'); if(!b) return;
if(b.dataset.act==='delete' && !confirm('Remover '+b.dataset.uid+'?')) return; if(b.dataset.act==='delete' && !confirm('Remover '+b.dataset.uid+'?')) return;
const extra={}; const extra={};
if(b.dataset.pair!==undefined) extra.pair=b.dataset.pair; if(b.dataset.pair!==undefined) extra.pair=b.dataset.pair;