Skip to content

Commit

Permalink
Merge branch 'master' into feature/pre-request-script
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpalenchar committed Oct 30, 2019
2 parents 36fb517 + a53c7ce commit 1bf17d5
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 15 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ When I wrote this, only God and I understood what I was doing. Now, only God kno

**Methods:**
- `GET` - Retrieve information about the REST API resource
- `HEAD` - Asks for a response identical to that of a GET request, but without the response body.
- `HEAD` - Retrieve response headers identical to those of a GET request, but without the response body.
- `POST` - Create a REST API resource
- `PUT` - Update a REST API resource
- `DELETE` - Delete a REST API resource or related component
- `OPTIONS` - Describe the communication options for the target resource
- `PATCH` - Applies partial modifications to a REST API resource
- `PATCH` - Apply partial modifications to a REST API resource

_History entries are synced with local session storage_

Expand Down Expand Up @@ -118,7 +118,7 @@ _HTML responses have "Preview HTML" feature_

**History**: Request entries are synced with local session storage to reuse with a single click.

**Field:s**
**Fields:**
- Label
- Timestamp
- Method
Expand All @@ -140,7 +140,7 @@ _Export, import and replace collections with JSON files_

_Collections are synced with local session storage_

📁 **Proxy**: Enable Proxy Mode from Settings to access blocked APIs
🌐 **Proxy**: Enable Proxy Mode from Settings to access blocked APIs

**Features:**
- Hide your IP address
Expand Down Expand Up @@ -292,9 +292,9 @@ Support this project with your organization. Your logo will show up here with a

This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.

## Acknowledgments 🙏
## Acknowledgements 🙏

* Hat tip to anyone who's code was used
* Hat tip to anyone whose code was used
* Inspirations:
* [Dribbble](https://dribbble.com)

Expand Down
2 changes: 1 addition & 1 deletion components/collections/collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
ul li {
display: flex;
padding-left: 16px;
margin-left: 32px;
border-left: 1px solid var(--brd-color);
}
</style>
Expand Down
2 changes: 1 addition & 1 deletion components/collections/folder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
ul li {
display: flex;
padding-left: 16px;
margin-left: 32px;
border-left: 1px solid var(--brd-color);
}
</style>
Expand Down
1 change: 1 addition & 0 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
if (process.client) {
document.body.classList.add("afterLoad");
}
document.querySelector('meta[name=theme-color]').setAttribute('content', this.$store.state.postwoman.settings.THEME_TAB_COLOR || "#252628");
// Initializes the PWA code - checks if the app is installed,
// etc.
Expand Down
20 changes: 15 additions & 5 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1421,9 +1421,9 @@ export default {
"url",
"path",
!this.urlExcludes.auth ? "auth" : null,
"httpUser",
"httpPassword",
"bearerToken",
!this.urlExcludes.httpUser ? "httpUser" : null,
!this.urlExcludes.httpPassword ? "httpPassword" : null,
!this.urlExcludes.bearerToken ? "bearerToken" : null,
"contentType"
].filter((item) => item !== null).map(item => flat(item));
let deeps = ["headers", "params"].map(item => deep(item));
Expand Down Expand Up @@ -1571,8 +1571,15 @@ export default {
this.editRequest = {};
},
setExclude (excludedField, excluded) {
if (excludedField === "auth") {
this.urlExcludes.auth = excluded;
this.urlExcludes.httpUser = excluded;
this.urlExcludes.httpPassword = excluded;
this.urlExcludes.bearerToken = excluded;
} else {
this.urlExcludes[excludedField] = excluded;
this.setRouteQueryState();
}
this.setRouteQueryState();
},
methodChange() {
// this.$store.commit('setState', { 'value': ["POST", "PUT", "PATCH"].includes(this.method) ? 'application/json' : '', 'attribute': 'contentType' })
Expand All @@ -1585,7 +1592,10 @@ export default {
created() {
this.urlExcludes = this.$store.state.postwoman.settings.URL_EXCLUDES || {
// Exclude authentication by default for security reasons.
auth: true
auth: true,
httpUser: true,
httpPassword: true,
bearerToken: true
};
if (Object.keys(this.$route.query).length)
Expand Down
7 changes: 5 additions & 2 deletions pages/settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<li>
<h3 class="title">Background</h3>
<div class="backgrounds">
<span :key="theme.class" @click="applyTheme(theme.class)" v-for="theme in themes">
<span :key="theme.class" @click="applyTheme(theme.class, theme.color)" v-for="theme in themes">
<swatch
:active="settings.THEME_CLASS === theme.class"
:class="{ vibrant: theme.vibrant }"
Expand Down Expand Up @@ -176,6 +176,7 @@
settings: {
THEME_CLASS: this.$store.state.postwoman.settings.THEME_CLASS || "",
THEME_COLOR: "",
THEME_TAB_COLOR: "",
THEME_COLOR_VIBRANT: true,
FRAME_COLORS_ENABLED:
Expand All @@ -199,8 +200,10 @@
},
methods: {
applyTheme(name) {
applyTheme(name, color) {
this.applySetting("THEME_CLASS", name);
document.querySelector('meta[name=theme-color]').setAttribute('content', color)
this.applySetting("THEME_TAB_COLOR", color);
document.documentElement.className = name;
let imgGitHub = document.getElementById("imgGitHub");
imgGitHub.style["filter"] = "";
Expand Down
5 changes: 5 additions & 0 deletions store/postwoman.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export const SETTINGS_KEYS = [
*/
"THEME_COLOR",

/**
* The hex color code for browser tab color.
*/
"THEME_TAB_COLOR",

/**
* Whether or not THEME_COLOR is considered 'vibrant'.
*
Expand Down

0 comments on commit 1bf17d5

Please sign in to comment.