浏览代码

add icon and label for login input in default options

pull/342/head
Guillaume Vincent 7 年前
父节点
当前提交
10b8371f07
共有 2 个文件被更改,包括 27 次插入16 次删除
  1. +27
    -12
      src/views/ConfigureOptions.vue
  2. +0
    -4
      src/views/PasswordGenerator.vue

+ 27
- 12
src/views/ConfigureOptions.vue 查看文件

@@ -1,20 +1,29 @@
<template>
<div>
<div class="form-group">
<input id="login"
name="login"
type="text"
class="form-control"
placeholder="Login"
autocomplete="off"
autocorrect="off"
autocapitalize="none"
v-model="defaultPassword.login">
<label for="login">Login</label>
<div class="inner-addon left-addon">
<i class="fa fa-user"></i>
<input id="login"
name="login"
type="text"
class="form-control"
placeholder="Login"
autocomplete="off"
autocorrect="off"
autocapitalize="none"
v-model="defaultPassword.login">
</div>
</div>
<options v-bind:password="defaultPassword" v-on:optionsUpdated="updatePassword"></options>
<div class="form-group">
<div class="alert alert-info" role="alert">
Default options are saved <strong>locally</strong></small>
<div class="alert alert-info" v-if="defaultPassword.version===2">
Default options are automatically saved <strong>locally</strong></small>
</div>
<div class="alert alert-danger" v-if="defaultPassword.version===1">
Version 1 is deprecated and will be removed in
<strong aria-label="April, 10 2017" class="hint--right">{{ getDayBeforeOnlyV2() }} days</strong>.
We strongly advise you to migrate your passwords to version 2.
</div>
</div>
</div>
@@ -38,7 +47,13 @@
methods: {
updatePassword(password){
this.$store.dispatch('saveDefaultPassword', {password});
}
},
getDayBeforeOnlyV2(){
const oneDay = 24 * 60 * 60 * 1000;
const now = new Date();
const onlyV2DefaultDate = new Date(2017, 4, 10);
return Math.round(Math.abs((now.getTime() - onlyV2DefaultDate.getTime()) / (oneDay)));
},
}
}
</script>

+ 0
- 4
src/views/PasswordGenerator.vue 查看文件

@@ -3,10 +3,6 @@
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;
}

#password-generator {
color: #555;
}

.inner-addon i {
position: absolute;
padding: 10px;


正在加载...
取消
保存