Added regex to handle url parts
This commit is contained in:
@@ -182,19 +182,27 @@
|
|||||||
id="url"
|
id="url"
|
||||||
name="url"
|
name="url"
|
||||||
type="url"
|
type="url"
|
||||||
v-model="url"
|
v-model="uri"
|
||||||
/>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<label for="path">{{ $t("path") }}</label>
|
|
||||||
<input
|
|
||||||
@keyup.enter="isValidURL ? sendRequest() : null"
|
|
||||||
id="path"
|
|
||||||
name="path"
|
|
||||||
v-model="path"
|
|
||||||
@input="pathInputHandler"
|
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
|
<div>
|
||||||
|
<li>
|
||||||
|
<label class="hide-on-small-screen" for="send"> </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>
|
<li>
|
||||||
<label for="label">{{ $t("label") }}</label>
|
<label for="label">{{ $t("label") }}</label>
|
||||||
<input
|
<input
|
||||||
@@ -1533,6 +1541,20 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
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: {
|
url: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.request.url
|
return this.$store.state.request.url
|
||||||
|
|||||||
2937
pages/index.vue.orig
Normal file
2937
pages/index.vue.orig
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user