feat: 服务器列表加「文件」按钮直达文件管理
- servers.html: renderActions 加「文件」链接(琥珀色) → /app/files.html?server_id=X - files.html: 支持 server_id URL参数, 自动选中服务器并浏览 /www/wwwroot
This commit is contained in:
+10
-1
@@ -705,6 +705,15 @@
|
||||
// Enter key in path input
|
||||
document.getElementById('dirPath').addEventListener('keydown',e=>{if(e.key==='Enter')browseDir()});
|
||||
|
||||
loadServers();
|
||||
// Auto-select server from URL param (e.g., from servers.html "文件" button)
|
||||
loadServers().then(()=>{
|
||||
const urlServerId=new URLSearchParams(window.location.search).get('server_id');
|
||||
if(urlServerId){
|
||||
const sel=document.getElementById('serverSelect');
|
||||
sel.value=urlServerId;
|
||||
_currentServerId=parseInt(urlServerId);
|
||||
browseDir('/www/wwwroot');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body></html>
|
||||
|
||||
@@ -359,6 +359,7 @@
|
||||
|
||||
function renderActions(s){
|
||||
let html=`<a href="/app/terminal.html?server_id=${s.id}" onclick="event.stopPropagation()" class="text-brand-light hover:underline text-xs mr-2">终端</a>`;
|
||||
html+=`<a href="/app/files.html?server_id=${s.id}" onclick="event.stopPropagation()" class="text-amber-400 hover:underline text-xs mr-2">文件</a>`;
|
||||
if(s.agent_version) html+=`<button onclick="event.stopPropagation();_quickCheck(${s.id})" class="text-emerald-400 hover:underline text-xs mr-2">检查</button>`;
|
||||
html+=`<button onclick="event.stopPropagation();showEditServer(${s.id})" class="text-slate-400 hover:underline text-xs mr-2">编辑</button>`;
|
||||
html+=`<button onclick="event.stopPropagation();deleteServer(${s.id})" class="text-red-400 hover:underline text-xs">删除</button>`;
|
||||
|
||||
Reference in New Issue
Block a user