feature: устранение дубликатов уведомлений, редактирование аккаунтов, заглушение папок
- Убраны дублирующиеся уведомления: оставлен только in-app toast, нативные Electron и Web Notification API удалены - Добавлено редактирование профиля аккаунта (IMAP/SMTP/пароль) через новый диалог EditAccountDialog и IPC-канал accounts:update - Реализовано заглушение уведомлений папки через ПКМ-меню (30 мин / 1 ч / 3 ч / 12 ч / навсегда); заглушенная папка показывает серый бейдж и иконку bell-off Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
59c21f1896
commit
ba58479231
11 changed files with 943 additions and 57 deletions
|
|
@ -21,4 +21,8 @@ export function registerAccountHandlers(manager: AccountManager): void {
|
|||
registerHandler('accounts:connect', async ({ accountId }) => {
|
||||
return manager.connectAccount(accountId)
|
||||
})
|
||||
|
||||
registerHandler('accounts:update', async (config) => {
|
||||
return manager.updateAccount(config)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { BrowserWindow, Notification, nativeImage } from 'electron'
|
||||
import { join } from 'node:path'
|
||||
import type { AccountConfig } from '@shared/types/account'
|
||||
import { BrowserWindow } from 'electron'
|
||||
import type { AccountConfig, ImapCredentials } from '@shared/types/account'
|
||||
import { AccountType } from '@shared/types/account'
|
||||
import type { IEmailProvider, FolderListResult, MessageListResult } from '@shared/types/provider'
|
||||
import type { MessageBody, MessageFlags, MessageEnvelope, ComposeData } from '@shared/types/message'
|
||||
|
|
@ -258,33 +257,56 @@ export class AccountManager {
|
|||
}
|
||||
}
|
||||
|
||||
async updateAccount(config: AccountConfig): Promise<{ success: boolean; error?: string }> {
|
||||
try {
|
||||
// If password is empty string, preserve existing credentials password
|
||||
const creds = config.credentials as ImapCredentials
|
||||
let newCredentials = config.credentials
|
||||
if ('password' in creds && creds.password === '') {
|
||||
const existingCredRaw = this.credentialStore.get(config.id)
|
||||
if (existingCredRaw) {
|
||||
const existing = JSON.parse(existingCredRaw) as ImapCredentials
|
||||
newCredentials = { ...creds, password: existing.password }
|
||||
}
|
||||
}
|
||||
|
||||
const configWithCreds: AccountConfig = { ...config, credentials: newCredentials }
|
||||
|
||||
// Update credentials
|
||||
await this.credentialStore.save(config.id, JSON.stringify(configWithCreds.credentials))
|
||||
|
||||
// Update metadata in store
|
||||
const { credentials: _, ...safeConfig } = configWithCreds
|
||||
const accounts = this.store.get('accounts', [])
|
||||
const idx = accounts.findIndex((a) => a.id === config.id)
|
||||
if (idx === -1) return { success: false, error: 'Account not found' }
|
||||
accounts[idx] = safeConfig
|
||||
this.store.set('accounts', accounts)
|
||||
|
||||
// Reconnect if currently connected
|
||||
const existingProvider = this.providers.get(config.id)
|
||||
if (existingProvider) {
|
||||
existingProvider.offNewMail()
|
||||
try { await existingProvider.disconnect() } catch { /* already disconnected */ }
|
||||
this.providers.delete(config.id)
|
||||
|
||||
const newProvider = this.createProvider(configWithCreds)
|
||||
await newProvider.connect()
|
||||
this.providers.set(config.id, newProvider)
|
||||
this.setupNewMailListener(config.id, newProvider)
|
||||
}
|
||||
|
||||
return { success: true }
|
||||
} catch (error) {
|
||||
return { success: false, error: (error as Error).message }
|
||||
}
|
||||
}
|
||||
|
||||
private setupNewMailListener(accountId: string, provider: IEmailProvider): void {
|
||||
provider.onNewMail((folderId, envelope) => {
|
||||
if (this.mainWindow && !this.mainWindow.isDestroyed()) {
|
||||
this.mainWindow.webContents.send('mail:new', { accountId, folderId, envelope })
|
||||
}
|
||||
|
||||
if (Notification.isSupported()) {
|
||||
const from = envelope.from.name || envelope.from.email || 'Новое письмо'
|
||||
const subject = envelope.subject || '(без темы)'
|
||||
const iconPath = join(__dirname, '../../resources/icon.png')
|
||||
const icon = nativeImage.createFromPath(iconPath)
|
||||
|
||||
const n = new Notification({
|
||||
title: from,
|
||||
body: subject,
|
||||
icon: icon.isEmpty() ? undefined : icon,
|
||||
silent: false,
|
||||
})
|
||||
n.on('click', () => {
|
||||
if (this.mainWindow && !this.mainWindow.isDestroyed()) {
|
||||
this.mainWindow.show()
|
||||
this.mainWindow.focus()
|
||||
this.mainWindow.webContents.send('notification:click', { accountId, folderId, messageId: envelope.id })
|
||||
}
|
||||
})
|
||||
n.show()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ export type IconName =
|
|||
| 'send'
|
||||
| 'pdf'
|
||||
| 'image'
|
||||
| 'bell-off'
|
||||
|
||||
const props = defineProps<{
|
||||
name: IconName
|
||||
|
|
@ -133,6 +134,13 @@ const paths: Record<IconName, string> = {
|
|||
<circle cx="8.5" cy="8.5" r="1.5"/>
|
||||
<polyline points="21 15 16 10 5 21"/>
|
||||
`,
|
||||
'bell-off': `
|
||||
<path d="M13.73 21a2 2 0 0 1-3.46 0"/>
|
||||
<path d="M18.63 13A17.89 17.89 0 0 1 18 8"/>
|
||||
<path d="M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h14"/>
|
||||
<path d="M18 8a6 6 0 0 0-9.33-5"/>
|
||||
<line x1="1" y1="1" x2="23" y2="23"/>
|
||||
`,
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
541
src/renderer/src/components/accounts/EditAccountDialog.vue
Normal file
541
src/renderer/src/components/accounts/EditAccountDialog.vue
Normal file
|
|
@ -0,0 +1,541 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { AccountType } from '@shared/types/account'
|
||||
import type { AccountConfig, ImapCredentials } from '@shared/types/account'
|
||||
import { useAccountsStore } from '../../stores/accounts.store'
|
||||
|
||||
const props = defineProps<{
|
||||
account: AccountConfig
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
}>()
|
||||
|
||||
const accountsStore = useAccountsStore()
|
||||
|
||||
const step = ref<'credentials' | 'testing'>('credentials')
|
||||
const error = ref('')
|
||||
const testing = ref(false)
|
||||
|
||||
const creds = props.account.credentials as ImapCredentials
|
||||
|
||||
const imapHost = ref(creds.host ?? '')
|
||||
const imapPort = ref(creds.port ?? 993)
|
||||
const imapSecure = ref(creds.secure ?? true)
|
||||
const imapUsername = ref(creds.username ?? props.account.email)
|
||||
const imapPassword = ref('')
|
||||
const imapLabel = ref(props.account.label ?? '')
|
||||
|
||||
const smtpHost = ref(creds.smtpHost ?? '')
|
||||
const smtpPort = ref(creds.smtpPort ?? 587)
|
||||
const smtpSecure = ref(creds.smtpSecure ?? false)
|
||||
const showSmtp = ref(!!creds.smtpHost)
|
||||
|
||||
async function handleSubmit(): Promise<void> {
|
||||
testing.value = true
|
||||
error.value = ''
|
||||
|
||||
try {
|
||||
const credentials: ImapCredentials = {
|
||||
host: imapHost.value,
|
||||
port: imapPort.value,
|
||||
secure: imapSecure.value,
|
||||
username: imapUsername.value,
|
||||
password: imapPassword.value,
|
||||
...(showSmtp.value && smtpHost.value
|
||||
? { smtpHost: smtpHost.value, smtpPort: smtpPort.value, smtpSecure: smtpSecure.value }
|
||||
: {})
|
||||
}
|
||||
const config: AccountConfig = {
|
||||
id: props.account.id,
|
||||
type: AccountType.IMAP,
|
||||
label: imapLabel.value || imapUsername.value,
|
||||
email: imapUsername.value,
|
||||
credentials
|
||||
}
|
||||
|
||||
// If password is provided, test connection first
|
||||
if (imapPassword.value !== '') {
|
||||
step.value = 'testing'
|
||||
const testResult = await accountsStore.testConnection(config)
|
||||
if (!testResult.success) {
|
||||
error.value = testResult.error ?? 'Ошибка подключения'
|
||||
step.value = 'credentials'
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const updateResult = await accountsStore.updateAccount(config)
|
||||
if (updateResult.success) {
|
||||
emit('close')
|
||||
} else {
|
||||
error.value = updateResult.error ?? 'Не удалось обновить аккаунт'
|
||||
step.value = 'credentials'
|
||||
}
|
||||
} catch (err) {
|
||||
error.value = (err as Error).message
|
||||
step.value = 'credentials'
|
||||
} finally {
|
||||
testing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const isFormValid = computed(() => imapHost.value && imapUsername.value)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="dialog-overlay" @click.self="emit('close')">
|
||||
<div class="dialog">
|
||||
<div class="dialog-header">
|
||||
<h2>Редактировать аккаунт</h2>
|
||||
<button class="close-btn" @click="emit('close')">×</button>
|
||||
</div>
|
||||
|
||||
<div v-if="step === 'credentials'" class="dialog-body" style="overflow-y:auto;max-height:calc(85vh - 70px)">
|
||||
<div v-if="error" class="error-msg">{{ error }}</div>
|
||||
|
||||
<form @submit.prevent="handleSubmit">
|
||||
<div class="form-group">
|
||||
<label>Название (необязательно)</label>
|
||||
<input v-model="imapLabel" type="text" placeholder="Моя почта" />
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group flex-1">
|
||||
<label>IMAP сервер</label>
|
||||
<input v-model="imapHost" type="text" placeholder="imap.example.com" required />
|
||||
</div>
|
||||
<div class="form-group" style="width: 80px">
|
||||
<label>Порт</label>
|
||||
<input v-model.number="imapPort" type="number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="checkbox-label">
|
||||
<input v-model="imapSecure" type="checkbox" />
|
||||
Использовать SSL/TLS
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Имя пользователя / Email</label>
|
||||
<input v-model="imapUsername" type="text" placeholder="user@example.com" required />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Пароль</label>
|
||||
<input v-model="imapPassword" type="password" placeholder="не менять — оставить текущий" />
|
||||
</div>
|
||||
<!-- SMTP (опционально) -->
|
||||
<div class="smtp-section">
|
||||
<button type="button" class="smtp-toggle" @click="showSmtp = !showSmtp">
|
||||
<svg :style="{ transform: showSmtp ? 'rotate(90deg)' : 'none', transition: 'transform 0.18s' }"
|
||||
width="12" height="12" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="9 18 15 12 9 6"/>
|
||||
</svg>
|
||||
Настройки SMTP (для отправки)
|
||||
</button>
|
||||
|
||||
<div v-if="showSmtp" class="smtp-fields">
|
||||
<div class="form-row">
|
||||
<div class="form-group flex-1">
|
||||
<label>SMTP сервер</label>
|
||||
<input v-model="smtpHost" type="text" :placeholder="imapHost ? imapHost.replace(/^imap\./i, 'smtp.') : 'smtp.example.com'" />
|
||||
</div>
|
||||
<div class="form-group" style="width: 80px">
|
||||
<label>Порт</label>
|
||||
<input v-model.number="smtpPort" type="number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="checkbox-label">
|
||||
<input v-model="smtpSecure" type="checkbox" />
|
||||
SSL/TLS (порт 465)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="submit-btn" :disabled="!isFormValid || testing">
|
||||
{{ testing ? 'Сохранение...' : 'Сохранить изменения' }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div v-if="step === 'testing'" class="dialog-body testing-state">
|
||||
<div class="spinner" />
|
||||
<span>Проверка подключения...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.dialog-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(9, 9, 14, 0.40);
|
||||
backdrop-filter: blur(20px) saturate(1.6);
|
||||
-webkit-backdrop-filter: blur(20px) saturate(1.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 100;
|
||||
animation: overlay-in 180ms ease;
|
||||
}
|
||||
|
||||
@keyframes overlay-in {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.dialog {
|
||||
position: relative;
|
||||
width: 560px;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
backdrop-filter: blur(72px) saturate(2.8);
|
||||
-webkit-backdrop-filter: blur(72px) saturate(2.8);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.60),
|
||||
inset 0 3px 16px rgba(255, 255, 255, 0.05),
|
||||
inset 1px 0 0 rgba(255, 255, 255, 0.08),
|
||||
inset -1px 0 0 rgba(255, 255, 255, 0.05),
|
||||
inset 0 -1px 0 rgba(0, 0, 0, 0.20),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.14),
|
||||
0 8px 32px rgba(0, 0, 0, 0.45),
|
||||
0 32px 80px rgba(0, 0, 0, 0.65);
|
||||
animation: dialog-in 280ms cubic-bezier(0.34, 1.15, 0.64, 1);
|
||||
}
|
||||
|
||||
@keyframes dialog-in {
|
||||
from { opacity: 0; transform: scale(0.92) translateY(14px); }
|
||||
to { opacity: 1; transform: scale(1) translateY(0); }
|
||||
}
|
||||
|
||||
.dialog::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 22px 28px;
|
||||
gap: 12px;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(255, 255, 255, 0.10) 0%,
|
||||
rgba(255, 255, 255, 0.04) 100%
|
||||
);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.10);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.dialog-header h2 {
|
||||
flex: 1;
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
color: var(--text-muted);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.18),
|
||||
inset 0 -1px 0 rgba(0, 0, 0, 0.12);
|
||||
transition:
|
||||
background var(--transition-fast),
|
||||
color var(--transition-fast),
|
||||
box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.close-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
color: var(--text-primary);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.28),
|
||||
0 2px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.close-btn:active {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.28);
|
||||
transform: scale(0.89);
|
||||
}
|
||||
|
||||
.dialog-body {
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
padding: 10px 14px;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
cursor: text;
|
||||
background: rgba(255, 60, 60, 0.10);
|
||||
border: 1px solid rgba(255, 80, 80, 0.30);
|
||||
border-top-color: rgba(255, 110, 110, 0.50);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--danger);
|
||||
font-size: 12px;
|
||||
margin-bottom: 18px;
|
||||
line-height: 1.5;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 100, 100, 0.10),
|
||||
0 2px 12px rgba(255, 30, 30, 0.07);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: rgba(255, 255, 255, 0.40);
|
||||
margin-bottom: 7px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.6px;
|
||||
}
|
||||
|
||||
.form-group input[type="text"],
|
||||
.form-group input[type="password"],
|
||||
.form-group input[type="number"] {
|
||||
width: 100%;
|
||||
padding: 12px 14px;
|
||||
font-size: 14px;
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(0, 0, 0, 0.22);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-top-color: rgba(0, 0, 0, 0.30);
|
||||
box-shadow:
|
||||
inset 0 2px 6px rgba(0, 0, 0, 0.28),
|
||||
0 1px 0 rgba(255, 255, 255, 0.07);
|
||||
backdrop-filter: none;
|
||||
transition:
|
||||
background var(--transition-fast),
|
||||
border-color var(--transition-fast),
|
||||
box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.form-group input[type="text"]:focus,
|
||||
.form-group input[type="password"]:focus,
|
||||
.form-group input[type="number"]:focus {
|
||||
background: rgba(0, 0, 0, 0.28);
|
||||
border-color: color-mix(in srgb, var(--accent) 50%, transparent);
|
||||
border-top-color: rgba(0, 0, 0, 0.25);
|
||||
box-shadow:
|
||||
inset 0 2px 6px rgba(0, 0, 0, 0.22),
|
||||
0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent),
|
||||
0 1px 0 rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.flex-1 { flex: 1; }
|
||||
|
||||
.checkbox-label {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
text-transform: none !important;
|
||||
letter-spacing: 0 !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 400 !important;
|
||||
color: var(--text-secondary) !important;
|
||||
}
|
||||
|
||||
.checkbox-label input[type="checkbox"] {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
min-width: 16px;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
border-radius: var(--radius-xs);
|
||||
background: rgba(0, 0, 0, 0.22);
|
||||
border: 1px solid rgba(255, 255, 255, 0.09);
|
||||
border-top-color: rgba(0, 0, 0, 0.28);
|
||||
box-shadow:
|
||||
inset 0 2px 4px rgba(0, 0, 0, 0.25),
|
||||
0 1px 0 rgba(255, 255, 255, 0.07);
|
||||
transition:
|
||||
background var(--transition-fast),
|
||||
box-shadow var(--transition-fast);
|
||||
}
|
||||
|
||||
.checkbox-label input[type="checkbox"]:checked {
|
||||
background: var(--accent);
|
||||
border-color: color-mix(in srgb, var(--accent) 60%, rgba(0,0,0,0.5));
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.35),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.14),
|
||||
0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
|
||||
}
|
||||
|
||||
.checkbox-label input[type="checkbox"]:checked::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 2px;
|
||||
width: 5px;
|
||||
height: 8px;
|
||||
border: 2px solid #0d1a00;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.checkbox-label input[type="checkbox"]:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
border-radius: var(--radius-md);
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
margin-top: 10px;
|
||||
color: var(--accent-text);
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
color-mix(in srgb, var(--accent) 88%, white 12%) 0%,
|
||||
var(--accent) 100%
|
||||
);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.40),
|
||||
inset 0 -1px 0 rgba(0, 0, 0, 0.12),
|
||||
0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent),
|
||||
0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
transition:
|
||||
background var(--transition-fast),
|
||||
box-shadow var(--transition-fast),
|
||||
transform var(--transition-fast);
|
||||
}
|
||||
|
||||
.submit-btn:hover:not(:disabled) {
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
color-mix(in srgb, var(--accent-hover) 88%, white 12%) 0%,
|
||||
var(--accent-hover) 100%
|
||||
);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.45),
|
||||
inset 0 -1px 0 rgba(0, 0, 0, 0.10),
|
||||
0 4px 18px color-mix(in srgb, var(--accent) 40%, transparent),
|
||||
0 1px 4px rgba(0, 0, 0, 0.22);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.submit-btn:active:not(:disabled) {
|
||||
transform: translateY(0);
|
||||
box-shadow:
|
||||
inset 0 2px 5px rgba(0, 0, 0, 0.18),
|
||||
0 1px 4px color-mix(in srgb, var(--accent) 20%, transparent);
|
||||
}
|
||||
|
||||
.submit-btn:disabled {
|
||||
opacity: 0.35;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.testing-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 48px 20px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.spinner {
|
||||
position: relative;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.spinner::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 2px solid rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.spinner::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 2px solid transparent;
|
||||
border-top-color: var(--accent);
|
||||
border-right-color: color-mix(in srgb, var(--accent) 35%, transparent);
|
||||
filter: drop-shadow(0 0 4px var(--accent));
|
||||
animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.smtp-section {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 8px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.10);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.smtp-toggle {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
}
|
||||
|
||||
.smtp-toggle:hover {
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.smtp-fields {
|
||||
padding: 8px 14px 12px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.07);
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -5,6 +5,7 @@ import { useIpc } from '../../composables/useIpc'
|
|||
import { useAccountsStore } from '../../stores/accounts.store'
|
||||
import { useFoldersStore } from '../../stores/folders.store'
|
||||
import { useMessagesStore } from '../../stores/messages.store'
|
||||
import { useNotificationsStore } from '../../stores/notifications.store'
|
||||
|
||||
interface ToastItem {
|
||||
id: string
|
||||
|
|
@ -24,6 +25,7 @@ const { on } = useIpc()
|
|||
const accountsStore = useAccountsStore()
|
||||
const foldersStore = useFoldersStore()
|
||||
const messagesStore = useMessagesStore()
|
||||
const notificationsStore = useNotificationsStore()
|
||||
|
||||
function addToast(item: Omit<ToastItem, 'id'>): void {
|
||||
const id = `toast-${++counter}`
|
||||
|
|
@ -45,44 +47,14 @@ function handleClick(id: string): void {
|
|||
removeToast(id)
|
||||
}
|
||||
|
||||
function showOsNotification(from: string, subject: string, onClick: () => void): void {
|
||||
if (!('Notification' in window)) return
|
||||
const send = (): void => {
|
||||
const n = new window.Notification(from, { body: subject, silent: false })
|
||||
n.onclick = () => { onClick(); n.close() }
|
||||
}
|
||||
if (Notification.permission === 'granted') {
|
||||
send()
|
||||
} else if (Notification.permission !== 'denied') {
|
||||
Notification.requestPermission().then(p => { if (p === 'granted') send() })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Запросить разрешение при старте + слушать события
|
||||
onMounted(() => {
|
||||
if ('Notification' in window && Notification.permission === 'default') {
|
||||
Notification.requestPermission()
|
||||
}
|
||||
|
||||
// Новые письма из любой папки (через pollNewMessages в main)
|
||||
on('mail:new', ({ accountId, folderId, envelope }) => {
|
||||
const account = accountsStore.accounts.find(a => a.id === accountId)
|
||||
if (!account) return
|
||||
if (notificationsStore.isMuted(accountId, folderId)) return
|
||||
const from = envelope.from.name || envelope.from.email
|
||||
const subject = envelope.subject || '(без темы)'
|
||||
addToast({ from, subject, accountEmail: account.email, accountId, folderId, messageId: envelope.id })
|
||||
showOsNotification(from, subject, () => {
|
||||
accountsStore.setActive(accountId)
|
||||
foldersStore.setActiveFolder(folderId)
|
||||
messagesStore.selectMessage(envelope.id)
|
||||
})
|
||||
})
|
||||
|
||||
on('notification:click', ({ accountId, folderId, messageId }) => {
|
||||
accountsStore.setActive(accountId)
|
||||
foldersStore.setActiveFolder(folderId)
|
||||
messagesStore.selectMessage(messageId)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
183
src/renderer/src/components/sidebar/FolderContextMenu.vue
Normal file
183
src/renderer/src/components/sidebar/FolderContextMenu.vue
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
x: number
|
||||
y: number
|
||||
accountId: string
|
||||
folderId: string
|
||||
folderName: string
|
||||
isMuted: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
mute: [durationMs: number | null]
|
||||
unmute: []
|
||||
}>()
|
||||
|
||||
const menuEl = ref<HTMLElement | null>(null)
|
||||
const menuX = ref(props.x)
|
||||
const menuY = ref(props.y)
|
||||
const showSubmenu = ref(false)
|
||||
|
||||
const MUTE_OPTIONS = [
|
||||
{ label: '30 минут', ms: 30 * 60 * 1000 },
|
||||
{ label: '1 час', ms: 60 * 60 * 1000 },
|
||||
{ label: '3 часа', ms: 3 * 60 * 60 * 1000 },
|
||||
{ label: '12 часов', ms: 12 * 60 * 60 * 1000 },
|
||||
{ label: 'Навсегда', ms: null },
|
||||
]
|
||||
|
||||
function handleMute(ms: number | null): void {
|
||||
emit('mute', ms)
|
||||
}
|
||||
|
||||
function handleUnmute(): void {
|
||||
emit('unmute')
|
||||
}
|
||||
|
||||
function onMouseDown(e: MouseEvent): void {
|
||||
if (menuEl.value && !menuEl.value.contains(e.target as Node)) {
|
||||
emit('close')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('mousedown', onMouseDown)
|
||||
|
||||
// Clamp position to viewport
|
||||
if (menuEl.value) {
|
||||
const rect = menuEl.value.getBoundingClientRect()
|
||||
if (props.x + rect.width > window.innerWidth) {
|
||||
menuX.value = Math.max(0, props.x - rect.width)
|
||||
}
|
||||
if (props.y + rect.height > window.innerHeight) {
|
||||
menuY.value = Math.max(0, props.y - rect.height)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('mousedown', onMouseDown)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<div
|
||||
ref="menuEl"
|
||||
class="context-menu"
|
||||
:style="{ left: menuX + 'px', top: menuY + 'px' }"
|
||||
>
|
||||
<!-- Unmute if already muted -->
|
||||
<button v-if="isMuted" class="menu-item" @click="handleUnmute">
|
||||
Включить уведомления
|
||||
</button>
|
||||
|
||||
<!-- Mute with submenu -->
|
||||
<div
|
||||
v-else
|
||||
class="menu-item-submenu"
|
||||
@mouseenter="showSubmenu = true"
|
||||
@mouseleave="showSubmenu = false"
|
||||
>
|
||||
<button class="menu-item has-submenu">
|
||||
<span>Заглушить уведомления</span>
|
||||
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="9 18 15 12 9 6"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div v-show="showSubmenu" class="submenu">
|
||||
<button
|
||||
v-for="option in MUTE_OPTIONS"
|
||||
:key="option.label"
|
||||
class="menu-item"
|
||||
@click="handleMute(option.ms)"
|
||||
>
|
||||
{{ option.label }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.context-menu {
|
||||
position: fixed;
|
||||
z-index: 99999;
|
||||
min-width: 200px;
|
||||
border-radius: 12px;
|
||||
background:
|
||||
linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%),
|
||||
rgba(14, 14, 22, 0.82);
|
||||
backdrop-filter: blur(40px) saturate(2);
|
||||
-webkit-backdrop-filter: blur(40px) saturate(2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.18),
|
||||
0 8px 32px rgba(0, 0, 0, 0.55),
|
||||
0 2px 8px rgba(0, 0, 0, 0.35);
|
||||
padding: 4px;
|
||||
animation: menu-in 140ms cubic-bezier(0.34, 1.15, 0.64, 1);
|
||||
}
|
||||
|
||||
@keyframes menu-in {
|
||||
from { opacity: 0; transform: scale(0.95) translateY(-4px); }
|
||||
to { opacity: 1; transform: scale(1) translateY(0); }
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 7px 12px;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
text-align: left;
|
||||
transition: background var(--transition-fast), color var(--transition-fast);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.menu-item:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.menu-item:active {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.menu-item-submenu {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.menu-item.has-submenu {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.submenu {
|
||||
position: absolute;
|
||||
left: 100%;
|
||||
top: 0;
|
||||
min-width: 150px;
|
||||
border-radius: 12px;
|
||||
background:
|
||||
linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%),
|
||||
rgba(14, 14, 22, 0.82);
|
||||
backdrop-filter: blur(40px) saturate(2);
|
||||
-webkit-backdrop-filter: blur(40px) saturate(2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.18),
|
||||
0 8px 32px rgba(0, 0, 0, 0.55),
|
||||
0 2px 8px rgba(0, 0, 0, 0.35);
|
||||
padding: 4px;
|
||||
margin-left: 4px;
|
||||
animation: menu-in 120ms cubic-bezier(0.34, 1.15, 0.64, 1);
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,8 +4,10 @@ import type { Folder } from '@shared/types/folder'
|
|||
import { SpecialFolderRole } from '@shared/types/folder'
|
||||
import { useFoldersStore } from '../../stores/folders.store'
|
||||
import { useAccountsStore } from '../../stores/accounts.store'
|
||||
import { useNotificationsStore } from '../../stores/notifications.store'
|
||||
import AppIcon from '../AppIcon.vue'
|
||||
import type { IconName } from '../AppIcon.vue'
|
||||
import FolderContextMenu from './FolderContextMenu.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
folder: Folder
|
||||
|
|
@ -14,7 +16,9 @@ const props = defineProps<{
|
|||
|
||||
const foldersStore = useFoldersStore()
|
||||
const accountsStore = useAccountsStore()
|
||||
const notificationsStore = useNotificationsStore()
|
||||
const expanded = ref(true)
|
||||
const contextMenu = ref<{ x: number; y: number } | null>(null)
|
||||
|
||||
const isActive = computed(() => foldersStore.activeFolderId === props.folder.id)
|
||||
const hasChildren = computed(() => props.folder.children.length > 0)
|
||||
|
|
@ -22,6 +26,10 @@ const unreadCount = computed(() => {
|
|||
if (!accountsStore.activeAccountId) return 0
|
||||
return foldersStore.getFolderUnread(accountsStore.activeAccountId, props.folder.id)
|
||||
})
|
||||
const isMuted = computed(() => {
|
||||
if (!accountsStore.activeAccountId) return false
|
||||
return notificationsStore.isMuted(accountsStore.activeAccountId, props.folder.id)
|
||||
})
|
||||
|
||||
const folderIcon = computed((): IconName => {
|
||||
switch (props.folder.role) {
|
||||
|
|
@ -43,6 +51,29 @@ function toggleExpand(event: Event): void {
|
|||
event.stopPropagation()
|
||||
expanded.value = !expanded.value
|
||||
}
|
||||
|
||||
function handleContextMenu(event: MouseEvent): void {
|
||||
event.preventDefault()
|
||||
contextMenu.value = { x: event.clientX, y: event.clientY }
|
||||
}
|
||||
|
||||
function closeContextMenu(): void {
|
||||
contextMenu.value = null
|
||||
}
|
||||
|
||||
function handleMute(durationMs: number | null): void {
|
||||
if (accountsStore.activeAccountId) {
|
||||
notificationsStore.muteFolder(accountsStore.activeAccountId, props.folder.id, durationMs)
|
||||
}
|
||||
contextMenu.value = null
|
||||
}
|
||||
|
||||
function handleUnmute(): void {
|
||||
if (accountsStore.activeAccountId) {
|
||||
notificationsStore.unmuteFolder(accountsStore.activeAccountId, props.folder.id)
|
||||
}
|
||||
contextMenu.value = null
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -52,6 +83,7 @@ function toggleExpand(event: Event): void {
|
|||
:class="{ active: isActive }"
|
||||
:style="{ paddingLeft: (depth * 16 + 8) + 'px' }"
|
||||
@click="handleClick"
|
||||
@contextmenu.prevent="handleContextMenu"
|
||||
>
|
||||
<button
|
||||
v-if="hasChildren"
|
||||
|
|
@ -65,11 +97,25 @@ function toggleExpand(event: Event): void {
|
|||
|
||||
<AppIcon :name="folderIcon" :size="14" class="folder-icon" />
|
||||
<span class="folder-name truncate">{{ folder.name }}</span>
|
||||
<span v-if="unreadCount > 0" class="unread-badge">
|
||||
<AppIcon v-if="isMuted" name="bell-off" :size="11" class="muted-icon" />
|
||||
<span v-if="unreadCount > 0" class="unread-badge" :class="{ muted: isMuted }">
|
||||
{{ unreadCount }}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<FolderContextMenu
|
||||
v-if="contextMenu && accountsStore.activeAccountId"
|
||||
:x="contextMenu.x"
|
||||
:y="contextMenu.y"
|
||||
:account-id="accountsStore.activeAccountId"
|
||||
:folder-id="folder.id"
|
||||
:folder-name="folder.name"
|
||||
:is-muted="isMuted"
|
||||
@close="closeContextMenu"
|
||||
@mute="handleMute"
|
||||
@unmute="handleUnmute"
|
||||
/>
|
||||
|
||||
<div v-if="hasChildren && expanded" class="folder-children">
|
||||
<FolderTreeItem
|
||||
v-for="child in folder.children"
|
||||
|
|
@ -207,4 +253,30 @@ function toggleExpand(event: Event): void {
|
|||
background: rgba(200, 40, 40, 0.65);
|
||||
border-color: rgba(255, 100, 100, 0.35);
|
||||
}
|
||||
|
||||
/* ── Muted badge: gray instead of red ───────────────────── */
|
||||
.unread-badge.muted {
|
||||
background: rgba(255, 255, 255, 0.10);
|
||||
border-color: rgba(255, 255, 255, 0.08);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.06),
|
||||
0 1px 4px rgba(0, 0, 0, 0.12);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.folder-item:hover .unread-badge.muted {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
.folder-item.active .unread-badge.muted {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.10);
|
||||
}
|
||||
|
||||
/* ── Muted icon ──────────────────────────────────────────── */
|
||||
.muted-icon {
|
||||
flex-shrink: 0;
|
||||
color: var(--text-muted);
|
||||
opacity: 0.65;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,14 @@ export const useAccountsStore = defineStore('accounts', () => {
|
|||
return invoke('accounts:test', config)
|
||||
}
|
||||
|
||||
async function updateAccount(config: AccountConfig): Promise<{ success: boolean; error?: string }> {
|
||||
const result = await invoke('accounts:update', config)
|
||||
if (result.success) {
|
||||
await loadAccounts()
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
function setActive(accountId: string): void {
|
||||
activeAccountId.value = accountId
|
||||
}
|
||||
|
|
@ -87,6 +95,7 @@ export const useAccountsStore = defineStore('accounts', () => {
|
|||
addAccount,
|
||||
removeAccount,
|
||||
testConnection,
|
||||
updateAccount,
|
||||
setActive
|
||||
}
|
||||
})
|
||||
|
|
|
|||
48
src/renderer/src/stores/notifications.store.ts
Normal file
48
src/renderer/src/stores/notifications.store.ts
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import { ref } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
const STORAGE_KEY = 'muted-folders'
|
||||
|
||||
export const useNotificationsStore = defineStore('notifications', () => {
|
||||
// Record<"accountId:folderId", expiry timestamp ms | null (= forever)>
|
||||
const mutedFolders = ref<Record<string, number | null>>(loadFromStorage())
|
||||
|
||||
function loadFromStorage(): Record<string, number | null> {
|
||||
try {
|
||||
const raw = localStorage.getItem(STORAGE_KEY)
|
||||
return raw ? JSON.parse(raw) : {}
|
||||
} catch {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
function persist(): void {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(mutedFolders.value))
|
||||
}
|
||||
|
||||
function isMuted(accountId: string, folderId: string): boolean {
|
||||
const key = `${accountId}:${folderId}`
|
||||
const expiry = mutedFolders.value[key]
|
||||
if (expiry === undefined) return false
|
||||
if (expiry === null) return true // forever
|
||||
if (Date.now() < expiry) return true // not yet expired
|
||||
// Expired — clean up lazily
|
||||
delete mutedFolders.value[key]
|
||||
persist()
|
||||
return false
|
||||
}
|
||||
|
||||
function muteFolder(accountId: string, folderId: string, durationMs: number | null): void {
|
||||
const key = `${accountId}:${folderId}`
|
||||
mutedFolders.value[key] = durationMs === null ? null : Date.now() + durationMs
|
||||
persist()
|
||||
}
|
||||
|
||||
function unmuteFolder(accountId: string, folderId: string): void {
|
||||
const key = `${accountId}:${folderId}`
|
||||
delete mutedFolders.value[key]
|
||||
persist()
|
||||
}
|
||||
|
||||
return { mutedFolders, isMuted, muteFolder, unmuteFolder }
|
||||
})
|
||||
|
|
@ -1,15 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useAccountsStore } from '../stores/accounts.store'
|
||||
import { useSettingsStore, SWIPE_ACTION_LABELS, ACCENT_QUICK_PICKS, AUTO_CHECK_INTERVALS, type SwipeAction } from '../stores/settings.store'
|
||||
import CustomSelect from '../components/CustomSelect.vue'
|
||||
import ColorPicker from '../components/ColorPicker.vue'
|
||||
import AppIcon from '../components/AppIcon.vue'
|
||||
import EditAccountDialog from '../components/accounts/EditAccountDialog.vue'
|
||||
import type { AccountConfig } from '@shared/types/account'
|
||||
|
||||
const router = useRouter()
|
||||
const accountsStore = useAccountsStore()
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
const editingAccount = ref<AccountConfig | null>(null)
|
||||
|
||||
const swipeOptions: { value: SwipeAction; label: string }[] = (
|
||||
['delete', 'toggleRead', 'toggleFlag', 'none'] as SwipeAction[]
|
||||
).map((v) => ({ value: v, label: SWIPE_ACTION_LABELS[v] }))
|
||||
|
|
@ -47,6 +52,9 @@ function folderDisplayName(path: string): string {
|
|||
<div v-for="account in accountsStore.accounts" :key="account.id" class="account-item">
|
||||
<span class="account-email">{{ account.email }}</span>
|
||||
<span class="account-type">{{ account.type }}</span>
|
||||
<button class="edit-btn" @click="editingAccount = account">
|
||||
Редактировать
|
||||
</button>
|
||||
<button class="remove-btn" @click="accountsStore.removeAccount(account.id)">
|
||||
Удалить
|
||||
</button>
|
||||
|
|
@ -56,6 +64,12 @@ function folderDisplayName(path: string): string {
|
|||
</p>
|
||||
</section>
|
||||
|
||||
<EditAccountDialog
|
||||
v-if="editingAccount"
|
||||
:account="editingAccount"
|
||||
@close="editingAccount = null"
|
||||
/>
|
||||
|
||||
<!-- Акцентный цвет -->
|
||||
<section>
|
||||
<h2>Акцентный цвет</h2>
|
||||
|
|
@ -305,6 +319,18 @@ function folderDisplayName(path: string): string {
|
|||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
color: var(--text-secondary);
|
||||
padding: 4px 10px;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 12px;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.edit-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.remove-btn {
|
||||
color: var(--danger);
|
||||
padding: 4px 10px;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export interface IpcChannelMap {
|
|||
'accounts:remove': [{ accountId: string }, void]
|
||||
'accounts:test': [AccountConfig, { success: boolean; error?: string }]
|
||||
'accounts:connect': [{ accountId: string }, { success: boolean; error?: string }]
|
||||
'accounts:update': [AccountConfig, { success: boolean; error?: string }]
|
||||
|
||||
'folders:list': [{ accountId: string }, FolderListResult]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue