Initial prettier formatted files
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import * as cookie from "cookie";
|
import * as cookie from 'cookie'
|
||||||
import * as URL from "url";
|
import * as URL from 'url'
|
||||||
import * as querystring from "querystring";
|
import * as querystring from 'querystring'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* given this: [ 'msg1=value1', 'msg2=value2' ]
|
* given this: [ 'msg1=value1', 'msg2=value2' ]
|
||||||
@@ -8,219 +8,215 @@ import * as querystring from "querystring";
|
|||||||
* @param dataArguments
|
* @param dataArguments
|
||||||
*/
|
*/
|
||||||
const joinDataArguments = dataArguments => {
|
const joinDataArguments = dataArguments => {
|
||||||
let data = "";
|
let data = ''
|
||||||
dataArguments.forEach((argument, i) => {
|
dataArguments.forEach((argument, i) => {
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
data += argument;
|
data += argument
|
||||||
} else {
|
} else {
|
||||||
data += `&${argument}`;
|
data += `&${argument}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return data
|
||||||
}
|
}
|
||||||
});
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const parseCurlCommand = curlCommand => {
|
const parseCurlCommand = curlCommand => {
|
||||||
let newlineFound = /\r|\n/.exec(curlCommand);
|
let newlineFound = /\r|\n/.exec(curlCommand)
|
||||||
if (newlineFound) {
|
if (newlineFound) {
|
||||||
// remove newlines
|
// remove newlines
|
||||||
curlCommand = curlCommand.replace(/\r|\n/g, "");
|
curlCommand = curlCommand.replace(/\r|\n/g, '')
|
||||||
}
|
}
|
||||||
// yargs parses -XPOST as separate arguments. just prescreen for it.
|
// yargs parses -XPOST as separate arguments. just prescreen for it.
|
||||||
curlCommand = curlCommand.replace(/ -XPOST/, " -X POST");
|
curlCommand = curlCommand.replace(/ -XPOST/, ' -X POST')
|
||||||
curlCommand = curlCommand.replace(/ -XGET/, " -X GET");
|
curlCommand = curlCommand.replace(/ -XGET/, ' -X GET')
|
||||||
curlCommand = curlCommand.replace(/ -XPUT/, " -X PUT");
|
curlCommand = curlCommand.replace(/ -XPUT/, ' -X PUT')
|
||||||
curlCommand = curlCommand.replace(/ -XPATCH/, " -X PATCH");
|
curlCommand = curlCommand.replace(/ -XPATCH/, ' -X PATCH')
|
||||||
curlCommand = curlCommand.replace(/ -XDELETE/, " -X DELETE");
|
curlCommand = curlCommand.replace(/ -XDELETE/, ' -X DELETE')
|
||||||
curlCommand = curlCommand.trim();
|
curlCommand = curlCommand.trim()
|
||||||
let parsedArguments = require("yargs-parser")(curlCommand);
|
let parsedArguments = require('yargs-parser')(curlCommand)
|
||||||
let cookieString;
|
let cookieString
|
||||||
let cookies;
|
let cookies
|
||||||
let url = parsedArguments._[1];
|
let url = parsedArguments._[1]
|
||||||
if (!url) {
|
if (!url) {
|
||||||
for (let argName in parsedArguments) {
|
for (let argName in parsedArguments) {
|
||||||
if (typeof parsedArguments[argName] === "string") {
|
if (typeof parsedArguments[argName] === 'string') {
|
||||||
if (["http", "www."].includes(parsedArguments[argName])) {
|
if (['http', 'www.'].includes(parsedArguments[argName])) {
|
||||||
url = parsedArguments[argName];
|
url = parsedArguments[argName]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let headers;
|
let headers
|
||||||
|
|
||||||
const parseHeaders = headerFieldName => {
|
const parseHeaders = headerFieldName => {
|
||||||
if (parsedArguments[headerFieldName]) {
|
if (parsedArguments[headerFieldName]) {
|
||||||
if (!headers) {
|
if (!headers) {
|
||||||
headers = {};
|
headers = {}
|
||||||
}
|
}
|
||||||
if (!Array.isArray(parsedArguments[headerFieldName])) {
|
if (!Array.isArray(parsedArguments[headerFieldName])) {
|
||||||
parsedArguments[headerFieldName] = [parsedArguments[headerFieldName]];
|
parsedArguments[headerFieldName] = [parsedArguments[headerFieldName]]
|
||||||
}
|
}
|
||||||
parsedArguments[headerFieldName].forEach(header => {
|
parsedArguments[headerFieldName].forEach(header => {
|
||||||
if (header.includes("Cookie")) {
|
if (header.includes('Cookie')) {
|
||||||
// stupid javascript tricks: closure
|
// stupid javascript tricks: closure
|
||||||
cookieString = header;
|
cookieString = header
|
||||||
} else {
|
} else {
|
||||||
let colonIndex = header.indexOf(":");
|
let colonIndex = header.indexOf(':')
|
||||||
let headerName = header.substring(0, colonIndex);
|
let headerName = header.substring(0, colonIndex)
|
||||||
let headerValue = header.substring(colonIndex + 1).trim();
|
let headerValue = header.substring(colonIndex + 1).trim()
|
||||||
headers[headerName] = headerValue;
|
headers[headerName] = headerValue
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
parseHeaders("H");
|
parseHeaders('H')
|
||||||
parseHeaders("header");
|
parseHeaders('header')
|
||||||
if (parsedArguments.A) {
|
if (parsedArguments.A) {
|
||||||
if (!headers) {
|
if (!headers) {
|
||||||
headers = [];
|
headers = []
|
||||||
}
|
}
|
||||||
headers["User-Agent"] = parsedArguments.A;
|
headers['User-Agent'] = parsedArguments.A
|
||||||
} else if (parsedArguments["user-agent"]) {
|
} else if (parsedArguments['user-agent']) {
|
||||||
if (!headers) {
|
if (!headers) {
|
||||||
headers = [];
|
headers = []
|
||||||
}
|
}
|
||||||
headers["User-Agent"] = parsedArguments["user-agent"];
|
headers['User-Agent'] = parsedArguments['user-agent']
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedArguments.b) {
|
if (parsedArguments.b) {
|
||||||
cookieString = parsedArguments.b;
|
cookieString = parsedArguments.b
|
||||||
}
|
}
|
||||||
if (parsedArguments.cookie) {
|
if (parsedArguments.cookie) {
|
||||||
cookieString = parsedArguments.cookie;
|
cookieString = parsedArguments.cookie
|
||||||
}
|
}
|
||||||
let multipartUploads;
|
let multipartUploads
|
||||||
if (parsedArguments.F) {
|
if (parsedArguments.F) {
|
||||||
multipartUploads = {};
|
multipartUploads = {}
|
||||||
if (!Array.isArray(parsedArguments.F)) {
|
if (!Array.isArray(parsedArguments.F)) {
|
||||||
parsedArguments.F = [parsedArguments.F];
|
parsedArguments.F = [parsedArguments.F]
|
||||||
}
|
}
|
||||||
parsedArguments.F.forEach(multipartArgument => {
|
parsedArguments.F.forEach(multipartArgument => {
|
||||||
// input looks like key=value. value could be json or a file path prepended with an @
|
// input looks like key=value. value could be json or a file path prepended with an @
|
||||||
const [key, value] = multipartArgument.split("=", 2);
|
const [key, value] = multipartArgument.split('=', 2)
|
||||||
multipartUploads[key] = value;
|
multipartUploads[key] = value
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
if (cookieString) {
|
if (cookieString) {
|
||||||
const cookieParseOptions = {
|
const cookieParseOptions = {
|
||||||
decode: s => s
|
decode: s => s,
|
||||||
};
|
}
|
||||||
// separate out cookie headers into separate data structure
|
// separate out cookie headers into separate data structure
|
||||||
// note: cookie is case insensitive
|
// note: cookie is case insensitive
|
||||||
cookies = cookie.parse(
|
cookies = cookie.parse(cookieString.replace(/^Cookie: /gi, ''), cookieParseOptions)
|
||||||
cookieString.replace(/^Cookie: /gi, ""),
|
|
||||||
cookieParseOptions
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
let method;
|
let method
|
||||||
if (parsedArguments.X === "POST") {
|
if (parsedArguments.X === 'POST') {
|
||||||
method = "post";
|
method = 'post'
|
||||||
} else if (parsedArguments.X === "PUT" || parsedArguments["T"]) {
|
} else if (parsedArguments.X === 'PUT' || parsedArguments['T']) {
|
||||||
method = "put";
|
method = 'put'
|
||||||
} else if (parsedArguments.X === "PATCH") {
|
} else if (parsedArguments.X === 'PATCH') {
|
||||||
method = "patch";
|
method = 'patch'
|
||||||
} else if (parsedArguments.X === "DELETE") {
|
} else if (parsedArguments.X === 'DELETE') {
|
||||||
method = "delete";
|
method = 'delete'
|
||||||
} else if (parsedArguments.X === "OPTIONS") {
|
} else if (parsedArguments.X === 'OPTIONS') {
|
||||||
method = "options";
|
method = 'options'
|
||||||
} else if (
|
} else if (
|
||||||
(parsedArguments["d"] ||
|
(parsedArguments['d'] ||
|
||||||
parsedArguments["data"] ||
|
parsedArguments['data'] ||
|
||||||
parsedArguments["data-ascii"] ||
|
parsedArguments['data-ascii'] ||
|
||||||
parsedArguments["data-binary"] ||
|
parsedArguments['data-binary'] ||
|
||||||
parsedArguments["F"] ||
|
parsedArguments['F'] ||
|
||||||
parsedArguments["form"]) &&
|
parsedArguments['form']) &&
|
||||||
!(parsedArguments["G"] || parsedArguments["get"])
|
!(parsedArguments['G'] || parsedArguments['get'])
|
||||||
) {
|
) {
|
||||||
method = "post";
|
method = 'post'
|
||||||
} else if (parsedArguments["I"] || parsedArguments["head"]) {
|
} else if (parsedArguments['I'] || parsedArguments['head']) {
|
||||||
method = "head";
|
method = 'head'
|
||||||
} else {
|
} else {
|
||||||
method = "get";
|
method = 'get'
|
||||||
}
|
}
|
||||||
|
|
||||||
let compressed = !!parsedArguments.compressed;
|
let compressed = !!parsedArguments.compressed
|
||||||
let urlObject = URL.parse(url); // eslint-disable-line
|
let urlObject = URL.parse(url) // eslint-disable-line
|
||||||
|
|
||||||
// if GET request with data, convert data to query string
|
// if GET request with data, convert data to query string
|
||||||
// NB: the -G flag does not change the http verb. It just moves the data into the url.
|
// NB: the -G flag does not change the http verb. It just moves the data into the url.
|
||||||
if (parsedArguments["G"] || parsedArguments["get"]) {
|
if (parsedArguments['G'] || parsedArguments['get']) {
|
||||||
urlObject.query = urlObject.query ? urlObject.query : "";
|
urlObject.query = urlObject.query ? urlObject.query : ''
|
||||||
let option =
|
let option = 'd' in parsedArguments ? 'd' : 'data' in parsedArguments ? 'data' : null
|
||||||
"d" in parsedArguments ? "d" : "data" in parsedArguments ? "data" : null;
|
|
||||||
if (option) {
|
if (option) {
|
||||||
let urlQueryString = "";
|
let urlQueryString = ''
|
||||||
|
|
||||||
if (!url.includes("?")) {
|
if (!url.includes('?')) {
|
||||||
url += "?";
|
url += '?'
|
||||||
} else {
|
} else {
|
||||||
urlQueryString += "&";
|
urlQueryString += '&'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof parsedArguments[option] === "object") {
|
if (typeof parsedArguments[option] === 'object') {
|
||||||
urlQueryString += parsedArguments[option].join("&");
|
urlQueryString += parsedArguments[option].join('&')
|
||||||
} else {
|
} else {
|
||||||
urlQueryString += parsedArguments[option];
|
urlQueryString += parsedArguments[option]
|
||||||
}
|
}
|
||||||
urlObject.query += urlQueryString;
|
urlObject.query += urlQueryString
|
||||||
url += urlQueryString;
|
url += urlQueryString
|
||||||
delete parsedArguments[option];
|
delete parsedArguments[option]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let query = querystring.parse(urlObject.query, null, null, {
|
let query = querystring.parse(urlObject.query, null, null, {
|
||||||
maxKeys: 10000
|
maxKeys: 10000,
|
||||||
});
|
})
|
||||||
|
|
||||||
urlObject.search = null; // Clean out the search/query portion.
|
urlObject.search = null // Clean out the search/query portion.
|
||||||
const request = {
|
const request = {
|
||||||
url,
|
url,
|
||||||
urlWithoutQuery: URL.format(urlObject)
|
urlWithoutQuery: URL.format(urlObject),
|
||||||
};
|
}
|
||||||
if (compressed) {
|
if (compressed) {
|
||||||
request["compressed"] = true;
|
request['compressed'] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(query).length > 0) {
|
if (Object.keys(query).length > 0) {
|
||||||
request.query = query;
|
request.query = query
|
||||||
}
|
}
|
||||||
if (headers) {
|
if (headers) {
|
||||||
request.headers = headers;
|
request.headers = headers
|
||||||
}
|
}
|
||||||
request["method"] = method;
|
request['method'] = method
|
||||||
|
|
||||||
if (cookies) {
|
if (cookies) {
|
||||||
request.cookies = cookies;
|
request.cookies = cookies
|
||||||
request.cookieString = cookieString.replace("Cookie: ", "");
|
request.cookieString = cookieString.replace('Cookie: ', '')
|
||||||
}
|
}
|
||||||
if (multipartUploads) {
|
if (multipartUploads) {
|
||||||
request.multipartUploads = multipartUploads;
|
request.multipartUploads = multipartUploads
|
||||||
}
|
}
|
||||||
if (parsedArguments.data) {
|
if (parsedArguments.data) {
|
||||||
request.data = parsedArguments.data;
|
request.data = parsedArguments.data
|
||||||
} else if (parsedArguments["data-binary"]) {
|
} else if (parsedArguments['data-binary']) {
|
||||||
request.data = parsedArguments["data-binary"];
|
request.data = parsedArguments['data-binary']
|
||||||
request.isDataBinary = true;
|
request.isDataBinary = true
|
||||||
} else if (parsedArguments["d"]) {
|
} else if (parsedArguments['d']) {
|
||||||
request.data = parsedArguments["d"];
|
request.data = parsedArguments['d']
|
||||||
} else if (parsedArguments["data-ascii"]) {
|
} else if (parsedArguments['data-ascii']) {
|
||||||
request.data = parsedArguments["data-ascii"];
|
request.data = parsedArguments['data-ascii']
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedArguments["u"]) {
|
if (parsedArguments['u']) {
|
||||||
request.auth = parsedArguments["u"];
|
request.auth = parsedArguments['u']
|
||||||
}
|
}
|
||||||
if (parsedArguments["user"]) {
|
if (parsedArguments['user']) {
|
||||||
request.auth = parsedArguments["user"];
|
request.auth = parsedArguments['user']
|
||||||
}
|
}
|
||||||
if (Array.isArray(request.data)) {
|
if (Array.isArray(request.data)) {
|
||||||
request.dataArray = request.data;
|
request.dataArray = request.data
|
||||||
request.data = joinDataArguments(request.data);
|
request.data = joinDataArguments(request.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedArguments["k"] || parsedArguments["insecure"]) {
|
if (parsedArguments['k'] || parsedArguments['insecure']) {
|
||||||
request.insecure = true;
|
request.insecure = true
|
||||||
|
}
|
||||||
|
return request
|
||||||
}
|
}
|
||||||
return request;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default parseCurlCommand;
|
export default parseCurlCommand
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const redirectUri = `${window.location.origin}/`;
|
const redirectUri = `${window.location.origin}/`
|
||||||
|
|
||||||
// GENERAL HELPER FUNCTIONS
|
// GENERAL HELPER FUNCTIONS
|
||||||
|
|
||||||
@@ -13,23 +13,23 @@ const redirectUri = `${window.location.origin}/`;
|
|||||||
const sendPostRequest = async (url, params) => {
|
const sendPostRequest = async (url, params) => {
|
||||||
const body = Object.keys(params)
|
const body = Object.keys(params)
|
||||||
.map(key => `${key}=${params[key]}`)
|
.map(key => `${key}=${params[key]}`)
|
||||||
.join("&");
|
.join('&')
|
||||||
const options = {
|
const options = {
|
||||||
method: "post",
|
method: 'post',
|
||||||
headers: {
|
headers: {
|
||||||
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
|
'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||||
},
|
},
|
||||||
body
|
body,
|
||||||
};
|
}
|
||||||
try {
|
try {
|
||||||
const response = await fetch(url, options);
|
const response = await fetch(url, options)
|
||||||
const data = await response.json();
|
const data = await response.json()
|
||||||
return data;
|
return data
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Request failed", err);
|
console.error('Request failed', err)
|
||||||
throw err;
|
throw err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a query string into an object
|
* Parse a query string into an object
|
||||||
@@ -39,16 +39,13 @@ const sendPostRequest = async (url, params) => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const parseQueryString = searchQuery => {
|
const parseQueryString = searchQuery => {
|
||||||
if (searchQuery === "") {
|
if (searchQuery === '') {
|
||||||
return {};
|
return {}
|
||||||
|
}
|
||||||
|
const segments = searchQuery.split('&').map(s => s.split('='))
|
||||||
|
const queryString = segments.reduce((obj, el) => ({ ...obj, [el[0]]: el[1] }), {})
|
||||||
|
return queryString
|
||||||
}
|
}
|
||||||
const segments = searchQuery.split("&").map(s => s.split("="));
|
|
||||||
const queryString = segments.reduce(
|
|
||||||
(obj, el) => ({ ...obj, [el[0]]: el[1] }),
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
return queryString;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get OAuth configuration from OpenID Discovery endpoint
|
* Get OAuth configuration from OpenID Discovery endpoint
|
||||||
@@ -58,20 +55,20 @@ const parseQueryString = searchQuery => {
|
|||||||
|
|
||||||
const getTokenConfiguration = async endpoint => {
|
const getTokenConfiguration = async endpoint => {
|
||||||
const options = {
|
const options = {
|
||||||
method: "GET",
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
"Content-type": "application/json"
|
'Content-type': 'application/json',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(endpoint, options);
|
const response = await fetch(endpoint, options)
|
||||||
const config = await response.json();
|
const config = await response.json()
|
||||||
return config;
|
return config
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Request failed", err);
|
console.error('Request failed', err)
|
||||||
throw err;
|
throw err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// PKCE HELPER FUNCTIONS
|
// PKCE HELPER FUNCTIONS
|
||||||
|
|
||||||
@@ -82,10 +79,10 @@ const getTokenConfiguration = async endpoint => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const generateRandomString = () => {
|
const generateRandomString = () => {
|
||||||
const array = new Uint32Array(28);
|
const array = new Uint32Array(28)
|
||||||
window.crypto.getRandomValues(array);
|
window.crypto.getRandomValues(array)
|
||||||
return Array.from(array, dec => `0${dec.toString(16)}`.substr(-2)).join("");
|
return Array.from(array, dec => `0${dec.toString(16)}`.substr(-2)).join('')
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the SHA256 hash of the input text
|
* Calculate the SHA256 hash of the input text
|
||||||
@@ -94,10 +91,10 @@ const generateRandomString = () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const sha256 = plain => {
|
const sha256 = plain => {
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder()
|
||||||
const data = encoder.encode(plain);
|
const data = encoder.encode(plain)
|
||||||
return window.crypto.subtle.digest("SHA-256", data);
|
return window.crypto.subtle.digest('SHA-256', data)
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encodes the input string into Base64 format
|
* Encodes the input string into Base64 format
|
||||||
@@ -113,9 +110,9 @@ const base64urlencode = (
|
|||||||
// Then convert the base64 encoded to base64url encoded
|
// Then convert the base64 encoded to base64url encoded
|
||||||
// (replace + with -, replace / with _, trim trailing =)
|
// (replace + with -, replace / with _, trim trailing =)
|
||||||
btoa(String.fromCharCode.apply(null, new Uint8Array(str)))
|
btoa(String.fromCharCode.apply(null, new Uint8Array(str)))
|
||||||
.replace(/\+/g, "-")
|
.replace(/\+/g, '-')
|
||||||
.replace(/\//g, "_")
|
.replace(/\//g, '_')
|
||||||
.replace(/=+$/, "");
|
.replace(/=+$/, '')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the base64-urlencoded sha256 hash for the PKCE challenge
|
* Return the base64-urlencoded sha256 hash for the PKCE challenge
|
||||||
@@ -125,9 +122,9 @@ const base64urlencode = (
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const pkceChallengeFromVerifier = async v => {
|
const pkceChallengeFromVerifier = async v => {
|
||||||
const hashed = await sha256(v);
|
const hashed = await sha256(v)
|
||||||
return base64urlencode(hashed);
|
return base64urlencode(hashed)
|
||||||
};
|
}
|
||||||
|
|
||||||
// OAUTH REQUEST
|
// OAUTH REQUEST
|
||||||
|
|
||||||
@@ -144,32 +141,29 @@ const tokenRequest = async ({
|
|||||||
authUrl,
|
authUrl,
|
||||||
accessTokenUrl,
|
accessTokenUrl,
|
||||||
clientId,
|
clientId,
|
||||||
scope
|
scope,
|
||||||
}) => {
|
}) => {
|
||||||
// Check oauth configuration
|
// Check oauth configuration
|
||||||
if (oidcDiscoveryUrl !== "") {
|
if (oidcDiscoveryUrl !== '') {
|
||||||
const {
|
const { authorization_endpoint, token_endpoint } = await getTokenConfiguration(oidcDiscoveryUrl)
|
||||||
authorization_endpoint,
|
authUrl = authorization_endpoint
|
||||||
token_endpoint
|
accessTokenUrl = token_endpoint
|
||||||
} = await getTokenConfiguration(oidcDiscoveryUrl);
|
|
||||||
authUrl = authorization_endpoint;
|
|
||||||
accessTokenUrl = token_endpoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store oauth information
|
// Store oauth information
|
||||||
localStorage.setItem("token_endpoint", accessTokenUrl);
|
localStorage.setItem('token_endpoint', accessTokenUrl)
|
||||||
localStorage.setItem("client_id", clientId);
|
localStorage.setItem('client_id', clientId)
|
||||||
|
|
||||||
// Create and store a random state value
|
// Create and store a random state value
|
||||||
const state = generateRandomString();
|
const state = generateRandomString()
|
||||||
localStorage.setItem("pkce_state", state);
|
localStorage.setItem('pkce_state', state)
|
||||||
|
|
||||||
// Create and store a new PKCE code_verifier (the plaintext random secret)
|
// Create and store a new PKCE code_verifier (the plaintext random secret)
|
||||||
const code_verifier = generateRandomString();
|
const code_verifier = generateRandomString()
|
||||||
localStorage.setItem("pkce_code_verifier", code_verifier);
|
localStorage.setItem('pkce_code_verifier', code_verifier)
|
||||||
|
|
||||||
// Hash and base64-urlencode the secret to use as the challenge
|
// Hash and base64-urlencode the secret to use as the challenge
|
||||||
const code_challenge = await pkceChallengeFromVerifier(code_verifier);
|
const code_challenge = await pkceChallengeFromVerifier(code_verifier)
|
||||||
|
|
||||||
// Build the authorization URL
|
// Build the authorization URL
|
||||||
const buildUrl = () =>
|
const buildUrl = () =>
|
||||||
@@ -177,15 +171,13 @@ const tokenRequest = async ({
|
|||||||
clientId
|
clientId
|
||||||
)}&state=${encodeURIComponent(state)}&scope=${encodeURIComponent(
|
)}&state=${encodeURIComponent(state)}&scope=${encodeURIComponent(
|
||||||
scope
|
scope
|
||||||
)}&redirect_uri=${encodeURIComponent(
|
)}&redirect_uri=${encodeURIComponent(redirectUri)}&code_challenge=${encodeURIComponent(
|
||||||
redirectUri
|
|
||||||
)}&code_challenge=${encodeURIComponent(
|
|
||||||
code_challenge
|
code_challenge
|
||||||
)}&code_challenge_method=S256`;
|
)}&code_challenge_method=S256`
|
||||||
|
|
||||||
// Redirect to the authorization server
|
// Redirect to the authorization server
|
||||||
window.location = buildUrl();
|
window.location = buildUrl()
|
||||||
};
|
}
|
||||||
|
|
||||||
// OAUTH REDIRECT HANDLING
|
// OAUTH REDIRECT HANDLING
|
||||||
|
|
||||||
@@ -197,42 +189,39 @@ const tokenRequest = async ({
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const oauthRedirect = async () => {
|
const oauthRedirect = async () => {
|
||||||
let tokenResponse = "";
|
let tokenResponse = ''
|
||||||
let q = parseQueryString(window.location.search.substring(1));
|
let q = parseQueryString(window.location.search.substring(1))
|
||||||
// Check if the server returned an error string
|
// Check if the server returned an error string
|
||||||
if (q.error) {
|
if (q.error) {
|
||||||
alert(`Error returned from authorization server: ${q.error}`);
|
alert(`Error returned from authorization server: ${q.error}`)
|
||||||
}
|
}
|
||||||
// If the server returned an authorization code, attempt to exchange it for an access token
|
// If the server returned an authorization code, attempt to exchange it for an access token
|
||||||
if (q.code) {
|
if (q.code) {
|
||||||
// Verify state matches what we set at the beginning
|
// Verify state matches what we set at the beginning
|
||||||
if (localStorage.getItem("pkce_state") != q.state) {
|
if (localStorage.getItem('pkce_state') != q.state) {
|
||||||
alert("Invalid state");
|
alert('Invalid state')
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
// Exchange the authorization code for an access token
|
// Exchange the authorization code for an access token
|
||||||
tokenResponse = await sendPostRequest(
|
tokenResponse = await sendPostRequest(localStorage.getItem('token_endpoint'), {
|
||||||
localStorage.getItem("token_endpoint"),
|
grant_type: 'authorization_code',
|
||||||
{
|
|
||||||
grant_type: "authorization_code",
|
|
||||||
code: q.code,
|
code: q.code,
|
||||||
client_id: localStorage.getItem("client_id"),
|
client_id: localStorage.getItem('client_id'),
|
||||||
redirect_uri: redirectUri,
|
redirect_uri: redirectUri,
|
||||||
code_verifier: localStorage.getItem("pkce_code_verifier")
|
code_verifier: localStorage.getItem('pkce_code_verifier'),
|
||||||
}
|
})
|
||||||
);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(`${error.error}\n\n${error.error_description}`);
|
console.log(`${error.error}\n\n${error.error_description}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Clean these up since we don't need them anymore
|
// Clean these up since we don't need them anymore
|
||||||
localStorage.removeItem("pkce_state");
|
localStorage.removeItem('pkce_state')
|
||||||
localStorage.removeItem("pkce_code_verifier");
|
localStorage.removeItem('pkce_code_verifier')
|
||||||
localStorage.removeItem("token_endpoint");
|
localStorage.removeItem('token_endpoint')
|
||||||
localStorage.removeItem("client_id");
|
localStorage.removeItem('client_id')
|
||||||
return tokenResponse;
|
return tokenResponse
|
||||||
|
}
|
||||||
|
return tokenResponse
|
||||||
}
|
}
|
||||||
return tokenResponse;
|
|
||||||
};
|
|
||||||
|
|
||||||
export { tokenRequest, oauthRedirect };
|
export { tokenRequest, oauthRedirect }
|
||||||
|
|||||||
@@ -2,55 +2,50 @@ export default () => {
|
|||||||
//*** Determine whether or not the PWA has been installed. ***//
|
//*** Determine whether or not the PWA has been installed. ***//
|
||||||
|
|
||||||
// Step 1: Check local storage
|
// Step 1: Check local storage
|
||||||
let pwaInstalled = localStorage.getItem("pwaInstalled") === "yes";
|
let pwaInstalled = localStorage.getItem('pwaInstalled') === 'yes'
|
||||||
|
|
||||||
// Step 2: Check if the display-mode is standalone. (Only permitted for PWAs.)
|
// Step 2: Check if the display-mode is standalone. (Only permitted for PWAs.)
|
||||||
if (
|
if (!pwaInstalled && window.matchMedia('(display-mode: standalone)').matches) {
|
||||||
!pwaInstalled &&
|
localStorage.setItem('pwaInstalled', 'yes')
|
||||||
window.matchMedia("(display-mode: standalone)").matches
|
pwaInstalled = true
|
||||||
) {
|
|
||||||
localStorage.setItem("pwaInstalled", "yes");
|
|
||||||
pwaInstalled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 3: Check if the navigator is in standalone mode. (Again, only permitted for PWAs.)
|
// Step 3: Check if the navigator is in standalone mode. (Again, only permitted for PWAs.)
|
||||||
if (!pwaInstalled && window.navigator.standalone === true) {
|
if (!pwaInstalled && window.navigator.standalone === true) {
|
||||||
localStorage.setItem("pwaInstalled", "yes");
|
localStorage.setItem('pwaInstalled', 'yes')
|
||||||
pwaInstalled = true;
|
pwaInstalled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
//*** If the PWA has not been installed, show the install PWA prompt.. ***//
|
//*** If the PWA has not been installed, show the install PWA prompt.. ***//
|
||||||
let deferredPrompt = null;
|
let deferredPrompt = null
|
||||||
window.addEventListener("beforeinstallprompt", event => {
|
window.addEventListener('beforeinstallprompt', event => {
|
||||||
deferredPrompt = event;
|
deferredPrompt = event
|
||||||
|
|
||||||
// Show the install button if the prompt appeared.
|
// Show the install button if the prompt appeared.
|
||||||
if (!pwaInstalled) {
|
if (!pwaInstalled) {
|
||||||
document.querySelector("#installPWA").style.display = "inline-flex";
|
document.querySelector('#installPWA').style.display = 'inline-flex'
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
// When the app is installed, remove install prompts.
|
// When the app is installed, remove install prompts.
|
||||||
window.addEventListener("appinstalled", event => {
|
window.addEventListener('appinstalled', event => {
|
||||||
localStorage.setItem("pwaInstalled", "yes");
|
localStorage.setItem('pwaInstalled', 'yes')
|
||||||
pwaInstalled = true;
|
pwaInstalled = true
|
||||||
document.getElementById("installPWA").style.display = "none";
|
document.getElementById('installPWA').style.display = 'none'
|
||||||
});
|
})
|
||||||
|
|
||||||
// When the app is uninstalled, add the prompts back
|
// When the app is uninstalled, add the prompts back
|
||||||
return async () => {
|
return async () => {
|
||||||
if (deferredPrompt) {
|
if (deferredPrompt) {
|
||||||
deferredPrompt.prompt();
|
deferredPrompt.prompt()
|
||||||
let outcome = await deferredPrompt.userChoice;
|
let outcome = await deferredPrompt.userChoice
|
||||||
|
|
||||||
if (outcome === "accepted") {
|
if (outcome === 'accepted') {
|
||||||
console.log("Postwoman was installed successfully.");
|
console.log('Postwoman was installed successfully.')
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log('Postwoman could not be installed. (Installation rejected by user.)')
|
||||||
"Postwoman could not be installed. (Installation rejected by user.)"
|
}
|
||||||
);
|
deferredPrompt = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
deferredPrompt = null;
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|||||||
56
build.js
56
build.js
@@ -1,63 +1,59 @@
|
|||||||
const axios = require("axios");
|
const axios = require('axios')
|
||||||
const fs = require("fs");
|
const fs = require('fs')
|
||||||
const { spawnSync } = require("child_process");
|
const { spawnSync } = require('child_process')
|
||||||
const runCommand = (command, args) =>
|
const runCommand = (command, args) =>
|
||||||
spawnSync(command, args)
|
spawnSync(command, args)
|
||||||
.stdout.toString()
|
.stdout.toString()
|
||||||
.replace(/\n/g, "");
|
.replace(/\n/g, '')
|
||||||
|
|
||||||
const FAIL_ON_ERROR = false;
|
const FAIL_ON_ERROR = false
|
||||||
const PW_BUILD_DATA_DIR = "./.postwoman";
|
const PW_BUILD_DATA_DIR = './.postwoman'
|
||||||
const IS_DEV_MODE = process.argv.includes("--dev");
|
const IS_DEV_MODE = process.argv.includes('--dev')
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(async () => {
|
;(async () => {
|
||||||
// Create the build data directory if it does not exist.
|
// Create the build data directory if it does not exist.
|
||||||
if (!fs.existsSync(PW_BUILD_DATA_DIR)) {
|
if (!fs.existsSync(PW_BUILD_DATA_DIR)) {
|
||||||
fs.mkdirSync(PW_BUILD_DATA_DIR);
|
fs.mkdirSync(PW_BUILD_DATA_DIR)
|
||||||
}
|
}
|
||||||
|
|
||||||
let version = {};
|
let version = {}
|
||||||
// Get the current version name as the tag from Git.
|
// Get the current version name as the tag from Git.
|
||||||
version.name =
|
version.name =
|
||||||
process.env.TRAVIS_TAG ||
|
process.env.TRAVIS_TAG || runCommand('git', ['tag --sort=committerdate | tail -1'])
|
||||||
runCommand("git", ["tag --sort=committerdate | tail -1"]);
|
|
||||||
|
|
||||||
// FALLBACK: If version.name was unset, let's grab it from GitHub.
|
// FALLBACK: If version.name was unset, let's grab it from GitHub.
|
||||||
if (!version.name) {
|
if (!version.name) {
|
||||||
version.name = (
|
version.name = (
|
||||||
await axios
|
await axios
|
||||||
.get("https://api.github.com/repos/liyasthomas/postwoman/releases")
|
.get('https://api.github.com/repos/liyasthomas/postwoman/releases')
|
||||||
// If we can't get it from GitHub, we'll resort to getting it from package.json
|
// If we can't get it from GitHub, we'll resort to getting it from package.json
|
||||||
.catch(ex => ({
|
.catch(ex => ({
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
tag_name: require("./package.json").version
|
tag_name: require('./package.json').version,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}))
|
}))
|
||||||
).data[0]["tag_name"];
|
).data[0]['tag_name']
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the current version hash as the short hash from Git.
|
// Get the current version hash as the short hash from Git.
|
||||||
version.hash = runCommand("git", ["rev-parse", "--short", "HEAD"]);
|
version.hash = runCommand('git', ['rev-parse', '--short', 'HEAD'])
|
||||||
// Get the 'variant' name as the branch, if it's not master.
|
// Get the 'variant' name as the branch, if it's not master.
|
||||||
version.variant =
|
version.variant =
|
||||||
process.env.TRAVIS_BRANCH ||
|
process.env.TRAVIS_BRANCH ||
|
||||||
runCommand("git", ["branch"])
|
runCommand('git', ['branch'])
|
||||||
.split("* ")[1]
|
.split('* ')[1]
|
||||||
.split(" ")[0] + (IS_DEV_MODE ? " - DEV MODE" : "");
|
.split(' ')[0] + (IS_DEV_MODE ? ' - DEV MODE' : '')
|
||||||
if (["", "master"].includes(version.variant)) {
|
if (['', 'master'].includes(version.variant)) {
|
||||||
delete version.variant;
|
delete version.variant
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write version data into a file
|
// Write version data into a file
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(`${PW_BUILD_DATA_DIR}/version.json`, JSON.stringify(version))
|
||||||
`${PW_BUILD_DATA_DIR}/version.json`,
|
})()
|
||||||
JSON.stringify(version)
|
|
||||||
);
|
|
||||||
})();
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.error(ex);
|
console.error(ex)
|
||||||
process.exit(FAIL_ON_ERROR ? 1 : 0);
|
process.exit(FAIL_ON_ERROR ? 1 : 0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,89 +3,87 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const DEFAULT_THEME = "twilight";
|
const DEFAULT_THEME = 'twilight'
|
||||||
|
|
||||||
import ace from "ace-builds";
|
import ace from 'ace-builds'
|
||||||
import "ace-builds/webpack-resolver";
|
import 'ace-builds/webpack-resolver'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: '',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false,
|
||||||
},
|
},
|
||||||
lang: {
|
lang: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "json"
|
default: 'json',
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editor: null,
|
editor: null,
|
||||||
cacheValue: ""
|
cacheValue: '',
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
value(value) {
|
value(value) {
|
||||||
if (value !== this.cacheValue) {
|
if (value !== this.cacheValue) {
|
||||||
this.editor.session.setValue(value, 1);
|
this.editor.session.setValue(value, 1)
|
||||||
this.cacheValue = value;
|
this.cacheValue = value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
theme() {
|
theme() {
|
||||||
this.editor.setTheme("ace/theme/" + this.defineTheme());
|
this.editor.setTheme('ace/theme/' + this.defineTheme())
|
||||||
},
|
},
|
||||||
lang(value) {
|
lang(value) {
|
||||||
this.editor.getSession().setMode("ace/mode/" + value);
|
this.editor.getSession().setMode('ace/mode/' + value)
|
||||||
},
|
},
|
||||||
options(value) {
|
options(value) {
|
||||||
this.editor.setOptions(value);
|
this.editor.setOptions(value)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
const editor = ace.edit(this.$refs.editor, {
|
const editor = ace.edit(this.$refs.editor, {
|
||||||
theme: `ace/theme/${this.defineTheme()}`,
|
theme: `ace/theme/${this.defineTheme()}`,
|
||||||
mode: `ace/mode/${this.lang}`,
|
mode: `ace/mode/${this.lang}`,
|
||||||
...this.options
|
...this.options,
|
||||||
});
|
})
|
||||||
|
|
||||||
if (this.value) editor.setValue(this.value, 1);
|
if (this.value) editor.setValue(this.value, 1)
|
||||||
|
|
||||||
this.editor = editor;
|
this.editor = editor
|
||||||
this.cacheValue = this.value;
|
this.cacheValue = this.value
|
||||||
|
|
||||||
editor.on("change", () => {
|
editor.on('change', () => {
|
||||||
const content = editor.getValue();
|
const content = editor.getValue()
|
||||||
this.$emit("input", content);
|
this.$emit('input', content)
|
||||||
this.cacheValue = content;
|
this.cacheValue = content
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
defineTheme() {
|
defineTheme() {
|
||||||
if (this.theme) {
|
if (this.theme) {
|
||||||
return this.theme;
|
return this.theme
|
||||||
}
|
|
||||||
return (
|
|
||||||
this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
return this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.editor.destroy();
|
this.editor.destroy()
|
||||||
this.editor.container.remove();
|
this.editor.container.remove()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: "Roboto Mono", monospace;
|
font-family: 'Roboto Mono', monospace;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
@@ -76,42 +76,42 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const KEY_TAB = 9;
|
const KEY_TAB = 9
|
||||||
const KEY_ESC = 27;
|
const KEY_ESC = 27
|
||||||
|
|
||||||
const KEY_ARROW_UP = 38;
|
const KEY_ARROW_UP = 38
|
||||||
const KEY_ARROW_DOWN = 40;
|
const KEY_ARROW_DOWN = 40
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
spellcheck: {
|
spellcheck: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
required: false
|
required: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
placeholder: {
|
placeholder: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: '',
|
||||||
required: false
|
required: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
source: {
|
source: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: '',
|
||||||
required: false
|
required: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
text() {
|
text() {
|
||||||
this.$emit("input", this.text);
|
this.$emit('input', this.text)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -120,70 +120,68 @@ export default {
|
|||||||
selectionStart: 0,
|
selectionStart: 0,
|
||||||
suggestionsOffsetLeft: 0,
|
suggestionsOffsetLeft: 0,
|
||||||
currentSuggestionIndex: -1,
|
currentSuggestionIndex: -1,
|
||||||
suggestionsVisible: false
|
suggestionsVisible: false,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
updateSuggestions(event) {
|
updateSuggestions(event) {
|
||||||
// Hide suggestions if ESC pressed.
|
// Hide suggestions if ESC pressed.
|
||||||
if (event.which && event.which === KEY_ESC) {
|
if (event.which && event.which === KEY_ESC) {
|
||||||
event.preventDefault();
|
event.preventDefault()
|
||||||
this.suggestionsVisible = false;
|
this.suggestionsVisible = false
|
||||||
this.currentSuggestionIndex = -1;
|
this.currentSuggestionIndex = -1
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// As suggestions is a reactive property, this implicitly
|
// As suggestions is a reactive property, this implicitly
|
||||||
// causes suggestions to update.
|
// causes suggestions to update.
|
||||||
this.selectionStart = this.$refs.acInput.selectionStart;
|
this.selectionStart = this.$refs.acInput.selectionStart
|
||||||
this.suggestionsOffsetLeft = 12 * this.selectionStart;
|
this.suggestionsOffsetLeft = 12 * this.selectionStart
|
||||||
this.suggestionsVisible = true;
|
this.suggestionsVisible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
forceSuggestion(text) {
|
forceSuggestion(text) {
|
||||||
let input = this.text.substring(0, this.selectionStart);
|
let input = this.text.substring(0, this.selectionStart)
|
||||||
this.text = input + text;
|
this.text = input + text
|
||||||
|
|
||||||
this.selectionStart = this.text.length;
|
this.selectionStart = this.text.length
|
||||||
this.suggestionsVisible = true;
|
this.suggestionsVisible = true
|
||||||
this.currentSuggestionIndex = -1;
|
this.currentSuggestionIndex = -1
|
||||||
},
|
},
|
||||||
|
|
||||||
handleKeystroke(event) {
|
handleKeystroke(event) {
|
||||||
switch (event.which) {
|
switch (event.which) {
|
||||||
case KEY_ARROW_UP:
|
case KEY_ARROW_UP:
|
||||||
event.preventDefault();
|
event.preventDefault()
|
||||||
this.currentSuggestionIndex =
|
this.currentSuggestionIndex =
|
||||||
this.currentSuggestionIndex - 1 >= 0
|
this.currentSuggestionIndex - 1 >= 0 ? this.currentSuggestionIndex - 1 : 0
|
||||||
? this.currentSuggestionIndex - 1
|
break
|
||||||
: 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case KEY_ARROW_DOWN:
|
case KEY_ARROW_DOWN:
|
||||||
event.preventDefault();
|
event.preventDefault()
|
||||||
this.currentSuggestionIndex =
|
this.currentSuggestionIndex =
|
||||||
this.currentSuggestionIndex < this.suggestions.length - 1
|
this.currentSuggestionIndex < this.suggestions.length - 1
|
||||||
? this.currentSuggestionIndex + 1
|
? this.currentSuggestionIndex + 1
|
||||||
: this.suggestions.length - 1;
|
: this.suggestions.length - 1
|
||||||
break;
|
break
|
||||||
|
|
||||||
case KEY_TAB:
|
case KEY_TAB:
|
||||||
event.preventDefault();
|
event.preventDefault()
|
||||||
let activeSuggestion = this.suggestions[
|
let activeSuggestion = this.suggestions[
|
||||||
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
||||||
];
|
]
|
||||||
if (activeSuggestion) {
|
if (activeSuggestion) {
|
||||||
let input = this.text.substring(0, this.selectionStart);
|
let input = this.text.substring(0, this.selectionStart)
|
||||||
this.text = input + activeSuggestion;
|
this.text = input + activeSuggestion
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
/**
|
/**
|
||||||
@@ -192,7 +190,7 @@ export default {
|
|||||||
* @returns {default.props.source|{type, required}}
|
* @returns {default.props.source|{type, required}}
|
||||||
*/
|
*/
|
||||||
suggestions() {
|
suggestions() {
|
||||||
let input = this.text.substring(0, this.selectionStart);
|
let input = this.text.substring(0, this.selectionStart)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
this.source
|
this.source
|
||||||
@@ -200,20 +198,20 @@ export default {
|
|||||||
return (
|
return (
|
||||||
entry.toLowerCase().startsWith(input.toLowerCase()) &&
|
entry.toLowerCase().startsWith(input.toLowerCase()) &&
|
||||||
input.toLowerCase() !== entry.toLowerCase()
|
input.toLowerCase() !== entry.toLowerCase()
|
||||||
);
|
)
|
||||||
})
|
})
|
||||||
// Cut off the part that's already been typed.
|
// Cut off the part that's already been typed.
|
||||||
.map(entry => entry.substring(this.selectionStart))
|
.map(entry => entry.substring(this.selectionStart))
|
||||||
// We only want the top 6 suggestions.
|
// We only want the top 6 suggestions.
|
||||||
.slice(0, 6)
|
.slice(0, 6)
|
||||||
);
|
)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updateSuggestions({
|
this.updateSuggestions({
|
||||||
target: this.$refs.acInput
|
target: this.$refs.acInput,
|
||||||
});
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("new_collection") }}</h3>
|
<h3 class="title">{{ $t('new_collection') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="addNewCollection">
|
<button class="icon primary" @click="addNewCollection">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,44 +43,42 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
show: Boolean
|
show: Boolean,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: undefined
|
name: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncCollections() {
|
syncCollections() {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
if (fb.currentSettings[0].value) {
|
if (fb.currentSettings[0].value) {
|
||||||
fb.writeCollections(
|
fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)))
|
||||||
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addNewCollection() {
|
addNewCollection() {
|
||||||
if (!this.$data.name) {
|
if (!this.$data.name) {
|
||||||
this.$toast.info($t("invalid_collection_name"));
|
this.$toast.info($t('invalid_collection_name'))
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.$store.commit("postwoman/addNewCollection", {
|
this.$store.commit('postwoman/addNewCollection', {
|
||||||
name: this.$data.name
|
name: this.$data.name,
|
||||||
});
|
})
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
this.syncCollections();
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("new_folder") }}</h3>
|
<h3 class="title">{{ $t('new_folder') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="addNewFolder">
|
<button class="icon primary" @click="addNewFolder">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,27 +47,27 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
collection: Object,
|
collection: Object,
|
||||||
collectionIndex: Number
|
collectionIndex: Number,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: undefined
|
name: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addNewFolder() {
|
addNewFolder() {
|
||||||
this.$store.commit("postwoman/addNewFolder", {
|
this.$store.commit('postwoman/addNewFolder', {
|
||||||
folder: { name: this.$data.name },
|
folder: { name: this.$data.name },
|
||||||
collectionIndex: this.$props.collectionIndex
|
collectionIndex: this.$props.collectionIndex,
|
||||||
});
|
})
|
||||||
this.hideModal();
|
this.hideModal()
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,23 +17,19 @@
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="$emit('add-folder')" v-close-popover>
|
<button class="icon" @click="$emit('add-folder')" v-close-popover>
|
||||||
<i class="material-icons">create_new_folder</i>
|
<i class="material-icons">create_new_folder</i>
|
||||||
<span>{{ $t("new_folder") }}</span>
|
<span>{{ $t('new_folder') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="$emit('edit-collection')" v-close-popover>
|
||||||
class="icon"
|
|
||||||
@click="$emit('edit-collection')"
|
|
||||||
v-close-popover
|
|
||||||
>
|
|
||||||
<i class="material-icons">create</i>
|
<i class="material-icons">create</i>
|
||||||
<span>{{ $t("edit") }}</span>
|
<span>{{ $t('edit') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="removeCollection" v-close-popover>
|
<button class="icon" @click="removeCollection" v-close-popover>
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
<span>{{ $t("delete") }}</span>
|
<span>{{ $t('delete') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -51,12 +47,8 @@
|
|||||||
@edit-request="$emit('edit-request', $event)"
|
@edit-request="$emit('edit-request', $event)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li v-if="collection.folders.length === 0 && collection.requests.length === 0">
|
||||||
v-if="
|
<label>{{ $t('collection_empty') }}</label>
|
||||||
collection.folders.length === 0 && collection.requests.length === 0
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<label>{{ $t("collection_empty") }}</label>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -71,7 +63,7 @@
|
|||||||
request,
|
request,
|
||||||
collectionIndex,
|
collectionIndex,
|
||||||
folderIndex: undefined,
|
folderIndex: undefined,
|
||||||
requestIndex: index
|
requestIndex: index,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
@@ -97,32 +89,32 @@ ul li {
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
folder: () => import("./folder"),
|
folder: () => import('./folder'),
|
||||||
request: () => import("./request")
|
request: () => import('./request'),
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
collectionIndex: Number,
|
collectionIndex: Number,
|
||||||
collection: Object
|
collection: Object,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showChildren: false,
|
showChildren: false,
|
||||||
selectedFolder: {}
|
selectedFolder: {},
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleShowChildren() {
|
toggleShowChildren() {
|
||||||
this.showChildren = !this.showChildren;
|
this.showChildren = !this.showChildren
|
||||||
},
|
},
|
||||||
removeCollection() {
|
removeCollection() {
|
||||||
if (!confirm("Are you sure you want to remove this Collection?")) return;
|
if (!confirm('Are you sure you want to remove this Collection?')) return
|
||||||
this.$store.commit("postwoman/removeCollection", {
|
this.$store.commit('postwoman/removeCollection', {
|
||||||
collectionIndex: this.collectionIndex
|
collectionIndex: this.collectionIndex,
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
editFolder(collectionIndex, folder, folderIndex) {
|
editFolder(collectionIndex, folder, folderIndex) {
|
||||||
this.$emit("edit-folder", { collectionIndex, folder, folderIndex });
|
this.$emit('edit-folder', { collectionIndex, folder, folderIndex })
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("edit_collection") }}</h3>
|
<h3 class="title">{{ $t('edit_collection') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="saveCollection">
|
<button class="icon primary" @click="saveCollection">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,35 +47,35 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
editingCollection: Object,
|
editingCollection: Object,
|
||||||
editingCollectionIndex: Number
|
editingCollectionIndex: Number,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: undefined
|
name: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveCollection() {
|
saveCollection() {
|
||||||
if (!this.$data.name) {
|
if (!this.$data.name) {
|
||||||
this.$toast.info($t("invalid_collection_name"));
|
this.$toast.info($t('invalid_collection_name'))
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
const collectionUpdated = {
|
const collectionUpdated = {
|
||||||
...this.$props.editingCollection,
|
...this.$props.editingCollection,
|
||||||
name: this.$data.name
|
name: this.$data.name,
|
||||||
};
|
}
|
||||||
this.$store.commit("postwoman/editCollection", {
|
this.$store.commit('postwoman/editCollection', {
|
||||||
collection: collectionUpdated,
|
collection: collectionUpdated,
|
||||||
collectionIndex: this.$props.editingCollectionIndex
|
collectionIndex: this.$props.editingCollectionIndex,
|
||||||
});
|
})
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("edit_folder") }}</h3>
|
<h3 class="title">{{ $t('edit_folder') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -17,12 +17,7 @@
|
|||||||
<div slot="body">
|
<div slot="body">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<input
|
<input type="text" v-model="name" :placeholder="folder.name" @keyup.enter="editFolder" />
|
||||||
type="text"
|
|
||||||
v-model="name"
|
|
||||||
:placeholder="folder.name"
|
|
||||||
@keyup.enter="editFolder"
|
|
||||||
/>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,10 +26,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="editFolder">
|
<button class="icon primary" @click="editFolder">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,28 +44,28 @@ export default {
|
|||||||
collection: Object,
|
collection: Object,
|
||||||
collectionIndex: Number,
|
collectionIndex: Number,
|
||||||
folder: Object,
|
folder: Object,
|
||||||
folderIndex: Number
|
folderIndex: Number,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: undefined
|
name: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editFolder() {
|
editFolder() {
|
||||||
this.$store.commit("postwoman/editFolder", {
|
this.$store.commit('postwoman/editFolder', {
|
||||||
collectionIndex: this.$props.collectionIndex,
|
collectionIndex: this.$props.collectionIndex,
|
||||||
folder: { ...this.$props.folder, name: this.$data.name },
|
folder: { ...this.$props.folder, name: this.$data.name },
|
||||||
folderIndex: this.$props.folderIndex
|
folderIndex: this.$props.folderIndex,
|
||||||
});
|
})
|
||||||
this.hideModal();
|
this.hideModal()
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("edit_request") }}</h3>
|
<h3 class="title">{{ $t('edit_request') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<div slot="body">
|
<div slot="body">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="selectLabel">{{ $t("label") }}</label>
|
<label for="selectLabel">{{ $t('label') }}</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="selectLabel"
|
id="selectLabel"
|
||||||
@@ -25,24 +25,14 @@
|
|||||||
@keyup.enter="saveRequest"
|
@keyup.enter="saveRequest"
|
||||||
:placeholder="request.name"
|
:placeholder="request.name"
|
||||||
/>
|
/>
|
||||||
<label for="selectCollection">{{ $t("collection") }}</label>
|
<label for="selectCollection">{{ $t('collection') }}</label>
|
||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
<select
|
<select type="text" id="selectCollection" v-model="requestUpdateData.collectionIndex">
|
||||||
type="text"
|
<option :key="undefined" :value="undefined" hidden disabled selected>{{
|
||||||
id="selectCollection"
|
$t('current_collection')
|
||||||
v-model="requestUpdateData.collectionIndex"
|
}}</option>
|
||||||
>
|
|
||||||
<option
|
<option
|
||||||
:key="undefined"
|
v-for="(collection, index) in $store.state.postwoman.collections"
|
||||||
:value="undefined"
|
|
||||||
hidden
|
|
||||||
disabled
|
|
||||||
selected
|
|
||||||
>{{ $t("current_collection") }}</option
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="(collection, index) in $store.state.postwoman
|
|
||||||
.collections"
|
|
||||||
:key="index"
|
:key="index"
|
||||||
:value="index"
|
:value="index"
|
||||||
>
|
>
|
||||||
@@ -50,19 +40,11 @@
|
|||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<label for="selectFolder">{{ $t("folder") }}</label>
|
<label for="selectFolder">{{ $t('folder') }}</label>
|
||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
<select
|
<select type="text" id="selectFolder" v-model="requestUpdateData.folderIndex">
|
||||||
type="text"
|
|
||||||
id="selectFolder"
|
|
||||||
v-model="requestUpdateData.folderIndex"
|
|
||||||
>
|
|
||||||
<option :key="undefined" :value="undefined">/</option>
|
<option :key="undefined" :value="undefined">/</option>
|
||||||
<option
|
<option v-for="(folder, index) in folders" :key="index" :value="index">
|
||||||
v-for="(folder, index) in folders"
|
|
||||||
:key="index"
|
|
||||||
:value="index"
|
|
||||||
>
|
|
||||||
{{ folder.name }}
|
{{ folder.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -75,10 +57,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="saveRequest">
|
<button class="icon primary" @click="saveRequest">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -93,42 +75,39 @@ export default {
|
|||||||
collectionIndex: Number,
|
collectionIndex: Number,
|
||||||
folderIndex: Number,
|
folderIndex: Number,
|
||||||
request: Object,
|
request: Object,
|
||||||
requestIndex: Number
|
requestIndex: Number,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
requestUpdateData: {
|
requestUpdateData: {
|
||||||
name: undefined,
|
name: undefined,
|
||||||
collectionIndex: undefined,
|
collectionIndex: undefined,
|
||||||
folderIndex: undefined
|
folderIndex: undefined,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"requestUpdateData.collectionIndex": function resetFolderIndex() {
|
'requestUpdateData.collectionIndex': function resetFolderIndex() {
|
||||||
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
||||||
// than `requestUpdateData.folderIndex` won't be reseted
|
// than `requestUpdateData.folderIndex` won't be reseted
|
||||||
this.$data.requestUpdateData.folderIndex = undefined;
|
this.$data.requestUpdateData.folderIndex = undefined
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
folders() {
|
folders() {
|
||||||
const userSelectedAnyCollection =
|
const userSelectedAnyCollection = this.$data.requestUpdateData.collectionIndex !== undefined
|
||||||
this.$data.requestUpdateData.collectionIndex !== undefined;
|
if (!userSelectedAnyCollection) return []
|
||||||
if (!userSelectedAnyCollection) return [];
|
|
||||||
|
|
||||||
return this.$store.state.postwoman.collections[
|
return this.$store.state.postwoman.collections[this.$data.requestUpdateData.collectionIndex]
|
||||||
this.$data.requestUpdateData.collectionIndex
|
.folders
|
||||||
].folders;
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveRequest() {
|
saveRequest() {
|
||||||
const userSelectedAnyCollection =
|
const userSelectedAnyCollection = this.$data.requestUpdateData.collectionIndex !== undefined
|
||||||
this.$data.requestUpdateData.collectionIndex !== undefined;
|
|
||||||
|
|
||||||
const requestUpdated = {
|
const requestUpdated = {
|
||||||
...this.$props.request,
|
...this.$props.request,
|
||||||
@@ -136,25 +115,25 @@ export default {
|
|||||||
collection: userSelectedAnyCollection
|
collection: userSelectedAnyCollection
|
||||||
? this.$data.requestUpdateData.collectionIndex
|
? this.$data.requestUpdateData.collectionIndex
|
||||||
: this.$props.collectionIndex,
|
: this.$props.collectionIndex,
|
||||||
folder: this.$data.requestUpdateData.folderIndex
|
folder: this.$data.requestUpdateData.folderIndex,
|
||||||
};
|
}
|
||||||
|
|
||||||
// pass data separately to don't depend on request's collection, folder fields
|
// pass data separately to don't depend on request's collection, folder fields
|
||||||
// probably, they should be deprecated because they don't describe request itself
|
// probably, they should be deprecated because they don't describe request itself
|
||||||
this.$store.commit("postwoman/editRequest", {
|
this.$store.commit('postwoman/editRequest', {
|
||||||
requestOldCollectionIndex: this.$props.collectionIndex,
|
requestOldCollectionIndex: this.$props.collectionIndex,
|
||||||
requestOldFolderIndex: this.$props.folderIndex,
|
requestOldFolderIndex: this.$props.folderIndex,
|
||||||
requestOldIndex: this.$props.requestIndex,
|
requestOldIndex: this.$props.requestIndex,
|
||||||
requestNew: requestUpdated,
|
requestNew: requestUpdated,
|
||||||
requestNewCollectionIndex: requestUpdated.collection,
|
requestNewCollectionIndex: requestUpdated.collection,
|
||||||
requestNewFolderIndex: requestUpdated.folder
|
requestNewFolderIndex: requestUpdated.folder,
|
||||||
});
|
})
|
||||||
|
|
||||||
this.hideModal();
|
this.hideModal()
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="editFolder" v-close-popover>
|
<button class="icon" @click="editFolder" v-close-popover>
|
||||||
<i class="material-icons">edit</i>
|
<i class="material-icons">edit</i>
|
||||||
<span>{{ $t("edit") }}</span>
|
<span>{{ $t('edit') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="removeFolder" v-close-popover>
|
<button class="icon" @click="removeFolder" v-close-popover>
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
<span>{{ $t("delete") }}</span>
|
<span>{{ $t('delete') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -43,13 +43,13 @@
|
|||||||
request,
|
request,
|
||||||
collectionIndex,
|
collectionIndex,
|
||||||
folderIndex,
|
folderIndex,
|
||||||
requestIndex: index
|
requestIndex: index,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="folder.requests.length === 0">
|
<li v-if="folder.requests.length === 0">
|
||||||
<label>{{ $t("folder_empty") }}</label>
|
<label>{{ $t('folder_empty') }}</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -74,33 +74,33 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
folder: Object,
|
folder: Object,
|
||||||
collectionIndex: Number,
|
collectionIndex: Number,
|
||||||
folderIndex: Number
|
folderIndex: Number,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
request: () => import("./request")
|
request: () => import('./request'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showChildren: false
|
showChildren: false,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleShowChildren() {
|
toggleShowChildren() {
|
||||||
this.showChildren = !this.showChildren;
|
this.showChildren = !this.showChildren
|
||||||
},
|
},
|
||||||
selectRequest(request) {
|
selectRequest(request) {
|
||||||
this.$store.commit("postwoman/selectRequest", { request });
|
this.$store.commit('postwoman/selectRequest', { request })
|
||||||
},
|
},
|
||||||
removeFolder() {
|
removeFolder() {
|
||||||
if (!confirm("Are you sure you want to remove this folder?")) return;
|
if (!confirm('Are you sure you want to remove this folder?')) return
|
||||||
this.$store.commit("postwoman/removeFolder", {
|
this.$store.commit('postwoman/removeFolder', {
|
||||||
collectionIndex: this.collectionIndex,
|
collectionIndex: this.collectionIndex,
|
||||||
folderIndex: this.folderIndex
|
folderIndex: this.folderIndex,
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
editFolder() {
|
editFolder() {
|
||||||
this.$emit("edit-folder");
|
this.$emit('edit-folder')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,18 +14,12 @@
|
|||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<span
|
<span
|
||||||
v-tooltip="{
|
v-tooltip="{
|
||||||
content: !fb.currentUser
|
content: !fb.currentUser ? $t('login_first') : $t('replace_current'),
|
||||||
? $t('login_first')
|
|
||||||
: $t('replace_current')
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<button
|
<button :disabled="!fb.currentUser" class="icon" @click="syncCollections">
|
||||||
:disabled="!fb.currentUser"
|
|
||||||
class="icon"
|
|
||||||
@click="syncCollections"
|
|
||||||
>
|
|
||||||
<i class="material-icons">folder_shared</i>
|
<i class="material-icons">folder_shared</i>
|
||||||
<span>{{ $t("import_from_sync") }}</span>
|
<span>{{ $t('import_from_sync') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
@@ -34,7 +28,7 @@
|
|||||||
v-tooltip="$t('replace_current')"
|
v-tooltip="$t('replace_current')"
|
||||||
>
|
>
|
||||||
<i class="material-icons">create_new_folder</i>
|
<i class="material-icons">create_new_folder</i>
|
||||||
<span>{{ $t("replace_json") }}</span>
|
<span>{{ $t('replace_json') }}</span>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
@change="replaceWithJSON"
|
@change="replaceWithJSON"
|
||||||
@@ -49,7 +43,7 @@
|
|||||||
v-tooltip="$t('preserve_current')"
|
v-tooltip="$t('preserve_current')"
|
||||||
>
|
>
|
||||||
<i class="material-icons">folder_special</i>
|
<i class="material-icons">folder_special</i>
|
||||||
<span>{{ $t("import_json") }}</span>
|
<span>{{ $t('import_json') }}</span>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
@change="importFromJSON"
|
@change="importFromJSON"
|
||||||
@@ -70,14 +64,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button class="icon primary" @click="exportJSON" v-tooltip="$t('download_file')">
|
||||||
class="icon primary"
|
{{ $t('export') }}
|
||||||
@click="exportJSON"
|
|
||||||
v-tooltip="$t('download_file')"
|
|
||||||
>
|
|
||||||
{{ $t("export") }}
|
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,239 +76,211 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fb
|
fb,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
show: Boolean
|
show: Boolean,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
collectionJson() {
|
collectionJson() {
|
||||||
return JSON.stringify(this.$store.state.postwoman.collections, null, 2);
|
return JSON.stringify(this.$store.state.postwoman.collections, null, 2)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
},
|
},
|
||||||
openDialogChooseFileToReplaceWith() {
|
openDialogChooseFileToReplaceWith() {
|
||||||
this.$refs.inputChooseFileToReplaceWith.click();
|
this.$refs.inputChooseFileToReplaceWith.click()
|
||||||
},
|
},
|
||||||
openDialogChooseFileToImportFrom() {
|
openDialogChooseFileToImportFrom() {
|
||||||
this.$refs.inputChooseFileToImportFrom.click();
|
this.$refs.inputChooseFileToImportFrom.click()
|
||||||
},
|
},
|
||||||
replaceWithJSON() {
|
replaceWithJSON() {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader()
|
||||||
reader.onload = event => {
|
reader.onload = event => {
|
||||||
let content = event.target.result;
|
let content = event.target.result
|
||||||
let collections = JSON.parse(content);
|
let collections = JSON.parse(content)
|
||||||
if (collections[0]) {
|
if (collections[0]) {
|
||||||
let [name, folders, requests] = Object.keys(collections[0]);
|
let [name, folders, requests] = Object.keys(collections[0])
|
||||||
if (
|
if (name === 'name' && folders === 'folders' && requests === 'requests') {
|
||||||
name === "name" &&
|
|
||||||
folders === "folders" &&
|
|
||||||
requests === "requests"
|
|
||||||
) {
|
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (collections.info && collections.info.schema.includes('v2.1.0')) {
|
||||||
collections.info &&
|
collections = this.parsePostmanCollection(collections)
|
||||||
collections.info.schema.includes("v2.1.0")
|
|
||||||
) {
|
|
||||||
collections = this.parsePostmanCollection(collections);
|
|
||||||
} else {
|
} else {
|
||||||
return this.failedImport();
|
return this.failedImport()
|
||||||
}
|
}
|
||||||
this.$store.commit("postwoman/importCollections", collections);
|
this.$store.commit('postwoman/importCollections', collections)
|
||||||
this.fileImported();
|
this.fileImported()
|
||||||
};
|
}
|
||||||
reader.readAsText(this.$refs.inputChooseFileToReplaceWith.files[0]);
|
reader.readAsText(this.$refs.inputChooseFileToReplaceWith.files[0])
|
||||||
},
|
},
|
||||||
importFromJSON() {
|
importFromJSON() {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader()
|
||||||
reader.onload = event => {
|
reader.onload = event => {
|
||||||
let content = event.target.result;
|
let content = event.target.result
|
||||||
let collections = JSON.parse(content);
|
let collections = JSON.parse(content)
|
||||||
if (collections[0]) {
|
if (collections[0]) {
|
||||||
let [name, folders, requests] = Object.keys(collections[0]);
|
let [name, folders, requests] = Object.keys(collections[0])
|
||||||
if (
|
if (name === 'name' && folders === 'folders' && requests === 'requests') {
|
||||||
name === "name" &&
|
|
||||||
folders === "folders" &&
|
|
||||||
requests === "requests"
|
|
||||||
) {
|
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (collections.info && collections.info.schema.includes('v2.1.0')) {
|
||||||
collections.info &&
|
collections = this.parsePostmanCollection(collections)
|
||||||
collections.info.schema.includes("v2.1.0")
|
|
||||||
) {
|
|
||||||
collections = this.parsePostmanCollection(collections);
|
|
||||||
} else {
|
} else {
|
||||||
return this.failedImport();
|
return this.failedImport()
|
||||||
}
|
}
|
||||||
this.$store.commit("postwoman/importCollections", collections);
|
this.$store.commit('postwoman/importCollections', collections)
|
||||||
this.fileImported();
|
this.fileImported()
|
||||||
};
|
}
|
||||||
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0]);
|
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0])
|
||||||
},
|
},
|
||||||
exportJSON() {
|
exportJSON() {
|
||||||
let text = this.collectionJson;
|
let text = this.collectionJson
|
||||||
text = text.replace(/\n/g, "\r\n");
|
text = text.replace(/\n/g, '\r\n')
|
||||||
let blob = new Blob([text], {
|
let blob = new Blob([text], {
|
||||||
type: "text/json"
|
type: 'text/json',
|
||||||
});
|
})
|
||||||
let anchor = document.createElement("a");
|
let anchor = document.createElement('a')
|
||||||
anchor.download = "postwoman-collection.json";
|
anchor.download = 'postwoman-collection.json'
|
||||||
anchor.href = window.URL.createObjectURL(blob);
|
anchor.href = window.URL.createObjectURL(blob)
|
||||||
anchor.target = "_blank";
|
anchor.target = '_blank'
|
||||||
anchor.style.display = "none";
|
anchor.style.display = 'none'
|
||||||
document.body.appendChild(anchor);
|
document.body.appendChild(anchor)
|
||||||
anchor.click();
|
anchor.click()
|
||||||
document.body.removeChild(anchor);
|
document.body.removeChild(anchor)
|
||||||
this.$toast.success(this.$t("download_started"), {
|
this.$toast.success(this.$t('download_started'), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
syncCollections() {
|
syncCollections() {
|
||||||
this.$store.commit("postwoman/replaceCollections", fb.currentCollections);
|
this.$store.commit('postwoman/replaceCollections', fb.currentCollections)
|
||||||
this.fileImported();
|
this.fileImported()
|
||||||
},
|
},
|
||||||
fileImported() {
|
fileImported() {
|
||||||
this.$toast.info(this.$t("file_imported"), {
|
this.$toast.info(this.$t('file_imported'), {
|
||||||
icon: "folder_shared"
|
icon: 'folder_shared',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
failedImport() {
|
failedImport() {
|
||||||
this.$toast.error(this.$t("import_failed"), {
|
this.$toast.error(this.$t('import_failed'), {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
parsePostmanCollection(collection, folders = true) {
|
parsePostmanCollection(collection, folders = true) {
|
||||||
let postwomanCollection = folders
|
let postwomanCollection = folders
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
name: "",
|
name: '',
|
||||||
folders: [],
|
folders: [],
|
||||||
requests: []
|
requests: [],
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
: {
|
: {
|
||||||
name: "",
|
name: '',
|
||||||
requests: []
|
requests: [],
|
||||||
};
|
}
|
||||||
for (let collectionItem of collection.item) {
|
for (let collectionItem of collection.item) {
|
||||||
if (collectionItem.request) {
|
if (collectionItem.request) {
|
||||||
if (postwomanCollection[0]) {
|
if (postwomanCollection[0]) {
|
||||||
postwomanCollection[0].name = collection.info
|
postwomanCollection[0].name = collection.info ? collection.info.name : ''
|
||||||
? collection.info.name
|
postwomanCollection[0].requests.push(this.parsePostmanRequest(collectionItem))
|
||||||
: "";
|
|
||||||
postwomanCollection[0].requests.push(
|
|
||||||
this.parsePostmanRequest(collectionItem)
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
postwomanCollection.name = collection.name ? collection.name : "";
|
postwomanCollection.name = collection.name ? collection.name : ''
|
||||||
postwomanCollection.requests.push(
|
postwomanCollection.requests.push(this.parsePostmanRequest(collectionItem))
|
||||||
this.parsePostmanRequest(collectionItem)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else if (collectionItem.item) {
|
} else if (collectionItem.item) {
|
||||||
if (collectionItem.item[0]) {
|
if (collectionItem.item[0]) {
|
||||||
postwomanCollection[0].folders.push(
|
postwomanCollection[0].folders.push(this.parsePostmanCollection(collectionItem, false))
|
||||||
this.parsePostmanCollection(collectionItem, false)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return postwomanCollection;
|
return postwomanCollection
|
||||||
},
|
},
|
||||||
parsePostmanRequest(requestObject) {
|
parsePostmanRequest(requestObject) {
|
||||||
let pwRequest = {
|
let pwRequest = {
|
||||||
url: "",
|
url: '',
|
||||||
path: "",
|
path: '',
|
||||||
method: "",
|
method: '',
|
||||||
auth: "",
|
auth: '',
|
||||||
httpUser: "",
|
httpUser: '',
|
||||||
httpPassword: "",
|
httpPassword: '',
|
||||||
passwordFieldType: "password",
|
passwordFieldType: 'password',
|
||||||
bearerToken: "",
|
bearerToken: '',
|
||||||
headers: [],
|
headers: [],
|
||||||
params: [],
|
params: [],
|
||||||
bodyParams: [],
|
bodyParams: [],
|
||||||
rawParams: "",
|
rawParams: '',
|
||||||
rawInput: false,
|
rawInput: false,
|
||||||
contentType: "",
|
contentType: '',
|
||||||
requestType: "",
|
requestType: '',
|
||||||
name: ""
|
name: '',
|
||||||
};
|
}
|
||||||
|
|
||||||
pwRequest.name = requestObject.name;
|
pwRequest.name = requestObject.name
|
||||||
let requestObjectUrl = requestObject.request.url.raw.match(
|
let requestObjectUrl = requestObject.request.url.raw.match(
|
||||||
/^(.+:\/\/[^\/]+|{[^\/]+})(\/[^\?]+|).*$/
|
/^(.+:\/\/[^\/]+|{[^\/]+})(\/[^\?]+|).*$/
|
||||||
);
|
)
|
||||||
pwRequest.url = requestObjectUrl[1];
|
pwRequest.url = requestObjectUrl[1]
|
||||||
pwRequest.path = requestObjectUrl[2] ? requestObjectUrl[2] : "";
|
pwRequest.path = requestObjectUrl[2] ? requestObjectUrl[2] : ''
|
||||||
pwRequest.method = requestObject.request.method;
|
pwRequest.method = requestObject.request.method
|
||||||
let itemAuth = requestObject.request.auth
|
let itemAuth = requestObject.request.auth ? requestObject.request.auth : ''
|
||||||
? requestObject.request.auth
|
let authType = itemAuth ? itemAuth.type : ''
|
||||||
: "";
|
if (authType === 'basic') {
|
||||||
let authType = itemAuth ? itemAuth.type : "";
|
pwRequest.auth = 'Basic Auth'
|
||||||
if (authType === "basic") {
|
|
||||||
pwRequest.auth = "Basic Auth";
|
|
||||||
pwRequest.httpUser =
|
pwRequest.httpUser =
|
||||||
itemAuth.basic[0].key === "username"
|
itemAuth.basic[0].key === 'username' ? itemAuth.basic[0].value : itemAuth.basic[1].value
|
||||||
? itemAuth.basic[0].value
|
|
||||||
: itemAuth.basic[1].value;
|
|
||||||
pwRequest.httpPassword =
|
pwRequest.httpPassword =
|
||||||
itemAuth.basic[0].key === "password"
|
itemAuth.basic[0].key === 'password' ? itemAuth.basic[0].value : itemAuth.basic[1].value
|
||||||
? itemAuth.basic[0].value
|
} else if (authType === 'oauth2') {
|
||||||
: itemAuth.basic[1].value;
|
pwRequest.auth = 'OAuth 2.0'
|
||||||
} else if (authType === "oauth2") {
|
|
||||||
pwRequest.auth = "OAuth 2.0";
|
|
||||||
pwRequest.bearerToken =
|
pwRequest.bearerToken =
|
||||||
itemAuth.oauth2[0].key === "accessToken"
|
itemAuth.oauth2[0].key === 'accessToken'
|
||||||
? itemAuth.oauth2[0].value
|
? itemAuth.oauth2[0].value
|
||||||
: itemAuth.oauth2[1].value;
|
: itemAuth.oauth2[1].value
|
||||||
} else if (authType === "bearer") {
|
} else if (authType === 'bearer') {
|
||||||
pwRequest.auth = "Bearer Token";
|
pwRequest.auth = 'Bearer Token'
|
||||||
pwRequest.bearerToken = itemAuth.bearer[0].value;
|
pwRequest.bearerToken = itemAuth.bearer[0].value
|
||||||
}
|
}
|
||||||
let requestObjectHeaders = requestObject.request.header;
|
let requestObjectHeaders = requestObject.request.header
|
||||||
if (requestObjectHeaders) {
|
if (requestObjectHeaders) {
|
||||||
pwRequest.headers = requestObjectHeaders;
|
pwRequest.headers = requestObjectHeaders
|
||||||
for (let header of pwRequest.headers) {
|
for (let header of pwRequest.headers) {
|
||||||
delete header.name;
|
delete header.name
|
||||||
delete header.type;
|
delete header.type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let requestObjectParams = requestObject.request.url.query;
|
let requestObjectParams = requestObject.request.url.query
|
||||||
if (requestObjectParams) {
|
if (requestObjectParams) {
|
||||||
pwRequest.params = requestObjectParams;
|
pwRequest.params = requestObjectParams
|
||||||
for (let param of pwRequest.params) {
|
for (let param of pwRequest.params) {
|
||||||
delete param.disabled;
|
delete param.disabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (requestObject.request.body) {
|
if (requestObject.request.body) {
|
||||||
if (requestObject.request.body.mode === "urlencoded") {
|
if (requestObject.request.body.mode === 'urlencoded') {
|
||||||
let params = requestObject.request.body.urlencoded;
|
let params = requestObject.request.body.urlencoded
|
||||||
pwRequest.bodyParams = params ? params : [];
|
pwRequest.bodyParams = params ? params : []
|
||||||
for (let param of pwRequest.bodyParams) {
|
for (let param of pwRequest.bodyParams) {
|
||||||
delete param.type;
|
delete param.type
|
||||||
}
|
}
|
||||||
} else if (requestObject.request.body.mode === "raw") {
|
} else if (requestObject.request.body.mode === 'raw') {
|
||||||
pwRequest.rawInput = true;
|
pwRequest.rawInput = true
|
||||||
pwRequest.rawParams = requestObject.request.body.raw;
|
pwRequest.rawParams = requestObject.request.body.raw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pwRequest;
|
return pwRequest
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ TODO:
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="displayModalAdd(true)">
|
<button class="icon" @click="displayModalAdd(true)">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
<span>{{ $t("new") }}</span>
|
<span>{{ $t('new') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="displayModalImportExport(true)">
|
<button class="icon" @click="displayModalImportExport(true)">
|
||||||
{{ $t("import_export") }}
|
{{ $t('import_export') }}
|
||||||
</button>
|
</button>
|
||||||
<!-- <a
|
<!-- <a
|
||||||
href="https://github.com/liyasthomas/postwoman/wiki/Collections"
|
href="https://github.com/liyasthomas/postwoman/wiki/Collections"
|
||||||
@@ -89,7 +89,7 @@ TODO:
|
|||||||
<nuxt-link :to="localePath('doc')" :aria-label="$t('documentation')">
|
<nuxt-link :to="localePath('doc')" :aria-label="$t('documentation')">
|
||||||
<button class="icon">
|
<button class="icon">
|
||||||
<i class="material-icons">books</i>
|
<i class="material-icons">books</i>
|
||||||
<span>{{ $t("generate_docs") }}</span>
|
<span>{{ $t('generate_docs') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
@@ -107,20 +107,20 @@ ul {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import collection from "./collection";
|
import collection from './collection'
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
collection,
|
collection,
|
||||||
"pw-section": () => import("../section"),
|
'pw-section': () => import('../section'),
|
||||||
addCollection: () => import("./addCollection"),
|
addCollection: () => import('./addCollection'),
|
||||||
addFolder: () => import("./addFolder"),
|
addFolder: () => import('./addFolder'),
|
||||||
editCollection: () => import("./editCollection"),
|
editCollection: () => import('./editCollection'),
|
||||||
editFolder: () => import("./editFolder"),
|
editFolder: () => import('./editFolder'),
|
||||||
editRequest: () => import("./editRequest"),
|
editRequest: () => import('./editRequest'),
|
||||||
importExportCollections: () => import("./importExportCollections"),
|
importExportCollections: () => import('./importExportCollections'),
|
||||||
VirtualList: () => import("vue-virtual-scroll-list")
|
VirtualList: () => import('vue-virtual-scroll-list'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -135,100 +135,98 @@ export default {
|
|||||||
editingFolder: undefined,
|
editingFolder: undefined,
|
||||||
editingFolderIndex: undefined,
|
editingFolderIndex: undefined,
|
||||||
editingRequest: undefined,
|
editingRequest: undefined,
|
||||||
editingRequestIndex: undefined
|
editingRequestIndex: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
collections() {
|
collections() {
|
||||||
return this.$store.state.postwoman.collections;
|
return this.$store.state.postwoman.collections
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this._keyListener = function(e) {
|
this._keyListener = function(e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === 'Escape') {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
this.showModalAdd = this.showModalEdit = this.showModalImportExport = this.showModalAddFolder = this.showModalEditFolder = this.showModalEditRequest = false;
|
this.showModalAdd = this.showModalEdit = this.showModalImportExport = this.showModalAddFolder = this.showModalEditFolder = this.showModalEditRequest = false
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
document.addEventListener("keydown", this._keyListener.bind(this));
|
document.addEventListener('keydown', this._keyListener.bind(this))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
displayModalAdd(shouldDisplay) {
|
displayModalAdd(shouldDisplay) {
|
||||||
this.showModalAdd = shouldDisplay;
|
this.showModalAdd = shouldDisplay
|
||||||
},
|
},
|
||||||
displayModalEdit(shouldDisplay) {
|
displayModalEdit(shouldDisplay) {
|
||||||
this.showModalEdit = shouldDisplay;
|
this.showModalEdit = shouldDisplay
|
||||||
|
|
||||||
if (!shouldDisplay) this.resetSelectedData();
|
if (!shouldDisplay) this.resetSelectedData()
|
||||||
},
|
},
|
||||||
displayModalImportExport(shouldDisplay) {
|
displayModalImportExport(shouldDisplay) {
|
||||||
this.showModalImportExport = shouldDisplay;
|
this.showModalImportExport = shouldDisplay
|
||||||
},
|
},
|
||||||
displayModalAddFolder(shouldDisplay) {
|
displayModalAddFolder(shouldDisplay) {
|
||||||
this.showModalAddFolder = shouldDisplay;
|
this.showModalAddFolder = shouldDisplay
|
||||||
|
|
||||||
if (!shouldDisplay) this.resetSelectedData();
|
if (!shouldDisplay) this.resetSelectedData()
|
||||||
},
|
},
|
||||||
displayModalEditFolder(shouldDisplay) {
|
displayModalEditFolder(shouldDisplay) {
|
||||||
this.showModalEditFolder = shouldDisplay;
|
this.showModalEditFolder = shouldDisplay
|
||||||
|
|
||||||
if (!shouldDisplay) this.resetSelectedData();
|
if (!shouldDisplay) this.resetSelectedData()
|
||||||
},
|
},
|
||||||
displayModalEditRequest(shouldDisplay) {
|
displayModalEditRequest(shouldDisplay) {
|
||||||
this.showModalEditRequest = shouldDisplay;
|
this.showModalEditRequest = shouldDisplay
|
||||||
|
|
||||||
if (!shouldDisplay) this.resetSelectedData();
|
if (!shouldDisplay) this.resetSelectedData()
|
||||||
},
|
},
|
||||||
editCollection(collection, collectionIndex) {
|
editCollection(collection, collectionIndex) {
|
||||||
this.$data.editingCollection = collection;
|
this.$data.editingCollection = collection
|
||||||
this.$data.editingCollectionIndex = collectionIndex;
|
this.$data.editingCollectionIndex = collectionIndex
|
||||||
this.displayModalEdit(true);
|
this.displayModalEdit(true)
|
||||||
this.syncCollections();
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
addFolder(collection, collectionIndex) {
|
addFolder(collection, collectionIndex) {
|
||||||
this.$data.editingCollection = collection;
|
this.$data.editingCollection = collection
|
||||||
this.$data.editingCollectionIndex = collectionIndex;
|
this.$data.editingCollectionIndex = collectionIndex
|
||||||
this.displayModalAddFolder(true);
|
this.displayModalAddFolder(true)
|
||||||
this.syncCollections();
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
editFolder(payload) {
|
editFolder(payload) {
|
||||||
const { collectionIndex, folder, folderIndex } = payload;
|
const { collectionIndex, folder, folderIndex } = payload
|
||||||
this.$data.editingCollection = collection;
|
this.$data.editingCollection = collection
|
||||||
this.$data.editingCollectionIndex = collectionIndex;
|
this.$data.editingCollectionIndex = collectionIndex
|
||||||
this.$data.editingFolder = folder;
|
this.$data.editingFolder = folder
|
||||||
this.$data.editingFolderIndex = folderIndex;
|
this.$data.editingFolderIndex = folderIndex
|
||||||
this.displayModalEditFolder(true);
|
this.displayModalEditFolder(true)
|
||||||
this.syncCollections();
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
editRequest(payload) {
|
editRequest(payload) {
|
||||||
const { request, collectionIndex, folderIndex, requestIndex } = payload;
|
const { request, collectionIndex, folderIndex, requestIndex } = payload
|
||||||
this.$data.editingCollectionIndex = collectionIndex;
|
this.$data.editingCollectionIndex = collectionIndex
|
||||||
this.$data.editingFolderIndex = folderIndex;
|
this.$data.editingFolderIndex = folderIndex
|
||||||
this.$data.editingRequest = request;
|
this.$data.editingRequest = request
|
||||||
this.$data.editingRequestIndex = requestIndex;
|
this.$data.editingRequestIndex = requestIndex
|
||||||
this.displayModalEditRequest(true);
|
this.displayModalEditRequest(true)
|
||||||
this.syncCollections();
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
resetSelectedData() {
|
resetSelectedData() {
|
||||||
this.$data.editingCollection = undefined;
|
this.$data.editingCollection = undefined
|
||||||
this.$data.editingCollectionIndex = undefined;
|
this.$data.editingCollectionIndex = undefined
|
||||||
this.$data.editingFolder = undefined;
|
this.$data.editingFolder = undefined
|
||||||
this.$data.editingFolderIndex = undefined;
|
this.$data.editingFolderIndex = undefined
|
||||||
this.$data.editingRequest = undefined;
|
this.$data.editingRequest = undefined
|
||||||
this.$data.editingRequestIndex = undefined;
|
this.$data.editingRequestIndex = undefined
|
||||||
},
|
},
|
||||||
syncCollections() {
|
syncCollections() {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
if (fb.currentSettings[0].value) {
|
if (fb.currentSettings[0].value) {
|
||||||
fb.writeCollections(
|
fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)))
|
||||||
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
document.removeEventListener("keydown", this._keyListener);
|
document.removeEventListener('keydown', this._keyListener)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="selectRequest()" v-tooltip="$t('use_request')">
|
||||||
class="icon"
|
|
||||||
@click="selectRequest()"
|
|
||||||
v-tooltip="$t('use_request')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">insert_drive_file</i>
|
<i class="material-icons">insert_drive_file</i>
|
||||||
<span>{{ request.name }}</span>
|
<span>{{ request.name }}</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -18,13 +14,13 @@
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="$emit('edit-request')" v-close-popover>
|
<button class="icon" @click="$emit('edit-request')" v-close-popover>
|
||||||
<i class="material-icons">edit</i>
|
<i class="material-icons">edit</i>
|
||||||
<span>{{ $t("edit") }}</span>
|
<span>{{ $t('edit') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="removeRequest" v-close-popover>
|
<button class="icon" @click="removeRequest" v-close-popover>
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
<span>{{ $t("delete") }}</span>
|
<span>{{ $t('delete') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -51,20 +47,20 @@ export default {
|
|||||||
request: Object,
|
request: Object,
|
||||||
collectionIndex: Number,
|
collectionIndex: Number,
|
||||||
folderIndex: Number,
|
folderIndex: Number,
|
||||||
requestIndex: Number
|
requestIndex: Number,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectRequest() {
|
selectRequest() {
|
||||||
this.$store.commit("postwoman/selectRequest", { request: this.request });
|
this.$store.commit('postwoman/selectRequest', { request: this.request })
|
||||||
},
|
},
|
||||||
removeRequest() {
|
removeRequest() {
|
||||||
if (!confirm("Are you sure you want to remove this request?")) return;
|
if (!confirm('Are you sure you want to remove this request?')) return
|
||||||
this.$store.commit("postwoman/removeRequest", {
|
this.$store.commit('postwoman/removeRequest', {
|
||||||
collectionIndex: this.collectionIndex,
|
collectionIndex: this.collectionIndex,
|
||||||
folderIndex: this.folderIndex,
|
folderIndex: this.folderIndex,
|
||||||
requestIndex: this.requestIndex
|
requestIndex: this.requestIndex,
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("save_request_as") }}</h3>
|
<h3 class="title">{{ $t('save_request_as') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<div slot="body">
|
<div slot="body">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="selectLabel">{{ $t("label") }}</label>
|
<label for="selectLabel">{{ $t('label') }}</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="selectLabel"
|
id="selectLabel"
|
||||||
@@ -25,24 +25,14 @@
|
|||||||
:placeholder="defaultRequestName"
|
:placeholder="defaultRequestName"
|
||||||
@keyup.enter="saveRequestAs"
|
@keyup.enter="saveRequestAs"
|
||||||
/>
|
/>
|
||||||
<label for="selectCollection">{{ $t("collection") }}</label>
|
<label for="selectCollection">{{ $t('collection') }}</label>
|
||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
<select
|
<select type="text" id="selectCollection" v-model="requestData.collectionIndex">
|
||||||
type="text"
|
<option :key="undefined" :value="undefined" hidden disabled selected>{{
|
||||||
id="selectCollection"
|
$t('select_collection')
|
||||||
v-model="requestData.collectionIndex"
|
}}</option>
|
||||||
>
|
|
||||||
<option
|
<option
|
||||||
:key="undefined"
|
v-for="(collection, index) in $store.state.postwoman.collections"
|
||||||
:value="undefined"
|
|
||||||
hidden
|
|
||||||
disabled
|
|
||||||
selected
|
|
||||||
>{{ $t("select_collection") }}</option
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="(collection, index) in $store.state.postwoman
|
|
||||||
.collections"
|
|
||||||
:key="index"
|
:key="index"
|
||||||
:value="index"
|
:value="index"
|
||||||
>
|
>
|
||||||
@@ -50,36 +40,20 @@
|
|||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<label for="selectFolder">{{ $t("folder") }}</label>
|
<label for="selectFolder">{{ $t('folder') }}</label>
|
||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
<select
|
<select type="text" id="selectFolder" v-model="requestData.folderIndex">
|
||||||
type="text"
|
|
||||||
id="selectFolder"
|
|
||||||
v-model="requestData.folderIndex"
|
|
||||||
>
|
|
||||||
<option :key="undefined" :value="undefined">/</option>
|
<option :key="undefined" :value="undefined">/</option>
|
||||||
<option
|
<option v-for="(folder, index) in folders" :key="index" :value="index">
|
||||||
v-for="(folder, index) in folders"
|
|
||||||
:key="index"
|
|
||||||
:value="index"
|
|
||||||
>
|
|
||||||
{{ folder.name }}
|
{{ folder.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<label for="selectRequest">{{ $t("request") }}</label>
|
<label for="selectRequest">{{ $t('request') }}</label>
|
||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
<select
|
<select type="text" id="selectRequest" v-model="requestData.requestIndex">
|
||||||
type="text"
|
|
||||||
id="selectRequest"
|
|
||||||
v-model="requestData.requestIndex"
|
|
||||||
>
|
|
||||||
<option :key="undefined" :value="undefined">/</option>
|
<option :key="undefined" :value="undefined">/</option>
|
||||||
<option
|
<option v-for="(folder, index) in requests" :key="index" :value="index">
|
||||||
v-for="(folder, index) in requests"
|
|
||||||
:key="index"
|
|
||||||
:value="index"
|
|
||||||
>
|
|
||||||
{{ folder.name }}
|
{{ folder.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
@@ -92,10 +66,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="saveRequestAs">
|
<button class="icon primary" @click="saveRequestAs">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,123 +78,113 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
editingRequest: Object
|
editingRequest: Object,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
defaultRequestName: "My Request",
|
defaultRequestName: 'My Request',
|
||||||
requestData: {
|
requestData: {
|
||||||
name: undefined,
|
name: undefined,
|
||||||
collectionIndex: undefined,
|
collectionIndex: undefined,
|
||||||
folderIndex: undefined,
|
folderIndex: undefined,
|
||||||
requestIndex: undefined
|
requestIndex: undefined,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"requestData.collectionIndex": function resetFolderAndRequestIndex() {
|
'requestData.collectionIndex': function resetFolderAndRequestIndex() {
|
||||||
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
||||||
// than `requestUpdateData.folderIndex` won't be reseted
|
// than `requestUpdateData.folderIndex` won't be reseted
|
||||||
this.$data.requestData.folderIndex = undefined;
|
this.$data.requestData.folderIndex = undefined
|
||||||
this.$data.requestData.requestIndex = undefined;
|
this.$data.requestData.requestIndex = undefined
|
||||||
|
},
|
||||||
|
'requestData.folderIndex': function resetRequestIndex() {
|
||||||
|
this.$data.requestData.requestIndex = undefined
|
||||||
},
|
},
|
||||||
"requestData.folderIndex": function resetRequestIndex() {
|
|
||||||
this.$data.requestData.requestIndex = undefined;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
folders() {
|
folders() {
|
||||||
const userSelectedAnyCollection =
|
const userSelectedAnyCollection = this.$data.requestData.collectionIndex !== undefined
|
||||||
this.$data.requestData.collectionIndex !== undefined;
|
if (!userSelectedAnyCollection) return []
|
||||||
if (!userSelectedAnyCollection) return [];
|
|
||||||
|
|
||||||
const noCollectionAvailable =
|
const noCollectionAvailable =
|
||||||
this.$store.state.postwoman.collections[
|
this.$store.state.postwoman.collections[this.$data.requestData.collectionIndex] !==
|
||||||
this.$data.requestData.collectionIndex
|
undefined
|
||||||
] !== undefined;
|
if (!noCollectionAvailable) return []
|
||||||
if (!noCollectionAvailable) return [];
|
|
||||||
|
|
||||||
return this.$store.state.postwoman.collections[
|
return this.$store.state.postwoman.collections[this.$data.requestData.collectionIndex].folders
|
||||||
this.$data.requestData.collectionIndex
|
|
||||||
].folders;
|
|
||||||
},
|
},
|
||||||
requests() {
|
requests() {
|
||||||
const userSelectedAnyCollection =
|
const userSelectedAnyCollection = this.$data.requestData.collectionIndex !== undefined
|
||||||
this.$data.requestData.collectionIndex !== undefined;
|
if (!userSelectedAnyCollection) return []
|
||||||
if (!userSelectedAnyCollection) return [];
|
|
||||||
|
|
||||||
const userSelectedAnyFolder =
|
const userSelectedAnyFolder = this.$data.requestData.folderIndex !== undefined
|
||||||
this.$data.requestData.folderIndex !== undefined;
|
|
||||||
if (userSelectedAnyFolder) {
|
if (userSelectedAnyFolder) {
|
||||||
const collection = this.$store.state.postwoman.collections[
|
const collection = this.$store.state.postwoman.collections[
|
||||||
this.$data.requestData.collectionIndex
|
this.$data.requestData.collectionIndex
|
||||||
];
|
]
|
||||||
const folder = collection.folders[this.$data.requestData.folderIndex];
|
const folder = collection.folders[this.$data.requestData.folderIndex]
|
||||||
const requests = folder.requests;
|
const requests = folder.requests
|
||||||
return requests;
|
return requests
|
||||||
} else {
|
} else {
|
||||||
const collection = this.$store.state.postwoman.collections[
|
const collection = this.$store.state.postwoman.collections[
|
||||||
this.$data.requestData.collectionIndex
|
this.$data.requestData.collectionIndex
|
||||||
];
|
]
|
||||||
const noCollectionAvailable =
|
const noCollectionAvailable =
|
||||||
this.$store.state.postwoman.collections[
|
this.$store.state.postwoman.collections[this.$data.requestData.collectionIndex] !==
|
||||||
this.$data.requestData.collectionIndex
|
undefined
|
||||||
] !== undefined;
|
if (!noCollectionAvailable) return []
|
||||||
if (!noCollectionAvailable) return [];
|
|
||||||
|
|
||||||
const requests = collection.requests;
|
const requests = collection.requests
|
||||||
return requests;
|
return requests
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncCollections() {
|
syncCollections() {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
if (fb.currentSettings[0].value) {
|
if (fb.currentSettings[0].value) {
|
||||||
fb.writeCollections(
|
fb.writeCollections(JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)))
|
||||||
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveRequestAs() {
|
saveRequestAs() {
|
||||||
const userDidntSpecifyCollection =
|
const userDidntSpecifyCollection = this.$data.requestData.collectionIndex === undefined
|
||||||
this.$data.requestData.collectionIndex === undefined;
|
|
||||||
if (userDidntSpecifyCollection) {
|
if (userDidntSpecifyCollection) {
|
||||||
this.$toast.error(this.$t("select_collection"), {
|
this.$toast.error(this.$t('select_collection'), {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestUpdated = {
|
const requestUpdated = {
|
||||||
...this.$props.editingRequest,
|
...this.$props.editingRequest,
|
||||||
name: this.$data.requestData.name || this.$data.defaultRequestName,
|
name: this.$data.requestData.name || this.$data.defaultRequestName,
|
||||||
collection: this.$data.requestData.collectionIndex
|
collection: this.$data.requestData.collectionIndex,
|
||||||
};
|
}
|
||||||
|
|
||||||
this.$store.commit("postwoman/saveRequestAs", {
|
this.$store.commit('postwoman/saveRequestAs', {
|
||||||
request: requestUpdated,
|
request: requestUpdated,
|
||||||
collectionIndex: this.$data.requestData.collectionIndex,
|
collectionIndex: this.$data.requestData.collectionIndex,
|
||||||
folderIndex: this.$data.requestData.folderIndex,
|
folderIndex: this.$data.requestData.folderIndex,
|
||||||
requestIndex: this.$data.requestData.requestIndex
|
requestIndex: this.$data.requestData.requestIndex,
|
||||||
});
|
})
|
||||||
|
|
||||||
this.hideModal();
|
this.hideModal()
|
||||||
this.syncCollections();
|
this.syncCollections()
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
this.$emit("hide-model"); // for backward compatibility // TODO: use fixed event
|
this.$emit('hide-model') // for backward compatibility // TODO: use fixed event
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("new_environment") }}</h3>
|
<h3 class="title">{{ $t('new_environment') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="addNewEnvironment">
|
<button class="icon primary" @click="addNewEnvironment">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,52 +43,50 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
show: Boolean
|
show: Boolean,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: undefined
|
name: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncEnvironments() {
|
syncEnvironments() {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
if (fb.currentSettings[1].value) {
|
if (fb.currentSettings[1].value) {
|
||||||
fb.writeEnvironments(
|
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
|
||||||
JSON.parse(JSON.stringify(this.$store.state.postwoman.environments))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addNewEnvironment() {
|
addNewEnvironment() {
|
||||||
if (!this.$data.name) {
|
if (!this.$data.name) {
|
||||||
this.$toast.info(this.$t("invalid_environment_name"));
|
this.$toast.info(this.$t('invalid_environment_name'))
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
let newEnvironment = [
|
let newEnvironment = [
|
||||||
{
|
{
|
||||||
name: this.$data.name,
|
name: this.$data.name,
|
||||||
variables: []
|
variables: [],
|
||||||
}
|
},
|
||||||
];
|
]
|
||||||
this.$store.commit("postwoman/importAddEnvironments", {
|
this.$store.commit('postwoman/importAddEnvironments', {
|
||||||
environments: newEnvironment,
|
environments: newEnvironment,
|
||||||
confirmation: "Environment added"
|
confirmation: 'Environment added',
|
||||||
});
|
})
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
this.syncEnvironments();
|
this.syncEnvironments()
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$data.name = undefined;
|
this.$data.name = undefined
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("edit_environment") }}</h3>
|
<h3 class="title">{{ $t('edit_environment') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -28,13 +28,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="variableList">{{ $t("env_variable_list") }}</label>
|
<label for="variableList">{{ $t('env_variable_list') }}</label>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="clearContent($event)" v-tooltip.bottom="$t('clear')">
|
||||||
class="icon"
|
|
||||||
@click="clearContent($event)"
|
|
||||||
v-tooltip.bottom="$t('clear')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,10 +45,7 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul
|
<ul v-for="(variable, index) in this.editingEnvCopy.variables" :key="index">
|
||||||
v-for="(variable, index) in this.editingEnvCopy.variables"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<li>
|
<li>
|
||||||
<input
|
<input
|
||||||
:placeholder="$t('parameter_count', { count: index + 1 })"
|
:placeholder="$t('parameter_count', { count: index + 1 })"
|
||||||
@@ -61,7 +54,7 @@
|
|||||||
@change="
|
@change="
|
||||||
$store.commit('postwoman/setVariableKey', {
|
$store.commit('postwoman/setVariableKey', {
|
||||||
index,
|
index,
|
||||||
value: $event.target.value
|
value: $event.target.value,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
autofocus
|
autofocus
|
||||||
@@ -72,14 +65,12 @@
|
|||||||
:placeholder="$t('value_count', { count: index + 1 })"
|
:placeholder="$t('value_count', { count: index + 1 })"
|
||||||
:name="'value' + index"
|
:name="'value' + index"
|
||||||
:value="
|
:value="
|
||||||
typeof variable.value === 'string'
|
typeof variable.value === 'string' ? variable.value : JSON.stringify(variable.value)
|
||||||
? variable.value
|
|
||||||
: JSON.stringify(variable.value)
|
|
||||||
"
|
"
|
||||||
@change="
|
@change="
|
||||||
$store.commit('postwoman/setVariableValue', {
|
$store.commit('postwoman/setVariableValue', {
|
||||||
index,
|
index,
|
||||||
value: $event.target.value
|
value: $event.target.value,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
@@ -101,7 +92,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<button class="icon" @click="addEnvironmentVariable">
|
<button class="icon" @click="addEnvironmentVariable">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
<span>{{ $t("add_new") }}</span>
|
<span>{{ $t('add_new') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -111,10 +102,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="icon primary" @click="saveEnvironment">
|
<button class="icon primary" @click="saveEnvironment">
|
||||||
{{ $t("save") }}
|
{{ $t('save') }}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -123,99 +114,94 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import textareaAutoHeight from "../../directives/textareaAutoHeight";
|
import textareaAutoHeight from '../../directives/textareaAutoHeight'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
directives: {
|
directives: {
|
||||||
textareaAutoHeight
|
textareaAutoHeight,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
editingEnvironment: Object,
|
editingEnvironment: Object,
|
||||||
editingEnvironmentIndex: Number
|
editingEnvironmentIndex: Number,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: undefined
|
name: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
editingEnvironment: function(update) {
|
editingEnvironment: function(update) {
|
||||||
this.name = this.$props.editingEnvironment && this.$props.editingEnvironment.name
|
this.name =
|
||||||
|
this.$props.editingEnvironment && this.$props.editingEnvironment.name
|
||||||
? this.$props.editingEnvironment.name
|
? this.$props.editingEnvironment.name
|
||||||
: undefined
|
: undefined
|
||||||
this.$store.commit(
|
this.$store.commit('postwoman/setEditingEnvironment', this.$props.editingEnvironment)
|
||||||
"postwoman/setEditingEnvironment",
|
},
|
||||||
this.$props.editingEnvironment
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
editingEnvCopy() {
|
editingEnvCopy() {
|
||||||
return this.$store.state.postwoman.editingEnvironment;
|
return this.$store.state.postwoman.editingEnvironment
|
||||||
},
|
},
|
||||||
variableString() {
|
variableString() {
|
||||||
const result = this.editingEnvCopy.variables;
|
const result = this.editingEnvCopy.variables
|
||||||
return result === "" ? "" : JSON.stringify(result);
|
return result === '' ? '' : JSON.stringify(result)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clearContent(e) {
|
clearContent(e) {
|
||||||
this.$store.commit("postwoman/removeVariables", []);
|
this.$store.commit('postwoman/removeVariables', [])
|
||||||
e.target.innerHTML = this.doneButton;
|
e.target.innerHTML = this.doneButton
|
||||||
this.$toast.info(this.$t("cleared"), {
|
this.$toast.info(this.$t('cleared'), {
|
||||||
icon: "clear_all"
|
icon: 'clear_all',
|
||||||
});
|
})
|
||||||
setTimeout(
|
setTimeout(() => (e.target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
|
||||||
() => (e.target.innerHTML = '<i class="material-icons">clear_all</i>'),
|
|
||||||
1000
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
addEnvironmentVariable() {
|
addEnvironmentVariable() {
|
||||||
let value = { key: "", value: "" };
|
let value = { key: '', value: '' }
|
||||||
this.$store.commit("postwoman/addVariable", value);
|
this.$store.commit('postwoman/addVariable', value)
|
||||||
},
|
},
|
||||||
removeEnvironmentVariable(index) {
|
removeEnvironmentVariable(index) {
|
||||||
let variableIndex = index;
|
let variableIndex = index
|
||||||
const oldVariables = this.editingEnvCopy.variables.slice();
|
const oldVariables = this.editingEnvCopy.variables.slice()
|
||||||
const newVariables = this.editingEnvCopy.variables.filter(
|
const newVariables = this.editingEnvCopy.variables.filter(
|
||||||
(variable, index) => variableIndex !== index
|
(variable, index) => variableIndex !== index
|
||||||
);
|
)
|
||||||
|
|
||||||
this.$store.commit("postwoman/removeVariable", newVariables);
|
this.$store.commit('postwoman/removeVariable', newVariables)
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t('deleted'), {
|
||||||
icon: "delete",
|
icon: 'delete',
|
||||||
action: {
|
action: {
|
||||||
text: this.$t("undo"),
|
text: this.$t('undo'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
this.$store.commit("postwoman/removeVariable", oldVariables);
|
this.$store.commit('postwoman/removeVariable', oldVariables)
|
||||||
toastObject.remove();
|
toastObject.remove()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
saveEnvironment() {
|
saveEnvironment() {
|
||||||
if (!this.$data.name) {
|
if (!this.$data.name) {
|
||||||
this.$toast.info(this.$t("invalid_environment_name"));
|
this.$toast.info(this.$t('invalid_environment_name'))
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
const environmentUpdated = {
|
const environmentUpdated = {
|
||||||
...this.editingEnvCopy,
|
...this.editingEnvCopy,
|
||||||
name: this.$data.name
|
name: this.$data.name,
|
||||||
};
|
}
|
||||||
this.$store.commit("postwoman/saveEnvironment", {
|
this.$store.commit('postwoman/saveEnvironment', {
|
||||||
environment: environmentUpdated,
|
environment: environmentUpdated,
|
||||||
environmentIndex: this.$props.editingEnvironmentIndex
|
environmentIndex: this.$props.editingEnvironmentIndex,
|
||||||
});
|
})
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
},
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$data.name = undefined;
|
this.$data.name = undefined
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="$emit('select-environment')" v-tooltip="$t('use_environment')">
|
||||||
class="icon"
|
|
||||||
@click="$emit('select-environment')"
|
|
||||||
v-tooltip="$t('use_environment')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">insert_drive_file</i>
|
<i class="material-icons">insert_drive_file</i>
|
||||||
<span>{{ environment.name }}</span>
|
<span>{{ environment.name }}</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -16,19 +12,15 @@
|
|||||||
</button>
|
</button>
|
||||||
<template slot="popover">
|
<template slot="popover">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="$emit('edit-environment')" v-close-popover>
|
||||||
class="icon"
|
|
||||||
@click="$emit('edit-environment')"
|
|
||||||
v-close-popover
|
|
||||||
>
|
|
||||||
<i class="material-icons">create</i>
|
<i class="material-icons">create</i>
|
||||||
<span>{{ $t("edit") }}</span>
|
<span>{{ $t('edit') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="removeEnvironment" v-close-popover>
|
<button class="icon" @click="removeEnvironment" v-close-popover>
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
<span>{{ $t("delete") }}</span>
|
<span>{{ $t('delete') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -53,13 +45,13 @@ ul li {
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
environment: Object,
|
environment: Object,
|
||||||
environmentIndex: Number
|
environmentIndex: Number,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
removeEnvironment() {
|
removeEnvironment() {
|
||||||
if (!confirm("Are you sure you want to remove this environment?")) return;
|
if (!confirm('Are you sure you want to remove this environment?')) return
|
||||||
this.$store.commit("postwoman/removeEnvironment", this.environmentIndex);
|
this.$store.commit('postwoman/removeEnvironment', this.environmentIndex)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,18 +14,12 @@
|
|||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<span
|
<span
|
||||||
v-tooltip="{
|
v-tooltip="{
|
||||||
content: !fb.currentUser
|
content: !fb.currentUser ? $t('login_first') : $t('replace_current'),
|
||||||
? $t('login_first')
|
|
||||||
: $t('replace_current')
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<button
|
<button :disabled="!fb.currentUser" class="icon" @click="syncEnvironments">
|
||||||
:disabled="!fb.currentUser"
|
|
||||||
class="icon"
|
|
||||||
@click="syncEnvironments"
|
|
||||||
>
|
|
||||||
<i class="material-icons">folder_shared</i>
|
<i class="material-icons">folder_shared</i>
|
||||||
<span>{{ $t("import_from_sync") }}</span>
|
<span>{{ $t('import_from_sync') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
@@ -34,7 +28,7 @@
|
|||||||
v-tooltip="$t('replace_current')"
|
v-tooltip="$t('replace_current')"
|
||||||
>
|
>
|
||||||
<i class="material-icons">create_new_folder</i>
|
<i class="material-icons">create_new_folder</i>
|
||||||
<span>{{ $t("replace_json") }}</span>
|
<span>{{ $t('replace_json') }}</span>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
@change="replaceWithJSON"
|
@change="replaceWithJSON"
|
||||||
@@ -49,7 +43,7 @@
|
|||||||
v-tooltip="$t('preserve_current')"
|
v-tooltip="$t('preserve_current')"
|
||||||
>
|
>
|
||||||
<i class="material-icons">folder_special</i>
|
<i class="material-icons">folder_special</i>
|
||||||
<span>{{ $t("import_json") }}</span>
|
<span>{{ $t('import_json') }}</span>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
@change="importFromJSON"
|
@change="importFromJSON"
|
||||||
@@ -70,14 +64,10 @@
|
|||||||
<span></span>
|
<span></span>
|
||||||
<span>
|
<span>
|
||||||
<button class="icon" @click="hideModal">
|
<button class="icon" @click="hideModal">
|
||||||
{{ $t("cancel") }}
|
{{ $t('cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button class="icon primary" @click="exportJSON" v-tooltip="$t('download_file')">
|
||||||
class="icon primary"
|
{{ $t('export') }}
|
||||||
@click="exportJSON"
|
|
||||||
v-tooltip="$t('download_file')"
|
|
||||||
>
|
|
||||||
{{ $t("export") }}
|
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,88 +76,85 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fb
|
fb,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
show: Boolean
|
show: Boolean,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
modal: () => import("../../components/modal")
|
modal: () => import('../../components/modal'),
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
environmentJson() {
|
environmentJson() {
|
||||||
return JSON.stringify(this.$store.state.postwoman.environments, null, 2);
|
return JSON.stringify(this.$store.state.postwoman.environments, null, 2)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal");
|
this.$emit('hide-modal')
|
||||||
},
|
},
|
||||||
openDialogChooseFileToReplaceWith() {
|
openDialogChooseFileToReplaceWith() {
|
||||||
this.$refs.inputChooseFileToReplaceWith.click();
|
this.$refs.inputChooseFileToReplaceWith.click()
|
||||||
},
|
},
|
||||||
openDialogChooseFileToImportFrom() {
|
openDialogChooseFileToImportFrom() {
|
||||||
this.$refs.inputChooseFileToImportFrom.click();
|
this.$refs.inputChooseFileToImportFrom.click()
|
||||||
},
|
},
|
||||||
replaceWithJSON() {
|
replaceWithJSON() {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader()
|
||||||
reader.onload = event => {
|
reader.onload = event => {
|
||||||
let content = event.target.result;
|
let content = event.target.result
|
||||||
let environments = JSON.parse(content);
|
let environments = JSON.parse(content)
|
||||||
this.$store.commit("postwoman/replaceEnvironments", environments);
|
this.$store.commit('postwoman/replaceEnvironments', environments)
|
||||||
};
|
}
|
||||||
reader.readAsText(this.$refs.inputChooseFileToReplaceWith.files[0]);
|
reader.readAsText(this.$refs.inputChooseFileToReplaceWith.files[0])
|
||||||
this.fileImported();
|
this.fileImported()
|
||||||
},
|
},
|
||||||
importFromJSON() {
|
importFromJSON() {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader()
|
||||||
reader.onload = event => {
|
reader.onload = event => {
|
||||||
let content = event.target.result;
|
let content = event.target.result
|
||||||
let environments = JSON.parse(content);
|
let environments = JSON.parse(content)
|
||||||
let confirmation = this.$t("file_imported")
|
let confirmation = this.$t('file_imported')
|
||||||
this.$store.commit("postwoman/importAddEnvironments", {
|
this.$store.commit('postwoman/importAddEnvironments', {
|
||||||
environments,
|
environments,
|
||||||
confirmation
|
confirmation,
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0]);
|
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0])
|
||||||
},
|
},
|
||||||
exportJSON() {
|
exportJSON() {
|
||||||
let text = this.environmentJson;
|
let text = this.environmentJson
|
||||||
text = text.replace(/\n/g, "\r\n");
|
text = text.replace(/\n/g, '\r\n')
|
||||||
let blob = new Blob([text], {
|
let blob = new Blob([text], {
|
||||||
type: "text/json"
|
type: 'text/json',
|
||||||
});
|
})
|
||||||
let anchor = document.createElement("a");
|
let anchor = document.createElement('a')
|
||||||
anchor.download = "postwoman-environment.json";
|
anchor.download = 'postwoman-environment.json'
|
||||||
anchor.href = window.URL.createObjectURL(blob);
|
anchor.href = window.URL.createObjectURL(blob)
|
||||||
anchor.target = "_blank";
|
anchor.target = '_blank'
|
||||||
anchor.style.display = "none";
|
anchor.style.display = 'none'
|
||||||
document.body.appendChild(anchor);
|
document.body.appendChild(anchor)
|
||||||
anchor.click();
|
anchor.click()
|
||||||
document.body.removeChild(anchor);
|
document.body.removeChild(anchor)
|
||||||
this.$toast.success(this.$t("download_started"), {
|
this.$toast.success(this.$t('download_started'), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
syncEnvironments() {
|
syncEnvironments() {
|
||||||
this.$store.commit(
|
this.$store.commit('postwoman/replaceEnvironments', fb.currentEnvironments)
|
||||||
"postwoman/replaceEnvironments",
|
this.fileImported()
|
||||||
fb.currentEnvironments
|
|
||||||
);
|
|
||||||
this.fileImported();
|
|
||||||
},
|
},
|
||||||
fileImported() {
|
fileImported() {
|
||||||
this.$toast.info(this.$t("file_imported"), {
|
this.$toast.info(this.$t('file_imported'), {
|
||||||
icon: "folder_shared"
|
icon: 'folder_shared',
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<pw-section
|
<pw-section class="green" icon="history" :label="$t('environment')" ref="environment">
|
||||||
class="green"
|
|
||||||
icon="history"
|
|
||||||
:label="$t('environment')"
|
|
||||||
ref="environment"
|
|
||||||
>
|
|
||||||
<addEnvironment :show="showModalAdd" @hide-modal="displayModalAdd(false)" />
|
<addEnvironment :show="showModalAdd" @hide-modal="displayModalAdd(false)" />
|
||||||
<editEnvironment
|
<editEnvironment
|
||||||
:show="showModalEdit"
|
:show="showModalEdit"
|
||||||
@@ -20,12 +15,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="displayModalAdd(true)">
|
<button class="icon" @click="displayModalAdd(true)">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
<span>{{ $t("new") }}</span>
|
<span>{{ $t('new') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="displayModalImportExport(true)">
|
<button class="icon" @click="displayModalImportExport(true)">
|
||||||
{{ $t("import_export") }}
|
{{ $t('import_export') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,10 +34,7 @@
|
|||||||
:remain="Math.min(5, environments.length)"
|
:remain="Math.min(5, environments.length)"
|
||||||
>
|
>
|
||||||
<ul>
|
<ul>
|
||||||
<li
|
<li v-for="(environment, index) in environments" :key="environment.name">
|
||||||
v-for="(environment, index) in environments"
|
|
||||||
:key="environment.name"
|
|
||||||
>
|
|
||||||
<environment
|
<environment
|
||||||
:environmentIndex="index"
|
:environmentIndex="index"
|
||||||
:environment="environment"
|
:environment="environment"
|
||||||
@@ -70,20 +62,20 @@ ul {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import environment from "./environment";
|
import environment from './environment'
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
const updateOnLocalStorage = (propertyName, property) =>
|
const updateOnLocalStorage = (propertyName, property) =>
|
||||||
window.localStorage.setItem(propertyName, JSON.stringify(property));
|
window.localStorage.setItem(propertyName, JSON.stringify(property))
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
environment,
|
environment,
|
||||||
"pw-section": () => import("../section"),
|
'pw-section': () => import('../section'),
|
||||||
addEnvironment: () => import("./addEnvironment"),
|
addEnvironment: () => import('./addEnvironment'),
|
||||||
editEnvironment: () => import("./editEnvironment"),
|
editEnvironment: () => import('./editEnvironment'),
|
||||||
importExportEnvironment: () => import("./importExportEnvironment"),
|
importExportEnvironment: () => import('./importExportEnvironment'),
|
||||||
VirtualList: () => import("vue-virtual-scroll-list")
|
VirtualList: () => import('vue-virtual-scroll-list'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -91,57 +83,55 @@ export default {
|
|||||||
showModalAdd: false,
|
showModalAdd: false,
|
||||||
showModalEdit: false,
|
showModalEdit: false,
|
||||||
editingEnvironment: undefined,
|
editingEnvironment: undefined,
|
||||||
editingEnvironmentIndex: undefined
|
editingEnvironmentIndex: undefined,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
environments() {
|
environments() {
|
||||||
return this.$store.state.postwoman.environments;
|
return this.$store.state.postwoman.environments
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this._keyListener = function(e) {
|
this._keyListener = function(e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === 'Escape') {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
this.showModalImportExport = false;
|
this.showModalImportExport = false
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
document.addEventListener("keydown", this._keyListener.bind(this));
|
document.addEventListener('keydown', this._keyListener.bind(this))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
displayModalAdd(shouldDisplay) {
|
displayModalAdd(shouldDisplay) {
|
||||||
this.showModalAdd = shouldDisplay;
|
this.showModalAdd = shouldDisplay
|
||||||
},
|
},
|
||||||
displayModalEdit(shouldDisplay) {
|
displayModalEdit(shouldDisplay) {
|
||||||
this.showModalEdit = shouldDisplay;
|
this.showModalEdit = shouldDisplay
|
||||||
|
|
||||||
if (!shouldDisplay) this.resetSelectedData();
|
if (!shouldDisplay) this.resetSelectedData()
|
||||||
},
|
},
|
||||||
displayModalImportExport(shouldDisplay) {
|
displayModalImportExport(shouldDisplay) {
|
||||||
this.showModalImportExport = shouldDisplay;
|
this.showModalImportExport = shouldDisplay
|
||||||
},
|
},
|
||||||
editEnvironment(environment, environmentIndex) {
|
editEnvironment(environment, environmentIndex) {
|
||||||
this.$data.editingEnvironment = environment;
|
this.$data.editingEnvironment = environment
|
||||||
this.$data.editingEnvironmentIndex = environmentIndex;
|
this.$data.editingEnvironmentIndex = environmentIndex
|
||||||
this.displayModalEdit(true);
|
this.displayModalEdit(true)
|
||||||
this.syncEnvironments;
|
this.syncEnvironments
|
||||||
},
|
},
|
||||||
resetSelectedData() {
|
resetSelectedData() {
|
||||||
this.$data.editingEnvironment = undefined;
|
this.$data.editingEnvironment = undefined
|
||||||
this.$data.editingEnvironmentIndex = undefined;
|
this.$data.editingEnvironmentIndex = undefined
|
||||||
},
|
},
|
||||||
syncEnvironments() {
|
syncEnvironments() {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
if (fb.currentSettings[1].value) {
|
if (fb.currentSettings[1].value) {
|
||||||
fb.writeEnvironments(
|
fb.writeEnvironments(JSON.parse(JSON.stringify(this.$store.state.postwoman.environments)))
|
||||||
JSON.parse(JSON.stringify(this.$store.state.postwoman.environments))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
document.removeEventListener("keydown", this._keyListener);
|
document.removeEventListener('keydown', this._keyListener)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="show-on-large-screen">
|
<div class="show-on-large-screen">
|
||||||
<li class="info">
|
<li class="info">
|
||||||
<label>
|
<label>
|
||||||
{{ feed.label || $t("no_label") }}
|
{{ feed.label || $t('no_label') }}
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<button class="icon" @click="deleteFeed(feed)">
|
<button class="icon" @click="deleteFeed(feed)">
|
||||||
@@ -19,14 +19,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="show-on-large-screen">
|
<div class="show-on-large-screen">
|
||||||
<li class="info clamb-3">
|
<li class="info clamb-3">
|
||||||
<label>{{ feed.message || $t("empty") }}</label>
|
<label>{{ feed.message || $t('empty') }}</label>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</virtual-list>
|
</virtual-list>
|
||||||
<ul v-else>
|
<ul v-else>
|
||||||
<li>
|
<li>
|
||||||
<label class="info">{{ $t("empty") }}</label>
|
<label class="info">{{ $t('empty') }}</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
@@ -55,24 +55,24 @@ ol {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
VirtualList: () => import("vue-virtual-scroll-list")
|
VirtualList: () => import('vue-virtual-scroll-list'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fb
|
fb,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
deleteFeed(feed) {
|
deleteFeed(feed) {
|
||||||
fb.deleteFeed(feed.id);
|
fb.deleteFeed(feed.id)
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t('deleted'), {
|
||||||
icon: "delete"
|
icon: 'delete',
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -46,24 +46,24 @@ ol {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
message: null,
|
message: null,
|
||||||
label: null
|
label: null,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formPost() {
|
formPost() {
|
||||||
if (!(this.message || this.label)) {
|
if (!(this.message || this.label)) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
fb.writeFeeds(this.message, this.label);
|
fb.writeFeeds(this.message, this.label)
|
||||||
this.message = null;
|
this.message = null
|
||||||
this.label = null;
|
this.label = null
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -41,75 +41,75 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import firebase from "firebase/app";
|
import firebase from 'firebase/app'
|
||||||
import { fb } from "../../functions/fb";
|
import { fb } from '../../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fb
|
fb,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
signInWithGoogle() {
|
signInWithGoogle() {
|
||||||
const provider = new firebase.auth.GoogleAuthProvider();
|
const provider = new firebase.auth.GoogleAuthProvider()
|
||||||
firebase
|
firebase
|
||||||
.auth()
|
.auth()
|
||||||
.signInWithPopup(provider)
|
.signInWithPopup(provider)
|
||||||
.then(({ additionalUserInfo }) => {
|
.then(({ additionalUserInfo }) => {
|
||||||
if (additionalUserInfo.isNewUser) {
|
if (additionalUserInfo.isNewUser) {
|
||||||
this.$toast.info(`${this.$t("turn_on")} ${this.$t("sync")}`, {
|
this.$toast.info(`${this.$t('turn_on')} ${this.$t('sync')}`, {
|
||||||
icon: "sync",
|
icon: 'sync',
|
||||||
duration: null,
|
duration: null,
|
||||||
closeOnSwipe: false,
|
closeOnSwipe: false,
|
||||||
action: {
|
action: {
|
||||||
text: this.$t("yes"),
|
text: this.$t('yes'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
fb.writeSettings("syncHistory", false);
|
fb.writeSettings('syncHistory', false)
|
||||||
fb.writeSettings("syncCollections", true);
|
fb.writeSettings('syncCollections', true)
|
||||||
this.$router.push({ path: "/settings" });
|
this.$router.push({ path: '/settings' })
|
||||||
toastObject.remove();
|
toastObject.remove()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.show(err.message || err, {
|
this.$toast.show(err.message || err, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
signInWithGithub() {
|
signInWithGithub() {
|
||||||
const provider = new firebase.auth.GithubAuthProvider();
|
const provider = new firebase.auth.GithubAuthProvider()
|
||||||
firebase
|
firebase
|
||||||
.auth()
|
.auth()
|
||||||
.signInWithPopup(provider)
|
.signInWithPopup(provider)
|
||||||
.then(({ additionalUserInfo }) => {
|
.then(({ additionalUserInfo }) => {
|
||||||
if (additionalUserInfo.isNewUser) {
|
if (additionalUserInfo.isNewUser) {
|
||||||
this.$toast.info(`${this.$t("turn_on")} ${this.$t("sync")}`, {
|
this.$toast.info(`${this.$t('turn_on')} ${this.$t('sync')}`, {
|
||||||
icon: "sync",
|
icon: 'sync',
|
||||||
duration: null,
|
duration: null,
|
||||||
closeOnSwipe: false,
|
closeOnSwipe: false,
|
||||||
action: {
|
action: {
|
||||||
text: this.$t("yes"),
|
text: this.$t('yes'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
fb.writeSettings("syncHistory", false);
|
fb.writeSettings('syncHistory', false)
|
||||||
fb.writeSettings("syncCollections", true);
|
fb.writeSettings('syncCollections', true)
|
||||||
this.$router.push({ path: "/settings" });
|
this.$router.push({ path: '/settings' })
|
||||||
toastObject.remove();
|
toastObject.remove()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.show(err.message || err, {
|
this.$toast.show(err.message || err, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -11,28 +11,28 @@
|
|||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import typelink from "./typelink";
|
import typelink from './typelink'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
typelink: typelink
|
typelink: typelink,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
gqlArg: Object
|
gqlArg: Object,
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
argName() {
|
argName() {
|
||||||
return this.gqlArg.name;
|
return this.gqlArg.name
|
||||||
},
|
},
|
||||||
argType() {
|
argType() {
|
||||||
return this.gqlArg.type;
|
return this.gqlArg.type
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
jumpCallback(typeName) {}
|
jumpCallback(typeName) {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,10 +6,7 @@
|
|||||||
(
|
(
|
||||||
<span v-for="(field, index) in fieldArgs" :key="index">
|
<span v-for="(field, index) in fieldArgs" :key="index">
|
||||||
{{ field.name }}:
|
{{ field.name }}:
|
||||||
<typelink
|
<typelink :gqlType="field.type" :jumpTypeCallback="jumpTypeCallback" />
|
||||||
:gqlType="field.type"
|
|
||||||
:jumpTypeCallback="jumpTypeCallback"
|
|
||||||
/>
|
|
||||||
<span v-if="index !== fieldArgs.length - 1">
|
<span v-if="index !== fieldArgs.length - 1">
|
||||||
,
|
,
|
||||||
</span>
|
</span>
|
||||||
@@ -23,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field-deprecated" v-if="gqlField.isDeprecated">
|
<div class="field-deprecated" v-if="gqlField.isDeprecated">
|
||||||
{{ $t("deprecated") }}
|
{{ $t('deprecated') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -53,16 +50,16 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import typelink from "./typelink";
|
import typelink from './typelink'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
typelink: typelink
|
typelink: typelink,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
gqlField: Object,
|
gqlField: Object,
|
||||||
jumpTypeCallback: Function
|
jumpTypeCallback: Function,
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
@@ -71,23 +68,21 @@ export default {
|
|||||||
return (
|
return (
|
||||||
acc +
|
acc +
|
||||||
`${arg.name}: ${arg.type.toString()}${
|
`${arg.name}: ${arg.type.toString()}${
|
||||||
index !== this.gqlField.args.length - 1 ? ", " : ""
|
index !== this.gqlField.args.length - 1 ? ', ' : ''
|
||||||
}`
|
}`
|
||||||
);
|
)
|
||||||
}, "");
|
}, '')
|
||||||
const argsString = args.length > 0 ? `(${args})` : "";
|
const argsString = args.length > 0 ? `(${args})` : ''
|
||||||
return `${
|
return `${this.gqlField.name}${argsString}: ${this.gqlField.type.toString()}`
|
||||||
this.gqlField.name
|
|
||||||
}${argsString}: ${this.gqlField.type.toString()}`;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fieldName() {
|
fieldName() {
|
||||||
return this.gqlField.name;
|
return this.gqlField.name
|
||||||
},
|
},
|
||||||
|
|
||||||
fieldArgs() {
|
fieldArgs() {
|
||||||
return this.gqlField.args || [];
|
return this.gqlField.args || []
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,86 +3,79 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const DEFAULT_THEME = "twilight";
|
const DEFAULT_THEME = 'twilight'
|
||||||
|
|
||||||
import ace from "ace-builds";
|
import ace from 'ace-builds'
|
||||||
import * as gql from "graphql";
|
import * as gql from 'graphql'
|
||||||
import { getAutocompleteSuggestions } from "graphql-language-service-interface";
|
import { getAutocompleteSuggestions } from 'graphql-language-service-interface'
|
||||||
import "ace-builds/webpack-resolver";
|
import 'ace-builds/webpack-resolver'
|
||||||
import "ace-builds/src-noconflict/ext-language_tools";
|
import 'ace-builds/src-noconflict/ext-language_tools'
|
||||||
import debounce from "../../functions/utils/debounce";
|
import debounce from '../../functions/utils/debounce'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: '',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false,
|
||||||
},
|
},
|
||||||
lang: {
|
lang: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "json"
|
default: 'json',
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editor: null,
|
editor: null,
|
||||||
cacheValue: "",
|
cacheValue: '',
|
||||||
validationSchema: null
|
validationSchema: null,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
value(value) {
|
value(value) {
|
||||||
if (value !== this.cacheValue) {
|
if (value !== this.cacheValue) {
|
||||||
this.editor.session.setValue(value, 1);
|
this.editor.session.setValue(value, 1)
|
||||||
this.cacheValue = value;
|
this.cacheValue = value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
theme() {
|
theme() {
|
||||||
this.editor.setTheme(`ace/theme/${this.defineTheme()}`);
|
this.editor.setTheme(`ace/theme/${this.defineTheme()}`)
|
||||||
},
|
},
|
||||||
lang(value) {
|
lang(value) {
|
||||||
this.editor.getSession().setMode(`ace/mode/${value}`);
|
this.editor.getSession().setMode(`ace/mode/${value}`)
|
||||||
},
|
},
|
||||||
options(value) {
|
options(value) {
|
||||||
this.editor.setOptions(value);
|
this.editor.setOptions(value)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
let langTools = ace.require("ace/ext/language_tools");
|
let langTools = ace.require('ace/ext/language_tools')
|
||||||
|
|
||||||
const editor = ace.edit(this.$refs.editor, {
|
const editor = ace.edit(this.$refs.editor, {
|
||||||
theme: `ace/theme/${this.defineTheme()}`,
|
theme: `ace/theme/${this.defineTheme()}`,
|
||||||
mode: `ace/mode/${this.lang}`,
|
mode: `ace/mode/${this.lang}`,
|
||||||
enableBasicAutocompletion: true,
|
enableBasicAutocompletion: true,
|
||||||
enableLiveAutocompletion: true,
|
enableLiveAutocompletion: true,
|
||||||
...this.options
|
...this.options,
|
||||||
});
|
})
|
||||||
|
|
||||||
const completer = {
|
const completer = {
|
||||||
getCompletions: (
|
getCompletions: (editor, _session, { row, column }, _prefix, callback) => {
|
||||||
editor,
|
|
||||||
_session,
|
|
||||||
{ row, column },
|
|
||||||
_prefix,
|
|
||||||
callback
|
|
||||||
) => {
|
|
||||||
if (this.validationSchema) {
|
if (this.validationSchema) {
|
||||||
const completions = getAutocompleteSuggestions(
|
const completions = getAutocompleteSuggestions(this.validationSchema, editor.getValue(), {
|
||||||
this.validationSchema,
|
line: row,
|
||||||
editor.getValue(),
|
character: column,
|
||||||
{ line: row, character: column }
|
})
|
||||||
);
|
|
||||||
|
|
||||||
callback(
|
callback(
|
||||||
null,
|
null,
|
||||||
@@ -90,64 +83,60 @@ export default {
|
|||||||
name: label,
|
name: label,
|
||||||
value: label,
|
value: label,
|
||||||
score: 1.0,
|
score: 1.0,
|
||||||
meta: detail
|
meta: detail,
|
||||||
}))
|
}))
|
||||||
);
|
)
|
||||||
} else {
|
} else {
|
||||||
callback(null, []);
|
callback(null, [])
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
langTools.setCompleters([completer]);
|
langTools.setCompleters([completer])
|
||||||
|
|
||||||
if (this.value) editor.setValue(this.value, 1);
|
if (this.value) editor.setValue(this.value, 1)
|
||||||
|
|
||||||
this.editor = editor;
|
this.editor = editor
|
||||||
this.cacheValue = this.value;
|
this.cacheValue = this.value
|
||||||
|
|
||||||
editor.on("change", () => {
|
editor.on('change', () => {
|
||||||
const content = editor.getValue();
|
const content = editor.getValue()
|
||||||
this.$emit("input", content);
|
this.$emit('input', content)
|
||||||
this.parseContents(content);
|
this.parseContents(content)
|
||||||
this.cacheValue = content;
|
this.cacheValue = content
|
||||||
});
|
})
|
||||||
|
|
||||||
this.parseContents(this.value);
|
this.parseContents(this.value)
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
defineTheme() {
|
defineTheme() {
|
||||||
if (this.theme) {
|
if (this.theme) {
|
||||||
return this.theme;
|
return this.theme
|
||||||
} else {
|
} else {
|
||||||
return (
|
return this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
|
||||||
this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setValidationSchema(schema) {
|
setValidationSchema(schema) {
|
||||||
this.validationSchema = schema;
|
this.validationSchema = schema
|
||||||
this.parseContents(this.cacheValue);
|
this.parseContents(this.cacheValue)
|
||||||
},
|
},
|
||||||
|
|
||||||
parseContents: debounce(function(content) {
|
parseContents: debounce(function(content) {
|
||||||
if (content !== "") {
|
if (content !== '') {
|
||||||
try {
|
try {
|
||||||
const doc = gql.parse(content);
|
const doc = gql.parse(content)
|
||||||
|
|
||||||
if (this.validationSchema) {
|
if (this.validationSchema) {
|
||||||
this.editor.session.setAnnotations(
|
this.editor.session.setAnnotations(
|
||||||
gql
|
gql.validate(this.validationSchema, doc).map(({ locations, message }) => ({
|
||||||
.validate(this.validationSchema, doc)
|
|
||||||
.map(({ locations, message }) => ({
|
|
||||||
row: locations[0].line - 1,
|
row: locations[0].line - 1,
|
||||||
column: locations[0].column - 1,
|
column: locations[0].column - 1,
|
||||||
text: message,
|
text: message,
|
||||||
type: "error"
|
type: 'error',
|
||||||
}))
|
}))
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.editor.session.setAnnotations([
|
this.editor.session.setAnnotations([
|
||||||
@@ -155,19 +144,19 @@ export default {
|
|||||||
row: e.locations[0].line - 1,
|
row: e.locations[0].line - 1,
|
||||||
column: e.locations[0].column - 1,
|
column: e.locations[0].column - 1,
|
||||||
text: e.message,
|
text: e.message,
|
||||||
type: "error"
|
type: 'error',
|
||||||
}
|
},
|
||||||
]);
|
])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.editor.session.setAnnotations([]);
|
this.editor.session.setAnnotations([])
|
||||||
}
|
}
|
||||||
}, 2000)
|
}, 2000),
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.editor.destroy();
|
this.editor.destroy()
|
||||||
this.editor.container.remove();
|
this.editor.container.remove()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="gqlType.getFields">
|
<div v-if="gqlType.getFields">
|
||||||
<h5>{{ $t("fields") }}</h5>
|
<h5>{{ $t('fields') }}</h5>
|
||||||
<div v-for="field in gqlType.getFields()" :key="field.name">
|
<div v-for="field in gqlType.getFields()" :key="field.name">
|
||||||
<gql-field :gqlField="field" :jumpTypeCallback="jumpTypeCallback" />
|
<gql-field :gqlField="field" :jumpTypeCallback="jumpTypeCallback" />
|
||||||
</div>
|
</div>
|
||||||
@@ -33,12 +33,12 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"gql-field": () => import("./field")
|
'gql-field': () => import('./field'),
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
gqlType: {},
|
gqlType: {},
|
||||||
jumpTypeCallback: Function
|
jumpTypeCallback: Function,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.typelink {
|
.typelink {
|
||||||
color: var(--ac-color);
|
color: var(--ac-color);
|
||||||
font-family: "Roboto Mono", monospace;
|
font-family: 'Roboto Mono', monospace;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -16,19 +16,19 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
gqlType: null,
|
gqlType: null,
|
||||||
// (typeName: string) => void
|
// (typeName: string) => void
|
||||||
jumpTypeCallback: Function
|
jumpTypeCallback: Function,
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
typeString() {
|
typeString() {
|
||||||
return this.gqlType.toString();
|
return this.gqlType.toString()
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
jumpToType() {
|
jumpToType() {
|
||||||
this.jumpTypeCallback(this.gqlType);
|
this.jumpTypeCallback(this.gqlType)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -28,11 +28,11 @@
|
|||||||
:class="{ stared: entry.star }"
|
:class="{ stared: entry.star }"
|
||||||
@click="toggleStar(entry)"
|
@click="toggleStar(entry)"
|
||||||
v-tooltip="{
|
v-tooltip="{
|
||||||
content: !entry.star ? $t('add_star') : $t('remove_star')
|
content: !entry.star ? $t('add_star') : $t('remove_star'),
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<i class="material-icons">
|
<i class="material-icons">
|
||||||
{{ entry.star ? "star" : "star_border" }}
|
{{ entry.star ? 'star' : 'star_border' }}
|
||||||
</i>
|
</i>
|
||||||
</button>
|
</button>
|
||||||
<li>
|
<li>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
v-close-popover
|
v-close-popover
|
||||||
>
|
>
|
||||||
<i class="material-icons">restore</i>
|
<i class="material-icons">restore</i>
|
||||||
<span>{{ $t("restore") }}</span>
|
<span>{{ $t('restore') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
v-close-popover
|
v-close-popover
|
||||||
>
|
>
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
<span>{{ $t("delete") }}</span>
|
<span>{{ $t('delete') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -162,15 +162,13 @@
|
|||||||
</transition>
|
</transition>
|
||||||
</ul>
|
</ul>
|
||||||
</virtual-list>
|
</virtual-list>
|
||||||
<ul
|
<ul :class="{ hidden: filteredHistory.length != 0 || history.length === 0 }">
|
||||||
:class="{ hidden: filteredHistory.length != 0 || history.length === 0 }"
|
|
||||||
>
|
|
||||||
<li>
|
<li>
|
||||||
<label>{{ $t("nothing_found") }} "{{ filterText }}"</label>
|
<label>{{ $t('nothing_found') }} "{{ filterText }}"</label>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p v-if="history.length === 0" class="info">
|
<p v-if="history.length === 0" class="info">
|
||||||
{{ $t("history_empty") }}
|
{{ $t('history_empty') }}
|
||||||
</p>
|
</p>
|
||||||
<div v-if="history.length !== 0">
|
<div v-if="history.length !== 0">
|
||||||
<div class="flex-wrap" v-if="!isClearingHistory">
|
<div class="flex-wrap" v-if="!isClearingHistory">
|
||||||
@@ -181,7 +179,7 @@
|
|||||||
@click="enableHistoryClearing"
|
@click="enableHistoryClearing"
|
||||||
>
|
>
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
<span>{{ $t("clear_all") }}</span>
|
<span>{{ $t('clear_all') }}</span>
|
||||||
</button>
|
</button>
|
||||||
<v-popover>
|
<v-popover>
|
||||||
<button class="tooltip-target icon" v-tooltip="$t('sort')">
|
<button class="tooltip-target icon" v-tooltip="$t('sort')">
|
||||||
@@ -191,49 +189,45 @@
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="sort_by_label()" v-close-popover>
|
<button class="icon" @click="sort_by_label()" v-close-popover>
|
||||||
<i class="material-icons">sort_by_alpha</i>
|
<i class="material-icons">sort_by_alpha</i>
|
||||||
<span>{{ $t("label") }}</span>
|
<span>{{ $t('label') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="sort_by_time()" v-close-popover>
|
<button class="icon" @click="sort_by_time()" v-close-popover>
|
||||||
<i class="material-icons">access_time</i>
|
<i class="material-icons">access_time</i>
|
||||||
<span>{{ $t("time") }}</span>
|
<span>{{ $t('time') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="sort_by_status_code()" v-close-popover>
|
||||||
class="icon"
|
|
||||||
@click="sort_by_status_code()"
|
|
||||||
v-close-popover
|
|
||||||
>
|
|
||||||
<i class="material-icons">assistant</i>
|
<i class="material-icons">assistant</i>
|
||||||
<span>{{ $t("status") }}</span>
|
<span>{{ $t('status') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="sort_by_url()" v-close-popover>
|
<button class="icon" @click="sort_by_url()" v-close-popover>
|
||||||
<i class="material-icons">language</i>
|
<i class="material-icons">language</i>
|
||||||
<span>{{ $t("url") }}</span>
|
<span>{{ $t('url') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="sort_by_path()" v-close-popover>
|
<button class="icon" @click="sort_by_path()" v-close-popover>
|
||||||
<i class="material-icons">timeline</i>
|
<i class="material-icons">timeline</i>
|
||||||
<span>{{ $t("path") }}</span>
|
<span>{{ $t('path') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showMore">
|
<div v-if="showMore">
|
||||||
<button class="icon" @click="sort_by_duration()" v-close-popover>
|
<button class="icon" @click="sort_by_duration()" v-close-popover>
|
||||||
<i class="material-icons">timer</i>
|
<i class="material-icons">timer</i>
|
||||||
<span>{{ $t("duration") }}</span>
|
<span>{{ $t('duration') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="toggleCollapse()">
|
<button class="icon" @click="toggleCollapse()">
|
||||||
<i class="material-icons">
|
<i class="material-icons">
|
||||||
{{ !showMore ? "first_page" : "last_page" }}
|
{{ !showMore ? 'first_page' : 'last_page' }}
|
||||||
</i>
|
</i>
|
||||||
<span>{{ !showMore ? $t("show_more") : $t("hide_more") }}</span>
|
<span>{{ !showMore ? $t('show_more') : $t('hide_more') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -241,7 +235,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-wrap" v-else>
|
<div class="flex-wrap" v-else>
|
||||||
<label for="clear-history-button" class="info">
|
<label for="clear-history-button" class="info">
|
||||||
{{ $t("are_you_sure") }}
|
{{ $t('are_you_sure') }}
|
||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
@@ -301,7 +295,7 @@ ol {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
font-family: "Roboto Mono", monospace;
|
font-family: 'Roboto Mono', monospace;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
padding: 2px 6px;
|
padding: 2px 6px;
|
||||||
@@ -326,24 +320,24 @@ ol {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { findStatusGroup } from "../pages/index";
|
import { findStatusGroup } from '../pages/index'
|
||||||
import { fb } from "../functions/fb";
|
import { fb } from '../functions/fb'
|
||||||
|
|
||||||
const updateOnLocalStorage = (propertyName, property) =>
|
const updateOnLocalStorage = (propertyName, property) =>
|
||||||
window.localStorage.setItem(propertyName, JSON.stringify(property));
|
window.localStorage.setItem(propertyName, JSON.stringify(property))
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"pw-section": () => import("./section"),
|
'pw-section': () => import('./section'),
|
||||||
VirtualList: () => import("vue-virtual-scroll-list")
|
VirtualList: () => import('vue-virtual-scroll-list'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
history:
|
history:
|
||||||
fb.currentUser !== null
|
fb.currentUser !== null
|
||||||
? fb.currentHistory
|
? fb.currentHistory
|
||||||
: JSON.parse(window.localStorage.getItem("history")) || [],
|
: JSON.parse(window.localStorage.getItem('history')) || [],
|
||||||
filterText: "",
|
filterText: '',
|
||||||
showFilter: false,
|
showFilter: false,
|
||||||
isClearingHistory: false,
|
isClearingHistory: false,
|
||||||
reverse_sort_label: false,
|
reverse_sort_label: false,
|
||||||
@@ -351,166 +345,144 @@ export default {
|
|||||||
reverse_sort_status_code: false,
|
reverse_sort_status_code: false,
|
||||||
reverse_sort_url: false,
|
reverse_sort_url: false,
|
||||||
reverse_sort_path: false,
|
reverse_sort_path: false,
|
||||||
showMore: false
|
showMore: false,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filteredHistory() {
|
filteredHistory() {
|
||||||
this.history =
|
this.history =
|
||||||
fb.currentUser !== null
|
fb.currentUser !== null
|
||||||
? fb.currentHistory
|
? fb.currentHistory
|
||||||
: JSON.parse(window.localStorage.getItem("history")) || [];
|
: JSON.parse(window.localStorage.getItem('history')) || []
|
||||||
return this.history.filter(entry => {
|
return this.history.filter(entry => {
|
||||||
const filterText = this.filterText.toLowerCase();
|
const filterText = this.filterText.toLowerCase()
|
||||||
return Object.keys(entry).some(key => {
|
return Object.keys(entry).some(key => {
|
||||||
let value = entry[key];
|
let value = entry[key]
|
||||||
value = typeof value !== "string" ? value.toString() : value;
|
value = typeof value !== 'string' ? value.toString() : value
|
||||||
return value.toLowerCase().includes(filterText);
|
return value.toLowerCase().includes(filterText)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clearHistory() {
|
clearHistory() {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
fb.clearHistory();
|
fb.clearHistory()
|
||||||
}
|
}
|
||||||
this.history = [];
|
this.history = []
|
||||||
this.filterText = "";
|
this.filterText = ''
|
||||||
this.disableHistoryClearing();
|
this.disableHistoryClearing()
|
||||||
updateOnLocalStorage("history", this.history);
|
updateOnLocalStorage('history', this.history)
|
||||||
this.$toast.error(this.$t("history_deleted"), {
|
this.$toast.error(this.$t('history_deleted'), {
|
||||||
icon: "delete"
|
icon: 'delete',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
useHistory(entry) {
|
useHistory(entry) {
|
||||||
this.$emit("useHistory", entry);
|
this.$emit('useHistory', entry)
|
||||||
},
|
},
|
||||||
findEntryStatus(entry) {
|
findEntryStatus(entry) {
|
||||||
const foundStatusGroup = findStatusGroup(entry.status);
|
const foundStatusGroup = findStatusGroup(entry.status)
|
||||||
return (
|
return (
|
||||||
foundStatusGroup || {
|
foundStatusGroup || {
|
||||||
className: ""
|
className: '',
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
},
|
},
|
||||||
deleteHistory(entry) {
|
deleteHistory(entry) {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
fb.deleteHistory(entry);
|
fb.deleteHistory(entry)
|
||||||
}
|
}
|
||||||
this.history.splice(this.history.indexOf(entry), 1);
|
this.history.splice(this.history.indexOf(entry), 1)
|
||||||
if (this.history.length === 0) {
|
if (this.history.length === 0) {
|
||||||
this.filterText = "";
|
this.filterText = ''
|
||||||
}
|
}
|
||||||
updateOnLocalStorage("history", this.history);
|
updateOnLocalStorage('history', this.history)
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t('deleted'), {
|
||||||
icon: "delete"
|
icon: 'delete',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
addEntry(entry) {
|
addEntry(entry) {
|
||||||
this.history.push(entry);
|
this.history.push(entry)
|
||||||
updateOnLocalStorage("history", this.history);
|
updateOnLocalStorage('history', this.history)
|
||||||
},
|
},
|
||||||
enableHistoryClearing() {
|
enableHistoryClearing() {
|
||||||
if (!this.history || !this.history.length) return;
|
if (!this.history || !this.history.length) return
|
||||||
this.isClearingHistory = true;
|
this.isClearingHistory = true
|
||||||
},
|
},
|
||||||
disableHistoryClearing() {
|
disableHistoryClearing() {
|
||||||
this.isClearingHistory = false;
|
this.isClearingHistory = false
|
||||||
},
|
},
|
||||||
sort_by_time() {
|
sort_by_time() {
|
||||||
let byDate = this.history.slice(0);
|
let byDate = this.history.slice(0)
|
||||||
byDate.sort((a, b) => {
|
byDate.sort((a, b) => {
|
||||||
let date_a = a.date.split("/");
|
let date_a = a.date.split('/')
|
||||||
let date_b = b.date.split("/");
|
let date_b = b.date.split('/')
|
||||||
let time_a = a.time.split(":");
|
let time_a = a.time.split(':')
|
||||||
let time_b = b.time.split(":");
|
let time_b = b.time.split(':')
|
||||||
let final_a = new Date(
|
let final_a = new Date(date_a[2], date_a[1], date_a[0], time_a[0], time_a[1], time_a[2])
|
||||||
date_a[2],
|
let final_b = new Date(date_b[2], date_b[1], date_b[0], time_b[0], time_b[1], time_b[2])
|
||||||
date_a[1],
|
if (this.reverse_sort_time) return final_b - final_a
|
||||||
date_a[0],
|
else return final_a - final_b
|
||||||
time_a[0],
|
})
|
||||||
time_a[1],
|
this.history = byDate
|
||||||
time_a[2]
|
this.reverse_sort_time = !this.reverse_sort_time
|
||||||
);
|
|
||||||
let final_b = new Date(
|
|
||||||
date_b[2],
|
|
||||||
date_b[1],
|
|
||||||
date_b[0],
|
|
||||||
time_b[0],
|
|
||||||
time_b[1],
|
|
||||||
time_b[2]
|
|
||||||
);
|
|
||||||
if (this.reverse_sort_time) return final_b - final_a;
|
|
||||||
else return final_a - final_b;
|
|
||||||
});
|
|
||||||
this.history = byDate;
|
|
||||||
this.reverse_sort_time = !this.reverse_sort_time;
|
|
||||||
},
|
},
|
||||||
sort_by_status_code() {
|
sort_by_status_code() {
|
||||||
let byCode = this.history.slice(0);
|
let byCode = this.history.slice(0)
|
||||||
byCode.sort((a, b) => {
|
byCode.sort((a, b) => {
|
||||||
if (this.reverse_sort_status_code) return b.status - a.status;
|
if (this.reverse_sort_status_code) return b.status - a.status
|
||||||
else return a.status - b.status;
|
else return a.status - b.status
|
||||||
});
|
})
|
||||||
this.history = byCode;
|
this.history = byCode
|
||||||
this.reverse_sort_status_code = !this.reverse_sort_status_code;
|
this.reverse_sort_status_code = !this.reverse_sort_status_code
|
||||||
},
|
},
|
||||||
sort_by_url() {
|
sort_by_url() {
|
||||||
let byUrl = this.history.slice(0);
|
let byUrl = this.history.slice(0)
|
||||||
byUrl.sort((a, b) => {
|
byUrl.sort((a, b) => {
|
||||||
if (this.reverse_sort_url)
|
if (this.reverse_sort_url) return a.url === b.url ? 0 : +(a.url < b.url) || -1
|
||||||
return a.url === b.url ? 0 : +(a.url < b.url) || -1;
|
else return a.url === b.url ? 0 : +(a.url > b.url) || -1
|
||||||
else return a.url === b.url ? 0 : +(a.url > b.url) || -1;
|
})
|
||||||
});
|
this.history = byUrl
|
||||||
this.history = byUrl;
|
this.reverse_sort_url = !this.reverse_sort_url
|
||||||
this.reverse_sort_url = !this.reverse_sort_url;
|
|
||||||
},
|
},
|
||||||
sort_by_label() {
|
sort_by_label() {
|
||||||
let byLabel = this.history.slice(0);
|
let byLabel = this.history.slice(0)
|
||||||
byLabel.sort((a, b) => {
|
byLabel.sort((a, b) => {
|
||||||
if (this.reverse_sort_label)
|
if (this.reverse_sort_label) return a.label === b.label ? 0 : +(a.label < b.label) || -1
|
||||||
return a.label === b.label ? 0 : +(a.label < b.label) || -1;
|
else return a.label === b.label ? 0 : +(a.label > b.label) || -1
|
||||||
else return a.label === b.label ? 0 : +(a.label > b.label) || -1;
|
})
|
||||||
});
|
this.history = byLabel
|
||||||
this.history = byLabel;
|
this.reverse_sort_label = !this.reverse_sort_label
|
||||||
this.reverse_sort_label = !this.reverse_sort_label;
|
|
||||||
},
|
},
|
||||||
sort_by_path() {
|
sort_by_path() {
|
||||||
let byPath = this.history.slice(0);
|
let byPath = this.history.slice(0)
|
||||||
byPath.sort((a, b) => {
|
byPath.sort((a, b) => {
|
||||||
if (this.reverse_sort_path)
|
if (this.reverse_sort_path) return a.path === b.path ? 0 : +(a.path < b.path) || -1
|
||||||
return a.path === b.path ? 0 : +(a.path < b.path) || -1;
|
else return a.path === b.path ? 0 : +(a.path > b.path) || -1
|
||||||
else return a.path === b.path ? 0 : +(a.path > b.path) || -1;
|
})
|
||||||
});
|
this.history = byPath
|
||||||
this.history = byPath;
|
this.reverse_sort_path = !this.reverse_sort_path
|
||||||
this.reverse_sort_path = !this.reverse_sort_path;
|
|
||||||
},
|
},
|
||||||
sort_by_duration() {
|
sort_by_duration() {
|
||||||
let byDuration = this.history.slice(0);
|
let byDuration = this.history.slice(0)
|
||||||
byDuration.sort((a, b) => {
|
byDuration.sort((a, b) => {
|
||||||
if (this.reverse_sort_duration)
|
if (this.reverse_sort_duration)
|
||||||
return a.duration === b.duration
|
return a.duration === b.duration ? 0 : +(a.duration < b.duration) || -1
|
||||||
? 0
|
else return a.duration === b.duration ? 0 : +(a.duration > b.duration) || -1
|
||||||
: +(a.duration < b.duration) || -1;
|
})
|
||||||
else
|
this.history = byDuration
|
||||||
return a.duration === b.duration
|
this.reverse_sort_duration = !this.reverse_sort_duration
|
||||||
? 0
|
|
||||||
: +(a.duration > b.duration) || -1;
|
|
||||||
});
|
|
||||||
this.history = byDuration;
|
|
||||||
this.reverse_sort_duration = !this.reverse_sort_duration;
|
|
||||||
},
|
},
|
||||||
toggleCollapse() {
|
toggleCollapse() {
|
||||||
this.showMore = !this.showMore;
|
this.showMore = !this.showMore
|
||||||
},
|
},
|
||||||
toggleStar(entry) {
|
toggleStar(entry) {
|
||||||
if (fb.currentUser !== null) {
|
if (fb.currentUser !== null) {
|
||||||
fb.toggleStar(entry, !entry.star);
|
fb.toggleStar(entry, !entry.star)
|
||||||
}
|
}
|
||||||
entry.star = !entry.star;
|
entry.star = !entry.star
|
||||||
updateOnLocalStorage("history", this.history);
|
updateOnLocalStorage('history', this.history)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -49,8 +49,8 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
color: {
|
color: {
|
||||||
type: String
|
type: String,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<fieldset
|
<fieldset :id="label.toLowerCase()" :class="{ 'no-colored-frames': !frameColorsEnabled }">
|
||||||
:id="label.toLowerCase()"
|
|
||||||
:class="{ 'no-colored-frames': !frameColorsEnabled }"
|
|
||||||
>
|
|
||||||
<legend @click.prevent="collapse">
|
<legend @click.prevent="collapse">
|
||||||
<span>{{ label }}</span>
|
<span>{{ label }}</span>
|
||||||
<i class="material-icons">
|
<i class="material-icons">
|
||||||
{{ isCollapsed ? "expand_more" : "expand_less" }}
|
{{ isCollapsed ? 'expand_more' : 'expand_less' }}
|
||||||
</i>
|
</i>
|
||||||
</legend>
|
</legend>
|
||||||
<div class="collapsible" :class="{ hidden: collapsed }">
|
<div class="collapsible" :class="{ hidden: collapsed }">
|
||||||
@@ -25,32 +22,32 @@ fieldset.no-colored-frames legend {
|
|||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
frameColorsEnabled() {
|
frameColorsEnabled() {
|
||||||
return this.$store.state.postwoman.settings.FRAME_COLORS_ENABLED || false;
|
return this.$store.state.postwoman.settings.FRAME_COLORS_ENABLED || false
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isCollapsed: false
|
isCollapsed: false,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
label: {
|
label: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "Section"
|
default: 'Section',
|
||||||
},
|
},
|
||||||
collapsed: {
|
collapsed: {
|
||||||
type: Boolean
|
type: Boolean,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
collapse({ target }) {
|
collapse({ target }) {
|
||||||
const parent = target.parentNode.parentNode;
|
const parent = target.parentNode.parentNode
|
||||||
parent.querySelector(".collapsible").classList.toggle("hidden");
|
parent.querySelector('.collapsible').classList.toggle('hidden')
|
||||||
this.isCollapsed = !this.isCollapsed;
|
this.isCollapsed = !this.isCollapsed
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -45,15 +45,15 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String
|
type: String,
|
||||||
},
|
},
|
||||||
active: {
|
active: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -84,15 +84,15 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
on: {
|
on: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toggle() {
|
toggle() {
|
||||||
const containsOnClass = this.$refs.toggle.classList.toggle("on");
|
const containsOnClass = this.$refs.toggle.classList.toggle('on')
|
||||||
this.$emit("change", containsOnClass);
|
this.$emit('change', containsOnClass)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "textareaAutoHeight",
|
name: 'textareaAutoHeight',
|
||||||
update({ scrollHeight, clientHeight, style }) {
|
update({ scrollHeight, clientHeight, style }) {
|
||||||
if (scrollHeight !== clientHeight) {
|
if (scrollHeight !== clientHeight) {
|
||||||
style.minHeight = `${scrollHeight}px`;
|
style.minHeight = `${scrollHeight}px`
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|||||||
@@ -10,11 +10,7 @@
|
|||||||
"target": "postwoman",
|
"target": "postwoman",
|
||||||
"public": "dist",
|
"public": "dist",
|
||||||
"cleanUrls": true,
|
"cleanUrls": true,
|
||||||
"ignore": [
|
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
|
||||||
"firebase.json",
|
|
||||||
"**/.*",
|
|
||||||
"**/node_modules/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"storage": {
|
"storage": {
|
||||||
"rules": "storage.rules"
|
"rules": "storage.rules"
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
const mimeToMode = {
|
const mimeToMode = {
|
||||||
"text/plain": "plain_text",
|
'text/plain': 'plain_text',
|
||||||
"text/html": "html",
|
'text/html': 'html',
|
||||||
"application/xml": "xml",
|
'application/xml': 'xml',
|
||||||
"application/hal+json": "json",
|
'application/hal+json': 'json',
|
||||||
"application/json": "json"
|
'application/json': 'json',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getEditorLangForMimeType(mimeType) {
|
export function getEditorLangForMimeType(mimeType) {
|
||||||
return mimeToMode[mimeType] || "plain_text";
|
return mimeToMode[mimeType] || 'plain_text'
|
||||||
}
|
}
|
||||||
|
|||||||
186
functions/fb.js
186
functions/fb.js
@@ -1,22 +1,22 @@
|
|||||||
import firebase from "firebase/app";
|
import firebase from 'firebase/app'
|
||||||
import "firebase/firestore";
|
import 'firebase/firestore'
|
||||||
import "firebase/auth";
|
import 'firebase/auth'
|
||||||
|
|
||||||
// Initialize Firebase, copied from cloud console
|
// Initialize Firebase, copied from cloud console
|
||||||
const firebaseConfig = {
|
const firebaseConfig = {
|
||||||
apiKey: "AIzaSyCMsFreESs58-hRxTtiqQrIcimh4i1wbsM",
|
apiKey: 'AIzaSyCMsFreESs58-hRxTtiqQrIcimh4i1wbsM',
|
||||||
authDomain: "postwoman-api.firebaseapp.com",
|
authDomain: 'postwoman-api.firebaseapp.com',
|
||||||
databaseURL: "https://postwoman-api.firebaseio.com",
|
databaseURL: 'https://postwoman-api.firebaseio.com',
|
||||||
projectId: "postwoman-api",
|
projectId: 'postwoman-api',
|
||||||
storageBucket: "postwoman-api.appspot.com",
|
storageBucket: 'postwoman-api.appspot.com',
|
||||||
messagingSenderId: "421993993223",
|
messagingSenderId: '421993993223',
|
||||||
appId: "1:421993993223:web:ec0baa8ee8c02ffa1fc6a2",
|
appId: '1:421993993223:web:ec0baa8ee8c02ffa1fc6a2',
|
||||||
measurementId: "G-ERJ6025CEB"
|
measurementId: 'G-ERJ6025CEB',
|
||||||
};
|
}
|
||||||
firebase.initializeApp(firebaseConfig);
|
firebase.initializeApp(firebaseConfig)
|
||||||
|
|
||||||
// a reference to the users collection
|
// a reference to the users collection
|
||||||
const usersCollection = firebase.firestore().collection("users");
|
const usersCollection = firebase.firestore().collection('users')
|
||||||
|
|
||||||
// the shared state object that any vue component
|
// the shared state object that any vue component
|
||||||
// can get access to
|
// can get access to
|
||||||
@@ -34,21 +34,21 @@ export const fb = {
|
|||||||
author_name: fb.currentUser.displayName,
|
author_name: fb.currentUser.displayName,
|
||||||
author_image: fb.currentUser.photoURL,
|
author_image: fb.currentUser.photoURL,
|
||||||
message,
|
message,
|
||||||
label
|
label,
|
||||||
};
|
}
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("feeds")
|
.collection('feeds')
|
||||||
.add(dt)
|
.add(dt)
|
||||||
.catch(e => console.error("error inserting", dt, e));
|
.catch(e => console.error('error inserting', dt, e))
|
||||||
},
|
},
|
||||||
deleteFeed: id => {
|
deleteFeed: id => {
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("feeds")
|
.collection('feeds')
|
||||||
.doc(id)
|
.doc(id)
|
||||||
.delete()
|
.delete()
|
||||||
.catch(e => console.error("error deleting", id, e));
|
.catch(e => console.error('error deleting', id, e))
|
||||||
},
|
},
|
||||||
writeSettings: async (setting, value) => {
|
writeSettings: async (setting, value) => {
|
||||||
const st = {
|
const st = {
|
||||||
@@ -57,47 +57,47 @@ export const fb = {
|
|||||||
author_name: fb.currentUser.displayName,
|
author_name: fb.currentUser.displayName,
|
||||||
author_image: fb.currentUser.photoURL,
|
author_image: fb.currentUser.photoURL,
|
||||||
name: setting,
|
name: setting,
|
||||||
value
|
value,
|
||||||
};
|
}
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("settings")
|
.collection('settings')
|
||||||
.doc(setting)
|
.doc(setting)
|
||||||
.set(st)
|
.set(st)
|
||||||
.catch(e => console.error("error updating", st, e));
|
.catch(e => console.error('error updating', st, e))
|
||||||
},
|
},
|
||||||
writeHistory: async entry => {
|
writeHistory: async entry => {
|
||||||
const hs = entry;
|
const hs = entry
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("history")
|
.collection('history')
|
||||||
.add(hs)
|
.add(hs)
|
||||||
.catch(e => console.error("error inserting", hs, e));
|
.catch(e => console.error('error inserting', hs, e))
|
||||||
},
|
},
|
||||||
deleteHistory: entry => {
|
deleteHistory: entry => {
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("history")
|
.collection('history')
|
||||||
.doc(entry.id)
|
.doc(entry.id)
|
||||||
.delete()
|
.delete()
|
||||||
.catch(e => console.error("error deleting", entry, e));
|
.catch(e => console.error('error deleting', entry, e))
|
||||||
},
|
},
|
||||||
clearHistory: () => {
|
clearHistory: () => {
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("history")
|
.collection('history')
|
||||||
.get()
|
.get()
|
||||||
.then(({ docs }) => {
|
.then(({ docs }) => {
|
||||||
docs.forEach(e => fb.deleteHistory(e));
|
docs.forEach(e => fb.deleteHistory(e))
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
toggleStar: (entry, value) => {
|
toggleStar: (entry, value) => {
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("history")
|
.collection('history')
|
||||||
.doc(entry.id)
|
.doc(entry.id)
|
||||||
.update({ star: value })
|
.update({ star: value })
|
||||||
.catch(e => console.error("error deleting", entry, e));
|
.catch(e => console.error('error deleting', entry, e))
|
||||||
},
|
},
|
||||||
writeCollections: async collection => {
|
writeCollections: async collection => {
|
||||||
const cl = {
|
const cl = {
|
||||||
@@ -105,14 +105,14 @@ export const fb = {
|
|||||||
author: fb.currentUser.uid,
|
author: fb.currentUser.uid,
|
||||||
author_name: fb.currentUser.displayName,
|
author_name: fb.currentUser.displayName,
|
||||||
author_image: fb.currentUser.photoURL,
|
author_image: fb.currentUser.photoURL,
|
||||||
collection: collection
|
collection: collection,
|
||||||
};
|
}
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("collections")
|
.collection('collections')
|
||||||
.doc("sync")
|
.doc('sync')
|
||||||
.set(cl)
|
.set(cl)
|
||||||
.catch(e => console.error("error updating", cl, e));
|
.catch(e => console.error('error updating', cl, e))
|
||||||
},
|
},
|
||||||
writeEnvironments: async environment => {
|
writeEnvironments: async environment => {
|
||||||
const ev = {
|
const ev = {
|
||||||
@@ -120,21 +120,21 @@ export const fb = {
|
|||||||
author: fb.currentUser.uid,
|
author: fb.currentUser.uid,
|
||||||
author_name: fb.currentUser.displayName,
|
author_name: fb.currentUser.displayName,
|
||||||
author_image: fb.currentUser.photoURL,
|
author_image: fb.currentUser.photoURL,
|
||||||
environment: environment
|
environment: environment,
|
||||||
};
|
}
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("environments")
|
.collection('environments')
|
||||||
.doc("sync")
|
.doc('sync')
|
||||||
.set(ev)
|
.set(ev)
|
||||||
.catch(e => console.error("error updating", ev, e));
|
.catch(e => console.error('error updating', ev, e))
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// When a user logs in or out, save that in the store
|
// When a user logs in or out, save that in the store
|
||||||
firebase.auth().onAuthStateChanged(user => {
|
firebase.auth().onAuthStateChanged(user => {
|
||||||
if (user) {
|
if (user) {
|
||||||
fb.currentUser = user;
|
fb.currentUser = user
|
||||||
fb.currentUser.providerData.forEach(profile => {
|
fb.currentUser.providerData.forEach(profile => {
|
||||||
let us = {
|
let us = {
|
||||||
updatedOn: new Date(),
|
updatedOn: new Date(),
|
||||||
@@ -142,80 +142,80 @@ firebase.auth().onAuthStateChanged(user => {
|
|||||||
name: profile.displayName,
|
name: profile.displayName,
|
||||||
email: profile.email,
|
email: profile.email,
|
||||||
photoUrl: profile.photoURL,
|
photoUrl: profile.photoURL,
|
||||||
uid: profile.uid
|
uid: profile.uid,
|
||||||
};
|
}
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.set(us)
|
.set(us)
|
||||||
.catch(e => console.error("error updating", us, e));
|
.catch(e => console.error('error updating', us, e))
|
||||||
});
|
})
|
||||||
|
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("feeds")
|
.collection('feeds')
|
||||||
.orderBy("createdOn", "desc")
|
.orderBy('createdOn', 'desc')
|
||||||
.onSnapshot(feedsRef => {
|
.onSnapshot(feedsRef => {
|
||||||
const feeds = [];
|
const feeds = []
|
||||||
feedsRef.forEach(doc => {
|
feedsRef.forEach(doc => {
|
||||||
const feed = doc.data();
|
const feed = doc.data()
|
||||||
feed.id = doc.id;
|
feed.id = doc.id
|
||||||
feeds.push(feed);
|
feeds.push(feed)
|
||||||
});
|
})
|
||||||
fb.currentFeeds = feeds;
|
fb.currentFeeds = feeds
|
||||||
});
|
})
|
||||||
|
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("settings")
|
.collection('settings')
|
||||||
.onSnapshot(settingsRef => {
|
.onSnapshot(settingsRef => {
|
||||||
const settings = [];
|
const settings = []
|
||||||
settingsRef.forEach(doc => {
|
settingsRef.forEach(doc => {
|
||||||
const setting = doc.data();
|
const setting = doc.data()
|
||||||
setting.id = doc.id;
|
setting.id = doc.id
|
||||||
settings.push(setting);
|
settings.push(setting)
|
||||||
});
|
})
|
||||||
fb.currentSettings = settings;
|
fb.currentSettings = settings
|
||||||
});
|
})
|
||||||
|
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("history")
|
.collection('history')
|
||||||
.onSnapshot(historyRef => {
|
.onSnapshot(historyRef => {
|
||||||
const history = [];
|
const history = []
|
||||||
historyRef.forEach(doc => {
|
historyRef.forEach(doc => {
|
||||||
const entry = doc.data();
|
const entry = doc.data()
|
||||||
entry.id = doc.id;
|
entry.id = doc.id
|
||||||
history.push(entry);
|
history.push(entry)
|
||||||
});
|
})
|
||||||
fb.currentHistory = history;
|
fb.currentHistory = history
|
||||||
});
|
})
|
||||||
|
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("collections")
|
.collection('collections')
|
||||||
.onSnapshot(collectionsRef => {
|
.onSnapshot(collectionsRef => {
|
||||||
const collections = [];
|
const collections = []
|
||||||
collectionsRef.forEach(doc => {
|
collectionsRef.forEach(doc => {
|
||||||
const collection = doc.data();
|
const collection = doc.data()
|
||||||
collection.id = doc.id;
|
collection.id = doc.id
|
||||||
collections.push(collection);
|
collections.push(collection)
|
||||||
});
|
})
|
||||||
fb.currentCollections = collections[0].collection;
|
fb.currentCollections = collections[0].collection
|
||||||
});
|
})
|
||||||
|
|
||||||
usersCollection
|
usersCollection
|
||||||
.doc(fb.currentUser.uid)
|
.doc(fb.currentUser.uid)
|
||||||
.collection("environments")
|
.collection('environments')
|
||||||
.onSnapshot(environmentsRef => {
|
.onSnapshot(environmentsRef => {
|
||||||
const environments = [];
|
const environments = []
|
||||||
environmentsRef.forEach(doc => {
|
environmentsRef.forEach(doc => {
|
||||||
const environment = doc.data();
|
const environment = doc.data()
|
||||||
environment.id = doc.id;
|
environment.id = doc.id
|
||||||
environments.push(environment);
|
environments.push(environment)
|
||||||
});
|
})
|
||||||
fb.currentEnvironments = environments[0].environment;
|
fb.currentEnvironments = environments[0].environment
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
fb.currentUser = null;
|
fb.currentUser = null
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|||||||
@@ -1,124 +1,124 @@
|
|||||||
export const commonHeaders = [
|
export const commonHeaders = [
|
||||||
"WWW-Authenticate",
|
'WWW-Authenticate',
|
||||||
"Authorization",
|
'Authorization',
|
||||||
"Proxy-Authenticate",
|
'Proxy-Authenticate',
|
||||||
"Proxy-Authorization",
|
'Proxy-Authorization',
|
||||||
"Age",
|
'Age',
|
||||||
"Cache-Control",
|
'Cache-Control',
|
||||||
"Clear-Site-Data",
|
'Clear-Site-Data',
|
||||||
"Expires",
|
'Expires',
|
||||||
"Pragma",
|
'Pragma',
|
||||||
"Warning",
|
'Warning',
|
||||||
"Accept-CH",
|
'Accept-CH',
|
||||||
"Accept-CH-Lifetime",
|
'Accept-CH-Lifetime',
|
||||||
"Early-Data",
|
'Early-Data',
|
||||||
"Content-DPR",
|
'Content-DPR',
|
||||||
"DPR",
|
'DPR',
|
||||||
"Device-Memory",
|
'Device-Memory',
|
||||||
"Save-Data",
|
'Save-Data',
|
||||||
"Viewport-Width",
|
'Viewport-Width',
|
||||||
"Width",
|
'Width',
|
||||||
"Last-Modified",
|
'Last-Modified',
|
||||||
"ETag",
|
'ETag',
|
||||||
"If-Match",
|
'If-Match',
|
||||||
"If-None-Match",
|
'If-None-Match',
|
||||||
"If-Modified-Since",
|
'If-Modified-Since',
|
||||||
"If-Unmodified-Since",
|
'If-Unmodified-Since',
|
||||||
"Vary",
|
'Vary',
|
||||||
"Connection",
|
'Connection',
|
||||||
"Keep-Alive",
|
'Keep-Alive',
|
||||||
"Accept",
|
'Accept',
|
||||||
"Accept-Charset",
|
'Accept-Charset',
|
||||||
"Accept-Encoding",
|
'Accept-Encoding',
|
||||||
"Accept-Language",
|
'Accept-Language',
|
||||||
"Expect",
|
'Expect',
|
||||||
"Max-Forwards",
|
'Max-Forwards',
|
||||||
"Cookie",
|
'Cookie',
|
||||||
"Set-Cookie",
|
'Set-Cookie',
|
||||||
"Cookie2",
|
'Cookie2',
|
||||||
"Set-Cookie2",
|
'Set-Cookie2',
|
||||||
"Access-Control-Allow-Origin",
|
'Access-Control-Allow-Origin',
|
||||||
"Access-Control-Allow-Credentials",
|
'Access-Control-Allow-Credentials',
|
||||||
"Access-Control-Allow-Headers",
|
'Access-Control-Allow-Headers',
|
||||||
"Access-Control-Allow-Methods",
|
'Access-Control-Allow-Methods',
|
||||||
"Access-Control-Expose-Headers",
|
'Access-Control-Expose-Headers',
|
||||||
"Access-Control-Max-Age",
|
'Access-Control-Max-Age',
|
||||||
"Access-Control-Request-Headers",
|
'Access-Control-Request-Headers',
|
||||||
"Access-Control-Request-Method",
|
'Access-Control-Request-Method',
|
||||||
"Origin",
|
'Origin',
|
||||||
"Service-Worker-Allowed",
|
'Service-Worker-Allowed',
|
||||||
"Timing-Allow-Origin",
|
'Timing-Allow-Origin',
|
||||||
"X-Permitted-Cross-Domain-Policies",
|
'X-Permitted-Cross-Domain-Policies',
|
||||||
"DNT",
|
'DNT',
|
||||||
"Tk",
|
'Tk',
|
||||||
"Content-Disposition",
|
'Content-Disposition',
|
||||||
"Content-Length",
|
'Content-Length',
|
||||||
"Content-Type",
|
'Content-Type',
|
||||||
"Content-Encoding",
|
'Content-Encoding',
|
||||||
"Content-Language",
|
'Content-Language',
|
||||||
"Content-Location",
|
'Content-Location',
|
||||||
"Forwarded",
|
'Forwarded',
|
||||||
"X-Forwarded-For",
|
'X-Forwarded-For',
|
||||||
"X-Forwarded-Host",
|
'X-Forwarded-Host',
|
||||||
"X-Forwarded-Proto",
|
'X-Forwarded-Proto',
|
||||||
"Via",
|
'Via',
|
||||||
"Location",
|
'Location',
|
||||||
"From",
|
'From',
|
||||||
"Host",
|
'Host',
|
||||||
"Referer",
|
'Referer',
|
||||||
"Referrer-Policy",
|
'Referrer-Policy',
|
||||||
"User-Agent",
|
'User-Agent',
|
||||||
"Allow",
|
'Allow',
|
||||||
"Server",
|
'Server',
|
||||||
"Accept-Ranges",
|
'Accept-Ranges',
|
||||||
"Range",
|
'Range',
|
||||||
"If-Range",
|
'If-Range',
|
||||||
"Content-Range",
|
'Content-Range',
|
||||||
"Cross-Origin-Opener-Policy",
|
'Cross-Origin-Opener-Policy',
|
||||||
"Cross-Origin-Resource-Policy",
|
'Cross-Origin-Resource-Policy',
|
||||||
"Content-Security-Policy",
|
'Content-Security-Policy',
|
||||||
"Content-Security-Policy-Report-Only",
|
'Content-Security-Policy-Report-Only',
|
||||||
"Expect-CT",
|
'Expect-CT',
|
||||||
"Feature-Policy",
|
'Feature-Policy',
|
||||||
"Public-Key-Pins",
|
'Public-Key-Pins',
|
||||||
"Public-Key-Pins-Report-Only",
|
'Public-Key-Pins-Report-Only',
|
||||||
"Strict-Transport-Security",
|
'Strict-Transport-Security',
|
||||||
"Upgrade-Insecure-Requests",
|
'Upgrade-Insecure-Requests',
|
||||||
"X-Content-Type-Options",
|
'X-Content-Type-Options',
|
||||||
"X-Download-Options",
|
'X-Download-Options',
|
||||||
"X-Frame-Options",
|
'X-Frame-Options',
|
||||||
"X-Powered-By",
|
'X-Powered-By',
|
||||||
"X-XSS-Protection",
|
'X-XSS-Protection',
|
||||||
"Last-Event-ID",
|
'Last-Event-ID',
|
||||||
"NEL",
|
'NEL',
|
||||||
"Ping-From",
|
'Ping-From',
|
||||||
"Ping-To",
|
'Ping-To',
|
||||||
"Report-To",
|
'Report-To',
|
||||||
"Transfer-Encoding",
|
'Transfer-Encoding',
|
||||||
"TE",
|
'TE',
|
||||||
"Trailer",
|
'Trailer',
|
||||||
"Sec-WebSocket-Key",
|
'Sec-WebSocket-Key',
|
||||||
"Sec-WebSocket-Extensions",
|
'Sec-WebSocket-Extensions',
|
||||||
"Sec-WebSocket-Accept",
|
'Sec-WebSocket-Accept',
|
||||||
"Sec-WebSocket-Protocol",
|
'Sec-WebSocket-Protocol',
|
||||||
"Sec-WebSocket-Version",
|
'Sec-WebSocket-Version',
|
||||||
"Accept-Push-Policy",
|
'Accept-Push-Policy',
|
||||||
"Accept-Signature",
|
'Accept-Signature',
|
||||||
"Alt-Svc",
|
'Alt-Svc',
|
||||||
"Date",
|
'Date',
|
||||||
"Large-Allocation",
|
'Large-Allocation',
|
||||||
"Link",
|
'Link',
|
||||||
"Push-Policy",
|
'Push-Policy',
|
||||||
"Retry-After",
|
'Retry-After',
|
||||||
"Signature",
|
'Signature',
|
||||||
"Signed-Headers",
|
'Signed-Headers',
|
||||||
"Server-Timing",
|
'Server-Timing',
|
||||||
"SourceMap",
|
'SourceMap',
|
||||||
"Upgrade",
|
'Upgrade',
|
||||||
"X-DNS-Prefetch-Control",
|
'X-DNS-Prefetch-Control',
|
||||||
"X-Firefox-Spdy",
|
'X-Firefox-Spdy',
|
||||||
"X-Pingback",
|
'X-Pingback',
|
||||||
"X-Requested-With",
|
'X-Requested-With',
|
||||||
"X-Robots-Tag",
|
'X-Robots-Tag',
|
||||||
"X-UA-Compatible"
|
'X-UA-Compatible',
|
||||||
];
|
]
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
import AxiosStrategy from "./strategies/AxiosStrategy";
|
import AxiosStrategy from './strategies/AxiosStrategy'
|
||||||
import ExtensionStrategy, {
|
import ExtensionStrategy, { hasExtensionInstalled } from './strategies/ExtensionStrategy'
|
||||||
hasExtensionInstalled
|
import FirefoxStrategy from './strategies/FirefoxStrategy'
|
||||||
} from "./strategies/ExtensionStrategy";
|
import ChromeStrategy, { hasChromeExtensionInstalled } from './strategies/ChromeStrategy'
|
||||||
import FirefoxStrategy from "./strategies/FirefoxStrategy";
|
|
||||||
import ChromeStrategy, {
|
|
||||||
hasChromeExtensionInstalled
|
|
||||||
} from "./strategies/ChromeStrategy";
|
|
||||||
|
|
||||||
const isExtensionsAllowed = ({ state }) =>
|
const isExtensionsAllowed = ({ state }) =>
|
||||||
typeof state.postwoman.settings.EXTENSIONS_ENABLED === "undefined" ||
|
typeof state.postwoman.settings.EXTENSIONS_ENABLED === 'undefined' ||
|
||||||
state.postwoman.settings.EXTENSIONS_ENABLED;
|
state.postwoman.settings.EXTENSIONS_ENABLED
|
||||||
|
|
||||||
const runAppropriateStrategy = (req, store) => {
|
const runAppropriateStrategy = (req, store) => {
|
||||||
if (isExtensionsAllowed(store)) {
|
if (isExtensionsAllowed(store)) {
|
||||||
if (hasExtensionInstalled()) {
|
if (hasExtensionInstalled()) {
|
||||||
return ExtensionStrategy(req, store);
|
return ExtensionStrategy(req, store)
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following strategies are deprecated and kept to support older version of the extensions
|
// The following strategies are deprecated and kept to support older version of the extensions
|
||||||
@@ -22,21 +18,19 @@ const runAppropriateStrategy = (req, store) => {
|
|||||||
// Chrome Provides a chrome object for scripts to access
|
// Chrome Provides a chrome object for scripts to access
|
||||||
// Check its availability to say whether you are in Google Chrome
|
// Check its availability to say whether you are in Google Chrome
|
||||||
if (window.chrome && hasChromeExtensionInstalled()) {
|
if (window.chrome && hasChromeExtensionInstalled()) {
|
||||||
return ChromeStrategy(req, store);
|
return ChromeStrategy(req, store)
|
||||||
}
|
}
|
||||||
// The firefox plugin injects a function to send requests through it
|
// The firefox plugin injects a function to send requests through it
|
||||||
// If that is available, then we can use the FirefoxStrategy
|
// If that is available, then we can use the FirefoxStrategy
|
||||||
if (window.firefoxExtSendRequest) {
|
if (window.firefoxExtSendRequest) {
|
||||||
return FirefoxStrategy(req, store);
|
return FirefoxStrategy(req, store)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return AxiosStrategy(req, store);
|
return AxiosStrategy(req, store)
|
||||||
};
|
}
|
||||||
|
|
||||||
const sendNetworkRequest = (req, store) =>
|
const sendNetworkRequest = (req, store) =>
|
||||||
runAppropriateStrategy(req, store).finally(() =>
|
runAppropriateStrategy(req, store).finally(() => window.$nuxt.$loading.finish())
|
||||||
window.$nuxt.$loading.finish()
|
|
||||||
);
|
|
||||||
|
|
||||||
export { sendNetworkRequest };
|
export { sendNetworkRequest }
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
const PASS = "PASS";
|
const PASS = 'PASS'
|
||||||
const FAIL = "FAIL";
|
const FAIL = 'FAIL'
|
||||||
const ERROR = "ERROR";
|
const ERROR = 'ERROR'
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
[PASS]: { icon: "check", class: "success-response" },
|
[PASS]: { icon: 'check', class: 'success-response' },
|
||||||
[FAIL]: { icon: "close", class: "cl-error-response" },
|
[FAIL]: { icon: 'close', class: 'cl-error-response' },
|
||||||
[ERROR]: { icon: "close", class: "cl-error-response" },
|
[ERROR]: { icon: 'close', class: 'cl-error-response' },
|
||||||
none: { icon: "", class: "" }
|
none: { icon: '', class: '' },
|
||||||
};
|
}
|
||||||
|
|
||||||
// TODO: probably have to use a more global state for `test`
|
// TODO: probably have to use a more global state for `test`
|
||||||
|
|
||||||
@@ -15,161 +15,133 @@ export default function runTestScriptWithVariables(script, variables) {
|
|||||||
let pw = {
|
let pw = {
|
||||||
_errors: [],
|
_errors: [],
|
||||||
_testReports: [],
|
_testReports: [],
|
||||||
_report: "",
|
_report: '',
|
||||||
expect(value) {
|
expect(value) {
|
||||||
try {
|
try {
|
||||||
return expect(value, this._testReports);
|
return expect(value, this._testReports)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
pw._testReports.push({ result: ERROR, message: e });
|
pw._testReports.push({ result: ERROR, message: e })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
test: (descriptor, func) => test(descriptor, func, pw._testReports)
|
test: (descriptor, func) => test(descriptor, func, pw._testReports),
|
||||||
// globals that the script is allowed to have access to.
|
// globals that the script is allowed to have access to.
|
||||||
};
|
}
|
||||||
Object.assign(pw, variables);
|
Object.assign(pw, variables)
|
||||||
|
|
||||||
// run pre-request script within this function so that it has access to the pw object.
|
// run pre-request script within this function so that it has access to the pw object.
|
||||||
new Function("pw", script)(pw);
|
new Function('pw', script)(pw)
|
||||||
//
|
//
|
||||||
const testReports = pw._testReports.map(item => {
|
const testReports = pw._testReports.map(item => {
|
||||||
if (item.result) {
|
if (item.result) {
|
||||||
item.styles = styles[item.result];
|
item.styles = styles[item.result]
|
||||||
} else {
|
} else {
|
||||||
item.styles = styles.none;
|
item.styles = styles.none
|
||||||
}
|
}
|
||||||
return item;
|
return item
|
||||||
});
|
})
|
||||||
return { report: pw._report, errors: pw._errors, testResults: testReports };
|
return { report: pw._report, errors: pw._errors, testResults: testReports }
|
||||||
}
|
}
|
||||||
|
|
||||||
function test(descriptor, func, _testReports) {
|
function test(descriptor, func, _testReports) {
|
||||||
_testReports.push({ startBlock: descriptor });
|
_testReports.push({ startBlock: descriptor })
|
||||||
try {
|
try {
|
||||||
func();
|
func()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_testReports.push({ result: ERROR, message: e });
|
_testReports.push({ result: ERROR, message: e })
|
||||||
}
|
}
|
||||||
_testReports.push({ endBlock: true });
|
_testReports.push({ endBlock: true })
|
||||||
|
|
||||||
// TODO: Organize and generate text report of each {descriptor: true} section in testReports.
|
// TODO: Organize and generate text report of each {descriptor: true} section in testReports.
|
||||||
// add checkmark or x depending on if each testReport is pass=true or pass=false
|
// add checkmark or x depending on if each testReport is pass=true or pass=false
|
||||||
}
|
}
|
||||||
|
|
||||||
function expect(expectValue, _testReports) {
|
function expect(expectValue, _testReports) {
|
||||||
return new Expectation(expectValue, null, _testReports);
|
return new Expectation(expectValue, null, _testReports)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Expectation {
|
class Expectation {
|
||||||
constructor(expectValue, _not, _testReports) {
|
constructor(expectValue, _not, _testReports) {
|
||||||
this.expectValue = expectValue;
|
this.expectValue = expectValue
|
||||||
this.not = _not || new Expectation(this.expectValue, true, _testReports);
|
this.not = _not || new Expectation(this.expectValue, true, _testReports)
|
||||||
this._testReports = _testReports; // this values is used within Test.it, which wraps Expectation and passes _testReports value.
|
this._testReports = _testReports // this values is used within Test.it, which wraps Expectation and passes _testReports value.
|
||||||
this._satisfies = function(expectValue, targetValue) {
|
this._satisfies = function(expectValue, targetValue) {
|
||||||
// Used for testing if two values match the expectation, which could be === OR !==, depending on if not
|
// Used for testing if two values match the expectation, which could be === OR !==, depending on if not
|
||||||
// was used. Expectation#_satisfies prevents the need to have an if(this.not) branch in every test method.
|
// was used. Expectation#_satisfies prevents the need to have an if(this.not) branch in every test method.
|
||||||
// Signature is _satisfies([expectValue,] targetValue): if only one argument is given, it is assumed the targetValue, and expectValue is set to this.expectValue
|
// Signature is _satisfies([expectValue,] targetValue): if only one argument is given, it is assumed the targetValue, and expectValue is set to this.expectValue
|
||||||
if (!targetValue) {
|
if (!targetValue) {
|
||||||
targetValue = expectValue;
|
targetValue = expectValue
|
||||||
expectValue = this.expectValue;
|
expectValue = this.expectValue
|
||||||
}
|
}
|
||||||
if (this.not === true) {
|
if (this.not === true) {
|
||||||
// test the inverse. this.not is always truthly, but an Expectation that is inverted will always be strictly `true`
|
// test the inverse. this.not is always truthly, but an Expectation that is inverted will always be strictly `true`
|
||||||
return expectValue !== targetValue;
|
return expectValue !== targetValue
|
||||||
} else {
|
} else {
|
||||||
return expectValue === targetValue;
|
return expectValue === targetValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
_fmtNot(message) {
|
_fmtNot(message) {
|
||||||
// given a string with "(not)" in it, replaces with "not" or "", depending if the expectation is expecting the positive or inverse (this._not)
|
// given a string with "(not)" in it, replaces with "not" or "", depending if the expectation is expecting the positive or inverse (this._not)
|
||||||
if (this.not === true) {
|
if (this.not === true) {
|
||||||
return message.replace("(not)", "not ");
|
return message.replace('(not)', 'not ')
|
||||||
} else {
|
} else {
|
||||||
return message.replace("(not)", "");
|
return message.replace('(not)', '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_fail(message) {
|
_fail(message) {
|
||||||
this._testReports.push({ result: FAIL, message });
|
this._testReports.push({ result: FAIL, message })
|
||||||
}
|
}
|
||||||
_pass(message) {
|
_pass(message) {
|
||||||
this._testReports.push({ result: PASS });
|
this._testReports.push({ result: PASS })
|
||||||
}
|
}
|
||||||
// TEST METHODS DEFINED BELOW
|
// TEST METHODS DEFINED BELOW
|
||||||
// these are the usual methods that would follow expect(...)
|
// these are the usual methods that would follow expect(...)
|
||||||
toBe(value) {
|
toBe(value) {
|
||||||
return this._satisfies(value)
|
return this._satisfies(value)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(this._fmtNot(`Expected ${this.expectValue} (not)to be ${value}`))
|
||||||
this._fmtNot(`Expected ${this.expectValue} (not)to be ${value}`)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
toHaveProperty(value) {
|
toHaveProperty(value) {
|
||||||
return this._satisfies(this.expectValue.hasOwnProperty(value), true)
|
return this._satisfies(this.expectValue.hasOwnProperty(value), true)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(
|
||||||
this._fmtNot(
|
this._fmtNot(`Expected object ${this.expectValue} to (not)have property ${value}`)
|
||||||
`Expected object ${this.expectValue} to (not)have property ${value}`
|
|
||||||
)
|
)
|
||||||
);
|
|
||||||
}
|
}
|
||||||
toBeLevel2xx() {
|
toBeLevel2xx() {
|
||||||
const code = parseInt(this.expectValue);
|
const code = parseInt(this.expectValue)
|
||||||
if (Number.isNaN(code)) {
|
if (Number.isNaN(code)) {
|
||||||
return this._fail(
|
return this._fail(`Expected 200-level status but could not parse value ${this.expectValue}`)
|
||||||
`Expected 200-level status but could not parse value ${this.expectValue}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return this._satisfies(code >= 200 && code < 300)
|
return this._satisfies(code >= 200 && code < 300)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(this._fmtNot(`Expected ${this.expectValue} to (not)be 200-level status`))
|
||||||
this._fmtNot(
|
|
||||||
`Expected ${this.expectValue} to (not)be 200-level status`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
toBeLevel3xx() {
|
toBeLevel3xx() {
|
||||||
const code = parseInt(this.expectValue);
|
const code = parseInt(this.expectValue)
|
||||||
if (Number.isNaN(code)) {
|
if (Number.isNaN(code)) {
|
||||||
return this._fail(
|
return this._fail(`Expected 300-level status but could not parse value ${this.expectValue}`)
|
||||||
`Expected 300-level status but could not parse value ${this.expectValue}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return this._satisfies(code >= 300 && code < 400)
|
return this._satisfies(code >= 300 && code < 400)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(this._fmtNot(`Expected ${this.expectValue} to (not)be 300-level status`))
|
||||||
this._fmtNot(
|
|
||||||
`Expected ${this.expectValue} to (not)be 300-level status`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
toBeLevel4xx() {
|
toBeLevel4xx() {
|
||||||
const code = parseInt(this.expectValue);
|
const code = parseInt(this.expectValue)
|
||||||
if (Number.isNaN(code)) {
|
if (Number.isNaN(code)) {
|
||||||
return this._fail(
|
return this._fail(`Expected 400-level status but could not parse value ${this.expectValue}`)
|
||||||
`Expected 400-level status but could not parse value ${this.expectValue}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return this._satisfies(code >= 400 && code < 500)
|
return this._satisfies(code >= 400 && code < 500)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(this._fmtNot(`Expected ${this.expectValue} to (not)be 400-level status`))
|
||||||
this._fmtNot(
|
|
||||||
`Expected ${this.expectValue} to (not)be 400-level status`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
toBeLevel5xx() {
|
toBeLevel5xx() {
|
||||||
const code = parseInt(this.expectValue);
|
const code = parseInt(this.expectValue)
|
||||||
if (Number.isNaN(code)) {
|
if (Number.isNaN(code)) {
|
||||||
return this._fail(
|
return this._fail(`Expected 500-level status but could not parse value ${this.expectValue}`)
|
||||||
`Expected 500-level status but could not parse value ${this.expectValue}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return this._satisfies(code >= 500 && code < 600)
|
return this._satisfies(code >= 500 && code < 600)
|
||||||
? this._pass()
|
? this._pass()
|
||||||
: this._fail(
|
: this._fail(this._fmtNot(`Expected ${this.expectValue} to (not)be 500-level status`))
|
||||||
this._fmtNot(
|
|
||||||
`Expected ${this.expectValue} to (not)be 500-level status`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
export default function getEnvironmentVariablesFromScript(script) {
|
export default function getEnvironmentVariablesFromScript(script) {
|
||||||
let _variables = {};
|
let _variables = {}
|
||||||
|
|
||||||
// the pw object is the proxy by which pre-request scripts can pass variables to the request.
|
// the pw object is the proxy by which pre-request scripts can pass variables to the request.
|
||||||
// for security and control purposes, this is the only way a pre-request script should modify variables.
|
// for security and control purposes, this is the only way a pre-request script should modify variables.
|
||||||
let pw = {
|
let pw = {
|
||||||
environment: {
|
environment: {
|
||||||
set: (key, value) => (_variables[key] = value)
|
set: (key, value) => (_variables[key] = value),
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
set: (key, value) => (_variables[key] = value)
|
set: (key, value) => (_variables[key] = value),
|
||||||
}
|
},
|
||||||
// globals that the script is allowed to have access to.
|
// globals that the script is allowed to have access to.
|
||||||
};
|
}
|
||||||
|
|
||||||
// run pre-request script within this function so that it has access to the pw object.
|
// run pre-request script within this function so that it has access to the pw object.
|
||||||
new Function("pw", script)(pw);
|
new Function('pw', script)(pw)
|
||||||
|
|
||||||
return _variables;
|
return _variables
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
import axios from "axios";
|
import axios from 'axios'
|
||||||
|
|
||||||
const axiosWithProxy = async (req, { state }) => {
|
const axiosWithProxy = async (req, { state }) => {
|
||||||
const { data } = await axios.post(
|
const { data } = await axios.post(
|
||||||
state.postwoman.settings.PROXY_URL || "https://postwoman.apollotv.xyz/",
|
state.postwoman.settings.PROXY_URL || 'https://postwoman.apollotv.xyz/',
|
||||||
req
|
req
|
||||||
);
|
)
|
||||||
return data;
|
return data
|
||||||
};
|
}
|
||||||
|
|
||||||
const axiosWithoutProxy = async (req, _store) => {
|
const axiosWithoutProxy = async (req, _store) => {
|
||||||
const res = await axios(req);
|
const res = await axios(req)
|
||||||
return res;
|
return res
|
||||||
};
|
}
|
||||||
|
|
||||||
const axiosStrategy = (req, store) => {
|
const axiosStrategy = (req, store) => {
|
||||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||||
return axiosWithProxy(req, store);
|
return axiosWithProxy(req, store)
|
||||||
|
}
|
||||||
|
return axiosWithoutProxy(req, store)
|
||||||
}
|
}
|
||||||
return axiosWithoutProxy(req, store);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default axiosStrategy;
|
export default axiosStrategy
|
||||||
|
|||||||
@@ -1,63 +1,61 @@
|
|||||||
const EXTENSION_ID = "amknoiejhlmhancpahfcfcfhllgkpbld";
|
const EXTENSION_ID = 'amknoiejhlmhancpahfcfcfhllgkpbld'
|
||||||
|
|
||||||
// Check if the Chrome Extension is present
|
// Check if the Chrome Extension is present
|
||||||
// The Chrome extension injects an empty span to help detection.
|
// The Chrome extension injects an empty span to help detection.
|
||||||
// Also check for the presence of window.chrome object to confirm smooth operations
|
// Also check for the presence of window.chrome object to confirm smooth operations
|
||||||
export const hasChromeExtensionInstalled = () =>
|
export const hasChromeExtensionInstalled = () =>
|
||||||
document.getElementById("chromePWExtensionDetect") !== null;
|
document.getElementById('chromePWExtensionDetect') !== null
|
||||||
|
|
||||||
const chromeWithoutProxy = (req, _store) =>
|
const chromeWithoutProxy = (req, _store) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
chrome.runtime.sendMessage(
|
chrome.runtime.sendMessage(
|
||||||
EXTENSION_ID,
|
EXTENSION_ID,
|
||||||
{
|
{
|
||||||
messageType: "send-req",
|
messageType: 'send-req',
|
||||||
data: {
|
data: {
|
||||||
config: req
|
config: req,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
({ data }) => {
|
({ data }) => {
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
reject(data.error);
|
reject(data.error)
|
||||||
} else {
|
} else {
|
||||||
resolve(data.response);
|
resolve(data.response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
});
|
})
|
||||||
|
|
||||||
const chromeWithProxy = (req, { state }) =>
|
const chromeWithProxy = (req, { state }) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
chrome.runtime.sendMessage(
|
chrome.runtime.sendMessage(
|
||||||
EXTENSION_ID,
|
EXTENSION_ID,
|
||||||
{
|
{
|
||||||
messageType: "send-req",
|
messageType: 'send-req',
|
||||||
data: {
|
data: {
|
||||||
config: {
|
config: {
|
||||||
method: "post",
|
method: 'post',
|
||||||
url:
|
url: state.postwoman.settings.PROXY_URL || 'https://postwoman.apollotv.xyz/',
|
||||||
state.postwoman.settings.PROXY_URL ||
|
data: req,
|
||||||
"https://postwoman.apollotv.xyz/",
|
},
|
||||||
data: req
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
({ data }) => {
|
({ data }) => {
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
reject(error);
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
resolve(data.response.data);
|
resolve(data.response.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
});
|
})
|
||||||
|
|
||||||
const chromeStrategy = (req, store) => {
|
const chromeStrategy = (req, store) => {
|
||||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||||
return chromeWithProxy(req, store);
|
return chromeWithProxy(req, store)
|
||||||
} else {
|
} else {
|
||||||
return chromeWithoutProxy(req, store);
|
return chromeWithoutProxy(req, store)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
export default chromeStrategy;
|
export default chromeStrategy
|
||||||
|
|||||||
@@ -1,26 +1,25 @@
|
|||||||
export const hasExtensionInstalled = () =>
|
export const hasExtensionInstalled = () =>
|
||||||
typeof window.__POSTWOMAN_EXTENSION_HOOK__ !== "undefined";
|
typeof window.__POSTWOMAN_EXTENSION_HOOK__ !== 'undefined'
|
||||||
|
|
||||||
const extensionWithProxy = async (req, { state }) => {
|
const extensionWithProxy = async (req, { state }) => {
|
||||||
const { data } = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
|
const { data } = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
|
||||||
method: "post",
|
method: 'post',
|
||||||
url:
|
url: state.postwoman.settings.PROXY_URL || 'https://postwoman.apollotv.xyz/',
|
||||||
state.postwoman.settings.PROXY_URL || "https://postwoman.apollotv.xyz/",
|
data: req,
|
||||||
data: req
|
})
|
||||||
});
|
return data
|
||||||
return data;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
const extensionWithoutProxy = async (req, _store) => {
|
const extensionWithoutProxy = async (req, _store) => {
|
||||||
const res = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest(req);
|
const res = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest(req)
|
||||||
return res;
|
return res
|
||||||
};
|
}
|
||||||
|
|
||||||
const extensionStrategy = (req, store) => {
|
const extensionStrategy = (req, store) => {
|
||||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||||
return extensionWithProxy(req, store);
|
return extensionWithProxy(req, store)
|
||||||
|
}
|
||||||
|
return extensionWithoutProxy(req, store)
|
||||||
}
|
}
|
||||||
return extensionWithoutProxy(req, store);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default extensionStrategy;
|
export default extensionStrategy
|
||||||
|
|||||||
@@ -1,50 +1,46 @@
|
|||||||
const firefoxWithProxy = (req, { state }) =>
|
const firefoxWithProxy = (req, { state }) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
const eventListener = event => {
|
const eventListener = event => {
|
||||||
window.removeEventListener("firefoxExtSendRequestComplete", event);
|
window.removeEventListener('firefoxExtSendRequestComplete', event)
|
||||||
|
|
||||||
if (event.detail.error) {
|
if (event.detail.error) {
|
||||||
reject(JSON.parse(event.detail.error));
|
reject(JSON.parse(event.detail.error))
|
||||||
} else {
|
} else {
|
||||||
resolve(JSON.parse(event.detail.response).data);
|
resolve(JSON.parse(event.detail.response).data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener("firefoxExtSendRequestComplete", eventListener);
|
window.addEventListener('firefoxExtSendRequestComplete', eventListener)
|
||||||
|
|
||||||
window.firefoxExtSendRequest({
|
window.firefoxExtSendRequest({
|
||||||
method: "post",
|
method: 'post',
|
||||||
url:
|
url: state.postwoman.settings.PROXY_URL || 'https://postwoman.apollotv.xyz/',
|
||||||
state.postwoman.settings.PROXY_URL || "https://postwoman.apollotv.xyz/",
|
data: req,
|
||||||
data: req
|
})
|
||||||
});
|
})
|
||||||
});
|
|
||||||
|
|
||||||
const firefoxWithoutProxy = (req, _store) =>
|
const firefoxWithoutProxy = (req, _store) =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
const eventListener = ({ detail }) => {
|
const eventListener = ({ detail }) => {
|
||||||
window.removeEventListener(
|
window.removeEventListener('firefoxExtSendRequestComplete', eventListener)
|
||||||
"firefoxExtSendRequestComplete",
|
|
||||||
eventListener
|
|
||||||
);
|
|
||||||
|
|
||||||
if (detail.error) {
|
if (detail.error) {
|
||||||
reject(JSON.parse(detail.error));
|
reject(JSON.parse(detail.error))
|
||||||
} else {
|
} else {
|
||||||
resolve(JSON.parse(detail.response));
|
resolve(JSON.parse(detail.response))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener("firefoxExtSendRequestComplete", eventListener);
|
window.addEventListener('firefoxExtSendRequestComplete', eventListener)
|
||||||
|
|
||||||
window.firefoxExtSendRequest(req);
|
window.firefoxExtSendRequest(req)
|
||||||
});
|
})
|
||||||
|
|
||||||
const firefoxStrategy = (req, store) => {
|
const firefoxStrategy = (req, store) => {
|
||||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||||
return firefoxWithProxy(req, store);
|
return firefoxWithProxy(req, store)
|
||||||
|
}
|
||||||
|
return firefoxWithoutProxy(req, store)
|
||||||
}
|
}
|
||||||
return firefoxWithoutProxy(req, store);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default firefoxStrategy;
|
export default firefoxStrategy
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export default function parseTemplateString(string, variables) {
|
export default function parseTemplateString(string, variables) {
|
||||||
if (!variables || !string) {
|
if (!variables || !string) {
|
||||||
return string;
|
return string
|
||||||
}
|
}
|
||||||
const searchTerm = /<<([^>]*)>>/g; // "<<myVariable>>"
|
const searchTerm = /<<([^>]*)>>/g // "<<myVariable>>"
|
||||||
return string.replace(searchTerm, (match, p1) => variables[p1] || "");
|
return string.replace(searchTerm, (match, p1) => variables[p1] || '')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
// functions which might be called frequently
|
// functions which might be called frequently
|
||||||
// NOTE : Don't use lambda functions as this doesn't get bound properly in them, use the 'function (args) {}' format
|
// NOTE : Don't use lambda functions as this doesn't get bound properly in them, use the 'function (args) {}' format
|
||||||
const debounce = (func, delay) => {
|
const debounce = (func, delay) => {
|
||||||
let inDebounce;
|
let inDebounce
|
||||||
return function() {
|
return function() {
|
||||||
const context = this;
|
const context = this
|
||||||
const args = arguments;
|
const args = arguments
|
||||||
clearTimeout(inDebounce);
|
clearTimeout(inDebounce)
|
||||||
inDebounce = setTimeout(() => func.apply(context, args), delay);
|
inDebounce = setTimeout(() => func.apply(context, args), delay)
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
export default debounce;
|
export default debounce
|
||||||
|
|||||||
176
lang/de-DE.js
176
lang/de-DE.js
@@ -1,90 +1,90 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Startseite",
|
home: 'Startseite',
|
||||||
realtime: "Echtzeit",
|
realtime: 'Echtzeit',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Einstellungen",
|
settings: 'Einstellungen',
|
||||||
request: "Anfrage",
|
request: 'Anfrage',
|
||||||
install_pwa: "PWA installieren",
|
install_pwa: 'PWA installieren',
|
||||||
support_us: "Unterstütze uns",
|
support_us: 'Unterstütze uns',
|
||||||
tweet: "Twittern",
|
tweet: 'Twittern',
|
||||||
options: "Optionen",
|
options: 'Optionen',
|
||||||
communication: "Kommunikation",
|
communication: 'Kommunikation',
|
||||||
endpoint: "Endpunkt",
|
endpoint: 'Endpunkt',
|
||||||
schema: "Schema",
|
schema: 'Schema',
|
||||||
theme: "Design",
|
theme: 'Design',
|
||||||
subscribe: "Abonnieren",
|
subscribe: 'Abonnieren',
|
||||||
choose_language: "Sprache auswählen",
|
choose_language: 'Sprache auswählen',
|
||||||
shortcuts: "Tastenkombinationen",
|
shortcuts: 'Tastenkombinationen',
|
||||||
send_request: "Anfrage senden",
|
send_request: 'Anfrage senden',
|
||||||
save_to_collections: "In Sammlungen speichern",
|
save_to_collections: 'In Sammlungen speichern',
|
||||||
copy_request_link: "Anfragelink kopieren",
|
copy_request_link: 'Anfragelink kopieren',
|
||||||
reset_request: "Anfrage zurücksetzen",
|
reset_request: 'Anfrage zurücksetzen',
|
||||||
support_us_on: "Unterstütze uns auf",
|
support_us_on: 'Unterstütze uns auf',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "JavaScript-Code",
|
javascript_code: 'JavaScript-Code',
|
||||||
method: "Methode",
|
method: 'Methode',
|
||||||
path: "Pfad",
|
path: 'Pfad',
|
||||||
label: "Beschriftung",
|
label: 'Beschriftung',
|
||||||
again: "Wiederholen",
|
again: 'Wiederholen',
|
||||||
content_type: "Content-Typ",
|
content_type: 'Content-Typ',
|
||||||
raw_input: "Rohdaten-Eingabe",
|
raw_input: 'Rohdaten-Eingabe',
|
||||||
parameter_list: "Parameterliste",
|
parameter_list: 'Parameterliste',
|
||||||
raw_request_body: "Rohdaten der Anfrage",
|
raw_request_body: 'Rohdaten der Anfrage',
|
||||||
show_code: "Code zeigen",
|
show_code: 'Code zeigen',
|
||||||
hide_code: "Code ausblenden",
|
hide_code: 'Code ausblenden',
|
||||||
show_prerequest_script: "Preanfrageskript anzeigen",
|
show_prerequest_script: 'Preanfrageskript anzeigen',
|
||||||
hide_prerequest_script: "Preanfrageskript ausblenden",
|
hide_prerequest_script: 'Preanfrageskript ausblenden',
|
||||||
authentication: "Authentifizierung",
|
authentication: 'Authentifizierung',
|
||||||
authentication_type: "Authentifizierungs-Typ",
|
authentication_type: 'Authentifizierungs-Typ',
|
||||||
include_in_url: "In URL einfügen",
|
include_in_url: 'In URL einfügen',
|
||||||
parameters: "Parameter",
|
parameters: 'Parameter',
|
||||||
expand_response: "Antwort ausklappen",
|
expand_response: 'Antwort ausklappen',
|
||||||
collapse_response: "Antwort einklappen",
|
collapse_response: 'Antwort einklappen',
|
||||||
hide_preview: "Vorschau verstecken",
|
hide_preview: 'Vorschau verstecken',
|
||||||
preview_html: "HTML-Vorschau",
|
preview_html: 'HTML-Vorschau',
|
||||||
history: "Verlauf",
|
history: 'Verlauf',
|
||||||
collections: "Kollektionen",
|
collections: 'Kollektionen',
|
||||||
import_curl: "cURL importieren",
|
import_curl: 'cURL importieren',
|
||||||
import: "Importieren",
|
import: 'Importieren',
|
||||||
generate_code: "Code generieren",
|
generate_code: 'Code generieren',
|
||||||
request_type: "Anfrage-Typ",
|
request_type: 'Anfrage-Typ',
|
||||||
generated_code: "Generierter Code",
|
generated_code: 'Generierter Code',
|
||||||
status: "Status",
|
status: 'Status',
|
||||||
headers: "Headers",
|
headers: 'Headers',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(warte auf Verbindung)",
|
waiting_for_connection: '(warte auf Verbindung)',
|
||||||
message: "Nachricht",
|
message: 'Nachricht',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Server",
|
server: 'Server',
|
||||||
events: "Ereignisse",
|
events: 'Ereignisse',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Schema abrufen",
|
get_schema: 'Schema abrufen',
|
||||||
header_list: "Headerliste",
|
header_list: 'Headerliste',
|
||||||
add_new: "Neu hinzufügen",
|
add_new: 'Neu hinzufügen',
|
||||||
response: "Antwort",
|
response: 'Antwort',
|
||||||
query: "Abfrage",
|
query: 'Abfrage',
|
||||||
queries: "Abfragen",
|
queries: 'Abfragen',
|
||||||
query_variables: "Variablen",
|
query_variables: 'Variablen',
|
||||||
mutations: "Mutationen",
|
mutations: 'Mutationen',
|
||||||
subscriptions: "Abonnements",
|
subscriptions: 'Abonnements',
|
||||||
types: "Typen",
|
types: 'Typen',
|
||||||
send: "Senden",
|
send: 'Senden',
|
||||||
background: "Hintergrund",
|
background: 'Hintergrund',
|
||||||
color: "Farbe",
|
color: 'Farbe',
|
||||||
labels: "Bezeichner",
|
labels: 'Bezeichner',
|
||||||
multi_color: "Mehrfarbig",
|
multi_color: 'Mehrfarbig',
|
||||||
enabled: "Aktiviert",
|
enabled: 'Aktiviert',
|
||||||
disabled: "Deaktiviert",
|
disabled: 'Deaktiviert',
|
||||||
proxy: "Proxy",
|
proxy: 'Proxy',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting:
|
||||||
"Postwomans offizieller Proxy wird durch ApolloTV bereitgestellt.",
|
'Postwomans offizieller Proxy wird durch ApolloTV bereitgestellt.',
|
||||||
read_the: "Lies die",
|
read_the: 'Lies die',
|
||||||
apollotv_privacy_policy: "ApolloTV Datenschutzerklärung",
|
apollotv_privacy_policy: 'ApolloTV Datenschutzerklärung',
|
||||||
contact_us: "Kontaktiere uns",
|
contact_us: 'Kontaktiere uns',
|
||||||
connect: "Verbinden",
|
connect: 'Verbinden',
|
||||||
disconnect: "Trennen",
|
disconnect: 'Trennen',
|
||||||
start: "Start",
|
start: 'Start',
|
||||||
stop: "Stopp"
|
stop: 'Stopp',
|
||||||
};
|
}
|
||||||
|
|||||||
547
lang/en-US.js
547
lang/en-US.js
@@ -1,278 +1,273 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Home",
|
home: 'Home',
|
||||||
realtime: "Realtime",
|
realtime: 'Realtime',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Settings",
|
settings: 'Settings',
|
||||||
request: "Request",
|
request: 'Request',
|
||||||
install_pwa: "Install PWA",
|
install_pwa: 'Install PWA',
|
||||||
support_us: "Support us",
|
support_us: 'Support us',
|
||||||
tweet: "Tweet",
|
tweet: 'Tweet',
|
||||||
options: "Options",
|
options: 'Options',
|
||||||
communication: "Communication",
|
communication: 'Communication',
|
||||||
endpoint: "Endpoint",
|
endpoint: 'Endpoint',
|
||||||
schema: "Schema",
|
schema: 'Schema',
|
||||||
theme: "Theme",
|
theme: 'Theme',
|
||||||
subscribe: "Subscribe",
|
subscribe: 'Subscribe',
|
||||||
choose_language: "Choose Language",
|
choose_language: 'Choose Language',
|
||||||
shortcuts: "Shortcuts",
|
shortcuts: 'Shortcuts',
|
||||||
send_request: "Send Request",
|
send_request: 'Send Request',
|
||||||
save_to_collections: "Save to Collections",
|
save_to_collections: 'Save to Collections',
|
||||||
copy_request_link: "Copy Request Link",
|
copy_request_link: 'Copy Request Link',
|
||||||
reset_request: "Reset Request",
|
reset_request: 'Reset Request',
|
||||||
support_us_on: "Support us on",
|
support_us_on: 'Support us on',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "JavaScript Code",
|
javascript_code: 'JavaScript Code',
|
||||||
method: "Method",
|
method: 'Method',
|
||||||
path: "Path",
|
path: 'Path',
|
||||||
label: "Label",
|
label: 'Label',
|
||||||
content_type: "Content Type",
|
content_type: 'Content Type',
|
||||||
raw_input: "Raw input",
|
raw_input: 'Raw input',
|
||||||
parameter_list: "Parameter List",
|
parameter_list: 'Parameter List',
|
||||||
raw_request_body: "Raw Request Body",
|
raw_request_body: 'Raw Request Body',
|
||||||
show_code: "Show Code",
|
show_code: 'Show Code',
|
||||||
hide_code: "Hide Code",
|
hide_code: 'Hide Code',
|
||||||
show_prerequest_script: "Show Pre-Request Script",
|
show_prerequest_script: 'Show Pre-Request Script',
|
||||||
hide_prerequest_script: "Hide Pre-Request Script",
|
hide_prerequest_script: 'Hide Pre-Request Script',
|
||||||
authentication: "Authentication",
|
authentication: 'Authentication',
|
||||||
authentication_type: "Authentication type",
|
authentication_type: 'Authentication type',
|
||||||
include_in_url: "Include in URL",
|
include_in_url: 'Include in URL',
|
||||||
parameters: "Parameters",
|
parameters: 'Parameters',
|
||||||
expand_response: "Expand response",
|
expand_response: 'Expand response',
|
||||||
collapse_response: "Collapse response",
|
collapse_response: 'Collapse response',
|
||||||
hide_preview: "Hide Preview",
|
hide_preview: 'Hide Preview',
|
||||||
preview_html: "Preview HTML",
|
preview_html: 'Preview HTML',
|
||||||
history: "History",
|
history: 'History',
|
||||||
collections: "Collections",
|
collections: 'Collections',
|
||||||
environment: "Environment",
|
environment: 'Environment',
|
||||||
new_environment: "New Environment",
|
new_environment: 'New Environment',
|
||||||
my_new_environment: "My New Environment",
|
my_new_environment: 'My New Environment',
|
||||||
edit_environment: "Edit Environment",
|
edit_environment: 'Edit Environment',
|
||||||
env_variable_list: "Variable List",
|
env_variable_list: 'Variable List',
|
||||||
invalid_environment_name: "Please provide a valid name for the environment",
|
invalid_environment_name: 'Please provide a valid name for the environment',
|
||||||
use_environment: "Use Environment",
|
use_environment: 'Use Environment',
|
||||||
add_one_variable: "(add at least one variable)",
|
add_one_variable: '(add at least one variable)',
|
||||||
import_curl: "Import cURL",
|
import_curl: 'Import cURL',
|
||||||
import: "Import",
|
import: 'Import',
|
||||||
generate_code: "Generate code",
|
generate_code: 'Generate code',
|
||||||
request_type: "Request type",
|
request_type: 'Request type',
|
||||||
generated_code: "Generated code",
|
generated_code: 'Generated code',
|
||||||
status: "Status",
|
status: 'Status',
|
||||||
headers: "Headers",
|
headers: 'Headers',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(waiting for connection)",
|
waiting_for_connection: '(waiting for connection)',
|
||||||
message: "Message",
|
message: 'Message',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Server",
|
server: 'Server',
|
||||||
events: "Events",
|
events: 'Events',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Get schema",
|
get_schema: 'Get schema',
|
||||||
header_list: "Header list",
|
header_list: 'Header list',
|
||||||
add_new: "Add new",
|
add_new: 'Add new',
|
||||||
response: "Response",
|
response: 'Response',
|
||||||
query: "Query",
|
query: 'Query',
|
||||||
queries: "Queries",
|
queries: 'Queries',
|
||||||
query_variables: "Variables",
|
query_variables: 'Variables',
|
||||||
mutations: "Mutations",
|
mutations: 'Mutations',
|
||||||
subscriptions: "Subscriptions",
|
subscriptions: 'Subscriptions',
|
||||||
types: "Types",
|
types: 'Types',
|
||||||
send: "Send",
|
send: 'Send',
|
||||||
background: "Background",
|
background: 'Background',
|
||||||
color: "Color",
|
color: 'Color',
|
||||||
labels: "Labels",
|
labels: 'Labels',
|
||||||
multi_color: "Multi-color",
|
multi_color: 'Multi-color',
|
||||||
enabled: "Enabled",
|
enabled: 'Enabled',
|
||||||
disabled: "Disabled",
|
disabled: 'Disabled',
|
||||||
proxy: "Proxy",
|
proxy: 'Proxy',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: "Postwoman's Official Proxy is hosted by ApolloTV.",
|
||||||
"Postwoman's Official Proxy is hosted by ApolloTV.",
|
read_the: 'Read the',
|
||||||
read_the: "Read the",
|
apollotv_privacy_policy: 'ApolloTV privacy policy',
|
||||||
apollotv_privacy_policy: "ApolloTV privacy policy",
|
contact_us: 'Contact us',
|
||||||
contact_us: "Contact us",
|
connect: 'Connect',
|
||||||
connect: "Connect",
|
disconnect: 'Disconnect',
|
||||||
disconnect: "Disconnect",
|
start: 'Start',
|
||||||
start: "Start",
|
stop: 'Stop',
|
||||||
stop: "Stop",
|
access_token: 'Access Token',
|
||||||
access_token: "Access Token",
|
token_list: 'Token List',
|
||||||
token_list: "Token List",
|
get_token: 'Get New Token',
|
||||||
get_token: "Get New Token",
|
manage_token: 'Manage Access Token',
|
||||||
manage_token: "Manage Access Token",
|
save_token: 'Save Access Token',
|
||||||
save_token: "Save Access Token",
|
use_token: 'Use Saved Token',
|
||||||
use_token: "Use Saved Token",
|
request_token: 'Request Token',
|
||||||
request_token: "Request Token",
|
save_token_req: 'Save Token Request',
|
||||||
save_token_req: "Save Token Request",
|
manage_token_req: 'Manage Token Request',
|
||||||
manage_token_req: "Manage Token Request",
|
use_token_req: 'Use Token Request',
|
||||||
use_token_req: "Use Token Request",
|
token_req_name: 'Request Name',
|
||||||
token_req_name: "Request Name",
|
token_req_details: 'Request Details',
|
||||||
token_req_details: "Request Details",
|
token_name: 'Token Name',
|
||||||
token_name: "Token Name",
|
oidc_discovery_url: 'OIDC Discovery URL',
|
||||||
oidc_discovery_url: "OIDC Discovery URL",
|
auth_url: 'Auth URL',
|
||||||
auth_url: "Auth URL",
|
access_token_url: 'Access Token URL',
|
||||||
access_token_url: "Access Token URL",
|
client_id: 'Client ID',
|
||||||
client_id: "Client ID",
|
scope: 'Scope',
|
||||||
scope: "Scope",
|
state: 'State',
|
||||||
state: "State",
|
token_req_list: 'Token Request List',
|
||||||
token_req_list: "Token Request List",
|
no_path: 'No path',
|
||||||
no_path: "No path",
|
no_label: 'No label',
|
||||||
no_label: "No label",
|
prerequest_script: 'Pre-Request Script',
|
||||||
prerequest_script: "Pre-Request Script",
|
no_prerequest_script: 'No pre-request script',
|
||||||
no_prerequest_script: "No pre-request script",
|
search: 'Search',
|
||||||
search: "Search",
|
history_empty: 'History is empty',
|
||||||
history_empty: "History is empty",
|
history_deleted: 'History Deleted',
|
||||||
history_deleted: "History Deleted",
|
clear: 'Clear',
|
||||||
clear: "Clear",
|
clear_all: 'Clear All',
|
||||||
clear_all: "Clear All",
|
cleared: 'Cleared',
|
||||||
cleared: "Cleared",
|
close: 'Close',
|
||||||
close: "Close",
|
sort: 'Sort',
|
||||||
sort: "Sort",
|
time: 'Time',
|
||||||
time: "Time",
|
duration: 'Duration',
|
||||||
duration: "Duration",
|
no_duration: 'No duration',
|
||||||
no_duration: "No duration",
|
show_more: 'Show more',
|
||||||
show_more: "Show more",
|
hide_more: 'Hide more',
|
||||||
hide_more: "Hide more",
|
collection: 'Collection',
|
||||||
collection: "Collection",
|
current_collection: 'Current Collection',
|
||||||
current_collection: "Current Collection",
|
select_collection: 'Select a Collection',
|
||||||
select_collection: "Select a Collection",
|
create_collection: 'Create a Collection',
|
||||||
create_collection: "Create a Collection",
|
new: 'New',
|
||||||
new: "New",
|
import_export: 'Import / Export',
|
||||||
import_export: "Import / Export",
|
more: 'More',
|
||||||
more: "More",
|
folder: 'Folder',
|
||||||
folder: "Folder",
|
new_folder: 'New Folder',
|
||||||
new_folder: "New Folder",
|
my_new_folder: 'My New Folder',
|
||||||
my_new_folder: "My New Folder",
|
folder_empty: 'Folder is empty',
|
||||||
folder_empty: "Folder is empty",
|
edit_folder: 'Edit Folder',
|
||||||
edit_folder: "Edit Folder",
|
edit: 'Edit',
|
||||||
edit: "Edit",
|
delete: 'Delete',
|
||||||
delete: "Delete",
|
deleted: 'Deleted',
|
||||||
deleted: "Deleted",
|
undo: 'Undo',
|
||||||
undo: "Undo",
|
collection_empty: 'Collection is empty',
|
||||||
collection_empty: "Collection is empty",
|
invalid_collection_name: 'Please provide a valid name for the collection',
|
||||||
invalid_collection_name: "Please provide a valid name for the collection",
|
new_collection: 'New Collection',
|
||||||
new_collection: "New Collection",
|
my_new_collection: 'My New Collection',
|
||||||
my_new_collection: "My New Collection",
|
edit_collection: 'Edit Collection',
|
||||||
edit_collection: "Edit Collection",
|
edit_request: 'Edit Request',
|
||||||
edit_request: "Edit Request",
|
save_request_as: 'Save Request As',
|
||||||
save_request_as: "Save Request As",
|
export: 'Export',
|
||||||
export: "Export",
|
connecting_to: 'Connecting to {name}...',
|
||||||
connecting_to: "Connecting to {name}...",
|
connected: 'Connected',
|
||||||
connected: "Connected",
|
connected_to: 'Connected to {name}',
|
||||||
connected_to: "Connected to {name}",
|
disconnected: 'Disconnected',
|
||||||
disconnected: "Disconnected",
|
disconnected_from: 'Disconnected from {name}',
|
||||||
disconnected_from: "Disconnected from {name}",
|
something_went_wrong: 'Something went wrong!',
|
||||||
something_went_wrong: "Something went wrong!",
|
error_occurred: 'An error has occurred.',
|
||||||
error_occurred: "An error has occurred.",
|
browser_support_sse: "This browser doesn't seems to have Server Sent Events support.",
|
||||||
browser_support_sse:
|
log: 'Log',
|
||||||
"This browser doesn't seems to have Server Sent Events support.",
|
no_url: 'No URL',
|
||||||
log: "Log",
|
run_query: 'Run Query',
|
||||||
no_url: "No URL",
|
copy_query: 'Copy Query',
|
||||||
run_query: "Run Query",
|
kinda_dark: 'Kinda Dark',
|
||||||
copy_query: "Copy Query",
|
clearly_white: 'Clearly White',
|
||||||
kinda_dark: "Kinda Dark",
|
just_black: 'Just Black',
|
||||||
clearly_white: "Clearly White",
|
auto_system: 'Auto (system)',
|
||||||
just_black: "Just Black",
|
green: 'Green',
|
||||||
auto_system: "Auto (system)",
|
yellow: 'Yellow',
|
||||||
green: "Green",
|
pink: 'Pink',
|
||||||
yellow: "Yellow",
|
red: 'Red',
|
||||||
pink: "Pink",
|
purple: 'Purple',
|
||||||
red: "Red",
|
orange: 'Orange',
|
||||||
purple: "Purple",
|
cyan: 'Cyan',
|
||||||
orange: "Orange",
|
blue: 'Blue',
|
||||||
cyan: "Cyan",
|
loading: 'Loading...',
|
||||||
blue: "Blue",
|
fetching: 'Fetching...',
|
||||||
loading: "Loading...",
|
waiting_send_req: '(waiting to send request)',
|
||||||
fetching: "Fetching...",
|
cancel: 'Cancel',
|
||||||
waiting_send_req: "(waiting to send request)",
|
save: 'Save',
|
||||||
cancel: "Cancel",
|
dismiss: 'Dismiss',
|
||||||
save: "Save",
|
are_you_sure: 'Are you sure?',
|
||||||
dismiss: "Dismiss",
|
yes: 'Yes',
|
||||||
are_you_sure: "Are you sure?",
|
no: 'No',
|
||||||
yes: "Yes",
|
restore: 'Restore',
|
||||||
no: "No",
|
add_star: 'Add star',
|
||||||
restore: "Restore",
|
remove_star: 'Remove star',
|
||||||
add_star: "Add star",
|
nothing_found: 'Nothing found',
|
||||||
remove_star: "Remove star",
|
replace_current: 'Replace current',
|
||||||
nothing_found: "Nothing found",
|
replace_json: 'Replace with JSON',
|
||||||
replace_current: "Replace current",
|
preserve_current: 'Preserve current',
|
||||||
replace_json: "Replace with JSON",
|
import_json: 'Import from JSON',
|
||||||
preserve_current: "Preserve current",
|
download_file: 'Download file',
|
||||||
import_json: "Import from JSON",
|
upload_file: 'Upload file',
|
||||||
download_file: "Download file",
|
copy_response: 'Copy response',
|
||||||
upload_file: "Upload file",
|
copy_code: 'Copy code',
|
||||||
copy_response: "Copy response",
|
copy_schema: 'Copy Schema',
|
||||||
copy_code: "Copy code",
|
use_request: 'Use request',
|
||||||
copy_schema: "Copy Schema",
|
documentation: 'Documentation',
|
||||||
use_request: "Use request",
|
docs: 'Docs',
|
||||||
documentation: "Documentation",
|
reset_default: 'Reset to default',
|
||||||
docs: "Docs",
|
fields: 'FIELDS',
|
||||||
reset_default: "Reset to default",
|
deprecated: 'DEPRECATED',
|
||||||
fields: "FIELDS",
|
add_one_header: '(add at least one header)',
|
||||||
deprecated: "DEPRECATED",
|
add_one_parameter: '(add at least one parameter)',
|
||||||
add_one_header: "(add at least one header)",
|
header_count: 'header {count}',
|
||||||
add_one_parameter: "(add at least one parameter)",
|
parameter_count: 'parameter {count}',
|
||||||
header_count: "header {count}",
|
variable_count: 'variable {count}',
|
||||||
parameter_count: "parameter {count}",
|
value_count: 'value {count}',
|
||||||
variable_count: "variable {count}",
|
send_request_first: 'Send a request first',
|
||||||
value_count: "value {count}",
|
generate_docs: 'Generate Documentation',
|
||||||
send_request_first: "Send a request first",
|
generate_docs_message: 'Import any Postwoman Collection to Generate Documentation on-the-go.',
|
||||||
generate_docs: "Generate Documentation",
|
generate_docs_first: 'Generate documentation first',
|
||||||
generate_docs_message:
|
docs_generated: 'Documentation generated',
|
||||||
"Import any Postwoman Collection to Generate Documentation on-the-go.",
|
import_collections: 'Import collections',
|
||||||
generate_docs_first: "Generate documentation first",
|
optional: '(optional)',
|
||||||
docs_generated: "Documentation generated",
|
json: 'JSON',
|
||||||
import_collections: "Import collections",
|
none: 'None',
|
||||||
optional: "(optional)",
|
username: 'Username',
|
||||||
json: "JSON",
|
password: 'Password',
|
||||||
none: "None",
|
token: 'Token',
|
||||||
username: "Username",
|
payload: 'Payload',
|
||||||
password: "Password",
|
choose_file: 'Choose a file',
|
||||||
token: "Token",
|
file_imported: 'File imported',
|
||||||
payload: "Payload",
|
import_failed: 'Import failed',
|
||||||
choose_file: "Choose a file",
|
f12_details: '(F12 for details)',
|
||||||
file_imported: "File imported",
|
we_use_cookies: 'We use cookies',
|
||||||
import_failed: "Import failed",
|
copied_to_clipboard: 'Copied to clipboard',
|
||||||
f12_details: "(F12 for details)",
|
finished_in: 'Finished in {duration}ms',
|
||||||
we_use_cookies: "We use cookies",
|
check_console_details: 'Check console for details.',
|
||||||
copied_to_clipboard: "Copied to clipboard",
|
download_started: 'Download started',
|
||||||
finished_in: "Finished in {duration}ms",
|
url_invalid_format: 'URL is not formatted properly',
|
||||||
check_console_details: "Check console for details.",
|
curl_invalid_format: 'cURL is not formatted properly',
|
||||||
download_started: "Download started",
|
enable_proxy: 'Try enabling Proxy',
|
||||||
url_invalid_format: "URL is not formatted properly",
|
complete_config_urls: 'Please complete configuration urls.',
|
||||||
curl_invalid_format: "cURL is not formatted properly",
|
token_request_saved: 'Token request saved',
|
||||||
enable_proxy: "Try enabling Proxy",
|
|
||||||
complete_config_urls: "Please complete configuration urls.",
|
|
||||||
token_request_saved: "Token request saved",
|
|
||||||
donate_info1:
|
donate_info1:
|
||||||
"If you have enjoyed the productivity of using Postwoman, consider donating as a sign of appreciation.",
|
'If you have enjoyed the productivity of using Postwoman, consider donating as a sign of appreciation.',
|
||||||
donate_info2:
|
donate_info2: 'You can support Postwoman development via the following methods:',
|
||||||
"You can support Postwoman development via the following methods:",
|
one_time_recurring: 'One-time or recurring',
|
||||||
one_time_recurring: "One-time or recurring",
|
one_time: 'One-time',
|
||||||
one_time: "One-time",
|
recurring: 'Recurring',
|
||||||
recurring: "Recurring",
|
wiki: 'Wiki',
|
||||||
wiki: "Wiki",
|
error: 'Error',
|
||||||
error: "Error",
|
go_home: 'Go Home',
|
||||||
go_home: "Go Home",
|
reload: 'Reload',
|
||||||
reload: "Reload",
|
enter_curl: 'Enter cURL',
|
||||||
enter_curl: "Enter cURL",
|
empty: 'Empty',
|
||||||
empty: "Empty",
|
extensions: 'Extensions',
|
||||||
extensions: "Extensions",
|
extensions_use_toggle: 'Use the browser extension to send requests (if present)',
|
||||||
extensions_use_toggle:
|
extensions_info1: 'Browser extension that simplifies access to Postwoman',
|
||||||
"Use the browser extension to send requests (if present)",
|
extensions_info2: 'Get Postwoman browser extension!',
|
||||||
extensions_info1: "Browser extension that simplifies access to Postwoman",
|
installed: 'Installed',
|
||||||
extensions_info2: "Get Postwoman browser extension!",
|
login_with: 'Login with',
|
||||||
installed: "Installed",
|
logged_out: 'Logged out',
|
||||||
login_with: "Login with",
|
logout: 'Logout',
|
||||||
logged_out: "Logged out",
|
account: 'Account',
|
||||||
logout: "Logout",
|
scrollInto_use_toggle: 'Auto scroll',
|
||||||
account: "Account",
|
sync: 'Sync',
|
||||||
scrollInto_use_toggle: "Auto scroll",
|
syncHistory: 'History',
|
||||||
sync: "Sync",
|
syncCollections: 'Collections',
|
||||||
syncHistory: "History",
|
syncEnvironments: 'Environments',
|
||||||
syncCollections: "Collections",
|
turn_on: 'Turn on',
|
||||||
syncEnvironments: "Environments",
|
login_first: 'Login first',
|
||||||
turn_on: "Turn on",
|
paste_a_note: 'Paste a note',
|
||||||
login_first: "Login first",
|
import_from_sync: 'Import from Sync',
|
||||||
paste_a_note: "Paste a note",
|
notes: 'Notes',
|
||||||
import_from_sync: "Import from Sync",
|
}
|
||||||
notes: "Notes"
|
|
||||||
};
|
|
||||||
|
|||||||
518
lang/es-ES.js
518
lang/es-ES.js
@@ -1,264 +1,262 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Inicio",
|
home: 'Inicio',
|
||||||
realtime: "Tiempo real",
|
realtime: 'Tiempo real',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Ajustes",
|
settings: 'Ajustes',
|
||||||
request: "Petición",
|
request: 'Petición',
|
||||||
install_pwa: "Instalar PWA",
|
install_pwa: 'Instalar PWA',
|
||||||
support_us: "Ayúdanos",
|
support_us: 'Ayúdanos',
|
||||||
tweet: "Tweet",
|
tweet: 'Tweet',
|
||||||
options: "Opciones",
|
options: 'Opciones',
|
||||||
communication: "Comunicación",
|
communication: 'Comunicación',
|
||||||
endpoint: "Endpoint",
|
endpoint: 'Endpoint',
|
||||||
schema: "Esquema",
|
schema: 'Esquema',
|
||||||
theme: "Tema",
|
theme: 'Tema',
|
||||||
subscribe: "Subscribirse",
|
subscribe: 'Subscribirse',
|
||||||
choose_language: "Seleccione un idioma",
|
choose_language: 'Seleccione un idioma',
|
||||||
shortcuts: "Atajos",
|
shortcuts: 'Atajos',
|
||||||
send_request: "Enviar petición",
|
send_request: 'Enviar petición',
|
||||||
save_to_collections: "Guardar en las Colecciones",
|
save_to_collections: 'Guardar en las Colecciones',
|
||||||
copy_request_link: "Copiar enlace de la petición",
|
copy_request_link: 'Copiar enlace de la petición',
|
||||||
reset_request: "Reiniciar Petición",
|
reset_request: 'Reiniciar Petición',
|
||||||
support_us_on: "Ayúdanos en",
|
support_us_on: 'Ayúdanos en',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "Código JavaScript",
|
javascript_code: 'Código JavaScript',
|
||||||
method: "Método",
|
method: 'Método',
|
||||||
path: "Ruta",
|
path: 'Ruta',
|
||||||
label: "Etiqueta",
|
label: 'Etiqueta',
|
||||||
again: "De nuevo",
|
again: 'De nuevo',
|
||||||
content_type: "Tipo de Contenido",
|
content_type: 'Tipo de Contenido',
|
||||||
raw_input: "Datos sin Procesar",
|
raw_input: 'Datos sin Procesar',
|
||||||
parameter_list: "Lista de Parámetros",
|
parameter_list: 'Lista de Parámetros',
|
||||||
raw_request_body: "Cuerpo de la Solicitud sin Procesar",
|
raw_request_body: 'Cuerpo de la Solicitud sin Procesar',
|
||||||
show_code: "Mostrar el código",
|
show_code: 'Mostrar el código',
|
||||||
hide_code: "Ocultar el código",
|
hide_code: 'Ocultar el código',
|
||||||
show_prerequest_script: "Mostrar Script pre solicitud",
|
show_prerequest_script: 'Mostrar Script pre solicitud',
|
||||||
hide_prerequest_script: "Ocultar Script pre solicitud",
|
hide_prerequest_script: 'Ocultar Script pre solicitud',
|
||||||
authentication: "Autenticación",
|
authentication: 'Autenticación',
|
||||||
authentication_type: "Tipo de autenticación",
|
authentication_type: 'Tipo de autenticación',
|
||||||
include_in_url: "Incluir en el URL",
|
include_in_url: 'Incluir en el URL',
|
||||||
parameters: "Parámetros",
|
parameters: 'Parámetros',
|
||||||
expand_response: "Ampliar Respuesta",
|
expand_response: 'Ampliar Respuesta',
|
||||||
collapse_response: "Contraer Respuesta",
|
collapse_response: 'Contraer Respuesta',
|
||||||
hide_preview: "Ocultar la vista previa",
|
hide_preview: 'Ocultar la vista previa',
|
||||||
preview_html: "Vista Previa del HTML",
|
preview_html: 'Vista Previa del HTML',
|
||||||
history: "Historial",
|
history: 'Historial',
|
||||||
collections: "Colecciones",
|
collections: 'Colecciones',
|
||||||
import_curl: "Importar cURL",
|
import_curl: 'Importar cURL',
|
||||||
import: "Importar",
|
import: 'Importar',
|
||||||
generate_code: "Generar código",
|
generate_code: 'Generar código',
|
||||||
request_type: "Tipo de Petición",
|
request_type: 'Tipo de Petición',
|
||||||
generated_code: "Código Generado",
|
generated_code: 'Código Generado',
|
||||||
status: "Estado",
|
status: 'Estado',
|
||||||
headers: "Cabeceras",
|
headers: 'Cabeceras',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(esperando por conexión)",
|
waiting_for_connection: '(esperando por conexión)',
|
||||||
message: "Mensaje",
|
message: 'Mensaje',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Servidor",
|
server: 'Servidor',
|
||||||
events: "Eventos",
|
events: 'Eventos',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Obtener esquema",
|
get_schema: 'Obtener esquema',
|
||||||
header_list: "Lista de Cabeceras",
|
header_list: 'Lista de Cabeceras',
|
||||||
add_new: "Agregar nuevo",
|
add_new: 'Agregar nuevo',
|
||||||
response: "Respuesta",
|
response: 'Respuesta',
|
||||||
query: "Consulta",
|
query: 'Consulta',
|
||||||
queries: "Consultas",
|
queries: 'Consultas',
|
||||||
query_variables: "Variables",
|
query_variables: 'Variables',
|
||||||
mutations: "Mutaciones",
|
mutations: 'Mutaciones',
|
||||||
subscriptions: "Subscripciones",
|
subscriptions: 'Subscripciones',
|
||||||
types: "Tipos",
|
types: 'Tipos',
|
||||||
send: "Enviar",
|
send: 'Enviar',
|
||||||
background: "Fondo",
|
background: 'Fondo',
|
||||||
color: "Color",
|
color: 'Color',
|
||||||
labels: "Etiquetas",
|
labels: 'Etiquetas',
|
||||||
multi_color: "Multicolor",
|
multi_color: 'Multicolor',
|
||||||
enabled: "Habilitado",
|
enabled: 'Habilitado',
|
||||||
disabled: "Deshabilitado",
|
disabled: 'Deshabilitado',
|
||||||
proxy: "Proxy",
|
proxy: 'Proxy',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: 'Proxy Oficial de Postwoman está hospedado en ApolloTV.',
|
||||||
"Proxy Oficial de Postwoman está hospedado en ApolloTV.",
|
read_the: 'Leer la',
|
||||||
read_the: "Leer la",
|
apollotv_privacy_policy: 'Política de Privacidad de ApolloTV',
|
||||||
apollotv_privacy_policy: "Política de Privacidad de ApolloTV",
|
contact_us: 'Contáctenos',
|
||||||
contact_us: "Contáctenos",
|
connect: 'Conectar',
|
||||||
connect: "Conectar",
|
disconnect: 'Desconectar',
|
||||||
disconnect: "Desconectar",
|
start: 'Comienzo',
|
||||||
start: "Comienzo",
|
stop: 'Detener',
|
||||||
stop: "Detener",
|
access_token: 'Token de acceso',
|
||||||
access_token: "Token de acceso",
|
token_list: 'Lista de token',
|
||||||
token_list: "Lista de token",
|
get_token: 'Obtener un nuevo token',
|
||||||
get_token: "Obtener un nuevo token",
|
manage_token: 'Gestionar el token de acceso',
|
||||||
manage_token: "Gestionar el token de acceso",
|
save_token: 'Guardar el token de acceso',
|
||||||
save_token: "Guardar el token de acceso",
|
use_token: 'Usar token guardado',
|
||||||
use_token: "Usar token guardado",
|
request_token: 'Petición del token',
|
||||||
request_token: "Petición del token",
|
save_token_req: 'Guardar la petición del token',
|
||||||
save_token_req: "Guardar la petición del token",
|
manage_token_req: 'Gestionar la petición del token',
|
||||||
manage_token_req: "Gestionar la petición del token",
|
use_token_req: 'Usar el token de la petición',
|
||||||
use_token_req: "Usar el token de la petición",
|
token_req_name: 'Nombre de la petición',
|
||||||
token_req_name: "Nombre de la petición",
|
token_req_details: 'Petición de detalles',
|
||||||
token_req_details: "Petición de detalles",
|
token_name: 'Nombre del token',
|
||||||
token_name: "Nombre del token",
|
oidc_discovery_url: 'URL de descubrimiento de OIDC',
|
||||||
oidc_discovery_url: "URL de descubrimiento de OIDC",
|
auth_url: 'URL de autenticación',
|
||||||
auth_url: "URL de autenticación",
|
access_token_url: 'URL de token de acceso',
|
||||||
access_token_url: "URL de token de acceso",
|
client_id: 'ID del cliente',
|
||||||
client_id: "ID del cliente",
|
scope: 'Alcance',
|
||||||
scope: "Alcance",
|
state: 'Estado',
|
||||||
state: "Estado",
|
token_req_list: 'Lista de solicitud de token',
|
||||||
token_req_list: "Lista de solicitud de token",
|
no_path: 'Sin ruta',
|
||||||
no_path: "Sin ruta",
|
no_label: 'Sin etiqueta',
|
||||||
no_label: "Sin etiqueta",
|
prerequest_script: 'Pre-Request Script',
|
||||||
prerequest_script: "Pre-Request Script",
|
no_prerequest_script: 'Script sin pre-requisito',
|
||||||
no_prerequest_script: "Script sin pre-requisito",
|
search: 'buscar historial',
|
||||||
search: "buscar historial",
|
history_empty: 'Historial vacío',
|
||||||
history_empty: "Historial vacío",
|
history_deleted: 'Historial borrado',
|
||||||
history_deleted: "Historial borrado",
|
clear: 'Limpiar',
|
||||||
clear: "Limpiar",
|
clear_all: 'Limpiar todo',
|
||||||
clear_all: "Limpiar todo",
|
cleared: 'Limpiado',
|
||||||
cleared: "Limpiado",
|
close: 'Cerrar',
|
||||||
close: "Cerrar",
|
sort: 'Ordenar',
|
||||||
sort: "Ordenar",
|
time: 'Tiempo',
|
||||||
time: "Tiempo",
|
duration: 'Duración',
|
||||||
duration: "Duración",
|
no_duration: 'Sin duración',
|
||||||
no_duration: "Sin duración",
|
show_more: 'Mostrar más',
|
||||||
show_more: "Mostrar más",
|
hide_more: 'Ocultar más',
|
||||||
hide_more: "Ocultar más",
|
collection: 'Colección',
|
||||||
collection: "Colección",
|
current_collection: 'Actual colección',
|
||||||
current_collection: "Actual colección",
|
select_collection: 'Seleccionar una colección',
|
||||||
select_collection: "Seleccionar una colección",
|
create_collection: 'Crear una colección',
|
||||||
create_collection: "Crear una colección",
|
new: 'Nuevo',
|
||||||
new: "Nuevo",
|
import_export: 'Importar / Exportar',
|
||||||
import_export: "Importar / Exportar",
|
more: 'Más',
|
||||||
more: "Más",
|
folder: 'Directorio',
|
||||||
folder: "Directorio",
|
new_folder: 'Nuevo directorio',
|
||||||
new_folder: "Nuevo directorio",
|
my_new_folder: 'Mi nuevo directorio',
|
||||||
my_new_folder: "Mi nuevo directorio",
|
folder_empty: 'Directorio vacío',
|
||||||
folder_empty: "Directorio vacío",
|
edit_folder: 'Editar directorio',
|
||||||
edit_folder: "Editar directorio",
|
edit: 'Editar',
|
||||||
edit: "Editar",
|
delete: 'Borrar',
|
||||||
delete: "Borrar",
|
deleted: 'Borrado',
|
||||||
deleted: "Borrado",
|
undo: 'Deshacer',
|
||||||
undo: "Deshacer",
|
collection_empty: 'Colección vacía',
|
||||||
collection_empty: "Colección vacía",
|
new_collection: 'Nueva colección',
|
||||||
new_collection: "Nueva colección",
|
my_new_collection: 'Mi nueva colección',
|
||||||
my_new_collection: "Mi nueva colección",
|
edit_collection: 'Editar colección',
|
||||||
edit_collection: "Editar colección",
|
edit_request: 'Editar petición',
|
||||||
edit_request: "Editar petición",
|
save_request_as: 'Guardar petición como',
|
||||||
save_request_as: "Guardar petición como",
|
export: 'Exportar',
|
||||||
export: "Exportar",
|
connecting_to: 'Conectando a {name}...',
|
||||||
connecting_to: "Conectando a {name}...",
|
connected: 'Conectado',
|
||||||
connected: "Conectado",
|
connected_to: 'Conectado a {name}',
|
||||||
connected_to: "Conectado a {name}",
|
disconnected: 'Desconectado',
|
||||||
disconnected: "Desconectado",
|
disconnected_from: 'Desconectado desde {name}',
|
||||||
disconnected_from: "Desconectado desde {name}",
|
something_went_wrong: 'Algo ha salido mal!',
|
||||||
something_went_wrong: "Algo ha salido mal!",
|
error_occurred: 'Ha ocurrido un error.',
|
||||||
error_occurred: "Ha ocurrido un error.",
|
|
||||||
browser_support_sse:
|
browser_support_sse:
|
||||||
"Este navegador parace no tener soporte a los eventos enviados desde el servidor.",
|
'Este navegador parace no tener soporte a los eventos enviados desde el servidor.',
|
||||||
log: "Bitácora",
|
log: 'Bitácora',
|
||||||
no_url: "Sin URL",
|
no_url: 'Sin URL',
|
||||||
run_query: "Ejecutar consulta",
|
run_query: 'Ejecutar consulta',
|
||||||
copy_query: "Copiar consulta",
|
copy_query: 'Copiar consulta',
|
||||||
kinda_dark: "Un poco oscúro",
|
kinda_dark: 'Un poco oscúro',
|
||||||
clearly_white: "Claramento blanco",
|
clearly_white: 'Claramento blanco',
|
||||||
just_black: "Solo Negro",
|
just_black: 'Solo Negro',
|
||||||
auto_system: "Autenticación (sistema)",
|
auto_system: 'Autenticación (sistema)',
|
||||||
green: "Verde",
|
green: 'Verde',
|
||||||
yellow: "Amarillo",
|
yellow: 'Amarillo',
|
||||||
pink: "Rosado",
|
pink: 'Rosado',
|
||||||
red: "Rojo",
|
red: 'Rojo',
|
||||||
purple: "Púrpura",
|
purple: 'Púrpura',
|
||||||
orange: "Anaranjado",
|
orange: 'Anaranjado',
|
||||||
cyan: "Cian",
|
cyan: 'Cian',
|
||||||
blue: "Azul",
|
blue: 'Azul',
|
||||||
loading: "Cargando...",
|
loading: 'Cargando...',
|
||||||
fetching: "Recuperando...",
|
fetching: 'Recuperando...',
|
||||||
waiting_send_req: "(esperando para enviar la petición)",
|
waiting_send_req: '(esperando para enviar la petición)',
|
||||||
cancel: "Cancelar",
|
cancel: 'Cancelar',
|
||||||
save: "Guardar",
|
save: 'Guardar',
|
||||||
dismiss: "Descartar",
|
dismiss: 'Descartar',
|
||||||
are_you_sure: "Está seguro?",
|
are_you_sure: 'Está seguro?',
|
||||||
yes: "Sí",
|
yes: 'Sí',
|
||||||
no: "No",
|
no: 'No',
|
||||||
restore: "Restaurar",
|
restore: 'Restaurar',
|
||||||
add_star: "Agregar estrella",
|
add_star: 'Agregar estrella',
|
||||||
remove_star: "Eliminar estrella",
|
remove_star: 'Eliminar estrella',
|
||||||
nothing_found: "No se encontró nada",
|
nothing_found: 'No se encontró nada',
|
||||||
replace_current: "Reemplaza el actual",
|
replace_current: 'Reemplaza el actual',
|
||||||
replace_json: "Reemplazar con JSON",
|
replace_json: 'Reemplazar con JSON',
|
||||||
preserve_current: "Preservar el actual",
|
preserve_current: 'Preservar el actual',
|
||||||
import_json: "Importar desde JSON",
|
import_json: 'Importar desde JSON',
|
||||||
download_file: "Descargar archivo",
|
download_file: 'Descargar archivo',
|
||||||
upload_file: "Cargar archivo",
|
upload_file: 'Cargar archivo',
|
||||||
copy_response: "Copiar respuesta",
|
copy_response: 'Copiar respuesta',
|
||||||
copy_code: "Copiar codigo",
|
copy_code: 'Copiar codigo',
|
||||||
copy_schema: "Copiar Esquema",
|
copy_schema: 'Copiar Esquema',
|
||||||
use_request: "Usar la petición",
|
use_request: 'Usar la petición',
|
||||||
documentation: "Documentación",
|
documentation: 'Documentación',
|
||||||
docs: "Documentos",
|
docs: 'Documentos',
|
||||||
reset_default: "Reiniciar valores por defecto",
|
reset_default: 'Reiniciar valores por defecto',
|
||||||
fields: "CAMPOS",
|
fields: 'CAMPOS',
|
||||||
deprecated: "OBSOLETO",
|
deprecated: 'OBSOLETO',
|
||||||
add_one_header: "(agregar al menos una cabecera)",
|
add_one_header: '(agregar al menos una cabecera)',
|
||||||
add_one_parameter: "(agregar al menos un parámetro)",
|
add_one_parameter: '(agregar al menos un parámetro)',
|
||||||
header_count: "cabecera {count}",
|
header_count: 'cabecera {count}',
|
||||||
parameter_count: "parámetro {count}",
|
parameter_count: 'parámetro {count}',
|
||||||
variable_count: "variable {count}",
|
variable_count: 'variable {count}',
|
||||||
value_count: "valor {count}",
|
value_count: 'valor {count}',
|
||||||
send_request_first: "Enviar primero la petición",
|
send_request_first: 'Enviar primero la petición',
|
||||||
generate_docs: "Generar la Documentación",
|
generate_docs: 'Generar la Documentación',
|
||||||
generate_docs_message:
|
generate_docs_message:
|
||||||
"Importar cualquier Colección de Postwoman para Generar la Documentación sobre la marcha.",
|
'Importar cualquier Colección de Postwoman para Generar la Documentación sobre la marcha.',
|
||||||
generate_docs_first: "Generar primero la documentación",
|
generate_docs_first: 'Generar primero la documentación',
|
||||||
docs_generated: "Documentación generada",
|
docs_generated: 'Documentación generada',
|
||||||
import_collections: "Importar colecciones",
|
import_collections: 'Importar colecciones',
|
||||||
optional: "(opcional)",
|
optional: '(opcional)',
|
||||||
json: "JSON",
|
json: 'JSON',
|
||||||
none: "Nada",
|
none: 'Nada',
|
||||||
username: "Nombre de usuario",
|
username: 'Nombre de usuario',
|
||||||
password: "Contrasaeña",
|
password: 'Contrasaeña',
|
||||||
token: "Token",
|
token: 'Token',
|
||||||
payload: "Carga",
|
payload: 'Carga',
|
||||||
choose_file: "Seleccione un archivo",
|
choose_file: 'Seleccione un archivo',
|
||||||
file_imported: "Archivo imporado",
|
file_imported: 'Archivo imporado',
|
||||||
f12_details: "(F12 para ver detalles)",
|
f12_details: '(F12 para ver detalles)',
|
||||||
we_use_cookies: "Usamos las cookies",
|
we_use_cookies: 'Usamos las cookies',
|
||||||
copied_to_clipboard: "Copiado al portapapeles",
|
copied_to_clipboard: 'Copiado al portapapeles',
|
||||||
finished_in: "Terminado en {duration}ms",
|
finished_in: 'Terminado en {duration}ms',
|
||||||
check_console_details: "Verifique la consola para más detalles.",
|
check_console_details: 'Verifique la consola para más detalles.',
|
||||||
download_started: "Inició la descarga",
|
download_started: 'Inició la descarga',
|
||||||
url_invalid_format: "La URL no está formateado apropiadamente",
|
url_invalid_format: 'La URL no está formateado apropiadamente',
|
||||||
curl_invalid_format: "El cURL no está formateado apropiadamente",
|
curl_invalid_format: 'El cURL no está formateado apropiadamente',
|
||||||
enable_proxy: "Pruebe habilitando el Proxy",
|
enable_proxy: 'Pruebe habilitando el Proxy',
|
||||||
complete_config_urls: "Por favor, termine la configuración de las urls.",
|
complete_config_urls: 'Por favor, termine la configuración de las urls.',
|
||||||
token_request_saved: "La petición de tToken ha sido guardada",
|
token_request_saved: 'La petición de tToken ha sido guardada',
|
||||||
donate_info1:
|
donate_info1:
|
||||||
"Si le ha gustado su productividad usando Postwoman, considere hacer una donación como un signo de su apreciación.",
|
'Si le ha gustado su productividad usando Postwoman, considere hacer una donación como un signo de su apreciación.',
|
||||||
donate_info2:
|
donate_info2: 'Puede ayudar al desarrollo de Postwoman mediante los siguientes métodos:',
|
||||||
"Puede ayudar al desarrollo de Postwoman mediante los siguientes métodos:",
|
one_time_recurring: 'Una vez o recurrente',
|
||||||
one_time_recurring: "Una vez o recurrente",
|
one_time: 'Una vez',
|
||||||
one_time: "Una vez",
|
recurring: 'Recurrente',
|
||||||
recurring: "Recurrente",
|
wiki: 'Wiki',
|
||||||
wiki: "Wiki",
|
error: 'Error',
|
||||||
error: "Error",
|
go_home: 'Ir al inicio',
|
||||||
go_home: "Ir al inicio",
|
reload: 'Recargar',
|
||||||
reload: "Recargar",
|
enter_curl: 'Intruduzca cURL',
|
||||||
enter_curl: "Intruduzca cURL",
|
empty: 'Vacío',
|
||||||
empty: "Vacío",
|
extensions: 'Extensiones',
|
||||||
extensions: "Extensiones",
|
extensions_info1: 'Extensión del navegador que simplifica el acceso a Postwoman',
|
||||||
extensions_info1: "Extensión del navegador que simplifica el acceso a Postwoman",
|
extensions_info2: 'Obtener la extensión del navegador de Postwoman!',
|
||||||
extensions_info2: "Obtener la extensión del navegador de Postwoman!",
|
installed: 'Instalado',
|
||||||
installed: "Instalado",
|
login_with: 'Iniciar sesión con',
|
||||||
login_with: "Iniciar sesión con",
|
logged_out: 'Sesión cerreda',
|
||||||
logged_out: "Sesión cerreda",
|
logout: 'Cerrar sesión',
|
||||||
logout: "Cerrar sesión",
|
account: 'Cuenta',
|
||||||
account: "Cuenta",
|
sync: 'Sync',
|
||||||
sync: "Sync",
|
syncHistory: 'Historial',
|
||||||
syncHistory: "Historial",
|
syncCollections: 'Colecciones',
|
||||||
syncCollections: "Colecciones",
|
turn_on: 'Encender',
|
||||||
turn_on: "Encender",
|
login_first: 'Inicie sesión primero',
|
||||||
login_first: "Inicie sesión primero",
|
paste_a_collection: 'Pegar una Colección',
|
||||||
paste_a_collection: "Pegar una Colección",
|
import_from_sync: 'Importar desde Sync',
|
||||||
import_from_sync: "Importar desde Sync"
|
}
|
||||||
};
|
|
||||||
|
|||||||
177
lang/fa-IR.js
177
lang/fa-IR.js
@@ -1,90 +1,89 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "خانه",
|
home: 'خانه',
|
||||||
realtime: "بلادرنگ",
|
realtime: 'بلادرنگ',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "تنظیمات",
|
settings: 'تنظیمات',
|
||||||
request: "درخواست",
|
request: 'درخواست',
|
||||||
install_pwa: "نصب PWA",
|
install_pwa: 'نصب PWA',
|
||||||
support_us: "از ما حمایت کنید",
|
support_us: 'از ما حمایت کنید',
|
||||||
tweet: "Tweet",
|
tweet: 'Tweet',
|
||||||
options: "گزینهها",
|
options: 'گزینهها',
|
||||||
communication: "ارتباط",
|
communication: 'ارتباط',
|
||||||
endpoint: "Endpoint",
|
endpoint: 'Endpoint',
|
||||||
schema: "Schema",
|
schema: 'Schema',
|
||||||
theme: "پوسته",
|
theme: 'پوسته',
|
||||||
subscribe: "اشتراک",
|
subscribe: 'اشتراک',
|
||||||
choose_language: "تغییر زبان",
|
choose_language: 'تغییر زبان',
|
||||||
shortcuts: "میانبرها",
|
shortcuts: 'میانبرها',
|
||||||
send_request: "ارسال درخواست",
|
send_request: 'ارسال درخواست',
|
||||||
save_to_collections: "ذخیره در کلکسیون",
|
save_to_collections: 'ذخیره در کلکسیون',
|
||||||
copy_request_link: "کپی لینک درخواست",
|
copy_request_link: 'کپی لینک درخواست',
|
||||||
reset_request: "بازنشانی درخواست",
|
reset_request: 'بازنشانی درخواست',
|
||||||
support_us_on: "حمایت از ما از طریق",
|
support_us_on: 'حمایت از ما از طریق',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "کد JavaScript",
|
javascript_code: 'کد JavaScript',
|
||||||
method: "متد",
|
method: 'متد',
|
||||||
path: "مسیر",
|
path: 'مسیر',
|
||||||
label: "برچسب",
|
label: 'برچسب',
|
||||||
again: "دوباره",
|
again: 'دوباره',
|
||||||
content_type: "Content Type",
|
content_type: 'Content Type',
|
||||||
raw_input: "ورودی raw",
|
raw_input: 'ورودی raw',
|
||||||
parameter_list: "لیست پارامترها",
|
parameter_list: 'لیست پارامترها',
|
||||||
raw_request_body: "Raw Request Body",
|
raw_request_body: 'Raw Request Body',
|
||||||
show_code: "نمایش کد",
|
show_code: 'نمایش کد',
|
||||||
hide_code: "عدم نمایش کد",
|
hide_code: 'عدم نمایش کد',
|
||||||
show_prerequest_script: "Show Pre-Request Script",
|
show_prerequest_script: 'Show Pre-Request Script',
|
||||||
hide_prerequest_script: "Hide Pre-Request Script",
|
hide_prerequest_script: 'Hide Pre-Request Script',
|
||||||
authentication: "Authentication",
|
authentication: 'Authentication',
|
||||||
authentication_type: "Authentication type",
|
authentication_type: 'Authentication type',
|
||||||
include_in_url: "در URL گنجانده شود",
|
include_in_url: 'در URL گنجانده شود',
|
||||||
parameters: "پارامترها",
|
parameters: 'پارامترها',
|
||||||
expand_response: "نمایش کامل پاسخ",
|
expand_response: 'نمایش کامل پاسخ',
|
||||||
collapse_response: "نمایش مختصر پاسخ",
|
collapse_response: 'نمایش مختصر پاسخ',
|
||||||
hide_preview: "مخفی کردن نمایش",
|
hide_preview: 'مخفی کردن نمایش',
|
||||||
preview_html: "نمایش HTML",
|
preview_html: 'نمایش HTML',
|
||||||
history: "تاریخچه",
|
history: 'تاریخچه',
|
||||||
collections: "کلکسیون",
|
collections: 'کلکسیون',
|
||||||
import_curl: "وارد کردن cURL",
|
import_curl: 'وارد کردن cURL',
|
||||||
import: "وارد کردن",
|
import: 'وارد کردن',
|
||||||
generate_code: "تولید کد",
|
generate_code: 'تولید کد',
|
||||||
request_type: "Request type",
|
request_type: 'Request type',
|
||||||
generated_code: "کد تولید شده",
|
generated_code: 'کد تولید شده',
|
||||||
status: "Status",
|
status: 'Status',
|
||||||
headers: "Headers",
|
headers: 'Headers',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(منتظر برقراری اتصال)",
|
waiting_for_connection: '(منتظر برقراری اتصال)',
|
||||||
message: "پیام",
|
message: 'پیام',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "سرور",
|
server: 'سرور',
|
||||||
events: "رویداد",
|
events: 'رویداد',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "دریافت Schema",
|
get_schema: 'دریافت Schema',
|
||||||
header_list: "لیست Header",
|
header_list: 'لیست Header',
|
||||||
add_new: "افزودن",
|
add_new: 'افزودن',
|
||||||
response: "Response",
|
response: 'Response',
|
||||||
query: "Query",
|
query: 'Query',
|
||||||
queries: "Queries",
|
queries: 'Queries',
|
||||||
query_variables: "Variables",
|
query_variables: 'Variables',
|
||||||
mutations: "Mutations",
|
mutations: 'Mutations',
|
||||||
subscriptions: "Subscriptions",
|
subscriptions: 'Subscriptions',
|
||||||
types: "Types",
|
types: 'Types',
|
||||||
send: "ارسال",
|
send: 'ارسال',
|
||||||
background: "پس زمینه",
|
background: 'پس زمینه',
|
||||||
color: "رنگ",
|
color: 'رنگ',
|
||||||
labels: "برچسبها",
|
labels: 'برچسبها',
|
||||||
multi_color: "چند رنگی",
|
multi_color: 'چند رنگی',
|
||||||
enabled: "فعال",
|
enabled: 'فعال',
|
||||||
disabled: "غیر فعال",
|
disabled: 'غیر فعال',
|
||||||
proxy: "پراکسی",
|
proxy: 'پراکسی',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: 'پراکسی Postwoman برروی هاست ApolloTV قرار دارد.',
|
||||||
"پراکسی Postwoman برروی هاست ApolloTV قرار دارد.",
|
read_the: 'بخوانید',
|
||||||
read_the: "بخوانید",
|
apollotv_privacy_policy: 'خط مشی رازداری ApolloTV',
|
||||||
apollotv_privacy_policy: "خط مشی رازداری ApolloTV",
|
contact_us: 'Contact us',
|
||||||
contact_us: "Contact us",
|
connect: 'Connect',
|
||||||
connect: "Connect",
|
disconnect: 'Disconnect',
|
||||||
disconnect: "Disconnect",
|
start: 'Start',
|
||||||
start: "Start",
|
stop: 'Stop',
|
||||||
stop: "Stop"
|
}
|
||||||
};
|
|
||||||
|
|||||||
466
lang/fr-FR.js
466
lang/fr-FR.js
@@ -1,264 +1,262 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Accueil",
|
home: 'Accueil',
|
||||||
realtime: "Temps réel",
|
realtime: 'Temps réel',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Paramètres",
|
settings: 'Paramètres',
|
||||||
request: "Request",
|
request: 'Request',
|
||||||
install_pwa: "Installer la PWA",
|
install_pwa: 'Installer la PWA',
|
||||||
support_us: "Nous supporter",
|
support_us: 'Nous supporter',
|
||||||
tweet: "Tweeter",
|
tweet: 'Tweeter',
|
||||||
options: "Options",
|
options: 'Options',
|
||||||
communication: "Communication",
|
communication: 'Communication',
|
||||||
endpoint: "Endpoint",
|
endpoint: 'Endpoint',
|
||||||
schema: "Schéma",
|
schema: 'Schéma',
|
||||||
theme: "Thème",
|
theme: 'Thème',
|
||||||
subscribe: "S'inscrire",
|
subscribe: "S'inscrire",
|
||||||
choose_language: "Sélectionner une langue",
|
choose_language: 'Sélectionner une langue',
|
||||||
shortcuts: "Raccourcis",
|
shortcuts: 'Raccourcis',
|
||||||
send_request: "Envoyer la requête",
|
send_request: 'Envoyer la requête',
|
||||||
save_to_collections: "Sauvegarder dans les collections",
|
save_to_collections: 'Sauvegarder dans les collections',
|
||||||
copy_request_link: "Copier le lien de la requête",
|
copy_request_link: 'Copier le lien de la requête',
|
||||||
reset_request: "Réinitialiser la requête",
|
reset_request: 'Réinitialiser la requête',
|
||||||
support_us_on: "Supportez-nous sur",
|
support_us_on: 'Supportez-nous sur',
|
||||||
open_collective: "Ouvrir Collective",
|
open_collective: 'Ouvrir Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "Code JavaScript",
|
javascript_code: 'Code JavaScript',
|
||||||
method: "Méthode",
|
method: 'Méthode',
|
||||||
path: "Chemin d'accès",
|
path: "Chemin d'accès",
|
||||||
label: "Libellé",
|
label: 'Libellé',
|
||||||
again: "Réessayer",
|
again: 'Réessayer',
|
||||||
content_type: "Type de contenu",
|
content_type: 'Type de contenu',
|
||||||
raw_input: "Texte brut",
|
raw_input: 'Texte brut',
|
||||||
parameter_list: "Liste des paramètres",
|
parameter_list: 'Liste des paramètres',
|
||||||
raw_request_body: "Corps de la requête en texte brut",
|
raw_request_body: 'Corps de la requête en texte brut',
|
||||||
show_code: "Afficher le code",
|
show_code: 'Afficher le code',
|
||||||
hide_code: "Masquer le code",
|
hide_code: 'Masquer le code',
|
||||||
show_prerequest_script: "Afficher le script de pré-requête",
|
show_prerequest_script: 'Afficher le script de pré-requête',
|
||||||
hide_prerequest_script: "Masquer le script de pré-requête",
|
hide_prerequest_script: 'Masquer le script de pré-requête',
|
||||||
authentication: "Authentification",
|
authentication: 'Authentification',
|
||||||
authentication_type: "Type d'authentification",
|
authentication_type: "Type d'authentification",
|
||||||
include_in_url: "Inclure dans l'URL",
|
include_in_url: "Inclure dans l'URL",
|
||||||
parameters: "Paramètres",
|
parameters: 'Paramètres',
|
||||||
expand_response: "Agrandir la réponse",
|
expand_response: 'Agrandir la réponse',
|
||||||
collapse_response: "Réduire la réponse",
|
collapse_response: 'Réduire la réponse',
|
||||||
hide_preview: "Masquer la prévisualisation",
|
hide_preview: 'Masquer la prévisualisation',
|
||||||
preview_html: "Prévisualiser le HTML",
|
preview_html: 'Prévisualiser le HTML',
|
||||||
history: "Historique",
|
history: 'Historique',
|
||||||
collections: "Collections",
|
collections: 'Collections',
|
||||||
import_curl: "Importer en cURL",
|
import_curl: 'Importer en cURL',
|
||||||
importer: "Importer",
|
importer: 'Importer',
|
||||||
generate_code: "Générer le code",
|
generate_code: 'Générer le code',
|
||||||
request_type: "Type de requête",
|
request_type: 'Type de requête',
|
||||||
generated_code: "Code généré",
|
generated_code: 'Code généré',
|
||||||
status: "Statut",
|
status: 'Statut',
|
||||||
headers: "En-têtes",
|
headers: 'En-têtes',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(en attente de connexion)",
|
waiting_for_connection: '(en attente de connexion)',
|
||||||
message: "Message",
|
message: 'Message',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Serveur",
|
server: 'Serveur',
|
||||||
events: "Évènements",
|
events: 'Évènements',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Récuperer le schéma",
|
get_schema: 'Récuperer le schéma',
|
||||||
header_list: "Liste d'en-têtes",
|
header_list: "Liste d'en-têtes",
|
||||||
add_new: "Ajouter",
|
add_new: 'Ajouter',
|
||||||
response: "Réponse",
|
response: 'Réponse',
|
||||||
query: "Requête",
|
query: 'Requête',
|
||||||
queries: "Requêtes",
|
queries: 'Requêtes',
|
||||||
query_variables: "Variables",
|
query_variables: 'Variables',
|
||||||
mutations: "Mutations",
|
mutations: 'Mutations',
|
||||||
subscriptions: "Abonnements",
|
subscriptions: 'Abonnements',
|
||||||
types: "Types",
|
types: 'Types',
|
||||||
send: "Envoyer",
|
send: 'Envoyer',
|
||||||
background: "Arrière-plan",
|
background: 'Arrière-plan',
|
||||||
color: "Couleur",
|
color: 'Couleur',
|
||||||
labels: "Libellés",
|
labels: 'Libellés',
|
||||||
multi_color: "Multi-couleurs",
|
multi_color: 'Multi-couleurs',
|
||||||
enabled: "Activé",
|
enabled: 'Activé',
|
||||||
disabled: "Désactivé",
|
disabled: 'Désactivé',
|
||||||
proxy: "Proxy",
|
proxy: 'Proxy',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: 'Le proxy officiel de Postwoman est hébergé par ApolloTV.',
|
||||||
"Le proxy officiel de Postwoman est hébergé par ApolloTV.",
|
read_the: 'Lire la',
|
||||||
read_the: "Lire la",
|
apollotv_privacy_policy: 'politique de confidentialité ApolloTV',
|
||||||
apollotv_privacy_policy: "politique de confidentialité ApolloTV",
|
contact_us: 'Contactez nous',
|
||||||
contact_us: "Contactez nous",
|
connect: 'Relier',
|
||||||
connect: "Relier",
|
disconnect: 'Déconnecter',
|
||||||
disconnect: "Déconnecter",
|
start: 'Début',
|
||||||
start: "Début",
|
stop: 'Arrêtez',
|
||||||
stop: "Arrêtez",
|
|
||||||
access_token: "Token d'accès",
|
access_token: "Token d'accès",
|
||||||
token_list: "Liste des Tokens",
|
token_list: 'Liste des Tokens',
|
||||||
get_token: "Obtenir un nouveau Token",
|
get_token: 'Obtenir un nouveau Token',
|
||||||
manage_token: "Gérer le Token",
|
manage_token: 'Gérer le Token',
|
||||||
save_token: "Sauvegarder le Token",
|
save_token: 'Sauvegarder le Token',
|
||||||
use_token: "Utiliser un Token",
|
use_token: 'Utiliser un Token',
|
||||||
request_token: "Demander un Token",
|
request_token: 'Demander un Token',
|
||||||
save_token_req: "Sauvegarder la requête ",
|
save_token_req: 'Sauvegarder la requête ',
|
||||||
manage_token_req: "Gérer la requête avec Token",
|
manage_token_req: 'Gérer la requête avec Token',
|
||||||
use_token_req: "Utiliser la requête avec Token",
|
use_token_req: 'Utiliser la requête avec Token',
|
||||||
token_req_name: "Nom de la requête",
|
token_req_name: 'Nom de la requête',
|
||||||
token_req_details: "Détails de la requête",
|
token_req_details: 'Détails de la requête',
|
||||||
token_name: "Nom du Token",
|
token_name: 'Nom du Token',
|
||||||
oidc_discovery_url: "OIDC Discovery URL",
|
oidc_discovery_url: 'OIDC Discovery URL',
|
||||||
auth_url: "Auth URL",
|
auth_url: 'Auth URL',
|
||||||
access_token_url: "URL du Token d'accès",
|
access_token_url: "URL du Token d'accès",
|
||||||
client_id: "Client ID",
|
client_id: 'Client ID',
|
||||||
scope: "Scope",
|
scope: 'Scope',
|
||||||
state: "État",
|
state: 'État',
|
||||||
token_req_list: "Liste des requêtes avec Token",
|
token_req_list: 'Liste des requêtes avec Token',
|
||||||
no_path: "Aucun chemin",
|
no_path: 'Aucun chemin',
|
||||||
no_label: "Aucun label",
|
no_label: 'Aucun label',
|
||||||
prerequest_script: "Pre-Request Script",
|
prerequest_script: 'Pre-Request Script',
|
||||||
no_prerequest_script: "No pre-request script",
|
no_prerequest_script: 'No pre-request script',
|
||||||
search: "Historique de la recherche",
|
search: 'Historique de la recherche',
|
||||||
history_empty: "L'historique est vide",
|
history_empty: "L'historique est vide",
|
||||||
history_deleted: "Historique supprimé",
|
history_deleted: 'Historique supprimé',
|
||||||
clear: "Nettoyer",
|
clear: 'Nettoyer',
|
||||||
clear_all: "Tout nettoyer",
|
clear_all: 'Tout nettoyer',
|
||||||
cleared: "Nettoyé",
|
cleared: 'Nettoyé',
|
||||||
close: "Fermer",
|
close: 'Fermer',
|
||||||
sort: "Trier",
|
sort: 'Trier',
|
||||||
time: "Temps",
|
time: 'Temps',
|
||||||
duration: "Durée",
|
duration: 'Durée',
|
||||||
no_duration: "Aucune durée",
|
no_duration: 'Aucune durée',
|
||||||
show_more: "Plus d'informations",
|
show_more: "Plus d'informations",
|
||||||
hide_more: "Moins d'informations",
|
hide_more: "Moins d'informations",
|
||||||
collection: "Collection",
|
collection: 'Collection',
|
||||||
current_collection: "Collection Actuelle",
|
current_collection: 'Collection Actuelle',
|
||||||
select_collection: "Selectionner une Collection",
|
select_collection: 'Selectionner une Collection',
|
||||||
create_collection: "Créer une Collection",
|
create_collection: 'Créer une Collection',
|
||||||
new: "Nouveau",
|
new: 'Nouveau',
|
||||||
import_export: "Importer / Exporter",
|
import_export: 'Importer / Exporter',
|
||||||
more: "Plus",
|
more: 'Plus',
|
||||||
folder: "Dossier",
|
folder: 'Dossier',
|
||||||
new_folder: "Nouveau Dossier",
|
new_folder: 'Nouveau Dossier',
|
||||||
my_new_folder: "Mon Nouveau Dossier",
|
my_new_folder: 'Mon Nouveau Dossier',
|
||||||
folder_empty: "Ce Dossier est vide",
|
folder_empty: 'Ce Dossier est vide',
|
||||||
edit_folder: "Éditer le Dossier",
|
edit_folder: 'Éditer le Dossier',
|
||||||
edit: "Éditer",
|
edit: 'Éditer',
|
||||||
delete: "Supprimer",
|
delete: 'Supprimer',
|
||||||
deleted: "Supprimé",
|
deleted: 'Supprimé',
|
||||||
undo: "Annuler",
|
undo: 'Annuler',
|
||||||
collection_empty: "Cette Collection est vide",
|
collection_empty: 'Cette Collection est vide',
|
||||||
new_collection: "Nouvelle Collection",
|
new_collection: 'Nouvelle Collection',
|
||||||
my_new_collection: "Ma Nouvelle Collection",
|
my_new_collection: 'Ma Nouvelle Collection',
|
||||||
edit_collection: "Éditer la Collection",
|
edit_collection: 'Éditer la Collection',
|
||||||
edit_request: "Éditer ma requête",
|
edit_request: 'Éditer ma requête',
|
||||||
save_request_as: "Sauvegarder ma requête sous",
|
save_request_as: 'Sauvegarder ma requête sous',
|
||||||
export: "Exporter",
|
export: 'Exporter',
|
||||||
connecting_to: "Connexion à {name}...",
|
connecting_to: 'Connexion à {name}...',
|
||||||
connected: "Connecté",
|
connected: 'Connecté',
|
||||||
connected_to: "Connecté à {name}",
|
connected_to: 'Connecté à {name}',
|
||||||
disconnected: "Déconnecté",
|
disconnected: 'Déconnecté',
|
||||||
disconnected_from: "Déconnecté sur {name}",
|
disconnected_from: 'Déconnecté sur {name}',
|
||||||
something_went_wrong: "Quelque chose n'a pas marché!",
|
something_went_wrong: "Quelque chose n'a pas marché!",
|
||||||
error_occurred: "Une erreur s'est produite.",
|
error_occurred: "Une erreur s'est produite.",
|
||||||
browser_support_sse:
|
browser_support_sse:
|
||||||
"Ce navigateur ne semble pas prendre en charge les événements envoyés par le serveur.",
|
'Ce navigateur ne semble pas prendre en charge les événements envoyés par le serveur.',
|
||||||
log: "Log",
|
log: 'Log',
|
||||||
no_url: "Aucune URL",
|
no_url: 'Aucune URL',
|
||||||
run_query: "Lancer une recherche",
|
run_query: 'Lancer une recherche',
|
||||||
copy_query: "Copier la recherche",
|
copy_query: 'Copier la recherche',
|
||||||
kinda_dark: "Plutôt Sombre",
|
kinda_dark: 'Plutôt Sombre',
|
||||||
clearly_white: "Clairement Blanc",
|
clearly_white: 'Clairement Blanc',
|
||||||
just_black: "Seulement Noir",
|
just_black: 'Seulement Noir',
|
||||||
auto_system: "Auth (système)",
|
auto_system: 'Auth (système)',
|
||||||
green: "Vert",
|
green: 'Vert',
|
||||||
yellow: "Jaune",
|
yellow: 'Jaune',
|
||||||
pink: "Rose",
|
pink: 'Rose',
|
||||||
red: "Rouge",
|
red: 'Rouge',
|
||||||
purple: "Violet",
|
purple: 'Violet',
|
||||||
orange: "Orange",
|
orange: 'Orange',
|
||||||
cyan: "Cyan",
|
cyan: 'Cyan',
|
||||||
blue: "Bleue",
|
blue: 'Bleue',
|
||||||
loading: "Chargement...",
|
loading: 'Chargement...',
|
||||||
fetching: "Récupération...",
|
fetching: 'Récupération...',
|
||||||
waiting_send_req: "(en attente de l'envoi de la demande)",
|
waiting_send_req: "(en attente de l'envoi de la demande)",
|
||||||
cancel: "Annuler",
|
cancel: 'Annuler',
|
||||||
save: "Sauvarder",
|
save: 'Sauvarder',
|
||||||
dismiss: "Dismiss",
|
dismiss: 'Dismiss',
|
||||||
are_you_sure: "Êtes-vous sûr?",
|
are_you_sure: 'Êtes-vous sûr?',
|
||||||
yes: "Oui",
|
yes: 'Oui',
|
||||||
no: "Non",
|
no: 'Non',
|
||||||
restore: "Restaurer",
|
restore: 'Restaurer',
|
||||||
add_star: "Ajouter une étoile",
|
add_star: 'Ajouter une étoile',
|
||||||
remove_star: "Supprimer une étoile",
|
remove_star: 'Supprimer une étoile',
|
||||||
nothing_found: "Rien n'a été trouvé",
|
nothing_found: "Rien n'a été trouvé",
|
||||||
replace_current: "Remplacer l'actuel",
|
replace_current: "Remplacer l'actuel",
|
||||||
replace_json: "Replacer avec du JSON",
|
replace_json: 'Replacer avec du JSON',
|
||||||
preserve_current: "Conserver l'actuel",
|
preserve_current: "Conserver l'actuel",
|
||||||
import_json: "Importer depuis un JSON",
|
import_json: 'Importer depuis un JSON',
|
||||||
download_file: "Télécharger un fichier",
|
download_file: 'Télécharger un fichier',
|
||||||
upload_file: "Charger un fichier",
|
upload_file: 'Charger un fichier',
|
||||||
copy_response: "Copier la réponse",
|
copy_response: 'Copier la réponse',
|
||||||
copy_code: "Copier le code",
|
copy_code: 'Copier le code',
|
||||||
copy_schema: "Copier le Schéma",
|
copy_schema: 'Copier le Schéma',
|
||||||
use_request: "Utiliser cette requête",
|
use_request: 'Utiliser cette requête',
|
||||||
documentation: "Documentation",
|
documentation: 'Documentation',
|
||||||
docs: "Docs",
|
docs: 'Docs',
|
||||||
reset_default: "Rétablir la valeur par défaut",
|
reset_default: 'Rétablir la valeur par défaut',
|
||||||
fields: "CHAMPS",
|
fields: 'CHAMPS',
|
||||||
deprecated: "DÉPRÉCIÉ",
|
deprecated: 'DÉPRÉCIÉ',
|
||||||
add_one_header: "(ajouter au moins un en-tête)",
|
add_one_header: '(ajouter au moins un en-tête)',
|
||||||
add_one_parameter: "(ajouter au moins un paramètre)",
|
add_one_parameter: '(ajouter au moins un paramètre)',
|
||||||
header_count: "{count} en-tête",
|
header_count: '{count} en-tête',
|
||||||
parameter_count: "{count} paramètre",
|
parameter_count: '{count} paramètre',
|
||||||
variable_count: "{count} variable",
|
variable_count: '{count} variable',
|
||||||
value_count: "{count} valeur",
|
value_count: '{count} valeur',
|
||||||
send_request_first: "Envoyez d'abord une requête",
|
send_request_first: "Envoyez d'abord une requête",
|
||||||
generate_docs: "Genérer une Documentation",
|
generate_docs: 'Genérer une Documentation',
|
||||||
generate_docs_message:
|
generate_docs_message:
|
||||||
"Importer n'importe quelle collection de Postwoman pour générer de la documentation en déplacement.",
|
"Importer n'importe quelle collection de Postwoman pour générer de la documentation en déplacement.",
|
||||||
generate_docs_first: "Générer la documentation d'abord",
|
generate_docs_first: "Générer la documentation d'abord",
|
||||||
docs_generated: "Documentation générée",
|
docs_generated: 'Documentation générée',
|
||||||
import_collections: "Importer les collections",
|
import_collections: 'Importer les collections',
|
||||||
optional: "(optionnel)",
|
optional: '(optionnel)',
|
||||||
json: "JSON",
|
json: 'JSON',
|
||||||
none: "Aucun",
|
none: 'Aucun',
|
||||||
username: "Username",
|
username: 'Username',
|
||||||
password: "Password",
|
password: 'Password',
|
||||||
token: "Token",
|
token: 'Token',
|
||||||
payload: "Payload",
|
payload: 'Payload',
|
||||||
choose_file: "Choisir un fichier",
|
choose_file: 'Choisir un fichier',
|
||||||
file_imported: "Fichier importé",
|
file_imported: 'Fichier importé',
|
||||||
f12_details: "(F12 pour voir les détails)",
|
f12_details: '(F12 pour voir les détails)',
|
||||||
we_use_cookies: "Nous utilisons des cookies",
|
we_use_cookies: 'Nous utilisons des cookies',
|
||||||
copied_to_clipboard: "Copié dans le presse-papier",
|
copied_to_clipboard: 'Copié dans le presse-papier',
|
||||||
finished_in: "Fini en {duration}ms",
|
finished_in: 'Fini en {duration}ms',
|
||||||
check_console_details: "Consultez la console pour plus de détails.",
|
check_console_details: 'Consultez la console pour plus de détails.',
|
||||||
download_started: "Téléchargement démarré",
|
download_started: 'Téléchargement démarré',
|
||||||
url_invalid_format: "L'URL n'est pas formatée correctement",
|
url_invalid_format: "L'URL n'est pas formatée correctement",
|
||||||
curl_invalid_format: "cURL n'est pas formaté correctement",
|
curl_invalid_format: "cURL n'est pas formaté correctement",
|
||||||
enable_proxy: "Essayez en activant le Proxy",
|
enable_proxy: 'Essayez en activant le Proxy',
|
||||||
complete_config_urls: "Veuillez compléter les urls de configuration.",
|
complete_config_urls: 'Veuillez compléter les urls de configuration.',
|
||||||
token_request_saved: "Requête de Token sauvegardé",
|
token_request_saved: 'Requête de Token sauvegardé',
|
||||||
donate_info1:
|
donate_info1:
|
||||||
"Si vous avez apprécié la productivité de l'utilisation de Postwoman, considérez le don comme un signe d'appréciation.",
|
"Si vous avez apprécié la productivité de l'utilisation de Postwoman, considérez le don comme un signe d'appréciation.",
|
||||||
donate_info2:
|
donate_info2: 'Vous pouvez soutenir le développement de Postwoman par les méthodes suivantes :',
|
||||||
"Vous pouvez soutenir le développement de Postwoman par les méthodes suivantes :",
|
one_time_recurring: 'Ponctuel ou récurrent',
|
||||||
one_time_recurring: "Ponctuel ou récurrent",
|
one_time: 'Une fois',
|
||||||
one_time: "Une fois",
|
recurring: 'Récurrent',
|
||||||
recurring: "Récurrent",
|
wiki: 'Wiki',
|
||||||
wiki: "Wiki",
|
error: 'Erreur',
|
||||||
error: "Erreur",
|
|
||||||
go_home: "Aller à l'accueil",
|
go_home: "Aller à l'accueil",
|
||||||
reload: "Recharger",
|
reload: 'Recharger',
|
||||||
enter_curl: "Entrer cURL",
|
enter_curl: 'Entrer cURL',
|
||||||
empty: "Vide",
|
empty: 'Vide',
|
||||||
extensions: "Extensions",
|
extensions: 'Extensions',
|
||||||
extensions_info1: "Extension pour navigateur qui simplifie l'accès à Postwoman",
|
extensions_info1: "Extension pour navigateur qui simplifie l'accès à Postwoman",
|
||||||
extensions_info2: "Obtenez l'extension Postwoman pour navigateur !",
|
extensions_info2: "Obtenez l'extension Postwoman pour navigateur !",
|
||||||
installed: "Installé",
|
installed: 'Installé',
|
||||||
login_with: "Se connecter avec",
|
login_with: 'Se connecter avec',
|
||||||
logged_out: "Se déconnecter",
|
logged_out: 'Se déconnecter',
|
||||||
logout: "Déconnexion",
|
logout: 'Déconnexion',
|
||||||
account: "Compte",
|
account: 'Compte',
|
||||||
sync: "Synchroniser",
|
sync: 'Synchroniser',
|
||||||
syncHistory: "Historique",
|
syncHistory: 'Historique',
|
||||||
syncCollections: "Collections",
|
syncCollections: 'Collections',
|
||||||
turn_on: "Activer",
|
turn_on: 'Activer',
|
||||||
login_first: "Se connecter d'abord",
|
login_first: "Se connecter d'abord",
|
||||||
paste_a_collection: "Coller une collection",
|
paste_a_collection: 'Coller une collection',
|
||||||
import_from_sync: "Importer depuis la synchronisation"
|
import_from_sync: 'Importer depuis la synchronisation',
|
||||||
};
|
}
|
||||||
|
|||||||
177
lang/id-ID.js
177
lang/id-ID.js
@@ -1,90 +1,89 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Beranda",
|
home: 'Beranda',
|
||||||
realtime: "Waktu Nyata",
|
realtime: 'Waktu Nyata',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Pengaturan",
|
settings: 'Pengaturan',
|
||||||
request: "Permintaan",
|
request: 'Permintaan',
|
||||||
install_pwa: "Pasang PWA",
|
install_pwa: 'Pasang PWA',
|
||||||
support_us: "Dukung kami",
|
support_us: 'Dukung kami',
|
||||||
tweet: "Cuitkan",
|
tweet: 'Cuitkan',
|
||||||
options: "Opsi",
|
options: 'Opsi',
|
||||||
communication: "Komunikasi",
|
communication: 'Komunikasi',
|
||||||
endpoint: "Titik Akhir",
|
endpoint: 'Titik Akhir',
|
||||||
schema: "Skema",
|
schema: 'Skema',
|
||||||
theme: "Tema",
|
theme: 'Tema',
|
||||||
subscribe: "Berlangganan",
|
subscribe: 'Berlangganan',
|
||||||
choose_language: "Pilih Bahasa",
|
choose_language: 'Pilih Bahasa',
|
||||||
shortcuts: "Pintasan",
|
shortcuts: 'Pintasan',
|
||||||
send_request: "Kirim Permintaan",
|
send_request: 'Kirim Permintaan',
|
||||||
save_to_collections: "Simpan ke Koleksi",
|
save_to_collections: 'Simpan ke Koleksi',
|
||||||
copy_request_link: "Salin Tautan Permintaan",
|
copy_request_link: 'Salin Tautan Permintaan',
|
||||||
reset_request: "Atur Ulang Permintaan",
|
reset_request: 'Atur Ulang Permintaan',
|
||||||
support_us_on: "Dukung kami di",
|
support_us_on: 'Dukung kami di',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "Paypal",
|
paypal: 'Paypal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "Kode Javascript",
|
javascript_code: 'Kode Javascript',
|
||||||
method: "Metode",
|
method: 'Metode',
|
||||||
path: "Lintasan",
|
path: 'Lintasan',
|
||||||
label: "Label",
|
label: 'Label',
|
||||||
again: "Lagi",
|
again: 'Lagi',
|
||||||
content_type: "Jenis Konten",
|
content_type: 'Jenis Konten',
|
||||||
raw_input: "Masukan mentah",
|
raw_input: 'Masukan mentah',
|
||||||
parameter_list: "Daftar parameter",
|
parameter_list: 'Daftar parameter',
|
||||||
raw_request_body: "Badan Permintaan Mentah",
|
raw_request_body: 'Badan Permintaan Mentah',
|
||||||
show_code: "Tampilkan Kode",
|
show_code: 'Tampilkan Kode',
|
||||||
hide_code: "Sembunyikan Kode",
|
hide_code: 'Sembunyikan Kode',
|
||||||
show_prerequest_script: "Tampilkan Skrip Pra-Permintaan",
|
show_prerequest_script: 'Tampilkan Skrip Pra-Permintaan',
|
||||||
hide_prerequest_script: "Sembunyikan Skrip Pra-Permintaan",
|
hide_prerequest_script: 'Sembunyikan Skrip Pra-Permintaan',
|
||||||
authentication: "Autentikasi",
|
authentication: 'Autentikasi',
|
||||||
authentication_type: "Jenis Autentikasi",
|
authentication_type: 'Jenis Autentikasi',
|
||||||
include_in_url: "Sertakan di URL",
|
include_in_url: 'Sertakan di URL',
|
||||||
parameters: "Parameter",
|
parameters: 'Parameter',
|
||||||
expand_response: "Bentangkan Balasan",
|
expand_response: 'Bentangkan Balasan',
|
||||||
collapse_response: "Ciutkan Balasan",
|
collapse_response: 'Ciutkan Balasan',
|
||||||
hide_preview: "Sembunyikan Pratinjau",
|
hide_preview: 'Sembunyikan Pratinjau',
|
||||||
preview_html: "Pratinjau HTML",
|
preview_html: 'Pratinjau HTML',
|
||||||
history: "Riwayat",
|
history: 'Riwayat',
|
||||||
collections: "Koleksi",
|
collections: 'Koleksi',
|
||||||
import_curl: "Impor cURL",
|
import_curl: 'Impor cURL',
|
||||||
import: "Impor",
|
import: 'Impor',
|
||||||
generate_code: "Hasilkan kode",
|
generate_code: 'Hasilkan kode',
|
||||||
request_type: "Jenis permintaan",
|
request_type: 'Jenis permintaan',
|
||||||
generated_code: "Kode yang dihasilkan",
|
generated_code: 'Kode yang dihasilkan',
|
||||||
status: "Status",
|
status: 'Status',
|
||||||
headers: "Header",
|
headers: 'Header',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(Menunggu sambungan)",
|
waiting_for_connection: '(Menunggu sambungan)',
|
||||||
message: "Pesan",
|
message: 'Pesan',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Peladen",
|
server: 'Peladen',
|
||||||
events: "Kejadian",
|
events: 'Kejadian',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Ambil skema",
|
get_schema: 'Ambil skema',
|
||||||
header_list: "Daftar header",
|
header_list: 'Daftar header',
|
||||||
add_new: "Tambah baru",
|
add_new: 'Tambah baru',
|
||||||
response: "Balasan",
|
response: 'Balasan',
|
||||||
query: "Kueri",
|
query: 'Kueri',
|
||||||
queries: "Kueri",
|
queries: 'Kueri',
|
||||||
query_variables: "Variables",
|
query_variables: 'Variables',
|
||||||
mutations: "Mutasi",
|
mutations: 'Mutasi',
|
||||||
subscriptions: "Langganan",
|
subscriptions: 'Langganan',
|
||||||
types: "Jenis",
|
types: 'Jenis',
|
||||||
send: "Kirim",
|
send: 'Kirim',
|
||||||
background: "Latar belakang",
|
background: 'Latar belakang',
|
||||||
color: "Warna",
|
color: 'Warna',
|
||||||
labels: "Label",
|
labels: 'Label',
|
||||||
multi_color: "Warna beragam",
|
multi_color: 'Warna beragam',
|
||||||
enabled: "diaktifkan",
|
enabled: 'diaktifkan',
|
||||||
disabled: "dinonaktifkan",
|
disabled: 'dinonaktifkan',
|
||||||
proxy: "Proksi",
|
proxy: 'Proksi',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: 'Proksi Resmi Postwoman dalam penginangan ApolloTV.',
|
||||||
"Proksi Resmi Postwoman dalam penginangan ApolloTV.",
|
read_the: 'Bacalah',
|
||||||
read_the: "Bacalah",
|
apollotv_privacy_policy: 'kebijakan privasi ApolloTV',
|
||||||
apollotv_privacy_policy: "kebijakan privasi ApolloTV",
|
contact_us: 'Hubungi kami',
|
||||||
contact_us: "Hubungi kami",
|
connect: 'Menghubungkan',
|
||||||
connect: "Menghubungkan",
|
disconnect: 'Memutuskan',
|
||||||
disconnect: "Memutuskan",
|
start: 'Mulai',
|
||||||
start: "Mulai",
|
stop: 'Berhenti',
|
||||||
stop: "Berhenti"
|
}
|
||||||
};
|
|
||||||
|
|||||||
488
lang/ja-JP.js
488
lang/ja-JP.js
@@ -1,245 +1,245 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "ホーム",
|
home: 'ホーム',
|
||||||
realtime: "リアルタイム",
|
realtime: 'リアルタイム',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "設定",
|
settings: '設定',
|
||||||
request: "リクエスト",
|
request: 'リクエスト',
|
||||||
install_pwa: "PWAをインストール",
|
install_pwa: 'PWAをインストール',
|
||||||
support_us: "寄付",
|
support_us: '寄付',
|
||||||
tweet: "ツイート",
|
tweet: 'ツイート',
|
||||||
options: "オプション",
|
options: 'オプション',
|
||||||
communication: "通信",
|
communication: '通信',
|
||||||
endpoint: "エンドポイント",
|
endpoint: 'エンドポイント',
|
||||||
schema: "スキーマ",
|
schema: 'スキーマ',
|
||||||
theme: "テーマ",
|
theme: 'テーマ',
|
||||||
subscribe: "登録",
|
subscribe: '登録',
|
||||||
choose_language: "言語の選択",
|
choose_language: '言語の選択',
|
||||||
shortcuts: "ショートカット",
|
shortcuts: 'ショートカット',
|
||||||
send_request: "リクエストを送信",
|
send_request: 'リクエストを送信',
|
||||||
save_to_collections: "コレクションに保存",
|
save_to_collections: 'コレクションに保存',
|
||||||
copy_request_link: "リクエストURLをコピー",
|
copy_request_link: 'リクエストURLをコピー',
|
||||||
reset_request: "リクエストをリセット",
|
reset_request: 'リクエストをリセット',
|
||||||
support_us_on: "以下より寄付",
|
support_us_on: '以下より寄付',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "JavaScriptコード",
|
javascript_code: 'JavaScriptコード',
|
||||||
method: "メソッド",
|
method: 'メソッド',
|
||||||
path: "パス",
|
path: 'パス',
|
||||||
label: "ラベル",
|
label: 'ラベル',
|
||||||
again: "",
|
again: '',
|
||||||
content_type: "Content Type",
|
content_type: 'Content Type',
|
||||||
raw_input: "Raw入力",
|
raw_input: 'Raw入力',
|
||||||
parameter_list: "パラメータリスト",
|
parameter_list: 'パラメータリスト',
|
||||||
raw_request_body: "Rawリクエストボディー",
|
raw_request_body: 'Rawリクエストボディー',
|
||||||
show_code: "コードを表示",
|
show_code: 'コードを表示',
|
||||||
hide_code: "コードを非表示",
|
hide_code: 'コードを非表示',
|
||||||
show_prerequest_script: "プレリクエストスクリプトを表示",
|
show_prerequest_script: 'プレリクエストスクリプトを表示',
|
||||||
hide_prerequest_script: "プレリクエストスクリプトを非表示",
|
hide_prerequest_script: 'プレリクエストスクリプトを非表示',
|
||||||
authentication: "認証",
|
authentication: '認証',
|
||||||
authentication_type: "認証タイプ",
|
authentication_type: '認証タイプ',
|
||||||
include_in_url: "URLに含む",
|
include_in_url: 'URLに含む',
|
||||||
parameters: "パラメータ",
|
parameters: 'パラメータ',
|
||||||
expand_response: "レスポンスを広げる",
|
expand_response: 'レスポンスを広げる',
|
||||||
collapse_response: "レスポンスを狭める",
|
collapse_response: 'レスポンスを狭める',
|
||||||
hide_preview: "プレビューしない",
|
hide_preview: 'プレビューしない',
|
||||||
preview_html: "HTMLプレビュー表示",
|
preview_html: 'HTMLプレビュー表示',
|
||||||
history: "履歴",
|
history: '履歴',
|
||||||
collections: "コレクション",
|
collections: 'コレクション',
|
||||||
import_curl: "cURLをインポート",
|
import_curl: 'cURLをインポート',
|
||||||
import: "インポート",
|
import: 'インポート',
|
||||||
generate_code: "コード生成",
|
generate_code: 'コード生成',
|
||||||
request_type: "リクエストタイプ",
|
request_type: 'リクエストタイプ',
|
||||||
generated_code: "生成されたコード",
|
generated_code: '生成されたコード',
|
||||||
status: "ステータス",
|
status: 'ステータス',
|
||||||
headers: "ヘッダー",
|
headers: 'ヘッダー',
|
||||||
websocket: "ウェブソケット",
|
websocket: 'ウェブソケット',
|
||||||
waiting_for_connection: "(接続待ち)",
|
waiting_for_connection: '(接続待ち)',
|
||||||
message: "メッセージ",
|
message: 'メッセージ',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "サーバ",
|
server: 'サーバ',
|
||||||
events: "イベント",
|
events: 'イベント',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "スキーマを取得",
|
get_schema: 'スキーマを取得',
|
||||||
header_list: "ヘッダーリスト",
|
header_list: 'ヘッダーリスト',
|
||||||
add_new: "追加",
|
add_new: '追加',
|
||||||
response: "レスポンス",
|
response: 'レスポンス',
|
||||||
query: "クエリ",
|
query: 'クエリ',
|
||||||
queries: "クエリ",
|
queries: 'クエリ',
|
||||||
query_variables: "変数",
|
query_variables: '変数',
|
||||||
mutations: "ミューテーション",
|
mutations: 'ミューテーション',
|
||||||
subscriptions: "サブスクリプション",
|
subscriptions: 'サブスクリプション',
|
||||||
types: "タイプ",
|
types: 'タイプ',
|
||||||
send: "送信",
|
send: '送信',
|
||||||
background: "背景",
|
background: '背景',
|
||||||
color: "色",
|
color: '色',
|
||||||
labels: "ラベル",
|
labels: 'ラベル',
|
||||||
multi_color: "マルチカラー",
|
multi_color: 'マルチカラー',
|
||||||
enabled: "有効",
|
enabled: '有効',
|
||||||
disabled: "無効",
|
disabled: '無効',
|
||||||
proxy: "プロキシ",
|
proxy: 'プロキシ',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: 'Postwomanの公式プロキシは、Apollo TVがホストしています。',
|
||||||
"Postwomanの公式プロキシは、Apollo TVがホストしています。",
|
read_the: 'プライバシーポリシー',
|
||||||
read_the: "プライバシーポリシー",
|
apollotv_privacy_policy: 'を読む',
|
||||||
apollotv_privacy_policy: "を読む",
|
contact_us: 'お問い合わせ',
|
||||||
contact_us: "お問い合わせ",
|
connect: '接続',
|
||||||
connect: "接続",
|
disconnect: '切断',
|
||||||
disconnect: "切断",
|
start: '開始',
|
||||||
start: "開始",
|
stop: '停止',
|
||||||
stop: "停止",
|
access_token: 'アクセストークン',
|
||||||
access_token: "アクセストークン",
|
token_list: 'トークンリスト',
|
||||||
token_list: "トークンリスト",
|
get_token: '新しいトークンを取得',
|
||||||
get_token: "新しいトークンを取得",
|
manage_token: 'アクセストークンを管理',
|
||||||
manage_token: "アクセストークンを管理",
|
save_token: 'アクセストークンを保存',
|
||||||
save_token: "アクセストークンを保存",
|
use_token: 'アクセストークンを使用',
|
||||||
use_token: "アクセストークンを使用",
|
request_token: 'トークンをリクエスト',
|
||||||
request_token: "トークンをリクエスト",
|
save_token_req: 'トークンリクエストを保存',
|
||||||
save_token_req: "トークンリクエストを保存",
|
manage_token_req: 'トークンリクエストを管理',
|
||||||
manage_token_req: "トークンリクエストを管理",
|
use_token_req: 'トークンリクエストを使用',
|
||||||
use_token_req: "トークンリクエストを使用",
|
token_req_name: 'リクエスト名',
|
||||||
token_req_name: "リクエスト名",
|
token_req_details: 'リクエスト詳細',
|
||||||
token_req_details: "リクエスト詳細",
|
token_name: 'トークン名',
|
||||||
token_name: "トークン名",
|
oidc_discovery_url: 'OIDC Discovery URL',
|
||||||
oidc_discovery_url: "OIDC Discovery URL",
|
auth_url: '認証URL',
|
||||||
auth_url: "認証URL",
|
access_token_url: 'アクセストークンURL',
|
||||||
access_token_url: "アクセストークンURL",
|
client_id: 'クライアントID',
|
||||||
client_id: "クライアントID",
|
scope: 'スコープ',
|
||||||
scope: "スコープ",
|
state: 'ステート',
|
||||||
state: "ステート",
|
token_req_list: 'トークンリクエストリスト',
|
||||||
token_req_list: "トークンリクエストリスト",
|
no_path: 'パス無し',
|
||||||
no_path: "パス無し",
|
no_label: 'ラベル無し',
|
||||||
no_label: "ラベル無し",
|
prerequest_script: 'プレリクエストスクリプト',
|
||||||
prerequest_script: "プレリクエストスクリプト",
|
no_prerequest_script: 'プレリクエストスクリプト無し',
|
||||||
no_prerequest_script: "プレリクエストスクリプト無し",
|
search: '検索履歴',
|
||||||
search: "検索履歴",
|
history_empty: '履歴が空です',
|
||||||
history_empty: "履歴が空です",
|
history_deleted: '履歴が削除された',
|
||||||
history_deleted: "履歴が削除された",
|
clear: 'クリア',
|
||||||
clear: "クリア",
|
clear_all: '全てクリア',
|
||||||
clear_all: "全てクリア",
|
cleared: 'クリアされた',
|
||||||
cleared: "クリアされた",
|
close: '閉じる',
|
||||||
close: "閉じる",
|
sort: 'ソート',
|
||||||
sort: "ソート",
|
time: '時間',
|
||||||
time: "時間",
|
duration: '期間',
|
||||||
duration: "期間",
|
no_duration: '期間なし',
|
||||||
no_duration: "期間なし",
|
show_more: 'もっと表示する',
|
||||||
show_more: "もっと表示する",
|
hide_more: '隠す',
|
||||||
hide_more: "隠す",
|
collection: 'コレクション',
|
||||||
collection: "コレクション",
|
current_collection: '現在のコレクション',
|
||||||
current_collection: "現在のコレクション",
|
select_collection: 'コレクションを選択',
|
||||||
select_collection: "コレクションを選択",
|
create_collection: 'コレクションを作成',
|
||||||
create_collection: "コレクションを作成",
|
new: '新規',
|
||||||
new: "新規",
|
import_export: 'インポート・エクスポート',
|
||||||
import_export: "インポート・エクスポート",
|
more: 'More',
|
||||||
more: "More",
|
folder: 'フォルダ',
|
||||||
folder: "フォルダ",
|
new_folder: '新しいフォルダー',
|
||||||
new_folder: "新しいフォルダー",
|
my_new_folder: '私の新しいフォルダー',
|
||||||
my_new_folder: "私の新しいフォルダー",
|
folder_empty: 'フォルダーが空です',
|
||||||
folder_empty: "フォルダーが空です",
|
edit_folder: 'フォルダーを編集',
|
||||||
edit_folder: "フォルダーを編集",
|
edit: '編集',
|
||||||
edit: "編集",
|
delete: '削除',
|
||||||
delete: "削除",
|
deleted: '削除された',
|
||||||
deleted: "削除された",
|
undo: '元に戻す',
|
||||||
undo: "元に戻す",
|
collection_empty: 'コレクションが空です',
|
||||||
collection_empty: "コレクションが空です",
|
new_collection: '新しいコレクション',
|
||||||
new_collection: "新しいコレクション",
|
my_new_collection: '私の新しいコレクション',
|
||||||
my_new_collection: "私の新しいコレクション",
|
edit_collection: 'コレクションを編集',
|
||||||
edit_collection: "コレクションを編集",
|
edit_request: 'リクエストを編集',
|
||||||
edit_request: "リクエストを編集",
|
save_request_as: '名前を付けてリクエストを保存',
|
||||||
save_request_as: "名前を付けてリクエストを保存",
|
export: 'エクスポート',
|
||||||
export: "エクスポート",
|
connecting_to: '{name}に接続中...',
|
||||||
connecting_to: "{name}に接続中...",
|
connected: '接続した',
|
||||||
connected: "接続した",
|
connected_to: '{name}に接続した',
|
||||||
connected_to: "{name}に接続した",
|
disconnected: '切断された',
|
||||||
disconnected: "切断された",
|
disconnected_from: '{name}から切断された',
|
||||||
disconnected_from: "{name}から切断された",
|
something_went_wrong: '何かの問題が起きた',
|
||||||
something_went_wrong: "何かの問題が起きた",
|
error_occurred: 'エラーが発生した',
|
||||||
error_occurred: "エラーが発生した",
|
browser_support_sse: 'このブラウザはサーバー送信イベントのサポートがないようです。',
|
||||||
browser_support_sse: "このブラウザはサーバー送信イベントのサポートがないようです。",
|
log: 'ログ',
|
||||||
log: "ログ",
|
no_url: 'URL無し',
|
||||||
no_url: "URL無し",
|
run_query: 'クエリを実行',
|
||||||
run_query: "クエリを実行",
|
copy_query: 'クエリをコピー',
|
||||||
copy_query: "クエリをコピー",
|
kinda_dark: 'ちょっと暗い',
|
||||||
kinda_dark: "ちょっと暗い",
|
clearly_white: '明らかに白',
|
||||||
clearly_white: "明らかに白",
|
just_black: 'ただの黒',
|
||||||
just_black: "ただの黒",
|
auto_system: 'オート(システム)',
|
||||||
auto_system: "オート(システム)",
|
green: '緑',
|
||||||
green: "緑",
|
yellow: '黄',
|
||||||
yellow: "黄",
|
pink: 'ピンク',
|
||||||
pink: "ピンク",
|
red: '赤',
|
||||||
red: "赤",
|
purple: '紫',
|
||||||
purple: "紫",
|
orange: 'オレンジ',
|
||||||
orange: "オレンジ",
|
cyan: 'シヤン',
|
||||||
cyan: "シヤン",
|
blue: '青',
|
||||||
blue: "青",
|
loading: 'ロード中...',
|
||||||
loading: "ロード中...",
|
fetching: 'フェッチ中...',
|
||||||
fetching: "フェッチ中...",
|
waiting_send_req: '(リクエスト送信待ち)',
|
||||||
waiting_send_req: "(リクエスト送信待ち)",
|
cancel: 'キャンセル',
|
||||||
cancel: "キャンセル",
|
save: '保存',
|
||||||
save: "保存",
|
dismiss: 'Dismiss',
|
||||||
dismiss: "Dismiss",
|
are_you_sure: 'よろしいですか?',
|
||||||
are_you_sure: "よろしいですか?",
|
yes: 'はい',
|
||||||
yes: "はい",
|
no: 'いいえ',
|
||||||
no: "いいえ",
|
restore: 'リストア',
|
||||||
restore: "リストア",
|
add_star: '星を付ける',
|
||||||
add_star: "星を付ける",
|
remove_star: '星を外す',
|
||||||
remove_star: "星を外す",
|
nothing_found: '何も見つからない',
|
||||||
nothing_found: "何も見つからない",
|
replace_current: '置換',
|
||||||
replace_current: "置換",
|
replace_json: 'JSONに置換',
|
||||||
replace_json: "JSONに置換",
|
preserve_current: '保持',
|
||||||
preserve_current: "保持",
|
import_json: 'JSONをインポート',
|
||||||
import_json: "JSONをインポート",
|
download_file: 'ファイルをダウンロード',
|
||||||
download_file: "ファイルをダウンロード",
|
upload_file: 'ファイルをアップロード',
|
||||||
upload_file: "ファイルをアップロード",
|
copy_response: 'レスポンスをコピー',
|
||||||
copy_response: "レスポンスをコピー",
|
copy_code: 'コードをコピー',
|
||||||
copy_code: "コードをコピー",
|
copy_schema: 'スキーマをコピー',
|
||||||
copy_schema: "スキーマをコピー",
|
use_request: 'リクエストを使用',
|
||||||
use_request: "リクエストを使用",
|
documentation: 'ドキュメンテーション',
|
||||||
documentation: "ドキュメンテーション",
|
docs: 'ドキュメント',
|
||||||
docs: "ドキュメント",
|
reset_default: 'デフォルトにリセット',
|
||||||
reset_default: "デフォルトにリセット",
|
fields: 'FIELDS',
|
||||||
fields: "FIELDS",
|
deprecated: 'DEPRECATED',
|
||||||
deprecated: "DEPRECATED",
|
add_one_header: '(ヘッダーを少なくとも1つ追加してください)',
|
||||||
add_one_header: "(ヘッダーを少なくとも1つ追加してください)",
|
add_one_parameter: '(パラメータを少なくとも1つ追加してください)',
|
||||||
add_one_parameter: "(パラメータを少なくとも1つ追加してください)",
|
header_count: 'ヘッダー {count}',
|
||||||
header_count: "ヘッダー {count}",
|
parameter_count: 'パラメータ {count}',
|
||||||
parameter_count: "パラメータ {count}",
|
variable_count: '変数 {count}',
|
||||||
variable_count: "変数 {count}",
|
value_count: '値 {count}',
|
||||||
value_count: "値 {count}",
|
send_request_first: 'リクエストを先に送信してください',
|
||||||
send_request_first: "リクエストを先に送信してください",
|
generate_docs: 'ドキュメンテーションを生成',
|
||||||
generate_docs: "ドキュメンテーションを生成",
|
generate_docs_message: 'Postwomanのコレクションをインポートし、直ちにドキュメンテーションを生成',
|
||||||
generate_docs_message: "Postwomanのコレクションをインポートし、直ちにドキュメンテーションを生成",
|
generate_docs_first: 'ドキュメントを先に生成してください',
|
||||||
generate_docs_first: "ドキュメントを先に生成してください",
|
docs_generated: 'ドキュメンテーションを生成した',
|
||||||
docs_generated: "ドキュメンテーションを生成した",
|
import_collections: 'コレクションをインポート',
|
||||||
import_collections: "コレクションをインポート",
|
optional: '(オプション)',
|
||||||
optional: "(オプション)",
|
json: 'JSON',
|
||||||
json: "JSON",
|
none: 'なし',
|
||||||
none: "なし",
|
username: 'ユーザー名',
|
||||||
username: "ユーザー名",
|
password: 'パスワード',
|
||||||
password: "パスワード",
|
token: 'トークン',
|
||||||
token: "トークン",
|
payload: 'ペイロード',
|
||||||
payload: "ペイロード",
|
choose_file: 'ファイルを選択',
|
||||||
choose_file: "ファイルを選択",
|
file_imported: 'ファイルをインポートした',
|
||||||
file_imported: "ファイルをインポートした",
|
f12_details: '(F12を押して詳細を確認してください)',
|
||||||
f12_details: "(F12を押して詳細を確認してください)",
|
we_use_cookies: 'クッキーを使用します。',
|
||||||
we_use_cookies: "クッキーを使用します。",
|
copied_to_clipboard: 'クリップボードにコピーした',
|
||||||
copied_to_clipboard: "クリップボードにコピーした",
|
finished_in: '{duration}msで終了した',
|
||||||
finished_in: "{duration}msで終了した",
|
check_console_details: 'コンソールより詳細を確認してください',
|
||||||
check_console_details: "コンソールより詳細を確認してください",
|
download_started: 'ダウンロードを開始した',
|
||||||
download_started: "ダウンロードを開始した",
|
url_invalid_format: 'URLが正しくフォーマットされていない',
|
||||||
url_invalid_format: "URLが正しくフォーマットされていない",
|
curl_invalid_format: 'cURLが正しくフォーマットされていない',
|
||||||
curl_invalid_format: "cURLが正しくフォーマットされていない",
|
enable_proxy: 'プロキシを有効にしてみてください',
|
||||||
enable_proxy: "プロキシを有効にしてみてください",
|
complete_config_urls: '設定URLsを入力してください',
|
||||||
complete_config_urls: "設定URLsを入力してください",
|
token_request_saved: 'トークンリクエストを保存した',
|
||||||
token_request_saved: "トークンリクエストを保存した",
|
donate_info1:
|
||||||
donate_info1: "Postwomanを非常に役に立つと思われる場合、感謝の印として寄付のご検討をお願いします。",
|
'Postwomanを非常に役に立つと思われる場合、感謝の印として寄付のご検討をお願いします。',
|
||||||
donate_info2: "以下の方法でPostwomanの開発をサポートできます:",
|
donate_info2: '以下の方法でPostwomanの開発をサポートできます:',
|
||||||
one_time_recurring: "一度又は定期的",
|
one_time_recurring: '一度又は定期的',
|
||||||
one_time: "一度",
|
one_time: '一度',
|
||||||
recurring: "定期的",
|
recurring: '定期的',
|
||||||
wiki: "Wiki",
|
wiki: 'Wiki',
|
||||||
error: "エラー",
|
error: 'エラー',
|
||||||
go_home: "ホームに戻る",
|
go_home: 'ホームに戻る',
|
||||||
reload: "リロード",
|
reload: 'リロード',
|
||||||
enter_curl: "cURLを入力",
|
enter_curl: 'cURLを入力',
|
||||||
empty: "空"
|
empty: '空',
|
||||||
};
|
}
|
||||||
|
|||||||
174
lang/pt-BR.js
174
lang/pt-BR.js
@@ -1,89 +1,89 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Home",
|
home: 'Home',
|
||||||
realtime: "Tempo real",
|
realtime: 'Tempo real',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Configurações",
|
settings: 'Configurações',
|
||||||
request: "Request",
|
request: 'Request',
|
||||||
install_pwa: "Instalar PWA",
|
install_pwa: 'Instalar PWA',
|
||||||
support_us: "Nos ajude",
|
support_us: 'Nos ajude',
|
||||||
tweet: "Tweet",
|
tweet: 'Tweet',
|
||||||
options: "Opções",
|
options: 'Opções',
|
||||||
communication: "Comunicação",
|
communication: 'Comunicação',
|
||||||
endpoint: "Endpoint",
|
endpoint: 'Endpoint',
|
||||||
schema: "Schema",
|
schema: 'Schema',
|
||||||
theme: "Tema",
|
theme: 'Tema',
|
||||||
subscribe: "Subscribe",
|
subscribe: 'Subscribe',
|
||||||
choose_language: "Escolher idioma",
|
choose_language: 'Escolher idioma',
|
||||||
shortcuts: "Atalhos",
|
shortcuts: 'Atalhos',
|
||||||
send_request: "Enviar request",
|
send_request: 'Enviar request',
|
||||||
save_to_collections: "Salvar nas coleções",
|
save_to_collections: 'Salvar nas coleções',
|
||||||
copy_request_link: "Copiar link da request",
|
copy_request_link: 'Copiar link da request',
|
||||||
reset_request: "Reiniciar request",
|
reset_request: 'Reiniciar request',
|
||||||
support_us_on: "Nos ajude no",
|
support_us_on: 'Nos ajude no',
|
||||||
open_collective: "Abrir coletivamente",
|
open_collective: 'Abrir coletivamente',
|
||||||
paypal: "Paypal",
|
paypal: 'Paypal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "Codigo JavaScript",
|
javascript_code: 'Codigo JavaScript',
|
||||||
method: "Método",
|
method: 'Método',
|
||||||
path: "Caminho",
|
path: 'Caminho',
|
||||||
label: "Label",
|
label: 'Label',
|
||||||
again: "Novamente",
|
again: 'Novamente',
|
||||||
content_type: "Content Type",
|
content_type: 'Content Type',
|
||||||
raw_input: "Raw input",
|
raw_input: 'Raw input',
|
||||||
parameter_list: "Lista de parâmetros",
|
parameter_list: 'Lista de parâmetros',
|
||||||
raw_request_body: "Raw request body",
|
raw_request_body: 'Raw request body',
|
||||||
show_code: "Mostrar código",
|
show_code: 'Mostrar código',
|
||||||
hide_code: "Esconder código",
|
hide_code: 'Esconder código',
|
||||||
show_prerequest_script: "Mostrar script de pré-request",
|
show_prerequest_script: 'Mostrar script de pré-request',
|
||||||
hide_prerequest_script: "Esconder script de pré-request",
|
hide_prerequest_script: 'Esconder script de pré-request',
|
||||||
authentication: "Autenticação",
|
authentication: 'Autenticação',
|
||||||
authentication_type: "Tipo de autenticação",
|
authentication_type: 'Tipo de autenticação',
|
||||||
include_in_url: "Incluir na url",
|
include_in_url: 'Incluir na url',
|
||||||
parameters: "Parâmetros",
|
parameters: 'Parâmetros',
|
||||||
expand_response: "Expandir response",
|
expand_response: 'Expandir response',
|
||||||
collapse_response: "Esconder response",
|
collapse_response: 'Esconder response',
|
||||||
hide_preview: "Esconder preview",
|
hide_preview: 'Esconder preview',
|
||||||
preview_html: "Preview html",
|
preview_html: 'Preview html',
|
||||||
history: "Histórico",
|
history: 'Histórico',
|
||||||
collections: "Coleções",
|
collections: 'Coleções',
|
||||||
import_curl: "Importar curl",
|
import_curl: 'Importar curl',
|
||||||
import: "Importar",
|
import: 'Importar',
|
||||||
generate_code: "Gerar código",
|
generate_code: 'Gerar código',
|
||||||
request_type: "Tipo de request",
|
request_type: 'Tipo de request',
|
||||||
generated_code: "Código gerado",
|
generated_code: 'Código gerado',
|
||||||
status: "Status",
|
status: 'Status',
|
||||||
headers: "Headers",
|
headers: 'Headers',
|
||||||
websocket: "Websocket",
|
websocket: 'Websocket',
|
||||||
waiting_for_connection: "(aguardando conexão)",
|
waiting_for_connection: '(aguardando conexão)',
|
||||||
message: "Mensagem",
|
message: 'Mensagem',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Servidor",
|
server: 'Servidor',
|
||||||
events: "Eventos",
|
events: 'Eventos',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Get schema",
|
get_schema: 'Get schema',
|
||||||
header_list: "Lista de headers",
|
header_list: 'Lista de headers',
|
||||||
add_new: "Adicionar novo",
|
add_new: 'Adicionar novo',
|
||||||
response: "Response",
|
response: 'Response',
|
||||||
query: "Query",
|
query: 'Query',
|
||||||
queries: "Queries",
|
queries: 'Queries',
|
||||||
query_variables: "Variáveis",
|
query_variables: 'Variáveis',
|
||||||
mutations: "Mutações",
|
mutations: 'Mutações',
|
||||||
subscriptions: "Assinaturas",
|
subscriptions: 'Assinaturas',
|
||||||
types: "Tipos",
|
types: 'Tipos',
|
||||||
send: "Enviar",
|
send: 'Enviar',
|
||||||
background: "Fundo",
|
background: 'Fundo',
|
||||||
color: "Cor",
|
color: 'Cor',
|
||||||
labels: "Labels",
|
labels: 'Labels',
|
||||||
multi_color: "Multi cor",
|
multi_color: 'Multi cor',
|
||||||
enabled: "Ativado",
|
enabled: 'Ativado',
|
||||||
disabled: "Desativado",
|
disabled: 'Desativado',
|
||||||
proxy: "Proxy",
|
proxy: 'Proxy',
|
||||||
postwoman_official_proxy_hosting: "Postwoman's alojamento proxy oficial",
|
postwoman_official_proxy_hosting: "Postwoman's alojamento proxy oficial",
|
||||||
read_the: "Leia o",
|
read_the: 'Leia o',
|
||||||
apollotv_privacy_policy: "ApolloTV Política de Privacidade",
|
apollotv_privacy_policy: 'ApolloTV Política de Privacidade',
|
||||||
contact_us: "Contate-Nos",
|
contact_us: 'Contate-Nos',
|
||||||
connect: "Conectar",
|
connect: 'Conectar',
|
||||||
disconnect: "Desconectar",
|
disconnect: 'Desconectar',
|
||||||
start: "Começar",
|
start: 'Começar',
|
||||||
stop: "Pare"
|
stop: 'Pare',
|
||||||
};
|
}
|
||||||
|
|||||||
175
lang/tr-TR.js
175
lang/tr-TR.js
@@ -1,90 +1,89 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "Ana Sayfa",
|
home: 'Ana Sayfa',
|
||||||
realtime: "Realtime",
|
realtime: 'Realtime',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "Ayarlar",
|
settings: 'Ayarlar',
|
||||||
request: "İstek",
|
request: 'İstek',
|
||||||
install_pwa: "PWA yükle",
|
install_pwa: 'PWA yükle',
|
||||||
support_us: "Bize destek ol",
|
support_us: 'Bize destek ol',
|
||||||
tweet: "Tweet",
|
tweet: 'Tweet',
|
||||||
options: "Options",
|
options: 'Options',
|
||||||
communication: "İletişim",
|
communication: 'İletişim',
|
||||||
endpoint: "Endpoint",
|
endpoint: 'Endpoint',
|
||||||
schema: "Taslak",
|
schema: 'Taslak',
|
||||||
theme: "Tema",
|
theme: 'Tema',
|
||||||
subscribe: "Abonelik",
|
subscribe: 'Abonelik',
|
||||||
choose_language: "Dil seç",
|
choose_language: 'Dil seç',
|
||||||
shortcuts: "Kısayollar",
|
shortcuts: 'Kısayollar',
|
||||||
send_request: "İstek gönder",
|
send_request: 'İstek gönder',
|
||||||
save_to_collections: "Koleksiyonları kaydet",
|
save_to_collections: 'Koleksiyonları kaydet',
|
||||||
copy_request_link: "İstek adresini kopyala",
|
copy_request_link: 'İstek adresini kopyala',
|
||||||
reset_request: "İstekleri resetle",
|
reset_request: 'İstekleri resetle',
|
||||||
support_us_on: "Bizi destekle",
|
support_us_on: 'Bizi destekle',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "PayPal",
|
paypal: 'PayPal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "JavaScript code",
|
javascript_code: 'JavaScript code',
|
||||||
method: "Metot",
|
method: 'Metot',
|
||||||
path: "Yol",
|
path: 'Yol',
|
||||||
label: "Etiket",
|
label: 'Etiket',
|
||||||
again: "Yeniden",
|
again: 'Yeniden',
|
||||||
content_type: "İçerik tipi",
|
content_type: 'İçerik tipi',
|
||||||
raw_input: "Raw giriş",
|
raw_input: 'Raw giriş',
|
||||||
parameter_list: "Parametre listesi",
|
parameter_list: 'Parametre listesi',
|
||||||
raw_request_body: "Raw istek içeriği",
|
raw_request_body: 'Raw istek içeriği',
|
||||||
show_code: "Kodu göster",
|
show_code: 'Kodu göster',
|
||||||
hide_code: "Kodu gizle",
|
hide_code: 'Kodu gizle',
|
||||||
show_prerequest_script: "Pre-Request scriptini göster",
|
show_prerequest_script: 'Pre-Request scriptini göster',
|
||||||
hide_prerequest_script: "Pre-Request scriptini gizle",
|
hide_prerequest_script: 'Pre-Request scriptini gizle',
|
||||||
authentication: "Authentication",
|
authentication: 'Authentication',
|
||||||
authentication_type: "Authentication tipi",
|
authentication_type: 'Authentication tipi',
|
||||||
include_in_url: "URL'den içeri aktar",
|
include_in_url: "URL'den içeri aktar",
|
||||||
parameters: "Parametre",
|
parameters: 'Parametre',
|
||||||
expand_response: "Cevabı genişlet",
|
expand_response: 'Cevabı genişlet',
|
||||||
collapse_response: "Cevap daralt",
|
collapse_response: 'Cevap daralt',
|
||||||
hide_preview: "Görüntülemeyi gizle",
|
hide_preview: 'Görüntülemeyi gizle',
|
||||||
preview_html: "HTML formatında görüntüle",
|
preview_html: 'HTML formatında görüntüle',
|
||||||
history: "Geçmiş",
|
history: 'Geçmiş',
|
||||||
collections: "Koleksiyonlar",
|
collections: 'Koleksiyonlar',
|
||||||
import_curl: "cURL içeri aktar",
|
import_curl: 'cURL içeri aktar',
|
||||||
import: "İçeri Aktar",
|
import: 'İçeri Aktar',
|
||||||
generate_code: "Kod Üret",
|
generate_code: 'Kod Üret',
|
||||||
request_type: "Request tipi",
|
request_type: 'Request tipi',
|
||||||
generated_code: "Üretilen Kod",
|
generated_code: 'Üretilen Kod',
|
||||||
status: "Durum",
|
status: 'Durum',
|
||||||
headers: "Headers",
|
headers: 'Headers',
|
||||||
websocket: "WebSocket",
|
websocket: 'WebSocket',
|
||||||
waiting_for_connection: "(esperando por conexión)",
|
waiting_for_connection: '(esperando por conexión)',
|
||||||
message: "Mesaj",
|
message: 'Mesaj',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Server",
|
server: 'Server',
|
||||||
events: "Events",
|
events: 'Events',
|
||||||
url: "URL",
|
url: 'URL',
|
||||||
get_schema: "Taslak",
|
get_schema: 'Taslak',
|
||||||
header_list: "Header listesi",
|
header_list: 'Header listesi',
|
||||||
add_new: "Yeni Ekle",
|
add_new: 'Yeni Ekle',
|
||||||
response: "Cevap",
|
response: 'Cevap',
|
||||||
query: "Sorgu",
|
query: 'Sorgu',
|
||||||
queries: "Sorgular",
|
queries: 'Sorgular',
|
||||||
query_variables: "Değişkenler",
|
query_variables: 'Değişkenler',
|
||||||
mutations: "Değişimler",
|
mutations: 'Değişimler',
|
||||||
subscriptions: "Aboneler",
|
subscriptions: 'Aboneler',
|
||||||
types: "Tipler",
|
types: 'Tipler',
|
||||||
send: "Gönder",
|
send: 'Gönder',
|
||||||
background: "Arka Plan",
|
background: 'Arka Plan',
|
||||||
color: "Renk",
|
color: 'Renk',
|
||||||
labels: "Etiketler",
|
labels: 'Etiketler',
|
||||||
multi_color: "Çoklu renk",
|
multi_color: 'Çoklu renk',
|
||||||
enabled: "Aktif",
|
enabled: 'Aktif',
|
||||||
disabled: "Aktif değil",
|
disabled: 'Aktif değil',
|
||||||
proxy: "Proxy",
|
proxy: 'Proxy',
|
||||||
postwoman_official_proxy_hosting:
|
postwoman_official_proxy_hosting: 'Proxy Oficial de Postwoman está hospedado en ApolloTV.',
|
||||||
"Proxy Oficial de Postwoman está hospedado en ApolloTV.",
|
read_the: 'Leer la',
|
||||||
read_the: "Leer la",
|
apollotv_privacy_policy: 'ApolloTV gizlilik politikaları',
|
||||||
apollotv_privacy_policy: "ApolloTV gizlilik politikaları",
|
contact_us: 'Bizimle iletişime geçin',
|
||||||
contact_us: "Bizimle iletişime geçin",
|
connect: 'Bağlan',
|
||||||
connect: "Bağlan",
|
disconnect: 'Kesmek',
|
||||||
disconnect: "Kesmek",
|
start: 'Başla',
|
||||||
start: "Başla",
|
stop: 'Durdurmak',
|
||||||
stop: "Durdurmak"
|
}
|
||||||
};
|
|
||||||
|
|||||||
176
lang/zh-CN.js
176
lang/zh-CN.js
@@ -1,89 +1,89 @@
|
|||||||
export default {
|
export default {
|
||||||
home: "主页",
|
home: '主页',
|
||||||
realtime: "长连接",
|
realtime: '长连接',
|
||||||
graphql: "GraphQL",
|
graphql: 'GraphQL',
|
||||||
settings: "设置",
|
settings: '设置',
|
||||||
request: "请求",
|
request: '请求',
|
||||||
install_pwa: "安装PWA应用",
|
install_pwa: '安装PWA应用',
|
||||||
support_us: "支持我们",
|
support_us: '支持我们',
|
||||||
tweet: "推特",
|
tweet: '推特',
|
||||||
options: "选项",
|
options: '选项',
|
||||||
communication: "联系我们",
|
communication: '联系我们',
|
||||||
endpoint: "服务端点",
|
endpoint: '服务端点',
|
||||||
schema: "模式",
|
schema: '模式',
|
||||||
theme: "主题",
|
theme: '主题',
|
||||||
subscribe: "订阅",
|
subscribe: '订阅',
|
||||||
choose_language: "选择语言",
|
choose_language: '选择语言',
|
||||||
shortcuts: "快捷键",
|
shortcuts: '快捷键',
|
||||||
send_request: "发送请求",
|
send_request: '发送请求',
|
||||||
save_to_collections: "保存到收藏夹",
|
save_to_collections: '保存到收藏夹',
|
||||||
copy_request_link: "复制请求链接",
|
copy_request_link: '复制请求链接',
|
||||||
reset_request: "重置请求",
|
reset_request: '重置请求',
|
||||||
support_us_on: "支持我们",
|
support_us_on: '支持我们',
|
||||||
open_collective: "Open Collective",
|
open_collective: 'Open Collective',
|
||||||
paypal: "Paypal",
|
paypal: 'Paypal',
|
||||||
patreon: "Patreon",
|
patreon: 'Patreon',
|
||||||
javascript_code: "JavaScript代码",
|
javascript_code: 'JavaScript代码',
|
||||||
method: "方法",
|
method: '方法',
|
||||||
path: "路径",
|
path: '路径',
|
||||||
label: "标签",
|
label: '标签',
|
||||||
again: "重试",
|
again: '重试',
|
||||||
content_type: "内容类型",
|
content_type: '内容类型',
|
||||||
raw_input: "raw数据",
|
raw_input: 'raw数据',
|
||||||
parameter_list: "参数列表",
|
parameter_list: '参数列表',
|
||||||
raw_request_body: "raw请求主体",
|
raw_request_body: 'raw请求主体',
|
||||||
show_code: "显示代码",
|
show_code: '显示代码',
|
||||||
hide_code: "隐藏代码",
|
hide_code: '隐藏代码',
|
||||||
show_prerequest_script: "显示预请求脚本",
|
show_prerequest_script: '显示预请求脚本',
|
||||||
hide_prerequest_script: "隐藏预请求脚本",
|
hide_prerequest_script: '隐藏预请求脚本',
|
||||||
authentication: "认证方式",
|
authentication: '认证方式',
|
||||||
authentication_type: "认证类型",
|
authentication_type: '认证类型',
|
||||||
include_in_url: "包含在URL中",
|
include_in_url: '包含在URL中',
|
||||||
parameters: "参数",
|
parameters: '参数',
|
||||||
expand_response: "展开显示响应内容",
|
expand_response: '展开显示响应内容',
|
||||||
collapse_response: "折叠显示响应内容",
|
collapse_response: '折叠显示响应内容',
|
||||||
hide_preview: "隐藏预览",
|
hide_preview: '隐藏预览',
|
||||||
preview_html: "预览HTML",
|
preview_html: '预览HTML',
|
||||||
history: "历史记录",
|
history: '历史记录',
|
||||||
collections: "收藏夹",
|
collections: '收藏夹',
|
||||||
import_curl: "批量导入",
|
import_curl: '批量导入',
|
||||||
import: "导入",
|
import: '导入',
|
||||||
generate_code: "生成代码",
|
generate_code: '生成代码',
|
||||||
request_type: "请求类型",
|
request_type: '请求类型',
|
||||||
generated_code: "生成的代码",
|
generated_code: '生成的代码',
|
||||||
status: "状态码",
|
status: '状态码',
|
||||||
headers: "请求头",
|
headers: '请求头',
|
||||||
websocket: "Websocket",
|
websocket: 'Websocket',
|
||||||
waiting_for_connection: "(等待连接)",
|
waiting_for_connection: '(等待连接)',
|
||||||
message: "消息内容",
|
message: '消息内容',
|
||||||
sse: "SSE",
|
sse: 'SSE',
|
||||||
server: "Server",
|
server: 'Server',
|
||||||
events: "事件",
|
events: '事件',
|
||||||
url: "地址",
|
url: '地址',
|
||||||
get_schema: "获取模式",
|
get_schema: '获取模式',
|
||||||
header_list: "请求头列表",
|
header_list: '请求头列表',
|
||||||
add_new: "添加",
|
add_new: '添加',
|
||||||
response: "响应",
|
response: '响应',
|
||||||
query: "查询",
|
query: '查询',
|
||||||
queries: "查询",
|
queries: '查询',
|
||||||
query_variables: "变数",
|
query_variables: '变数',
|
||||||
mutations: "Mutations",
|
mutations: 'Mutations',
|
||||||
subscriptions: "订阅",
|
subscriptions: '订阅',
|
||||||
types: "种类",
|
types: '种类',
|
||||||
send: "发送",
|
send: '发送',
|
||||||
background: "背景",
|
background: '背景',
|
||||||
color: "颜色",
|
color: '颜色',
|
||||||
labels: "标签",
|
labels: '标签',
|
||||||
multi_color: "彩色",
|
multi_color: '彩色',
|
||||||
enabled: "已启用",
|
enabled: '已启用',
|
||||||
disabled: "已禁用",
|
disabled: '已禁用',
|
||||||
proxy: "代理",
|
proxy: '代理',
|
||||||
postwoman_official_proxy_hosting: "Postwoman的官方代理由ApolloTV托管",
|
postwoman_official_proxy_hosting: 'Postwoman的官方代理由ApolloTV托管',
|
||||||
read_the: "阅读",
|
read_the: '阅读',
|
||||||
apollotv_privacy_policy: "ApolloTV隐私政策",
|
apollotv_privacy_policy: 'ApolloTV隐私政策',
|
||||||
contact_us: "联系我们",
|
contact_us: '联系我们',
|
||||||
connect: "连接",
|
connect: '连接',
|
||||||
disconnect: "断开",
|
disconnect: '断开',
|
||||||
start: "开始",
|
start: '开始',
|
||||||
stop: "停止"
|
stop: '停止',
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -304,11 +304,9 @@
|
|||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
v-tooltip="
|
v-tooltip="
|
||||||
(fb.currentUser.displayName ||
|
(fb.currentUser.displayName || '<label><i>Name not found</i></label>') +
|
||||||
'<label><i>Name not found</i></label>') +
|
|
||||||
'<br>' +
|
'<br>' +
|
||||||
(fb.currentUser.email ||
|
(fb.currentUser.email || '<label><i>Email not found</i></label>')
|
||||||
'<label><i>Email not found</i></label>')
|
|
||||||
"
|
"
|
||||||
aria-label="Account"
|
aria-label="Account"
|
||||||
>
|
>
|
||||||
@@ -326,7 +324,7 @@
|
|||||||
<button class="icon">
|
<button class="icon">
|
||||||
<i class="material-icons">settings</i>
|
<i class="material-icons">settings</i>
|
||||||
<span>
|
<span>
|
||||||
{{ $t("settings") }}
|
{{ $t('settings') }}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
@@ -334,7 +332,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="logout" v-close-popover>
|
<button class="icon" @click="logout" v-close-popover>
|
||||||
<i class="material-icons">exit_to_app</i>
|
<i class="material-icons">exit_to_app</i>
|
||||||
<span>{{ $t("logout") }}</span>
|
<span>{{ $t('logout') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -346,33 +344,21 @@
|
|||||||
</button>
|
</button>
|
||||||
<template slot="popover">
|
<template slot="popover">
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="showExtensions = true" v-close-popover>
|
||||||
class="icon"
|
|
||||||
@click="showExtensions = true"
|
|
||||||
v-close-popover
|
|
||||||
>
|
|
||||||
<i class="material-icons">extension</i>
|
<i class="material-icons">extension</i>
|
||||||
<span>{{ $t("extensions") }}</span>
|
<span>{{ $t('extensions') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="showShortcuts = true" v-close-popover>
|
||||||
class="icon"
|
|
||||||
@click="showShortcuts = true"
|
|
||||||
v-close-popover
|
|
||||||
>
|
|
||||||
<i class="material-icons">keyboard</i>
|
<i class="material-icons">keyboard</i>
|
||||||
<span>{{ $t("shortcuts") }}</span>
|
<span>{{ $t('shortcuts') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="showSupport = true" v-close-popover>
|
||||||
class="icon"
|
|
||||||
@click="showSupport = true"
|
|
||||||
v-close-popover
|
|
||||||
>
|
|
||||||
<i class="material-icons">favorite</i>
|
<i class="material-icons">favorite</i>
|
||||||
<span>{{ $t("support_us") }}</span>
|
<span>{{ $t('support_us') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -391,7 +377,7 @@
|
|||||||
d="M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"
|
d="M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<span>{{ $t("tweet") }}</span>
|
<span>{{ $t('tweet') }}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="navigatorShare"
|
v-if="navigatorShare"
|
||||||
@@ -414,10 +400,7 @@
|
|||||||
<span v-if="version.name" class="mono">
|
<span v-if="version.name" class="mono">
|
||||||
<a
|
<a
|
||||||
class="footer-link"
|
class="footer-link"
|
||||||
:href="
|
:href="'https://github.com/liyasthomas/postwoman/releases/tag/' + version.name"
|
||||||
'https://github.com/liyasthomas/postwoman/releases/tag/' +
|
|
||||||
version.name
|
|
||||||
"
|
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
v-tooltip="'GitHub'"
|
v-tooltip="'GitHub'"
|
||||||
@@ -443,20 +426,12 @@
|
|||||||
<!-- <span v-if="version.variant">({{version.variant}})</span> -->
|
<!-- <span v-if="version.variant">({{version.variant}})</span> -->
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<a
|
<a href="https://liyasthomas.web.app" target="_blank" rel="noopener">
|
||||||
href="https://liyasthomas.web.app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
>
|
|
||||||
<button class="icon" v-tooltip="'Liyas Thomas'">
|
<button class="icon" v-tooltip="'Liyas Thomas'">
|
||||||
🦄
|
🦄
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a href="mailto:liyascthomas@gmail.com" target="_blank" rel="noopener">
|
||||||
href="mailto:liyascthomas@gmail.com"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
>
|
|
||||||
<button class="icon" v-tooltip="$t('contact_us')">
|
<button class="icon" v-tooltip="$t('contact_us')">
|
||||||
<i class="material-icons">email</i>
|
<i class="material-icons">email</i>
|
||||||
</button>
|
</button>
|
||||||
@@ -487,7 +462,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("extensions") }}</h3>
|
<h3 class="title">{{ $t('extensions') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="showExtensions = false">
|
<button class="icon" @click="showExtensions = false">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -499,7 +474,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="body">
|
<div slot="body">
|
||||||
<p class="info">
|
<p class="info">
|
||||||
{{ $t("extensions_info1") }}
|
{{ $t('extensions_info1') }}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
@@ -520,11 +495,7 @@
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<span>Firefox</span>
|
<span>Firefox</span>
|
||||||
<span
|
<span class="icon" v-if="firefoxExtInstalled" v-tooltip="$t('installed')">
|
||||||
class="icon"
|
|
||||||
v-if="firefoxExtInstalled"
|
|
||||||
v-tooltip="$t('installed')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">done</i>
|
<i class="material-icons">done</i>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -549,11 +520,7 @@
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<span>Chrome</span>
|
<span>Chrome</span>
|
||||||
<span
|
<span class="icon" v-if="chromeExtInstalled" v-tooltip="$t('installed')">
|
||||||
class="icon"
|
|
||||||
v-if="chromeExtInstalled"
|
|
||||||
v-tooltip="$t('installed')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">done</i>
|
<i class="material-icons">done</i>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -567,7 +534,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("shortcuts") }}</h3>
|
<h3 class="title">{{ $t('shortcuts') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="showShortcuts = false">
|
<button class="icon" @click="showShortcuts = false">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -579,19 +546,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="body">
|
<div slot="body">
|
||||||
<div>
|
<div>
|
||||||
<label>{{ $t("send_request") }}</label>
|
<label>{{ $t('send_request') }}</label>
|
||||||
<kbd>{{ getSpecialKey() }} G</kbd>
|
<kbd>{{ getSpecialKey() }} G</kbd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label>{{ $t("save_to_collections") }}</label>
|
<label>{{ $t('save_to_collections') }}</label>
|
||||||
<kbd>{{ getSpecialKey() }} S</kbd>
|
<kbd>{{ getSpecialKey() }} S</kbd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label>{{ $t("copy_request_link") }}</label>
|
<label>{{ $t('copy_request_link') }}</label>
|
||||||
<kbd>{{ getSpecialKey() }} K</kbd>
|
<kbd>{{ getSpecialKey() }} K</kbd>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label>{{ $t("reset_request") }}</label>
|
<label>{{ $t('reset_request') }}</label>
|
||||||
<kbd>{{ getSpecialKey() }} L</kbd>
|
<kbd>{{ getSpecialKey() }} L</kbd>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -602,7 +569,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<h3 class="title">{{ $t("support_us_on") }}</h3>
|
<h3 class="title">{{ $t('support_us_on') }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button class="icon" @click="showSupport = false">
|
<button class="icon" @click="showSupport = false">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
@@ -614,10 +581,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="body">
|
<div slot="body">
|
||||||
<p class="info">
|
<p class="info">
|
||||||
{{ $t("donate_info1") }}
|
{{ $t('donate_info1') }}
|
||||||
</p>
|
</p>
|
||||||
<p class="info">
|
<p class="info">
|
||||||
{{ $t("donate_info2") }}
|
{{ $t('donate_info2') }}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
@@ -628,7 +595,7 @@
|
|||||||
>
|
>
|
||||||
<button class="icon">
|
<button class="icon">
|
||||||
<i class="material-icons">donut_large</i>
|
<i class="material-icons">donut_large</i>
|
||||||
<span>{{ $t("open_collective") }}</span>
|
<span>{{ $t('open_collective') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -641,7 +608,7 @@
|
|||||||
>
|
>
|
||||||
<button class="icon">
|
<button class="icon">
|
||||||
<i class="material-icons">payment</i>
|
<i class="material-icons">payment</i>
|
||||||
<span>{{ $t("paypal") }}</span>
|
<span>{{ $t('paypal') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -654,7 +621,7 @@
|
|||||||
>
|
>
|
||||||
<button class="icon">
|
<button class="icon">
|
||||||
<i class="material-icons">local_parking</i>
|
<i class="material-icons">local_parking</i>
|
||||||
<span>{{ $t("patreon") }}</span>
|
<span>{{ $t('patreon') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -671,58 +638,58 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import intializePwa from "../assets/js/pwa";
|
import intializePwa from '../assets/js/pwa'
|
||||||
import * as version from "../.postwoman/version.json";
|
import * as version from '../.postwoman/version.json'
|
||||||
import { hasExtensionInstalled } from "../functions/strategies/ExtensionStrategy";
|
import { hasExtensionInstalled } from '../functions/strategies/ExtensionStrategy'
|
||||||
import firebase from "firebase/app";
|
import firebase from 'firebase/app'
|
||||||
import { fb } from "../functions/fb";
|
import { fb } from '../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
logo: () => import("../components/logo"),
|
logo: () => import('../components/logo'),
|
||||||
modal: () => import("../components/modal"),
|
modal: () => import('../components/modal'),
|
||||||
login: () => import("../components/firebase/login")
|
login: () => import('../components/firebase/login'),
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getSpecialKey() {
|
getSpecialKey() {
|
||||||
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? "⌘" : "Ctrl";
|
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? '⌘' : 'Ctrl'
|
||||||
},
|
},
|
||||||
linkActive(path) {
|
linkActive(path) {
|
||||||
return {
|
return {
|
||||||
"nuxt-link-exact-active": this.$route.path === path,
|
'nuxt-link-exact-active': this.$route.path === path,
|
||||||
"nuxt-link-active": this.$route.path === path
|
'nuxt-link-active': this.$route.path === path,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
fb.currentUser = null;
|
fb.currentUser = null
|
||||||
firebase
|
firebase
|
||||||
.auth()
|
.auth()
|
||||||
.signOut()
|
.signOut()
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.show(err.message || err, {
|
this.$toast.show(err.message || err, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
this.$toast.info(this.$t("logged_out"), {
|
this.$toast.info(this.$t('logged_out'), {
|
||||||
icon: "vpn_key"
|
icon: 'vpn_key',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
nativeShare() {
|
nativeShare() {
|
||||||
if (navigator.share) {
|
if (navigator.share) {
|
||||||
navigator
|
navigator
|
||||||
.share({
|
.share({
|
||||||
title: "Postwoman",
|
title: 'Postwoman',
|
||||||
text:
|
text:
|
||||||
"Postwoman • A free, fast and beautiful API request builder - Web alternative to Postman - Helps you create requests faster, saving precious time on development.",
|
'Postwoman • A free, fast and beautiful API request builder - Web alternative to Postman - Helps you create requests faster, saving precious time on development.',
|
||||||
url: "https://postwoman.io/"
|
url: 'https://postwoman.io/',
|
||||||
})
|
})
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch(console.error);
|
.catch(console.error)
|
||||||
} else {
|
} else {
|
||||||
// fallback
|
// fallback
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -737,146 +704,137 @@ export default {
|
|||||||
showSupport: false,
|
showSupport: false,
|
||||||
extensionInstalled: hasExtensionInstalled(),
|
extensionInstalled: hasExtensionInstalled(),
|
||||||
fb,
|
fb,
|
||||||
navigatorShare: navigator.share
|
navigatorShare: navigator.share,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
// Set version data
|
// Set version data
|
||||||
this.version = version.default;
|
this.version = version.default
|
||||||
|
|
||||||
// Load theme settings
|
// Load theme settings
|
||||||
(() => {
|
;(() => {
|
||||||
// Apply theme from settings.
|
// Apply theme from settings.
|
||||||
document.documentElement.className =
|
document.documentElement.className = this.$store.state.postwoman.settings.THEME_CLASS || ''
|
||||||
this.$store.state.postwoman.settings.THEME_CLASS || "";
|
|
||||||
// Load theme color data from settings, or use default color.
|
// Load theme color data from settings, or use default color.
|
||||||
let color = this.$store.state.postwoman.settings.THEME_COLOR || "#50fa7b";
|
let color = this.$store.state.postwoman.settings.THEME_COLOR || '#50fa7b'
|
||||||
let vibrant =
|
let vibrant = this.$store.state.postwoman.settings.THEME_COLOR_VIBRANT || true
|
||||||
this.$store.state.postwoman.settings.THEME_COLOR_VIBRANT || true;
|
document.documentElement.style.setProperty('--ac-color', color)
|
||||||
document.documentElement.style.setProperty("--ac-color", color);
|
|
||||||
document.documentElement.style.setProperty(
|
document.documentElement.style.setProperty(
|
||||||
"--act-color",
|
'--act-color',
|
||||||
vibrant ? "rgba(32, 33, 36, 1)" : "rgba(255, 255, 255, 1)"
|
vibrant ? 'rgba(32, 33, 36, 1)' : 'rgba(255, 255, 255, 1)'
|
||||||
);
|
)
|
||||||
})();
|
})()
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (process.client) {
|
if (process.client) {
|
||||||
document.body.classList.add("afterLoad");
|
document.body.classList.add('afterLoad')
|
||||||
}
|
}
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelector("meta[name=theme-color]")
|
.querySelector('meta[name=theme-color]')
|
||||||
.setAttribute(
|
.setAttribute('content', this.$store.state.postwoman.settings.THEME_TAB_COLOR || '#202124')
|
||||||
"content",
|
|
||||||
this.$store.state.postwoman.settings.THEME_TAB_COLOR || "#202124"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Initializes the PWA code - checks if the app is installed,
|
// Initializes the PWA code - checks if the app is installed,
|
||||||
// etc.
|
// etc.
|
||||||
(async () => {
|
;(async () => {
|
||||||
this.showInstallPrompt = await intializePwa();
|
this.showInstallPrompt = await intializePwa()
|
||||||
let cookiesAllowed = localStorage.getItem("cookiesAllowed") === "yes";
|
let cookiesAllowed = localStorage.getItem('cookiesAllowed') === 'yes'
|
||||||
if (!cookiesAllowed) {
|
if (!cookiesAllowed) {
|
||||||
this.$toast.show(this.$t("we_use_cookies"), {
|
this.$toast.show(this.$t('we_use_cookies'), {
|
||||||
icon: "info",
|
icon: 'info',
|
||||||
duration: 5000,
|
duration: 5000,
|
||||||
theme: "toasted-primary",
|
theme: 'toasted-primary',
|
||||||
action: [
|
action: [
|
||||||
{
|
{
|
||||||
text: this.$t("dismiss"),
|
text: this.$t('dismiss'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
localStorage.setItem("cookiesAllowed", "yes");
|
localStorage.setItem('cookiesAllowed', 'yes')
|
||||||
toastObject.goAway(0);
|
toastObject.goAway(0)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
let showExtensionsToast = localStorage.getItem('showExtensionsToast') === 'yes'
|
||||||
]
|
if (!this.extensionInstalled && !showExtensionsToast) {
|
||||||
});
|
|
||||||
}
|
|
||||||
let showExtensionsToast =
|
|
||||||
localStorage.getItem("showExtensionsToast") === "yes";
|
|
||||||
if (
|
|
||||||
!this.extensionInstalled &&
|
|
||||||
!showExtensionsToast
|
|
||||||
) {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$toast.show(this.$t("extensions_info2"), {
|
this.$toast.show(this.$t('extensions_info2'), {
|
||||||
icon: "extension",
|
icon: 'extension',
|
||||||
duration: 5000,
|
duration: 5000,
|
||||||
theme: "toasted-primary",
|
theme: 'toasted-primary',
|
||||||
action: [
|
action: [
|
||||||
{
|
{
|
||||||
text: this.$t("yes"),
|
text: this.$t('yes'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
this.showExtensions = true;
|
this.showExtensions = true
|
||||||
localStorage.setItem("showExtensionsToast", "yes");
|
localStorage.setItem('showExtensionsToast', 'yes')
|
||||||
toastObject.goAway(0);
|
toastObject.goAway(0)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: this.$t("no"),
|
text: this.$t('no'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
toastObject.goAway(0);
|
toastObject.goAway(0)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
})
|
||||||
}, 15000);
|
}, 15000)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._keyListener = function(e) {
|
this._keyListener = function(e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === 'Escape') {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
this.showExtensions = this.showShortcuts = this.showSupport = false;
|
this.showExtensions = this.showShortcuts = this.showSupport = false
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
document.addEventListener("keydown", this._keyListener.bind(this));
|
document.addEventListener('keydown', this._keyListener.bind(this))
|
||||||
})();
|
})()
|
||||||
|
|
||||||
window.addEventListener("scroll", event => {
|
window.addEventListener('scroll', event => {
|
||||||
let mainNavLinks = document.querySelectorAll("nav ul li a");
|
let mainNavLinks = document.querySelectorAll('nav ul li a')
|
||||||
let fromTop = window.scrollY;
|
let fromTop = window.scrollY
|
||||||
mainNavLinks.forEach(link => {
|
mainNavLinks.forEach(link => {
|
||||||
let section = document.querySelector(link.hash);
|
let section = document.querySelector(link.hash)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
section &&
|
section &&
|
||||||
section.offsetTop <= fromTop &&
|
section.offsetTop <= fromTop &&
|
||||||
section.offsetTop + section.offsetHeight > fromTop
|
section.offsetTop + section.offsetHeight > fromTop
|
||||||
) {
|
) {
|
||||||
link.classList.add("current");
|
link.classList.add('current')
|
||||||
} else {
|
} else {
|
||||||
link.classList.remove("current");
|
link.classList.remove('current')
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
"%cWe ❤︎ open source!",
|
'%cWe ❤︎ open source!',
|
||||||
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
|
'background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;'
|
||||||
);
|
)
|
||||||
console.log(
|
console.log(
|
||||||
"%cContribute: https://github.com/liyasthomas/postwoman",
|
'%cContribute: https://github.com/liyasthomas/postwoman',
|
||||||
"background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
|
'background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;'
|
||||||
);
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
$route() {
|
$route() {
|
||||||
// this.$toast.clear();
|
// this.$toast.clear();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
availableLocales() {
|
availableLocales() {
|
||||||
return this.$i18n.locales.filter(i => i.code !== this.$i18n.locale);
|
return this.$i18n.locales.filter(i => i.code !== this.$i18n.locale)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
document.removeEventListener("keydown", this._keyListener);
|
document.removeEventListener('keydown', this._keyListener)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page page-error">
|
<div class="page page-error">
|
||||||
<img
|
<img src="~static/icons/error.svg" :alt="$t('error')" class="error_banner" />
|
||||||
src="~static/icons/error.svg"
|
|
||||||
:alt="$t('error')"
|
|
||||||
class="error_banner"
|
|
||||||
/>
|
|
||||||
<h2>{{ error.statusCode }}</h2>
|
<h2>{{ error.statusCode }}</h2>
|
||||||
<h3>{{ error.message }}</h3>
|
<h3>{{ error.message }}</h3>
|
||||||
<p>
|
<p>
|
||||||
<nuxt-link to="/">
|
<nuxt-link to="/">
|
||||||
<button>{{ $t("go_home") }}</button>
|
<button>{{ $t('go_home') }}</button>
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href @click.prevent="reloadApplication">{{ $t("reload") }}</a>
|
<a href @click.prevent="reloadApplication">{{ $t('reload') }}</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,20 +31,20 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ["error"],
|
props: ['error'],
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
reloadApplication() {
|
reloadApplication() {
|
||||||
this.$router.push("/", () => window.location.reload());
|
this.$router.push('/', () => window.location.reload())
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
head() {
|
head() {
|
||||||
return {
|
return {
|
||||||
bodyAttrs: {
|
bodyAttrs: {
|
||||||
class: "sticky-footer"
|
class: 'sticky-footer',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default function({ route, redirect }) {
|
export default function({ route, redirect }) {
|
||||||
if (route.fullPath !== "/") {
|
if (route.fullPath !== '/') {
|
||||||
return redirect("/");
|
return redirect('/')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
358
nuxt.config.js
358
nuxt.config.js
@@ -1,231 +1,227 @@
|
|||||||
// Some helpful application constants.
|
// Some helpful application constants.
|
||||||
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
|
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
|
||||||
export const meta = {
|
export const meta = {
|
||||||
name: "Postwoman",
|
name: 'Postwoman',
|
||||||
shortDescription: "A free, fast and beautiful API request builder",
|
shortDescription: 'A free, fast and beautiful API request builder',
|
||||||
description:
|
description:
|
||||||
"Web alternative to Postman - Helps you create requests faster, saving precious time on development."
|
'Web alternative to Postman - Helps you create requests faster, saving precious time on development.',
|
||||||
};
|
}
|
||||||
// Sets the base path for the router.
|
// Sets the base path for the router.
|
||||||
// Important for deploying to GitHub pages.
|
// Important for deploying to GitHub pages.
|
||||||
// -- Travis includes the author in the repo slug,
|
// -- Travis includes the author in the repo slug,
|
||||||
// so if there's a /, we need to get everything after it.
|
// so if there's a /, we need to get everything after it.
|
||||||
let repoName = (process.env.TRAVIS_REPO_SLUG || "").split("/").pop();
|
let repoName = (process.env.TRAVIS_REPO_SLUG || '').split('/').pop()
|
||||||
export const routerBase =
|
export const routerBase =
|
||||||
process.env.DEPLOY_ENV === "GH_PAGES"
|
process.env.DEPLOY_ENV === 'GH_PAGES'
|
||||||
? {
|
? {
|
||||||
router: {
|
router: {
|
||||||
base: `/${repoName}/`
|
base: `/${repoName}/`,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
router: {
|
router: {
|
||||||
base: "/"
|
base: '/',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
export default {
|
export default {
|
||||||
mode: "spa",
|
mode: 'spa',
|
||||||
/*
|
/*
|
||||||
** Headers of the page
|
** Headers of the page
|
||||||
*/
|
*/
|
||||||
server: {
|
server: {
|
||||||
host: "0.0.0.0" // default: localhost
|
host: '0.0.0.0', // default: localhost
|
||||||
},
|
},
|
||||||
render: {
|
render: {
|
||||||
bundleRenderer: {
|
bundleRenderer: {
|
||||||
shouldPreload: (file, type) => {
|
shouldPreload: (file, type) => {
|
||||||
return ["script", "style", "font"].includes(type);
|
return ['script', 'style', 'font'].includes(type)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
head: {
|
head: {
|
||||||
title: `${meta.name} \u2022 ${meta.shortDescription}`,
|
title: `${meta.name} \u2022 ${meta.shortDescription}`,
|
||||||
meta: [
|
meta: [
|
||||||
{
|
{
|
||||||
charset: "utf-8"
|
charset: 'utf-8',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "viewport",
|
name: 'viewport',
|
||||||
content:
|
content:
|
||||||
"width=device-width, initial-scale=1, minimum-scale=1, viewport-fit=cover, minimal-ui"
|
'width=device-width, initial-scale=1, minimum-scale=1, viewport-fit=cover, minimal-ui',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
hid: "description",
|
hid: 'description',
|
||||||
name: "description",
|
name: 'description',
|
||||||
content: meta.description || ""
|
content: meta.description || '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "keywords",
|
name: 'keywords',
|
||||||
content:
|
content:
|
||||||
"postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket, sse, graphql"
|
'postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket, sse, graphql',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "X-UA-Compatible",
|
name: 'X-UA-Compatible',
|
||||||
content: "IE=edge, chrome=1"
|
content: 'IE=edge, chrome=1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
itemprop: "name",
|
itemprop: 'name',
|
||||||
content: `${meta.name} \u2022 ${meta.shortDescription}`
|
content: `${meta.name} \u2022 ${meta.shortDescription}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
itemprop: "description",
|
itemprop: 'description',
|
||||||
content: meta.description
|
content: meta.description,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
itemprop: "image",
|
itemprop: 'image',
|
||||||
content: `https://postwoman.io/logo.jpg`
|
content: `https://postwoman.io/logo.jpg`,
|
||||||
},
|
},
|
||||||
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
|
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
|
||||||
{
|
{
|
||||||
name: "application-name",
|
name: 'application-name',
|
||||||
content: meta.name
|
content: meta.name,
|
||||||
},
|
},
|
||||||
// Add to homescreen for Safari on iOS
|
// Add to homescreen for Safari on iOS
|
||||||
{
|
{
|
||||||
name: "apple-mobile-web-app-capable",
|
name: 'apple-mobile-web-app-capable',
|
||||||
content: "yes"
|
content: 'yes',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "apple-mobile-web-app-status-bar-style",
|
name: 'apple-mobile-web-app-status-bar-style',
|
||||||
content: "black-translucent"
|
content: 'black-translucent',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "apple-mobile-web-app-title",
|
name: 'apple-mobile-web-app-title',
|
||||||
content: meta.name
|
content: meta.name,
|
||||||
},
|
},
|
||||||
// Windows phone tile icon
|
// Windows phone tile icon
|
||||||
{
|
{
|
||||||
name: "msapplication-TileImage",
|
name: 'msapplication-TileImage',
|
||||||
content: `${routerBase.router.base}icons/icon-144x144.png`
|
content: `${routerBase.router.base}icons/icon-144x144.png`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "msapplication-TileColor",
|
name: 'msapplication-TileColor',
|
||||||
content: "#202124"
|
content: '#202124',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "msapplication-tap-highlight",
|
name: 'msapplication-tap-highlight',
|
||||||
content: "no"
|
content: 'no',
|
||||||
},
|
},
|
||||||
// OpenGraph
|
// OpenGraph
|
||||||
{
|
{
|
||||||
property: "og:site_name",
|
property: 'og:site_name',
|
||||||
content: meta.name
|
content: meta.name,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: "og:url",
|
property: 'og:url',
|
||||||
content: "https://postwoman.io"
|
content: 'https://postwoman.io',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: "og:type",
|
property: 'og:type',
|
||||||
content: "website"
|
content: 'website',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: "og:title",
|
property: 'og:title',
|
||||||
content: `${meta.name} \u2022 ${meta.shortDescription}`
|
content: `${meta.name} \u2022 ${meta.shortDescription}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: "og:description",
|
property: 'og:description',
|
||||||
content: meta.description
|
content: meta.description,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: "og:image",
|
property: 'og:image',
|
||||||
content: `https://postwoman.io/logo.jpg`
|
content: `https://postwoman.io/logo.jpg`,
|
||||||
},
|
},
|
||||||
// Twitter
|
// Twitter
|
||||||
{
|
{
|
||||||
name: "twitter:card",
|
name: 'twitter:card',
|
||||||
content: "summary_large_image"
|
content: 'summary_large_image',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:site",
|
name: 'twitter:site',
|
||||||
content: "@liyasthomas"
|
content: '@liyasthomas',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:creator",
|
name: 'twitter:creator',
|
||||||
content: "@liyasthomas"
|
content: '@liyasthomas',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:url",
|
name: 'twitter:url',
|
||||||
content: "https://postwoman.io"
|
content: 'https://postwoman.io',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:title",
|
name: 'twitter:title',
|
||||||
content: `${meta.name} \u2022 ${meta.shortDescription}`
|
content: `${meta.name} \u2022 ${meta.shortDescription}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:description",
|
name: 'twitter:description',
|
||||||
content: meta.description
|
content: meta.description,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:image",
|
name: 'twitter:image',
|
||||||
content: "https://postwoman.io/logo.jpg"
|
content: 'https://postwoman.io/logo.jpg',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
link: [
|
link: [
|
||||||
{
|
{
|
||||||
rel: "icon",
|
rel: 'icon',
|
||||||
type: "image/x-icon",
|
type: 'image/x-icon',
|
||||||
href: `${routerBase.router.base}favicon.ico`
|
href: `${routerBase.router.base}favicon.ico`,
|
||||||
},
|
},
|
||||||
// Home-screen icons (iOS)
|
// Home-screen icons (iOS)
|
||||||
{
|
{
|
||||||
rel: "apple-touch-icon",
|
rel: 'apple-touch-icon',
|
||||||
href: `${routerBase.router.base}icons/icon-48x48.png`
|
href: `${routerBase.router.base}icons/icon-48x48.png`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rel: "apple-touch-icon",
|
rel: 'apple-touch-icon',
|
||||||
sizes: "72x72",
|
sizes: '72x72',
|
||||||
href: `${routerBase.router.base}icons/icon-72x72.png`
|
href: `${routerBase.router.base}icons/icon-72x72.png`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rel: "apple-touch-icon",
|
rel: 'apple-touch-icon',
|
||||||
sizes: "96x96",
|
sizes: '96x96',
|
||||||
href: `${routerBase.router.base}icons/icon-96x96.png`
|
href: `${routerBase.router.base}icons/icon-96x96.png`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rel: "apple-touch-icon",
|
rel: 'apple-touch-icon',
|
||||||
sizes: "144x144",
|
sizes: '144x144',
|
||||||
href: `${routerBase.router.base}icons/icon-144x144.png`
|
href: `${routerBase.router.base}icons/icon-144x144.png`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rel: "apple-touch-icon",
|
rel: 'apple-touch-icon',
|
||||||
sizes: "192x192",
|
sizes: '192x192',
|
||||||
href: `${routerBase.router.base}icons/icon-192x192.png`
|
href: `${routerBase.router.base}icons/icon-192x192.png`,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Customize the progress-bar color
|
** Customize the progress-bar color
|
||||||
*/
|
*/
|
||||||
loading: {
|
loading: {
|
||||||
color: "var(--ac-color)"
|
color: 'var(--ac-color)',
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Customize the loading indicator
|
** Customize the loading indicator
|
||||||
*/
|
*/
|
||||||
loadingIndicator: {
|
loadingIndicator: {
|
||||||
name: "pulse",
|
name: 'pulse',
|
||||||
color: "var(--ac-color)",
|
color: 'var(--ac-color)',
|
||||||
background: "var(--bg-color)"
|
background: 'var(--bg-color)',
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Global CSS
|
** Global CSS
|
||||||
*/
|
*/
|
||||||
css: [
|
css: ['~/assets/css/styles.scss', '~/assets/css/themes.scss', '~/assets/css/fonts.scss'],
|
||||||
"~/assets/css/styles.scss",
|
|
||||||
"~/assets/css/themes.scss",
|
|
||||||
"~/assets/css/fonts.scss"
|
|
||||||
],
|
|
||||||
/*
|
/*
|
||||||
** Plugins to load before mounting the App
|
** Plugins to load before mounting the App
|
||||||
*/
|
*/
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
src: "~/plugins/vuex-persist"
|
src: '~/plugins/vuex-persist',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: "~/plugins/v-tooltip"
|
src: '~/plugins/v-tooltip',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
/*
|
/*
|
||||||
** Nuxt.js dev-modules
|
** Nuxt.js dev-modules
|
||||||
@@ -236,136 +232,136 @@ export default {
|
|||||||
*/
|
*/
|
||||||
modules: [
|
modules: [
|
||||||
// See https://goo.gl/OOhYW5
|
// See https://goo.gl/OOhYW5
|
||||||
["@nuxtjs/pwa"],
|
['@nuxtjs/pwa'],
|
||||||
["@nuxtjs/axios"],
|
['@nuxtjs/axios'],
|
||||||
["@nuxtjs/toast"],
|
['@nuxtjs/toast'],
|
||||||
["@nuxtjs/google-analytics"],
|
['@nuxtjs/google-analytics'],
|
||||||
["@nuxtjs/sitemap"],
|
['@nuxtjs/sitemap'],
|
||||||
[
|
[
|
||||||
"@nuxtjs/google-tag-manager",
|
'@nuxtjs/google-tag-manager',
|
||||||
{
|
{
|
||||||
id: process.env.GTM_ID || "GTM-MXWD8NQ"
|
id: process.env.GTM_ID || 'GTM-MXWD8NQ',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
["@nuxtjs/robots"],
|
['@nuxtjs/robots'],
|
||||||
["nuxt-i18n"]
|
['nuxt-i18n'],
|
||||||
],
|
],
|
||||||
pwa: {
|
pwa: {
|
||||||
manifest: {
|
manifest: {
|
||||||
name: meta.name,
|
name: meta.name,
|
||||||
short_name: meta.name,
|
short_name: meta.name,
|
||||||
|
|
||||||
display: "standalone",
|
display: 'standalone',
|
||||||
|
|
||||||
theme_color: "#202124",
|
theme_color: '#202124',
|
||||||
background_color: "#202124",
|
background_color: '#202124',
|
||||||
start_url: `${routerBase.router.base}`
|
start_url: `${routerBase.router.base}`,
|
||||||
},
|
},
|
||||||
|
|
||||||
meta: {
|
meta: {
|
||||||
description: meta.shortDescription,
|
description: meta.shortDescription,
|
||||||
theme_color: "#202124"
|
theme_color: '#202124',
|
||||||
},
|
},
|
||||||
|
|
||||||
icons: (sizes => {
|
icons: (sizes => {
|
||||||
let icons = [];
|
let icons = []
|
||||||
for (let size of sizes) {
|
for (let size of sizes) {
|
||||||
icons.push({
|
icons.push({
|
||||||
src: `${routerBase.router.base}icons/icon-${size}x${size}.png`,
|
src: `${routerBase.router.base}icons/icon-${size}x${size}.png`,
|
||||||
type: "image/png",
|
type: 'image/png',
|
||||||
sizes: `${size}x${size}`
|
sizes: `${size}x${size}`,
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
return icons;
|
return icons
|
||||||
})([48, 72, 96, 144, 192, 512])
|
})([48, 72, 96, 144, 192, 512]),
|
||||||
},
|
},
|
||||||
toast: {
|
toast: {
|
||||||
position: "bottom-center",
|
position: 'bottom-center',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
theme: "bubble",
|
theme: 'bubble',
|
||||||
keepOnHover: true
|
keepOnHover: true,
|
||||||
},
|
},
|
||||||
googleAnalytics: {
|
googleAnalytics: {
|
||||||
id: process.env.GA_ID || "UA-61422507-2"
|
id: process.env.GA_ID || 'UA-61422507-2',
|
||||||
},
|
},
|
||||||
sitemap: {
|
sitemap: {
|
||||||
hostname: "https://postwoman.io"
|
hostname: 'https://postwoman.io',
|
||||||
},
|
},
|
||||||
robots: {
|
robots: {
|
||||||
UserAgent: "*",
|
UserAgent: '*',
|
||||||
Disallow: "",
|
Disallow: '',
|
||||||
Allow: "/",
|
Allow: '/',
|
||||||
Sitemap: "https://postwoman.io/sitemap.xml"
|
Sitemap: 'https://postwoman.io/sitemap.xml',
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
locales: [
|
locales: [
|
||||||
{
|
{
|
||||||
code: "en",
|
code: 'en',
|
||||||
name: "English",
|
name: 'English',
|
||||||
iso: "en-US",
|
iso: 'en-US',
|
||||||
file: "en-US.js"
|
file: 'en-US.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "es",
|
code: 'es',
|
||||||
name: "Español",
|
name: 'Español',
|
||||||
iso: "es-ES",
|
iso: 'es-ES',
|
||||||
file: "es-ES.js"
|
file: 'es-ES.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "fr",
|
code: 'fr',
|
||||||
name: "Français",
|
name: 'Français',
|
||||||
iso: "fr-FR",
|
iso: 'fr-FR',
|
||||||
file: "fr-FR.js"
|
file: 'fr-FR.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "fa",
|
code: 'fa',
|
||||||
name: "Farsi",
|
name: 'Farsi',
|
||||||
iso: "fa-IR",
|
iso: 'fa-IR',
|
||||||
file: "fa-IR.js"
|
file: 'fa-IR.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "pt",
|
code: 'pt',
|
||||||
name: "Português Brasileiro",
|
name: 'Português Brasileiro',
|
||||||
iso: "pt-BR",
|
iso: 'pt-BR',
|
||||||
file: "pt-BR.js"
|
file: 'pt-BR.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "cn",
|
code: 'cn',
|
||||||
name: "简体中文",
|
name: '简体中文',
|
||||||
iso: "zh-CN",
|
iso: 'zh-CN',
|
||||||
file: "zh-CN.js"
|
file: 'zh-CN.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "id",
|
code: 'id',
|
||||||
name: "Bahasa Indonesia",
|
name: 'Bahasa Indonesia',
|
||||||
iso: "id-ID",
|
iso: 'id-ID',
|
||||||
file: "id-ID.js"
|
file: 'id-ID.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "tr",
|
code: 'tr',
|
||||||
name: "Türkçe",
|
name: 'Türkçe',
|
||||||
iso: "tr-TR",
|
iso: 'tr-TR',
|
||||||
file: "tr-TR.js"
|
file: 'tr-TR.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "de",
|
code: 'de',
|
||||||
name: "Deutsch",
|
name: 'Deutsch',
|
||||||
iso: "de-DE",
|
iso: 'de-DE',
|
||||||
file: "de-DE.js"
|
file: 'de-DE.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: "ja",
|
code: 'ja',
|
||||||
name: "日本語",
|
name: '日本語',
|
||||||
iso: "ja-JP",
|
iso: 'ja-JP',
|
||||||
file: "ja-JP.js"
|
file: 'ja-JP.js',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
defaultLocale: "en",
|
defaultLocale: 'en',
|
||||||
vueI18n: {
|
vueI18n: {
|
||||||
fallbackLocale: "en"
|
fallbackLocale: 'en',
|
||||||
},
|
},
|
||||||
lazy: true,
|
lazy: true,
|
||||||
langDir: "lang/"
|
langDir: 'lang/',
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Build configuration
|
** Build configuration
|
||||||
@@ -374,16 +370,16 @@ export default {
|
|||||||
/*
|
/*
|
||||||
** You can extend webpack config here
|
** You can extend webpack config here
|
||||||
*/
|
*/
|
||||||
extend(config, ctx) {}
|
extend(config, ctx) {},
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Generate configuration
|
** Generate configuration
|
||||||
*/
|
*/
|
||||||
generate: {
|
generate: {
|
||||||
fallback: true
|
fallback: true,
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
** Router configuration
|
** Router configuration
|
||||||
*/
|
*/
|
||||||
...routerBase
|
...routerBase,
|
||||||
};
|
}
|
||||||
|
|||||||
240
pages/doc.vue
240
pages/doc.vue
@@ -4,20 +4,16 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p class="info">
|
<p class="info">
|
||||||
{{ $t("generate_docs_message") }}
|
{{ $t('generate_docs_message') }}
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="collectionUpload">
|
<label for="collectionUpload">
|
||||||
<button
|
<button class="icon" @click="$refs.collectionUpload.click()" v-tooltip="$t('json')">
|
||||||
class="icon"
|
|
||||||
@click="$refs.collectionUpload.click()"
|
|
||||||
v-tooltip="$t('json')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">folder</i>
|
<i class="material-icons">folder</i>
|
||||||
<span>{{ $t("import_collections") }}</span>
|
<span>{{ $t('import_collections') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
@@ -39,7 +35,7 @@
|
|||||||
fontSize: '16px',
|
fontSize: '16px',
|
||||||
autoScrollEditorIntoView: true,
|
autoScrollEditorIntoView: true,
|
||||||
showPrintMargin: false,
|
showPrintMargin: false,
|
||||||
useWorker: false
|
useWorker: false,
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
@@ -48,7 +44,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<button class="icon" @click="getDoc">
|
<button class="icon" @click="getDoc">
|
||||||
<i class="material-icons">book</i>
|
<i class="material-icons">book</i>
|
||||||
<span>{{ $t("generate_docs") }}</span>
|
<span>{{ $t('generate_docs') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -56,132 +52,108 @@
|
|||||||
|
|
||||||
<pw-section class="green" label="Documentation" ref="documentation">
|
<pw-section class="green" label="Documentation" ref="documentation">
|
||||||
<p v-if="this.items.length === 0" class="info">
|
<p v-if="this.items.length === 0" class="info">
|
||||||
{{ $t("generate_docs_first") }}
|
{{ $t('generate_docs_first') }}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<span
|
<span class="collection" v-for="(collection, index) in this.items" :key="index">
|
||||||
class="collection"
|
|
||||||
v-for="(collection, index) in this.items"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<h2>
|
<h2>
|
||||||
<i class="material-icons">folder</i>
|
<i class="material-icons">folder</i>
|
||||||
{{ collection.name || $t("none") }}
|
{{ collection.name || $t('none') }}
|
||||||
</h2>
|
</h2>
|
||||||
<span
|
<span class="folder" v-for="(folder, index) in collection.folders" :key="index">
|
||||||
class="folder"
|
|
||||||
v-for="(folder, index) in collection.folders"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<h3>
|
<h3>
|
||||||
<i class="material-icons">folder_open</i>
|
<i class="material-icons">folder_open</i>
|
||||||
{{ folder.name || $t("none") }}
|
{{ folder.name || $t('none') }}
|
||||||
</h3>
|
</h3>
|
||||||
<span
|
<span class="request" v-for="(request, index) in folder.requests" :key="index">
|
||||||
class="request"
|
|
||||||
v-for="(request, index) in folder.requests"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<h4>
|
<h4>
|
||||||
<i class="material-icons">insert_drive_file</i>
|
<i class="material-icons">insert_drive_file</i>
|
||||||
{{ request.name || $t("none") }}
|
{{ request.name || $t('none') }}
|
||||||
</h4>
|
</h4>
|
||||||
<p class="doc-desc" v-if="request.url">
|
<p class="doc-desc" v-if="request.url">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("url") }}: <code>{{ request.url || $t("none") }}</code>
|
{{ $t('url') }}: <code>{{ request.url || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.path">
|
<p class="doc-desc" v-if="request.path">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("path") }}:
|
{{ $t('path') }}:
|
||||||
<code>{{ request.path || $t("none") }}</code>
|
<code>{{ request.path || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.method">
|
<p class="doc-desc" v-if="request.method">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("method") }}:
|
{{ $t('method') }}:
|
||||||
<code>{{ request.method || $t("none") }}</code>
|
<code>{{ request.method || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.auth">
|
<p class="doc-desc" v-if="request.auth">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("authentication") }}:
|
{{ $t('authentication') }}:
|
||||||
<code>{{ request.auth || $t("none") }}</code>
|
<code>{{ request.auth || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.httpUser">
|
<p class="doc-desc" v-if="request.httpUser">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("username") }}:
|
{{ $t('username') }}:
|
||||||
<code>{{ request.httpUser || $t("none") }}</code>
|
<code>{{ request.httpUser || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.httpPassword">
|
<p class="doc-desc" v-if="request.httpPassword">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("password") }}:
|
{{ $t('password') }}:
|
||||||
<code>{{ request.httpPassword || $t("none") }}</code>
|
<code>{{ request.httpPassword || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.bearerToken">
|
<p class="doc-desc" v-if="request.bearerToken">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("token") }}:
|
{{ $t('token') }}:
|
||||||
<code>{{ request.bearerToken || $t("none") }}</code>
|
<code>{{ request.bearerToken || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<h4 v-if="request.headers.length > 0">{{ $t("headers") }}</h4>
|
<h4 v-if="request.headers.length > 0">{{ $t('headers') }}</h4>
|
||||||
<span v-if="request.headers">
|
<span v-if="request.headers">
|
||||||
<p
|
<p v-for="header in request.headers" :key="header.key" class="doc-desc">
|
||||||
v-for="header in request.headers"
|
|
||||||
:key="header.key"
|
|
||||||
class="doc-desc"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ header.key || $t("none") }}:
|
{{ header.key || $t('none') }}:
|
||||||
<code>{{ header.value || $t("none") }}</code>
|
<code>{{ header.value || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
<h4 v-if="request.params.length > 0">{{ $t("parameters") }}</h4>
|
<h4 v-if="request.params.length > 0">{{ $t('parameters') }}</h4>
|
||||||
<span v-if="request.params">
|
<span v-if="request.params">
|
||||||
<p
|
<p v-for="parameter in request.params" :key="parameter.key" class="doc-desc">
|
||||||
v-for="parameter in request.params"
|
|
||||||
:key="parameter.key"
|
|
||||||
class="doc-desc"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ parameter.key || $t("none") }}:
|
{{ parameter.key || $t('none') }}:
|
||||||
<code>{{ parameter.value || $t("none") }}</code>
|
<code>{{ parameter.value || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
<h4 v-if="request.bodyParam">{{ $t("payload") }}</h4>
|
<h4 v-if="request.bodyParam">{{ $t('payload') }}</h4>
|
||||||
<span v-if="request.bodyParam">
|
<span v-if="request.bodyParam">
|
||||||
<p
|
<p v-for="payload in request.bodyParam" :key="payload.key" class="doc-desc">
|
||||||
v-for="payload in request.bodyParam"
|
|
||||||
:key="payload.key"
|
|
||||||
class="doc-desc"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ payload.key || $t("none") }}:
|
{{ payload.key || $t('none') }}:
|
||||||
<code>{{ payload.value || $t("none") }}</code>
|
<code>{{ payload.value || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
<p class="doc-desc" v-if="request.rawParams">
|
<p class="doc-desc" v-if="request.rawParams">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("parameters") }}:
|
{{ $t('parameters') }}:
|
||||||
<code>{{ request.rawParams || $t("none") }}</code>
|
<code>{{ request.rawParams || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.contentType">
|
<p class="doc-desc" v-if="request.contentType">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("content_type") }}:
|
{{ $t('content_type') }}:
|
||||||
<code>{{ request.contentType || $t("none") }}</code>
|
<code>{{ request.contentType || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.requestType">
|
<p class="doc-desc" v-if="request.requestType">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("request_type") }}:
|
{{ $t('request_type') }}:
|
||||||
<code>{{ request.requestType || $t("none") }}</code>
|
<code>{{ request.requestType || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
@@ -193,103 +165,91 @@
|
|||||||
>
|
>
|
||||||
<h4>
|
<h4>
|
||||||
<i class="material-icons">insert_drive_file</i>
|
<i class="material-icons">insert_drive_file</i>
|
||||||
{{ request.name || $t("none") }}
|
{{ request.name || $t('none') }}
|
||||||
</h4>
|
</h4>
|
||||||
<p class="doc-desc" v-if="request.url">
|
<p class="doc-desc" v-if="request.url">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("url") }}: <code>{{ request.url || $t("none") }}</code>
|
{{ $t('url') }}: <code>{{ request.url || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.path">
|
<p class="doc-desc" v-if="request.path">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("path") }}: <code>{{ request.path || $t("none") }}</code>
|
{{ $t('path') }}: <code>{{ request.path || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.method">
|
<p class="doc-desc" v-if="request.method">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("method") }}:
|
{{ $t('method') }}:
|
||||||
<code>{{ request.method || $t("none") }}</code>
|
<code>{{ request.method || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.auth">
|
<p class="doc-desc" v-if="request.auth">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("authentication") }}:
|
{{ $t('authentication') }}:
|
||||||
<code>{{ request.auth || $t("none") }}</code>
|
<code>{{ request.auth || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.httpUser">
|
<p class="doc-desc" v-if="request.httpUser">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("username") }}:
|
{{ $t('username') }}:
|
||||||
<code>{{ request.httpUser || $t("none") }}</code>
|
<code>{{ request.httpUser || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.httpPassword">
|
<p class="doc-desc" v-if="request.httpPassword">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("password") }}:
|
{{ $t('password') }}:
|
||||||
<code>{{ request.httpPassword || $t("none") }}</code>
|
<code>{{ request.httpPassword || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.bearerToken">
|
<p class="doc-desc" v-if="request.bearerToken">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("token") }}:
|
{{ $t('token') }}:
|
||||||
<code>{{ request.bearerToken || $t("none") }}</code>
|
<code>{{ request.bearerToken || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<h4 v-if="request.headers.length > 0">{{ $t("headers") }}</h4>
|
<h4 v-if="request.headers.length > 0">{{ $t('headers') }}</h4>
|
||||||
<span v-if="request.headers">
|
<span v-if="request.headers">
|
||||||
<p
|
<p v-for="header in request.headers" :key="header.key" class="doc-desc">
|
||||||
v-for="header in request.headers"
|
|
||||||
:key="header.key"
|
|
||||||
class="doc-desc"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ header.key || $t("none") }}:
|
{{ header.key || $t('none') }}:
|
||||||
<code>{{ header.value || $t("none") }}</code>
|
<code>{{ header.value || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
<h4 v-if="request.params.length > 0">{{ $t("parameters") }}</h4>
|
<h4 v-if="request.params.length > 0">{{ $t('parameters') }}</h4>
|
||||||
<span v-if="request.params">
|
<span v-if="request.params">
|
||||||
<p
|
<p v-for="parameter in request.params" :key="parameter.key" class="doc-desc">
|
||||||
v-for="parameter in request.params"
|
|
||||||
:key="parameter.key"
|
|
||||||
class="doc-desc"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ parameter.key || $t("none") }}:
|
{{ parameter.key || $t('none') }}:
|
||||||
<code>{{ parameter.value || $t("none") }}</code>
|
<code>{{ parameter.value || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
<h4 v-if="request.bodyParam">{{ $t("payload") }}</h4>
|
<h4 v-if="request.bodyParam">{{ $t('payload') }}</h4>
|
||||||
<span v-if="request.bodyParam">
|
<span v-if="request.bodyParam">
|
||||||
<p
|
<p v-for="payload in request.bodyParam" :key="payload.key" class="doc-desc">
|
||||||
v-for="payload in request.bodyParam"
|
|
||||||
:key="payload.key"
|
|
||||||
class="doc-desc"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ payload.key || $t("none") }}:
|
{{ payload.key || $t('none') }}:
|
||||||
<code>{{ payload.value || $t("none") }}</code>
|
<code>{{ payload.value || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
<p class="doc-desc" v-if="request.rawParams">
|
<p class="doc-desc" v-if="request.rawParams">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("parameters") }}:
|
{{ $t('parameters') }}:
|
||||||
<code>{{ request.rawParams || $t("none") }}</code>
|
<code>{{ request.rawParams || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.contentType">
|
<p class="doc-desc" v-if="request.contentType">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("content_type") }}:
|
{{ $t('content_type') }}:
|
||||||
<code>{{ request.contentType || $t("none") }}</code>
|
<code>{{ request.contentType || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="doc-desc" v-if="request.requestType">
|
<p class="doc-desc" v-if="request.requestType">
|
||||||
<span>
|
<span>
|
||||||
{{ $t("request_type") }}:
|
{{ $t('request_type') }}:
|
||||||
<code>{{ request.requestType || $t("none") }}</code>
|
<code>{{ request.requestType || $t('none') }}</code>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
@@ -342,53 +302,53 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AceEditor from "../components/ace-editor";
|
import AceEditor from '../components/ace-editor'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"pw-section": () => import("../components/section"),
|
'pw-section': () => import('../components/section'),
|
||||||
Editor: AceEditor
|
Editor: AceEditor,
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
collectionJSON: "[]",
|
collectionJSON: '[]',
|
||||||
items: []
|
items: [],
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
uploadCollection() {
|
uploadCollection() {
|
||||||
this.rawInput = true;
|
this.rawInput = true
|
||||||
let file = this.$refs.collectionUpload.files[0];
|
let file = this.$refs.collectionUpload.files[0]
|
||||||
if (file !== undefined && file !== null) {
|
if (file !== undefined && file !== null) {
|
||||||
let reader = new FileReader();
|
let reader = new FileReader()
|
||||||
reader.onload = ({ target }) => {
|
reader.onload = ({ target }) => {
|
||||||
this.collectionJSON = target.result;
|
this.collectionJSON = target.result
|
||||||
};
|
}
|
||||||
reader.readAsText(file);
|
reader.readAsText(file)
|
||||||
this.$toast.info(this.$t("file_imported"), {
|
this.$toast.info(this.$t('file_imported'), {
|
||||||
icon: "attach_file"
|
icon: 'attach_file',
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$toast.error(this.$t("choose_file"), {
|
this.$toast.error(this.$t('choose_file'), {
|
||||||
icon: "attach_file"
|
icon: 'attach_file',
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getDoc() {
|
getDoc() {
|
||||||
try {
|
try {
|
||||||
this.items = JSON.parse(this.collectionJSON);
|
this.items = JSON.parse(this.collectionJSON)
|
||||||
this.$toast.info(this.$t("docs_generated"), {
|
this.$toast.info(this.$t('docs_generated'), {
|
||||||
icon: "book"
|
icon: 'book',
|
||||||
});
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$toast.error(e, {
|
this.$toast.error(e, {
|
||||||
icon: "code"
|
icon: 'code',
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,19 +5,14 @@
|
|||||||
<pw-section class="blue" :label="$t('endpoint')" ref="endpoint">
|
<pw-section class="blue" :label="$t('endpoint')" ref="endpoint">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="url">{{ $t("url") }}</label>
|
<label for="url">{{ $t('url') }}</label>
|
||||||
<input
|
<input id="url" type="url" v-model="url" @keyup.enter="getSchema()" />
|
||||||
id="url"
|
|
||||||
type="url"
|
|
||||||
v-model="url"
|
|
||||||
@keyup.enter="getSchema()"
|
|
||||||
/>
|
|
||||||
</li>
|
</li>
|
||||||
<div>
|
<div>
|
||||||
<li>
|
<li>
|
||||||
<label for="get" class="hide-on-small-screen"> </label>
|
<label for="get" class="hide-on-small-screen"> </label>
|
||||||
<button id="get" name="get" @click="getSchema">
|
<button id="get" name="get" @click="getSchema">
|
||||||
{{ $t("get_schema") }}
|
{{ $t('get_schema') }}
|
||||||
<span><i class="material-icons">send</i></span>
|
<span><i class="material-icons">send</i></span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
@@ -29,13 +24,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="headerList">{{ $t("header_list") }}</label>
|
<label for="headerList">{{ $t('header_list') }}</label>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="headers = []" v-tooltip.bottom="$t('clear')">
|
||||||
class="icon"
|
|
||||||
@click="headers = []"
|
|
||||||
v-tooltip.bottom="$t('clear')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,7 +51,7 @@
|
|||||||
@input="
|
@input="
|
||||||
$store.commit('setGQLHeaderKey', {
|
$store.commit('setGQLHeaderKey', {
|
||||||
index,
|
index,
|
||||||
value: $event
|
value: $event,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
autofocus
|
autofocus
|
||||||
@@ -74,7 +65,7 @@
|
|||||||
@change="
|
@change="
|
||||||
$store.commit('setGQLHeaderValue', {
|
$store.commit('setGQLHeaderValue', {
|
||||||
index,
|
index,
|
||||||
value: $event.target.value
|
value: $event.target.value,
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
autofocus
|
autofocus
|
||||||
@@ -97,7 +88,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<button class="icon" @click="addRequestHeader">
|
<button class="icon" @click="addRequestHeader">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
<span>{{ $t("add_new") }}</span>
|
<span>{{ $t('add_new') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -105,20 +96,18 @@
|
|||||||
|
|
||||||
<pw-section class="green" :label="$t('schema')" ref="schema">
|
<pw-section class="green" :label="$t('schema')" ref="schema">
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label>{{ $t("response") }}</label>
|
<label>{{ $t('response') }}</label>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="ToggleExpandResponse"
|
@click="ToggleExpandResponse"
|
||||||
ref="ToggleExpandResponse"
|
ref="ToggleExpandResponse"
|
||||||
v-tooltip="{
|
v-tooltip="{
|
||||||
content: !expandResponse
|
content: !expandResponse ? $t('expand_response') : $t('collapse_response'),
|
||||||
? $t('expand_response')
|
|
||||||
: $t('collapse_response')
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<i class="material-icons">
|
<i class="material-icons">
|
||||||
{{ !expandResponse ? "unfold_more" : "unfold_less" }}
|
{{ !expandResponse ? 'unfold_more' : 'unfold_less' }}
|
||||||
</i>
|
</i>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -149,20 +138,16 @@
|
|||||||
autoScrollEditorIntoView: true,
|
autoScrollEditorIntoView: true,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
showPrintMargin: false,
|
showPrintMargin: false,
|
||||||
useWorker: false
|
useWorker: false,
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
|
|
||||||
<pw-section class="cyan" :label="$t('query')" ref="query">
|
<pw-section class="cyan" :label="$t('query')" ref="query">
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="gqlQuery">{{ $t("query") }}</label>
|
<label for="gqlQuery">{{ $t('query') }}</label>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button class="icon" @click="runQuery()" v-tooltip.bottom="$t('run_query')">
|
||||||
class="icon"
|
|
||||||
@click="runQuery()"
|
|
||||||
v-tooltip.bottom="$t('run_query')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">play_arrow</i>
|
<i class="material-icons">play_arrow</i>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -184,7 +169,7 @@
|
|||||||
fontSize: '16px',
|
fontSize: '16px',
|
||||||
autoScrollEditorIntoView: true,
|
autoScrollEditorIntoView: true,
|
||||||
showPrintMargin: false,
|
showPrintMargin: false,
|
||||||
useWorker: false
|
useWorker: false,
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
@@ -199,14 +184,14 @@
|
|||||||
fontSize: '16px',
|
fontSize: '16px',
|
||||||
autoScrollEditorIntoView: true,
|
autoScrollEditorIntoView: true,
|
||||||
showPrintMargin: false,
|
showPrintMargin: false,
|
||||||
useWorker: false
|
useWorker: false,
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
|
|
||||||
<pw-section class="purple" label="Response" ref="response">
|
<pw-section class="purple" label="Response" ref="response">
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="responseField">{{ $t("response") }}</label>
|
<label for="responseField">{{ $t('response') }}</label>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
@@ -228,7 +213,7 @@
|
|||||||
autoScrollEditorIntoView: true,
|
autoScrollEditorIntoView: true,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
showPrintMargin: false,
|
showPrintMargin: false,
|
||||||
useWorker: false
|
useWorker: false,
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
@@ -244,14 +229,11 @@
|
|||||||
checked="checked"
|
checked="checked"
|
||||||
/>
|
/>
|
||||||
<label v-if="queryFields.length > 0" for="queries-tab">
|
<label v-if="queryFields.length > 0" for="queries-tab">
|
||||||
{{ $t("queries") }}
|
{{ $t('queries') }}
|
||||||
</label>
|
</label>
|
||||||
<div v-if="queryFields.length > 0" class="tab">
|
<div v-if="queryFields.length > 0" class="tab">
|
||||||
<div v-for="field in queryFields" :key="field.name">
|
<div v-for="field in queryFields" :key="field.name">
|
||||||
<gql-field
|
<gql-field :gqlField="field" :jumpTypeCallback="handleJumpToType" />
|
||||||
:gqlField="field"
|
|
||||||
:jumpTypeCallback="handleJumpToType"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -263,14 +245,11 @@
|
|||||||
checked="checked"
|
checked="checked"
|
||||||
/>
|
/>
|
||||||
<label v-if="mutationFields.length > 0" for="mutations-tab">
|
<label v-if="mutationFields.length > 0" for="mutations-tab">
|
||||||
{{ $t("mutations") }}
|
{{ $t('mutations') }}
|
||||||
</label>
|
</label>
|
||||||
<div v-if="mutationFields.length > 0" class="tab">
|
<div v-if="mutationFields.length > 0" class="tab">
|
||||||
<div v-for="field in mutationFields" :key="field.name">
|
<div v-for="field in mutationFields" :key="field.name">
|
||||||
<gql-field
|
<gql-field :gqlField="field" :jumpTypeCallback="handleJumpToType" />
|
||||||
:gqlField="field"
|
|
||||||
:jumpTypeCallback="handleJumpToType"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -282,14 +261,11 @@
|
|||||||
checked="checked"
|
checked="checked"
|
||||||
/>
|
/>
|
||||||
<label v-if="subscriptionFields.length > 0" for="subscriptions-tab">
|
<label v-if="subscriptionFields.length > 0" for="subscriptions-tab">
|
||||||
{{ $t("subscriptions") }}
|
{{ $t('subscriptions') }}
|
||||||
</label>
|
</label>
|
||||||
<div v-if="subscriptionFields.length > 0" class="tab">
|
<div v-if="subscriptionFields.length > 0" class="tab">
|
||||||
<div v-for="field in subscriptionFields" :key="field.name">
|
<div v-for="field in subscriptionFields" :key="field.name">
|
||||||
<gql-field
|
<gql-field :gqlField="field" :jumpTypeCallback="handleJumpToType" />
|
||||||
:gqlField="field"
|
|
||||||
:jumpTypeCallback="handleJumpToType"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -301,18 +277,11 @@
|
|||||||
checked="checked"
|
checked="checked"
|
||||||
/>
|
/>
|
||||||
<label v-if="gqlTypes.length > 0" for="gqltypes-tab">
|
<label v-if="gqlTypes.length > 0" for="gqltypes-tab">
|
||||||
{{ $t("types") }}
|
{{ $t('types') }}
|
||||||
</label>
|
</label>
|
||||||
<div v-if="gqlTypes.length > 0" class="tab">
|
<div v-if="gqlTypes.length > 0" class="tab">
|
||||||
<div
|
<div v-for="type in gqlTypes" :key="type.name" :id="`type_${type.name}`">
|
||||||
v-for="type in gqlTypes"
|
<gql-type :gqlType="type" :jumpTypeCallback="handleJumpToType" />
|
||||||
:key="type.name"
|
|
||||||
:id="`type_${type.name}`"
|
|
||||||
>
|
|
||||||
<gql-type
|
|
||||||
:gqlType="type"
|
|
||||||
:jumpTypeCallback="handleJumpToType"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -326,7 +295,7 @@
|
|||||||
"
|
"
|
||||||
class="info"
|
class="info"
|
||||||
>
|
>
|
||||||
{{ $t("send_request_first") }}
|
{{ $t('send_request_first') }}
|
||||||
</p>
|
</p>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
</aside>
|
</aside>
|
||||||
@@ -342,373 +311,352 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios";
|
import axios from 'axios'
|
||||||
import * as gql from "graphql";
|
import * as gql from 'graphql'
|
||||||
import textareaAutoHeight from "../directives/textareaAutoHeight";
|
import textareaAutoHeight from '../directives/textareaAutoHeight'
|
||||||
import { commonHeaders } from "../functions/headers";
|
import { commonHeaders } from '../functions/headers'
|
||||||
import AceEditor from "../components/ace-editor";
|
import AceEditor from '../components/ace-editor'
|
||||||
import QueryEditor from "../components/graphql/queryeditor";
|
import QueryEditor from '../components/graphql/queryeditor'
|
||||||
import { sendNetworkRequest } from "../functions/network";
|
import { sendNetworkRequest } from '../functions/network'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
directives: {
|
directives: {
|
||||||
textareaAutoHeight
|
textareaAutoHeight,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
"pw-section": () => import("../components/section"),
|
'pw-section': () => import('../components/section'),
|
||||||
"gql-field": () => import("../components/graphql/field"),
|
'gql-field': () => import('../components/graphql/field'),
|
||||||
"gql-type": () => import("../components/graphql/type"),
|
'gql-type': () => import('../components/graphql/type'),
|
||||||
autocomplete: () => import("../components/autocomplete"),
|
autocomplete: () => import('../components/autocomplete'),
|
||||||
Editor: AceEditor,
|
Editor: AceEditor,
|
||||||
QueryEditor: QueryEditor
|
QueryEditor: QueryEditor,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
schemaString: "",
|
schemaString: '',
|
||||||
commonHeaders,
|
commonHeaders,
|
||||||
queryFields: [],
|
queryFields: [],
|
||||||
mutationFields: [],
|
mutationFields: [],
|
||||||
subscriptionFields: [],
|
subscriptionFields: [],
|
||||||
gqlTypes: [],
|
gqlTypes: [],
|
||||||
responseString: "",
|
responseString: '',
|
||||||
copyButton: '<i class="material-icons">file_copy</i>',
|
copyButton: '<i class="material-icons">file_copy</i>',
|
||||||
downloadButton: '<i class="material-icons">get_app</i>',
|
downloadButton: '<i class="material-icons">get_app</i>',
|
||||||
doneButton: '<i class="material-icons">done</i>',
|
doneButton: '<i class="material-icons">done</i>',
|
||||||
expandResponse: false,
|
expandResponse: false,
|
||||||
responseBodyMaxLines: 16
|
responseBodyMaxLines: 16,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
url: {
|
url: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.gql.url;
|
return this.$store.state.gql.url
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$store.commit("setGQLState", { value, attribute: "url" });
|
this.$store.commit('setGQLState', { value, attribute: 'url' })
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.gql.headers;
|
return this.$store.state.gql.headers
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$store.commit("setGQLState", { value, attribute: "headers" });
|
this.$store.commit('setGQLState', { value, attribute: 'headers' })
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
gqlQueryString: {
|
gqlQueryString: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.gql.query;
|
return this.$store.state.gql.query
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$store.commit("setGQLState", { value, attribute: "query" });
|
this.$store.commit('setGQLState', { value, attribute: 'query' })
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
variableString: {
|
variableString: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.gql.variablesJSONString;
|
return this.$store.state.gql.variablesJSONString
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
this.$store.commit("setGQLState", {
|
this.$store.commit('setGQLState', {
|
||||||
value,
|
value,
|
||||||
attribute: "variablesJSONString"
|
attribute: 'variablesJSONString',
|
||||||
});
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
headerString() {
|
headerString() {
|
||||||
const result = this.headers
|
const result = this.headers
|
||||||
.filter(({ key }) => !!key)
|
.filter(({ key }) => !!key)
|
||||||
.map(({ key, value }) => `${key}: ${value}`)
|
.map(({ key, value }) => `${key}: ${value}`)
|
||||||
.join(",\n");
|
.join(',\n')
|
||||||
return result === "" ? "" : `${result}`;
|
return result === '' ? '' : `${result}`
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleJumpToType(type) {
|
handleJumpToType(type) {
|
||||||
const typesTab = document.getElementById("gqltypes-tab");
|
const typesTab = document.getElementById('gqltypes-tab')
|
||||||
typesTab.checked = true;
|
typesTab.checked = true
|
||||||
|
|
||||||
const rootTypeName = this.resolveRootType(type).name;
|
const rootTypeName = this.resolveRootType(type).name
|
||||||
|
|
||||||
const target = document.getElementById(`type_${rootTypeName}`);
|
const target = document.getElementById(`type_${rootTypeName}`)
|
||||||
if (target && this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED) {
|
if (target && this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED) {
|
||||||
target.scrollIntoView({
|
target.scrollIntoView({
|
||||||
behavior: "smooth"
|
behavior: 'smooth',
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolveRootType(type) {
|
resolveRootType(type) {
|
||||||
let t = type;
|
let t = type
|
||||||
while (t.ofType != null) t = t.ofType;
|
while (t.ofType != null) t = t.ofType
|
||||||
return t;
|
return t
|
||||||
},
|
},
|
||||||
copySchema() {
|
copySchema() {
|
||||||
this.$refs.copySchemaCode.innerHTML = this.doneButton;
|
this.$refs.copySchemaCode.innerHTML = this.doneButton
|
||||||
const aux = document.createElement("textarea");
|
const aux = document.createElement('textarea')
|
||||||
aux.innerText = this.schemaString;
|
aux.innerText = this.schemaString
|
||||||
document.body.appendChild(aux);
|
document.body.appendChild(aux)
|
||||||
aux.select();
|
aux.select()
|
||||||
document.execCommand("copy");
|
document.execCommand('copy')
|
||||||
document.body.removeChild(aux);
|
document.body.removeChild(aux)
|
||||||
this.$toast.success(this.$t("copied_to_clipboard"), {
|
this.$toast.success(this.$t('copied_to_clipboard'), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
setTimeout(
|
setTimeout(() => (this.$refs.copySchemaCode.innerHTML = this.copyButton), 1000)
|
||||||
() => (this.$refs.copySchemaCode.innerHTML = this.copyButton),
|
|
||||||
1000
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
copyQuery() {
|
copyQuery() {
|
||||||
this.$refs.copyQueryButton.innerHTML = this.doneButton;
|
this.$refs.copyQueryButton.innerHTML = this.doneButton
|
||||||
const aux = document.createElement("textarea");
|
const aux = document.createElement('textarea')
|
||||||
aux.innerText = this.gqlQueryString;
|
aux.innerText = this.gqlQueryString
|
||||||
document.body.appendChild(aux);
|
document.body.appendChild(aux)
|
||||||
aux.select();
|
aux.select()
|
||||||
document.execCommand("copy");
|
document.execCommand('copy')
|
||||||
document.body.removeChild(aux);
|
document.body.removeChild(aux)
|
||||||
this.$toast.success(this.$t("copied_to_clipboard"), {
|
this.$toast.success(this.$t('copied_to_clipboard'), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
setTimeout(
|
setTimeout(() => (this.$refs.copyQueryButton.innerHTML = this.copyButton), 1000)
|
||||||
() => (this.$refs.copyQueryButton.innerHTML = this.copyButton),
|
|
||||||
1000
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
copyResponse() {
|
copyResponse() {
|
||||||
this.$refs.copyResponseButton.innerHTML = this.doneButton;
|
this.$refs.copyResponseButton.innerHTML = this.doneButton
|
||||||
const aux = document.createElement("textarea");
|
const aux = document.createElement('textarea')
|
||||||
aux.innerText = this.responseString;
|
aux.innerText = this.responseString
|
||||||
document.body.appendChild(aux);
|
document.body.appendChild(aux)
|
||||||
aux.select();
|
aux.select()
|
||||||
document.execCommand("copy");
|
document.execCommand('copy')
|
||||||
document.body.removeChild(aux);
|
document.body.removeChild(aux)
|
||||||
this.$toast.success(this.$t("copied_to_clipboard"), {
|
this.$toast.success(this.$t('copied_to_clipboard'), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
setTimeout(
|
setTimeout(() => (this.$refs.copyResponseButton.innerHTML = this.copyButton), 1000)
|
||||||
() => (this.$refs.copyResponseButton.innerHTML = this.copyButton),
|
|
||||||
1000
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
async runQuery() {
|
async runQuery() {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now()
|
||||||
|
|
||||||
this.$nuxt.$loading.start();
|
this.$nuxt.$loading.start()
|
||||||
this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED &&
|
this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED && this.scrollInto('response')
|
||||||
this.scrollInto("response");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let headers = {};
|
let headers = {}
|
||||||
this.headers.forEach(header => {
|
this.headers.forEach(header => {
|
||||||
headers[header.key] = header.value;
|
headers[header.key] = header.value
|
||||||
});
|
})
|
||||||
|
|
||||||
let variables = JSON.parse(this.variableString);
|
let variables = JSON.parse(this.variableString)
|
||||||
|
|
||||||
const gqlQueryString = this.gqlQueryString;
|
const gqlQueryString = this.gqlQueryString
|
||||||
|
|
||||||
const reqOptions = {
|
const reqOptions = {
|
||||||
method: "post",
|
method: 'post',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
headers: {
|
headers: {
|
||||||
...headers,
|
...headers,
|
||||||
"content-type": "application/json"
|
'content-type': 'application/json',
|
||||||
},
|
},
|
||||||
data: JSON.stringify({ query: gqlQueryString, variables })
|
data: JSON.stringify({ query: gqlQueryString, variables }),
|
||||||
};
|
}
|
||||||
|
|
||||||
const data = await sendNetworkRequest(reqOptions, this.$store);
|
const data = await sendNetworkRequest(reqOptions, this.$store)
|
||||||
|
|
||||||
this.responseString = JSON.stringify(data.data, null, 2);
|
this.responseString = JSON.stringify(data.data, null, 2)
|
||||||
|
|
||||||
this.$nuxt.$loading.finish();
|
this.$nuxt.$loading.finish()
|
||||||
const duration = Date.now() - startTime;
|
const duration = Date.now() - startTime
|
||||||
this.$toast.info(this.$t("finished_in", { duration }), {
|
this.$toast.info(this.$t('finished_in', { duration }), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$nuxt.$loading.finish();
|
this.$nuxt.$loading.finish()
|
||||||
|
|
||||||
this.$toast.error(`${error} ${this.$t("f12_details")}`, {
|
this.$toast.error(`${error} ${this.$t('f12_details')}`, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
console.log("Error", error);
|
console.log('Error', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getSchema() {
|
async getSchema() {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now()
|
||||||
this.schemaString = this.$t("loading");
|
this.schemaString = this.$t('loading')
|
||||||
this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED &&
|
this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED && this.scrollInto('schema')
|
||||||
this.scrollInto("schema");
|
|
||||||
|
|
||||||
// Start showing the loading bar as soon as possible.
|
// Start showing the loading bar as soon as possible.
|
||||||
// The nuxt axios module will hide it when the request is made.
|
// The nuxt axios module will hide it when the request is made.
|
||||||
this.$nuxt.$loading.start();
|
this.$nuxt.$loading.start()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const query = JSON.stringify({
|
const query = JSON.stringify({
|
||||||
query: gql.getIntrospectionQuery()
|
query: gql.getIntrospectionQuery(),
|
||||||
});
|
})
|
||||||
|
|
||||||
let headers = {};
|
let headers = {}
|
||||||
this.headers.forEach(header => {
|
this.headers.forEach(header => {
|
||||||
headers[header.key] = header.value;
|
headers[header.key] = header.value
|
||||||
});
|
})
|
||||||
|
|
||||||
const reqOptions = {
|
const reqOptions = {
|
||||||
method: "post",
|
method: 'post',
|
||||||
url: this.url,
|
url: this.url,
|
||||||
headers: {
|
headers: {
|
||||||
...headers,
|
...headers,
|
||||||
"content-type": "application/json"
|
'content-type': 'application/json',
|
||||||
},
|
},
|
||||||
data: query
|
data: query,
|
||||||
};
|
}
|
||||||
|
|
||||||
// console.log(reqOptions);
|
// console.log(reqOptions);
|
||||||
|
|
||||||
const reqConfig = this.$store.state.postwoman.settings.PROXY_ENABLED
|
const reqConfig = this.$store.state.postwoman.settings.PROXY_ENABLED
|
||||||
? {
|
? {
|
||||||
method: "post",
|
method: 'post',
|
||||||
url:
|
url:
|
||||||
this.$store.state.postwoman.settings.PROXY_URL ||
|
this.$store.state.postwoman.settings.PROXY_URL || `https://postwoman.apollotv.xyz/`,
|
||||||
`https://postwoman.apollotv.xyz/`,
|
data: reqOptions,
|
||||||
data: reqOptions
|
|
||||||
}
|
}
|
||||||
: reqOptions;
|
: reqOptions
|
||||||
|
|
||||||
const res = await axios(reqConfig);
|
const res = await axios(reqConfig)
|
||||||
|
|
||||||
const data = this.$store.state.postwoman.settings.PROXY_ENABLED
|
const data = this.$store.state.postwoman.settings.PROXY_ENABLED ? res.data : res
|
||||||
? res.data
|
|
||||||
: res;
|
|
||||||
|
|
||||||
const schema = gql.buildClientSchema(data.data.data);
|
const schema = gql.buildClientSchema(data.data.data)
|
||||||
this.schemaString = gql.printSchema(schema, {
|
this.schemaString = gql.printSchema(schema, {
|
||||||
commentDescriptions: true
|
commentDescriptions: true,
|
||||||
});
|
})
|
||||||
|
|
||||||
if (schema.getQueryType()) {
|
if (schema.getQueryType()) {
|
||||||
const fields = schema.getQueryType().getFields();
|
const fields = schema.getQueryType().getFields()
|
||||||
const qFields = [];
|
const qFields = []
|
||||||
for (const field in fields) {
|
for (const field in fields) {
|
||||||
qFields.push(fields[field]);
|
qFields.push(fields[field])
|
||||||
}
|
}
|
||||||
this.queryFields = qFields;
|
this.queryFields = qFields
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.getMutationType()) {
|
if (schema.getMutationType()) {
|
||||||
const fields = schema.getMutationType().getFields();
|
const fields = schema.getMutationType().getFields()
|
||||||
const mFields = [];
|
const mFields = []
|
||||||
for (const field in fields) {
|
for (const field in fields) {
|
||||||
mFields.push(fields[field]);
|
mFields.push(fields[field])
|
||||||
}
|
}
|
||||||
this.mutationFields = mFields;
|
this.mutationFields = mFields
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.getSubscriptionType()) {
|
if (schema.getSubscriptionType()) {
|
||||||
const fields = schema.getSubscriptionType().getFields();
|
const fields = schema.getSubscriptionType().getFields()
|
||||||
const sFields = [];
|
const sFields = []
|
||||||
for (const field in fields) {
|
for (const field in fields) {
|
||||||
sFields.push(fields[field]);
|
sFields.push(fields[field])
|
||||||
}
|
}
|
||||||
this.subscriptionFields = sFields;
|
this.subscriptionFields = sFields
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeMap = schema.getTypeMap();
|
const typeMap = schema.getTypeMap()
|
||||||
const types = [];
|
const types = []
|
||||||
|
|
||||||
const queryTypeName = schema.getQueryType()
|
const queryTypeName = schema.getQueryType() ? schema.getQueryType().name : ''
|
||||||
? schema.getQueryType().name
|
const mutationTypeName = schema.getMutationType() ? schema.getMutationType().name : ''
|
||||||
: "";
|
|
||||||
const mutationTypeName = schema.getMutationType()
|
|
||||||
? schema.getMutationType().name
|
|
||||||
: "";
|
|
||||||
const subscriptionTypeName = schema.getSubscriptionType()
|
const subscriptionTypeName = schema.getSubscriptionType()
|
||||||
? schema.getSubscriptionType().name
|
? schema.getSubscriptionType().name
|
||||||
: "";
|
: ''
|
||||||
|
|
||||||
for (const type in typeMap) {
|
for (const type in typeMap) {
|
||||||
if (
|
if (
|
||||||
!typeMap[type].name.startsWith("__") &&
|
!typeMap[type].name.startsWith('__') &&
|
||||||
![queryTypeName, mutationTypeName, subscriptionTypeName].includes(
|
![queryTypeName, mutationTypeName, subscriptionTypeName].includes(typeMap[type].name) &&
|
||||||
typeMap[type].name
|
|
||||||
) &&
|
|
||||||
typeMap[type] instanceof gql.GraphQLObjectType
|
typeMap[type] instanceof gql.GraphQLObjectType
|
||||||
) {
|
) {
|
||||||
types.push(typeMap[type]);
|
types.push(typeMap[type])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.gqlTypes = types;
|
this.gqlTypes = types
|
||||||
this.$refs.queryEditor.setValidationSchema(schema);
|
this.$refs.queryEditor.setValidationSchema(schema)
|
||||||
this.$nuxt.$loading.finish();
|
this.$nuxt.$loading.finish()
|
||||||
const duration = Date.now() - startTime;
|
const duration = Date.now() - startTime
|
||||||
this.$toast.info(this.$t("finished_in", { duration }), {
|
this.$toast.info(this.$t('finished_in', { duration }), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$nuxt.$loading.finish();
|
this.$nuxt.$loading.finish()
|
||||||
this.schemaString = `${error}. ${this.$t("check_console_details")}`;
|
this.schemaString = `${error}. ${this.$t('check_console_details')}`
|
||||||
this.$toast.error(`${error} ${this.$t("f12_details")}`, {
|
this.$toast.error(`${error} ${this.$t('f12_details')}`, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
console.log("Error", error);
|
console.log('Error', error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ToggleExpandResponse() {
|
ToggleExpandResponse() {
|
||||||
this.expandResponse = !this.expandResponse;
|
this.expandResponse = !this.expandResponse
|
||||||
this.responseBodyMaxLines =
|
this.responseBodyMaxLines = this.responseBodyMaxLines == Infinity ? 16 : Infinity
|
||||||
this.responseBodyMaxLines == Infinity ? 16 : Infinity;
|
|
||||||
},
|
},
|
||||||
downloadResponse() {
|
downloadResponse() {
|
||||||
const dataToWrite = JSON.stringify(this.schemaString, null, 2);
|
const dataToWrite = JSON.stringify(this.schemaString, null, 2)
|
||||||
const file = new Blob([dataToWrite], { type: "application/json" });
|
const file = new Blob([dataToWrite], { type: 'application/json' })
|
||||||
const a = document.createElement("a");
|
const a = document.createElement('a')
|
||||||
const url = URL.createObjectURL(file);
|
const url = URL.createObjectURL(file)
|
||||||
a.href = url;
|
a.href = url
|
||||||
a.download = `${this.url} on ${Date()}.graphql`.replace(/\./g, "[dot]");
|
a.download = `${this.url} on ${Date()}.graphql`.replace(/\./g, '[dot]')
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a)
|
||||||
a.click();
|
a.click()
|
||||||
this.$refs.downloadResponse.innerHTML = this.doneButton;
|
this.$refs.downloadResponse.innerHTML = this.doneButton
|
||||||
this.$toast.success(this.$t("download_started"), {
|
this.$toast.success(this.$t('download_started'), {
|
||||||
icon: "done"
|
icon: 'done',
|
||||||
});
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a)
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url)
|
||||||
this.$refs.downloadResponse.innerHTML = this.downloadButton;
|
this.$refs.downloadResponse.innerHTML = this.downloadButton
|
||||||
}, 1000);
|
}, 1000)
|
||||||
},
|
},
|
||||||
addRequestHeader(index) {
|
addRequestHeader(index) {
|
||||||
this.$store.commit("addGQLHeader", {
|
this.$store.commit('addGQLHeader', {
|
||||||
key: "",
|
key: '',
|
||||||
value: ""
|
value: '',
|
||||||
});
|
})
|
||||||
return false;
|
return false
|
||||||
},
|
},
|
||||||
removeRequestHeader(index) {
|
removeRequestHeader(index) {
|
||||||
// .slice() is used so we get a separate array, rather than just a reference
|
// .slice() is used so we get a separate array, rather than just a reference
|
||||||
const oldHeaders = this.headers.slice();
|
const oldHeaders = this.headers.slice()
|
||||||
|
|
||||||
this.$store.commit("removeGQLHeader", index);
|
this.$store.commit('removeGQLHeader', index)
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t('deleted'), {
|
||||||
icon: "delete",
|
icon: 'delete',
|
||||||
action: {
|
action: {
|
||||||
text: this.$t("undo"),
|
text: this.$t('undo'),
|
||||||
duration: 4000,
|
duration: 4000,
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
this.headers = oldHeaders;
|
this.headers = oldHeaders
|
||||||
toastObject.remove();
|
toastObject.remove()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
// console.log(oldHeaders);
|
// console.log(oldHeaders);
|
||||||
},
|
},
|
||||||
scrollInto(view) {
|
scrollInto(view) {
|
||||||
this.$refs[view].$el.scrollIntoView({
|
this.$refs[view].$el.scrollIntoView({
|
||||||
behavior: "smooth"
|
behavior: 'smooth',
|
||||||
});
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
1913
pages/index.vue
1913
pages/index.vue
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,12 @@
|
|||||||
<div class="page">
|
<div class="page">
|
||||||
<section id="options">
|
<section id="options">
|
||||||
<input id="tab-one" type="radio" name="options" checked="checked" />
|
<input id="tab-one" type="radio" name="options" checked="checked" />
|
||||||
<label for="tab-one">{{ $t("websocket") }}</label>
|
<label for="tab-one">{{ $t('websocket') }}</label>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<pw-section class="blue" :label="$t('request')" ref="request">
|
<pw-section class="blue" :label="$t('request')" ref="request">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="url">{{ $t("url") }}</label>
|
<label for="url">{{ $t('url') }}</label>
|
||||||
<input
|
<input
|
||||||
id="url"
|
id="url"
|
||||||
type="url"
|
type="url"
|
||||||
@@ -19,16 +19,11 @@
|
|||||||
<div>
|
<div>
|
||||||
<li>
|
<li>
|
||||||
<label for="connect" class="hide-on-small-screen"> </label>
|
<label for="connect" class="hide-on-small-screen"> </label>
|
||||||
<button
|
<button :disabled="!urlValid" id="connect" name="connect" @click="toggleConnection">
|
||||||
:disabled="!urlValid"
|
{{ !connectionState ? $t('connect') : $t('disconnect') }}
|
||||||
id="connect"
|
|
||||||
name="connect"
|
|
||||||
@click="toggleConnection"
|
|
||||||
>
|
|
||||||
{{ !connectionState ? $t("connect") : $t("disconnect") }}
|
|
||||||
<span>
|
<span>
|
||||||
<i class="material-icons">
|
<i class="material-icons">
|
||||||
{{ !connectionState ? "sync" : "sync_disabled" }}
|
{{ !connectionState ? 'sync' : 'sync_disabled' }}
|
||||||
</i>
|
</i>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -37,15 +32,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
|
|
||||||
<pw-section
|
<pw-section class="purple" :label="$t('communication')" id="response" ref="response">
|
||||||
class="purple"
|
|
||||||
:label="$t('communication')"
|
|
||||||
id="response"
|
|
||||||
ref="response"
|
|
||||||
>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="log">{{ $t("log") }}</label>
|
<label for="log">{{ $t('log') }}</label>
|
||||||
<div id="log" name="log" class="log">
|
<div id="log" name="log" class="log">
|
||||||
<span v-if="communication.log">
|
<span v-if="communication.log">
|
||||||
<span
|
<span
|
||||||
@@ -56,13 +46,13 @@
|
|||||||
}}{{ logEntry.payload }}</span
|
}}{{ logEntry.payload }}</span
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span v-else>{{ $t("waiting_for_connection") }}</span>
|
<span v-else>{{ $t('waiting_for_connection') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="message">{{ $t("message") }}</label>
|
<label for="message">{{ $t('message') }}</label>
|
||||||
<input
|
<input
|
||||||
id="message"
|
id="message"
|
||||||
name="message"
|
name="message"
|
||||||
@@ -75,13 +65,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<li>
|
<li>
|
||||||
<label for="send" class="hide-on-small-screen"> </label>
|
<label for="send" class="hide-on-small-screen"> </label>
|
||||||
<button
|
<button id="send" name="send" :disabled="!connectionState" @click="sendMessage">
|
||||||
id="send"
|
{{ $t('send') }}
|
||||||
name="send"
|
|
||||||
:disabled="!connectionState"
|
|
||||||
@click="sendMessage"
|
|
||||||
>
|
|
||||||
{{ $t("send") }}
|
|
||||||
<span>
|
<span>
|
||||||
<i class="material-icons">send</i>
|
<i class="material-icons">send</i>
|
||||||
</span>
|
</span>
|
||||||
@@ -92,12 +77,12 @@
|
|||||||
</pw-section>
|
</pw-section>
|
||||||
</div>
|
</div>
|
||||||
<input id="tab-two" type="radio" name="options" />
|
<input id="tab-two" type="radio" name="options" />
|
||||||
<label for="tab-two">{{ $t("sse") }}</label>
|
<label for="tab-two">{{ $t('sse') }}</label>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<pw-section class="blue" :label="$t('request')" ref="request">
|
<pw-section class="blue" :label="$t('request')" ref="request">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="server">{{ $t("server") }}</label>
|
<label for="server">{{ $t('server') }}</label>
|
||||||
<input
|
<input
|
||||||
id="server"
|
id="server"
|
||||||
type="url"
|
type="url"
|
||||||
@@ -115,10 +100,10 @@
|
|||||||
name="start"
|
name="start"
|
||||||
@click="toggleSSEConnection"
|
@click="toggleSSEConnection"
|
||||||
>
|
>
|
||||||
{{ !connectionSSEState ? $t("start") : $t("stop") }}
|
{{ !connectionSSEState ? $t('start') : $t('stop') }}
|
||||||
<span>
|
<span>
|
||||||
<i class="material-icons">
|
<i class="material-icons">
|
||||||
{{ !connectionSSEState ? "sync" : "sync_disabled" }}
|
{{ !connectionSSEState ? 'sync' : 'sync_disabled' }}
|
||||||
</i>
|
</i>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -127,15 +112,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</pw-section>
|
</pw-section>
|
||||||
|
|
||||||
<pw-section
|
<pw-section class="purple" :label="$t('communication')" id="response" ref="response">
|
||||||
class="purple"
|
|
||||||
:label="$t('communication')"
|
|
||||||
id="response"
|
|
||||||
ref="response"
|
|
||||||
>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="log">{{ $t("events") }}</label>
|
<label for="log">{{ $t('events') }}</label>
|
||||||
<div id="log" name="log" class="log">
|
<div id="log" name="log" class="log">
|
||||||
<span v-if="events.log">
|
<span v-if="events.log">
|
||||||
<span
|
<span
|
||||||
@@ -146,7 +126,7 @@
|
|||||||
}}{{ logEntry.payload }}</span
|
}}{{ logEntry.payload }}</span
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span v-else>{{ $t("waiting_for_connection") }}</span>
|
<span v-else>{{ $t('waiting_for_connection') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
</li>
|
</li>
|
||||||
@@ -171,7 +151,7 @@ div.log {
|
|||||||
&,
|
&,
|
||||||
span {
|
span {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: "Roboto Mono", monospace;
|
font-family: 'Roboto Mono', monospace;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,252 +167,251 @@ div.log {
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"pw-section": () => import("../components/section")
|
'pw-section': () => import('../components/section'),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
connectionState: false,
|
connectionState: false,
|
||||||
url: "wss://echo.websocket.org",
|
url: 'wss://echo.websocket.org',
|
||||||
socket: null,
|
socket: null,
|
||||||
communication: {
|
communication: {
|
||||||
log: null,
|
log: null,
|
||||||
input: ""
|
input: '',
|
||||||
},
|
},
|
||||||
connectionSSEState: false,
|
connectionSSEState: false,
|
||||||
server: "https://express-eventsource.herokuapp.com/events",
|
server: 'https://express-eventsource.herokuapp.com/events',
|
||||||
sse: null,
|
sse: null,
|
||||||
events: {
|
events: {
|
||||||
log: null,
|
log: null,
|
||||||
input: ""
|
input: '',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
urlValid() {
|
urlValid() {
|
||||||
const protocol = "^(wss?:\\/\\/)?";
|
const protocol = '^(wss?:\\/\\/)?'
|
||||||
const validIP = new RegExp(
|
const validIP = new RegExp(
|
||||||
`${protocol}(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`
|
`${protocol}(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`
|
||||||
);
|
)
|
||||||
const validHostname = new RegExp(
|
const validHostname = new RegExp(
|
||||||
`${protocol}(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9/])$`
|
`${protocol}(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9/])$`
|
||||||
);
|
)
|
||||||
return validIP.test(this.url) || validHostname.test(this.url);
|
return validIP.test(this.url) || validHostname.test(this.url)
|
||||||
},
|
},
|
||||||
serverValid() {
|
serverValid() {
|
||||||
const protocol = "^(https?:\\/\\/)?";
|
const protocol = '^(https?:\\/\\/)?'
|
||||||
const validIP = new RegExp(
|
const validIP = new RegExp(
|
||||||
`${protocol}(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`
|
`${protocol}(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$`
|
||||||
);
|
)
|
||||||
const validHostname = new RegExp(
|
const validHostname = new RegExp(
|
||||||
`${protocol}(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9/])$`
|
`${protocol}(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9/])$`
|
||||||
);
|
)
|
||||||
return validIP.test(this.server) || validHostname.test(this.server);
|
return validIP.test(this.server) || validHostname.test(this.server)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleConnection() {
|
toggleConnection() {
|
||||||
// If it is connecting:
|
// If it is connecting:
|
||||||
if (!this.connectionState) return this.connect();
|
if (!this.connectionState) return this.connect()
|
||||||
// Otherwise, it's disconnecting.
|
// Otherwise, it's disconnecting.
|
||||||
else return this.disconnect();
|
else return this.disconnect()
|
||||||
},
|
},
|
||||||
connect() {
|
connect() {
|
||||||
this.communication.log = [
|
this.communication.log = [
|
||||||
{
|
{
|
||||||
payload: this.$t("connecting_to", { name: this.url }),
|
payload: this.$t('connecting_to', { name: this.url }),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "var(--ac-color)"
|
color: 'var(--ac-color)',
|
||||||
}
|
},
|
||||||
];
|
]
|
||||||
try {
|
try {
|
||||||
this.socket = new WebSocket(this.url);
|
this.socket = new WebSocket(this.url)
|
||||||
this.socket.onopen = event => {
|
this.socket.onopen = event => {
|
||||||
this.connectionState = true;
|
this.connectionState = true
|
||||||
this.communication.log = [
|
this.communication.log = [
|
||||||
{
|
{
|
||||||
payload: this.$t("connected_to", { name: this.url }),
|
payload: this.$t('connected_to', { name: this.url }),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "var(--ac-color)",
|
color: 'var(--ac-color)',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
this.$toast.success(this.$t('connected'), {
|
||||||
|
icon: 'sync',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
];
|
|
||||||
this.$toast.success(this.$t("connected"), {
|
|
||||||
icon: "sync"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
this.socket.onerror = event => {
|
this.socket.onerror = event => {
|
||||||
this.handleError();
|
this.handleError()
|
||||||
};
|
}
|
||||||
this.socket.onclose = event => {
|
this.socket.onclose = event => {
|
||||||
this.connectionState = false;
|
this.connectionState = false
|
||||||
this.communication.log.push({
|
this.communication.log.push({
|
||||||
payload: this.$t("disconnected_from", { name: this.url }),
|
payload: this.$t('disconnected_from', { name: this.url }),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
this.$toast.error(this.$t("disconnected"), {
|
this.$toast.error(this.$t('disconnected'), {
|
||||||
icon: "sync_disabled"
|
icon: 'sync_disabled',
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
this.socket.onmessage = event => {
|
this.socket.onmessage = event => {
|
||||||
this.communication.log.push({
|
this.communication.log.push({
|
||||||
payload: event.data,
|
payload: event.data,
|
||||||
source: "server",
|
source: 'server',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this.handleError(ex);
|
this.handleError(ex)
|
||||||
this.$toast.error(this.$t("something_went_wrong"), {
|
this.$toast.error(this.$t('something_went_wrong'), {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
disconnect() {
|
disconnect() {
|
||||||
this.socket.close();
|
this.socket.close()
|
||||||
},
|
},
|
||||||
handleError(error) {
|
handleError(error) {
|
||||||
this.disconnect();
|
this.disconnect()
|
||||||
this.connectionState = false;
|
this.connectionState = false
|
||||||
this.communication.log.push({
|
this.communication.log.push({
|
||||||
payload: this.$t("error_occurred"),
|
payload: this.$t('error_occurred'),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
if (error !== null)
|
if (error !== null)
|
||||||
this.communication.log.push({
|
this.communication.log.push({
|
||||||
payload: error,
|
payload: error,
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
const message = this.communication.input;
|
const message = this.communication.input
|
||||||
this.socket.send(message);
|
this.socket.send(message)
|
||||||
this.communication.log.push({
|
this.communication.log.push({
|
||||||
payload: message,
|
payload: message,
|
||||||
source: "client",
|
source: 'client',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
this.communication.input = "";
|
this.communication.input = ''
|
||||||
},
|
},
|
||||||
collapse({ target }) {
|
collapse({ target }) {
|
||||||
const el = target.parentNode.className;
|
const el = target.parentNode.className
|
||||||
document.getElementsByClassName(el)[0].classList.toggle("hidden");
|
document.getElementsByClassName(el)[0].classList.toggle('hidden')
|
||||||
},
|
},
|
||||||
getSourcePrefix(source) {
|
getSourcePrefix(source) {
|
||||||
const sourceEmojis = {
|
const sourceEmojis = {
|
||||||
// Source used for info messages.
|
// Source used for info messages.
|
||||||
info: "\tℹ️ [INFO]:\t",
|
info: '\tℹ️ [INFO]:\t',
|
||||||
// Source used for client to server messages.
|
// Source used for client to server messages.
|
||||||
client: "\t👽 [SENT]:\t",
|
client: '\t👽 [SENT]:\t',
|
||||||
// Source used for server to client messages.
|
// Source used for server to client messages.
|
||||||
server: "\t📥 [RECEIVED]:\t"
|
server: '\t📥 [RECEIVED]:\t',
|
||||||
};
|
}
|
||||||
if (Object.keys(sourceEmojis).includes(source))
|
if (Object.keys(sourceEmojis).includes(source)) return sourceEmojis[source]
|
||||||
return sourceEmojis[source];
|
return ''
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
toggleSSEConnection() {
|
toggleSSEConnection() {
|
||||||
// If it is connecting:
|
// If it is connecting:
|
||||||
if (!this.connectionSSEState) return this.start();
|
if (!this.connectionSSEState) return this.start()
|
||||||
// Otherwise, it's disconnecting.
|
// Otherwise, it's disconnecting.
|
||||||
else return this.stop();
|
else return this.stop()
|
||||||
},
|
},
|
||||||
start() {
|
start() {
|
||||||
this.events.log = [
|
this.events.log = [
|
||||||
{
|
{
|
||||||
payload: this.$t("connecting_to", { name: this.server }),
|
payload: this.$t('connecting_to', { name: this.server }),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "var(--ac-color)"
|
color: 'var(--ac-color)',
|
||||||
}
|
},
|
||||||
];
|
]
|
||||||
if (typeof EventSource !== "undefined") {
|
if (typeof EventSource !== 'undefined') {
|
||||||
try {
|
try {
|
||||||
this.sse = new EventSource(this.server);
|
this.sse = new EventSource(this.server)
|
||||||
this.sse.onopen = event => {
|
this.sse.onopen = event => {
|
||||||
this.connectionSSEState = true;
|
this.connectionSSEState = true
|
||||||
this.events.log = [
|
this.events.log = [
|
||||||
{
|
{
|
||||||
payload: this.$t("connected_to", { name: this.server }),
|
payload: this.$t('connected_to', { name: this.server }),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "var(--ac-color)",
|
color: 'var(--ac-color)',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
this.$toast.success(this.$t('connected'), {
|
||||||
|
icon: 'sync',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
];
|
|
||||||
this.$toast.success(this.$t("connected"), {
|
|
||||||
icon: "sync"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
this.sse.onerror = event => {
|
this.sse.onerror = event => {
|
||||||
this.handleSSEError();
|
this.handleSSEError()
|
||||||
};
|
}
|
||||||
this.sse.onclose = event => {
|
this.sse.onclose = event => {
|
||||||
this.connectionSSEState = false;
|
this.connectionSSEState = false
|
||||||
this.events.log.push({
|
this.events.log.push({
|
||||||
payload: this.$t("disconnected_from", { name: this.server }),
|
payload: this.$t('disconnected_from', { name: this.server }),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
this.$toast.error(this.$t("disconnected"), {
|
this.$toast.error(this.$t('disconnected'), {
|
||||||
icon: "sync_disabled"
|
icon: 'sync_disabled',
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
this.sse.onmessage = event => {
|
this.sse.onmessage = event => {
|
||||||
this.events.log.push({
|
this.events.log.push({
|
||||||
payload: event.data,
|
payload: event.data,
|
||||||
source: "server",
|
source: 'server',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
this.handleSSEError(ex);
|
this.handleSSEError(ex)
|
||||||
this.$toast.error(this.$t("something_went_wrong"), {
|
this.$toast.error(this.$t('something_went_wrong'), {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.events.log = [
|
this.events.log = [
|
||||||
{
|
{
|
||||||
payload: this.$t("browser_support_sse"),
|
payload: this.$t('browser_support_sse'),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
}
|
},
|
||||||
];
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSSEError(error) {
|
handleSSEError(error) {
|
||||||
this.stop();
|
this.stop()
|
||||||
this.connectionSSEState = false;
|
this.connectionSSEState = false
|
||||||
this.events.log.push({
|
this.events.log.push({
|
||||||
payload: this.$t("error_occurred"),
|
payload: this.$t('error_occurred'),
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
if (error !== null)
|
if (error !== null)
|
||||||
this.events.log.push({
|
this.events.log.push({
|
||||||
payload: error,
|
payload: error,
|
||||||
source: "info",
|
source: 'info',
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
ts: new Date().toLocaleTimeString()
|
ts: new Date().toLocaleTimeString(),
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
stop() {
|
stop() {
|
||||||
this.sse.onclose();
|
this.sse.onclose()
|
||||||
this.sse.close();
|
this.sse.close()
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
updated: function() {
|
updated: function() {
|
||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
const divLog = document.getElementById("log");
|
const divLog = document.getElementById('log')
|
||||||
divLog.scrollBy(0, divLog.scrollHeight + 100);
|
divLog.scrollBy(0, divLog.scrollHeight + 100)
|
||||||
});
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,20 +12,20 @@
|
|||||||
/>
|
/>
|
||||||
<i v-else class="material-icons">account_circle</i>
|
<i v-else class="material-icons">account_circle</i>
|
||||||
<span>
|
<span>
|
||||||
{{ fb.currentUser.displayName || "Name not found" }}
|
{{ fb.currentUser.displayName || 'Name not found' }}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<br />
|
<br />
|
||||||
<button class="icon">
|
<button class="icon">
|
||||||
<i class="material-icons">email</i>
|
<i class="material-icons">email</i>
|
||||||
<span>
|
<span>
|
||||||
{{ fb.currentUser.email || "Email not found" }}
|
{{ fb.currentUser.email || 'Email not found' }}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<br />
|
<br />
|
||||||
<button class="icon" @click="logout">
|
<button class="icon" @click="logout">
|
||||||
<i class="material-icons">exit_to_app</i>
|
<i class="material-icons">exit_to_app</i>
|
||||||
<span>{{ $t("logout") }}</span>
|
<span>{{ $t('logout') }}</span>
|
||||||
</button>
|
</button>
|
||||||
<br />
|
<br />
|
||||||
<p v-for="setting in fb.currentSettings" :key="setting.id">
|
<p v-for="setting in fb.currentSettings" :key="setting.id">
|
||||||
@@ -34,19 +34,19 @@
|
|||||||
:on="setting.value"
|
:on="setting.value"
|
||||||
@change="toggleSettings(setting.name, setting.value)"
|
@change="toggleSettings(setting.name, setting.value)"
|
||||||
>
|
>
|
||||||
{{ $t(setting.name) + " " + $t("sync") }}
|
{{ $t(setting.name) + ' ' + $t('sync') }}
|
||||||
{{ setting.value ? $t("enabled") : $t("disabled") }}
|
{{ setting.value ? $t('enabled') : $t('disabled') }}
|
||||||
</pw-toggle>
|
</pw-toggle>
|
||||||
</p>
|
</p>
|
||||||
<p v-if="fb.currentSettings.length !== 3">
|
<p v-if="fb.currentSettings.length !== 3">
|
||||||
<button class="" @click="initSettings">
|
<button class="" @click="initSettings">
|
||||||
<i class="material-icons">sync</i>
|
<i class="material-icons">sync</i>
|
||||||
<span>{{ $t("turn_on") + " " + $t("sync") }}</span>
|
<span>{{ $t('turn_on') + ' ' + $t('sync') }}</span>
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<label>{{ $t("login_with") }}</label>
|
<label>{{ $t('login_with') }}</label>
|
||||||
<p>
|
<p>
|
||||||
<button class="icon" @click="signInWithGoogle">
|
<button class="icon" @click="signInWithGoogle">
|
||||||
<svg
|
<svg
|
||||||
@@ -86,13 +86,9 @@
|
|||||||
<pw-section class="cyan" :label="$t('theme')" ref="theme">
|
<pw-section class="cyan" :label="$t('theme')" ref="theme">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label>{{ $t("background") }}</label>
|
<label>{{ $t('background') }}</label>
|
||||||
<div class="backgrounds">
|
<div class="backgrounds">
|
||||||
<span
|
<span :key="theme.class" @click="applyTheme(theme)" v-for="theme in themes">
|
||||||
:key="theme.class"
|
|
||||||
@click="applyTheme(theme)"
|
|
||||||
v-for="theme in themes"
|
|
||||||
>
|
|
||||||
<swatch
|
<swatch
|
||||||
:active="settings.THEME_CLASS === theme.class"
|
:active="settings.THEME_CLASS === theme.class"
|
||||||
:class="{ vibrant: theme.vibrant }"
|
:class="{ vibrant: theme.vibrant }"
|
||||||
@@ -106,7 +102,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label>{{ $t("color") }}</label>
|
<label>{{ $t('color') }}</label>
|
||||||
<div class="colors">
|
<div class="colors">
|
||||||
<span
|
<span
|
||||||
:key="entry.color"
|
:key="entry.color"
|
||||||
@@ -131,10 +127,8 @@
|
|||||||
:on="settings.FRAME_COLORS_ENABLED"
|
:on="settings.FRAME_COLORS_ENABLED"
|
||||||
@change="toggleSetting('FRAME_COLORS_ENABLED')"
|
@change="toggleSetting('FRAME_COLORS_ENABLED')"
|
||||||
>
|
>
|
||||||
{{ $t("multi_color") }}
|
{{ $t('multi_color') }}
|
||||||
{{
|
{{ settings.FRAME_COLORS_ENABLED ? $t('enabled') : $t('disabled') }}
|
||||||
settings.FRAME_COLORS_ENABLED ? $t("enabled") : $t("disabled")
|
|
||||||
}}
|
|
||||||
</pw-toggle>
|
</pw-toggle>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
@@ -146,10 +140,8 @@
|
|||||||
:on="settings.SCROLL_INTO_ENABLED"
|
:on="settings.SCROLL_INTO_ENABLED"
|
||||||
@change="toggleSetting('SCROLL_INTO_ENABLED')"
|
@change="toggleSetting('SCROLL_INTO_ENABLED')"
|
||||||
>
|
>
|
||||||
{{ $t("scrollInto_use_toggle") }}
|
{{ $t('scrollInto_use_toggle') }}
|
||||||
{{
|
{{ settings.SCROLL_INTO_ENABLED ? $t('enabled') : $t('disabled') }}
|
||||||
settings.SCROLL_INTO_ENABLED ? $t("enabled") : $t("disabled")
|
|
||||||
}}
|
|
||||||
</pw-toggle>
|
</pw-toggle>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
@@ -164,7 +156,7 @@
|
|||||||
:on="settings.EXTENSIONS_ENABLED"
|
:on="settings.EXTENSIONS_ENABLED"
|
||||||
@change="toggleSetting('EXTENSIONS_ENABLED')"
|
@change="toggleSetting('EXTENSIONS_ENABLED')"
|
||||||
>
|
>
|
||||||
{{ $t("extensions_use_toggle") }}
|
{{ $t('extensions_use_toggle') }}
|
||||||
</pw-toggle>
|
</pw-toggle>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@@ -176,12 +168,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<span>
|
<span>
|
||||||
<pw-toggle
|
<pw-toggle :on="settings.PROXY_ENABLED" @change="toggleSetting('PROXY_ENABLED')">
|
||||||
:on="settings.PROXY_ENABLED"
|
{{ $t('proxy') }}
|
||||||
@change="toggleSetting('PROXY_ENABLED')"
|
{{ settings.PROXY_ENABLED ? $t('enabled') : $t('disabled') }}
|
||||||
>
|
|
||||||
{{ $t("proxy") }}
|
|
||||||
{{ settings.PROXY_ENABLED ? $t("enabled") : $t("disabled") }}
|
|
||||||
</pw-toggle>
|
</pw-toggle>
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
@@ -199,12 +188,8 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
<label for="url">{{ $t("url") }}</label>
|
<label for="url">{{ $t('url') }}</label>
|
||||||
<button
|
<button class="icon" @click="resetProxy" v-tooltip.bottom="$t('reset_default')">
|
||||||
class="icon"
|
|
||||||
@click="resetProxy"
|
|
||||||
v-tooltip.bottom="$t('reset_default')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">clear_all</i>
|
<i class="material-icons">clear_all</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -219,16 +204,11 @@
|
|||||||
<ul class="info">
|
<ul class="info">
|
||||||
<li>
|
<li>
|
||||||
<p>
|
<p>
|
||||||
{{ $t("postwoman_official_proxy_hosting") }}
|
{{ $t('postwoman_official_proxy_hosting') }}
|
||||||
<br />
|
<br />
|
||||||
{{ $t("read_the") }}
|
{{ $t('read_the') }}
|
||||||
<a
|
<a class="link" href="https://apollotv.xyz/legal" target="_blank" rel="noopener">
|
||||||
class="link"
|
{{ $t('apollotv_privacy_policy') }} </a
|
||||||
href="https://apollotv.xyz/legal"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
>
|
|
||||||
{{ $t("apollotv_privacy_policy") }} </a
|
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
@@ -255,14 +235,14 @@
|
|||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import firebase from "firebase/app";
|
import firebase from 'firebase/app'
|
||||||
import { fb } from "../functions/fb";
|
import { fb } from '../functions/fb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"pw-section": () => import("../components/section"),
|
'pw-section': () => import('../components/section'),
|
||||||
"pw-toggle": () => import("../components/toggle"),
|
'pw-toggle': () => import('../components/toggle'),
|
||||||
swatch: () => import("../components/settings/swatch")
|
swatch: () => import('../components/settings/swatch'),
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -272,265 +252,253 @@ export default {
|
|||||||
// set the relevant values.
|
// set the relevant values.
|
||||||
themes: [
|
themes: [
|
||||||
{
|
{
|
||||||
color: "#202124",
|
color: '#202124',
|
||||||
name: this.$t("kinda_dark"),
|
name: this.$t('kinda_dark'),
|
||||||
class: "",
|
class: '',
|
||||||
aceEditor: "twilight"
|
aceEditor: 'twilight',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#ffffff",
|
color: '#ffffff',
|
||||||
name: this.$t("clearly_white"),
|
name: this.$t('clearly_white'),
|
||||||
vibrant: true,
|
vibrant: true,
|
||||||
class: "light",
|
class: 'light',
|
||||||
aceEditor: "iplastic"
|
aceEditor: 'iplastic',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#000000",
|
color: '#000000',
|
||||||
name: this.$t("just_black"),
|
name: this.$t('just_black'),
|
||||||
class: "black",
|
class: 'black',
|
||||||
aceEditor: "vibrant_ink"
|
aceEditor: 'vibrant_ink',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "var(--ac-color)",
|
color: 'var(--ac-color)',
|
||||||
name: this.$t("auto_system"),
|
name: this.$t('auto_system'),
|
||||||
vibrant: window.matchMedia("(prefers-color-scheme: light)").matches,
|
vibrant: window.matchMedia('(prefers-color-scheme: light)').matches,
|
||||||
class: "auto",
|
class: 'auto',
|
||||||
aceEditor: window.matchMedia("(prefers-color-scheme: light)").matches
|
aceEditor: window.matchMedia('(prefers-color-scheme: light)').matches
|
||||||
? "iplastic"
|
? 'iplastic'
|
||||||
: "twilight"
|
: 'twilight',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
// You can define a new color here! It will simply store the color value.
|
// You can define a new color here! It will simply store the color value.
|
||||||
colors: [
|
colors: [
|
||||||
// If the color is vibrant, black is used as the active foreground color.
|
// If the color is vibrant, black is used as the active foreground color.
|
||||||
{
|
{
|
||||||
color: "#50fa7b",
|
color: '#50fa7b',
|
||||||
name: this.$t("green"),
|
name: this.$t('green'),
|
||||||
vibrant: true
|
vibrant: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#f1fa8c",
|
color: '#f1fa8c',
|
||||||
name: this.$t("yellow"),
|
name: this.$t('yellow'),
|
||||||
vibrant: true
|
vibrant: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#ff79c6",
|
color: '#ff79c6',
|
||||||
name: this.$t("pink"),
|
name: this.$t('pink'),
|
||||||
vibrant: true
|
vibrant: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#ff5555",
|
color: '#ff5555',
|
||||||
name: this.$t("red"),
|
name: this.$t('red'),
|
||||||
vibrant: false
|
vibrant: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#bd93f9",
|
color: '#bd93f9',
|
||||||
name: this.$t("purple"),
|
name: this.$t('purple'),
|
||||||
vibrant: true
|
vibrant: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#ffb86c",
|
color: '#ffb86c',
|
||||||
name: this.$t("orange"),
|
name: this.$t('orange'),
|
||||||
vibrant: true
|
vibrant: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#8be9fd",
|
color: '#8be9fd',
|
||||||
name: this.$t("cyan"),
|
name: this.$t('cyan'),
|
||||||
vibrant: true
|
vibrant: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
color: "#57b5f9",
|
color: '#57b5f9',
|
||||||
name: this.$t("blue"),
|
name: this.$t('blue'),
|
||||||
vibrant: false
|
vibrant: false,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
settings: {
|
settings: {
|
||||||
SCROLL_INTO_ENABLED:
|
SCROLL_INTO_ENABLED:
|
||||||
typeof this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED !==
|
typeof this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED !== 'undefined'
|
||||||
"undefined"
|
|
||||||
? this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED
|
? this.$store.state.postwoman.settings.SCROLL_INTO_ENABLED
|
||||||
: true,
|
: true,
|
||||||
|
|
||||||
THEME_COLOR: "",
|
THEME_COLOR: '',
|
||||||
THEME_TAB_COLOR: "",
|
THEME_TAB_COLOR: '',
|
||||||
THEME_COLOR_VIBRANT: true,
|
THEME_COLOR_VIBRANT: true,
|
||||||
|
|
||||||
FRAME_COLORS_ENABLED:
|
FRAME_COLORS_ENABLED: this.$store.state.postwoman.settings.FRAME_COLORS_ENABLED || false,
|
||||||
this.$store.state.postwoman.settings.FRAME_COLORS_ENABLED || false,
|
PROXY_ENABLED: this.$store.state.postwoman.settings.PROXY_ENABLED || false,
|
||||||
PROXY_ENABLED:
|
|
||||||
this.$store.state.postwoman.settings.PROXY_ENABLED || false,
|
|
||||||
PROXY_URL:
|
PROXY_URL:
|
||||||
this.$store.state.postwoman.settings.PROXY_URL ||
|
this.$store.state.postwoman.settings.PROXY_URL || 'https://postwoman.apollotv.xyz/',
|
||||||
"https://postwoman.apollotv.xyz/",
|
PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || '',
|
||||||
PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || "",
|
|
||||||
|
|
||||||
EXTENSIONS_ENABLED:
|
EXTENSIONS_ENABLED:
|
||||||
typeof this.$store.state.postwoman.settings.EXTENSIONS_ENABLED !==
|
typeof this.$store.state.postwoman.settings.EXTENSIONS_ENABLED !== 'undefined'
|
||||||
"undefined"
|
|
||||||
? this.$store.state.postwoman.settings.EXTENSIONS_ENABLED
|
? this.$store.state.postwoman.settings.EXTENSIONS_ENABLED
|
||||||
: true
|
: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
doneButton: '<i class="material-icons">done</i>',
|
doneButton: '<i class="material-icons">done</i>',
|
||||||
fb
|
fb,
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
proxySettings: {
|
proxySettings: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler(value) {
|
handler(value) {
|
||||||
this.applySetting("PROXY_URL", value.url);
|
this.applySetting('PROXY_URL', value.url)
|
||||||
this.applySetting("PROXY_KEY", value.key);
|
this.applySetting('PROXY_KEY', value.key)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
applyTheme({ class: name, color, aceEditor }) {
|
applyTheme({ class: name, color, aceEditor }) {
|
||||||
this.applySetting("THEME_CLASS", name);
|
this.applySetting('THEME_CLASS', name)
|
||||||
this.applySetting("THEME_ACE_EDITOR", aceEditor);
|
this.applySetting('THEME_ACE_EDITOR', aceEditor)
|
||||||
document
|
document.querySelector('meta[name=theme-color]').setAttribute('content', color)
|
||||||
.querySelector("meta[name=theme-color]")
|
this.applySetting('THEME_TAB_COLOR', color)
|
||||||
.setAttribute("content", color);
|
document.documentElement.className = name
|
||||||
this.applySetting("THEME_TAB_COLOR", color);
|
|
||||||
document.documentElement.className = name;
|
|
||||||
},
|
},
|
||||||
setActiveColor(color, vibrant) {
|
setActiveColor(color, vibrant) {
|
||||||
// By default, the color is vibrant.
|
// By default, the color is vibrant.
|
||||||
if (vibrant === null) vibrant = true;
|
if (vibrant === null) vibrant = true
|
||||||
document.documentElement.style.setProperty("--ac-color", color);
|
document.documentElement.style.setProperty('--ac-color', color)
|
||||||
document.documentElement.style.setProperty(
|
document.documentElement.style.setProperty(
|
||||||
"--act-color",
|
'--act-color',
|
||||||
vibrant ? "rgba(32, 33, 36, 1)" : "rgba(255, 255, 255, 1)"
|
vibrant ? 'rgba(32, 33, 36, 1)' : 'rgba(255, 255, 255, 1)'
|
||||||
);
|
)
|
||||||
this.applySetting("THEME_COLOR", color.toUpperCase());
|
this.applySetting('THEME_COLOR', color.toUpperCase())
|
||||||
this.applySetting("THEME_COLOR_VIBRANT", vibrant);
|
this.applySetting('THEME_COLOR_VIBRANT', vibrant)
|
||||||
},
|
},
|
||||||
getActiveColor() {
|
getActiveColor() {
|
||||||
// This strips extra spaces and # signs from the strings.
|
// This strips extra spaces and # signs from the strings.
|
||||||
const strip = str => str.replace(/#/g, "").replace(/ /g, "");
|
const strip = str => str.replace(/#/g, '').replace(/ /g, '')
|
||||||
return `#${strip(
|
return `#${strip(
|
||||||
window
|
window.getComputedStyle(document.documentElement).getPropertyValue('--ac-color')
|
||||||
.getComputedStyle(document.documentElement)
|
).toUpperCase()}`
|
||||||
.getPropertyValue("--ac-color")
|
|
||||||
).toUpperCase()}`;
|
|
||||||
},
|
},
|
||||||
applySetting(key, value) {
|
applySetting(key, value) {
|
||||||
this.settings[key] = value;
|
this.settings[key] = value
|
||||||
this.$store.commit("postwoman/applySetting", [key, value]);
|
this.$store.commit('postwoman/applySetting', [key, value])
|
||||||
},
|
},
|
||||||
toggleSetting(key) {
|
toggleSetting(key) {
|
||||||
this.settings[key] = !this.settings[key];
|
this.settings[key] = !this.settings[key]
|
||||||
this.$store.commit("postwoman/applySetting", [key, this.settings[key]]);
|
this.$store.commit('postwoman/applySetting', [key, this.settings[key]])
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
fb.currentUser = null;
|
fb.currentUser = null
|
||||||
firebase
|
firebase
|
||||||
.auth()
|
.auth()
|
||||||
.signOut()
|
.signOut()
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.show(err.message || err, {
|
this.$toast.show(err.message || err, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
this.$toast.info(this.$t("logged_out"), {
|
this.$toast.info(this.$t('logged_out'), {
|
||||||
icon: "vpn_key"
|
icon: 'vpn_key',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
signInWithGoogle() {
|
signInWithGoogle() {
|
||||||
const provider = new firebase.auth.GoogleAuthProvider();
|
const provider = new firebase.auth.GoogleAuthProvider()
|
||||||
firebase
|
firebase
|
||||||
.auth()
|
.auth()
|
||||||
.signInWithPopup(provider)
|
.signInWithPopup(provider)
|
||||||
.then(({ additionalUserInfo }) => {
|
.then(({ additionalUserInfo }) => {
|
||||||
if (additionalUserInfo.isNewUser) {
|
if (additionalUserInfo.isNewUser) {
|
||||||
this.$toast.info(`${this.$t("turn_on")} ${this.$t("sync")}`, {
|
this.$toast.info(`${this.$t('turn_on')} ${this.$t('sync')}`, {
|
||||||
icon: "sync",
|
icon: 'sync',
|
||||||
duration: null,
|
duration: null,
|
||||||
closeOnSwipe: false,
|
closeOnSwipe: false,
|
||||||
action: {
|
action: {
|
||||||
text: this.$t("yes"),
|
text: this.$t('yes'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
fb.writeSettings("syncHistory", true);
|
fb.writeSettings('syncHistory', true)
|
||||||
fb.writeSettings("syncCollections", true);
|
fb.writeSettings('syncCollections', true)
|
||||||
fb.writeSettings("syncEnvironments", true);
|
fb.writeSettings('syncEnvironments', true)
|
||||||
this.$router.push({ path: "/settings" });
|
this.$router.push({ path: '/settings' })
|
||||||
toastObject.remove();
|
toastObject.remove()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.show(err.message || err, {
|
this.$toast.show(err.message || err, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
signInWithGithub() {
|
signInWithGithub() {
|
||||||
const provider = new firebase.auth.GithubAuthProvider();
|
const provider = new firebase.auth.GithubAuthProvider()
|
||||||
firebase
|
firebase
|
||||||
.auth()
|
.auth()
|
||||||
.signInWithPopup(provider)
|
.signInWithPopup(provider)
|
||||||
.then(({ additionalUserInfo }) => {
|
.then(({ additionalUserInfo }) => {
|
||||||
if (additionalUserInfo.isNewUser) {
|
if (additionalUserInfo.isNewUser) {
|
||||||
this.$toast.info(`${this.$t("turn_on")} ${this.$t("sync")}`, {
|
this.$toast.info(`${this.$t('turn_on')} ${this.$t('sync')}`, {
|
||||||
icon: "sync",
|
icon: 'sync',
|
||||||
duration: null,
|
duration: null,
|
||||||
closeOnSwipe: false,
|
closeOnSwipe: false,
|
||||||
action: {
|
action: {
|
||||||
text: this.$t("yes"),
|
text: this.$t('yes'),
|
||||||
onClick: (e, toastObject) => {
|
onClick: (e, toastObject) => {
|
||||||
fb.writeSettings("syncHistory", true);
|
fb.writeSettings('syncHistory', true)
|
||||||
fb.writeSettings("syncCollections", true);
|
fb.writeSettings('syncCollections', true)
|
||||||
fb.writeSettings("syncEnvironments", true);
|
fb.writeSettings('syncEnvironments', true)
|
||||||
this.$router.push({ path: "/settings" });
|
this.$router.push({ path: '/settings' })
|
||||||
toastObject.remove();
|
toastObject.remove()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$toast.show(err.message || err, {
|
this.$toast.show(err.message || err, {
|
||||||
icon: "error"
|
icon: 'error',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
toggleSettings(s, v) {
|
toggleSettings(s, v) {
|
||||||
fb.writeSettings(s, !v);
|
fb.writeSettings(s, !v)
|
||||||
},
|
},
|
||||||
initSettings() {
|
initSettings() {
|
||||||
fb.writeSettings("syncHistory", true);
|
fb.writeSettings('syncHistory', true)
|
||||||
fb.writeSettings("syncCollections", true);
|
fb.writeSettings('syncCollections', true)
|
||||||
fb.writeSettings("syncEnvironments", true);
|
fb.writeSettings('syncEnvironments', true)
|
||||||
},
|
},
|
||||||
resetProxy({ target }) {
|
resetProxy({ target }) {
|
||||||
this.settings.PROXY_URL = `https://postwoman.apollotv.xyz/`;
|
this.settings.PROXY_URL = `https://postwoman.apollotv.xyz/`
|
||||||
target.innerHTML = this.doneButton;
|
target.innerHTML = this.doneButton
|
||||||
this.$toast.info(this.$t("cleared"), {
|
this.$toast.info(this.$t('cleared'), {
|
||||||
icon: "clear_all"
|
icon: 'clear_all',
|
||||||
});
|
})
|
||||||
setTimeout(
|
setTimeout(() => (target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
|
||||||
() => (target.innerHTML = '<i class="material-icons">clear_all</i>'),
|
},
|
||||||
1000
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.settings.THEME_COLOR = this.getActiveColor();
|
this.settings.THEME_COLOR = this.getActiveColor()
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
proxySettings() {
|
proxySettings() {
|
||||||
return {
|
return {
|
||||||
url: this.settings.PROXY_URL,
|
url: this.settings.PROXY_URL,
|
||||||
key: this.settings.PROXY_KEY
|
key: this.settings.PROXY_KEY,
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Vue from "vue";
|
import Vue from 'vue'
|
||||||
import VTooltip from "v-tooltip";
|
import VTooltip from 'v-tooltip'
|
||||||
|
|
||||||
Vue.use(VTooltip);
|
Vue.use(VTooltip)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import VuexPersistence from "vuex-persist";
|
import VuexPersistence from 'vuex-persist'
|
||||||
|
|
||||||
export default ({ store }) => {
|
export default ({ store }) => {
|
||||||
new VuexPersistence().plugin(store);
|
new VuexPersistence().plugin(store)
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
import Vuex from "vuex";
|
import Vuex from 'vuex'
|
||||||
import state from "./state";
|
import state from './state'
|
||||||
import VuexPersist from "vuex-persist";
|
import VuexPersist from 'vuex-persist'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(Vue) {
|
install(Vue) {
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex)
|
||||||
|
|
||||||
const vuexLocalStorage = new VuexPersist({
|
const vuexLocalStorage = new VuexPersist({
|
||||||
key: "vuex",
|
key: 'vuex',
|
||||||
storage: window.localStorage,
|
storage: window.localStorage,
|
||||||
reducer: ({ ...request }) => ({
|
reducer: ({ ...request }) => ({
|
||||||
...request
|
...request,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
});
|
|
||||||
|
|
||||||
const store = new Vuex.Store({
|
const store = new Vuex.Store({
|
||||||
state,
|
state,
|
||||||
plugins: [vuexLocalStorage.plugin]
|
plugins: [vuexLocalStorage.plugin],
|
||||||
});
|
})
|
||||||
|
|
||||||
Vue.prototype.$store = store;
|
Vue.prototype.$store = store
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,97 +1,97 @@
|
|||||||
export default {
|
export default {
|
||||||
setState({ request }, { attribute, value }) {
|
setState({ request }, { attribute, value }) {
|
||||||
request[attribute] = value;
|
request[attribute] = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setGQLState({ gql }, { attribute, value }) {
|
setGQLState({ gql }, { attribute, value }) {
|
||||||
gql[attribute] = value;
|
gql[attribute] = value
|
||||||
},
|
},
|
||||||
|
|
||||||
addGQLHeader({ gql }, object) {
|
addGQLHeader({ gql }, object) {
|
||||||
gql.headers.push(object);
|
gql.headers.push(object)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeGQLHeader({ gql }, index) {
|
removeGQLHeader({ gql }, index) {
|
||||||
gql.headers.splice(index, 1);
|
gql.headers.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
setGQLHeaderKey({ gql }, { index, value }) {
|
setGQLHeaderKey({ gql }, { index, value }) {
|
||||||
gql.headers[index].key = value;
|
gql.headers[index].key = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setGQLHeaderValue({ gql }, { index, value }) {
|
setGQLHeaderValue({ gql }, { index, value }) {
|
||||||
gql.headers[index].value = value;
|
gql.headers[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
addHeaders({ request }, value) {
|
addHeaders({ request }, value) {
|
||||||
request.headers.push(value);
|
request.headers.push(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeHeaders({ request }, index) {
|
removeHeaders({ request }, index) {
|
||||||
request.headers.splice(index, 1);
|
request.headers.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
setKeyHeader({ request }, { index, value }) {
|
setKeyHeader({ request }, { index, value }) {
|
||||||
request.headers[index].key = value;
|
request.headers[index].key = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setValueHeader({ request }, { index, value }) {
|
setValueHeader({ request }, { index, value }) {
|
||||||
request.headers[index].value = value;
|
request.headers[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
addParams({ request }, value) {
|
addParams({ request }, value) {
|
||||||
request.params.push(value);
|
request.params.push(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeParams({ request }, index) {
|
removeParams({ request }, index) {
|
||||||
request.params.splice(index, 1);
|
request.params.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
setKeyParams({ request }, { index, value }) {
|
setKeyParams({ request }, { index, value }) {
|
||||||
request.params[index].key = value;
|
request.params[index].key = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setValueParams({ request }, { index, value }) {
|
setValueParams({ request }, { index, value }) {
|
||||||
request.params[index].value = value;
|
request.params[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
addBodyParams({ request }, value) {
|
addBodyParams({ request }, value) {
|
||||||
request.bodyParams.push(value);
|
request.bodyParams.push(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeBodyParams({ request }, index) {
|
removeBodyParams({ request }, index) {
|
||||||
request.bodyParams.splice(index, 1);
|
request.bodyParams.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
setKeyBodyParams({ request }, { index, value }) {
|
setKeyBodyParams({ request }, { index, value }) {
|
||||||
request.bodyParams[index].key = value;
|
request.bodyParams[index].key = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setValueBodyParams({ request }, { index, value }) {
|
setValueBodyParams({ request }, { index, value }) {
|
||||||
request.bodyParams[index].value = value;
|
request.bodyParams[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setOAuth2({ oauth2 }, { attribute, value }) {
|
setOAuth2({ oauth2 }, { attribute, value }) {
|
||||||
oauth2[attribute] = value;
|
oauth2[attribute] = value
|
||||||
},
|
},
|
||||||
|
|
||||||
addOAuthToken({ oauth2 }, value) {
|
addOAuthToken({ oauth2 }, value) {
|
||||||
oauth2.tokens.push(value);
|
oauth2.tokens.push(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeOAuthToken({ oauth2 }, index) {
|
removeOAuthToken({ oauth2 }, index) {
|
||||||
oauth2.tokens.splice(index, 1);
|
oauth2.tokens.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
setOAuthTokenName({ oauth2 }, { index, value }) {
|
setOAuthTokenName({ oauth2 }, { index, value }) {
|
||||||
oauth2.tokens[index].name = value;
|
oauth2.tokens[index].name = value
|
||||||
},
|
},
|
||||||
|
|
||||||
addOAuthTokenReq({ oauth2 }, value) {
|
addOAuthTokenReq({ oauth2 }, value) {
|
||||||
oauth2.tokenReqs.push(value);
|
oauth2.tokenReqs.push(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeOAuthTokenReq({ oauth2 }, index) {
|
removeOAuthTokenReq({ oauth2 }, index) {
|
||||||
oauth2.tokenReqs.splice(index, 1);
|
oauth2.tokenReqs.splice(index, 1)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
import Vue from "vue";
|
import Vue from 'vue'
|
||||||
|
|
||||||
export const SETTINGS_KEYS = [
|
export const SETTINGS_KEYS = [
|
||||||
/**
|
/**
|
||||||
* Whether or not to enable scrolling to a specified element, when certain
|
* Whether or not to enable scrolling to a specified element, when certain
|
||||||
* actions are triggered.
|
* actions are triggered.
|
||||||
*/
|
*/
|
||||||
"SCROLL_INTO_ENABLED",
|
'SCROLL_INTO_ENABLED',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CSS class that should be applied to the root element.
|
* The CSS class that should be applied to the root element.
|
||||||
* Essentially, the name of the background theme.
|
* Essentially, the name of the background theme.
|
||||||
*/
|
*/
|
||||||
"THEME_CLASS",
|
'THEME_CLASS',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The hex color code for the currently active theme.
|
* The hex color code for the currently active theme.
|
||||||
*/
|
*/
|
||||||
"THEME_COLOR",
|
'THEME_COLOR',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The hex color code for browser tab color.
|
* The hex color code for browser tab color.
|
||||||
*/
|
*/
|
||||||
"THEME_TAB_COLOR",
|
'THEME_TAB_COLOR',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not THEME_COLOR is considered 'vibrant'.
|
* Whether or not THEME_COLOR is considered 'vibrant'.
|
||||||
@@ -30,247 +30,237 @@ export const SETTINGS_KEYS = [
|
|||||||
* any text placed on the theme color will have its color
|
* any text placed on the theme color will have its color
|
||||||
* inverted from white to black.
|
* inverted from white to black.
|
||||||
*/
|
*/
|
||||||
"THEME_COLOR_VIBRANT",
|
'THEME_COLOR_VIBRANT',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Ace editor theme
|
* The Ace editor theme
|
||||||
*/
|
*/
|
||||||
"THEME_ACE_EDITOR",
|
'THEME_ACE_EDITOR',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normally, section frames are multicolored in the UI
|
* Normally, section frames are multicolored in the UI
|
||||||
* to emphasise the different sections.
|
* to emphasise the different sections.
|
||||||
* This setting allows that to be turned off.
|
* This setting allows that to be turned off.
|
||||||
*/
|
*/
|
||||||
"FRAME_COLORS_ENABLED",
|
'FRAME_COLORS_ENABLED',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not requests should be proxied.
|
* Whether or not requests should be proxied.
|
||||||
*/
|
*/
|
||||||
"PROXY_ENABLED",
|
'PROXY_ENABLED',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The URL of the proxy to connect to for requests.
|
* The URL of the proxy to connect to for requests.
|
||||||
*/
|
*/
|
||||||
"PROXY_URL",
|
'PROXY_URL',
|
||||||
/**
|
/**
|
||||||
* The security key of the proxy.
|
* The security key of the proxy.
|
||||||
*/
|
*/
|
||||||
"PROXY_KEY",
|
'PROXY_KEY',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of properties to exclude from the URL.
|
* An array of properties to exclude from the URL.
|
||||||
* e.g. 'auth'
|
* e.g. 'auth'
|
||||||
*/
|
*/
|
||||||
"URL_EXCLUDES",
|
'URL_EXCLUDES',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A boolean value indicating whether to use the browser extensions
|
* A boolean value indicating whether to use the browser extensions
|
||||||
* to run the requests
|
* to run the requests
|
||||||
*/
|
*/
|
||||||
"EXTENSIONS_ENABLED"
|
'EXTENSIONS_ENABLED',
|
||||||
];
|
]
|
||||||
|
|
||||||
export const state = () => ({
|
export const state = () => ({
|
||||||
settings: {},
|
settings: {},
|
||||||
collections: [
|
collections: [
|
||||||
{
|
{
|
||||||
name: "My Collection",
|
name: 'My Collection',
|
||||||
folders: [],
|
folders: [],
|
||||||
requests: []
|
requests: [],
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
environments: [
|
environments: [
|
||||||
{
|
{
|
||||||
name: "My Environment Variables",
|
name: 'My Environment Variables',
|
||||||
variables: []
|
variables: [],
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
editingEnvironment: {},
|
editingEnvironment: {},
|
||||||
selectedRequest: {},
|
selectedRequest: {},
|
||||||
editingRequest: {}
|
editingRequest: {},
|
||||||
});
|
})
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
applySetting({ settings }, setting) {
|
applySetting({ settings }, setting) {
|
||||||
if (
|
if (setting === null || !(setting instanceof Array) || setting.length !== 2) {
|
||||||
setting === null ||
|
throw new Error('You must provide a setting (array in the form [key, value])')
|
||||||
!(setting instanceof Array) ||
|
|
||||||
setting.length !== 2
|
|
||||||
) {
|
|
||||||
throw new Error(
|
|
||||||
"You must provide a setting (array in the form [key, value])"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [key, value] = setting;
|
const [key, value] = setting
|
||||||
// Do not just remove this check.
|
// Do not just remove this check.
|
||||||
// Add your settings key to the SETTINGS_KEYS array at the
|
// Add your settings key to the SETTINGS_KEYS array at the
|
||||||
// top of the file.
|
// top of the file.
|
||||||
// This is to ensure that application settings remain documented.
|
// This is to ensure that application settings remain documented.
|
||||||
if (!SETTINGS_KEYS.includes(key)) {
|
if (!SETTINGS_KEYS.includes(key)) {
|
||||||
throw new Error(`The settings structure does not include the key ${key}`);
|
throw new Error(`The settings structure does not include the key ${key}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
settings[key] = value;
|
settings[key] = value
|
||||||
},
|
},
|
||||||
|
|
||||||
removeVariables({ editingEnvironment }, value) {
|
removeVariables({ editingEnvironment }, value) {
|
||||||
editingEnvironment.variables = value;
|
editingEnvironment.variables = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setEditingEnvironment(state, value) {
|
setEditingEnvironment(state, value) {
|
||||||
state.editingEnvironment = { ...value };
|
state.editingEnvironment = { ...value }
|
||||||
},
|
},
|
||||||
|
|
||||||
setVariableKey({ editingEnvironment }, { index, value }) {
|
setVariableKey({ editingEnvironment }, { index, value }) {
|
||||||
editingEnvironment.variables[index].key = value;
|
editingEnvironment.variables[index].key = value
|
||||||
},
|
},
|
||||||
|
|
||||||
setVariableValue({ editingEnvironment }, { index, value }) {
|
setVariableValue({ editingEnvironment }, { index, value }) {
|
||||||
editingEnvironment.variables[index].value = testValue(value);
|
editingEnvironment.variables[index].value = testValue(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeVariable({ editingEnvironment }, variables) {
|
removeVariable({ editingEnvironment }, variables) {
|
||||||
editingEnvironment.variables = variables;
|
editingEnvironment.variables = variables
|
||||||
},
|
},
|
||||||
|
|
||||||
addVariable({ editingEnvironment }, value) {
|
addVariable({ editingEnvironment }, value) {
|
||||||
editingEnvironment.variables.push(value);
|
editingEnvironment.variables.push(value)
|
||||||
},
|
},
|
||||||
|
|
||||||
replaceEnvironments(state, environments) {
|
replaceEnvironments(state, environments) {
|
||||||
state.environments = environments;
|
state.environments = environments
|
||||||
},
|
},
|
||||||
|
|
||||||
importAddEnvironments(state, { environments, confirmation }) {
|
importAddEnvironments(state, { environments, confirmation }) {
|
||||||
const duplicateEnvironment = environments.some(
|
const duplicateEnvironment = environments.some(item => {
|
||||||
item => {
|
return state.environments.some(item2 => {
|
||||||
return state.environments.some(
|
return item.name.toLowerCase() === item2.name.toLowerCase()
|
||||||
item2 => {
|
})
|
||||||
return item.name.toLowerCase() === item2.name.toLowerCase();
|
})
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
if (duplicateEnvironment) {
|
if (duplicateEnvironment) {
|
||||||
this.$toast.info("Duplicate environment");
|
this.$toast.info('Duplicate environment')
|
||||||
return;
|
return
|
||||||
};
|
}
|
||||||
state.environments = [...state.environments, ...environments];
|
state.environments = [...state.environments, ...environments]
|
||||||
|
|
||||||
let index = 0;
|
let index = 0
|
||||||
for (let environment of state.environments) {
|
for (let environment of state.environments) {
|
||||||
environment.environmentIndex = index;
|
environment.environmentIndex = index
|
||||||
index += 1;
|
index += 1
|
||||||
}
|
}
|
||||||
this.$toast.info(confirmation, {
|
this.$toast.info(confirmation, {
|
||||||
icon: "folder_shared"
|
icon: 'folder_shared',
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
removeEnvironment({ environments }, environmentIndex) {
|
removeEnvironment({ environments }, environmentIndex) {
|
||||||
environments.splice(environmentIndex, 1);
|
environments.splice(environmentIndex, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
saveEnvironment({ environments }, payload) {
|
saveEnvironment({ environments }, payload) {
|
||||||
const { environment, environmentIndex } = payload;
|
const { environment, environmentIndex } = payload
|
||||||
const { name } = environment;
|
const { name } = environment
|
||||||
const duplicateEnvironment = environments.length === 1
|
const duplicateEnvironment =
|
||||||
|
environments.length === 1
|
||||||
? false
|
? false
|
||||||
: environments.some(
|
: environments.some(
|
||||||
item =>
|
item =>
|
||||||
item.environmentIndex !== environmentIndex &&
|
item.environmentIndex !== environmentIndex &&
|
||||||
item.name.toLowerCase() === name.toLowerCase()
|
item.name.toLowerCase() === name.toLowerCase()
|
||||||
);
|
)
|
||||||
if (duplicateEnvironment) {
|
if (duplicateEnvironment) {
|
||||||
this.$toast.info("Duplicate environment");
|
this.$toast.info('Duplicate environment')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
environments[environmentIndex] = environment;
|
environments[environmentIndex] = environment
|
||||||
},
|
},
|
||||||
|
|
||||||
replaceCollections(state, collections) {
|
replaceCollections(state, collections) {
|
||||||
state.collections = collections;
|
state.collections = collections
|
||||||
},
|
},
|
||||||
|
|
||||||
importCollections(state, collections) {
|
importCollections(state, collections) {
|
||||||
state.collections = [...state.collections, ...collections];
|
state.collections = [...state.collections, ...collections]
|
||||||
|
|
||||||
let index = 0;
|
let index = 0
|
||||||
for (let collection of collections) {
|
for (let collection of collections) {
|
||||||
collection.collectionIndex = index;
|
collection.collectionIndex = index
|
||||||
index += 1;
|
index += 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addNewCollection({ collections }, collection) {
|
addNewCollection({ collections }, collection) {
|
||||||
const { name } = collection;
|
const { name } = collection
|
||||||
const duplicateCollection = collections.some(
|
const duplicateCollection = collections.some(
|
||||||
item => item.name.toLowerCase() === name.toLowerCase()
|
item => item.name.toLowerCase() === name.toLowerCase()
|
||||||
);
|
)
|
||||||
if (duplicateCollection) {
|
if (duplicateCollection) {
|
||||||
this.$toast.info("Duplicate collection");
|
this.$toast.info('Duplicate collection')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
collections.push({
|
collections.push({
|
||||||
name: "",
|
name: '',
|
||||||
folders: [],
|
folders: [],
|
||||||
requests: [],
|
requests: [],
|
||||||
...collection
|
...collection,
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
removeCollection({ collections }, payload) {
|
removeCollection({ collections }, payload) {
|
||||||
const { collectionIndex } = payload;
|
const { collectionIndex } = payload
|
||||||
collections.splice(collectionIndex, 1);
|
collections.splice(collectionIndex, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
editCollection({ collections }, payload) {
|
editCollection({ collections }, payload) {
|
||||||
const {
|
const {
|
||||||
collection: { name },
|
collection: { name },
|
||||||
collectionIndex
|
collectionIndex,
|
||||||
} = payload;
|
} = payload
|
||||||
const duplicateCollection = collections.some(
|
const duplicateCollection = collections.some(
|
||||||
item => item.name.toLowerCase() === name.toLowerCase()
|
item => item.name.toLowerCase() === name.toLowerCase()
|
||||||
);
|
)
|
||||||
if (duplicateCollection) {
|
if (duplicateCollection) {
|
||||||
this.$toast.info("Duplicate collection");
|
this.$toast.info('Duplicate collection')
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
collections[collectionIndex] = collection;
|
collections[collectionIndex] = collection
|
||||||
},
|
},
|
||||||
|
|
||||||
addNewFolder({ collections }, payload) {
|
addNewFolder({ collections }, payload) {
|
||||||
const { collectionIndex, folder } = payload;
|
const { collectionIndex, folder } = payload
|
||||||
collections[collectionIndex].folders.push({
|
collections[collectionIndex].folders.push({
|
||||||
name: "",
|
name: '',
|
||||||
requests: [],
|
requests: [],
|
||||||
...folder
|
...folder,
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
editFolder({ collections }, payload) {
|
editFolder({ collections }, payload) {
|
||||||
const { collectionIndex, folder, folderIndex } = payload;
|
const { collectionIndex, folder, folderIndex } = payload
|
||||||
Vue.set(collections[collectionIndex].folders, folderIndex, folder);
|
Vue.set(collections[collectionIndex].folders, folderIndex, folder)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeFolder({ collections }, payload) {
|
removeFolder({ collections }, payload) {
|
||||||
const { collectionIndex, folderIndex } = payload;
|
const { collectionIndex, folderIndex } = payload
|
||||||
collections[collectionIndex].folders.splice(folderIndex, 1);
|
collections[collectionIndex].folders.splice(folderIndex, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
addRequest({ collections }, payload) {
|
addRequest({ collections }, payload) {
|
||||||
const { request } = payload;
|
const { request } = payload
|
||||||
|
|
||||||
// Request that is directly attached to collection
|
// Request that is directly attached to collection
|
||||||
if (request.folder === -1) {
|
if (request.folder === -1) {
|
||||||
collections[request.collection].requests.push(request);
|
collections[request.collection].requests.push(request)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
collections[request.collection].folders[request.folder].requests.push(
|
collections[request.collection].folders[request.folder].requests.push(request)
|
||||||
request
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
editRequest({ collections }, payload) {
|
editRequest({ collections }, payload) {
|
||||||
@@ -280,148 +270,116 @@ export const mutations = {
|
|||||||
requestOldIndex,
|
requestOldIndex,
|
||||||
requestNew,
|
requestNew,
|
||||||
requestNewCollectionIndex,
|
requestNewCollectionIndex,
|
||||||
requestNewFolderIndex
|
requestNewFolderIndex,
|
||||||
} = payload;
|
} = payload
|
||||||
|
|
||||||
const changedCollection =
|
const changedCollection = requestOldCollectionIndex !== requestNewCollectionIndex
|
||||||
requestOldCollectionIndex !== requestNewCollectionIndex;
|
const changedFolder = requestOldFolderIndex !== requestNewFolderIndex
|
||||||
const changedFolder = requestOldFolderIndex !== requestNewFolderIndex;
|
const changedPlace = changedCollection || changedFolder
|
||||||
const changedPlace = changedCollection || changedFolder;
|
|
||||||
|
|
||||||
// set new request
|
// set new request
|
||||||
if (requestNewFolderIndex !== undefined) {
|
if (requestNewFolderIndex !== undefined) {
|
||||||
Vue.set(
|
Vue.set(
|
||||||
collections[requestNewCollectionIndex].folders[requestNewFolderIndex]
|
collections[requestNewCollectionIndex].folders[requestNewFolderIndex].requests,
|
||||||
.requests,
|
|
||||||
requestOldIndex,
|
requestOldIndex,
|
||||||
requestNew
|
requestNew
|
||||||
);
|
)
|
||||||
} else {
|
} else {
|
||||||
Vue.set(
|
Vue.set(collections[requestNewCollectionIndex].requests, requestOldIndex, requestNew)
|
||||||
collections[requestNewCollectionIndex].requests,
|
|
||||||
requestOldIndex,
|
|
||||||
requestNew
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove old request
|
// remove old request
|
||||||
if (changedPlace) {
|
if (changedPlace) {
|
||||||
if (requestOldFolderIndex !== undefined) {
|
if (requestOldFolderIndex !== undefined) {
|
||||||
collections[requestOldCollectionIndex].folders[
|
collections[requestOldCollectionIndex].folders[requestOldFolderIndex].requests.splice(
|
||||||
requestOldFolderIndex
|
|
||||||
].requests.splice(requestOldIndex, 1);
|
|
||||||
} else {
|
|
||||||
collections[requestOldCollectionIndex].requests.splice(
|
|
||||||
requestOldIndex,
|
requestOldIndex,
|
||||||
1
|
1
|
||||||
);
|
)
|
||||||
|
} else {
|
||||||
|
collections[requestOldCollectionIndex].requests.splice(requestOldIndex, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
saveRequestAs({ collections }, payload) {
|
saveRequestAs({ collections }, payload) {
|
||||||
const { request, collectionIndex, folderIndex, requestIndex } = payload;
|
const { request, collectionIndex, folderIndex, requestIndex } = payload
|
||||||
|
|
||||||
const specifiedCollection = collectionIndex !== undefined;
|
const specifiedCollection = collectionIndex !== undefined
|
||||||
const specifiedFolder = folderIndex !== undefined;
|
const specifiedFolder = folderIndex !== undefined
|
||||||
const specifiedRequest = requestIndex !== undefined;
|
const specifiedRequest = requestIndex !== undefined
|
||||||
|
|
||||||
if (specifiedCollection && specifiedFolder && specifiedRequest) {
|
if (specifiedCollection && specifiedFolder && specifiedRequest) {
|
||||||
Vue.set(
|
Vue.set(collections[collectionIndex].folders[folderIndex].requests, requestIndex, request)
|
||||||
collections[collectionIndex].folders[folderIndex].requests,
|
|
||||||
requestIndex,
|
|
||||||
request
|
|
||||||
);
|
|
||||||
} else if (specifiedCollection && specifiedFolder && !specifiedRequest) {
|
} else if (specifiedCollection && specifiedFolder && !specifiedRequest) {
|
||||||
const requests =
|
const requests = collections[collectionIndex].folders[folderIndex].requests
|
||||||
collections[collectionIndex].folders[folderIndex].requests;
|
const lastRequestIndex = requests.length - 1
|
||||||
const lastRequestIndex = requests.length - 1;
|
Vue.set(requests, lastRequestIndex + 1, request)
|
||||||
Vue.set(requests, lastRequestIndex + 1, request);
|
|
||||||
} else if (specifiedCollection && !specifiedFolder && specifiedRequest) {
|
} else if (specifiedCollection && !specifiedFolder && specifiedRequest) {
|
||||||
const requests = collections[collectionIndex].requests;
|
const requests = collections[collectionIndex].requests
|
||||||
Vue.set(requests, requestIndex, request);
|
Vue.set(requests, requestIndex, request)
|
||||||
} else if (specifiedCollection && !specifiedFolder && !specifiedRequest) {
|
} else if (specifiedCollection && !specifiedFolder && !specifiedRequest) {
|
||||||
const requests = collections[collectionIndex].requests;
|
const requests = collections[collectionIndex].requests
|
||||||
const lastRequestIndex = requests.length - 1;
|
const lastRequestIndex = requests.length - 1
|
||||||
Vue.set(requests, lastRequestIndex + 1, request);
|
Vue.set(requests, lastRequestIndex + 1, request)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
saveRequest({ collections }, payload) {
|
saveRequest({ collections }, payload) {
|
||||||
const { request } = payload;
|
const { request } = payload
|
||||||
|
|
||||||
// Remove the old request from collection
|
// Remove the old request from collection
|
||||||
if (request.hasOwnProperty("oldCollection") && request.oldCollection > -1) {
|
if (request.hasOwnProperty('oldCollection') && request.oldCollection > -1) {
|
||||||
const folder =
|
const folder =
|
||||||
request.hasOwnProperty("oldFolder") && request.oldFolder >= -1
|
request.hasOwnProperty('oldFolder') && request.oldFolder >= -1
|
||||||
? request.oldFolder
|
? request.oldFolder
|
||||||
: request.folder;
|
: request.folder
|
||||||
if (folder > -1) {
|
if (folder > -1) {
|
||||||
collections[request.oldCollection].folders[folder].requests.splice(
|
collections[request.oldCollection].folders[folder].requests.splice(request.requestIndex, 1)
|
||||||
request.requestIndex,
|
|
||||||
1
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
collections[request.oldCollection].requests.splice(
|
collections[request.oldCollection].requests.splice(request.requestIndex, 1)
|
||||||
request.requestIndex,
|
|
||||||
1
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (request.hasOwnProperty('oldFolder') && request.oldFolder !== -1) {
|
||||||
request.hasOwnProperty("oldFolder") &&
|
collections[request.collection].folders[folder].requests.splice(request.requestIndex, 1)
|
||||||
request.oldFolder !== -1
|
|
||||||
) {
|
|
||||||
collections[request.collection].folders[folder].requests.splice(
|
|
||||||
request.requestIndex,
|
|
||||||
1
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete request.oldCollection;
|
delete request.oldCollection
|
||||||
delete request.oldFolder;
|
delete request.oldFolder
|
||||||
|
|
||||||
// Request that is directly attached to collection
|
// Request that is directly attached to collection
|
||||||
if (request.folder === -1) {
|
if (request.folder === -1) {
|
||||||
Vue.set(
|
Vue.set(collections[request.collection].requests, request.requestIndex, request)
|
||||||
collections[request.collection].requests,
|
return
|
||||||
request.requestIndex,
|
|
||||||
request
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.set(
|
Vue.set(
|
||||||
collections[request.collection].folders[request.folder].requests,
|
collections[request.collection].folders[request.folder].requests,
|
||||||
request.requestIndex,
|
request.requestIndex,
|
||||||
request
|
request
|
||||||
);
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
removeRequest({ collections }, payload) {
|
removeRequest({ collections }, payload) {
|
||||||
const { collectionIndex, folderIndex, requestIndex } = payload;
|
const { collectionIndex, folderIndex, requestIndex } = payload
|
||||||
|
|
||||||
// Request that is directly attached to collection
|
// Request that is directly attached to collection
|
||||||
if (folderIndex === -1) {
|
if (folderIndex === -1) {
|
||||||
collections[collectionIndex].requests.splice(requestIndex, 1);
|
collections[collectionIndex].requests.splice(requestIndex, 1)
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
collections[collectionIndex].folders[folderIndex].requests.splice(
|
collections[collectionIndex].folders[folderIndex].requests.splice(requestIndex, 1)
|
||||||
requestIndex,
|
|
||||||
1
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
selectRequest(state, { request }) {
|
selectRequest(state, { request }) {
|
||||||
state.selectedRequest = Object.assign({}, request);
|
state.selectedRequest = Object.assign({}, request)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
function testValue(myValue) {
|
function testValue(myValue) {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(myValue);
|
return JSON.parse(myValue)
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Now we know it's a string just leave it as a string value.
|
// Now we know it's a string just leave it as a string value.
|
||||||
return myValue;
|
return myValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
export default () => ({
|
export default () => ({
|
||||||
request: {
|
request: {
|
||||||
method: "GET",
|
method: 'GET',
|
||||||
url: "https://httpbin.org",
|
url: 'https://httpbin.org',
|
||||||
path: "/get",
|
path: '/get',
|
||||||
label: "",
|
label: '',
|
||||||
auth: "None",
|
auth: 'None',
|
||||||
httpUser: "",
|
httpUser: '',
|
||||||
httpPassword: "",
|
httpPassword: '',
|
||||||
passwordFieldType: "password",
|
passwordFieldType: 'password',
|
||||||
bearerToken: "",
|
bearerToken: '',
|
||||||
headers: [],
|
headers: [],
|
||||||
params: [],
|
params: [],
|
||||||
bodyParams: [],
|
bodyParams: [],
|
||||||
rawParams: "",
|
rawParams: '',
|
||||||
rawInput: false,
|
rawInput: false,
|
||||||
requestType: "",
|
requestType: '',
|
||||||
contentType: ""
|
contentType: '',
|
||||||
},
|
},
|
||||||
gql: {
|
gql: {
|
||||||
url: "https://rickandmortyapi.com/graphql",
|
url: 'https://rickandmortyapi.com/graphql',
|
||||||
headers: [],
|
headers: [],
|
||||||
variablesJSONString: "{}",
|
variablesJSONString: '{}',
|
||||||
query: ""
|
query: '',
|
||||||
},
|
},
|
||||||
oauth2: {
|
oauth2: {
|
||||||
tokens: [],
|
tokens: [],
|
||||||
tokenReqs: [],
|
tokenReqs: [],
|
||||||
tokenReqSelect: "",
|
tokenReqSelect: '',
|
||||||
tokenReqName: "",
|
tokenReqName: '',
|
||||||
accessTokenName: "",
|
accessTokenName: '',
|
||||||
oidcDiscoveryUrl: "",
|
oidcDiscoveryUrl: '',
|
||||||
authUrl: "",
|
authUrl: '',
|
||||||
accessTokenUrl: "",
|
accessTokenUrl: '',
|
||||||
clientId: "",
|
clientId: '',
|
||||||
scope: ""
|
scope: '',
|
||||||
}
|
},
|
||||||
});
|
})
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ describe('Authentication', () => {
|
|||||||
cy.visit(`?&auth=Basic Auth&httpUser=foo&httpPassword=bar`, { retryOnStatusCodeFailure: true })
|
cy.visit(`?&auth=Basic Auth&httpUser=foo&httpPassword=bar`, { retryOnStatusCodeFailure: true })
|
||||||
.get('input[name="http_basic_user"]', { timeout: 500 })
|
.get('input[name="http_basic_user"]', { timeout: 500 })
|
||||||
.invoke('val')
|
.invoke('val')
|
||||||
.then((user) => {
|
.then(user => {
|
||||||
expect(user === 'foo').to.equal(true)
|
expect(user === 'foo').to.equal(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
.get('input[name="http_basic_passwd"]')
|
.get('input[name="http_basic_passwd"]')
|
||||||
.invoke('val')
|
.invoke('val')
|
||||||
.then((pass) => {
|
.then(pass => {
|
||||||
expect(pass === 'bar').to.equal(true)
|
expect(pass === 'bar').to.equal(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
describe('Proxy disabled - local request', () => {
|
describe('Proxy disabled - local request', () => {
|
||||||
it('Change default url with query and make a request to local cat api', () => {
|
it('Change default url with query and make a request to local cat api', () => {
|
||||||
cy.seedAndVisit('catapi', '/?url=https://api.thecatapi.com&path=')
|
cy.seedAndVisit('catapi', '/?url=https://api.thecatapi.com&path=')
|
||||||
.get('#url').then((el) => expect(el.val() === 'https://api.thecatapi.com').to.equal(true))
|
.get('#url')
|
||||||
.get("#path").then((el) => expect(el.val() === '').to.equal(true))
|
.then(el => expect(el.val() === 'https://api.thecatapi.com').to.equal(true))
|
||||||
.get('#response-details-wrapper').should($wrapper => {
|
.get('#path')
|
||||||
|
.then(el => expect(el.val() === '').to.equal(true))
|
||||||
|
.get('#response-details-wrapper')
|
||||||
|
.should($wrapper => {
|
||||||
expect($wrapper).to.contain('FAKE Cat API')
|
expect($wrapper).to.contain('FAKE Cat API')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -12,8 +15,10 @@ describe('Proxy disabled - local request', () => {
|
|||||||
describe('Proxy enabled - external request', () => {
|
describe('Proxy enabled - external request', () => {
|
||||||
it('Enable the proxy and make a request to the real cat api', () => {
|
it('Enable the proxy and make a request to the real cat api', () => {
|
||||||
cy.enableProxy('/?url=https://api.thecatapi.com&path=')
|
cy.enableProxy('/?url=https://api.thecatapi.com&path=')
|
||||||
.get('#send').click()
|
.get('#send')
|
||||||
.get('#response-details-wrapper').should($wrapper => {
|
.click()
|
||||||
|
.get('#response-details-wrapper')
|
||||||
|
.should($wrapper => {
|
||||||
expect($wrapper).to.contain('Cat API')
|
expect($wrapper).to.contain('Cat API')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,10 +7,12 @@
|
|||||||
*/
|
*/
|
||||||
Cypress.Commands.add('seedAndVisit', (seedData, path = '/', method = 'GET') => {
|
Cypress.Commands.add('seedAndVisit', (seedData, path = '/', method = 'GET') => {
|
||||||
cy.server()
|
cy.server()
|
||||||
.route(method, 'https://api.thecatapi.com/', `fixture:${seedData}`).as('load')
|
.route(method, 'https://api.thecatapi.com/', `fixture:${seedData}`)
|
||||||
|
.as('load')
|
||||||
|
|
||||||
cy.visit(path)
|
cy.visit(path)
|
||||||
.get('#send').click()
|
.get('#send')
|
||||||
|
.click()
|
||||||
.wait('@load')
|
.wait('@load')
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -19,7 +21,7 @@ Cypress.Commands.add('seedAndVisit', (seedData, path = '/', method = 'GET') => {
|
|||||||
* This function will enable the proxy and navigate back to a given path
|
* This function will enable the proxy and navigate back to a given path
|
||||||
* @param { String } goBackPath The page go back
|
* @param { String } goBackPath The page go back
|
||||||
*/
|
*/
|
||||||
Cypress.Commands.add('enableProxy', (goBackPath) => {
|
Cypress.Commands.add('enableProxy', goBackPath => {
|
||||||
cy.visit('/settings')
|
cy.visit('/settings')
|
||||||
.get('#proxy')
|
.get('#proxy')
|
||||||
.find('.toggle')
|
.find('.toggle')
|
||||||
|
|||||||
Reference in New Issue
Block a user