Merge branch 'master' into master

This commit is contained in:
Liyas Thomas
2019-08-23 10:56:22 +05:30
committed by GitHub
2 changed files with 42 additions and 37 deletions

View File

@@ -75,7 +75,7 @@
<h3>API request builder</h3> <h3>API request builder</h3>
</div> </div>
</header> </header>
<fieldset class="request"> <fieldset class="request" ref="request">
<legend v-on:click="collapse">Request ↕</legend> <legend v-on:click="collapse">Request ↕</legend>
<div class="collapsible"> <div class="collapsible">
<ul> <ul>
@@ -91,11 +91,11 @@
</li> </li>
<li> <li>
<label for="url">URL</label> <label for="url">URL</label>
<input type="url" v-bind:class="{ error: urlNotValid }" v-model="url"> <input type="url" v-bind:class="{ error: urlNotValid }" v-model="url" v-on:keyup.enter="sendRequest">
</li> </li>
<li> <li>
<label for="path">Path</label> <label for="path">Path</label>
<input v-model="path"> <input v-model="path" v-on:keyup.enter="sendRequest">
</li> </li>
<li> <li>
<label for="action">&nbsp;</label> <label for="action">&nbsp;</label>
@@ -104,40 +104,6 @@
</ul> </ul>
</div> </div>
</fieldset> </fieldset>
<fieldset class="history hidden">
<legend v-on:click="collapse">History ↕</legend>
<div class="collapsible">
<ul>
<li><button v-bind:class="{ disabled: noHistoryToClear }" v-on:click="clearHistory">Clear History</button></li>
</ul>
<ul v-for="entry in history">
<li>
<label for="time">Time</label>
<input name="time" type="text" readonly :value="entry.time">
</li>
<li>
<label for="name">Method</label>
<input name="name" type="text" readonly :value="entry.method">
</li>
<li>
<label for="name">URL</label>
<input name="name" type="text" readonly :value="entry.url">
</li>
<li>
<label for="name">Path</label>
<input name="name" type="text" readonly :value="entry.path">
</li>
<li>
<label for="delete">&nbsp;</label>
<button name="delete" @click="deleteHistory(entry)">Delete</button>
</li>
<li>
<label for="use">&nbsp;</label>
<button name="use" @click="useHistory(entry)">Use</button>
</li>
</ul>
</div>
</fieldset>
<fieldset class="reqbody" v-if="method === 'POST' || method === 'PUT'"> <fieldset class="reqbody" v-if="method === 'POST' || method === 'PUT'">
<legend v-on:click="collapse">Request Body ↕</legend> <legend v-on:click="collapse">Request Body ↕</legend>
<div class="collapsible"> <div class="collapsible">
@@ -256,6 +222,42 @@
</ul> </ul>
</div> </div>
</fieldset> </fieldset>
<fieldset class="history">
<legend v-on:click="collapse">History ↕</legend>
<div class="collapsible">
<ul>
<li>
<button v-bind:class="{ disabled: noHistoryToClear }" v-on:click="clearHistory">Clear History</button>
</li>
</ul>
<ul v-for="entry in history">
<li>
<label for="time">Time</label>
<input name="time" type="text" readonly :value="entry.time">
</li>
<li>
<label for="name">Method</label>
<input name="name" type="text" readonly :value="entry.method">
</li>
<li>
<label for="name">URL</label>
<input name="name" type="text" readonly :value="entry.url">
</li>
<li>
<label for="name">Path</label>
<input name="name" type="text" readonly :value="entry.path">
</li>
<li>
<label for="delete">&nbsp;</label>
<button name="delete" @click="deleteHistory(entry)">Delete</button>
</li>
<li>
<label for="use">&nbsp;</label>
<button name="use" @click="useHistory(entry)">Use</button>
</li>
</ul>
</div>
</fieldset>
<footer> <footer>
<a href="https://github.com/liyasthomas/postwoman"><img src="icons/github.svg" alt="" style="margin-right: 16px">GitHub</a> <a href="https://github.com/liyasthomas/postwoman"><img src="icons/github.svg" alt="" style="margin-right: 16px">GitHub</a>
<button id="installPWA" onclick="installPWA()"> <button id="installPWA" onclick="installPWA()">

View File

@@ -98,6 +98,9 @@ const app = new Vue({
this.method = method this.method = method
this.url = url this.url = url
this.path = path this.path = path
this.$refs.request.scrollIntoView({
behavior: 'smooth'
})
}, },
collapse({ collapse({
target target