Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-engines true
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,23 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@electron/remote": "^2.1.2",
"@iktakahiro/markdown-it-katex": "^3.1.0",
"@sentry/electron": "^1.2.0",
"ant-design-vue": "^1.3.5",
"axios": "^0.18.1",
"bluebird": "^3.5.3",
"ejs": "^2.6.1",
"axios": "^1.13.5",
"bluebird": "^3.7.2",
"ejs": "^3.1.10",
"electron-google-analytics": "^0.1.0",
"electron-updater": "^4.2.0",
"feed": "^2.0.4",
"electron-updater": "^6.8.3",
"feed": "^4.2.2",
"fs-extra": "^7.0.1",
"gray-matter": "^4.0.1",
"gray-matter": "^4.0.3",
"junk": "^3.1.0",
"less": "^3.9.0",
"lowdb": "^1.0.0",
"macaddress": "^0.2.9",
"markdown-it": "^13.0.1",
"markdown-it": "^14.1.0",
"markdown-it-abbr": "^1.0.4",
"markdown-it-emoji": "^2.0.2",
"markdown-it-footnote": "^3.0.3",
Expand All @@ -48,16 +49,16 @@
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-toc-and-anchor": "^4.2.0",
"moment": "^2.24.0",
"moment": "^2.30.1",
"monaco-markdown": "^0.0.6",
"node-ssh": "^6.0.0",
"node-ssh": "^13.2.1",
"normalize-path": "^3.0.0",
"prismjs": "^1.16.0",
"simple-git": "^1.107.0",
"prismjs": "^1.30.0",
"shortid": "^2.2.14",
"simple-git": "^3.27.0",
"slug": "^0.9.3",
"ssh2-sftp-client": "^4.2.4",
"striptags": "^3.1.1",
"striptags": "^3.2.0",
"transliteration": "^1.6.6",
"url-join": "^4.0.1",
"uuid": "^3.3.3",
Expand All @@ -81,7 +82,7 @@
"@types/fs-extra": "^5.0.5",
"@types/less": "^3.0.0",
"@types/lowdb": "^1.0.7",
"@types/markdown-it": "0.0.7",
"@types/markdown-it": "14.1.2",
"@types/marked": "^0.6.5",
"@types/normalize-path": "^3.0.0",
"@types/prismjs": "^1.16.0",
Expand All @@ -98,7 +99,7 @@
"@vue/eslint-config-typescript": "^4.0.0",
"babel-eslint": "^10.0.1",
"babel-plugin-prismjs": "^1.0.2",
"electron": "^7.2.4",
"electron": "^22.3.27",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.2.2",
"husky": "^1.3.1",
Expand All @@ -108,7 +109,7 @@
"postcss-import": "^12.0.1",
"tailwindcss": "^1.1.4",
"typescript": "^3.0.0",
"vue-cli-plugin-electron-builder": "2.0.0-beta.2",
"vue-cli-plugin-electron-builder": "2.1.1",
"vue-template-compiler": "^2.6.10"
},
"main": "background.js",
Expand Down
6 changes: 5 additions & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ import {
} from 'vue-cli-plugin-electron-builder/lib'
import { autoUpdater } from 'electron-updater'
import { init } from '@sentry/electron/dist/main'
import { initialize as initRemote, enable as enableRemote } from '@electron/remote/main'
import App from './server/app'
import messages from './assets/locales-menu'
import initServer from './server'

init({ dsn: 'https://6a6dacc57a6a4e27a88eb31596c152f8@sentry.io/1887150' })

initRemote()

const isDevelopment = process.env.NODE_ENV !== 'production'

// Keep a global reference of the window object, if you don't, the window will
Expand All @@ -32,7 +35,7 @@ function createWindow() {
webPreferences: {
webSecurity: false, // FIXED: Not allowed to load local resource
nodeIntegration: true,
enableRemoteModule: true, // FIXED: 兼容 electron@11.0.1
contextIsolation: false, // Required for @electron/remote and nodeIntegration; was default in Electron <12
},
// frame: false, // 去除默认窗口栏
titleBarStyle: 'hiddenInset' as ('hidden' | 'default' | 'hiddenInset' | 'customButtonsOnHover' | undefined),
Expand All @@ -43,6 +46,7 @@ function createWindow() {
}

win = new BrowserWindow(winOption)
enableRemote(win.webContents)
win.setTitle('Gridea')

if (process.env.WEBPACK_DEV_SERVER_URL) {
Expand Down
9 changes: 5 additions & 4 deletions src/components/AppSystem/includes/SourceFolderSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

<script lang="ts">
import {
ipcRenderer, IpcRendererEvent, remote,
ipcRenderer, IpcRendererEvent,
} from 'electron'
import { app as remoteApp, dialog as remoteDialog } from '@electron/remote'
import { Vue, Component } from 'vue-property-decorator'
import { State } from 'vuex-class'

Expand All @@ -42,16 +43,16 @@ export default class System extends Vue {
if (data) {
this.$message.success(this.$t('saved'))
this.$bus.$emit('site-reload')
remote.app.relaunch()
remote.app.quit()
remoteApp.relaunch()
remoteApp.quit()
} else {
this.$message.error(this.$t('saveError'))
}
})
}

async handleFolderSelect() {
const res = await remote.dialog.showOpenDialog({
const res = await remoteDialog.showOpenDialog({
properties: ['openDirectory', 'createDirectory'],
})
if (res.filePaths.length > 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '@/assets/styles/main.less'
import VueI18n from 'vue-i18n'
import Prism from 'prismjs'
import VueShortkey from 'vue-shortkey'
import { remote } from 'electron'
import { app as remoteApp } from '@electron/remote'
import * as Sentry from '@sentry/electron'
import locale from './assets/locales'
import App from './App.vue'
Expand All @@ -26,7 +26,7 @@ const defaultLocale = ({
'zh-CN': 'zhHans',
'zh-TW': 'zh_TW',
'en-US': 'en',
} as any)[remote.app.getLocale() || 'zh-CN']
} as any)[remoteApp.getLocale() || 'zh-CN']

Vue.use(VueI18n)
const i18n = new VueI18n({
Expand Down
2 changes: 1 addition & 1 deletion src/server/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import simpleGit, { SimpleGit } from 'simple-git/promise'
import simpleGit, { SimpleGit } from 'simple-git'
import fs from 'fs'
import moment from 'moment'
// @ts-ignore
Expand Down
4 changes: 2 additions & 2 deletions src/server/plugins/deploys/sftp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fse from 'fs-extra'
// import * as fs from 'fs'
import path from 'path'
import SftpClient from 'ssh2-sftp-client'
import NodeSsh from 'node-ssh'
import { NodeSSH } from 'node-ssh'
import normalizePath from 'normalize-path'
import Model from '../../model'

Expand Down Expand Up @@ -91,7 +91,7 @@ export default class SftpDeploy extends Model {
message: '',
}

const client = new NodeSsh()
const client = new NodeSSH()

const { setting } = this.db

Expand Down
Loading