Browse Source

Some bug fixes and QoL updates.

tags/v1.4.5
Ivan Bravo Bravo 1 month ago
parent
commit
e8042849dc
39 changed files with 823 additions and 1516 deletions
  1. 19
    30
      .github/workflows/ci.yml
  2. 28
    33
      README.md
  3. 96
    96
      src/.eslintrc.js
  4. 10
    5
      src/assets/css/components/_notification.scss
  5. 3
    45
      src/assets/css/components/_wizard.scss
  6. 2
    0
      src/assets/css/tailwind.scss
  7. 1
    1
      src/components/Layout/Navbar.vue
  8. 8
    8
      src/components/Nudity/Upload.vue
  9. 0
    4
      src/components/Queue/QueuePhoto.vue
  10. 1
    1
      src/components/Settings/SettingsPreferences.vue
  11. 83
    16
      src/components/UI/ProjectUpdate.vue
  12. 3
    3
      src/electron-builder.js
  13. 19
    53
      src/electron/src/index.js
  14. 21
    4
      src/electron/src/modules/settings.js
  15. 53
    7
      src/electron/src/modules/tools/system.js
  16. 31
    19
      src/modules/config/cli-errors.json
  17. 13
    0
      src/modules/consola/errors.js
  18. 2
    1
      src/modules/file.js
  19. 1
    1
      src/modules/services/dreamtrack.js
  20. 1
    1
      src/modules/system/requirements.js
  21. 9
    4
      src/modules/updater/base.js
  22. 29
    7
      src/modules/updater/dreamtime.js
  23. 44
    170
      src/nuxt.config.js
  24. 95
    84
      src/package.json
  25. 4
    6
      src/package.min.json
  26. 1
    1
      src/pages/alerts.vue
  27. 3
    3
      src/pages/index.vue
  28. 30
    26
      src/pages/nudify/_id/crop.vue
  29. 27
    325
      src/pages/nudify/_id/overlay.vue
  30. 2
    2
      src/pages/nudify/_id/results.vue
  31. 6
    6
      src/pages/settings/app.vue
  32. 17
    24
      src/pages/wizard/checkpoints.vue
  33. 0
    14
      src/pages/wizard/dreamtime.vue
  34. 10
    28
      src/pages/wizard/power.vue
  35. 34
    22
      src/plugins/boot.js
  36. 112
    0
      src/scripts/deploy.js
  37. 0
    464
      src/scripts/release.js
  38. 4
    1
      src/tailwind.config.js
  39. 1
    1
      src/workers/fs/worker.js

+ 19
- 30
.github/workflows/ci.yml View File

@@ -40,20 +40,6 @@ jobs:
extension: dmg

steps:
- name: Dump GitHub context
if: false
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
continue-on-error: true

- name: Dump runner context
if: false
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
continue-on-error: true

- uses: actions/checkout@v1
with:
submodules: true
@@ -67,40 +53,43 @@ jobs:
run: npm install -g yarn

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

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

- name: Build (Installer)
working-directory: src
working-directory: src/
env:
GITHUB_SHA: ${{ github.sha }}
run: yarn run build

- name: Build (Portable)
working-directory: src
working-directory: src/
env:
BUILD_PORTABLE: true
run: yarn run build

- name: Release
working-directory: src/scripts
- name: Deploy
working-directory: src/
continue-on-error: true
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
DREAMLINK_TOKEN: ${{ secrets.DREAMLINK_TOKEN }}
PINATA_KEY: ${{ secrets.PINATA_KEY }}
PINATA_SECRET: ${{ secrets.PINATA_SECRET }}
CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
ANTOPIE_TOKEN: ${{ secrets.ANTOPIE_TOKEN }}
SPIP_TOKEN: ${{ secrets.SPIP_TOKEN }}
TEKNIK_TOKEN: ${{ secrets.TEKNIK_TOKEN }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
BUILD_PLATFORM: ${{ matrix.platform }}
BUILD_EXTENSION: ${{ matrix.extension }}
run: node release.js
DEPLOY_ENCRYPT_KEY: ${{ secrets.SECRET_KEY }}
DEPLOY_GITHUB_TOKEN: ${{ secrets.TOKEN }}
DEPLOY_GITHUB_OWNER: dreamnettech
DEPLOY_TEKNIK_TOKEN: ${{ secrets.TEKNIK_TOKEN }}
DEPLOY_TEKNIK_OWNER: dreamnet
DEPLOY_DREAMLINKCLUSTER_USERNAME: ${{ secrets.DEPLOY_DREAMLINKCLUSTER_USERNAME }}
DEPLOY_DREAMLINKCLUSTER_PASSWORD: ${{ secrets.DEPLOY_DREAMLINKCLUSTER_PASSWORD }}
DEPLOY_PINATA_KEY: ${{ secrets.PINATA_KEY }}
DEPLOY_PINATA_SECRET: ${{ secrets.PINATA_SECRET }}
DEPLOY_MEGA_EMAIL: ${{ secrets.DEPLOY_MEGA_EMAIL }}
DEPLOY_MEGA_PASSWORD: ${{ secrets.DEPLOY_MEGA_PASSWORD }}
DEPLOY_MEGA_FOLDER: "/Projects/DreamTime/Releases/"
run: yarn run deploy

+ 28
- 33
README.md View File

@@ -1,60 +1,53 @@
<h1 align="center">
<div align="center">
<a href="https://time.dreamnet.tech">
<img src="assets/dreamtime.png" alt="DreamTime">
</a>
<p align="center">DreamTime</p>
<p align="center" style="font-size: 2.0em;">DreamTime</p>

<p align="center" style="font-size: 0.8em;">
๐Ÿ™ˆ Use artificial intelligence to undress people.
<p align="center" style="font-size: 1.6em;">
๐Ÿ™ˆ Use artificial intelligence to create fake nudes.
</p>
</h1>

<p align="center">
Available for Windows, Linux and Mac.
</p>
</div>

<p align="center">
<a href="https://github.com/dreamnettech/dreamtime/actions"><img src="https://github.com/dreamnettech/dreamtime/workflows/CI/CD/badge.svg" /></a>
<a href="https://github.com/dreamnettech/dreamtime/releases"><img src="https://img.shields.io/github/downloads/dreamnettech/dreamtime/total?logo=github&logoColor=white" /></a>
<a href="https://www.codacy.com/app/kolessios/dreamtime?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dreamnettech/dreamtime&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/0ecb8ba6eeae42e7bfd0d414d1bacee1" /></a>
<a href="https://codeclimate.com/github/dreamnettech/dreamtime/maintainability"><img src="https://api.codeclimate.com/v1/badges/8d325515768f221e235f/maintainability" /></a>
<a target="_blank" href="https://www.codacy.com/app/kolessios/dreamtime?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dreamnettech/dreamtime&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/0ecb8ba6eeae42e7bfd0d414d1bacee1" /></a>
<a target="_blank" href="https://codeclimate.com/github/private-dreamnet/dreamtime/maintainability"><img src="https://api.codeclimate.com/v1/badges/8d325515768f221e235f/maintainability" /></a>
</p>

<p align="center">
<a href="https://time.dreamnet.tech"><img src="https://img.shields.io/uptimerobot/status/m783500405-1d347e6a5472fdb2035c7003?label=website" /></a>
<a target="_blank" href="https://time.dreamnet.tech"><img src="https://img.shields.io/uptimerobot/status/m783500405-1d347e6a5472fdb2035c7003?label=website" /></a>
<a href="CONTRIBUTING.md#pull-requests"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
</p>

## Introduction

DreamTime is a user interface for [DreamPower](https://github.com/dreamnettech/dreampower), an application that uses artificial intelligence to remove clothing from photos of people.

With DreamTime you can use the same technology introduced by DeepNude more easily thanks to a friendlier user interface and new features that improve the quality of the nudifications. ๐Ÿ’ช
## Download

- **Totally free.** Free and open-source user interface to nudify photos. It is constantly updated and does not need cracks.
- **Friendly and Stable.** Easy to use thanks to its modern design similar to a web application, you can nudify photo after photo without the app freezing. ๐Ÿฅถ
- **Multi platform.** Available for Windows, Linux and macOS.
- **Are you still using DeepNude?** [Check out the features that make it better.](https://time.dreamnet.tech/docs/dreamtime)
[Download the latest version of DreamTime here!](https://time.dreamnet.tech/docs/installation)

## Installation

๐Ÿ’ป Visit the [installation page](https://time.dreamnet.tech/docs/installation) to download and install DreamTime.

You can also visit the [Releases](https://github.com/dreamnettech/dreamtime/releases) section to download DreamTime.
You can also visit the [Releases](https://github.com/dreamnettech/dreamtime/releases) page.

## Development

๐Ÿ‘ฉโ€๐Ÿ’ป Start hacking DreamTime or help us improve it by creating a PR.
Visit the [Getting Started](https://time.dreamnet.tech/docs/development/getting-started) page to start hacking DreamTime. ๐Ÿ‘ฉโ€๐Ÿ’ป

Visit the [Getting Started](https://time.dreamnet.tech/docs/development/getting-started) page for more information.
## Community

## Contact
- [Chat](https://chat.dreamnet.tech)
- [Forum](https://forum.dreamnet.tech)
- [Twitter](https://twitter.com/DreamNetTechno)
- [Facebook](https://web.facebook.com/DreamNetTechnology)

๐Ÿ“ง Stay in touch with the developers and the community:
## Supporting DreamTime

- [![](https://img.shields.io/uptimerobot/status/m783500390-1e7fe0c3dd2ccf723a66a1b5?label=Chat&style=flat-square)](https://chat.dreamnet.tech)
- [![](https://img.shields.io/uptimerobot/status/m783500403-8eacc06341d120efccad2c5a?label=Forum&style=flat-square)](https://forum.dreamnet.tech)
- [ivan@dreamnet.tech](mailto:ivan@dreamnet.tech)
DreamTime is an open-source project that will be **free forever**. The project is kept in development thanks to the support of our incredible backers.

## Funding

๐Ÿ’– DreamTime will be free and open-source **forever**. You can help us speed up and continue with the development and offer servers for the download:
These are the ways you can support us:

- [Patreon](https://patreon.com/dreamnet)
- [Ko-fi](https://ko-fi.com/dreamnet)
@@ -62,7 +55,9 @@ Visit the [Getting Started](https://time.dreamnet.tech/docs/development/getting-

## Sponsors

๐Ÿฅฐ Support this project by becoming a sponsor. Your logo will show up here and in the about section of our apps, with a link to your website. [[Become a sponsor](https://www.patreon.com/join/dreamnet/checkout?rid=4426478)]
๐Ÿฅฐ Support this project by becoming a sponsor. Your logo will show up here and in the about section of our apps, with a link to your website.

[[Become a sponsor](https://www.patreon.com/join/dreamnet/checkout?rid=4426478)]

## License


+ 96
- 96
src/.eslintrc.js View File

@@ -2,18 +2,18 @@ module.exports = {
env: {
browser: true,
node: true,
mocha: true
mocha: true,
},
extends: [
"@nuxtjs",
"airbnb-base",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:promise/recommended",
"plugin:lodash/recommended",
"plugin:vue/recommended",
"plugin:nuxt/recommended",
"plugin:mocha/recommended"
'@nuxtjs',
'airbnb-base',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:promise/recommended',
'plugin:lodash/recommended',
'plugin:vue/recommended',
'plugin:nuxt/recommended',
'plugin:mocha/recommended',
],
globals: {
$provider: false,
@@ -21,115 +21,115 @@ module.exports = {
LogEvent: false,
Warning: false,
Exception: false,
consola: false
consola: false,
},
parserOptions: {
parser: "babel-eslint",
allowImportExportEverywhere: true
parser: 'babel-eslint',
allowImportExportEverywhere: true,
},
plugins: [
"import",
"promise",
"lodash",
"vue",
"mocha"
'import',
'promise',
'lodash',
'vue',
'mocha',
],
root: true,
rules: {
"no-param-reassign": "off",
"class-methods-use-this": "off",
"no-trailing-spaces": "warn",
"comma-dangle": "warn",
"global-require": "off",
"import/default": "warn",
"import/no-webpack-loader-syntax": "off",
"import/order": ['error'],
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"import/named": "warn",
"import/no-cycle": "off",
"promise/no-callback-in-promise": "off",
"promise/catch-or-return": "off",
"linebreak-style": "warn",
"new-parens": "off",
"lodash/import-scope": [
"off",
"member"
'no-param-reassign': 'off',
'class-methods-use-this': 'off',
'no-trailing-spaces': 'warn',
'comma-dangle': 'warn',
'global-require': 'off',
'import/default': 'warn',
'import/no-webpack-loader-syntax': 'off',
'import/order': ['error'],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/named': 'warn',
'import/no-cycle': 'off',
'promise/no-callback-in-promise': 'off',
'promise/catch-or-return': 'off',
'linebreak-style': 'warn',
'new-parens': 'off',
'lodash/import-scope': [
'off',
'member',
],
"lodash/prefer-constant": "off",
"lodash/prefer-immutable-method": "warn",
"lodash/prefer-includes": "warn",
"lodash/prefer-lodash-method": "off",
"lodash/prefer-lodash-typecheck": "warn",
"lodash/prefer-noop": "off",
"lodash/prefer-spread": "off",
"import/extensions": "off",
"max-len": "off",
"func-names": "off",
"no-await-in-loop": "warn",
"no-console": "warn",
"no-continue": "off",
"no-debugger": "error",
"no-lone-blocks": "error",
"no-restricted-globals": "warn",
"no-restricted-syntax": "off",
"no-shadow": "off",
"no-underscore-dangle": [
"error",
'lodash/prefer-constant': 'off',
'lodash/prefer-immutable-method': 'warn',
'lodash/prefer-includes': 'warn',
'lodash/prefer-lodash-method': 'off',
'lodash/prefer-lodash-typecheck': 'warn',
'lodash/prefer-noop': 'off',
'lodash/prefer-spread': 'off',
'import/extensions': 'off',
'max-len': 'off',
'func-names': 'off',
'no-await-in-loop': 'warn',
'no-console': 'warn',
'no-continue': 'off',
'no-debugger': 'error',
'no-lone-blocks': 'error',
'no-restricted-globals': 'warn',
'no-restricted-syntax': 'off',
'no-shadow': 'off',
'no-underscore-dangle': [
'error',
{
allowAfterThis: true
}
allowAfterThis: true,
},
],
"no-unreachable": "warn",
"no-unused-vars": "warn",
"no-useless-constructor": "warn",
"nuxt/no-globals-in-created": "off",
"object-shorthand": [
"error",
"always"
'no-unreachable': 'warn',
'no-unused-vars': 'warn',
'no-useless-constructor': 'warn',
'nuxt/no-globals-in-created': 'off',
'object-shorthand': [
'error',
'always',
],
"padded-blocks": [
"error",
"never"
'padded-blocks': [
'error',
'never',
],
"prefer-spread": "off",
"quote-props": [
"error",
"as-needed"
'prefer-spread': 'off',
'quote-props': [
'error',
'as-needed',
],
quotes: [
"error",
"single",
'error',
'single',
{
allowTemplateLiterals: true
}
allowTemplateLiterals: true,
},
],
semi: [
"error",
"never"
'error',
'never',
],
"spaced-comment": "warn",
"vue/html-closing-bracket-newline": [
"warn",
'spaced-comment': 'warn',
'vue/html-closing-bracket-newline': [
'warn',
{
multiline: "never",
singleline: "never"
}
multiline: 'never',
singleline: 'never',
},
],
"vue/html-indent": [
"warn",
2
'vue/html-indent': [
'warn',
2,
],
"vue/html-self-closing": "error",
"vue/no-v-html": "off",
"vue/singleline-html-element-content-newline": "warn",
'nuxt/no-cjs-in-config': 'off'
'vue/html-self-closing': 'error',
'vue/no-v-html': 'off',
'vue/singleline-html-element-content-newline': 'warn',
'nuxt/no-cjs-in-config': 'off',
},
settings: {
"import/resolver": {
'import/resolver': {
nuxt: {},
node: {},
webpack: {}
}
}
webpack: {},
},
},
}

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

@@ -10,23 +10,28 @@
*/

.notification {
@apply mb-4 py-2 px-4 border-2 border-dark-100 rounded-sm;
@apply bg-transparent text-generic-500 text-sm;
@apply mb-4 py-4 px-4 rounded;
@apply bg-white text-black text-sm;

h5 {
@apply font-bold;
margin-bottom: 6px;
}

a {
@apply underline;
}

&.notification--warning {
@apply text-warning-400 border-warning;
@apply bg-warning-500;
}

&.notification--danger {
@apply text-danger-400 border-danger;
@apply bg-danger-500;
}

&.notification--success {
@apply text-success-400 border-success;
@apply bg-success-500;
}

.icon {

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

@@ -11,55 +11,13 @@
.wizard-project {
.project__content {
@apply flex mb-6 pb-6 border-b border-dark-500;
@apply flex;

.project__update {
@apply flex-1;
}

.project__description {
@apply flex-1 flex flex-col justify-center;

p {
@apply text-xl mb-6;
}

a {
@apply text-white underline;
}
}
}

.project__installation {
@apply flex;

.project__overview {
@apply flex-1 flex flex-col justify-center items-center;

figure {
@apply mb-6 text-6xl;

img {
height: 100px;
}
}

h1 {
@apply text-2xl text-white font-bold;
}

h2 {
@apply text-lg;
}

.project__navigation {
@apply mt-6;

.button {
&:not(:last-child) {
@apply mr-2;
}
}
&:not(:last-child) {
@apply mr-4;
}
}


+ 2
- 0
src/assets/css/tailwind.scss View File

@@ -1,3 +1,5 @@
/* purgecss start ignore */
@tailwind base;
@tailwind components;
/* purgecss end ignore */
@tailwind utilities;

+ 1
- 1
src/components/Layout/Navbar.vue View File

@@ -14,7 +14,7 @@
</nuxt-link>

<a v-if="isDev" class="navbar__item" @click.prevent="createError">
Force Error
DEV: UI Error
</a>
</div>


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

@@ -6,16 +6,16 @@
<select
id="uploader-settings"
v-model="$settings.app.uploadMode"
v-tooltip="{ content: 'Upload mode. What will happen when uploading a photo.', placement: 'right' }"
v-tooltip="{ content: 'Upload mode. The uploaded photos will be added to the selected section.', placement: 'right' }"
class="input">
<option value="add-queue">
Put in Queue
</option>
<option value="none">
Put in Pending
Pending
</option>
<option value="go-preferences">
Put in Pending and Open preferences
Pending -> Preferences
</option>
<option value="add-queue">
Queue
</option>
</select>

@@ -72,7 +72,7 @@
<input v-model="webAddress" type="url" class="input mb-2" placeholder="https://" data-private="lipsum">

<p class="help">
Enter the web address of a photo that ends in a valid extension. <i>(jpg, png, gif)</i>
Only web addresses that end in: <code>jpg, png or gif</code>.
</p>

<button class="button" @click="openUrl">
@@ -86,7 +86,7 @@
<input v-model="instagramPhoto" type="url" class="input mb-2" placeholder="https://www.instagram.com/p/dU4fHDw-Ho/" data-private="lipsum">

<p class="help">
Enter the web address or ID of an Instagram photo.
Public photos from any Instagram profile.
</p>

<button class="button" @click="openInstagramPhoto">

+ 0
- 4
src/components/Queue/QueuePhoto.vue View File

@@ -25,8 +25,6 @@
</template>

<script>
import normalize from 'normalize-path'

export default {
props: {
photo: {
@@ -47,8 +45,6 @@ export default {
}
}

photoPath = normalize(photoPath)

return {
backgroundImage: `url("${photoPath}")`,
}

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

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

<!-- Boobs -->
<Preference id="preferences-body" v-model="currentValue.body.boobs" label="Boobs" />
<Preference id="preferences-body" v-model="currentValue.body.boobs" label="Boobs" :min="0" />

<!-- Areola -->
<Preference v-model="currentValue.body.areola" label="Areola" :min="0" />

+ 83
- 16
src/components/UI/ProjectUpdate.vue View File

@@ -1,16 +1,29 @@
<template>
<div class="project-update">
<!-- Update available -->
<div
v-if="!updater.update.active"
v-tooltip="'New version'"
class="update__status">
<strong>{{ updater.latest.tag_name }}</strong>
<div v-if="isReady" class="update">
<div class="update__info">
<!-- Logo -->
<figure>
<img :src="info.logo">
</figure>

<h1 class="title">
{{ info.title }} <span v-tooltip="'New version'">{{ updater.latest.tag_name }}</span>
</h1>

<h2 v-if="!updater.update.active" class="subtitle">
{{ info.description }}
</h2>
</div>


<!-- Downloading -->
<div v-if="isDownloading && updater.update.progress >= 0" class="update__status">
Downloading ~ <strong>{{ updater.update.progress }}%</strong> ~ {{ updater.update.written | size }}/{{ updater.update.total | size }} MB.
</div>

<!-- Downloading -->
<div v-else-if="isDownloading" class="update__status">
Downloading ~ <strong>{{ updater.update.progress | progress }}</strong> ~ {{ updater.update.written | size }}/{{ updater.update.total | size }} MB.
Downloading ~ {{ updater.update.written | size }} MB.
</div>

<!-- Installing -->
@@ -19,28 +32,38 @@
</div>

<!-- Download Progress -->
<div v-show="isDownloading" class="update__progressbar">
<div v-if="isDownloading && updater.update.progress >= 0" class="update__progressbar">
<progress min="0" max="100" :value="updater.update.progress" />
</div>

<!-- Actions -->
<div class="update__actions">
<button v-show="!updater.update.active" class="button button--success" @click.prevent="updater.start()">
Start
Update
</button>

<button v-show="updater.update.active" class="button button--danger" @click.prevent="updater.cancel()">
Cancel
</button>
</div>

<!-- Project buttons -->
<div class="update__actions__extra">
<a v-for="(item, index) in info.navigation" :key="index" :href="item.href" target="_blank" class="button button--sm">{{ item.label }}</a>

<button v-tooltip="'Show a list of links to download the update manually.'" class="button button--info" @click.prevent="$refs.mirrorsDialog.show()">
<button v-tooltip="'Show a list of links to download the update manually.'" class="button button--info button--sm" @click.prevent="$refs.mirrorsDialog.show()">
Mirrors
</button>
</div>

<!-- Hint -->
<div class="update__hint">
<p><a href="https://time.dreamnet.tech/docs/guide/updater" target="_blank">More information and troubleshooting</a>.</p>
<p>
<a href="https://time.dreamnet.tech/docs/guide/updater" target="_blank">
<font-awesome-icon icon="exclamation-circle" />
Troubleshooting
</a>
</p>
</div>

<!-- Mirrors Dialog -->
@@ -64,6 +87,7 @@

<script>
import { toNumber } from 'lodash'
import { dreamtrack } from '~/modules/services'
import * as providers from '~/modules/updater'

export default {
@@ -92,9 +116,14 @@ export default {

data: () => ({
updater: null,
info: null,
}),

computed: {
isReady() {
return this.updater && this.info
},

currentVersion() {
return this.updater?.currentVersion || 'v0.0.0'
},
@@ -111,6 +140,8 @@ export default {
created() {
// eslint-disable-next-line import/namespace
this.updater = providers[this.project]

this.info = dreamtrack.get(['projects', this.project, 'about'], {})
},

beforeDestroy() {
@@ -120,16 +151,42 @@ export default {
</script>

<style lang="scss" scoped>
.project-update {
.update {
@apply flex flex-col items-center justify-center;
}

.update__info {
@apply text-center mb-6;

figure {
@apply mb-4 text-6xl;

img {
@apply inline-block;
height: 100px;
}
}

.title {
@apply text-2xl text-white font-semibold;

span {
@apply text-primary-500 font-bold;
cursor: help;
}
}

.subtitle {
@apply text-lg;
}
}

.update__status {
@apply mb-6 text-2xl text-white;
@apply mb-4 text-lg;
}

.update__progressbar {
@apply mb-6;
@apply mb-4;
width: 80%;

progress {
@@ -150,7 +207,7 @@ export default {
}

.update__actions {
@apply mb-6 text-sm;
@apply mb-4;

.button {
&:not(:last-child) {
@@ -159,6 +216,16 @@ export default {
}
}

.update__actions__extra {
@apply mb-6;

.button {
&:not(:last-child) {
@apply mr-2;
}
}
}

.update__hint {
@apply text-sm;


+ 3
- 3
src/electron-builder.js View File

@@ -8,7 +8,7 @@ const pkg = require('./package.json')
const windows = {
win: {
target: process.env.BUILD_PORTABLE ? 'zip' : 'nsis',
artifactName: '${productName}-v${version}-windows.${ext}',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-windows-portable.${ext}' : '${productName}-v${version}-windows.${ext}',
extraResources: [
{
from: 'node_modules/regedit/vbs',
@@ -37,7 +37,7 @@ const windows = {
const linux = {
linux: {
target: process.env.BUILD_PORTABLE ? 'zip' : 'snap',
artifactName: '${productName}-v${version}-ubuntu.${ext}',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-ubuntu-portable.${ext}' : '${productName}-v${version}-ubuntu.${ext}',
executableName: process.env.npm_package_name,
synopsis: pkg.description,
category: 'Graphics',
@@ -56,7 +56,7 @@ const linux = {
const macos = {
mac: {
target: process.env.BUILD_PORTABLE ? 'zip' : 'dmg',
artifactName: '${productName}-v${version}-macos.${ext}',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-macos-portable.${ext}' : '${productName}-v${version}-macos.${ext}',
darkModeSupport: true,
category: 'public.app-category.graphics-design',
minimumSystemVersion: '10.15.0',

+ 19
- 53
src/electron/src/index.js View File

@@ -14,10 +14,8 @@ import Logger from '@dreamnet/logplease'
import fs from 'fs-extra'
import { AppError } from './modules/app-error'
import { system } from './modules/tools/system'
import {
getPath, getModelsPath, getMasksPath, getAppPath,
} from './modules/tools/paths'
import { settings, ngrok } from './modules'
import { getPath, getAppPath } from './modules/tools/paths'
import { settings } from './modules'
import config from '~/nuxt.config'

const logger = Logger.create('electron')
@@ -50,9 +48,8 @@ class DreamApp {
})

logger.info('Booting...')

logger.debug(`Enviroment: ${process.env.NODE_ENV}`)
logger.debug(`Portable: ${process.env.BUILD_PORTABLE}`)
logger.debug(`Portable: ${process.env.BUILD_PORTABLE ? 'Yes' : 'No'}`)
logger.debug(`App Path: ${app.getAppPath()}`)
logger.debug(`Exe Path: ${app.getPath('exe')}`)

@@ -89,6 +86,8 @@ class DreamApp {
logger.debug('Hardware Acceleration disabled.')
app.disableHardwareAcceleration()
}

app.allowRendererProcessReuse = true
}

/**
@@ -201,33 +200,18 @@ class DreamApp {
showSaveImageAs: true,
})

// system stats.
// System setup.
await system.setup()

// user settings.
await settings.setup()

//
this.createDirs()

/*
if (process.env.NODE_ENV === 'development') {
const address = await ngrok.connect()
logger.debug(`Proxy for debugging: ${address}`)
}
*/
}

/**
*
*/
// eslint-disable-next-line no-empty-function
static async shutdown() {
logger.debug('Shutting down services...')

if (process.env.NODE_ENV === 'development') {
await ngrok.disconnect()
}
}

/**
@@ -247,7 +231,7 @@ class DreamApp {
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true,
webSecurity: false, // Necessary to load local photos and not put them in memory.
webSecurity: false, // Necessary to load filesystem photos.
preload: resolve(app.getAppPath(), 'electron', 'dist', 'provider.js'),
},
})
@@ -260,12 +244,12 @@ class DreamApp {
this.window.setMenu(null)

// ui location
this.uiUrl = this.getUiUrl()
this.interfaceURL = this.getInterfaceURL()

if (config.dev) {
this.pollUi()
this.loadServer()
} else {
this.window.loadFile(this.uiUrl)
this.window.loadFile(this.interfaceURL)
}

if (process.env.DEVTOOLS) {
@@ -277,24 +261,24 @@ class DreamApp {
/**
* Wait until the NuxtJS server is ready.
*/
static pollUi() {
logger.debug(`Requesting server (${this.uiUrl})...`)
static loadServer() {
logger.debug(`Requesting server (${this.interfaceURL})...`)

const http = require('http')

http
.get(this.uiUrl, (response) => {
.get(this.interfaceURL, (response) => {
if (response.statusCode === 200) {
logger.debug('Server ready, dream time!')
this.window.loadURL(this.uiUrl)
logger.debug('Server ready!')
this.window.loadURL(this.interfaceURL)
} else {
logger.warn(`Server reported: ${response.statusCode}`)
setTimeout(this.pollUi.bind(this), 300)
setTimeout(this.loadServer.bind(this), 300)
}
})
.on('error', (error) => {
logger.warn('Server error', error)
setTimeout(this.pollUi.bind(this), 300)
setTimeout(this.loadServer.bind(this), 300)
})
}

@@ -303,38 +287,20 @@ class DreamApp {
*
* @return {string}
*/
static getUiUrl() {
static getInterfaceURL() {
if (!config.dev) {
return resolve(config.rootDir, 'dist', 'index.html')
}

return `http://localhost:${config.server.port}`
}

/**
* Create required directories.
*/
static createDirs() {
const dirs = [
getModelsPath('Uncategorized'),
getMasksPath(),
]

dirs.forEach((dir) => {
try {
fs.ensureDirSync(dir)
} catch (error) {
throw new AppError(`Could not create the directory:\n${dir}`, { error })
}
})
}
}

app.on('ready', async () => {
try {
await DreamApp.start()
} catch (error) {
throw new AppError(error, { title: `Failed to start correctly.`, level: 'error' })
throw new AppError(error, { title: `DreamTime failed to start.`, level: 'error' })
}
})


+ 21
- 4
src/electron/src/modules/settings.js View File

@@ -33,6 +33,12 @@ class Settings {
*/
_default = {}

/**
*
*
*/
isSaving = false

/**
* file where to save the payload.
*
@@ -56,7 +62,7 @@ class Settings {

try {
this.payload = fs.readJsonSync(this.path)
logger.debug('Settings:', this.payload)
logger.debug('Settings loaded!')
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
@@ -68,8 +74,19 @@ class Settings {
* This function is called automatically.
*/
async save() {
fs.writeJsonSync(this.path, this.payload, { spaces: 2 })
logger.debug('Settings saved!')
if (this.isSaving) {
return
}

try {
this.isSaving = true
fs.writeJsonSync(this.path, this.payload, { spaces: 2 })
logger.debug('Settings saved!')
} catch (error) {
logger.warn('An error occurred while saving the settings.', error)
} finally {
this.isSaving = false
}
}

/**
@@ -115,7 +132,7 @@ class Settings {
* Load the default configuration (and the current version)
*/
_loadDefault() {
const uuid = require('uuid')
const { v4: uuid } = require('uuid')
const hasGPU = process.platform === 'darwin' ? false : system.graphics.length > 0
const cores = round(system.cpu?.cores / 2) || 1


+ 53
- 7
src/electron/src/modules/tools/system.js View File

@@ -10,9 +10,12 @@
import {
filter, isNil,
} from 'lodash'
import fs from 'fs-extra'
import si from 'systeminformation'
import isOnline from 'is-online'
import { settings } from '../settings'
import { AppError } from '../app-error'
import { getModelsPath, getMasksPath } from './paths'


const logger = require('@dreamnet/logplease').create('system')
@@ -28,6 +31,17 @@ class System {
*/
_graphics

/**
* @type {Array}
*/
get graphics() {
if (isNil(this._graphics)) {
return []
}

return filter(this._graphics.controllers, { vendor: 'NVIDIA' })
}

/**
* @type {si.Systeminformation.CpuData}
*/
@@ -56,10 +70,34 @@ class System {
*/
online


/**
*
*
* @readonly
*/
get hasToCollect() {
return !fs.existsSync(settings.path)
}

/**
*
*/
async setup() {
if (this.hasToCollect) {
await this.collect()
} else {
this.collect()
}

this.createRequiredFolders()
}

/**
*
*
*/
async collect() {
logger.debug('Collecting system information...')

const [
@@ -119,14 +157,22 @@ class System {
}

/**
* @type {Array}
*
*
*/
get graphics() {
if (isNil(this._graphics)) {
return []
}

return filter(this._graphics.controllers, { vendor: 'NVIDIA' })
async createRequiredFolders() {
const dirs = [
getModelsPath('Uncategorized'),
getMasksPath(),
]

dirs.forEach((dir) => {
try {
fs.ensureDirSync(dir)
} catch (error) {
throw new AppError(`Could not create the directory:\n${dir}`, { error })
}
})
}
}


+ 31
- 19
src/modules/config/cli-errors.json View File

@@ -1,7 +1,7 @@
[
{
"query": "Found no NVIDIA driver",
"message": "Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and the latest drivers installed."
"message": "Found no NVIDIA driver on your system: Please check that you have an NVIDIA GPU and the latest drivers installed."
},
{
"query": "The NVIDIA driver on your system is too old",
@@ -13,15 +13,19 @@
},
{
"query": "Buy new RAM!",
"message": "You have run out of RAM on your system! Try a photo of smaller size or close all the programs you can."
"message": "You have run out of RAM on your system! Please install more RAM on your system before using DreamTime."
},
{
"query": "Stopped to avoid memory problems",
"message": "You have run out of RAM on your system! Try a photo of smaller size or close all the programs you can."
"message": "You have run out of RAM on your system! Please install more RAM on your system before using DreamTime."
},
{
"query": "enforce fail at CPUAllocator",
"message": "You have run out of RAM on your system! Please install more RAM on your system before using DreamTime."
},
{
"query": "CUDA out of memory",
"message": "You have run out of VRAM on your GPU! Try a photo of smaller size or close all the programs you can."
"message": "You have run out of VRAM on your GPU! Make sure there are no other programs using your GPU or purchase a GPU with more memory before using DreamTime."
},
{
"query": "codec can't decode byte",
@@ -37,15 +41,15 @@
},
{
"query": "Image is not 512 x 512",
"message": "Your photo needs to be 512x512 to be nudified. Please resize the photo with any of the DreamTime options or manually before uploading."
"message": "Your photo needs to be 512x512 to be nudified. Please use the 'Scale method' option or resize manually before uploading."
},
{
"query": "loading Python",
"message": "There was a problem loading the algorithm. Please reinstall DreamPower or make sure your operating system has the latest updates."
"message": "Algorithm error: Please reinstall DreamPower or make sure your operating system has the latest updates."
},
{
"query": "DLL",
"message": "There was a problem loading the algorithm. Please reinstall DreamPower or make sure your operating system has the latest updates."
"message": "Algorithm error: Please reinstall DreamPower or make sure your operating system has the latest updates."
},
{
"query": "file is not valid image",
@@ -77,50 +81,58 @@
},
{
"query": "float division by zero",
"message": "There was a problem cropping the photo. Please make sure you position the cropper correctly."
"message": "Crop error: Please make sure you position the cropper correctly."
},
{
"query": "could not broadcast input array from shape",
"message": "Overlay error: Please make sure you position the overlay correctly."
},
{
"query": "CUDA error",
"message": "Your GPU has reported a problem. Please make sure you have the latest drivers installed or reinstall it to fix any errors."
"message": "GPU error: Please make sure you have the latest drivers installed or reinstall."
},
{
"query": "Python was not found",
"message": "There was a problem with DreamPower. Python is not installed on the system. Please disable the Use Python option if you are not using the algorithm source code."
"message": "DreamPower error: Python is not installed on the system. Please disable the 'Use Python' option if you are not using the algorithm source code."
},
{
"query": "No module named",
"message": "There was a problem with DreamPower. If you are using the algorithm source code please make sure you have installed the necessary modules, if you are not using the source code please disable the Use Python option or update your operating system."
"message": "DreamPower error: If you are using the algorithm source code please make sure you have installed the necessary modules or disable the 'Use Python' option or update your operating system."
},
{
"query": "can't open file 'main.py'",
"message": "There was a problem with DreamPower. If you are using the algorithm source code please make sure you have cloned the repository correctly or have configured the correct location, if you are not using the source code please disable the Use Python option."
"message": "DreamPower error: If you are using the algorithm source code please make sure you have cloned and configured the repository correctly, if you are not using the source code please disable the 'Use Python' option."
},
{
"query": "invalid choice",
"message": "There was a problem with DreamPower. The installed version of DreamPower is not compatible with this version of DreamTime, please update the component."
"message": "DreamPower error: The installed version of DreamPower is not compatible with this version of DreamTime, please update."
},
{
"query": "unrecognized arguments",
"message": "There was a problem with DreamPower. The installed version of DreamPower is not compatible with this version of DreamTime, please update the component."
"message": "DreamPower error: The installed version of DreamPower is not compatible with this version of DreamTime, please update."
},
{
"query": "Checkpoints file not found",
"message": "There was a problem with DreamPower. The checkpoints could not be loaded, if you have changed the location of DreamPower please be sure to restart DreamTime and install the checkpoints."
"message": "DreamPower error: The checkpoints could not be loaded, if you have changed the location of DreamPower please be sure to restart DreamTime."
},
{
"query": "No such file or directory",
"message": "DreamPower error: The checkpoints could not be loaded, if you have changed the location of DreamPower please be sure to restart DreamTime."
},
{
"query": "THCudaCheck FAIL",
"message": "There was a problem with CUDA. This version of DreamPower may not be compatible with your operating system and it may be necessary to compile the project in your environment. Please visit our Chat or Forum for technical support."
"message": "THCudaCheck FAIL: This version of DreamPower may not be compatible with your operating system and it may be necessary to compile the project in your environment. Please visit our Chat or Forum for technical support."
},
{
"query": "CUDNN_STATUS_ALLOC_FAILED",
"message": "There was a problem with CUDA. Apparently there is another program using your GPU, please close that program and try again."
"message": "CUDNN_STATUS_ALLOC_FAILED: You have run out of VRAM on your GPU! Make sure there are no other programs using your GPU or purchase a GPU with more memory before using DreamTime."
},
{
"query": "CUDNN_STATUS_INTERNAL_ERROR",
"message": "There was a problem with CUDA. Please make sure you have the latest drivers installed, that you have available memory and if you have installed CUDA or CUDNN that these are updated and configured."
"message": "CUDNN_STATUS_INTERNAL_ERROR: Please make sure you have the latest drivers installed, that you have available video memory and if you have installed CUDA or CUDNN that these are updated and configured."
},
{
"query": "library load disallowed by system policy",
"message": "There was a problem with DreamPower. Your operating system is configured to prevent the loading of applications that have not been verified by Apple. Please <a href='https://support.apple.com/en-us/HT202491' target='_blank'>click here</a> for information on how to solve this problem."
"message": "Your operating system disallowed the correct loading of the algorithm due to the system policy on third party applications. Please see <a href='https://support.apple.com/en-us/HT202491' target='_blank'>'Safely open apps on your Mac'</a> for information on how to solve this problem."
}
]

+ 13
- 0
src/modules/consola/errors.js View File

@@ -69,6 +69,13 @@ export class Exception extends LogEvent {
}
}

/**
*
*
* @export
* @param {Error} error
* @returns
*/
export function handleError(error) {
if (error instanceof LogEvent) {
consola.log(error.level, ...error.args).show()
@@ -79,6 +86,12 @@ export function handleError(error) {
return true
}

if (error.message.includes('Cannot set property') || error.message.includes('Cannot read property')) {
// This is wrong, but for now these are innocent library errors.
consola.warn(error)
return true
}

consola.error(error)
return true
}

+ 2
- 1
src/modules/file.js View File

@@ -140,7 +140,8 @@ export class File {
this.extension = metadata.ext
this.fullname = `${this.name}${this.extension}`
this.directory = slash(metadata.dir)
this.path = slash(path.join(this.directory, this.fullname))
this.realpath = path.join(this.directory, this.fullname)
this.path = slash(this.realpath)
this.mimetype = metadata.mimetype
this.size = metadata.size
this.exists = metadata.exists

+ 1
- 1
src/modules/services/dreamtrack.js View File

@@ -18,7 +18,7 @@ const { system } = $provider

const consola = Consola.create('dreamtrack')

const CONNECT_TIMEOUT = 1500
const CONNECT_TIMEOUT = 3000
const SNAPSHOT_TIMEOUT = 3000

/**

+ 1
- 1
src/modules/system/requirements.js View File

@@ -86,7 +86,7 @@ export const requirements = {
this.windows.media = await this._hasWindowsMedia()

// ram
this.recommended.ram = system.memory.total >= 8589934592 // 8 GB
this.recommended.ram = system.memory.total >= 12884901888 // 12 GB
this.recommended.vram = system.graphics[0]?.vram >= 4000 // Win32_VideoController does not scan VRAM above 4GB

// Folders

+ 9
- 4
src/modules/updater/base.js View File

@@ -9,7 +9,7 @@

import {
isNil, isArray, isPlainObject, find,
startsWith, filter, isEmpty,
startsWith, filter, isEmpty, toNumber,
} from 'lodash'
import axios from 'axios'
import compareVersions from 'compare-versions'
@@ -164,7 +164,7 @@ export class BaseUpdater {
return filename
}

return null
throw new Error('The file name could not be obtained!')
}

/**
@@ -266,7 +266,7 @@ export class BaseUpdater {
try {
urls = dreamtrack.get(['projects', this.name, 'releases', this.latestVersion, 'urls'])
} catch (err) {
// not the best way, but it works
// not the best way, but works
urls = []
}

@@ -438,7 +438,12 @@ export class BaseUpdater {
})

this.downloadEvents.on('progress', (payload) => {
this.update.progress = (payload.progress * 100).toFixed(2)
if (payload.total > 0) {
this.update.progress = toNumber(payload.progress * 100).toFixed(2)
} else {
this.update.progress = -1
}

this.update.total = payload.total
this.update.written = payload.written
})

+ 29
- 7
src/modules/updater/dreamtime.js View File

@@ -11,6 +11,7 @@ import { dirname } from 'path'
import delay from 'delay'
import { exec } from 'child_process'
import { BaseUpdater } from './base'
import dream from '../dream'

const { activeWindow } = $provider.util
const { shell, app, Notification } = $provider.api
@@ -30,21 +31,42 @@ class DreamTimeUpdater extends BaseUpdater {
return `v${process.env.npm_package_version}`
}

/**
* @type {string}
*/
get platform() {
let platform = super.platform

if (dream.isPortable) {
platform = `${platform}-portable`
}

return platform
}

/**
*
* @param {string} filepath
*/
async install(filepath) {
try {
exec(filepath)
if (!dream.isPortable) {
try {
exec(filepath)

await delay(1000)

await delay(1000)
// Quit to update
app.quit()
} catch (error) {
shell.openItem(dirname(filepath))
throw error
}
} else {
if (!shell.openItem(filepath)) {
shell.openItem(dirname(filepath))
}

// Quit to update
app.quit()
} catch (error) {
shell.openItem(dirname(filepath))
throw error
}
}


+ 44
- 170
src/nuxt.config.js View File

@@ -28,81 +28,23 @@ module.exports = {
** Headers of the page
*/
head: {
title: process.env.npm_package_displayName,
title: process.env.npm_package_displayName || 'DreamTime',

meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
// { 'http-equiv': 'Content-Security-Policy', content: 'default-src \'self\'; script-src \'self\' \'unsafe-inline\' https://cdn.logrocket.io https://cdn.lr-ingest.io; worker-src \'self\' \'unsafe-inline\' data: blob:; object-src \'none\'; style-src \'self\' \'unsafe-inline\' https://fonts.googleapis.com; img-src \'self\' data:; media-src \'self\' data:; frame-src \'self\' https://*.dreamnet.tech; font-src *; connect-src \'self\' http://localhost:* https://*.dreamnet.tech wss://app.nucleus.sh https://nucleus.sh https://*.logrocket.io https://r.lr-ingest.io https://*.github.com' },
],

link: [
{
rel: 'preload', href: 'https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500,700|Roboto+Slab:300,400,500,600,700', as: 'style', onload: 'this.rel = \'stylesheet\'',
rel: 'preload',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Roboto+Slab:wght@300;400;500;600&display=swap',
as: 'style',
onload: 'this.rel = \'stylesheet\'',
},
],
},

/**
*
*/
render: {
csp: {
hashAlgorithm: 'sha256',
policies: {
'default-src': [
'self',
],
'script-src': [
'self',
'unsafe-inline',
'https://cdn.logrocket.io',
'https://cdn.lr-ingest.io',
],
'worker-src': [
'self',
'unsafe-inline',
'data:',
'blob:',
],
'object-src': [
'none',
],
'style-src': [
'self',
'unsafe-inline',
'https://fonts.googleapis.com',
],
'img-src': [
'self',
'data:',
],
'media-src': [
'self',
'data:',
],
'frame-src': [
'self',
'https://*.dreamnet.tech',
],
'font-src': [
'*',
],
'connect-src': [
'self',
'http://localhost:*',
'https://*.dreamnet.tech',
'wss://app.nucleus.sh',
'https://nucleus.sh',
'https://*.logrocket.io',
'https://r.lr-ingest.io',
'https://*.github.com',
],
},
addMeta: true,
},
},

/*
** Customize the progress-bar color
*/
@@ -148,9 +90,7 @@ module.exports = {
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/Developmint/nuxt-purgecss
'nuxt-purgecss',
// '@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/nuxt-tailwindcss
'@nuxtjs/tailwindcss',
],
@@ -167,29 +107,6 @@ module.exports = {
cssPath: '~/assets/css/tailwind.scss',
},

/**
*
*/
purgeCSS: {
enabled: uglify,
mode: 'postcss',

paths: [
'components/**/*.vue',
'layouts/**/*.vue',
'pages/**/*.vue',
'plugins/**/*.js',
'modules/**/*.js',
'assets/css/**/*.scss',
],

whitelistPatterns: [
/(tippy|vue-slider|cropper|tui|color-picker|swal2|introjs|nuxt)/,
/(text|top|bottom|editor|only|fixed|filter|apply|tie|triangle)/,
/(body|html|pre|svg)/,
],
},

/**
*
*/
@@ -236,29 +153,27 @@ module.exports = {
*/
extractCSS: false,

/**
*
*/
publicPath: '/assets/',

/**
* Customize options of Nuxt.js integrated webpack loaders.
* https://nuxtjs.org/api/configuration-build#loaders
*/
loaders: {
imgUrl: {
limit: 10 * 1000,
},
},

/**
* Customize Babel configuration for JavaScript and Vue files.
*/
babel: {
sourceType: 'unambiguous',

presets: [
[
'@babel/preset-env',
{
debug: false,
targets: {
chrome: '78',
},
modules: false,
useBuiltIns: 'usage',
corejs: {
version: 3,
},
},
],
],

plugins: [
'lodash',
'@babel/plugin-proposal-class-properties',
@@ -274,67 +189,22 @@ module.exports = {
},
],
],
},

/**
* Customize options of Nuxt.js integrated webpack loaders.
* https://nuxtjs.org/api/configuration-build#loaders
*/
loaders: {
scss: dev ? {
implementation: require('sass'),
} : {},

vue: {
prettify: false,
},

imgUrl: {
limit: 10 * 1000,
},
},

/**
* Webpack Optimization.
* https://nuxtjs.org/api/configuration-build#optimization
*/
optimization: {
splitChunks: {
name: false,
automaticNameMaxLength: 30,
maxSize: 500 * 1000,

cacheGroups: {
// Disable the built-in cacheGroups.
default: false,

commons: {
name: 'commons',
priority: 10,
test: /node_modules[\\/](vue|vue-loader|vue-router|vuex|vue-meta|core-js|@babel\/runtime|axios|webpack|setimmediate|timers-browserify|process|regenerator-runtime|cookie|js-cookie|is-buffer|dotprop|nuxt\.js)[\\/]/,
chunks: 'all',
},

vendors: {
name: 'vendors',
test: /node_modules[\\/]/,
priority: 20,
chunks: 'all',
},

modules: {
name: 'modules',
test: /(modules|workers|mixins|)[\\/]/,
priority: 30,
chunks: 'all',
},
},
},
},

postcss: {
plugins: {
tailwindcss: './tailwind.config.js',
presets({ envName }) {
const envTargets = {
client: { chrome: '83' },
server: { node: 'current' },
}

return [
[
'@nuxt/babel-preset-app',
{
targets: envTargets[envName],
corejs: { version: 3 },
},
],
]
},
},

@@ -342,14 +212,19 @@ module.exports = {
** You can extend webpack config here.
*/
extend(config, { isDev }) {
//
config.target = 'electron-renderer'

//
config.output.publicPath = './assets/'

// Don't throw warning when asset created is over 250kb
config.performance.hints = false

// Disable handling of requires with a single expression.
config.module.exprContextCritical = false

//
config.module.rules.push({
test: /\.worker\.js$/,
use: {
@@ -361,6 +236,7 @@ module.exports = {
exclude: /(node_modules)/,
})

//
config.module.rules.push({
test: /\.(ogg|mp3|wav|mpe?g)$/i,
use: {
@@ -371,10 +247,8 @@ module.exports = {
},
})

config.devtool = 'source-map'

if (!isDev) {
config.output.publicPath = './_nuxt/'
if (isDev) {
config.devtool = 'source-map'
}
},
},

+ 95
- 84
src/package.json View File

@@ -1,160 +1,171 @@
{
"name": "dreamtime",
"private": true,
"displayName": "DreamTime",
"description": "An open-source and super-improved version of DeepNude.",
"author": "DreamNet",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.4.5",
"homepage": "https://time.dreamnet.tech",
"version": "1.4.4",
"main": "electron/dist/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"
},
"scripts": {
"postinstall": "patch-package",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
"test": "env-cmd -e default,test mocha",
"clean": "shx rm -rf .nuxt/ dist/ electron/dist/",
"optimize": "modclean --patterns default:safe --run",
"deploy": "node scripts/deploy.js",
"development": "env-cmd -e default,development --no-override",
"production": "env-cmd -e default,production --no-override",
"start:nuxt": "yarn development nuxt",
"start:babel": "yarn development babel electron/src --out-dir electron/dist --source-maps --watch --verbose",
"start:electron": "yarn development electron .",
"start:electron": "yarn development electron . --allow-file-access-from-files",
"build:nuxt": "yarn production nuxt build",
"build:babel": "yarn production babel electron/src --out-dir electron/dist --minified",
"build:electron": "yarn production electron-builder --publish=never --x64",
"build": "yarn build:nuxt && yarn build:babel && modclean --patterns default:safe --run && yarn build:electron",
"build:dev": "yarn run clean && yarn run build:nuxt && yarn run build:babel && yarn run build:electron",
"build": "yarn run clean && yarn run build:nuxt && yarn run build:babel && yarn run optimize && yarn run build:electron",
"preview:electron": "env-cmd -e default,production,preview --no-override electron .",
"preview:production": "yarn build:nuxt && yarn build:babel && yarn preview:electron"
},
"lint-staged": {
"*.{js,vue}": "eslint"
"*.{js,vue}": "eslint --fix"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"engines": {
"node": ">=10.0.0"
},
"os": [
"win32",
"darwin",
"linux"
],
"cpu": [
"x64"
],
"dependencies": {
"7zip-bin": "^5.0.3",
"@adonisjs/websocket-client": "^1.0.9",
"@dreamnet/logplease": "^1.0.0",
"@dreamnet/queue": "^0.1.2",
"@fortawesome/fontawesome-svg-core": "^1.2.27",
"@fortawesome/free-brands-svg-icons": "^5.12.1",
"@fortawesome/free-regular-svg-icons": "^5.12.1",
"@fortawesome/free-solid-svg-icons": "^5.12.1",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-brands-svg-icons": "^5.13.0",
"@fortawesome/free-regular-svg-icons": "^5.13.0",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/vue-fontawesome": "^0.1.9",
"@sweetalert2/theme-dark": "^3.1.0",
"@sweetalert2/theme-dark": "^3.1.4",
"axios": "^0.19.2",
"combokeys": "^3.0.1",
"compare-versions": "^3.6.0",
"cropperjs": "^1.5.6",
"cryptr": "^6.0.1",
"dayjs": "^1.8.20",
"cryptr": "^6.0.2",
"dayjs": "^1.8.27",
"deferred": "^0.7.11",
"delay": "^4.3.0",
"electron-context-menu": "^0.16.0",
"electron-util": "^0.14.0",
"electron-context-menu": "^2.0.1",
"electron-util": "^0.14.1",
"emoji-strip": "^1.0.1",
"fabric": "^3.6.2",
"filesize": "^6.0.1",
"fabric": "^3.6.3",
"filesize": "^6.1.0",
"form-data": "^3.0.0",
"fs-extra": "^8.1.0",
"fs-extra": "^9.0.0",
"he": "^1.2.0",
"instagram-save": "^1.3.2",
"intro.js": "^2.9.3",
"is-online": "^8.2.1",
"js-event-bus": "^1.0.0",
"is-online": "^8.3.1",
"js-event-bus": "^1.0.3",
"lodash": "^4.17.15",
"logrocket": "^1.0.6",
"md5-file": "^4.0.0",
"logrocket": "^1.0.7",
"md5-file": "^5.0.0",
"melanke-watchjs": "^1.5.2",
"mime-types": "^2.1.26",
"mime-types": "^2.1.27",
"node-7z": "^2.1.1",
"normalize-path": "^3.0.0",
"nuxt": "^2.11.0",
"patch-package": "^6.2.0",
"popmotion": "^8.7.1",
"postinstall-postinstall": "^2.0.0",
"nuxt": "^2.12.2",
"patch-package": "^6.2.2",
"popmotion": "^8.7.3",
"postinstall-postinstall": "^2.1.0",
"promise-worker": "^2.0.1",
"regedit": "^3.0.3",
"rollbar": "^2.14.4",
"rollbar": "^2.16.2",
"semver-regex": "^3.1.1",
"slash": "^3.0.0",
"sourcemapped-stacktrace": "^1.1.11",
"sweetalert2": "^9.7.2",
"systeminformation": "^4.22.1",
"tippy.js": "^5.2.1",
"sweetalert2": "^9.11.0",
"systeminformation": "^4.26.2",
"tippy.js": "^6.2.3",
"tui-image-editor": "3.8.0",
"unzipper": "^0.10.8",
"uuid": "^3.4.0",
"vue-slider-component": "^3.1.1"
"unzipper": "^0.10.11",
"uuid": "^8.0.0",
"vue-slider-component": "^3.1.3"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-export-default-from": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/plugin-transform-regenerator": "^7.8.3",
"@nuxtjs/eslint-config": "^2.0.2",
"@nuxtjs/eslint-module": "^1.1.0",
"@nuxtjs/tailwindcss": "^1.3.2",
"@octokit/rest": "^16.43.1",
"babel-eslint": "^10.0.3",
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/plugin-transform-regenerator": "^7.8.7",
"@dreamnet/deploy": "^0.1.0",
"@nuxtjs/eslint-config": "^3.0.0",
"@nuxtjs/eslint-module": "^2.0.0",
"@nuxtjs/tailwindcss": "^2.0.0",
"@octokit/rest": "^17.9.2",
"babel-eslint": "^10.1.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-watch": "^7.0.0",
"cross-env": "^7.0.0",
"electron": "^8.0.1",
"electron-builder": "^22.3.2",
"electron-devtools-installer": "^2.2.4",
"cross-env": "^7.0.2",
"electron": "8.3.0",
"electron-builder": "^22.6.1",
"electron-devtools-installer": "^3.0.0",
"env-cmd": "^10.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-standard": ">=14.1.0",
"eslint": "^7.0.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-standard": ">=14.1.1",
"eslint-import-resolver-node": "^0.3.3",
"eslint-import-resolver-nuxt": "^1.0.0",
"eslint-import-resolver-nuxt": "^1.0.1",
"eslint-import-resolver-webpack": "^0.12.1",
"eslint-plugin-import": ">=2.20.1",
"eslint-plugin-jest": ">=23.7.0",
"eslint-plugin-lodash": "^6.0.0",
"eslint-plugin-mocha": "^6.2.2",
"eslint-plugin-node": ">=11.0.0",
"eslint-plugin-nuxt": ">=0.5.1",
"eslint-plugin-import": ">=2.20.2",
"eslint-plugin-jest": ">=23.13.1",
"eslint-plugin-lodash": "^7.1.0",
"eslint-plugin-mocha": "^7.0.0",
"eslint-plugin-node": ">=11.1.0",
"eslint-plugin-nuxt": ">=1.0.0",
"eslint-plugin-promise": ">=4.2.1",
"eslint-plugin-standard": ">=4.0.1",
"eslint-plugin-vue": "^6.2.1",
"fibers": "^4.0.2",
"flow-bin": "^0.118.0",
"husky": "^4.2.3",
"lint-staged": "^10.0.7",
"mocha": "^7.0.1",
"eslint-plugin-vue": "^6.2.2",
"fibers": "^5.0.0",
"flow-bin": "^0.125.1",
"husky": "^4.2.5",
"lint-staged": "^10.2.4",
"mocha": "^7.1.2",
"modclean": "^3.0.0-beta.1",
"ndjson-parse": "^1.0.4",
"ngrok": "^3.2.7",
"sass": "^1.25.0",
"sass-loader": "^8.0.2",
"spectron": "^10.0.1",
"tailwindcss": "^1.2.0",
"shx": "^0.3.2",
"spectron": "^11.0.0",
"tailwindcss": "^1.4.6",
"tailwindcss-alpha": "hacknug/tailwindcss-alpha#feature/tests",
"worker-loader": "^2.0.0"
}
},
"author": {
"name": "DreamNet",
"email": "ivan@dreamnet.tech",
"url": "https://github.com/dreamnettech/dreamtime/graphs/contributors"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dreamnettech/dreamtime.git"
},
"bugs": {
"email": "ivan@dreamnet.tech",
"url": "https://github.com/dreamnettech/dreamtime/issues"
},
"engines": {
"node": ">=10.0.0"
},
"os": [
"win32",
"darwin",
"linux"
],
"cpu": [
"x64"
]
}

+ 4
- 6
src/package.min.json View File

@@ -1,11 +1,9 @@
{
"name": "dreamtime",
"private": true,
"displayName": "DreamTime",
"description": "An open-source and super-improved version of DeepNude.",
"author": "DreamNet",
"homepage": "https://time.dreamnet.tech",
"version": "1.4.4",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.4.5",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only",
"private": true
"license": "GPL-3.0-only"
}

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

@@ -27,7 +27,7 @@
<!-- RAM -->
<div v-if="!requirements.recommended.ram" class="notification notification--warning">
<span class="icon"><font-awesome-icon icon="exclamation-triangle" /></span>
<span>Your system has less than <strong>8 GB</strong> of RAM. Please buy more RAM!</span>
<span>Your system has less than <strong>12 GB</strong> of RAM. Please buy more RAM!</span>
</div>
<div v-else class="notification notification--success">
<span class="icon"><font-awesome-icon icon="check-circle" /></span>

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

@@ -6,17 +6,17 @@

<!-- DreamTime Updater -->
<div v-if="dreamtime.available" class="notification notification--warning cursor-pointer" @click="$router.push('/wizard/dreamtime')">
๐ŸŽ‰ <strong>Update:</strong> {{ $dream.name }} {{ dreamtime.latest.tag_name }} is available for download!
๐ŸŽ‰ <strong>{{ $dream.name }} {{ dreamtime.latest.tag_name }}</strong> is available for download!
</div>

<!-- DreamPower Updater -->
<div v-if="dreampower.available" class="notification notification--warning cursor-pointer" @click="$router.push('/wizard/power')">
๐ŸŽ‰ <strong>Update:</strong> {{ dreampower.displayName }} {{ dreampower.latest.tag_name }} is available for download!
๐ŸŽ‰ <strong>{{ dreampower.displayName }} {{ dreampower.latest.tag_name }}</strong> is available for download!
</div>

<!-- Checkpoints Updater -->
<div v-if="checkpoints.available" class="notification notification--warning cursor-pointer" @click="$router.push('/wizard/checkpoints')">
๐ŸŽ‰ <strong>Update:</strong> {{ checkpoints.displayName }} {{ checkpoints.latest.tag_name }} is available for download!
๐ŸŽ‰ <strong>{{ checkpoints.displayName }} {{ checkpoints.latest.tag_name }}</strong> is available for download!
</div>

<!-- Quick Upload -->

+ 30
- 26
src/pages/nudify/_id/crop.vue View File

@@ -1,18 +1,14 @@
<template>
<div class="nudify-cropper">
<div class="cropper__crop">
<canvas ref="cropCanvas" data-private />
</div>

<div class="cropper__help">
<button
id="cropper-reload"
v-tooltip="'Get recent changes from the editor.'"
class="button"