diff --git a/docker/php/php.conf b/docker/php/php.conf index b72399d4..74f52c2d 100644 --- a/docker/php/php.conf +++ b/docker/php/php.conf @@ -2,10 +2,10 @@ directory=/var/www # 生产环境 -#command=php bin/laravels start -i +command=php bin/laravels start -i # 开发环境 -command=./bin/inotify ./app +#command=./bin/inotify ./app numprocs=1 autostart=true diff --git a/nativefier.js b/nativefier.js index ff535bda..cf1c4c62 100644 --- a/nativefier.js +++ b/nativefier.js @@ -1,25 +1,61 @@ const nativefier = require('nativefier').default; +const inquirer = require('inquirer'); const config = require('./package.json'); const options = { name: config.name, - version: config.version, - targetUrl: 'http://127.0.0.1:2222', - arch: 'arm64', + appVersion: config.version, + buildVersion: config.version, out: './build', icon: './resources/assets/statics/public/images/logo-app.png', + bounce: false, + counter: true, clearCache: false, - disableDevTools: false, - disableContextMenu: false, + disableDevTools: true, + disableContextMenu: true, fileDownloadOptions: { saveAs: true, }, }; -nativefier(options, function (error, appPath) { - if (error) { - console.error(error); - } else { - console.log('App has been nativefied to', appPath); +const questions = [ + { + type: 'input', + name: 'targetUrl', + message: "请输入网站地址", + validate: function (value) { + return value !== '' + } + }, { + type: 'list', + name: 'platform', + message: "选择操作系统平台", + choices: [{ + name: "MacOS Intel", + value: { + platform: 'mac', + arch: 'x64', + } + }, { + name: "MacOS Arm64", + value: { + platform: 'mac', + arch: 'arm64', + } + }, { + name: "Window x86_64", + value: { + platform: 'windows', + arch: 'x64', + } + }] } +]; + +inquirer.prompt(questions).then(answers => { + nativefier(Object.assign(options, answers.platform, { + targetUrl: answers.targetUrl + }), (error) => { + error && console.error(error) + }); }); diff --git a/package.json b/package.json index 1e3ac279..c5da8f5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "DooTask", - "version": "0.0.2", + "version": "0.2.12", "description": "DooTask is task management system", "scripts": { "dev": "npm run development", @@ -16,6 +16,7 @@ "cross-env": "^7.0.2", "css-loader": "^5.2.6", "file-loader": "^6.2.0", + "inquirer": "^8.1.1", "internal-ip": "^6.2.0", "jquery": "^3.5.1", "laravel-mix": "^6.0.6", diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index 5a25bf7b..52193dc4 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -71,7 +71,7 @@ Vue.prototype.goForward = function(location, isReplace) { if (typeof location === 'string') location = {name: location}; if (isReplace === true) { app.$router.replace(location).then(() => {}); - }else{ + } else { app.$router.push(location).then(() => {}); } }; diff --git a/resources/assets/js/components/PageTitle.vue b/resources/assets/js/components/PageTitle.vue index 9a2694ea..a690b185 100755 --- a/resources/assets/js/components/PageTitle.vue +++ b/resources/assets/js/components/PageTitle.vue @@ -1,70 +1,69 @@ diff --git a/resources/assets/js/pages/login.vue b/resources/assets/js/pages/login.vue index 1888524e..c2740d98 100644 --- a/resources/assets/js/pages/login.vue +++ b/resources/assets/js/pages/login.vue @@ -1,6 +1,6 @@