working again

This commit is contained in:
ben
2023-01-25 20:29:42 +00:00
parent fd71c82183
commit cc3dbaa1a7

View File

@@ -313,15 +313,10 @@
</q-card> </q-card>
</q-dialog> </q-dialog>
</div> </div>
{% endblock %} {% block scripts %} {{ window_vars(user) }}
{% endblock %}
{% block scripts %}
<script> <script>
new Vue({ new Vue({
el: '#vue', el: '#vue',
mixins: [windowMixin],
data: function () { data: function () {
return { return {
searchTerm: '', searchTerm: '',
@@ -331,7 +326,7 @@ new Vue({
showUpgradeDialog: false, showUpgradeDialog: false,
selectedExtension: null, selectedExtension: null,
selectedExtensionRepos: null, selectedExtensionRepos: null,
maxStars: 5 maxStars: 0
} }
}, },
watch: { watch: {
@@ -343,7 +338,7 @@ new Vue({
handleTabChanged: function (tab) { handleTabChanged: function (tab) {
this.filterExtensions(this.searchTerm, tab) this.filterExtensions(this.searchTerm, tab)
}, },
filterExtensions(term, tab) { filterExtensions: function (term, tab) {
// Filter the extensions list // Filter the extensions list
function extensionNameContains(searchTerm) { function extensionNameContains(searchTerm) {
return function (extension) { return function (extension) {
@@ -361,7 +356,7 @@ new Vue({
.filter(e => (tab === 'featured' ? e.isFeatured : true)) .filter(e => (tab === 'featured' ? e.isFeatured : true))
.filter(extensionNameContains(term)) .filter(extensionNameContains(term))
}, },
async installExtension(release) { installExtension: async function (release) {
const extension = this.selectedExtension const extension = this.selectedExtension
try { try {
extension.inProgress = true extension.inProgress = true
@@ -386,7 +381,7 @@ new Vue({
extension.inProgress = false extension.inProgress = false
} }
}, },
async uninstallExtension() { uninstallExtension: async function () {
const extension = this.selectedExtension const extension = this.selectedExtension
this.showUpgradeDialog = false this.showUpgradeDialog = false
this.showUninstallDialog = false this.showUninstallDialog = false
@@ -418,12 +413,12 @@ new Vue({
].join('') ].join('')
}, },
showUninstall() { showUninstall: function () {
this.showUpgradeDialog = false this.showUpgradeDialog = false
this.showUninstallDialog = true this.showUninstallDialog = true
}, },
async showUpgrade(extension) { showUpgrade: async function (extension) {
this.selectedExtension = extension this.selectedExtension = extension
this.showUpgradeDialog = true this.showUpgradeDialog = true
this.selectedExtensionRepos = null this.selectedExtensionRepos = null
@@ -457,7 +452,8 @@ new Vue({
hasNewVersion: function (extension) { hasNewVersion: function (extension) {
if (extension.installedRelease && extension.latestRelease) { if (extension.installedRelease && extension.latestRelease) {
return ( return (
extension.installedRelease.version !== extension.latestRelease.version extension.installedRelease.version !==
extension.latestRelease.version
) )
} }
}, },
@@ -470,17 +466,14 @@ new Vue({
} }
} }
}, },
created() { created: function () {
console.log('{{extensions}}') this.extensions = JSON.parse('{{extensions | tojson | safe}}').map(e => ({
console.log(this.extensions)
this.extensions = JSON.parse(window.extensions).map(e => ({
...e, ...e,
inProgress: false inProgress: false
})) }))
this.filteredExtensions = this.extensions.concat([]) this.filteredExtensions = this.extensions.concat([])
}, },
mixins: [windowMixin]
}) })
</script> </script>
{% endblock %} {% endblock %}