Browse Source

Router, notification and "cancelled" fixes. Improvements for bigger screens.

tags/v1.4.4
Ivan Bravo Bravo 9 months ago
parent
commit
8741e64ec2

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

@@ -9,27 +9,16 @@
* Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.
*/

.placeholder-container {
@apply h-screen flex flex-col justify-center;

.container-body {
@apply flex-1;
}

.container-footer {
@apply flex justify-center items-center border-t border-gray-300;
min-height: 80px;

.button {
@apply mx-4;
}
}
}

.content-body {
.content-body,
.content__body {
@apply p-6;
}

.content__body {
@apply p-6;
}

.wrapper {
@apply ml-auto mr-auto;
max-width: 1920px;
}

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

@@ -232,7 +232,7 @@ export default {
@apply bg-cover bg-center border border-dark-500;
@apply relative;
background-image: url('~@/assets/images/background.png');
height: 512px;
min-height: 512px;

&:hover {
.run__content,

+ 2
- 2
src/modules/nudify/nudify.js View File

@@ -162,14 +162,14 @@ export class Nudify {
}

if (params.isMaskfin) {
window.$router.push(`/nudify/${photo.id}/editor`)
window.$redirect(`/nudify/${photo.id}/editor`)
} else {
const { uploadMode } = settings.app

if (uploadMode === 'add-queue') {
this.addToQueue(photo)
} else if (uploadMode === 'go-preferences') {
window.$router.push(`/nudify/${photo.id}/preferences`)
window.$redirect(`/nudify/${photo.id}/preferences`)
}
}
}

+ 17
- 17
src/modules/nudify/photo-run.js View File

@@ -17,8 +17,9 @@ import cliErrors from '../config/cli-errors'
import preferencesConfig from '../config/preferences'
import { settings, achievements } from '../system'

const { getCurrentWindow } = require('electron').remote

const { transform } = $provider.power
const { activeWindow } = $provider.util
const { getMasksPath } = $provider.paths

export class PhotoRun {
@@ -312,29 +313,28 @@ export class PhotoRun {
}

_sendNotification() {
const window = activeWindow()

if (!isNil(window) && window.isFocused()) {
return
}

if (!settings.notifications.run) {
return
}

// eslint-disable-next-line no-new
new Notification(`📷 ${this.file.fullname} - Run ${this.id} has finished.`)

/*
notification.onclick = () => {
const window = activeWindow()
try {
const browserWindow = getCurrentWindow()

if (!isNil(window)) {
window.focus()
if (isNil(browserWindow) || !browserWindow.isMinimized()) {
return
}

window.$router.push(`/nudify/${this.photo.id}/results`)
const notification = new Notification(`📷 Run ${this.id} has finished.`, {
icon: this.outputFile.path,
body: 'Hopefully it was a good run.',
})

notification.onclick = () => {
browserWindow.focus()
window.$redirect(`/nudify/${this.photo.id}/results`)
}
} catch (error) {
this.photo.consola.warn('Unable to send a notification.', error).report()
}
*/
}
}

+ 23
- 21
src/modules/nudify/photo.js View File

@@ -8,7 +8,7 @@
// Written by Ivan Bravo Bravo <ivan@dreamnet.tech>, 2019.

import {
cloneDeep, isNil, merge,
cloneDeep, isNil, merge, isError,
} from 'lodash'
import Queue from 'better-queue'
import MemoryStore from 'better-queue-memory'
@@ -20,7 +20,8 @@ import { PhotoRun } from './photo-run'
import { File } from '../file'
import { Timer } from '../timer'

const { activeWindow } = $provider.util
const { getCurrentWindow } = require('electron').remote

const { getModelsPath, getCropPath } = $provider.paths

export class Photo {
@@ -333,7 +334,11 @@ export class Photo {

run.onFail()

handleError(error)
if (isError(error)) {
handleError(error)
} else {
this.consola.warn(`Task failed with unknown error: ${error}`)
}
})
}

@@ -442,31 +447,28 @@ export class Photo {
}

_sendNotification() {
const window = activeWindow()

if (!isNil(window) && window.isFocused()) {
return
}

if (!settings.notifications.allRuns) {
return
}

// eslint-disable-next-line no-new
new Notification(`📷 ${this.file.fullname} has finished.`, {
body: 'The photo has completed the transformation process.',
})

/*
notification.onclick = () => {
const window = activeWindow()
try {
const browserWindow = getCurrentWindow()

if (!isNil(window)) {
window.focus()
if (isNil(browserWindow) || !browserWindow.isMinimized()) {
return
}

window.$router.push(`/nudify/${this.id}/results`)
const notification = new Notification(`💖 Dream fulfilled!`, {
icon: this.file.path,
body: 'All runs have finished.',
})

notification.onclick = () => {
browserWindow.focus()
window.$redirect(`/nudify/${this.id}/results`)
}
} catch (error) {
this.photo.consola.warn('Unable to send a notification.', error).report()
}
*/
}
}

+ 109
- 107
src/pages/about.vue View File

@@ -1,118 +1,120 @@
<template>
<div class="about content__body">
<div v-if="alert" class="notification text-lg" v-html="alert" />

<!-- Offline -->
<section v-if="!$provider.system.online" class="box box--items">
<div class="box__content">
<box-item
description="While in offline mode you will not be able to obtain more information about the project or download the latest updates."
label="Offline mode." />
</div>
</section>
<div class="wrapper">
<div v-if="alert" class="notification text-lg" v-html="alert" />

<div class="about__columns">
<!-- DreamTime -->
<section class="box box--items">
<!-- Offline -->
<section v-if="!$provider.system.online" class="box box--items">
<div class="box__content">
<box-item
:label="$dream.name"
:description="dreamtime.about.description">
<template slot="icon">
<div class="item__icon">
<img src="~/assets/images/apps/dreamtime.png">
</div>
</template>

<button type="button" class="button w-full" @click="openAppPath">
App
</button>
</box-item>

<app-update :project-title="$dream.name" project="dreamtime" href="/wizard/dreamtime" />

<box-item
v-for="(item, index) in dreamtime.about.navigation"
:key="index"
:label="item.label"
:description="item.description"
:icon="item.icon"
:href="item.href"
:version="item.version" />
</div>
</section>

<!-- DreamPower -->
<section class="box box--items">
<div class="box__content">
<box-item
:label="dreampower.about.title"
:description="dreampower.about.description">
<template slot="icon">
<div class="item__icon">
<img src="~/assets/images/apps/dreampower.png">
</div>
</template>

<button type="button" class="button w-full" @click="openPowerPath">
App
</button>
</box-item>

<app-update project-title="DreamPower" project="dreampower" href="/wizard/power" />

<app-update project-title="Checkpoints" project="checkpoints" href="/wizard/checkpoints" />

<box-item
v-for="(item, index) in dreampower.about.navigation"
:key="index"
:label="item.label"
:description="item.description"
:icon="item.icon"
:href="item.href"
:version="item.version" />
description="While in offline mode you will not be able to obtain more information about the project or download the latest updates."
label="Offline mode." />
</div>
</section>

<!-- Supporters -->
<section class="box box--items is-contributors">
<div class="box__content">
<box-item
icon="grin-hearts"
label="Supporters"
description="Wonderful people who have helped us make this possible." />

<box-item
v-for="(item, index) in supporters"
:key="index"
:label="item.name"
:description="item.description"
:icon="item.icon"
:class="item.role" />
</div>
</section>

<!-- Developers -->
<section class="box box--items is-contributors">
<div class="box__content">
<box-item
:icon="['fas', 'code']"
label="Developers"
description="Semi gods who have used their skills to create this incredible project." />

<box-item
v-for="(item, index) in developers"
:key="index"
:label="item.name"
:description="item.description"
:icon="item.icon"
:class="item.role">
<a v-for="(link, lindex) in item.links" :key="`link-${lindex}`" :href="link.href" target="_blank" class="button button--sm mr-2">
{{ link.name }}
</a>
</box-item>
</div>
</section>
<div class="about__columns">
<!-- DreamTime -->
<section class="box box--items">
<div class="box__content">
<box-item
:label="$dream.name"
:description="dreamtime.about.description">
<template slot="icon">
<div class="item__icon">
<img src="~/assets/images/apps/dreamtime.png">
</div>
</template>

<button type="button" class="button w-full" @click="openAppPath">
App
</button>
</box-item>

<app-update :project-title="$dream.name" project="dreamtime" href="/wizard/dreamtime" />

<box-item
v-for="(item, index) in dreamtime.about.navigation"
:key="index"
:label="item.label"
:description="item.description"
:icon="item.icon"
:href="item.href"
:version="item.version" />
</div>
</section>

<!-- DreamPower -->
<section class="box box--items">
<div class="box__content">
<box-item
:label="dreampower.about.title"
:description="dreampower.about.description">
<template slot="icon">
<div class="item__icon">
<img src="~/assets/images/apps/dreampower.png">
</div>
</template>

<button type="button" class="button w-full" @click="openPowerPath">
App
</button>
</box-item>

<app-update project-title="DreamPower" project="dreampower" href="/wizard/power" />

<app-update project-title="Checkpoints" project="checkpoints" href="/wizard/checkpoints" />

<box-item
v-for="(item, index) in dreampower.about.navigation"
:key="index"
:label="item.label"
:description="item.description"
:icon="item.icon"
:href="item.href"
:version="item.version" />
</div>
</section>

<!-- Supporters -->
<section class="box box--items is-contributors">
<div class="box__content">
<box-item
icon="grin-hearts"
label="Supporters"
description="Wonderful people who have helped us make this possible." />

<box-item
v-for="(item, index) in supporters"
:key="index"
:label="item.name"
:description="item.description"
:icon="item.icon"
:class="item.role" />
</div>
</section>

<!-- Developers -->
<section class="box box--items is-contributors">
<div class="box__content">
<box-item
:icon="['fas', 'code']"
label="Developers"
description="Semi gods who have used their skills to create this incredible project." />

<box-item
v-for="(item, index) in developers"
:key="index"
:label="item.name"
:description="item.description"
:icon="item.icon"
:class="item.role">
<a v-for="(link, lindex) in item.links" :key="`link-${lindex}`" :href="link.href" target="_blank" class="button button--sm mr-2">
{{ link.name }}
</a>
</box-item>
</div>
</section>
</div>
</div>
</div>
</template>

+ 21
- 19
src/pages/index.vue View File

@@ -1,25 +1,27 @@
<template>
<div class="home content-body">
<!-- Global alert -->
<div v-if="alert" class="notification" v-html="alert" />

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

<!-- DreamPower Updater -->
<div v-if="dreampower.available" class="notification notification--warning cursor-pointer" @click="$router.push('/wizard/power')">
🎉 {{ dreampower.displayName }} {{ dreampower.latest.tag_name }} is available for download!
<div class="wrapper">
<!-- Global alert -->
<div v-if="alert" class="notification" v-html="alert" />

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

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

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

<!-- Quick Upload -->
<nudify-upload />
</div>

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

<!-- Quick Upload -->
<nudify-upload />
</div>
</template>


+ 1
- 1
src/pages/nudify/_id/preferences.vue View File

@@ -1,5 +1,5 @@
<template>
<div class="nudify-preferences">
<div class="nudify-preferences wrapper">
<settings-preferences v-model="photo.preferences" />
</div>
</template>

+ 4
- 0
src/pages/nudify/_id/results.vue View File

@@ -66,6 +66,10 @@ export default {
@screen xl {
width: calc(1/3*100% - (1 - 1/3)*1rem);
}

@media (min-height: 1280px) {
height: 1024px;
}
}
}
</style>

+ 3
- 1
src/pages/settings.vue View File

@@ -39,7 +39,9 @@
</div>

<div class="settings__content">
<nuxt-child v-model="settings" keep-alive />
<div class="wrapper">
<nuxt-child v-model="settings" keep-alive />
</div>
</div>
</div>
</template>

+ 0
- 1
src/plugins/binds.js View File

@@ -34,5 +34,4 @@ window.Exception = Exception

export default ({ redirect, router }) => {
window.$redirect = redirect
window.$router = router
}

Loading…
Cancel
Save