mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-02 14:31:18 +08:00
Set ?device={device} when changing tab in installation guides (#12560)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
parent
f17f1d4608
commit
a2769032ca
@ -1,3 +1,4 @@
|
|||||||
|
// Add RunLLM widget
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
var script = document.createElement("script");
|
var script = document.createElement("script");
|
||||||
script.type = "module";
|
script.type = "module";
|
||||||
@ -16,3 +17,22 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
script.async = true;
|
script.async = true;
|
||||||
document.head.appendChild(script);
|
document.head.appendChild(script);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Update URL search params when tab is clicked
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const tabs = document.querySelectorAll(".sd-tab-label");
|
||||||
|
|
||||||
|
function updateURL(tab) {
|
||||||
|
const syncGroup = tab.getAttribute("data-sync-group");
|
||||||
|
const syncId = tab.getAttribute("data-sync-id");
|
||||||
|
if (syncGroup && syncId) {
|
||||||
|
const url = new URL(window.location);
|
||||||
|
url.searchParams.set(syncGroup, syncId);
|
||||||
|
window.history.replaceState(null, "", url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tabs.forEach(tab => {
|
||||||
|
tab.addEventListener("click", () => updateURL(tab));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user