run prettier

This commit is contained in:
Son Nguyen Kim
2021-08-03 16:36:35 +02:00
parent ab4b62d217
commit 39f0cb8913
12 changed files with 57 additions and 60 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ async function handleNewRandomAlias(currentUrl) {
hostname,
},
{
note: await Utils.getDefaultNote()
note: await Utils.getDefaultNote(),
},
API_ON_ERR.THROW
);
-2
View File
@@ -30,8 +30,6 @@ function initService() {
});
}
});
}
export default { initService };
+9 -9
View File
@@ -67,12 +67,12 @@
<img
v-if="isChrome"
src="../images/chrome-permission-screenshot.png"
style="width: 400px;"
style="width: 400px"
/>
<img
v-else
src="../images/firefox-permission-screenshot.png"
style="width: 400px;"
style="width: 400px"
/>
<p>
@@ -84,7 +84,7 @@
<img
alt="SimpleLogin Button demo"
src="../images/sl-button-demo.png"
style="width: 400px;"
style="width: 400px"
class="mb-3"
/>
@@ -106,7 +106,7 @@
<button
@click="nextStep()"
class="btn"
style="color: #888; font-size: 0.8em;"
style="color: #888; font-size: 0.8em"
>
Skip
</button>
@@ -119,20 +119,20 @@
<img
alt="SimpleLogin"
src="../images/icon-simplelogin.png"
style="height: 1.2em;"
style="height: 1.2em"
/>
icon at the corner of your browser.
</p>
<p
v-if="isChrome"
class="alert alert-primary"
style="border-left: 5px #467fcf solid;"
style="border-left: 5px #467fcf solid"
>
Note: this icon maybe hidden under
<img
alt="Extension Menu"
src="../images/icon-puzzle.png"
style="height: 1.2em;"
style="height: 1.2em"
/>
button.
</p>
@@ -148,10 +148,10 @@
</template>
<script>
import {requestPermission} from "../background/permissions";
import { requestPermission } from "../background/permissions";
import SLStorage from "../popup/SLStorage";
import axios from "axios";
import {API_ROUTE} from "../popup/APIService";
import { API_ROUTE } from "../popup/APIService";
import EventManager from "../popup/EventManager";
export default {
+5 -5
View File
@@ -24,16 +24,16 @@ class Utils {
}
}
static async getDefaultNote(){
static async getDefaultNote() {
const hostName = await Utils.getHostName();
let note = '';
let note = "";
// ignore hostName that doesn't look like an url
if (hostName && hostName.indexOf(".") > -1){
note = `Used on ${hostName}`
if (hostName && hostName.indexOf(".") > -1) {
note = `Used on ${hostName}`;
}
return note
return note;
}
static getDeviceName() {
+2 -2
View File
@@ -29,7 +29,7 @@
<textarea-autosize
placeholder="Note, can be anything to help you remember why you created this alias. This field is optional."
class="form-control"
style="width: 100%;"
style="width: 100%"
v-model="moreOptions.note"
:disabled="loading"
></textarea-autosize>
@@ -69,7 +69,7 @@
<button
class="btn btn-sm btn-delete"
style="color: #dc3545;"
style="color: #dc3545"
v-on:click="handleClickDelete"
:disabled="loading"
>
+5 -5
View File
@@ -1,21 +1,21 @@
<template>
<div class="header">
<div class="row mt-2 pb-2 ml-3 mr-2" style="border-bottom: 1px #eee solid;">
<div class="row mt-2 pb-2 ml-3 mr-2" style="border-bottom: 1px #eee solid">
<div>
<div
v-on:click="navigateBack()"
v-bind:class="{ back: canBack }"
style="display: inline-block;"
style="display: inline-block"
>
<img
v-if="canBack"
src="/images/back-button.svg"
style="height: 20px;"
style="height: 20px"
/>
<img
class="sl-logo"
src="/images/horizontal-logo.svg"
style="height: 18px;"
style="height: 18px"
/>
</div>
<div class="beta-badge" v-if="isBeta">BETA</div>
@@ -53,7 +53,7 @@
:href="apiUrl + '/dashboard/'"
target="_blank"
class="dashboard-btn float-right"
style="padding: 0.25rem 0.5rem; font-size: 0.875rem;"
style="padding: 0.25rem 0.5rem; font-size: 0.875rem"
title="Dashboard"
v-b-tooltip.hover
:disabled="!useCompactLayout"
+5 -9
View File
@@ -1,7 +1,7 @@
<template>
<div class="content">
<!-- Login/register screen -->
<div v-if="!isShowMfa" class="p-6 container" style="min-height: 350px;">
<div v-if="!isShowMfa" class="p-6 container" style="min-height: 350px">
<h1 class="h5 mb-3">
Welcome to
<a href="https://simplelogin.io" target="_blank"
@@ -30,9 +30,7 @@
<input v-model="password" type="password" class="form-control" />
</div>
<button class="btn btn-primary btn-block mt-2">
Login
</button>
<button class="btn btn-primary btn-block mt-2">Login</button>
</form>
<div class="text-center">
@@ -54,7 +52,7 @@
<!-- END Login/register screen -->
<!-- MFA screen -->
<div v-else class="p-6 container" style="min-height: 350px;">
<div v-else class="p-6 container" style="min-height: 350px">
<div class="p-3">
<div class="mb-2">
Your account is protected with Two Factor Authentication. <br />
@@ -62,12 +60,10 @@
<div>
<b>Token</b>
<p>
Please enter the 2FA code from your 2FA authenticator
</p>
<p>Please enter the 2FA code from your 2FA authenticator</p>
</div>
<div style="margin: auto;">
<div style="margin: auto">
<input
v-model="mfaCode"
v-on:keyup.enter="submitMfaCode"
+25 -19
View File
@@ -27,14 +27,14 @@
<div>
<p
class="font-weight-bold mt-2 align-self-center"
style="display: inline-block;"
style="display: inline-block"
>
New Alias
</p>
<button
:disabled="loading || !canCreate"
style="margin-left: 15px;"
style="margin-left: 15px"
class="btn btn-outline-primary btn-sm"
title="Generate a totally random alias."
@click="createRandomAlias"
@@ -49,7 +49,7 @@
<div class="row mb-2">
<div
class="col align-self-start input-group-sm"
style="padding-right: 0;"
style="padding-right: 0"
>
<input
v-model="aliasPrefix"
@@ -63,7 +63,7 @@
<div
class="col align-self-start input-group-sm"
style="padding-left: 5px; padding-right: 5px;"
style="padding-left: 5px; padding-right: 5px"
>
<select
v-model="signedSuffix"
@@ -82,26 +82,31 @@
<button
:disabled="loading || !canCreate"
style="margin-right: 15px;"
style="margin-right: 15px"
class="btn btn-primary btn-sm align-self-start"
>
Create
</button>
</div>
<div class="row text-danger" style="font-size: 12px" v-if="aliasPrefixError != ''">
<div
class="row text-danger"
style="font-size: 12px"
v-if="aliasPrefixError != ''"
>
<div class="col">
{{aliasPrefixError}}
{{ aliasPrefixError }}
</div>
</div>
</form>
</div>
<div class="mb-1 text-center" v-if="aliasPrefix" style="font-size: 12px">
You're about to create alias <span class="text-primary">{{aliasPrefix}}{{signedSuffix[0]}}</span>
You're about to create alias
<span class="text-primary">{{ aliasPrefix }}{{ signedSuffix[0] }}</span>
</div>
<div v-if="!canCreate">
<p class="text-danger" style="font-size: 14px;">
<p class="text-danger" style="font-size: 14px">
You have reached limit number of email aliases in free plan, please
<a :href="apiUrl + '/dashboard/pricing'" target="_blank">upgrade</a>
or reuse one of the existing aliases.
@@ -114,7 +119,7 @@
Or use an existing alias
</div>
<div class="mx-auto" style="max-width: 60%;">
<div class="mx-auto" style="max-width: 60%">
<input
v-model="searchString"
v-on:keyup.enter="loadAlias"
@@ -128,7 +133,7 @@
v-if="searchString"
@click="resetSearch"
class="float-right"
style="color: blue; border: none; padding: 0; background: none;"
style="color: blue; border: none; padding: 0; background: none"
>
Reset
</button>
@@ -152,7 +157,7 @@
</a>
<div class="list-item-email-fade" />
</div>
<div style="white-space: nowrap;">
<div style="white-space: nowrap">
<toggle-button
:value="alias.enabled"
color="#b02a8f"
@@ -180,7 +185,7 @@
{{ alias.note }}
</div>
<div class="font-weight-lighter" style="font-size: 11px;">
<div class="font-weight-lighter" style="font-size: 11px">
{{ alias.nb_forward }} forwards, {{ alias.nb_reply }} replies,
{{ alias.nb_block }} blocks.
</div>
@@ -201,7 +206,7 @@
<div v-if="isFetchingAlias" class="text-secondary mx-auto text-center">
<img
src="/images/loading-three-dots.svg"
style="width: 80px; margin: 20px;"
style="width: 80px; margin: 20px"
/>
</div>
</div>
@@ -217,7 +222,7 @@ import Navigation from "../Navigation";
import AliasMoreOptions from "./AliasMoreOptions";
import { callAPI, API_ROUTE, API_ON_ERR } from "../APIService";
const ALIAS_PREFIX_REGEX =/^[0-9a-z-_.]+$/
const ALIAS_PREFIX_REGEX = /^[0-9a-z-_.]+$/;
export default {
components: {
@@ -359,10 +364,11 @@ export default {
if (this.loading) return;
// check aliasPrefix
this.aliasPrefixError = ""
if (this.aliasPrefix.match(ALIAS_PREFIX_REGEX) === null){
this.aliasPrefixError = "Only lowercase letters, dots, numbers, dashes (-) and underscores (_) are currently supported."
return
this.aliasPrefixError = "";
if (this.aliasPrefix.match(ALIAS_PREFIX_REGEX) === null) {
this.aliasPrefixError =
"Only lowercase letters, dots, numbers, dashes (-) and underscores (_) are currently supported.";
return;
}
this.loading = true;
+1 -1
View File
@@ -41,7 +41,7 @@
<a
@click="doNotAskRateAgain"
class="text-secondary cursor"
style="font-size: 0.7em;"
style="font-size: 0.7em"
>
Do not ask again
</a>
+2 -4
View File
@@ -5,11 +5,9 @@
If you self-host SimpleLogin, you can change the API URL to your server
address.
</div>
<div class="mb-2">
The default API URL is https://app.simplelogin.io
</div>
<div class="mb-2">The default API URL is https://app.simplelogin.io</div>
<div style="margin: auto;">
<div style="margin: auto">
<input
v-model="apiUrl"
v-on:keyup.enter="saveApiUrl"
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<div v-if="show" style="height: 400px;">
<div v-if="show" style="height: 400px">
<div class="splash overlay">
<div class="overlay-content">
<img class="logo" src="/images/horizontal-logo.svg" /><br />
+1 -2
View File
@@ -56,8 +56,7 @@ async function initApp() {
process.env.NODE_ENV !== "development"
) {
Sentry.init({
dsn:
"https://0e2d03e61f194df9ba85a791d364088b@o336535.ingest.sentry.io/5341174",
dsn: "https://0e2d03e61f194df9ba85a791d364088b@o336535.ingest.sentry.io/5341174",
integrations: [
new Integrations.Vue({ Vue, attachProps: true, logErrors: true }),
],