mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-10 09:19:42 +01:00
make ad space as a CSV formatted string
This commit is contained in:
parent
0a47b63597
commit
f7dd533daa
5 changed files with 5 additions and 33 deletions
|
@ -22,7 +22,7 @@ LNBITS_DEFAULT_WALLET_NAME="LNbits wallet"
|
||||||
# Ad space description
|
# Ad space description
|
||||||
# LNBITS_AD_SPACE_TITLE="Supported by"
|
# LNBITS_AD_SPACE_TITLE="Supported by"
|
||||||
# csv ad space, format "<url>;<img-light>;<img-dark>, <url>;<img-light>;<img-dark>", extensions can choose to honor
|
# csv ad space, format "<url>;<img-light>;<img-dark>, <url>;<img-light>;<img-dark>", extensions can choose to honor
|
||||||
# LNBITS_AD_SPACE=""
|
# LNBITS_AD_SPACE="https://shop.lnbits.com/;https://raw.githubusercontent.com/lnbits/lnbits/main/lnbits/static/images/lnbits-shop-light.png;https://raw.githubusercontent.com/lnbits/lnbits/main/lnbits/static/images/lnbits-shop-dark.png"
|
||||||
|
|
||||||
# Hides wallet api, extensions can choose to honor
|
# Hides wallet api, extensions can choose to honor
|
||||||
LNBITS_HIDE_API=false
|
LNBITS_HIDE_API=false
|
||||||
|
|
|
@ -23,7 +23,7 @@ class UpdateSettings(BaseModel):
|
||||||
lnbits_denomination: str = Query(None)
|
lnbits_denomination: str = Query(None)
|
||||||
lnbits_theme: str = Query(None)
|
lnbits_theme: str = Query(None)
|
||||||
lnbits_custom_logo: str = Query(None)
|
lnbits_custom_logo: str = Query(None)
|
||||||
lnbits_ad_space: List[str] = Query(None)
|
lnbits_ad_space: str = Query(None)
|
||||||
lnbits_ad_space_title: str = Query(None)
|
lnbits_ad_space_title: str = Query(None)
|
||||||
|
|
||||||
# funding sources
|
# funding sources
|
||||||
|
|
|
@ -98,27 +98,12 @@
|
||||||
<p>Advertisement Slots</p>
|
<p>Advertisement Slots</p>
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
v-model="formData.ad_space_add"
|
v-model="formData.lnbits_ad_space"
|
||||||
type="text"
|
type="text"
|
||||||
label="url;img_light_url;img_dark_url, url..."
|
label="url;img_light_url;img_dark_url, url..."
|
||||||
hint="Ad url and image filepaths in CSV format, extensions can choose to honor"
|
hint="Ad url and image filepaths in CSV format, extensions can choose to honor"
|
||||||
>
|
>
|
||||||
<!-- <q-btn @click="addAdSpace" dense flat icon="add"></q-btn> -->
|
|
||||||
</q-input>
|
</q-input>
|
||||||
<div>
|
|
||||||
{% raw %}
|
|
||||||
<q-chip
|
|
||||||
v-for="space in settings.lnbits_ad_space"
|
|
||||||
:key="space"
|
|
||||||
removable
|
|
||||||
@remove="removeAdSpace(space)"
|
|
||||||
color="primary"
|
|
||||||
text-color="white"
|
|
||||||
>
|
|
||||||
{{ space.slice(0, 8) + " ... " + space.slice(-8) }}
|
|
||||||
</q-chip>
|
|
||||||
{% endraw %}
|
|
||||||
</div>
|
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -364,19 +364,6 @@
|
||||||
u => u !== user
|
u => u !== user
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
addAdSpace() {
|
|
||||||
let adSpace = this.formData.ad_space_add
|
|
||||||
let spaces = this.settings.lnbits_ad_space
|
|
||||||
if (adSpace.length && !spaces.includes(adSpace)) {
|
|
||||||
spaces.push(adSpace)
|
|
||||||
this.settings.lnbits_ad_space = spaces
|
|
||||||
this.formData.ad_space_add = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
removeAdSpace(ad) {
|
|
||||||
let spaces = this.settings.lnbits_ad_space
|
|
||||||
this.settings.lnbits_ad_space = spaces.filter(s => s !== ad)
|
|
||||||
},
|
|
||||||
restartServer() {
|
restartServer() {
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.request('GET', '/admin/api/v1/restart/?usr=' + this.g.user.id)
|
.request('GET', '/admin/api/v1/restart/?usr=' + this.g.user.id)
|
||||||
|
|
|
@ -62,7 +62,7 @@ class Settings(BaseSettings):
|
||||||
default=["classic", "flamingo", "mint", "salvador", "monochrome", "autumn"]
|
default=["classic", "flamingo", "mint", "salvador", "monochrome", "autumn"]
|
||||||
)
|
)
|
||||||
lnbits_custom_logo: str = Field(default=None)
|
lnbits_custom_logo: str = Field(default=None)
|
||||||
lnbits_ad_space: List[str] = Field(default=[])
|
lnbits_ad_space: str = Field(default="")
|
||||||
lnbits_ad_space_title: str = Field(default="")
|
lnbits_ad_space_title: str = Field(default="")
|
||||||
|
|
||||||
# ops
|
# ops
|
||||||
|
@ -136,7 +136,7 @@ class Settings(BaseSettings):
|
||||||
"lnbits_admin_users",
|
"lnbits_admin_users",
|
||||||
"lnbits_allowed_users",
|
"lnbits_allowed_users",
|
||||||
"lnbits_theme_options",
|
"lnbits_theme_options",
|
||||||
"lnbits_ad_space",
|
# "lnbits_ad_space",
|
||||||
"lnbits_admin_extensions",
|
"lnbits_admin_extensions",
|
||||||
"lnbits_disabled_extensions",
|
"lnbits_disabled_extensions",
|
||||||
"lnbits_allowed_funding_sources",
|
"lnbits_allowed_funding_sources",
|
||||||
|
|
Loading…
Add table
Reference in a new issue