Added regex to handle url parts
This commit is contained in:
@@ -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"> </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
2937
pages/index.vue.orig
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user