feat: убрать CalDAV из UI, редизайн диалогов аккаунта
CalDAV: - CalendarView: удалён probe (probeCalDAV, probeResults, probe-UI и стили) - AddAccountDialog: удалена CalDAV-секция и все caldav* refs - EditAccountDialog: то же самое - EWS-backend (caldav.provider.ts) не тронут — auto-fallback на IMAP host AddAccountDialog (полный рефакторинг): - Шаги: form → testing → success - IMAP + SMTP секции всегда видны (section-sep разделители) - Автодетект хоста по домену email (Gmail/Outlook/Yahoo/iCloud/generic) - SSL-поля заменены на toggle-switch вместо checkbox - Testing: checklist с иконками статуса для IMAP и SMTP - Success: экран с аватаром + email + провайдер, авто-закрытие ~2s EditAccountDialog (полный рефакторинг): - Идентичная структура секций с AddAccountDialog - Header: аватар + имя аккаунта + IMAP-хост - Пароль: placeholder «не менять», тест только если изменён - Шаги: form → testing (без success, диалог закрывается сразу) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3eed873bc7
commit
4174971f1e
3 changed files with 1082 additions and 844 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -17,23 +17,6 @@ const calStore = useCalendarStore()
|
|||
const accountsStore = useAccountsStore()
|
||||
const showAddAccount = ref(false)
|
||||
|
||||
// CalDAV path probe
|
||||
const probeResults = ref<{ path: string; status: number; note: string }[] | null>(null)
|
||||
const probing = ref(false)
|
||||
|
||||
async function probeCalDAV(): Promise<void> {
|
||||
if (!accountsStore.activeAccountId) return
|
||||
probing.value = true
|
||||
probeResults.value = null
|
||||
try {
|
||||
probeResults.value = await window.api.invoke('calendar:probe', { accountId: accountsStore.activeAccountId })
|
||||
} catch (e) {
|
||||
probeResults.value = [{ path: '(error)', status: 0, note: (e as Error).message }]
|
||||
} finally {
|
||||
probing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar color palette
|
||||
const CAL_COLORS = ['#a8e600', '#38bdf8', '#a78bfa', '#f472b6', '#fb923c', '#4ade80', '#f87171']
|
||||
function calendarColor(calendarId: string): string {
|
||||
|
|
@ -78,31 +61,13 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
<div class="error-icon-wrap">
|
||||
<AppIcon name="warning" :size="20" class="error-icon" />
|
||||
</div>
|
||||
<p class="error-title">CalDAV недоступен</p>
|
||||
<p class="error-title">Календарь недоступен</p>
|
||||
<p class="error-detail">{{ calStore.error }}</p>
|
||||
<div class="error-actions">
|
||||
<button class="retry-btn" @click="reload">
|
||||
<AppIcon name="refresh" :size="12" />
|
||||
Повторить
|
||||
</button>
|
||||
<button class="retry-btn" :disabled="probing" @click="probeCalDAV">
|
||||
<AppIcon name="search" :size="12" />
|
||||
{{ probing ? 'Сканирование…' : 'Найти путь' }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="probeResults" class="probe-results">
|
||||
<p class="probe-title">Результаты:</p>
|
||||
<div
|
||||
v-for="r in probeResults"
|
||||
:key="r.path"
|
||||
class="probe-row"
|
||||
:class="{ 'probe-ok': r.status === 207 || r.status === 200 }"
|
||||
>
|
||||
<span class="probe-path">{{ r.path }}</span>
|
||||
<span class="probe-note">{{ r.note }}</span>
|
||||
</div>
|
||||
<p class="probe-hint">Скопируйте путь со статусом 207 в настройки CalDAV.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -455,62 +420,6 @@ function handleEventClick(ev: CalendarEvent): void {
|
|||
}
|
||||
.retry-btn:disabled { opacity: 0.5; cursor: default; }
|
||||
|
||||
.probe-results {
|
||||
width: 100%;
|
||||
border-top: 1px solid var(--glass-border);
|
||||
padding-top: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.probe-title {
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.probe-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
padding: 3px 6px;
|
||||
border-radius: 5px;
|
||||
background: rgba(255,255,255,0.03);
|
||||
}
|
||||
|
||||
.probe-row.probe-ok {
|
||||
background: rgba(168, 230, 0, 0.08);
|
||||
}
|
||||
|
||||
.probe-path {
|
||||
font-size: 9px;
|
||||
font-family: monospace;
|
||||
color: var(--text-primary);
|
||||
word-break: break-all;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.probe-note {
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.probe-row.probe-ok .probe-note {
|
||||
color: #a8e600;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.probe-hint {
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.5;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.sidebar-loading {
|
||||
flex: 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue