fix: username sanitization, canvas creation modal fixes, and auth headers for tasks

This commit is contained in:
2026-05-03 21:12:55 +05:00
parent 4a912d972e
commit f0b5883084
5 changed files with 47 additions and 39 deletions
+18 -10
View File
@@ -9,13 +9,13 @@
<div class="flex items-center justify-between mb-8">
<h1 class="text-2xl font-bold text-slate-100">Мои Карты</h1>
<div class="flex gap-2">
<div class="flex items-center gap-3">
<button @click="triggerImport" class="px-4 py-2 bg-slate-700 hover:bg-slate-600 text-white rounded-lg font-medium transition">
Импорт .canvas
</button>
<input ref="importInput" type="file" accept=".canvas,.json" class="hidden" @change="handleImport" />
<button @click="showCreateModal = true" class="px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg font-medium transition">
+ Новая Карта
<button @click="openCreateModal" class="px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg font-bold shadow-lg shadow-blue-900/20 transition flex items-center gap-2">
<span>➕</span> Создать
</button>
</div>
</div>
@@ -223,11 +223,19 @@ const showCreateModal = ref(false)
const importInput = ref(null)
const activeTab = ref('personal')
const newCanvas = reactive({
name: '',
visibility: 'private',
groupId: ''
})
const newCanvas = reactive({
name: '',
visibility: 'private',
groupId: ''
})
const openCreateModal = () => {
newCanvas.name = ''
newCanvas.visibility = 'private'
newCanvas.groupId = ''
showSettingsModal.value = false
showCreateModal.value = true
}
const showSettingsModal = ref(false)
const saving = ref(false)
@@ -293,9 +301,9 @@ const filteredCanvases = computed(() => {
switch (activeTab.value) {
case 'personal':
return canvases.value.filter(c => c.ownerId === userId && !c.groupId)
return canvases.value.filter(c => c.ownerId === userId && (!c.groupId || c.groupId === ''))
case 'team':
return canvases.value.filter(c => !!c.groupId)
return canvases.value.filter(c => c.groupId && c.groupId !== '')
case 'public':
return canvases.value.filter(c => c.isPublic)
default: