Skip to content

Commit 36e83ec

Browse files
yakuteroguzhaninanFaruk Oruçdependabot[bot]
authored
Refactor and update components (#52)
* Update version * Add auth expire check * Add linux build script and update installer scripts * auth and UI bug fix * update electron version for dynamically change top bar (#37) * Update: Electron version to 7.0.0 * Add: Operating system dark mode support * Update: Private notes size is enlarged * add menu item became singular * fix import function (#38) * Fix import bug after electron update to 7.0.0 * Fix openexternal link issue and add success callback to paddle upgrade * Refactor copy content functions * Add detail mixin and implement for all detail pages * Fix server detail page * update servers * Improve search function * pre-release * change company logo at detail and create * added Generate tooltip * Add custom title bar * Implement a global search on the title bar * added closeDevTools * Update login page style * fix height * Fix title-bar drag issue * added server field * Update login page * Fix quit issue * update version 1.0.2 * add nvm usage to README * Update electron and axios * updated electron version * fix top bar links * removed paddle script * add http cookie authentication * fix check update url * update version to 1.0.3 * Bump path-parse from 1.0.6 to 1.0.7 (#50) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump dns-packet from 1.3.1 to 1.3.4 (#49) Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4. - [Release notes](https://github.com/mafintosh/dns-packet/releases) - [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md) - [Commits](mafintosh/dns-packet@v1.3.1...v1.3.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump hosted-git-info from 2.8.8 to 2.8.9 (#48) Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](npm/hosted-git-info@v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * upgrade electron builder version for mac arm * update readme for build * add build information * add password check and refactor password buttons * add hover color to button components * refactor delete and edit buttons on detail pages * Refactor detail delete buttons * refactor textarea components * feature always on top * update version and readme Co-authored-by: Oguzhan INAN <oguzhan3488@gmail.com> Co-authored-by: Faruk Oruç <ooruc471@yandex.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 4bbf276 commit 36e83ec

File tree

27 files changed

+598
-502
lines changed

27 files changed

+598
-502
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ yarn build --mac --x64
5858
yarn build --mac --arm64
5959

6060
# Linux Debian Package
61-
yarn build --linux deb
61+
yarn build --linux --x64
6262

6363
# Windows x64
6464
yarn build --win --x64
65+
66+
# All Platforms
67+
yarn run build -wml --arm64 --x64
6568
```

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "passwall",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"author": "PassWall <hello@passwall.io>",
55
"description": "PassWall Desktop",
66
"license": "MIT",
@@ -20,8 +20,6 @@
2020
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test",
2121
"pack": "npm run pack:main && npm run pack:renderer",
2222
"pack:linux": "electron-packager . passwall --platform linux --arch x64 --out build",
23-
"installer:deb": "npx electron-installer-debian --src build/passwall-linux-x64 --arch amd64 --dest installers/ --icon build/icons/512x512.png",
24-
"installer:rpm": "npx electron-installer-redhat --src build/passwall-linux-x64 --arch amd64 --dest installers/ --icon build/icons/512x512.png",
2523
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
2624
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
2725
"test": "npm run unit",
@@ -58,8 +56,12 @@
5856
"win": {
5957
"icon": "build/icons/icon.ico"
6058
},
61-
"linux": {
62-
"icon": "build/icons/icon.png"
59+
"linux":{
60+
"icon": "build/icons/512x512.png",
61+
"target":[
62+
"deb"
63+
],
64+
"category":"Development"
6365
}
6466
},
6567
"dependencies": {
@@ -99,7 +101,7 @@
99101
"del": "^3.0.0",
100102
"devtron": "^1.4.0",
101103
"electron": "^11.4.1",
102-
"electron-builder": "22.10",
104+
"electron-builder": "^22.11.7",
103105
"electron-debug": "^1.5.0",
104106
"electron-devtools-installer": "^2.2.4",
105107
"electron-packager": "^15.0.0",

src/main/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ function createMenu() {
6565
label: 'Application',
6666
submenu: [
6767
{ label: 'About PassWall', selector: 'orderFrontStandardAboutPanel:' },
68+
{
69+
label: 'Always On Top',
70+
click: function() {
71+
mainWindow.setAlwaysOnTop(!mainWindow.isAlwaysOnTop())
72+
}
73+
},
6874
{ type: 'separator' },
6975
{
7076
label: 'Quit',

src/renderer/App.vue

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@
2121
</div>
2222
<!-- Right Section -->
2323
<div class="app-header-right-section" v-if="authenticated">
24+
<!-- Always On Top -->
25+
<button class="top-btn mr-3" :class="[isAlwaysOnTop ? 'active' : '']" @click="onAlwaysOnTop">
26+
<VIcon name="always-on-top" size="14px" v-tooltip="$t('AlwaysOnTop')" />
27+
</button>
2428
<!-- Import -->
25-
<button class="c-gray-300 mr-5" @click="onImport">
26-
{{ $t('Import') }}
27-
<VIcon name="download" size="14px" class="ml-2" />
29+
<button class="top-btn mr-3" @click="onImport">
30+
<VIcon name="download" size="14px" v-tooltip="$t('Import')" />
2831
</button>
2932
<!-- Export -->
30-
<button class="c-gray-300 mr-5" @click="onExport">
31-
{{ $t('Export') }}
32-
<VIcon name="upload" size="14px" class="ml-2" />
33+
<button class="top-btn mr-3" @click="onExport">
34+
<VIcon name="upload" size="14px" v-tooltip="$t('Export')" />
3335
</button>
3436
<!-- Logout -->
3537
<button class="c-danger mr-3" @click="onClickLogout">
3638
{{ $t('Logout') }}
37-
<VIcon name="logout" size="14px" rotation="180" class="ml-2" />
39+
<VIcon name="logout" size="14px" rotation="180" class="ml-2" v-tooltip="$t('Logout')" />
3840
</button>
3941
</div>
4042
</header>
@@ -54,6 +56,12 @@ import { mapActions, mapMutations, mapState } from 'vuex'
5456
import CryptoUtils from '@/utils/crypto'
5557
5658
export default {
59+
data() {
60+
return {
61+
isAlwaysOnTop: false,
62+
}
63+
},
64+
5765
computed: mapState(['authenticated', 'searchQuery']),
5866
5967
methods: {
@@ -77,6 +85,11 @@ export default {
7785
}
7886
},
7987
88+
onAlwaysOnTop() {
89+
this.isAlwaysOnTop = !this.isAlwaysOnTop
90+
remote.getCurrentWindow().setAlwaysOnTop(!remote.getCurrentWindow().isAlwaysOnTop())
91+
},
92+
8093
onClickLogout() {
8194
this.Logout()
8295
this.$router.replace({ name: 'Login' })
@@ -219,6 +232,14 @@ export default {
219232
}
220233
}
221234
235+
.top-btn {
236+
color: $color-gray-300;
237+
}
238+
239+
.top-btn:hover, .top-btn.active {
240+
color: $color-secondary;
241+
}
242+
222243
&-right-section {
223244
display: flex;
224245
margin-left: auto;
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<template>
2+
<button
3+
type="button"
4+
@click="checkPassword"
5+
class="password-check-btn ml-1"
6+
v-tooltip="$t('CheckIfExposed')"
7+
>
8+
<VIcon name="check" size="14px" />
9+
</button>
10+
</template>
11+
12+
<script>
13+
import Axios from 'axios'
14+
import CryptoUtils from '@/utils/crypto'
15+
16+
export default {
17+
name: 'CheckPassword',
18+
19+
props: {
20+
password: {
21+
type: String,
22+
default: ''
23+
}
24+
},
25+
26+
methods: {
27+
async checkPassword() {
28+
let text = ""
29+
if (this.password === "") {
30+
text = this.$t(`Please enter your password to check if password has been exposed.`)
31+
this.$notifyError(text)
32+
return
33+
}
34+
var hash = CryptoUtils.sha1(this.password)
35+
var first = hash.substring(0, 5)
36+
var last = hash.slice(hash.length - 5)
37+
var found = false
38+
var times = ""
39+
40+
try {
41+
const response = await Axios.get(`https://api.pwnedpasswords.com/range/${first}`)
42+
var returnedPasswords = response.data.split('\n')
43+
for (var i = 0; i < returnedPasswords.length; i++) {
44+
var row = returnedPasswords[i].split(':')
45+
if (row[0].slice(row[0].length - 5) === last) {
46+
found = true
47+
times = row[1]
48+
break
49+
}
50+
}
51+
52+
if (found) {
53+
text = this.$t(`Password has been exposed ${times} time(s) in data breaches. You should change it.`)
54+
this.$notifyWarn(text)
55+
} else {
56+
text = this.$t(`This password was not found in any known data breaches. It should be safe to use.`)
57+
this.$notifySuccess(text)
58+
}
59+
60+
} catch (err) {
61+
let text = this.$t('Ooops! Something went wrong!')
62+
this.$notifyError(text)
63+
// Handle Error Here
64+
console.error(err)
65+
}
66+
}
67+
}
68+
}
69+
</script>
70+
71+
<style lang="scss">
72+
.password-check-btn {
73+
display: flex;
74+
align-items: center;
75+
justify-content: center;
76+
width: 24px;
77+
height: 24px;
78+
border-radius: 4px;
79+
background-color: $color-gray-500;
80+
color: $color-gray-300;
81+
}
82+
83+
.password-check-btn:hover {
84+
color: $color-secondary;
85+
}
86+
87+
</style>

src/renderer/components/ClipboardButton.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<button type="button" class="clipboard-btn" v-clipboard:copy="copy" v-tooltip="$t('Copy')">
3-
<VIcon name="duplicate" size="13px" />
2+
<button type="button" class="clipboard-btn ml-1" v-clipboard:copy="copy" v-tooltip="$t('Copy')">
3+
<VIcon name="duplicate" size="14px" />
44
</button>
55
</template>
66

@@ -28,4 +28,8 @@ export default {
2828
background-color: $color-gray-500;
2929
color: $color-gray-300;
3030
}
31+
32+
.clipboard-btn:hover {
33+
color: $color-secondary;
34+
}
3135
</style>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<button
3+
class="delete-btn ml-1"
4+
v-tooltip="$t('Delete')"
5+
v-on:click="deleteItem"
6+
>
7+
<VIcon name="trash" size="14px" />
8+
</button>
9+
</template>
10+
11+
<script>
12+
export default {
13+
name: 'DeleteButton',
14+
methods: {
15+
deleteItem() {
16+
this.$emit('click')
17+
}
18+
}
19+
}
20+
</script>
21+
22+
<style lang="scss">
23+
.delete-btn {
24+
display: flex;
25+
align-items: center;
26+
justify-content: center;
27+
width: 24px;
28+
height: 24px;
29+
border-radius: 4px;
30+
background-color: $color-gray-500;
31+
color: $color-gray-300;
32+
}
33+
34+
.delete-btn:hover {
35+
color: $color-secondary;
36+
}
37+
</style>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<template>
2+
<button
3+
v-if="!isEditMode"
4+
class="edit-btn ml-1"
5+
v-tooltip="$t('Edit')"
6+
v-on="inputListeners"
7+
>
8+
<VIcon name="pencil" size="14px" />
9+
</button>
10+
</template>
11+
12+
<script>
13+
export default {
14+
name: 'EditButton',
15+
data() {
16+
return { isEditMode: false }
17+
},
18+
computed: {
19+
inputListeners() {
20+
return Object.assign({}, this.$listeners, {
21+
click: event => {
22+
this.isEditMode = !this.isEditMode
23+
return this.$emit('click', this.isEditMode)
24+
}
25+
})
26+
}
27+
}
28+
}
29+
</script>
30+
31+
<style lang="scss">
32+
.edit-btn {
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
36+
width: 24px;
37+
height: 24px;
38+
border-radius: 4px;
39+
background-color: $color-gray-500;
40+
color: $color-gray-300;
41+
}
42+
43+
.edit-btn:hover {
44+
color: $color-secondary;
45+
}
46+
</style>

src/renderer/components/GeneratePassword.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<button
44
type="button"
55
@click="onClickGenerate"
6-
class="btn-generate-pass"
6+
class="btn-generate-pass ml-1"
77
v-tooltip="$t('Generate')">
88
<VIcon name="refresh" size="14px" />
99
</button>
@@ -71,6 +71,10 @@ export default {
7171
color: $color-gray-300;
7272
}
7373
74+
.btn-generate-pass:hover {
75+
color: $color-secondary;
76+
}
77+
7478
.generate-password {
7579
text-align: center;
7680
border-radius: 4px;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<template>
2+
<button
3+
type="button"
4+
class="showpass-btn ml-1"
5+
v-tooltip="$t(isShow ? 'Hide' : 'Show')"
6+
v-on="inputListeners"
7+
>
8+
<VIcon class="c-pointer" :name="isShow ? 'eye-off' : 'eye'" size="14px" />
9+
</button>
10+
</template>
11+
12+
<script>
13+
export default {
14+
name: 'ShowPassButton',
15+
data() {
16+
return { isShow: false }
17+
},
18+
computed: {
19+
inputListeners() {
20+
return Object.assign({}, this.$listeners, {
21+
click: event => {
22+
this.isShow = !this.isShow
23+
return this.$emit('click', this.isShow)
24+
}
25+
})
26+
}
27+
}
28+
}
29+
</script>
30+
31+
<style lang="scss">
32+
.showpass-btn {
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
36+
width: 24px;
37+
height: 24px;
38+
border-radius: 4px;
39+
background-color: $color-gray-500;
40+
color: $color-gray-300;
41+
}
42+
43+
.showpass-btn:hover {
44+
color: $color-secondary;
45+
}
46+
</style>

0 commit comments

Comments
 (0)