Skip to content

Commit

Permalink
Nice formatting of funding source titles in Server admin (lnbits#2543)
Browse files Browse the repository at this point in the history
* Display friendly funding source titles in funding sources list

* Sort funding options select alphabetically

* Run make bundle
  • Loading branch information
blackcoffeexbt authored Jun 10, 2024
1 parent 83b8985 commit b3368d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
18 changes: 9 additions & 9 deletions lnbits/static/bundle.min.js

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion lnbits/static/js/components/lnbits-funding-sources.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Vue.component('lnbits-funding-sources', {
mixins: [windowMixin],
props: ['form-data', 'allowed-funding-sources'],
methods: {
getFundingSourceLabel(item) {
const fundingSource = this.rawFundingSources.find(
fundingSource => fundingSource[0] === item
)
return fundingSource ? fundingSource[1] : item
}
},
computed: {
fundingSources() {
let tmp = []
Expand All @@ -14,6 +22,9 @@ Vue.component('lnbits-funding-sources', {
tmp.push([key, tmpObj])
}
return new Map(tmp)
},
sortedAllowedFundingSources() {
return this.allowedFundingSources.sort()
}
},
data() {
Expand Down Expand Up @@ -159,7 +170,8 @@ Vue.component('lnbits-funding-sources', {
filled
v-model="formData.lnbits_backend_wallet_class"
hint="Select the active funding wallet"
:options="allowedFundingSources"
:options="sortedAllowedFundingSources"
:option-label="(item) => getFundingSourceLabel(item)"
></q-select>
</div>
</div>
Expand Down

0 comments on commit b3368d8

Please sign in to comment.