Vue.component("email-sender", { props: ["value", "name"], data: function () { let value = this.value if (value == null) { value = { isOn: false, smtpHost: "", smtpPort: 0, username: "", password: "", fromEmail: "", fromName: "" } } let smtpPortString = value.smtpPort.toString() if (smtpPortString == "0") { smtpPortString = "" } return { config: value, smtpPortString: smtpPortString } }, watch: { smtpPortString: function (v) { let port = parseInt(v) if (!isNaN(port)) { this.config.smtpPort = port } } }, methods: { test: function () { window.TESTING_EMAIL_CONFIG = this.config teaweb.popup("/users/setting/emailTest", { height: "36em" }) } }, template: `
` })