Skip to content

Commit 46c0c2e

Browse files
yakuteroguzhaninanFaruk Oruç
authored
Teacher's Day Release (#39)
* 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 Co-authored-by: Oguzhan INAN <oguzhan3488@gmail.com> Co-authored-by: Faruk Oruç <ooruc471@yandex.com>
1 parent 2aa15da commit 46c0c2e

File tree

34 files changed

+319
-494
lines changed

34 files changed

+319
-494
lines changed

build/icons/icon.png

11 KB
Loading

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "passwall",
3-
"version": "v1.0.0",
3+
"version": "1.0.1",
44
"author": "PassWall <hello@passwall.io>",
55
"description": "PassWall Desktop",
66
"license": "MIT",
@@ -11,17 +11,16 @@
1111
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
1212
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
1313
"build:darwin": "cross-env BUILD_TARGET=darwin node .electron-vue/build.js",
14-
"build:linux": "cross-env BUILD_TARGET=linux node .electron-vue/build.js",
14+
"build:linux": "electron-packager . --overwrite --asar --platform=linux --arch=x64 --icon=build/icons/512x512.png --prune=true --out=build --version-string.CompanyName=PassWall --version-string.FileDescription=PassWall",
1515
"build:mas": "cross-env BUILD_TARGET=mas node .electron-vue/build.js",
16-
"build:win3": "cross-env BUILD_TARGET=win32 node .electron-vue/build.js",
17-
"build:win32": "electron-packager . --overwrite --asar --platform=win32 --arch=ia32 --icon=build/icons/icon.ico --prune=true --out=build --version-string.CompanyName=PassWall --version-string.FileDescription=PassWall",
16+
"build:win32": "electron-packager . --overwrite --asar --platform=win32 --arch=x64 --icon=build/icons/icon.ico --prune=true --out=build --version-string.CompanyName=PassWall --version-string.FileDescription=PassWall",
1817
"dev": "node .electron-vue/dev-runner.js",
1918
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test",
2019
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test",
2120
"pack": "npm run pack:main && npm run pack:renderer",
2221
"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/256x256.png",
24-
"installer:rpm": "npx electron-installer-redhat --src build/passwall-linux-x64 --arch amd64 --dest installers/ --icon build/icons/256x256.png",
22+
"installer:deb": "npx electron-installer-debian --src build/passwall-linux-x64 --arch amd64 --dest installers/ --icon build/icons/512x512.png",
23+
"installer:rpm": "npx electron-installer-redhat --src build/passwall-linux-x64 --arch amd64 --dest installers/ --icon build/icons/512x512.png",
2524
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
2625
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
2726
"test": "npm run unit",
@@ -59,7 +58,7 @@
5958
"icon": "build/icons/icon.ico"
6059
},
6160
"linux": {
62-
"icon": "build/icons"
61+
"icon": "build/icons/icon.png"
6362
}
6463
},
6564
"dependencies": {
@@ -99,7 +98,7 @@
9998
"css-loader": "^0.28.11",
10099
"del": "^3.0.0",
101100
"devtron": "^1.4.0",
102-
"electron": "6.0.12",
101+
"electron": "^7.0.0",
103102
"electron-builder": "21.2.0",
104103
"electron-debug": "^1.5.0",
105104
"electron-devtools-installer": "^2.2.4",

src/renderer/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default {
4141
}
4242
4343
const filePath = dialog.showSaveDialogSync(null)
44+
4445
if (!filePath) {
4546
return
4647
}
@@ -63,13 +64,12 @@ export default {
6364
return
6465
}
6566
66-
dialog.showOpenDialog({ properties: ['openFile'] }, async files => {
67-
if (files.length === 0) {
67+
const t = dialog.showOpenDialog({ properties: ['openFile'] }).then(async ({ filePaths }) => {
68+
if (filePaths.length === 0) {
6869
return
6970
}
70-
7171
try {
72-
const fileContent = fs.readFileSync(files[0]).toString()
72+
const fileContent = fs.readFileSync(filePaths[0]).toString()
7373
7474
let parsedCSV = Papa.parse(fileContent.trim(), {
7575
header: true // creates array of { head: value }

src/renderer/api/HTTPClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Axios from 'axios'
22

3-
let baseURL = 'https://vault.passwall.io'
3+
let baseURL = 'http://localhost:3625'
44
if (process.env.NODE_ENV === 'production') {
55
baseURL = 'https://vault.passwall.io'
66
}

src/renderer/components/AddItemMenu.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
:class="{ '--lock': !hasProPlan }"
1616
>
1717
<VIcon name="credit-card" size="14px" class="icon" />
18-
{{ $t('Credit Cards') }}
18+
{{ $t('Credit Card') }}
1919
<!-- Premium -->
2020
<div class="premium-icon"><VIcon name="star" size="11px" class="c-secondary" /></div>
2121
</button>
@@ -27,7 +27,7 @@
2727
:class="{ '--lock': !hasProPlan }"
2828
>
2929
<VIcon name="bank-account" size="14px" class="icon" />
30-
{{ $t('Bank Accounts') }}
30+
{{ $t('Bank Account') }}
3131
<!-- Premium -->
3232
<div class="premium-icon"><VIcon name="star" size="11px" class="c-secondary" /></div>
3333
</button>
@@ -39,7 +39,7 @@
3939
:class="{ '--lock': !hasProPlan }"
4040
>
4141
<VIcon name="email" size="14px" class="icon" />
42-
{{ $t('Emails') }}
42+
{{ $t('Email') }}
4343
<!-- Premium -->
4444
<div class="premium-icon"><VIcon name="star" size="11px" class="c-secondary" /></div>
4545
</button>
@@ -51,7 +51,7 @@
5151
:class="{ '--lock': !hasProPlan }"
5252
>
5353
<VIcon name="private-note" size="14px" class="icon" />
54-
{{ $t('Private Notes') }}
54+
{{ $t('Private Note') }}
5555
<!-- Premium -->
5656
<div class="premium-icon"><VIcon name="star" size="11px" class="c-secondary" /></div>
5757
</button>
@@ -63,7 +63,7 @@
6363
:class="{ '--lock': !hasProPlan }"
6464
>
6565
<VIcon name="server" size="14px" class="icon" />
66-
{{ $t('Servers') }}
66+
{{ $t('Server') }}
6767
<!-- Premium -->
6868
<div class="premium-icon"><VIcon name="star" size="11px" class="c-secondary" /></div>
6969
</button>

src/renderer/components/VTextArea.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export default {
2020
props: {
2121
name: String,
2222
value: String,
23-
sensitive: Boolean
23+
sensitive: Boolean,
2424
},
25-
25+
2626
computed: {
2727
getError() {
2828
const error = this.errors.items.find(e => e.field == this.name)

src/renderer/config.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Vue from 'vue'
22
import i18n from '@/i18n'
3+
import store from '@/store'
4+
import router from '@/router'
35

46
import * as Waiters from '@/utils/waiters'
57
Vue.prototype.$waiters = Waiters
@@ -51,14 +53,17 @@ Vue.prototype.$request = async (callback, waitKey, errorCallback = null) => {
5153
console.log(error)
5254

5355
if (error.response) {
56+
if (error.response.status === 401 && !router.app._route.meta.auth) {
57+
store.dispatch('Logout')
58+
return router.push({ name: 'Login' })
59+
}
60+
5461
if (errorCallback) {
5562
errorCallback(error)
56-
} else {
57-
if (error.response.status >= 500) {
58-
Vue.prototype.$notifyError(i18n.t('API500ErrorMessage'))
59-
} else if (error.response.data.Message && error.response.status != 401) {
60-
Vue.prototype.$notifyError(error.response.data.Message)
61-
}
63+
} else if (error.response.status >= 500) {
64+
Vue.prototype.$notifyError(i18n.t('API500ErrorMessage'))
65+
} else if (error.response.data.Message && error.response.status != 401) {
66+
Vue.prototype.$notifyError(error.response.data.Message)
6267
}
6368
} else {
6469
Vue.prototype.$notifyError('Network Error !')

src/renderer/mixins/detail.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default {
2+
data() {
3+
return {
4+
form: {}
5+
}
6+
},
7+
8+
beforeRouteUpdate(to, from, next) {
9+
this.form = to.params.detail
10+
next()
11+
},
12+
13+
beforeRouteEnter(to, from, next) {
14+
next(vm => {
15+
vm.form = to.params.detail
16+
})
17+
}
18+
}

src/renderer/mixins/list.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export default {
88
},
99

1010
beforeRouteUpdate(to, from, next) {
11-
if (to.params.refresh) {
11+
if (to.params.openFirst) {
12+
this.openFirstItem()
13+
} else if (to.params.refresh) {
1214
this.fetchAll()
1315
}
1416
next()
@@ -21,25 +23,29 @@ export default {
2123
methods: {
2224
async fetchAll() {
2325
try {
24-
await this.FetchAll()
25-
26-
if (this.ItemList.length > 0) {
27-
this.onClickItem(this.ItemList[0].id)
28-
}
26+
await this.$request(this.FetchAll)
27+
this.openFirstItem()
2928
} catch (error) {
3029
console.log(error)
3130
}
31+
},
32+
33+
openFirstItem() {
34+
if (this.ItemList.length > 0) {
35+
this.onClickItem(this.ItemList[0])
36+
}
3237
}
3338
},
3439

35-
3640
computed: {
3741
filteredList() {
38-
// return this.ItemList.filter(i =>
39-
// i.title.toLowerCase().includes(this.searchQuery.toLowerCase())
40-
// )
4142
return this.ItemList.filter(item =>
42-
Object.values(item).some(value => (value ? value.toString() : '').includes(this.searchQuery.toLowerCase()))
43+
Object.values(item).some(value =>
44+
(value || '')
45+
.toString()
46+
.toLowerCase()
47+
.includes(this.searchQuery.toLowerCase())
48+
)
4349
)
4450
}
4551
}

src/renderer/mixins/logo.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
export default {
22
data() {
33
return {
4-
logoIsAvailable: true,
4+
logoIsAvailable: true
55
}
66
},
7+
78
methods: {
89
getLogo(url) {
910
return `http://logo.clearbit.com/${this.domainFromURL(url)}`
1011
},
12+
1113
domainFromURL(url) {
1214
if (url) {
1315
// Regex is from: https://stackoverflow.com/a/33651369/10991790
1416
const matches = url.match(/^(?:https?:)?(?:\/\/)?([^\/\?]+)/i)
1517
return matches && matches[1]
1618
}
17-
return "N"
19+
return 'N'
1820
},
19-
companyLetter: function(url) {
21+
22+
companyLetter(url) {
2023
return this.domainFromURL(url)[0].toUpperCase()
2124
}
2225
},
2326

2427
watch: {
25-
url: function(val) {
28+
url() {
2629
this.logoIsAvailable = true
2730
}
2831
}

0 commit comments

Comments
 (0)