| 92 | } |
| 93 | |
| 94 | const handlePodmanVersion = async (row: PodmanTableRow) => { |
| 95 | if (PodmanSetup.installing) return |
| 96 | PodmanSetup.installing = true |
| 97 | PodmanSetup.installEnd = false |
| 98 | const fn = row.installed ? 'uninstall' : 'install' |
| 99 | const sh = join(window.Server.Static!, 'sh/podman-cmd.sh') |
| 100 | const copyfile = join(window.Server.Cache!, 'podman-cmd.sh') |
| 101 | const exists = await fs.existsSync(copyfile) |
| 102 | if (exists) await fs.remove(copyfile) |
| 103 | await fs.copyFile(sh, copyfile) |
| 104 | await fs.chmod(copyfile, '0777') |
| 105 | const params = [`${copyfile} ${fn} ${row.name};`] |
| 106 | await nextTick() |
| 107 | const execXTerm = new XTerm() |
| 108 | PodmanSetup.xterm = execXTerm |
| 109 | await execXTerm.mount(xtermDom.value!) |
| 110 | await execXTerm.send(params) |
| 111 | PodmanSetup.installEnd = true |
| 112 | PodmanSetup.installing = false |
| 113 | } |
| 114 | |
| 115 | const xtermDom = ref<HTMLElement | null>(null) |
| 116 | |