Start of destination support and some refactoring

This commit is contained in:
2022-07-05 20:43:32 +09:30
parent c1c1fc1866
commit 16d9ac368c
7 changed files with 189 additions and 81 deletions

View File

@@ -54,8 +54,6 @@
</template>
{{ range $k, $v := .Downloads }}
{{ end }}
</tbody>
</table>
</div>
@@ -65,7 +63,7 @@
<script>
function index() {
return {
items: [], version: {},
items: [], version: {}, popups: {},
fetch_version() {
fetch('/rest/version')
.then(response => response.json())
@@ -90,9 +88,11 @@
})
},
show_popup(item) {
window.open(item.popup_url, item.id, "width={{ .Config.UI.PopupWidth }},height={{ .Config.UI.PopupHeight }}");
},
}
// allegedly you can use the reference to pop the window to the front on subsequent
// clicks, but I can't seem to find a reliable way to do so.
this.popups[item.id] = window.open(item.popup_url, item.id, "width={{ .Config.UI.PopupWidth }},height={{ .Config.UI.PopupHeight }}");
},
}
}
</script>
{{ end }}