Upload index.html with huggingface_hub
Browse files- index.html +19 -1
index.html
CHANGED
|
@@ -380,6 +380,17 @@
|
|
| 380 |
cursor: pointer;
|
| 381 |
height: 28px;
|
| 382 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
.merge-dataset-row .merge-status {
|
| 384 |
font-size: 0.75rem;
|
| 385 |
color: #6c757d;
|
|
@@ -443,6 +454,7 @@
|
|
| 443 |
|
| 444 |
<div class="hf-auth-row" id="hf-auth-row" style="display:none">
|
| 445 |
<img id="hf-signin-btn" class="hf-signin-img" src="https://huggingface.co/datasets/huggingface/badges/resolve/main/sign-in-with-huggingface-sm-dark.svg" alt="Sign in with Hugging Face" style="display:none">
|
|
|
|
| 446 |
<span id="hf-user" class="hf-user" style="display:none"></span>
|
| 447 |
<button class="btn btn-sm" id="hf-signout-btn" style="display:none">Sign out</button>
|
| 448 |
<input type="password" id="hf-token-input" placeholder="HF token (for private datasets)" style="display:none">
|
|
@@ -1919,15 +1931,18 @@
|
|
| 1919 |
return;
|
| 1920 |
}
|
| 1921 |
|
|
|
|
| 1922 |
authRow.style.display = '';
|
| 1923 |
if (oauthResult) {
|
| 1924 |
signinBtn.style.display = 'none';
|
|
|
|
| 1925 |
tokenInput.style.display = 'none';
|
| 1926 |
userEl.textContent = `Signed in as ${oauthResult.userInfo?.name || oauthResult.userInfo?.preferred_username || 'HF user'}`;
|
| 1927 |
userEl.style.display = '';
|
| 1928 |
signoutBtn.style.display = '';
|
| 1929 |
} else {
|
| 1930 |
signinBtn.style.display = '';
|
|
|
|
| 1931 |
tokenInput.style.display = 'none';
|
| 1932 |
userEl.style.display = 'none';
|
| 1933 |
signoutBtn.style.display = 'none';
|
|
@@ -1954,7 +1969,10 @@
|
|
| 1954 |
|
| 1955 |
// Sign in
|
| 1956 |
document.getElementById('hf-signin-btn').addEventListener('click', async () => {
|
| 1957 |
-
const
|
|
|
|
|
|
|
|
|
|
| 1958 |
window.location.href = (await oauthLoginUrl({ scopes })) + '&prompt=consent';
|
| 1959 |
});
|
| 1960 |
|
|
|
|
| 380 |
cursor: pointer;
|
| 381 |
height: 28px;
|
| 382 |
}
|
| 383 |
+
.hf-auth-row label {
|
| 384 |
+
font-size: 0.75rem;
|
| 385 |
+
color: #6c757d;
|
| 386 |
+
cursor: pointer;
|
| 387 |
+
display: flex;
|
| 388 |
+
align-items: center;
|
| 389 |
+
gap: 4px;
|
| 390 |
+
}
|
| 391 |
+
.hf-auth-row label input {
|
| 392 |
+
accent-color: #4361ee;
|
| 393 |
+
}
|
| 394 |
.merge-dataset-row .merge-status {
|
| 395 |
font-size: 0.75rem;
|
| 396 |
color: #6c757d;
|
|
|
|
| 454 |
|
| 455 |
<div class="hf-auth-row" id="hf-auth-row" style="display:none">
|
| 456 |
<img id="hf-signin-btn" class="hf-signin-img" src="https://huggingface.co/datasets/huggingface/badges/resolve/main/sign-in-with-huggingface-sm-dark.svg" alt="Sign in with Hugging Face" style="display:none">
|
| 457 |
+
<label id="hf-private-label" style="display:none"><input type="checkbox" id="hf-private-toggle"> Include private repos</label>
|
| 458 |
<span id="hf-user" class="hf-user" style="display:none"></span>
|
| 459 |
<button class="btn btn-sm" id="hf-signout-btn" style="display:none">Sign out</button>
|
| 460 |
<input type="password" id="hf-token-input" placeholder="HF token (for private datasets)" style="display:none">
|
|
|
|
| 1931 |
return;
|
| 1932 |
}
|
| 1933 |
|
| 1934 |
+
const privateLabel = document.getElementById('hf-private-label');
|
| 1935 |
authRow.style.display = '';
|
| 1936 |
if (oauthResult) {
|
| 1937 |
signinBtn.style.display = 'none';
|
| 1938 |
+
privateLabel.style.display = 'none';
|
| 1939 |
tokenInput.style.display = 'none';
|
| 1940 |
userEl.textContent = `Signed in as ${oauthResult.userInfo?.name || oauthResult.userInfo?.preferred_username || 'HF user'}`;
|
| 1941 |
userEl.style.display = '';
|
| 1942 |
signoutBtn.style.display = '';
|
| 1943 |
} else {
|
| 1944 |
signinBtn.style.display = '';
|
| 1945 |
+
privateLabel.style.display = '';
|
| 1946 |
tokenInput.style.display = 'none';
|
| 1947 |
userEl.style.display = 'none';
|
| 1948 |
signoutBtn.style.display = 'none';
|
|
|
|
| 1969 |
|
| 1970 |
// Sign in
|
| 1971 |
document.getElementById('hf-signin-btn').addEventListener('click', async () => {
|
| 1972 |
+
const includePrivate = document.getElementById('hf-private-toggle').checked;
|
| 1973 |
+
const scopes = includePrivate
|
| 1974 |
+
? 'openid profile read-repos'
|
| 1975 |
+
: 'openid profile gated-repos';
|
| 1976 |
window.location.href = (await oauthLoginUrl({ scopes })) + '&prompt=consent';
|
| 1977 |
});
|
| 1978 |
|