Implement HTTP basic auth feature

This commit is contained in:
Ivan Bratović 2021-11-02 12:30:44 +01:00
parent 665c263c03
commit 23736549f9
3 changed files with 34 additions and 0 deletions

View file

@ -265,6 +265,15 @@
<label for="headers" class="form-label">{{ $t("Headers") }}</label>
<textarea id="headers" v-model="monitor.headers" class="form-control" :placeholder="headersPlaceholder"></textarea>
</div>
<!-- HTTP Basic Auth -->
<h4 class="mt-5 mb-2">{{ $t("HTTP Basic Auth") }}</h4>
<div class="my-3">
<label for="basicauth" class="form-label">{{ $t("Username") }}</label>
<input id="basicauth-user" v-model="monitor.basicauth_user" type="text" class="form-control" :placeholder="Username">
<label for="basicauth" class="form-label">{{ $t("Password") }}</label>
<input id="basicauth-pass" v-model="monitor.basicauth_pass" type="password" class="form-control" :placeholder="Password">
</div>
</template>
</div>
</div>
@ -487,6 +496,7 @@ export default {
this.monitor.headers = JSON.stringify(JSON.parse(this.monitor.headers), null, 4);
}
if (this.isAdd) {
this.$root.add(this.monitor, async (res) => {