var t = `
Software update
Check for updates
Runtime version
Latest release
Last check
You are using the latest version
You are using a newer version than the latest release
Runtime
state
` import Icon from './icon.js' import { formatDate } from './dateutils.js'; export default { components: { Icon }, emits: ['version-check'], props: ['versionCheck'], data() { return { runtime: {}, } }, methods: { getRuntime() { fetch("/api/runtime") .then(r => r.ok ? r.json() : r.json().then(e => Promise.reject(e))) .then(response => { this.runtime = response; }) .catch(e => { console.error(e); }); }, formattedDate(date) { if (date) return formatDate(date, '%Y-%m-%d %H:%M:%S'); }, }, computed: { issueUrl() { const url = "https://github.com/alonswartz/notesium/issues/new"; if (Object.keys(this.runtime).length === 0) return url let body body = "```\n"; body += `version:${this.runtime.version}\n`; body += `gitversion:${this.runtime.build.gitversion}\n`; body += `buildtime:${this.runtime.build.buildtime}\n`; body += `platform:${this.runtime.platform}\n`; body += "```\n\n"; const params = new URLSearchParams({ body: body }); return `${url}?${params.toString()}`; }, }, created() { this.getRuntime(); }, template: t }