Files
canine/app/javascript/controllers/show_default_values_controller.js
2025-01-15 20:55:57 -08:00

22 lines
591 B
JavaScript

import { Controller } from "@hotwired/stimulus"
import { getDefaultValues } from "../utils/helm_charts"
export default class extends Controller {
static targets = [ "modal", "content" ]
static values = {
repositoryName: String,
repositoryUrl: String,
chartName: String
}
connect() {
}
async show(event) {
event.preventDefault()
const html = await getDefaultValues(this.repositoryNameValue, this.repositoryUrlValue, this.chartNameValue)
this.contentTarget.innerHTML = html
// Show the modal on the page already
this.modalTarget.showModal()
}
}