mirror of
https://github.com/lukaszraczylo/kportal.git
synced 2026-07-08 06:35:10 +00:00
Update the tap link in README and github page
This commit is contained in:
@@ -33,7 +33,7 @@ kportal simplifies managing multiple Kubernetes port-forwards with an elegant, i
|
|||||||
### Homebrew (macOS/Linux)
|
### Homebrew (macOS/Linux)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install lukaszraczylo/tap/kportal
|
brew install lukaszraczylo/brew-taps/kportal
|
||||||
```
|
```
|
||||||
|
|
||||||
### Quick Install Script
|
### Quick Install Script
|
||||||
|
|||||||
+60
-12
@@ -162,9 +162,9 @@
|
|||||||
<p class="text-gray-600 dark:text-gray-400 text-sm">macOS & Linux</p>
|
<p class="text-gray-600 dark:text-gray-400 text-sm">macOS & Linux</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div onclick="copyToClipboard('brew install lukaszraczylo/tap/kportal', this)"
|
<div onclick="copyToClipboard('brew install lukaszraczylo/brew-taps/kportal', this)"
|
||||||
class="bg-gray-900 dark:bg-gray-950 text-gray-100 p-4 rounded text-sm cursor-pointer hover:bg-gray-800 dark:hover:bg-black transition group relative">
|
class="bg-gray-900 dark:bg-gray-950 text-gray-100 p-4 rounded text-sm cursor-pointer hover:bg-gray-800 dark:hover:bg-black transition group relative">
|
||||||
<code class="block">brew install lukaszraczylo/tap/kportal</code>
|
<code class="block">brew install lukaszraczylo/brew-taps/kportal</code>
|
||||||
<i class="fas fa-copy absolute top-3 right-3 text-gray-500 group-hover:text-gray-300 text-xs"></i>
|
<i class="fas fa-copy absolute top-3 right-3 text-gray-500 group-hover:text-gray-300 text-xs"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -357,17 +357,65 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Copy to clipboard function
|
// Copy to clipboard function with fallback
|
||||||
function copyToClipboard(text, button) {
|
function copyToClipboard(text, button) {
|
||||||
navigator.clipboard.writeText(text).then(() => {
|
// Modern clipboard API (preferred)
|
||||||
const originalHTML = button.innerHTML;
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||||
button.innerHTML = '<i class="fas fa-check text-green-500"></i>';
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
setTimeout(() => {
|
showCopySuccess(button);
|
||||||
button.innerHTML = originalHTML;
|
}).catch(err => {
|
||||||
}, 2000);
|
console.error('Clipboard API failed:', err);
|
||||||
}).catch(err => {
|
fallbackCopy(text, button);
|
||||||
console.error('Failed to copy:', err);
|
});
|
||||||
});
|
} else {
|
||||||
|
// Fallback for older browsers or insecure contexts
|
||||||
|
fallbackCopy(text, button);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback copy method using execCommand
|
||||||
|
function fallbackCopy(text, button) {
|
||||||
|
const textarea = document.createElement('textarea');
|
||||||
|
textarea.value = text;
|
||||||
|
textarea.style.position = 'fixed';
|
||||||
|
textarea.style.top = '0';
|
||||||
|
textarea.style.left = '0';
|
||||||
|
textarea.style.opacity = '0';
|
||||||
|
document.body.appendChild(textarea);
|
||||||
|
textarea.focus();
|
||||||
|
textarea.select();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const successful = document.execCommand('copy');
|
||||||
|
if (successful) {
|
||||||
|
showCopySuccess(button);
|
||||||
|
} else {
|
||||||
|
showCopyError(button);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Fallback copy failed:', err);
|
||||||
|
showCopyError(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.removeChild(textarea);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show success feedback
|
||||||
|
function showCopySuccess(button) {
|
||||||
|
const originalHTML = button.innerHTML;
|
||||||
|
button.innerHTML = '<i class="fas fa-check text-green-500"></i>';
|
||||||
|
setTimeout(() => {
|
||||||
|
button.innerHTML = originalHTML;
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show error feedback
|
||||||
|
function showCopyError(button) {
|
||||||
|
const originalHTML = button.innerHTML;
|
||||||
|
button.innerHTML = '<i class="fas fa-times text-red-500"></i>';
|
||||||
|
setTimeout(() => {
|
||||||
|
button.innerHTML = originalHTML;
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Smooth scrolling
|
// Smooth scrolling
|
||||||
|
|||||||
Reference in New Issue
Block a user