Added regex to handle url parts

This commit is contained in:
Jacob Anavisca
2020-02-25 01:35:15 -05:00
parent 711cabcf9b
commit 8cc7b525d9
2 changed files with 2970 additions and 11 deletions

View File

@@ -182,19 +182,27 @@
id="url"
name="url"
type="url"
v-model="url"
/>
</li>
<li>
<label for="path">{{ $t("path") }}</label>
<input
@keyup.enter="isValidURL ? sendRequest() : null"
id="path"
name="path"
v-model="path"
@input="pathInputHandler"
v-model="uri"
/>
</li>
<div>
<li>
<label class="hide-on-small-screen" for="send">&nbsp;</label>
<button
:disabled="!isValidURL"
@click="sendRequest"
id="send"
ref="sendButton"
>
{{ $t("send") }}
<span>
<i class="material-icons">send</i>
</span>
</button>
</li>
</div>
</ul>
<ul>
<li>
<label for="label">{{ $t("label") }}</label>
<input
@@ -1533,6 +1541,20 @@ export default {
},
},
computed: {
uri: {
get() {
return this.url + this.path;
},
set(value) {
let uriRegex = value.match(
/^((http[s]?:\/\/)?(<<[^\/]+>>)?[^\/]*|)(\/?.*)$/
);
let url = uriRegex[1];
let path = uriRegex[4];
this.url = url;
this.path = path;
}
},
url: {
get() {
return this.$store.state.request.url

2937
pages/index.vue.orig Normal file

File diff suppressed because it is too large Load Diff