processes

This commit is contained in:
Chris Zhu
2024-10-15 10:17:04 -07:00
parent 70eea72e4f
commit c65c7557c4
6 changed files with 141 additions and 120 deletions

View File

@@ -1,13 +1,32 @@
import { Controller } from "@hotwired/stimulus"
import tippy from "tippy.js";
export default class extends Controller {
static targets = ["command"]
connect() {
console.log("processes controller connected")
}
copyToClick(event) {
navigator.clipboard.writeText(this.commandTarget.textContent)
this.tooltip(event.target)
}
tooltip(target) {
tippy(target, {
content: "Copied!",
showOnCreate: true,
onHidden: (instance) => {
instance.destroy()
}
})
}
showConnectionInstructions(event) {
event.preventDefault()
event.preventDefault();
const text = `KUBECONFIG=/path/to/kubeconfig kubectl exec -it ${event.target.dataset.podName} -- /bin/bash`
this.commandTarget.textContent = text
click_outside_modal.showModal()
}
}