1
0
Fork 0
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:
Knut Ahlers 2020-01-11 21:49:58 +01:00
parent 5ef83ec536
commit 6ced6fd57c
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
6 changed files with 1034 additions and 987 deletions

View file

@ -28,21 +28,21 @@ lint:
-v "$(CURDIR):/src" \ -v "$(CURDIR):/src" \
-w "/src" \ -w "/src" \
node:10-alpine \ 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: lint-fix:
docker run --rm -i \ docker run --rm -i \
-v "$(CURDIR):/src" \ -v "$(CURDIR):/src" \
-w "/src" \ -w "/src" \
node:10-alpine \ 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: lint-watch:
docker run --rm -i \ docker run --rm -i \
-v "$(CURDIR):/src" \ -v "$(CURDIR):/src" \
-w "/src" \ -w "/src" \
node:10-alpine \ 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 .PHONY: bindata.go
bindata.go: build_vue bindata.go: build_vue

1760
bindata.go

File diff suppressed because it is too large Load diff

View file

@ -24,7 +24,6 @@ import RegisterModal from './components/RegisterModal.vue'
import SignInModal from './components/SignInModal.vue' import SignInModal from './components/SignInModal.vue'
export default { export default {
name: 'app',
components: { components: {
AddPasswordModal, AddPasswordModal,
Landing, Landing,
@ -32,7 +31,9 @@ export default {
PasswordView, PasswordView,
RegisterModal, RegisterModal,
SignInModal, SignInModal,
} },
name: 'App',
} }
</script> </script>

View file

@ -1,54 +1,65 @@
<template> <template>
<b-modal id="addPassword" <b-modal
lazy id="addPassword"
ok-title="Add" lazy
size="lg" ok-title="Add"
title="Add Password" size="lg"
@ok="onOK"> title="Add Password"
<b-form @submit.prevent id="addPasswordForm"> @ok="onOK">
<b-form
@submit.prevent
id="addPasswordForm">
<b-form-group label="Title"> <b-form-group label="Title">
<b-form-input type="text" <b-form-input
name="title" type="text"
required name="title"
placeholder="Title"/> required
placeholder="Title"/>
</b-form-group> </b-form-group>
<b-form-group label="Username"> <b-form-group label="Username">
<b-form-input type="text" <b-form-input
name="username" type="text"
placeholder="Username"/> name="username"
placeholder="Username"/>
</b-form-group> </b-form-group>
<b-form-group label="Password"> <b-form-group label="Password">
<b-input-group> <b-input-group>
<b-form-input type="text" <b-form-input
name="password" type="text"
placeholder="Password"/> name="password"
placeholder="Password"/>
<b-input-group-append> <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-append>
</b-input-group> </b-input-group>
</b-form-group> </b-form-group>
<b-form-group label="URL"> <b-form-group label="URL">
<b-form-input type="text" <b-form-input
name="url" type="text"
placeholder="URL"/> name="url"
placeholder="URL"/>
</b-form-group> </b-form-group>
<b-form-group label="Comments"> <b-form-group label="Comments">
<b-form-textarea type="text" <b-form-textarea
name="comments" type="text"
rows="4" name="comments"
placeholder="Comments / notes for the entry"/> rows="4"
placeholder="Comments / notes for the entry"/>
</b-form-group> </b-form-group>
<b-form-group label="Tags"> <b-form-group label="Tags">
<b-form-input type="text" <b-form-input
name="tags" type="text"
placeholder="Tags"/> name="tags"
placeholder="Tags"/>
</b-form-group> </b-form-group>
</b-form> </b-form>
@ -58,19 +69,20 @@
<script> <script>
export default { export default {
name: 'addpassword',
methods: { methods: {
onOK: function() { onOK() {
let form = document.getElementById('addPasswordForm') const form = document.getElementById('addPasswordForm')
let entry = {} const entry = {}
for(var pair of new FormData(form).entries()) { for (var pair of new FormData(form).entries()) {
entry[pair[0]] = pair[1] entry[pair[0]] = pair[1]
} }
this.$store.dispatch('add_entry', entry) this.$store.dispatch('add_entry', entry)
form.reset() form.reset()
}, },
} },
name: 'Addpassword',
} }
</script> </script>

View file

@ -1,86 +1,102 @@
<template> <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"> <b-navbar-brand class="mr-3">
<fa-icon icon="key" /> cloud<strong>keys</strong> <fa-icon icon="key" /> cloud<strong>keys</strong>
</b-navbar-brand> </b-navbar-brand>
<b-navbar-toggle target="nav_collapse"></b-navbar-toggle> <b-navbar-toggle target="nav_collapse"/>
<b-collapse is-nav id="nav_collapse"> <b-collapse
is-nav
id="nav_collapse">
<b-navbar-nav class="mr-auto"> <b-navbar-nav class="mr-auto">
<b-nav-item href="#" <b-nav-item
class="mr-2" href="#"
title="Add new password (Ctrl+N)" class="mr-2"
v-shortkey.once="['ctrl', 'n']" title="Add new password (Ctrl+N)"
@shortkey="" v-shortkey.once="['ctrl', 'n']"
v-if="this.$store.state.account_info.master_password" v-if="this.$store.state.account_info.master_password"
v-b-modal.addPassword> v-b-modal.addPassword>
<fa-icon icon="plus-circle" /> Add Password <fa-icon icon="plus-circle" /> Add Password
</b-nav-item> </b-nav-item>
<b-nav-item href="#" <b-nav-item
title="Import passwords from KeePass" href="#"
v-if="this.$store.state.account_info.master_password" title="Import passwords from KeePass"
class="d-none d-sm-none d-md-none d-lg-block d-xl-block"> 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 <fa-icon icon="file-import" /> Import from KeePass
</b-nav-item> </b-nav-item>
</b-navbar-nav> </b-navbar-nav>
<b-navbar-nav class="ml-auto"> <b-navbar-nav class="ml-auto">
<b-nav-item-dropdown text="Select Account" right v-if="this.$store.state.accounts.length > 0"> <b-nav-item-dropdown
<b-dropdown-item href="#" text="Select Account"
v-for="user in this.$store.state.accounts" right
:key="user" v-if="this.$store.state.accounts.length > 0">
@click="$store.dispatch('load_user_data', user)"> <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" /> <fa-icon icon="user" />
<strong v-if="$store.state.account_info.loaded == user">{{ user }}</strong> <strong v-if="$store.state.account_info.loaded == user">{{ user }}</strong>
<span v-else>{{ user }}</span> <span v-else>{{ user }}</span>
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-divider /> <b-dropdown-divider />
<b-dropdown-item href="#" <b-dropdown-item
v-b-modal.signIn> href="#"
v-b-modal.signIn>
<fa-icon icon="sign-in-alt" /> Sign in <fa-icon icon="sign-in-alt" /> Sign in
</b-dropdown-item> </b-dropdown-item>
</b-nav-item-dropdown> </b-nav-item-dropdown>
<b-nav-item href="#" <b-nav-item
class="mr-3" href="#"
title="Sign in to an existing account" class="mr-3"
v-if="this.$store.state.accounts.length == 0" title="Sign in to an existing account"
v-b-modal.signIn> v-if="this.$store.state.accounts.length == 0"
v-b-modal.signIn>
<fa-icon icon="sign-in-alt" /> Login <fa-icon icon="sign-in-alt" /> Login
</b-nav-item> </b-nav-item>
<b-nav-item href="#" <b-nav-item
title="Lock current account (Ctrl+L)" href="#"
v-shortkey.once="['ctrl', 'l']" title="Lock current account (Ctrl+L)"
@shortkey="$store.commit('lock_database')" v-shortkey.once="['ctrl', 'l']"
@click="$store.commit('lock_database')" @shortkey="$store.commit('lock_database')"
v-if="this.$store.state.account_info.master_password" @click="$store.commit('lock_database')"
class="mr-2 d-none d-sm-none d-md-none d-lg-block d-xl-block"> 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" /> <fa-icon icon="lock" />
</b-nav-item> </b-nav-item>
<b-nav-item href="#" <b-nav-item
class="mr-2" href="#"
title="Sign out current account" class="mr-2"
v-if="this.$store.state.account_info.loaded" title="Sign out current account"
@click="$store.dispatch('sign_out')"> v-if="this.$store.state.account_info.loaded"
@click="$store.dispatch('sign_out')">
<fa-icon icon="sign-out-alt" /> <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> <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>
<b-nav-item href="#" <b-nav-item
title="Register new account" href="#"
class="mr-2 d-none d-sm-none d-md-none d-lg-block d-xl-block" title="Register new account"
v-b-modal.register> 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" /> <fa-icon icon="user-plus" />
</b-nav-item> </b-nav-item>
<b-nav-item href="#" <b-nav-item
title="Info" href="#"
class="ml-2 d-none d-sm-none d-md-none d-lg-block d-xl-block"> title="Info"
class="ml-2 d-none d-sm-none d-md-none d-lg-block d-xl-block">
<fa-icon icon="info-circle" /> <fa-icon icon="info-circle" />
</b-nav-item> </b-nav-item>
@ -91,6 +107,6 @@
<script> <script>
export default { export default {
name: 'navigation', name: 'Navigation',
} }
</script> </script>

View file

@ -1,23 +1,30 @@
<template> <template>
<b-modal id="signIn" <b-modal
lazy id="signIn"
ok-title="Sign-In" lazy
size="lg" ok-title="Sign-In"
title="Sign in using existing account" size="lg"
@ok="onOK"> title="Sign in using existing account"
<b-form @submit.prevent id="signInForm"> @ok="issueLogin">
<b-form
@submit.prevent="issueLogin"
id="signInForm">
<b-form-group label="Username"> <b-form-group label="Username">
<b-form-input type="text" <b-form-input
name="username" type="text"
placeholder="Username"/> name="username"
placeholder="Username"
v-model="login.username"/>
</b-form-group> </b-form-group>
<b-form-group label="Password"> <b-form-group label="Password">
<b-form-input type="password" <b-form-input
name="password" type="password"
placeholder="Password"/> name="password"
placeholder="Password"
v-model="login.password"/>
</b-form-group> </b-form-group>
</b-form> </b-form>
@ -27,19 +34,22 @@
<script> <script>
export default { export default {
name: 'signin', data() {
return {
login: {
password: '',
username: '',
},
}
},
methods: { methods: {
onOK: function() { issueLogin() {
let form = document.getElementById('signInForm') this.$store.dispatch('sign_in', this.login)
let entry = {} this.login = { password: '', username: '' }
for(var pair of new FormData(form).entries()) {
entry[pair[0]] = pair[1]
}
this.$store.dispatch('sign_in', entry)
form.reset()
}, },
} },
name: 'Signin',
} }
</script> </script>