mirror of
https://github.com/Luzifer/cloudkeys-go.git
synced 2024-11-08 14:10:05 +00:00
Lint .vue files
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
5ef83ec536
commit
6ced6fd57c
6 changed files with 1034 additions and 987 deletions
6
Makefile
6
Makefile
|
@ -28,21 +28,21 @@ lint:
|
|||
-v "$(CURDIR):/src" \
|
||||
-w "/src" \
|
||||
node:10-alpine \
|
||||
sh -exc "apk add python && npm ci && npx eslint src"
|
||||
sh -exc "apk add python && npm ci && npx eslint --ext .vue,.js src"
|
||||
|
||||
lint-fix:
|
||||
docker run --rm -i \
|
||||
-v "$(CURDIR):/src" \
|
||||
-w "/src" \
|
||||
node:10-alpine \
|
||||
sh -exc "apk add python && npm ci && npx eslint --fix src"
|
||||
sh -exc "apk add python && npm ci && npx eslint --ext .vue,.js --fix src"
|
||||
|
||||
lint-watch:
|
||||
docker run --rm -i \
|
||||
-v "$(CURDIR):/src" \
|
||||
-w "/src" \
|
||||
node:10-alpine \
|
||||
sh -exc "apk add python && npm ci && while true; do npx eslint src || true; sleep 5; done"
|
||||
sh -exc "apk add python && npm ci && while true; do npx eslint --ext .vue,.js src || true; sleep 5; done"
|
||||
|
||||
.PHONY: bindata.go
|
||||
bindata.go: build_vue
|
||||
|
|
1760
bindata.go
1760
bindata.go
File diff suppressed because it is too large
Load diff
|
@ -24,7 +24,6 @@ import RegisterModal from './components/RegisterModal.vue'
|
|||
import SignInModal from './components/SignInModal.vue'
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
AddPasswordModal,
|
||||
Landing,
|
||||
|
@ -32,7 +31,9 @@ export default {
|
|||
PasswordView,
|
||||
RegisterModal,
|
||||
SignInModal,
|
||||
}
|
||||
},
|
||||
|
||||
name: 'App',
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,54 +1,65 @@
|
|||
<template>
|
||||
|
||||
<b-modal id="addPassword"
|
||||
lazy
|
||||
ok-title="Add"
|
||||
size="lg"
|
||||
title="Add Password"
|
||||
@ok="onOK">
|
||||
<b-form @submit.prevent id="addPasswordForm">
|
||||
<b-modal
|
||||
id="addPassword"
|
||||
lazy
|
||||
ok-title="Add"
|
||||
size="lg"
|
||||
title="Add Password"
|
||||
@ok="onOK">
|
||||
<b-form
|
||||
@submit.prevent
|
||||
id="addPasswordForm">
|
||||
|
||||
<b-form-group label="Title">
|
||||
<b-form-input type="text"
|
||||
name="title"
|
||||
required
|
||||
placeholder="Title"/>
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="title"
|
||||
required
|
||||
placeholder="Title"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Username">
|
||||
<b-form-input type="text"
|
||||
name="username"
|
||||
placeholder="Username"/>
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="username"
|
||||
placeholder="Username"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Password">
|
||||
<b-input-group>
|
||||
<b-form-input type="text"
|
||||
name="password"
|
||||
placeholder="Password"/>
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="password"
|
||||
placeholder="Password"/>
|
||||
<b-input-group-append>
|
||||
<b-btn variant="primary" title="Generate password"><fa-icon icon="sync" /></b-btn>
|
||||
<b-btn
|
||||
variant="primary"
|
||||
title="Generate password"><fa-icon icon="sync" /></b-btn>
|
||||
</b-input-group-append>
|
||||
</b-input-group>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="URL">
|
||||
<b-form-input type="text"
|
||||
name="url"
|
||||
placeholder="URL"/>
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="url"
|
||||
placeholder="URL"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Comments">
|
||||
<b-form-textarea type="text"
|
||||
name="comments"
|
||||
rows="4"
|
||||
placeholder="Comments / notes for the entry"/>
|
||||
<b-form-textarea
|
||||
type="text"
|
||||
name="comments"
|
||||
rows="4"
|
||||
placeholder="Comments / notes for the entry"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Tags">
|
||||
<b-form-input type="text"
|
||||
name="tags"
|
||||
placeholder="Tags"/>
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="tags"
|
||||
placeholder="Tags"/>
|
||||
</b-form-group>
|
||||
|
||||
</b-form>
|
||||
|
@ -58,19 +69,20 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'addpassword',
|
||||
methods: {
|
||||
onOK: function() {
|
||||
let form = document.getElementById('addPasswordForm')
|
||||
let entry = {}
|
||||
onOK() {
|
||||
const form = document.getElementById('addPasswordForm')
|
||||
const entry = {}
|
||||
|
||||
for(var pair of new FormData(form).entries()) {
|
||||
for (var pair of new FormData(form).entries()) {
|
||||
entry[pair[0]] = pair[1]
|
||||
}
|
||||
|
||||
this.$store.dispatch('add_entry', entry)
|
||||
form.reset()
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
name: 'Addpassword',
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,86 +1,102 @@
|
|||
<template>
|
||||
<b-navbar toggleable="md" type="dark" variant="primary" class="mb-4">
|
||||
<b-navbar
|
||||
toggleable="md"
|
||||
type="dark"
|
||||
variant="primary"
|
||||
class="mb-4">
|
||||
<b-navbar-brand class="mr-3">
|
||||
<fa-icon icon="key" /> cloud<strong>keys</strong>
|
||||
</b-navbar-brand>
|
||||
<b-navbar-toggle target="nav_collapse"></b-navbar-toggle>
|
||||
<b-collapse is-nav id="nav_collapse">
|
||||
<b-navbar-toggle target="nav_collapse"/>
|
||||
<b-collapse
|
||||
is-nav
|
||||
id="nav_collapse">
|
||||
<b-navbar-nav class="mr-auto">
|
||||
<b-nav-item href="#"
|
||||
class="mr-2"
|
||||
title="Add new password (Ctrl+N)"
|
||||
v-shortkey.once="['ctrl', 'n']"
|
||||
@shortkey=""
|
||||
v-if="this.$store.state.account_info.master_password"
|
||||
v-b-modal.addPassword>
|
||||
<b-nav-item
|
||||
href="#"
|
||||
class="mr-2"
|
||||
title="Add new password (Ctrl+N)"
|
||||
v-shortkey.once="['ctrl', 'n']"
|
||||
v-if="this.$store.state.account_info.master_password"
|
||||
v-b-modal.addPassword>
|
||||
<fa-icon icon="plus-circle" /> Add Password
|
||||
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
title="Import passwords from KeePass"
|
||||
v-if="this.$store.state.account_info.master_password"
|
||||
class="d-none d-sm-none d-md-none d-lg-block d-xl-block">
|
||||
<b-nav-item
|
||||
href="#"
|
||||
title="Import passwords from KeePass"
|
||||
v-if="this.$store.state.account_info.master_password"
|
||||
class="d-none d-sm-none d-md-none d-lg-block d-xl-block">
|
||||
<fa-icon icon="file-import" /> Import from KeePass
|
||||
</b-nav-item>
|
||||
</b-navbar-nav>
|
||||
|
||||
<b-navbar-nav class="ml-auto">
|
||||
|
||||
<b-nav-item-dropdown text="Select Account" right v-if="this.$store.state.accounts.length > 0">
|
||||
<b-dropdown-item href="#"
|
||||
v-for="user in this.$store.state.accounts"
|
||||
:key="user"
|
||||
@click="$store.dispatch('load_user_data', user)">
|
||||
<b-nav-item-dropdown
|
||||
text="Select Account"
|
||||
right
|
||||
v-if="this.$store.state.accounts.length > 0">
|
||||
<b-dropdown-item
|
||||
href="#"
|
||||
v-for="user in this.$store.state.accounts"
|
||||
:key="user"
|
||||
@click="$store.dispatch('load_user_data', user)">
|
||||
<fa-icon icon="user" />
|
||||
<strong v-if="$store.state.account_info.loaded == user">{{ user }}</strong>
|
||||
<span v-else>{{ user }}</span>
|
||||
</b-dropdown-item>
|
||||
|
||||
<b-dropdown-divider />
|
||||
<b-dropdown-item href="#"
|
||||
v-b-modal.signIn>
|
||||
<b-dropdown-item
|
||||
href="#"
|
||||
v-b-modal.signIn>
|
||||
<fa-icon icon="sign-in-alt" /> Sign in
|
||||
</b-dropdown-item>
|
||||
</b-nav-item-dropdown>
|
||||
|
||||
<b-nav-item href="#"
|
||||
class="mr-3"
|
||||
title="Sign in to an existing account"
|
||||
v-if="this.$store.state.accounts.length == 0"
|
||||
v-b-modal.signIn>
|
||||
<b-nav-item
|
||||
href="#"
|
||||
class="mr-3"
|
||||
title="Sign in to an existing account"
|
||||
v-if="this.$store.state.accounts.length == 0"
|
||||
v-b-modal.signIn>
|
||||
<fa-icon icon="sign-in-alt" /> Login
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
title="Lock current account (Ctrl+L)"
|
||||
v-shortkey.once="['ctrl', 'l']"
|
||||
@shortkey="$store.commit('lock_database')"
|
||||
@click="$store.commit('lock_database')"
|
||||
v-if="this.$store.state.account_info.master_password"
|
||||
class="mr-2 d-none d-sm-none d-md-none d-lg-block d-xl-block">
|
||||
<b-nav-item
|
||||
href="#"
|
||||
title="Lock current account (Ctrl+L)"
|
||||
v-shortkey.once="['ctrl', 'l']"
|
||||
@shortkey="$store.commit('lock_database')"
|
||||
@click="$store.commit('lock_database')"
|
||||
v-if="this.$store.state.account_info.master_password"
|
||||
class="mr-2 d-none d-sm-none d-md-none d-lg-block d-xl-block">
|
||||
<fa-icon icon="lock" />
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
class="mr-2"
|
||||
title="Sign out current account"
|
||||
v-if="this.$store.state.account_info.loaded"
|
||||
@click="$store.dispatch('sign_out')">
|
||||
<b-nav-item
|
||||
href="#"
|
||||
class="mr-2"
|
||||
title="Sign out current account"
|
||||
v-if="this.$store.state.account_info.loaded"
|
||||
@click="$store.dispatch('sign_out')">
|
||||
<fa-icon icon="sign-out-alt" />
|
||||
<span class="d-inline d-sm-inline d-md-inline d-lg-none d-xl-none">Sign out</span>
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
title="Register new account"
|
||||
class="mr-2 d-none d-sm-none d-md-none d-lg-block d-xl-block"
|
||||
v-b-modal.register>
|
||||
<b-nav-item
|
||||
href="#"
|
||||
title="Register new account"
|
||||
class="mr-2 d-none d-sm-none d-md-none d-lg-block d-xl-block"
|
||||
v-b-modal.register>
|
||||
<fa-icon icon="user-plus" />
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
title="Info"
|
||||
class="ml-2 d-none d-sm-none d-md-none d-lg-block d-xl-block">
|
||||
<b-nav-item
|
||||
href="#"
|
||||
title="Info"
|
||||
class="ml-2 d-none d-sm-none d-md-none d-lg-block d-xl-block">
|
||||
<fa-icon icon="info-circle" />
|
||||
</b-nav-item>
|
||||
|
||||
|
@ -91,6 +107,6 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'navigation',
|
||||
name: 'Navigation',
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,23 +1,30 @@
|
|||
<template>
|
||||
|
||||
<b-modal id="signIn"
|
||||
lazy
|
||||
ok-title="Sign-In"
|
||||
size="lg"
|
||||
title="Sign in using existing account"
|
||||
@ok="onOK">
|
||||
<b-form @submit.prevent id="signInForm">
|
||||
<b-modal
|
||||
id="signIn"
|
||||
lazy
|
||||
ok-title="Sign-In"
|
||||
size="lg"
|
||||
title="Sign in using existing account"
|
||||
@ok="issueLogin">
|
||||
<b-form
|
||||
@submit.prevent="issueLogin"
|
||||
id="signInForm">
|
||||
|
||||
<b-form-group label="Username">
|
||||
<b-form-input type="text"
|
||||
name="username"
|
||||
placeholder="Username"/>
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="username"
|
||||
placeholder="Username"
|
||||
v-model="login.username"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Password">
|
||||
<b-form-input type="password"
|
||||
name="password"
|
||||
placeholder="Password"/>
|
||||
<b-form-input
|
||||
type="password"
|
||||
name="password"
|
||||
placeholder="Password"
|
||||
v-model="login.password"/>
|
||||
</b-form-group>
|
||||
|
||||
</b-form>
|
||||
|
@ -27,19 +34,22 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'signin',
|
||||
data() {
|
||||
return {
|
||||
login: {
|
||||
password: '',
|
||||
username: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onOK: function() {
|
||||
let form = document.getElementById('signInForm')
|
||||
let entry = {}
|
||||
|
||||
for(var pair of new FormData(form).entries()) {
|
||||
entry[pair[0]] = pair[1]
|
||||
}
|
||||
|
||||
this.$store.dispatch('sign_in', entry)
|
||||
form.reset()
|
||||
issueLogin() {
|
||||
this.$store.dispatch('sign_in', this.login)
|
||||
this.login = { password: '', username: '' }
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
name: 'Signin',
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue