PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { IListRoutes } from '@src/model'
|
||||
import type { IListRoutes } from '@src/model'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { tools } from '@tools'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { static_data } from '@/db/static_data'
|
||||
import { static_data } from '@src/db/static_data'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import { CMenuItem } from '../../components/CMenuItem'
|
||||
@@ -75,7 +75,7 @@ export default defineComponent({
|
||||
}
|
||||
if (!link)
|
||||
link = elem.path
|
||||
|
||||
|
||||
// console.log('getroute LINK=', link)
|
||||
return link
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
||||
|
||||
import type { INotif } from '@model';
|
||||
import {
|
||||
IChat,
|
||||
IMessage, IMsgUsers, INotif,
|
||||
IMessage, IMsgUsers
|
||||
} from '@model'
|
||||
|
||||
import { date } from 'quasar'
|
||||
@@ -14,14 +15,14 @@ import MixinUsers from '../../../mixins/mixin-users'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CTimeAgo } from '@/components/CTimeAgo'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { CMyCircuits } from '@/components/CMyCircuits'
|
||||
import { CFinder } from '@/components/CFinder'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
||||
import { CMyFieldRec } from '@src/components/CMyFieldRec'
|
||||
import { CTimeAgo } from '@src/components/CTimeAgo'
|
||||
import { CMyFieldDb } from '@src/components/CMyFieldDb'
|
||||
import { CMyCircuits } from '@src/components/CMyCircuits'
|
||||
import { CFinder } from '@src/components/CFinder'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
@@ -101,7 +102,7 @@ export default defineComponent({
|
||||
|
||||
function clickNotif(notif: INotif) {
|
||||
if (notif.openUrl) {
|
||||
let mylink = tools.updateQueryStringParameter(notif.openUrl, 'idnotif', notif._id)
|
||||
const mylink = tools.updateQueryStringParameter(notif.openUrl, 'idnotif', notif._id)
|
||||
console.log('mylink', mylink, notif._id)
|
||||
if (mylink) {
|
||||
$router.replace(mylink)
|
||||
@@ -126,7 +127,7 @@ export default defineComponent({
|
||||
function getlastdataread(username: string): any {
|
||||
// Get msg for this
|
||||
|
||||
let myrec = getlastnotifcoins(username)
|
||||
const myrec = getlastnotifcoins(username)
|
||||
const lastdata: any = (myrec && myrec.lastdataread) ? myrec.lastdataread : tools.getLastDateReadReset()
|
||||
|
||||
let mydate = ''
|
||||
@@ -143,7 +144,7 @@ export default defineComponent({
|
||||
async function refreshdata(username: string) {
|
||||
try {
|
||||
|
||||
if (!!username) {
|
||||
if (username) {
|
||||
notifsel.value.dest = ''
|
||||
// console.log('refreshdata')
|
||||
loading.value = true
|
||||
|
||||
@@ -1,39 +1,77 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-btn flat round dense icon="img: images/1ris_rosso_100.png" class="q-mx-xs" @click="open = !open">
|
||||
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{ num_notifs_unread }}</q-badge>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="img: /images/1ris_rosso_100.png"
|
||||
class="q-mx-xs"
|
||||
@click="open = !open"
|
||||
>
|
||||
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{
|
||||
num_notifs_unread
|
||||
}}</q-badge>
|
||||
</q-btn>
|
||||
<q-btn v-if="false" flat round dense icon="img: images/1ris_rosso_100.png">
|
||||
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{ num_notifs_unread }}</q-badge>
|
||||
<q-btn v-if="false" flat round dense icon="img: /images/1ris_rosso_100.png">
|
||||
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{
|
||||
num_notifs_unread
|
||||
}}</q-badge>
|
||||
</q-btn>
|
||||
|
||||
<q-drawer v-model="open" side="right" elevated
|
||||
:overlay="true"
|
||||
:breakpoint="1200"
|
||||
:width="q.screen.lt.sm ? tools.getwidth($q) : 450"
|
||||
<q-drawer
|
||||
v-model="open"
|
||||
side="right"
|
||||
elevated
|
||||
:overlay="true"
|
||||
:breakpoint="1200"
|
||||
:width="q.screen.lt.sm ? tools.getwidth($q) : 450"
|
||||
>
|
||||
<q-bar class="bg-primary text-white">
|
||||
{{ $t('notifs.coins') }}
|
||||
<q-space/>
|
||||
{{ $t("notifs.coins") }}
|
||||
<q-space />
|
||||
<q-btn round dense icon="fas fa-pencil-alt" class="q-mx-xs">
|
||||
<q-menu style="min-width: 200px">
|
||||
<q-list style="">
|
||||
<q-item clickable v-close-popup @click="notifStore.setAllRead(username, shared_consts.QualiNotifs.CIRCUITS)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
notifStore.setAllRead(
|
||||
username,
|
||||
shared_consts.QualiNotifs.CIRCUITS
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-check"/>
|
||||
<q-icon name="fas fa-check" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.setallread') }}</q-item-section>
|
||||
<q-item-section>{{ $t("notifs.setallread") }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.deleteAll(username, shared_consts.QualiNotifs.CIRCUITS)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
notifStore.deleteAll(
|
||||
username,
|
||||
shared_consts.QualiNotifs.CIRCUITS
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
<q-icon name="fas fa-trash-alt" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.deleteall') }}</q-item-section>
|
||||
<q-item-section>{{ $t("notifs.deleteall") }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn flat round color="white" icon="close" @click="open = false"></q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="white"
|
||||
icon="close"
|
||||
@click="open = false"
|
||||
></q-btn>
|
||||
</q-bar>
|
||||
|
||||
<div v-if="tools.isLogged()">
|
||||
@@ -49,26 +87,29 @@
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="[
|
||||
{label: t('notifs.all'), value: true},
|
||||
{label: t('notifs.notread'), value: false}
|
||||
]"
|
||||
{ label: t('notifs.all'), value: true },
|
||||
{ label: t('notifs.notread'), value: false },
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="clBorderSperator"></div>
|
||||
<div class="clBorderSperator"></div>
|
||||
|
||||
<div class="q-ma-xs text-black">
|
||||
<q-list bordered class="rounded-borders">
|
||||
|
||||
<div v-if="num_notifs_unread === 0">
|
||||
<q-item>
|
||||
<q-item-label lines="1" class="text-gray">{{ $t('notifs.nocoins') }}</q-item-label>
|
||||
|
||||
<q-item-label lines="1" class="text-gray">{{
|
||||
$t("notifs.nocoins")
|
||||
}}</q-item-label>
|
||||
</q-item>
|
||||
</div>
|
||||
|
||||
<q-item clickable v-for="(notif, index) in getlasts_coins" :key="index">
|
||||
|
||||
<q-item
|
||||
clickable
|
||||
v-for="(notif, index) in getlasts_coins"
|
||||
:key="index"
|
||||
>
|
||||
<!--<q-item-section avatar>
|
||||
<q-avatar>
|
||||
<q-item-label lines="1">{{ getTypeDirNotif(notif) }}</q-item-label>
|
||||
@@ -76,28 +117,49 @@
|
||||
</q-item-section>-->
|
||||
|
||||
<q-item-section avatar>
|
||||
<q-avatar >
|
||||
<img :src="notif.myimgsender" :alt="notif.sender">
|
||||
<q-avatar>
|
||||
<img :src="notif.myimgsender" :alt="notif.sender" />
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
|
||||
<q-item-section v-ripple>
|
||||
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
|
||||
<q-item-label
|
||||
lines="5"
|
||||
:class="!notif.read ? 'unread' : 'read'"
|
||||
@click="clickNotif(notif)"
|
||||
>
|
||||
<div v-html="getNotifText($t, notif, false)"></div>
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="2"
|
||||
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === shared_consts.CircuitsNotif.STATUS_NONE && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REQUEST_TO_ENTER"
|
||||
v-ripple>
|
||||
|
||||
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminCircuit(notif.extrafield)">
|
||||
<q-item-label
|
||||
caption
|
||||
lines="2"
|
||||
v-if="
|
||||
notif.typedir ===
|
||||
shared_consts.TypeNotifs.TYPEDIR_CIRCUITS &&
|
||||
notif.status === shared_consts.CircuitsNotif.STATUS_NONE &&
|
||||
notif.typeid ===
|
||||
shared_consts.TypeNotifs.ID_CIRCUIT_REQUEST_TO_ENTER
|
||||
"
|
||||
v-ripple
|
||||
>
|
||||
<div
|
||||
class="row no-wrap justify-evenly"
|
||||
v-if="tools.iAmAdminCircuit(notif.extrafield)"
|
||||
>
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept')"
|
||||
@click="tools.addFidoToMyCircuits(q, notif.sender, notif.extrafield)"
|
||||
color="positive"
|
||||
:label="$t('circuit.accept')"
|
||||
@click="
|
||||
tools.addFidoToMyCircuits(
|
||||
q,
|
||||
notif.sender,
|
||||
notif.extrafield
|
||||
)
|
||||
"
|
||||
/>
|
||||
<!--<q-btn
|
||||
dense
|
||||
@@ -109,17 +171,26 @@
|
||||
/>-->
|
||||
</div>
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="2"
|
||||
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === shared_consts.CircuitsNotif.STATUS_NONE && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
|
||||
v-ripple>
|
||||
|
||||
<q-item-label
|
||||
caption
|
||||
lines="2"
|
||||
v-if="
|
||||
notif.typedir ===
|
||||
shared_consts.TypeNotifs.TYPEDIR_CIRCUITS &&
|
||||
notif.status === shared_consts.CircuitsNotif.STATUS_NONE &&
|
||||
notif.typeid ===
|
||||
shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ
|
||||
"
|
||||
v-ripple
|
||||
>
|
||||
<div class="row no-wrap justify-evenly">
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept_coins')"
|
||||
color="positive"
|
||||
:label="$t('circuit.accept_coins')"
|
||||
@click="tools.acceptCoins(q, notif.sender, notif)"
|
||||
/>
|
||||
<q-btn
|
||||
@@ -127,14 +198,20 @@
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-minus"
|
||||
color="negative" :label="$t('circuit.refuse_coins')"
|
||||
color="negative"
|
||||
:label="$t('circuit.refuse_coins')"
|
||||
@click="tools.refuseCoins(q, notif.sender, notif)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'" @click="clickNotif(notif)">
|
||||
<CTimeAgo :datetime="notif.datenotif" />
|
||||
<q-item-label
|
||||
caption
|
||||
lines="1"
|
||||
:class="!notif.read ? 'unread-date' : 'read-date'"
|
||||
@click="clickNotif(notif)"
|
||||
>
|
||||
<CTimeAgo :datetime="notif.datenotif" />
|
||||
|
||||
<!--{{ // getUsernameChatByNotif(notif) }}-->
|
||||
</q-item-label>
|
||||
@@ -144,28 +221,41 @@
|
||||
<q-btn dense rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="notifStore.setRead(notif._id, true)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="notifStore.setRead(notif._id, true)"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
<q-icon name="fas fa-trash-alt" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.read') }}</q-item-section>
|
||||
<q-item-section>{{
|
||||
$t("notifs.read")
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.deleteRec(username, notif._id, true)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
notifStore.deleteRec(username, notif._id, true)
|
||||
"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
<q-icon name="fas fa-trash-alt" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.delete_notif') }}</q-item-section>
|
||||
<q-item-section>{{
|
||||
$t("notifs.delete_notif")
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
</q-item>
|
||||
<q-separator/>
|
||||
<q-separator />
|
||||
</q-list>
|
||||
<br><br><br>
|
||||
<br /><br /><br />
|
||||
</div>
|
||||
</div>
|
||||
</q-drawer>
|
||||
@@ -175,5 +265,5 @@
|
||||
<script lang="ts" src="./coinsPopover.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './coinsPopover.scss';
|
||||
@import "./coinsPopover.scss";
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
import {
|
||||
import type {
|
||||
IMessage,
|
||||
} from '@model'
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
||||
|
||||
import type { INotif } from '@model';
|
||||
import {
|
||||
IChat,
|
||||
IMessage, IMsgUsers, INotif,
|
||||
IMessage, IMsgUsers
|
||||
} from '@model'
|
||||
|
||||
import { date } from 'quasar'
|
||||
@@ -15,12 +16,12 @@ import { useNotifStore } from '@store/NotifStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CTimeAgo } from '@/components/CTimeAgo'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { CTitleBanner } from '@src/components/CTitleBanner'
|
||||
import { CTimeAgo } from '@src/components/CTimeAgo'
|
||||
import { CMyFieldRec } from '@src/components/CMyFieldRec'
|
||||
import { CMyFieldDb } from '@src/components/CMyFieldDb'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { waitAndcheckPendingNotif } from '../../../store/Modules/ApiTables'
|
||||
@@ -135,7 +136,7 @@ export default defineComponent({
|
||||
|
||||
function clickNotif(notif: INotif) {
|
||||
if (notif.openUrl) {
|
||||
let mylink = tools.updateQueryStringParameter(notif.openUrl, 'idnotif', notif._id)
|
||||
const mylink = tools.updateQueryStringParameter(notif.openUrl, 'idnotif', notif._id)
|
||||
console.log('mylink', mylink, notif._id)
|
||||
if (mylink) {
|
||||
$router.replace(mylink)
|
||||
@@ -153,7 +154,7 @@ export default defineComponent({
|
||||
function getlastdataread(myusername: string): any {
|
||||
// Get msg for this
|
||||
|
||||
let myrec = getlastnotif(myusername)
|
||||
const myrec = getlastnotif(myusername)
|
||||
const lastdata: any = (myrec && myrec.lastdataread) ? myrec.lastdataread : tools.getLastDateReadReset()
|
||||
|
||||
let mydate = ''
|
||||
@@ -171,7 +172,7 @@ export default defineComponent({
|
||||
try {
|
||||
if (globalStore.finishLoading && userStore.my.username && tools.isLogged()) {
|
||||
|
||||
if (!!myusername) {
|
||||
if (myusername) {
|
||||
notifsel.value.dest = ''
|
||||
// console.log('refreshdata')
|
||||
loading.value = true
|
||||
|
||||
Reference in New Issue
Block a user