Browse Source

Important fixes and design changes.

tags/v1.4.4
Ivan Bravo Bravo 8 months ago
parent
commit
2ed11fb5c9
48 changed files with 1171 additions and 957 deletions
  1. 10
    65
      .github/workflows/ci.yml
  2. 0
    4
      .gitmodules
  3. 1
    1
      src/.env
  4. 3
    3
      src/assets/css/components/_box.scss
  5. 7
    7
      src/assets/css/components/_button.scss
  6. 1
    1
      src/assets/css/components/_notification.scss
  7. 1
    1
      src/assets/css/fonts.scss
  8. 1
    1
      src/assets/css/oldv.scss
  9. 0
    1
      src/cli
  10. 3
    3
      src/components/Layout/Navigation.vue
  11. 2
    2
      src/components/Nudity/Job.vue
  12. 1
    1
      src/components/Nudity/Upload.vue
  13. 5
    5
      src/components/Settings/SettingsPreferences.vue
  14. 4
    4
      src/components/UI/AppTitle.vue
  15. 8
    8
      src/components/UI/AppUpdate.vue
  16. 6
    2
      src/electron/index.js
  17. 2
    2
      src/electron/modules/rollbar.js
  18. 12
    22
      src/electron/modules/settings.js
  19. 29
    25
      src/electron/tools/fs.js
  20. 3
    22
      src/electron/tools/paths.js
  21. 1
    1
      src/electron/tools/shell.js
  22. 1
    1
      src/modules/models/photo.js
  23. 67
    40
      src/modules/update/base.js
  24. 7
    46
      src/modules/update/checkpoints.js
  25. 159
    0
      src/modules/update/dreampower.js
  26. 1
    8
      src/modules/update/dreamtime.js
  27. 5
    1
      src/modules/updater.js
  28. 12
    37
      src/nuxt.config.js
  29. 194
    0
      src/package - Copy.json
  30. 75
    94
      src/package.json
  31. 1
    1
      src/pages/index.vue
  32. 318
    0
      src/pages/nudity/crop.vue
  33. 133
    119
      src/pages/system/about.vue
  34. 1
    1
      src/pages/system/settings/folders.vue
  35. 2
    2
      src/pages/system/settings/notifications.vue
  36. 3
    3
      src/pages/system/settings/processing.vue
  37. 0
    100
      src/patches/unzipper+0.10.2.patch
  38. 1
    4
      src/plugins/boot.client.js
  39. 0
    87
      src/scripts/build.py
  40. 0
    48
      src/scripts/dev-start.py
  41. 18
    75
      src/scripts/release.js
  42. 0
    73
      src/scripts/setup.py
  43. BIN
      src/static/app.icns
  44. BIN
      src/static/app.ico
  45. BIN
      src/static/favicon.icns
  46. BIN
      src/static/favicon.ico
  47. BIN
      src/static/favicon.png
  48. 73
    36
      src/tailwind.config.js

+ 10
- 65
.github/workflows/ci.yml View File

@@ -3,7 +3,6 @@ name: CI/CD
on:
push:
branches:
- master
- canary
tags:
- v*
@@ -20,7 +19,7 @@ on:

jobs:
build:
name: Build (${{ matrix.os-short }}-${{ matrix.device }})
name: Build (${{ matrix.os-short }}
runs-on: ${{ matrix.os }}

# Strategy
@@ -33,41 +32,17 @@ jobs:
- ubuntu-latest
- windows-latest
- macOS-latest
device:
- any
- cpuonly

include:
- os: ubuntu-latest # Ubuntu
os-short: ubuntu
os-ext: deb
python: python3
- os: ubuntu-latest # Ubuntu & GPU
device: any
torch-version: https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-linux_x86_64.whl
- os: ubuntu-latest # Ubuntu & CPU
device: cpuonly
torch-version: https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-linux_x86_64.whl
os-extension: deb
- os: windows-latest # Windows
os-short: windows
os-ext: exe
python: python
pyinstaller-args: --add-binary "./third/msvcp/msvcp140.dll;."
- os: windows-latest # Windows & GPU
device: any
torch-version: https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl
- os: windows-latest # Windows & CPU
device: cpuonly
torch-version: https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl
os-extension: exe
- os: macOS-latest # macOS
os-short: macos
os-ext: dmg
python: python3
torch-version: torch

exclude:
- os: macOS-latest
device: any
os-extension: dmg

steps:
- name: Dump GitHub context
@@ -87,13 +62,6 @@ jobs:
with:
submodules: true

- name: Use Python 3.7
uses: actions/setup-python@v1
if: runner.os != 'macOS'
with:
python-version: 3.7
architecture: x64

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
@@ -106,47 +74,24 @@ jobs:
if: runner.os == 'macOS'
run: brew install p7zip

- name: Setup - DreamPower
working-directory: src/cli
run: |
${{ matrix.python }} -m pip install pyinstaller
${{ matrix.python }} -m pip install numpy==1.16.4
${{ matrix.python }} -m pip install pillow==6.1.0
${{ matrix.python }} -m pip install opencv-python==4.1.0.25
${{ matrix.python }} -m pip install rsa==4.0
${{ matrix.python }} -m pip install imageio==2.5.0
${{ matrix.python }} -m pip install python-dotenv==0.10.3
${{ matrix.python }} -m pip install rook==0.1.73
${{ matrix.python }} -m pip install sentry-sdk==0.10.2
${{ matrix.python }} -m pip --no-cache-dir install ${{ matrix.torch-version }}
${{ matrix.python }} -m pip --no-cache-dir install torchvision==0.2.2.post3

- name: Setup - DreamTime
- name: Setup
working-directory: src
run: yarn install

- name: Build - DreamPower
working-directory: src/cli
run: |
${{ matrix.python }} -m PyInstaller main.py -y --onedir --name "dreampower" --distpath "../../dist" ${{ matrix.pyinstaller-args }}

- name: Lint - DreamTime
- name: Lint
working-directory: src
run: yarn lint

- name: Build - DreamTime
- name: Build
working-directory: src
env:
BUILD_DEVICE: ${{ matrix.device }}
run: yarn build

- name: Deploy
- name: Release
working-directory: src/scripts
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
BUILD_DEVICE: ${{ matrix.device }}
BUILD_OS: ${{ matrix.os-short }}
BUILD_OS_EXTENSION: ${{ matrix.os-extension }}
run: node release.js

+ 0
- 4
.gitmodules View File

@@ -1,4 +0,0 @@
[submodule "src/cli"]
path = src/cli
url = https://github.com/private-dreamnet/dreampower.git
branch = master

+ 1
- 1
src/.env View File

@@ -1,6 +1,6 @@
APP_NAME = DreamTime
APP_STATUS = stable
APP_VERSION = 1.1.0
APP_VERSION = 1.1.1

SERVER_PORT = 3000
SERVER_HOST = localhost

+ 3
- 3
src/assets/css/components/_box.scss View File

@@ -10,7 +10,7 @@
*/

.box {
@apply bg-dark rounded px-5 py-3 shadow mb-5;
@apply bg-dark-500 rounded px-5 py-3 shadow mb-5;

&.is-transparent {
@apply bg-transparent rounded-none shadow-none;
@@ -58,8 +58,8 @@
}

.item-extra {
@apply flex items-center justify-center;
min-width: 200px;
@apply ml-4 flex items-center justify-center;
max-width: 200px;
}
}
}

+ 7
- 7
src/assets/css/components/_button.scss View File

@@ -14,11 +14,11 @@
outline: none !important;

&:hover {
@apply bg-primary-10;
@apply bg-primary-500-10;
}

&:active {
@apply bg-primary-20;
@apply bg-primary-500-20;
}

&.is-active,
@@ -34,11 +34,11 @@
@apply text-danger;

&:hover {
@apply bg-danger-10;
@apply bg-danger-500-10;
}

&:active {
@apply bg-danger-20;
@apply bg-danger-500-20;
}
}

@@ -46,16 +46,16 @@
@apply text-success;

&:hover {
@apply bg-success-10;
@apply bg-success-500-10;
}

&:active {
@apply bg-success-20;
@apply bg-success-500-20;
}
}

&.is-sm {
@apply px-3 text-sm;
@apply px-2 text-sm;
height: 30px;
}


+ 1
- 1
src/assets/css/components/_notification.scss View File

@@ -10,7 +10,7 @@
}

&.is-danger {
@apply bg-danger-25 border-danger-20;
@apply bg-danger-500-20 border-danger-500;
}

&.is-transparent {

+ 1
- 1
src/assets/css/fonts.scss View File

@@ -1 +1 @@
@import url('https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800,900');
@import url('https://fonts.googleapis.com/css?family=Catamaran:300,400,500,600,700&display=swap');

src/assets/css/vendor.scss → src/assets/css/oldv.scss View File

@@ -2,4 +2,4 @@
@import 'tippy.js/index.css';
@import 'tippy.js/themes/light.css';

@import 'cropperjs/dist/cropper.css';
@import '~cropperjs/src/css/cropper';

+ 0
- 1
src/cli

@@ -1 +0,0 @@
Subproject commit 58571bd4ef26ebfbcd9ecb51f6cdc7fad319cb48

+ 3
- 3
src/components/Layout/Navigation.vue View File

@@ -1,6 +1,6 @@
<template>
<div class="layout-navbar">
<div class="navbar" :class="{ 'is-active': isActive }">
<div :class="{ 'is-active': isActive }" class="navbar">
<!-- Welcome! -->
<div class="navbar-header">
<h1 class="header-title">
@@ -110,7 +110,7 @@ export default {
}

.layout-navbar {
@apply pb-6 shadow h-screen bg-dark relative;
@apply pb-6 shadow h-screen bg-dark-500 relative;
width: 200px;

.navbar {
@@ -129,7 +129,7 @@ export default {
.navbar-header {
@apply mb-5 text-gray-300 flex flex-col items-center justify-center;
animation: 20s ease-in-out infinite bgAnim;
height: 90px;
height: 70px;

background: rgb(99, 66, 245);


+ 2
- 2
src/components/Nudity/Job.vue View File

@@ -145,7 +145,7 @@ export default {
.__preview {
@apply flex justify-center items-center
rounded rounded-tr-none rounded-br-none
border-2 border-dark border-r-0
border-2 border-dark-500 border-r-0
text-3xl;
width: 125px;
height: 125px;
@@ -163,7 +163,7 @@ export default {

.__content {
@apply flex-1 flex flex-col
bg-dark
bg-dark-500
rounded
rounded-tl-none
rounded-bl-none

+ 1
- 1
src/components/Nudity/Upload.vue View File

@@ -2,8 +2,8 @@
<div class="c-nudity-upload">
<!-- Dropzone -->
<div
class="upload-dropzone"
:class="{'is-dragging': isDraggingFile}"
class="upload-dropzone"
@dragenter="onDragEnter"
@dragover="onDragOver"
@dragleave="onDragLeave"

+ 5
- 5
src/components/Settings/SettingsPreferences.vue View File

@@ -28,7 +28,7 @@
</section>

<section class="box box-section">
<box-section-item label="Boob Size" :description="`Current value: ${currentValue.boobs.size}`">
<box-section-item :description="`Current value: ${currentValue.boobs.size}`" label="Boob Size">
<div class="slider-container">
<input
v-model="currentValue.boobs.size"
@@ -64,7 +64,7 @@
</section>

<section class="box box-section">
<box-section-item label="Areola Size" :description="`Current value: ${currentValue.areola.size}`">
<box-section-item :description="`Current value: ${currentValue.areola.size}`" label="Areola Size">
<div class="slider-container">
<input
v-model="currentValue.areola.size"
@@ -100,7 +100,7 @@
</section>

<section class="box box-section">
<box-section-item label="Nipple Size" :description="`Current value: ${currentValue.nipple.size}`">
<box-section-item :description="`Current value: ${currentValue.nipple.size}`" label="Nipple Size">
<div class="slider-container">
<input
v-model="currentValue.nipple.size"
@@ -136,7 +136,7 @@
</section>

<section class="box box-section">
<box-section-item label="Vagina Size" :description="`Current value: ${currentValue.vagina.size}`">
<box-section-item :description="`Current value: ${currentValue.vagina.size}`" label="Vagina Size">
<div class="slider-container">
<input
v-model="currentValue.vagina.size"
@@ -172,7 +172,7 @@
</section>

<section class="box box-section">
<box-section-item label="Pubic Hair" :description="`Current value: ${currentValue.pubicHair.size}`">
<box-section-item :description="`Current value: ${currentValue.pubicHair.size}`" label="Pubic Hair">
<div class="slider-container">
<input
v-model="currentValue.pubicHair.size"

+ 4
- 4
src/components/UI/AppTitle.vue View File

@@ -6,11 +6,11 @@

<style lang="scss">
.app-title {
@apply px-4 py-2 bg-dark shadow flex flex-col justify-center;
height: 90px;
@apply px-4 py-2 bg-dark-500 shadow flex flex-col justify-center;
height: 70px;

.title {
@apply font-bold text-white text-xl;
@apply font-bold text-white text-lg;

sup {
@apply text-white;
@@ -18,7 +18,7 @@
}

.subtitle {
@apply text-lg text-generic-300;
@apply text-generic-300;
}

a {

+ 8
- 8
src/components/UI/AppUpdate.vue View File

@@ -8,29 +8,29 @@
<!-- Updated! -->
<box-section-item
v-else-if="!updater.available"
:label="`${projectTitle} it's updated!`"
:description="`v${updater.getCurrentVersion()}`"
:label="`${projectTitle} is up to date.`"
:description="updater.getCurrentVersion()"
icon="๐ŸŒ" />

<!-- Update available -->
<box-section-item
v-else-if="!updater.updating.active"
:label="`Update available: ${updater.latest.tag_name}`"
description="Click 'Update' to start the automatic update!"
:label="`${projectTitle} ${updater.latest.tag_name} available.`"
icon="๐ŸŒ"
class="update-item">
<button type="button" class="button is-sm" @click.prevent="updater.download()">Update</button>
<app-external-link v-tooltip="'Download and install the update manually.'" :href="downloadURL" class="button is-sm">Download</app-external-link>
<button v-tooltip="'Open download folder, if you have already downloaded the update you can find it here.'" type="button" class="button is-sm" @click.prevent="openDownload">Folder</button>
<button v-tooltip="'Download and install the update automatically.'" type="button" class="button is-sm" @click.prevent="updater.download()">Update</button>
<app-external-link v-tooltip="'Download the update manually.'" :href="downloadURL" class="button is-sm">Manual</app-external-link>
</box-section-item>

<!-- Updating... -->
<!-- eslint-disable-next-line vue/valid-template-root --->
<box-section-item
v-else
:label="updater.updating.text"
icon="๐ŸŒ">
<template slot="description">
<p class="item-description"><strong>{{ updater.updating.progress | progress }}</strong> - {{ updater.updating.mbWritten | size }}/{{ updater.updating.mbTotal | size }} MB - (Please do not close the program or leave this section)</p>
<p v-if="updater.updating.text === 'Downloading...'" class="item-description"><strong>{{ updater.updating.progress | progress }}</strong> - {{ updater.updating.mbWritten | size }}/{{ updater.updating.mbTotal | size }} MB.</p>
<p v-else class="item-description">Wait a few minutes, please do not close the program.</p>
</template>

<button type="button" class="button is-danger is-sm" @click.prevent="updater.cancel()">Cancel</button>

+ 6
- 2
src/electron/index.js View File

@@ -43,10 +43,8 @@ console.log('Starting...')
console.log({
env: process.env.NODE_ENV,
paths: {
getRootPath: utils.getRootPath(),
appPath: app.getAppPath(),
exePath: app.getPath('exe'),
rootPath: paths.getRoot()
},
isStatic: utils.pack.isStatic()
})
@@ -101,6 +99,7 @@ class DreamApp {
height: 700,
minWidth: 1200,
minHeight: 700,
icon: path.join(config.rootDir, 'dist', 'app.ico'),
webPreferences: {
// Script that offers secure communication to the NodeJS API
preload: path.join(app.getAppPath(), 'electron', 'preload.js')
@@ -125,6 +124,11 @@ class DreamApp {
} else {
// Production, load the static interface!
this.window.loadFile(this.loadURL)

if (process.env.DEVTOOLS) {
// Load the DevTools
this.window.webContents.openDevTools()
}
}
}


+ 2
- 2
src/electron/modules/rollbar.js View File

@@ -1,5 +1,5 @@
const _ = require('lodash')
const { Rollbar } = require('electron-utils')
const { Rollbar } = require('rollbar')
const debug = require('debug').default('app:electron:modules:rollbar')

const settings = require('./settings')
@@ -89,6 +89,6 @@ module.exports = new Proxy(instance, {
}
}

return () => {}
return () => { }
}
})

+ 12
- 22
src/electron/modules/settings.js View File

@@ -1,6 +1,7 @@
const fs = require('fs')
const _ = require('lodash')
const { uuid, api, is } = require('electron-utils')
const uuid = require('uuid')
const { api, is } = require('electron-utils')
const debug = require('debug').default('app:electron:modules:settings')

const tools = require('../tools')
@@ -22,7 +23,7 @@ const settings = {
async init() {
await this._initDefault()

this._path = tools.paths.getRoot('settings.json')
this._path = tools.paths.get('userData', 'settings.json')
this._settings = {}

await this._ensure()
@@ -41,7 +42,7 @@ const settings = {
try {
hasGPU = (await tools.getGpusList()).length > 0
// eslint-disable-next-line
} catch (err) {}
} catch (err) { }

this._default = {
version: 2,
@@ -100,7 +101,7 @@ const settings = {
cropped: tools.paths.get('temp'),
models: tools.paths.get('userData', 'models'),
masks: tools.paths.get('userData', 'masks'),
cli: tools.paths.getRoot('cli')
cli: tools.paths.get('userData', 'dreampower')
},

telemetry: {
@@ -121,23 +122,12 @@ const settings = {
try {
fs.writeFileSync(this._path, JSON.stringify(this._default, null, 2))
} catch (err) {
if (is.windows) {
api.dialog.showErrorBox(
'The program could not be started',
`An error occurred while trying to save the settings, please make sure the program has the necessary permissions to write to:\n${this._path}`
)

api.app.exit()
} else {
api.dialog.showErrorBox(
'The program could not be started',
`An error occurred while trying to save the settings, please make sure the program has the necessary permissions to write to:\n${
this._path
}.\nDue to the way Ubuntu installs the program you need to grant 777 permissions to the following folder:\n${tools.paths.getRoot()}`
)

api.app.exit()
}
api.dialog.showErrorBox(
'The program could not be started',
`An error occurred while trying to save the settings, please make sure the program has the necessary permissions to write to:\n${this._path}`
)

api.app.exit()
}
},

@@ -212,7 +202,7 @@ const settings = {
*/
async load() {
this._settings = JSON.parse(fs.readFileSync(this._path))
debug('User Settings loaded!', this._settings)
debug('User Settings loaded!', { path: this._path, settings: this._settings })
},

/**

+ 29
- 25
src/electron/tools/fs.js View File

@@ -7,6 +7,9 @@ const axios = require('axios')
const { api } = require('electron-utils')
const filesize = require('filesize')
const unzipper = require('unzipper')
const deferred = require('deferred')
const sevenBin = require('7zip-bin')
const { extractFull } = require('node-7z')

const debug = require('debug').default('app:electron:tools:fs')

@@ -112,49 +115,50 @@ module.exports = {
*
* @param {string} zipPath
* @param {string} targetPath
* @return {Promise}
*/
extract(zipPath, targetPath) {
const bus = new EventBus()
const def = deferred()

const stream = fs
.createReadStream(zipPath)
.pipe(unzipper.Extract({ path: targetPath }))

let extracted = 0

stream.on('close', () => {
bus.emit('end')
def.resolve()
})

stream.on('data', (entryStream) => {
extracted += 1
const progress = extracted / 4 // TODO: Hardcoded for checkpoints
stream.on('error', (err) => {
def.reject(err)
})

debug({
extracted,
entryStream
})
return def.promise
},

bus.emit('progress', null, progress)
})
/**
*
* @param {string} zipPath
* @param {string} targetPath
*/
extractSeven(zipPath, targetPath) {
const def = deferred()

stream.on('error', (err) => {
bus.emit('error', null, err)
})
const pathTo7zip = sevenBin.path7za

/*
const zip = new AdmZip(zipPath)
const seven = extractFull(zipPath, targetPath, {
$bin: pathTo7zip,
recursive: true
})

zip.extractAllToAsync(targetPath, overwrite, null, progress => {
bus.emit('progress', null, progress)
seven.on('end', () => {
def.resolve()
})

if (progress === 1) {
bus.emit('end', null, progress)
}
seven.on('error', (err) => {
def.reject(err)
})
*/

return bus
return def.promise
},

/**

+ 3
- 22
src/electron/tools/paths.js View File

@@ -22,37 +22,18 @@ module.exports = {
*/
get(name, ...args) {
const { app } = utils.api
let folderPath

if (name === 'root') {
if (utils.is.development) {
folderPath = utils.getRootPath()
} else {
folderPath = path.resolve(app.getPath('exe'), '../')
}
} else {
folderPath = app.getPath(name)
}
const folderPath = app.getPath(name)

return path.join(folderPath, ...args)
},

/**
* Alias for get('root', ...args)
*
* @param {string} args Series of path segments to join into one path
*/
getRoot(...args) {
return this.get('root', ...args)
},

/**
*
* @param {...any} args
*/
getGui(...args) {
if (utils.is.development) {
return path.join(utils.getRootPath(), ...args)
return path.join(utils.api.app.getPath('exe'), ...args)
}

return path.join(utils.api.app.getPath('exe'), ...args)
@@ -66,7 +47,7 @@ module.exports = {
let folder = $settings.folders.cli

if (!fs.existsSync(folder)) {
folder = this.getRoot('cli')
folder = this.get('userData', 'dreampower')
}

return path.join(folder, ...args)

+ 1
- 1
src/electron/tools/shell.js View File

@@ -39,7 +39,7 @@ module.exports = {
* @param {...any} args
*/
showSaveDialog(...args) {
return api.dialog.showSaveDialog(...args)
return api.dialog.showSaveDialogSync(...args)
},

/**

+ 1
- 1
src/modules/models/photo.js View File

@@ -1,5 +1,5 @@
import _ from 'lodash'
import { uuid } from 'electron-utils/browser'
import uuid from 'uuid'
import swal from 'sweetalert'
import Queue from 'better-queue'
import MemoryStore from 'better-queue-memory'

+ 67
- 40
src/modules/update/base.js View File

@@ -34,11 +34,11 @@ export default class {
this.downloadBus = undefined

this.current = {
tag_name: '0.0.0'
tag_name: 'v0.0.0'
}

this.latest = {
tag_name: '0.0.0'
tag_name: 'v0.0.0'
}

this.http = axios.create({
@@ -62,17 +62,21 @@ export default class {
}

/**
* Returns the name of the project.
* Returns the current version of the project
*/
getTitle() {
return undefined
getCurrentVersion() {
return 'v0.0.0'
}

/**
* Returns the current version of the project
*
* @param {string} latest
* @param {string} current
* @return {boolean}
*/
getCurrentVersion() {
return '0.0.0'
isAvailable(latest) {
const currentVersion = this.getCurrentVersion()
return compareVersions.compare(latest, currentVersion, '>')
}

/**
@@ -84,48 +88,71 @@ export default class {
}

/**
* Returns the file name of the latest version
*
*/
getUpdateFileName() {
const platform = $tools.utils.platform({
const url = this.getUpdateDownloadURLs()[0]
return url.substring(url.lastIndexOf('/') + 1)
}

/**
*
*/
getUpdatePlatform() {
return $tools.utils.platform({
macos: 'macos',
windows: 'windows',
linux: 'ubuntu'
})

const extension = $tools.utils.platform({
macos: '.dmg',
windows: '.exe',
linux: '.deb'
})

return `${this.getTitle()}-${
this.latest.tag_name
}-${platform}-x64${extension}`
}

/**
* Returns the URLs where the latest version can be downloaded
*/
getUpdateDownloadURLs() {
const urls = [
// CDN
`${$nucleus.urls.cdn}/releases/${this.getName()}/v${
this.latest.tag_name
}/${this.getUpdateFileName()}`
]

const asset = _.find(this.latest.assets, {
name: this.getUpdateFileName()
})
const platform = this.getUpdatePlatform()

let urls
let asset

try {
urls = $nucleus.releases[`${this.getName()}`][`${this.latest.tag_name}`]
} catch (err) {
urls = []
}

if (_.isPlainObject(urls)) {
urls = urls[platform]
}

if (this.latest.assets.length === 1) {
// eslint-disable-next-line prefer-destructuring
asset = this.latest.assets[0]
} else {
asset = _.find(this.latest.assets, (asset) => {
return asset.name.includes(platform)
})
}

if (!_.isNil(asset)) {
urls.push(asset.browser_download_url)
urls.unshift(asset.browser_download_url)
}

urls = urls.filter((item) => {
return _.startsWith(item, 'http')
})

return urls
}

/**
*
* @param {Array} releases
*/
getLatestRelease(releases) {
return releases[0]
}

/**
* Set information about the update in progress
*
@@ -178,20 +205,20 @@ export default class {

this.enabled = true

debug(`${this.getTitle()} - Update provider initialized!`, {
debug(`${this.getName()} - Update provider initialized!`, {
provider: this,
name: this.getName(),
title: this.getTitle(),
currentVersion: this.getCurrentVersion(),
downloadURLs: this.getUpdateDownloadURLs(),
fileName: this.getUpdateFileName(),
downloadURLs: this.getUpdateDownloadURLs()
platform: this.getUpdatePlatform()
})
} catch (err) {
$rollbar.warn(err, {
project: this.getTitle()
project: this.getName()
})

console.warn(`${this.getTitle()}: Error at fetch releases`, err)
console.warn(`${this.getName()}: Error at fetch releases`, err)

this.enabled = false
}
@@ -218,9 +245,9 @@ export default class {
const currentVersion = this.getCurrentVersion()

// eslint-disable-next-line
this.latest = releases[0]
this.current = _.find(releases, { tag_name: `v${currentVersion}` })
this.available = compareVersions(this.latest.tag_name, currentVersion) === 1
this.latest = this.getLatestRelease(releases)
this.current = _.find(releases, { tag_name: currentVersion })
this.available = this.isAvailable(this.latest.tag_name)

// this.available = true

@@ -345,5 +372,5 @@ export default class {
/**
* Send a notification indicating update available
*/
sendNotification() {}
sendNotification() { }
}

+ 7
- 46
src/modules/update/checkpoints.js View File

@@ -46,28 +46,21 @@ export default class extends Base {
return $nucleus.about.checkpoints.name
}

/**
* Returns the name of the project.
*/
getTitle() {
return $nucleus.about.checkpoints.name
}

/**
* Returns the current version of the project
*/
getCurrentVersion() {
if (!platform.requirements.checkpoints || !platform.requirements.cli) {
return '0.0.0'
return 'v0.0.0'
}

const filePath = $tools.paths.getCheckpoints('version')

if (!$tools.fs.exists(filePath)) {
return '0.0.1'
return 'v0.0.1'
}

let version = $tools.fs.read(filePath) || '0.0.1'
let version = $tools.fs.read(filePath) || 'v0.0.1'
version = version.trim()

return version
@@ -81,27 +74,6 @@ export default class extends Base {
return $nucleus.about.checkpoints.github
}

/**
* Returns the file name of the latest version
*/
getUpdateFileName() {
return `v${this.latest.tag_name}.zip`
}

/**
* Returns the URLs where the latest version can be downloaded
*/
getUpdateDownloadURLs() {
const urls = [
// CDN
`${
$nucleus.urls.cdn
}/releases/${this.getName()}/${this.getUpdateFileName()}`
]

return urls
}

/**
* Download the latest software version
*/
@@ -138,23 +110,12 @@ export default class extends Base {
* @param {string} filePath
*/
async install(filePath) {
const bus = $tools.fs.extract(filePath, $tools.paths.getCli())

bus.on('progress', (value) => {
this.updating.progress = value
})

bus.on('end', (value) => {
this.updating.progress = value
this._resetUpdating()
await $tools.fs.extract(filePath, $tools.paths.getCli())

$tools.utils.api.app.relaunch()
$tools.utils.api.app.exit()
})
this._resetUpdating()

bus.on('error', (err) => {
throw err
})
$tools.utils.api.app.relaunch()
$tools.utils.api.app.exit()
}

/**

+ 159
- 0
src/modules/update/dreampower.js View File

@@ -0,0 +1,159 @@
// DreamTime.
// Copyright (C) DreamNet. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License 3.0 as published by
// the Free Software Foundation.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

import _ from 'lodash'
import compareVersions from 'compare-versions'
import Base from './base'
import dream from '../dream'
import platform from '../platform'

export default class DreamPower extends Base {
/**
* Returns if this provider is activated
*/
can() {
if (!$nucleus.isEnabled) {
return false
}

if (_.isNil(_.get($nucleus, 'about.dreampower.name'))) {
return false
}

if (_.isNil(_.get($nucleus, 'about.dreampower.title'))) {
return false
}

if (_.isNil(_.get($nucleus, 'about.dreampower.github'))) {
return false
}

return true
}

/**
* Returns the code name of the project.
* It is usually the lowercase name
*/
getName() {
return $nucleus.about.dreampower.name
}

/**
* Returns the domain and repository of the project in Github.
* Example: private-dreamnet/dreamtime
*/
getGithubRepository() {
return $nucleus.about.dreampower.github
}

/**
* Returns the current version of the project
*/
getCurrentVersion() {
if (!platform.requirements.cli) {
return 'v0.0.0'
}

const filePath = $tools.paths.getCli('version')

if (!$tools.fs.exists(filePath)) {
return 'v1.1.0'
}

let version = $tools.fs.read(filePath) || 'v1.1.0'
version = version.trim()

return version
}

/**
*
*/
getUpdatePlatform() {
let platform = $tools.utils.platform({
macos: 'macos',
windows: 'windows',
linux: 'ubuntu'
})

if (platform === 'macos' || $settings.processing.device === 'CPU') {
platform = `${platform}-cpuonly`
} else {
platform = `${platform}-any`
}

return platform
}

/**
*
* @param {string} latest
* @return {boolean}
*/
isAvailable(latest) {
const compatibility = $nucleus.compatibility[`v${dream.version}`]

for (const conditions of compatibility) {
// v1.2.2 v1.0.0 >= = true
// v1.2.2 v.1.0 <= = false
if (!compareVersions.compare(latest, conditions[0], conditions[1])) {
return false
}
}

return super.isAvailable(latest)
}

/**
*
* @param {Array} releases
*/
getLatestRelease(releases) {
const currentVersion = this.getCurrentVersion()

return _.find(releases, (release) => {
return this.isAvailable(release.tag_name) || release.tag_name === currentVersion
})
}

/**
* Install the downloaded update
*
* @param {string} filePath
*/
async install(filePath) {
await $tools.fs.extractSeven(filePath, $tools.paths.getCli())

this._resetUpdating()

$tools.utils.api.app.relaunch()
$tools.utils.api.app.exit()
}

/**
* Send a notification indicating update available
*/
sendNotification() {
const notification = new Notification(
`โœจ DreamPower ${this.latest.tag_name} available!`,
{
body: 'A new version of DreamPower is available for update.'
}
)

notification.onclick = () => {
window.$redirect('/system/about')
$tools.utils.activeWindow().focus()
}
}
}

+ 1
- 8
src/modules/update/dreamtime.js View File

@@ -46,13 +46,6 @@ export default class extends Base {
return $nucleus.about.dreamtime.name
}

/**
* Returns the name of the project.
*/
getTitle() {
return $nucleus.about.dreamtime.title
}

/**
* Returns the domain and repository of the project in Github.
* Example: private-dreamnet/dreamtime
@@ -65,7 +58,7 @@ export default class extends Base {
* Returns the current version of the project
*/
getCurrentVersion() {
return dream.version
return `v${dream.version}`
}

/**

+ 5
- 1
src/modules/updater.js View File

@@ -14,6 +14,7 @@ import _ from 'lodash'

import DreamTime from './update/dreamtime'
import Checkpoints from './update/checkpoints'
import DreamPower from './update/dreampower'

const debug = require('debug').default('app:modules:updater')

@@ -29,14 +30,17 @@ export default {
// Software
this.dreamtime = new DreamTime()
this.checkpoints = new Checkpoints()
this.dreampower = new DreamPower()

// Information of the current and most recent version
await this.dreamtime.fetch()
await this.checkpoints.fetch()
await this.dreampower.fetch()

debug('Updater initialized!', {
dreamtime: this.dreamtime,
checkpoints: this.checkpoints
checkpoints: this.checkpoints,
dreampower: this.dreampower
})
}
}

+ 12
- 37
src/nuxt.config.js View File

@@ -30,17 +30,9 @@ module.exports = {
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],

link: [
/* { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } */
],
link: [],

scripts: [
/*
{
src: 'https://www.gstatic.com/firebasejs/6.3.1/firebase-app.js'
}
*/
]
scripts: []
},

/*
@@ -52,9 +44,11 @@ module.exports = {
** Global CSS
*/
css: [
'tippy.js/dist/tippy.css',
'cropperjs/dist/cropper.css',

'~/assets/css/tailwind.scss',
'~/assets/css/fonts.scss',
'~/assets/css/vendor.scss'
],

/*
@@ -65,7 +59,7 @@ module.exports = {
/*
** Nuxt.js dev-modules
*/
devModules: [
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/nuxt-tailwindcss
@@ -75,7 +69,10 @@ module.exports = {
/*
** Nuxt.js modules
*/
modules: ['@nuxtjs/pwa', '@nuxtjs/dotenv'],
modules: [
// '@nuxtjs/pwa',
'@nuxtjs/dotenv'
],

/*
** Axios module configuration
@@ -101,31 +98,9 @@ module.exports = {
** Build configuration
*/
build: {
/**
*
*/
postcss: {
plugins: {
tailwindcss: './tailwind.config.js'
}
},
analyze: false,

/**
*
*/
terser: {
parallel: true,
cache: false,
sourceMap: true,
extractComments: {
filename: 'LICENSES'
},
terserOptions: {
output: {
comments: /^\**!|@preserve|@license|@cc_on/
}
}
},
extractCSS: true,

/*
** You can extend webpack config here

+ 194
- 0
src/package - Copy.json View File

@@ -0,0 +1,194 @@
{
"name": "dreamtime",
"description": "Friendly user interface for DreamPower.",
"author": "DreamNet <dreamtime@dreamnet.tech>",
"homepage": "https://time.dreamnet.tech",
"version": "1.1.1",
"main": "electron/index.js",
"license": "GPL-3.0-only",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/dreamnettech/dreamtime.git"
},
"bugs": {
"url": "https://github.com/dreamnettech/dreamtime/issues"
},
"build": {
"appId": "com.dreamnet.dreamtime",
"productName": "DreamTime",
"directories": {
"output": "../dist"
},
"files": [
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
"!**/node_modules/*.d.ts",
"!**/node_modules/.bin",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj,vscode,env.example,eslintrc.json,prettierrc,tgz}",
"!.editorconfig",
"!**/._*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}",
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}",
"!**/{components,cli,layouts,middleware,mixins,pages,patches,plugins,scripts,store,third,nucleus.json,tailwind.config.js}",
"!{assets,modules}"
],
"win": {
"icon": "static/app.ico",
"target": [
{
"target": "nsis",
"arch": "x64"
}
],
"extraResources": [
{
"from": "node_modules/regedit/vbs",
"to": "vbs"
}
],
"extraFiles": [
{
"from": ".env",
"to": ".env"
}
]
},
"linux": {
"target": "deb",
"icon": "static/app.icns",
"executableName": "DreamTime",
"category": "Graphics",
"extraFiles": [
{
"from": ".env",
"to": ".env"
}
]
},
"mac": {
"target": "dmg",
"icon": "static/app.icns",
"category": "public.app-category.graphics-design",
"extraFiles": [
{
"from": ".env",
"to": "MacOS/.env"
}
]
},
"nsis": {
"oneClick": false,
"artifactName": "${productName}-v${version}-windows.${ext}",
"menuCategory": true,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"installerIcon": "static/app.ico",
"uninstallerIcon": "static/app.ico",
"license": "LICENSE"
},
"deb": {
"artifactName": "${productName}-v${version}-ubuntu.${ext}",
"fpm": [
"--deb-no-default-config-files"
]
},
"dmg": {
"title": "${productName} v${version}",
"artifactName": "${productName}-v${version}-macos.${ext}"
}
},
"scripts": {
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"postinstall": "patch-package",
"pack": "electron-builder --dir",
"dev:nuxt": "cross-env NODE_ENV=development nuxt",
"dev:electron": "cross-env NODE_ENV=development DEBUG=app:* electron .",
"build:nuxt": "cross-env NODE_ENV=production nuxt build",
"build:electron": "cross-env NODE_ENV=production electron-builder --publish=never",
"build": "yarn build:nuxt && yarn build:electron",
"preview": "yarn build:nuxt && yarn preview:electron",
"preview:electron": "cross-env NODE_ENV=production DEBUG=app:* DEVTOOLS=true electron ."
},
"husky": {
"hooks": {
"pre-commit": "yarn lint"
}
},
"dependencies": {
"7zip-bin": "^5.0.3",
"@nuxtjs/dotenv": "^1.4.0",
"@nuxtjs/pwa": "^2.6.0",
"better-queue": "^3.8.10",
"better-queue-memory": "^1.0.3",
"clipboard": "^2.0.4",
"compare-versions": "^3.5.0",
"cropperjs": "^1.5.2",
"debug": "^4.1.1",
"deferred": "^0.7.11",
"electron-context-menu": "^0.13.0",
"electron-nucleus": "^2.1.0",
"electron-utils": "^3.0.0",
"filesize": "^4.1.2",
"gpu-info": "^3.0.0",
"gsap": "^2.1.3",
"image-js": "^0.21.7",
"ipfs": "^0.39.0",
"js-event-bus": "^1.0.0",
"lodash": "^4.17.11",
"markdown": "^0.5.0",
"md5": "^2.2.1",
"mime-types": "^2.1.24",
"moment": "^2.24.0",
"node-7z": "^2.0.3",
"nuxt": "^2.0.0",
"patch-package": "^6.1.2",
"postinstall-postinstall": "^2.0.0",
"randomcolor": "^0.5.4",
"randomstring": "^1.1.5",
"raw-loader": "^3.0.0",
"regedit": "^3.0.3",
"supports-color": "^7.0.0",
"sweetalert": "^2.1.2",
"tippy.js": "^4.3.4",
"unzipper": "^0.10.2"
},
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.0",
"@nuxtjs/eslint-config": "^0.0.1",
"@nuxtjs/eslint-module": "^0.0.1",
"@nuxtjs/tailwindcss": "^1.1.2",
"@octokit/rest": "^16.28.7",
"babel-eslint": "^10.0.1",
"cross-env": "^5.2.0",
"electron": "^5.0.6",
"electron-builder": "^20.44.4",
"electron-devtools-installer": "^2.2.4",
"electron-rebuild": "^1.8.5",
"eslint": "^5.15.1",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-standard": ">=12.0.0",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-jest": ">=22.3.0",
"eslint-plugin-lodash": "^5.1.0",
"eslint-plugin-node": ">=8.0.1",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.3",
"husky": "^3.0.4",
"node-sass": "^4.12.0",
"nodemon": "^1.18.9",
"nuxtjs-electron": "^0.1.10",
"prettier": "^1.16.4",
"rollbar-sourcemap-webpack-plugin": "^2.5.1",
"sass-loader": "^8.0.0",
"tailwindcss": "^1.0.0",
"tailwindcss-alpha": "hacknug/tailwindcss-alpha#feature/tests"
}
}

+ 75
- 94
src/package.json View File

@@ -3,16 +3,16 @@
"description": "Friendly user interface for DreamPower.",
"author": "DreamNet <dreamtime@dreamnet.tech>",
"homepage": "https://time.dreamnet.tech",
"version": "1.1.0",
"version": "1.1.1",
"main": "electron/index.js",
"license": "GPL-3.0-only",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/private-dreamnet/dreamtime.git"
"url": "git+https://github.com/dreamnettech/dreamtime.git"
},
"bugs": {
"url": "https://github.com/private-dreamnet/dreamtime/issues"
"url": "https://github.com/dreamnettech/dreamtime/issues"
},
"build": {
"appId": "com.dreamnet.dreamtime",
@@ -32,11 +32,10 @@
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}",
"!**/{components,cli,layouts,middleware,mixins,pages,patches,plugins,scripts,store,third,nucleus.json,tailwind.config.js}",
"!{assets,modules}"
"!**/{components,cli,layouts,middleware,mixins,pages,patches,plugins,scripts,store,third,nucleus.json,tailwind.config.js}"
],
"win": {
"icon": "static/favicon.ico",
"icon": "static/app.ico",
"target": [
{
"target": "nsis",
@@ -53,88 +52,64 @@
{
"from": ".env",
"to": ".env"
},
{
"from": "../dist/dreampower",
"to": "cli",
"filter": [
"**/*",
"!{build,checkpoints,readmeimgs}"
]
}
]
},
"linux": {
"target": "deb",
"icon": "static/favicon.icns",
"icon": "static/app.icns",
"executableName": "DreamTime",
"category": "Graphics",
"extraFiles": [
{
"from": ".env",
"to": ".env"
},
{
"from": "../dist/dreampower",
"to": "cli",
"filter": [
"**/*",
"!{build,checkpoints,readmeimgs}"
]
}
]
},
"mac": {
"target": "dmg",
"icon": "static/favicon.icns",
"icon": "static/app.icns",
"category": "public.app-category.graphics-design",
"extraFiles": [
{
"from": ".env",
"to": "MacOS/.env"
},
{
"from": "../dist/dreampower",
"to": "MacOS/cli",
"filter": [
"**/*",
"!{build,checkpoints,readmeimgs}"
]
}
]
},
"nsis": {
"oneClick": false,
"artifactName": "${productName}-v${version}-windows-${env.BUILD_DEVICE}.${ext}",
"artifactName": "${productName}-v${version}-windows.${ext}",
"menuCategory": true,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"installerIcon": "static/favicon.ico",
"uninstallerIcon": "static/favicon.ico",
"license": "license.txt"
"installerIcon": "static/app.ico",
"uninstallerIcon": "static/app.ico",
"license": "LICENSE"
},
"deb": {
"artifactName": "${productName}-v${version}-ubuntu-${env.BUILD_DEVICE}.${ext}",
"artifactName": "${productName}-v${version}-ubuntu.${ext}",
"fpm": [
"--deb-no-default-config-files"
]
},
"dmg": {
"title": "${productName} v${version}",
"artifactName": "${productName}-v${version}-macos-${env.BUILD_DEVICE}.${ext}"
"artifactName": "${productName}-v${version}-macos.${ext}"
}
},
"scripts": {
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"postinstall": "patch-package",
"pack": "electron-builder --dir",
"dev:gui": "cross-env NODE_ENV=development nuxt",
"dev:nuxt": "cross-env NODE_ENV=development nuxt",
"dev:electron": "cross-env NODE_ENV=development DEBUG=app:* electron .",
"build:gui": "cross-env NODE_ENV=production nuxt build",
"build:nuxt": "cross-env NODE_ENV=production nuxt build",
"build:electron": "cross-env NODE_ENV=production electron-builder --publish=never",
"build": "yarn build:gui && yarn build:electron",
"preview": "yarn build:gui && cross-env NODE_ENV=production DEBUG=app:* electron .",
"release": "release-it --no-increment"
"build": "yarn build:nuxt && yarn build:electron",
"preview": "yarn build:nuxt && yarn preview:electron",
"preview:electron": "cross-env NODE_ENV=production DEBUG=app:* DEVTOOLS=true electron ."
},
"husky": {
"hooks": {
@@ -142,74 +117,80 @@
}
},
"dependencies": {
"@nuxtjs/dotenv": "^1.4.0",
"7zip-bin": "^5.0.3",
"@nuxtjs/dotenv": "^1.4.1",
"@nuxtjs/pwa": "^2.6.0",
"axios": "^0.19.0",
"better-queue": "^3.8.10",
"better-queue-memory": "^1.0.3",
"better-queue-memory": "^1.0.4",
"clipboard": "^2.0.4",
"compare-versions": "^3.5.0",
"cropperjs": "^1.5.2",
"compare-versions": "^3.5.1",
"cropperjs": "^1.5.6",
"debug": "^4.1.1",
"deferred": "^0.7.11",
"electron-context-menu": "^0.13.0",
"electron-nucleus": "^2.1.0",
"electron-utils": "^3.0.0",
"filesize": "^4.1.2",
"gpu-info": "^3.0.0",
"gsap": "^2.1.3",
"image-js": "^0.21.7",
"electron-context-menu": "^0.15.1",
"electron-nucleus": "^2.4.0",
"electron-utils": "^3.0.11",
"filesize": "^6.0.1",
"gpu-info": "^0.0.1",
"gsap": "^3.0.1",
"image-js": "^0.21.8",
"ipfs": "^0.39.0",
"js-event-bus": "^1.0.0",
"lodash": "^4.17.11",
"lodash": "^4.17.15",
"markdown": "^0.5.0",
"md5": "^2.2.1",
"mime-types": "^2.1.24",
"mime-types": "^2.1.25",
"moment": "^2.24.0",
"nuxt": "^2.0.0",
"patch-package": "^6.1.2",
"node-7z": "^2.0.3",
"nuxt": "^2.10.2",
"patch-package": "^6.2.0",
"postinstall-postinstall": "^2.0.0",
"randomcolor": "^0.5.4",
"randomstring": "^1.1.5",
"raw-loader": "^3.0.0",
"raw-loader": "^3.1.0",
"regedit": "^3.0.3",
"supports-color": "^7.0.0",
"rollbar": "^2.14.4",
"supports-color": "^7.1.0",
"sweetalert": "^2.1.2",
"tippy.js": "^4.3.4",
"unzipper": "^0.10.2"
"tippy.js": "^5.1.1",
"unzipper": "^0.10.5",
"uuid": "^3.3.3"
},
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.0",
"@nuxtjs/eslint-config": "^0.0.1",
"@nuxtjs/eslint-module": "^0.0.1",
"@nuxtjs/tailwindcss": "^1.1.2",
"@octokit/rest": "^16.28.7",
"aws-sdk": "^2.515.0",
"babel-eslint": "^10.0.1",
"cross-env": "^5.2.0",
"electron": "^5.0.6",
"electron-builder": "^20.44.4",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@nuxtjs/eslint-config": "^1.1.2",
"@nuxtjs/eslint-module": "^1.1.0",
"@nuxtjs/tailwindcss": "^1.2.0",
"@octokit/rest": "^16.35.0",
"babel-eslint": "^10.0.3",
"cross-env": "^6.0.3",
"electron": "^7.1.1",
"electron-builder": "^22.1.0",
"electron-devtools-installer": "^2.2.4",
"electron-rebuild": "^1.8.5",
"eslint": "^5.15.1",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-standard": ">=12.0.0",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-jest": ">=22.3.0",
"eslint-plugin-lodash": "^5.1.0",
"eslint-plugin-node": ">=8.0.1",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.3",
"husky": "^3.0.4",
"node-sass": "^4.12.0",
"nodemon": "^1.18.9",
"electron-rebuild": "^1.8.6",
"eslint": "^6.6.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.5.0",
"eslint-config-standard": ">=14.1.0",
"eslint-plugin-import": ">=2.18.2",
"eslint-plugin-jest": ">=23.0.4",
"eslint-plugin-lodash": "^6.0.0",
"eslint-plugin-node": ">=10.0.0",
"eslint-plugin-nuxt": ">=0.5.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": ">=4.2.1",
"eslint-plugin-standard": ">=4.0.1",
"eslint-plugin-vue": "^6.0.1",
"husky": "^3.0.9",
"node-sass": "^4.13.0",
"nodemon": "^1.19.4",
"nuxtjs-electron": "^0.1.10",
"prettier": "^1.16.4",
"prettier": "^1.19.1",
"rollbar-sourcemap-webpack-plugin": "^2.5.1",
"sass-loader": "^7.1.0",
"tailwindcss": "^1.0.0"
"sass-loader": "^8.0.0",
"tailwindcss": "^1.1.3",
"tailwindcss-alpha": "hacknug/tailwindcss-alpha#feature/tests"
}
}
}

+ 1
- 1
src/pages/index.vue View File

@@ -11,7 +11,7 @@
</app-title>

<div class="content-body">
<div v-if="alert" class="notification is-warning text-lg" v-html="alert" />
<div v-if="alert" class="notification is-warning" v-html="alert" />

<!-- Quick Upload -->
<nudity-upload />

+ 318
- 0
src/pages/nudity/crop.vue View File

@@ -62,6 +62,8 @@
<div class="crop-canvas">
<canvas ref="photoCanvas" />
</div>

<div class="cropper"></div>
</div>
</template>

@@ -200,4 +202,320 @@ export default {
}
}
}

.crupper {
color: red;
}

.creeper {
color: green;
}
</style>

<style>
/*!
* Cropper.js v1.5.6
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-10-04T04:33:44.164Z
*/

.cropper-container {
direction: ltr;
font-size: 0;
line-height: 0;
position: relative;
-ms-touch-action: none;
touch-action: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.cropper-container img {
display: block;
height: 100%;
image-orientation: 0deg;
max-height: none !important;
max-width: none !important;
min-height: 0 !important;
min-width: 0 !important;
width: 100%;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
overflow: hidden;
}

.cropper-drag-box {
background-color: #fff;
opacity: 0;
}

.cropper-modal {
background-color: #000;
opacity: 0.5;
}

.cropper-view-box {
display: block;
height: 100%;
outline: 1px solid #39f;
outline-color: rgba(51, 153, 255, 0.75);
overflow: hidden;
width: 100%;
}

.cropper-dashed {
border: 0 dashed #eee;
display: block;
opacity: 0.5;
position: absolute;
}

.cropper-dashed.dashed-h {
border-bottom-width: 1px;
border-top-width: 1px;
height: calc(100% / 3);
left: 0;
top: calc(100% / 3);
width: 100%;
}

.cropper-dashed.dashed-v {
border-left-width: 1px;
border-right-width: 1px;
height: 100%;
left: calc(100% / 3);
top: 0;
width: calc(100% / 3);
}

.cropper-center {
display: block;
height: 0;
left: 50%;
opacity: 0.75;
position: absolute;
top: 50%;
width: 0;
}

.cropper-center::before,
.cropper-center::after {
background-color: #eee;
content: ' ';
display: block;
position: absolute;
}

.cropper-center::before {
height: 1px;
left: -3px;
top: 0;
width: 7px;
}

.cropper-center::after {
height: 7px;
left: 0;
top: -3px;
width: 1px;
}

.cropper-face,
.cropper-line,
.cropper-point {
display: block;
height: 100%;
opacity: 0.1;
position: absolute;
width: 100%;
}

.cropper-face {
background-color: #fff;
left: 0;
top: 0;
}

.cropper-line {
background-color: #39f;
}

.cropper-line.line-e {
cursor: ew-resize;
right: -3px;
top: 0;
width: 5px;
}

.cropper-line.line-n {
cursor: ns-resize;
height: 5px;
left: 0;
top: -3px;
}

.cropper-line.line-w {
cursor: ew-resize;
left: -3px;
top: 0;
width: 5px;
}

.cropper-line.line-s {
bottom: -3px;
cursor: ns-resize;
height: 5px;
left: 0;
}

.cropper-point {
background-color: #39f;
height: 5px;
opacity: 0.75;
width: 5px;
}

.cropper-point.point-e {
cursor: ew-resize;
margin-top: -3px;
right: -3px;
top: 50%;
}

.cropper-point.point-n {
cursor: ns-resize;
left: 50%;
margin-left: -3px;
top: -3px;
}

.cropper-point.point-w {
cursor: ew-resize;
left: -3px;
margin-top: -3px;
top: 50%;
}

.cropper-point.point-s {
bottom: -3px;
cursor: s-resize;
left: 50%;
margin-left: -3px;
}

.cropper-point.point-ne {
cursor: nesw-resize;
right: -3px;
top: -3px;
}

.cropper-point.point-nw {
cursor: nwse-resize;
left: -3px;
top: -3px;
}

.cropper-point.point-sw {
bottom: -3px;
cursor: nesw-resize;
left: -3px;
}

.cropper-point.point-se {
bottom: -3px;
cursor: nwse-resize;
height: 20px;
opacity: 1;
right: -3px;
width: 20px;
}

@media (min-width: 768px) {
.cropper-point.point-se {
height: 15px;
width: 15px;
}
}

@media (min-width: 992px) {
.cropper-point.point-se {
height: 10px;
width: 10px;
}
}

@media (min-width: 1200px) {
.cropper-point.point-se {
height: 5px;
opacity: 0.75;
width: 5px;
}
}

.cropper-point.point-se::before {
background-color: #39f;
bottom: -50%;
content: ' ';
display: block;
height: 200%;
opacity: 0;
position: absolute;
right: -50%;
width: 200%;
}

.cropper-invisible {
opacity: 0;
}

.cropper-bg {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
}

.cropper-hide {
display: block;
height: 0;
position: absolute;
width: 0;
}

.cropper-hidden {
display: none !important;
}

.cropper-move {
cursor: move;
}

.cropper-crop {
cursor: crosshair;
}

.cropper-disabled .cropper-drag-box,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
cursor: not-allowed;
}

</style>

+ 133
- 119
src/pages/system/about.vue View File

@@ -16,29 +16,30 @@
<!-- Limited! -->
<section v-if="$platform.isLimited" class="box box-section">
<box-section-item
label="It seems that you are offline"
:description="`It's okay! You can use ${$dream.name} offline, but while you are disconnected we cannot offer you more information about the project, updates or report errors automatically. Connect to the Internet or if you are a developer, set the Nucleus API key and restart the program.`">
:description="`It's okay! You