feat: show new install available icon
This commit is contained in:
parent
03df382325
commit
584b667637
1 changed files with 25 additions and 27 deletions
|
|
@ -55,12 +55,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
<q-badge
|
<q-badge
|
||||||
v-if="extension.details"
|
v-if="hasNewVersion(extension)"
|
||||||
@click="showExtensionDetails(extension)"
|
color="green"
|
||||||
color="secondary"
|
class="float-right"
|
||||||
class="cursor-pointer float-right"
|
|
||||||
>
|
>
|
||||||
<small>More</small>
|
<small>New Version</small>
|
||||||
</q-badge>
|
</q-badge>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -155,18 +154,23 @@
|
||||||
v-for="release of selectedExtensionRepos[repo]"
|
v-for="release of selectedExtensionRepos[repo]"
|
||||||
:key="release.version"
|
:key="release.version"
|
||||||
group="extras"
|
group="extras"
|
||||||
icon="download"
|
:icon="isInstalledVersion(selectedExtension, release) ? 'download_done' : 'download'"
|
||||||
:label="release.description"
|
:label="release.description"
|
||||||
:caption="release.version"
|
:caption="release.version"
|
||||||
:content-inset-level="0.5"
|
:content-inset-level="0.5"
|
||||||
|
:header-class="isInstalledVersion(selectedExtension, release) ? 'text-green' : ''"
|
||||||
>
|
>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="!isInstalledVersion(selectedExtension, release)"
|
||||||
@click="installExtension(release)"
|
@click="installExtension(release)"
|
||||||
color="primary unelevated mt-lg pt-lg"
|
color="primary unelevated mt-lg pt-lg"
|
||||||
>Install</q-btn
|
>Install</q-btn
|
||||||
>
|
>
|
||||||
|
<span v-if="isInstalledVersion(selectedExtension, release)"
|
||||||
|
>xxxxx</span
|
||||||
|
>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator></q-separator>
|
<q-separator></q-separator>
|
||||||
<div
|
<div
|
||||||
|
|
@ -185,22 +189,6 @@
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
{%raw%}
|
|
||||||
<q-dialog v-model="showDetailsDialog">
|
|
||||||
<q-card v-if="selectedExtension" class="q-pa-lg">
|
|
||||||
<h6 class="q-my-md text-primary">{{selectedExtension.name}}</h6>
|
|
||||||
<div
|
|
||||||
v-if="selectedExtension.details"
|
|
||||||
v-html="selectedExtension.details"
|
|
||||||
></div>
|
|
||||||
|
|
||||||
<div class="row q-mt-lg">
|
|
||||||
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Done</q-btn>
|
|
||||||
</div>
|
|
||||||
</q-card>
|
|
||||||
</q-dialog>
|
|
||||||
{%endraw%}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %} {% block scripts %} {{ window_vars(user) }}
|
{% endblock %} {% block scripts %} {{ window_vars(user) }}
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -213,7 +201,6 @@
|
||||||
filteredExtensions: null,
|
filteredExtensions: null,
|
||||||
showUninstallDialog: false,
|
showUninstallDialog: false,
|
||||||
showUpgradeDialog: false,
|
showUpgradeDialog: false,
|
||||||
showDetailsDialog: false,
|
|
||||||
selectedExtension: null,
|
selectedExtension: null,
|
||||||
selectedExtensionRepos: null,
|
selectedExtensionRepos: null,
|
||||||
maxStars: 0
|
maxStars: 0
|
||||||
|
|
@ -323,10 +310,21 @@
|
||||||
}, {})
|
}, {})
|
||||||
console.log('### repos', this.selectedExtensionRepos)
|
console.log('### repos', this.selectedExtensionRepos)
|
||||||
},
|
},
|
||||||
|
hasNewVersion: function (extension) {
|
||||||
showExtensionDetails: function (extension) {
|
if (extension.installedRelease && extension.latestRelease) {
|
||||||
this.selectedExtension = extension
|
return (
|
||||||
this.showDetailsDialog = true
|
extension.installedRelease.version !==
|
||||||
|
extension.latestRelease.version
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isInstalledVersion: function (extension, release) {
|
||||||
|
if (extension.installedRelease) {
|
||||||
|
return (
|
||||||
|
extension.installedRelease.source_repo === release.source_repo &&
|
||||||
|
extension.installedRelease.version === release.version
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue