mirror of
https://github.com/czhu12/canine.git
synced 2026-01-06 11:40:44 -06:00
processes
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user