Add URL validation to settings URL inputs on admin UI.

This commit is contained in:
Kailash Nadh 2024-03-25 11:06:40 +05:30
parent 1bd55e1a03
commit f04798a329
3 changed files with 8 additions and 7 deletions

View file

@ -8,7 +8,7 @@
<b-field :label="$t('settings.general.rootURL')" label-position="on-border"
:message="$t('settings.general.rootURLHelp')">
<b-input v-model="data['app.root_url']" name="app.root_url" placeholder="https://listmonk.yoursite.com"
:maxlength="300" required />
:maxlength="300" required type="url" pattern="https?://.*" />
</b-field>
<div class="columns">
@ -16,14 +16,15 @@
<b-field :label="$t('settings.general.logoURL')" label-position="on-border"
:message="$t('settings.general.logoURLHelp')">
<b-input v-model="data['app.logo_url']" name="app.logo_url" placeholder="https://listmonk.yoursite.com/logo.png"
:maxlength="300" />
:maxlength="300" type="url" pattern="https?://.*" />
</b-field>
</div>
<div class="column is-6">
<b-field :label="$t('settings.general.faviconURL')" label-position="on-border"
:message="$t('settings.general.faviconURLHelp')">
<b-input v-model="data['app.favicon_url']" name="app.favicon_url"
placeholder="https://listmonk.yoursite.com/favicon.png" :maxlength="300" />
placeholder="https://listmonk.yoursite.com/favicon.png" :maxlength="300"
type="url" pattern="https?://.*" />
</b-field>
</div>
</div>

View file

@ -97,14 +97,14 @@
</div>
<div class="column is-9">
<b-field :label="$t('settings.media.s3.url')" label-position="on-border"
:message="$t('settings.media.s3.urlHelp')" expanded>
:message="$t('settings.media.s3.urlHelp')">
<b-input v-model="data['upload.s3.url']" name="upload.s3.url" :disabled="!data['upload.s3.bucket']" required
placeholder="https://s3.$region.amazonaws.com" :maxlength="200" />
placeholder="https://s3.$region.amazonaws.com" :maxlength="200" expanded type="url" pattern="https?://.*" />
</b-field>
<b-field :label="$t('settings.media.s3.publicURL')" label-position="on-border" expanded>
<b-input v-model="data['upload.s3.public_url']" :message="$t('settings.media.s3.publicURLHelp')"
name="upload.s3.public_url" :disabled="!data['upload.s3.bucket']" placeholder="https://files.yourdomain.com"
:maxlength="200" />
:maxlength="200" type="url" pattern="https?://.*" />
</b-field>
</div>
</div>

View file

@ -27,7 +27,7 @@
<b-field :label="$t('settings.messengers.url')" label-position="on-border"
:message="$t('settings.messengers.urlHelp')">
<b-input v-model="item.root_url" name="root_url" placeholder="https://postback.messenger.net/path"
:maxlength="200" />
:maxlength="200" expanded type="url" pattern="https?://.*" />
</b-field>
</div>
</div><!-- host -->