Compare commits

..

No commits in common. "a2beb45302052070cc80800624ba6eb93927d5af" and "ac7533dec5a0431bb3b3d6e70d2682bef498d8fb" have entirely different histories.

7 changed files with 28 additions and 74 deletions

1
ios/.gitignore vendored
View File

@ -11,4 +11,3 @@ capacitor-cordova-ios-plugins
# Generated Config files
App/App/capacitor.config.json
App/App/config.xml
App/App.xcarchive

View File

@ -48,7 +48,6 @@
"typescript": "~5.4.0",
"unocss": "^0.58.7",
"vite": "^5.1.6",
"vite-plugin-pwa": "^0.19.7",
"vue-tsc": "^2.0.6"
}
}

View File

@ -3,11 +3,10 @@
Attached {{ props.attachments.length }} attachment(s)
</v-chip>
<v-card v-else variant="outlined" class="max-w-[540px] max-h-[720px]">
<v-carousel hide-delimiter-background height="100%" :show-arrows="false">
<v-card v-else variant="outlined" class="max-w-[540px]">
<v-carousel hide-delimiters progress="primary" show-arrows="hover" height="100%">
<v-carousel-item v-for="item in attachments">
<img v-if="item.type === 1" :src="getUrl(item)" :alt="item.filename" class="cursor-zoom-in"
@click="openLightbox" />
<img v-if="item.type === 1" :src="getUrl(item)" class="cursor-zoom-in" @click="openLightbox" />
<video v-if="item.type === 2" controls class="w-full">
<source :src="getUrl(item)" />
</video>
@ -19,14 +18,7 @@
<vue-easy-lightbox teleport="#app" :visible="lightbox" :imgs="[getUrl(current)]" @hide="lightbox = false">
<template v-slot:close-btn="{ close }">
<v-btn
class="fixed left-2 top-2"
icon="mdi-close"
variant="text"
color="white"
:style="`margin-top: ${safeAreaTop}`"
@click="close"
/>
<v-btn class="fixed left-2 top-2" icon="mdi-close" variant="text" color="white" @click="close" />
</template>
</vue-easy-lightbox>
</v-card>
@ -35,23 +27,16 @@
<script setup lang="ts">
import { buildRequestUrl } from "@/scripts/request"
import { computed, ref } from "vue"
import { useUI } from "@/stores/ui"
import VueEasyLightbox from "vue-easy-lightbox"
const props = defineProps<{ attachments: any[]; overview?: boolean }>()
const ui = useUI()
const lightbox = ref(false)
const focus = ref(0)
const current = computed(() => props.attachments[focus.value])
const canLightbox = computed(() => current.value.type === 1)
const safeAreaTop = computed(() => {
return `${ui.safeArea.top}px`
})
function getUrl(item: any) {
return item.external_url ? item.external_url : buildRequestUrl("interactive", `/api/attachments/o/${item.file_id}`)
}

View File

@ -1,15 +1,15 @@
<template>
<v-bottom-sheet class="max-w-[480px]" v-model="editor.show.comment" eager>
<v-bottom-sheet v-model="editor.show.comment" eager>
<comment-editor />
</v-bottom-sheet>
<v-bottom-sheet class="max-w-[480px]" v-model="editor.show.moment" eager>
<v-bottom-sheet v-model="editor.show.moment" eager>
<moment-editor />
</v-bottom-sheet>
<v-bottom-sheet v-model="editor.show.article" eager>
<article-editor />
</v-bottom-sheet>
<v-bottom-sheet class="max-w-[480px]" v-model="editor.show.delete" eager>
<v-bottom-sheet v-model="editor.show.delete" eager>
<post-deletion />
</v-bottom-sheet>
</template>

View File

@ -22,7 +22,7 @@
<v-card variant="tonal">
<v-list>
<v-list-item v-for="(item, idx) in props.value" :title="getFileName(item)">
<template #subtitle> {{ getFileType(item) }} · {{ formatBytes(item.filesize) }}</template>
<template #subtitle> {{ getFileType(item) }} · {{ formatBytes(item.filesize) }} </template>
<template #append>
<v-btn icon="mdi-delete" size="small" variant="text" color="error" @click="dispose(idx)" />
</template>
@ -54,11 +54,13 @@ async function upload(file?: any) {
const data = new FormData()
if (!file) {
file = picked.value[0]
if (!picked.value) return
data.set("attachment", picked.value[0])
} else {
data.set("attachment", file)
}
data.set("attachment", file)
data.set("hashcode", await calculateHashCode(file))
data.set("hashcode", await calculateHashCode(picked.value[0]))
emits("update:uploading", true)
const res = await request("interactive", "/api/attachments", {

View File

@ -1,29 +1,10 @@
<template>
<v-navigation-drawer
v-model="drawerOpen"
color="grey-lighten-5"
width="320"
:rail="drawerMini"
:rail-width="58"
:order="0"
@click="drawerMini = false"
>
<v-navigation-drawer v-model="drawerOpen" color="grey-lighten-5" width="320" :order="0" floating>
<div class="flex flex-col h-full">
<div class="flex items-center justify-between px-3 pb-2.5 border-opacity-15 min-h-[64px]"
style="border-bottom-width: thin"
:style="`padding-top: max(${safeAreaTop}, 10px)`">
<div class="flex items-center">
<img src="/favicon.png" alt="Logo" width="36" height="36" class="block" />
<div v-show="!drawerMini" class="ms-6 font-medium">Solar Network</div>
</div>
<v-btn
v-show="!drawerMini"
icon="mdi-arrow-collapse-left"
size="small"
variant="text"
@click.stop="drawerMini = true"
/>
<div class="flex items-center px-3 pb-2.5 border-opacity-15" style="border-bottom-width: thin"
:style="`padding-top: max(${safeAreaTop}, 16px)`">
<img src="/favicon.png" width="36" height="36" class="block" />
<div class="ms-6 font-medium">Solar Network</div>
</div>
<div class="flex-grow-1">
@ -58,7 +39,7 @@
<v-app-bar height="64" color="primary" scroll-behavior="hide" :order="2" flat>
<div class="max-md:px-5 md:px-12 flex flex-grow-1 items-center">
<v-app-bar-nav-icon variant="text" @click.stop="drawerOpen = !drawerOpen" />
<v-app-bar-nav-icon variant="text" @click.stop="toggleDrawer" />
<router-link :to="{ name: 'explore' }">
<h2 class="ml-2 text-lg font-500">Solian</h2>
@ -143,7 +124,10 @@ const passportUrl = computed(() => {
meta.readWellKnown()
const drawerOpen = ref(true)
const drawerMini = ref(false)
function toggleDrawer() {
drawerOpen.value = !drawerOpen.value
}
</script>
<style scoped>

View File

@ -1,28 +1,13 @@
import { fileURLToPath, URL } from "node:url"
import { defineConfig } from "vite"
import { VitePWA as vitePWA } from "vite-plugin-pwa"
import vue from "@vitejs/plugin-vue"
import vueJsx from "@vitejs/plugin-vue-jsx"
import unocss from "unocss/vite"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
unocss(),
vitePWA({
registerType: "autoUpdate",
useCredentials: true,
manifest: {
name: "Solian",
short_name: "Solian",
description: "The Solar Network entrypoint.",
theme_color: "#4b5094",
},
})
],
plugins: [vue(), vueJsx(), unocss()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url))