mirror of
https://github.com/Luzifer/cloudkeys-go.git
synced 2024-11-09 14:40: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,52 +1,63 @@
|
|||
<template>
|
||||
|
||||
<b-modal id="addPassword"
|
||||
<b-modal
|
||||
id="addPassword"
|
||||
lazy
|
||||
ok-title="Add"
|
||||
size="lg"
|
||||
title="Add Password"
|
||||
@ok="onOK">
|
||||
<b-form @submit.prevent id="addPasswordForm">
|
||||
<b-form
|
||||
@submit.prevent
|
||||
id="addPasswordForm">
|
||||
|
||||
<b-form-group label="Title">
|
||||
<b-form-input type="text"
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="title"
|
||||
required
|
||||
placeholder="Title"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Username">
|
||||
<b-form-input type="text"
|
||||
<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"
|
||||
<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"
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="url"
|
||||
placeholder="URL"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Comments">
|
||||
<b-form-textarea type="text"
|
||||
<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"
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="tags"
|
||||
placeholder="Tags"/>
|
||||
</b-form-group>
|
||||
|
@ -58,11 +69,10 @@
|
|||
|
||||
<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()) {
|
||||
entry[pair[0]] = pair[1]
|
||||
|
@ -71,6 +81,8 @@ export default {
|
|||
this.$store.dispatch('add_entry', entry)
|
||||
form.reset()
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
name: 'Addpassword',
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,23 +1,29 @@
|
|||
<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="#"
|
||||
<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>
|
||||
<fa-icon icon="plus-circle" /> Add Password
|
||||
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
<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">
|
||||
|
@ -27,8 +33,12 @@
|
|||
|
||||
<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="#"
|
||||
<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)">
|
||||
|
@ -38,13 +48,15 @@
|
|||
</b-dropdown-item>
|
||||
|
||||
<b-dropdown-divider />
|
||||
<b-dropdown-item href="#"
|
||||
<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="#"
|
||||
<b-nav-item
|
||||
href="#"
|
||||
class="mr-3"
|
||||
title="Sign in to an existing account"
|
||||
v-if="this.$store.state.accounts.length == 0"
|
||||
|
@ -52,7 +64,8 @@
|
|||
<fa-icon icon="sign-in-alt" /> Login
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
<b-nav-item
|
||||
href="#"
|
||||
title="Lock current account (Ctrl+L)"
|
||||
v-shortkey.once="['ctrl', 'l']"
|
||||
@shortkey="$store.commit('lock_database')"
|
||||
|
@ -62,7 +75,8 @@
|
|||
<fa-icon icon="lock" />
|
||||
</b-nav-item>
|
||||
|
||||
<b-nav-item href="#"
|
||||
<b-nav-item
|
||||
href="#"
|
||||
class="mr-2"
|
||||
title="Sign out current account"
|
||||
v-if="this.$store.state.account_info.loaded"
|
||||
|
@ -71,14 +85,16 @@
|
|||
<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="#"
|
||||
<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="#"
|
||||
<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" />
|
||||
|
@ -91,6 +107,6 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'navigation',
|
||||
name: 'Navigation',
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,23 +1,30 @@
|
|||
<template>
|
||||
|
||||
<b-modal id="signIn"
|
||||
<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">
|
||||
@ok="issueLogin">
|
||||
<b-form
|
||||
@submit.prevent="issueLogin"
|
||||
id="signInForm">
|
||||
|
||||
<b-form-group label="Username">
|
||||
<b-form-input type="text"
|
||||
<b-form-input
|
||||
type="text"
|
||||
name="username"
|
||||
placeholder="Username"/>
|
||||
placeholder="Username"
|
||||
v-model="login.username"/>
|
||||
</b-form-group>
|
||||
|
||||
<b-form-group label="Password">
|
||||
<b-form-input type="password"
|
||||
<b-form-input
|
||||
type="password"
|
||||
name="password"
|
||||
placeholder="Password"/>
|
||||
placeholder="Password"
|
||||
v-model="login.password"/>
|
||||
</b-form-group>
|
||||
|
||||
</b-form>
|
||||
|
@ -27,19 +34,22 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'signin',
|
||||
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()
|
||||
data() {
|
||||
return {
|
||||
login: {
|
||||
password: '',
|
||||
username: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
issueLogin() {
|
||||
this.$store.dispatch('sign_in', this.login)
|
||||
this.login = { password: '', username: '' }
|
||||
},
|
||||
},
|
||||
|
||||
name: 'Signin',
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue