diff --git a/static/js/cookbook.js b/static/js/cookbook.js index ebdc3c5ed..b1610c50c 100644 --- a/static/js/cookbook.js +++ b/static/js/cookbook.js @@ -915,6 +915,30 @@ async function _fetchDependencies() { }); }); + // Wire the alternative-install "Run" buttons in the Manual block. + // Each action launches the underlying command as a tmux task on the + // currently selected deps server, same as Reinstall does. + document.querySelectorAll('.cookbook-deps-run-btn').forEach(btn => { + if (btn._wired) return; + btn._wired = true; + btn.addEventListener('click', (e) => { + e.stopPropagation(); + const action = btn.dataset.depsAction; + const sel = document.getElementById('hwfit-deps-server'); + if (sel) _applyServerSelection(sel.value); + const host = _envState.remoteHost || ''; + const where = host || 'this server'; + const cmds = { + 'vllm-uv': 'uv venv && . .venv/bin/activate && uv pip install -U vllm --torch-backend auto', + 'vllm-docker': 'docker pull vllm/vllm-openai:latest', + }; + const cmd = cmds[action]; + if (!cmd) return; + if (!confirm(`Run on ${where}?\n\n${cmd}\n\nLaunches as a tmux task — watch progress in the Active tab.`)) return; + _launchServeTask(`deps-${action}`, 'deps-install', cmd); + }); + }); + // Wire the ⋮ menu on installed packages — currently just "Update". function _showDepMenu(anchor) { document.querySelectorAll('.cookbook-dep-menu').forEach(d => d.remove()); @@ -2063,28 +2087,29 @@ function _renderRecipes() { html += ''; html += ''; html += '
Optional packages that extend Odysseus capabilities.
'; - // Manual install hints (collapsed). Useful when the in-app Install button - // can't run (offline server, custom torch backend, etc.) — three vetted - // recipes the user can copy verbatim into a terminal on the target box. + // Alternative install methods — Odysseus runs each in a tmux task on + // the selected server (watch in the Running tab). Wired to event + // delegation below; no need for per-button click handlers. html += '${body}`
+ const _depRunBlock = (label, body, action) =>
+ `${esc(body)}`
+ `