Add alphabetize button to app list

This commit is contained in:
Yukino Song
2025-05-28 20:41:53 +08:00
parent 4030680fcc
commit d89f3f75d3
3 changed files with 9 additions and 0 deletions

View File

@@ -470,6 +470,9 @@
<button class="btn btn-primary" @click="newApp" :disabled="actionDisabled">
<i class="fas fa-plus"></i> {{ $t('apps.add_new') }}
</button>
<button class="btn btn-secondary float-end" @click="alphabetizeApps" :disabled="actionDisabled" v-if="!listReordered">
<i class="fas fa-sort-alpha-up"></i> {{ $t('apps.alphabetize') }}
</button>
<button class="btn btn-warning float-end" @click="saveOrder" :disabled="actionDisabled" v-if="listReordered">
<i class="fas fa-floppy-disk"></i> {{ $t('apps.save_order') }}
</button>
@@ -587,6 +590,10 @@
this.listReordered = true;
},
alphabetizeApps() {
this.apps.sort((a, b) => a.name.localeCompare(b.name));
this.listReordered = true;
},
saveOrder() {
this.actionDisabled = true;