Compare commits
No commits in common. "a2beb45302052070cc80800624ba6eb93927d5af" and "ac7533dec5a0431bb3b3d6e70d2682bef498d8fb" have entirely different histories.
a2beb45302
...
ac7533dec5
1
ios/.gitignore
vendored
1
ios/.gitignore
vendored
@ -11,4 +11,3 @@ capacitor-cordova-ios-plugins
|
|||||||
# Generated Config files
|
# Generated Config files
|
||||||
App/App/capacitor.config.json
|
App/App/capacitor.config.json
|
||||||
App/App/config.xml
|
App/App/config.xml
|
||||||
App/App.xcarchive
|
|
@ -48,7 +48,6 @@
|
|||||||
"typescript": "~5.4.0",
|
"typescript": "~5.4.0",
|
||||||
"unocss": "^0.58.7",
|
"unocss": "^0.58.7",
|
||||||
"vite": "^5.1.6",
|
"vite": "^5.1.6",
|
||||||
"vite-plugin-pwa": "^0.19.7",
|
|
||||||
"vue-tsc": "^2.0.6"
|
"vue-tsc": "^2.0.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,10 @@
|
|||||||
Attached {{ props.attachments.length }} attachment(s)
|
Attached {{ props.attachments.length }} attachment(s)
|
||||||
</v-chip>
|
</v-chip>
|
||||||
|
|
||||||
<v-card v-else variant="outlined" class="max-w-[540px] max-h-[720px]">
|
<v-card v-else variant="outlined" class="max-w-[540px]">
|
||||||
<v-carousel hide-delimiter-background height="100%" :show-arrows="false">
|
<v-carousel hide-delimiters progress="primary" show-arrows="hover" height="100%">
|
||||||
<v-carousel-item v-for="item in attachments">
|
<v-carousel-item v-for="item in attachments">
|
||||||
<img v-if="item.type === 1" :src="getUrl(item)" :alt="item.filename" class="cursor-zoom-in"
|
<img v-if="item.type === 1" :src="getUrl(item)" class="cursor-zoom-in" @click="openLightbox" />
|
||||||
@click="openLightbox" />
|
|
||||||
<video v-if="item.type === 2" controls class="w-full">
|
<video v-if="item.type === 2" controls class="w-full">
|
||||||
<source :src="getUrl(item)" />
|
<source :src="getUrl(item)" />
|
||||||
</video>
|
</video>
|
||||||
@ -19,14 +18,7 @@
|
|||||||
|
|
||||||
<vue-easy-lightbox teleport="#app" :visible="lightbox" :imgs="[getUrl(current)]" @hide="lightbox = false">
|
<vue-easy-lightbox teleport="#app" :visible="lightbox" :imgs="[getUrl(current)]" @hide="lightbox = false">
|
||||||
<template v-slot:close-btn="{ close }">
|
<template v-slot:close-btn="{ close }">
|
||||||
<v-btn
|
<v-btn class="fixed left-2 top-2" icon="mdi-close" variant="text" color="white" @click="close" />
|
||||||
class="fixed left-2 top-2"
|
|
||||||
icon="mdi-close"
|
|
||||||
variant="text"
|
|
||||||
color="white"
|
|
||||||
:style="`margin-top: ${safeAreaTop}`"
|
|
||||||
@click="close"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</vue-easy-lightbox>
|
</vue-easy-lightbox>
|
||||||
</v-card>
|
</v-card>
|
||||||
@ -35,23 +27,16 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { buildRequestUrl } from "@/scripts/request"
|
import { buildRequestUrl } from "@/scripts/request"
|
||||||
import { computed, ref } from "vue"
|
import { computed, ref } from "vue"
|
||||||
import { useUI } from "@/stores/ui"
|
|
||||||
import VueEasyLightbox from "vue-easy-lightbox"
|
import VueEasyLightbox from "vue-easy-lightbox"
|
||||||
|
|
||||||
const props = defineProps<{ attachments: any[]; overview?: boolean }>()
|
const props = defineProps<{ attachments: any[]; overview?: boolean }>()
|
||||||
|
|
||||||
const ui = useUI()
|
|
||||||
|
|
||||||
const lightbox = ref(false)
|
const lightbox = ref(false)
|
||||||
const focus = ref(0)
|
const focus = ref(0)
|
||||||
|
|
||||||
const current = computed(() => props.attachments[focus.value])
|
const current = computed(() => props.attachments[focus.value])
|
||||||
const canLightbox = computed(() => current.value.type === 1)
|
const canLightbox = computed(() => current.value.type === 1)
|
||||||
|
|
||||||
const safeAreaTop = computed(() => {
|
|
||||||
return `${ui.safeArea.top}px`
|
|
||||||
})
|
|
||||||
|
|
||||||
function getUrl(item: any) {
|
function getUrl(item: any) {
|
||||||
return item.external_url ? item.external_url : buildRequestUrl("interactive", `/api/attachments/o/${item.file_id}`)
|
return item.external_url ? item.external_url : buildRequestUrl("interactive", `/api/attachments/o/${item.file_id}`)
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<template>
|
<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 />
|
<comment-editor />
|
||||||
</v-bottom-sheet>
|
</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 />
|
<moment-editor />
|
||||||
</v-bottom-sheet>
|
</v-bottom-sheet>
|
||||||
<v-bottom-sheet v-model="editor.show.article" eager>
|
<v-bottom-sheet v-model="editor.show.article" eager>
|
||||||
<article-editor />
|
<article-editor />
|
||||||
</v-bottom-sheet>
|
</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 />
|
<post-deletion />
|
||||||
</v-bottom-sheet>
|
</v-bottom-sheet>
|
||||||
</template>
|
</template>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<v-card variant="tonal">
|
<v-card variant="tonal">
|
||||||
<v-list>
|
<v-list>
|
||||||
<v-list-item v-for="(item, idx) in props.value" :title="getFileName(item)">
|
<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>
|
<template #append>
|
||||||
<v-btn icon="mdi-delete" size="small" variant="text" color="error" @click="dispose(idx)" />
|
<v-btn icon="mdi-delete" size="small" variant="text" color="error" @click="dispose(idx)" />
|
||||||
</template>
|
</template>
|
||||||
@ -54,11 +54,13 @@ async function upload(file?: any) {
|
|||||||
|
|
||||||
const data = new FormData()
|
const data = new FormData()
|
||||||
if (!file) {
|
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(picked.value[0]))
|
||||||
data.set("hashcode", await calculateHashCode(file))
|
|
||||||
|
|
||||||
emits("update:uploading", true)
|
emits("update:uploading", true)
|
||||||
const res = await request("interactive", "/api/attachments", {
|
const res = await request("interactive", "/api/attachments", {
|
||||||
|
@ -1,29 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-navigation-drawer
|
<v-navigation-drawer v-model="drawerOpen" color="grey-lighten-5" width="320" :order="0" floating>
|
||||||
v-model="drawerOpen"
|
|
||||||
color="grey-lighten-5"
|
|
||||||
width="320"
|
|
||||||
:rail="drawerMini"
|
|
||||||
:rail-width="58"
|
|
||||||
:order="0"
|
|
||||||
@click="drawerMini = false"
|
|
||||||
>
|
|
||||||
<div class="flex flex-col h-full">
|
<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]"
|
<div class="flex items-center px-3 pb-2.5 border-opacity-15" style="border-bottom-width: thin"
|
||||||
style="border-bottom-width: thin"
|
:style="`padding-top: max(${safeAreaTop}, 16px)`">
|
||||||
:style="`padding-top: max(${safeAreaTop}, 10px)`">
|
<img src="/favicon.png" width="36" height="36" class="block" />
|
||||||
<div class="flex items-center">
|
<div class="ms-6 font-medium">Solar Network</div>
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
@ -32,7 +13,7 @@
|
|||||||
|
|
||||||
<!-- User info -->
|
<!-- User info -->
|
||||||
<v-list class="border-opacity-15 h-[64px]" style="border-top-width: thin"
|
<v-list class="border-opacity-15 h-[64px]" style="border-top-width: thin"
|
||||||
:style="`margin-bottom: ${safeAreaBottom}`">
|
:style="`margin-bottom: ${safeAreaBottom}`">
|
||||||
<v-list-item :subtitle="username" :title="nickname">
|
<v-list-item :subtitle="username" :title="nickname">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<v-avatar icon="mdi-account-circle" :image="id.userinfo.data?.picture" />
|
<v-avatar icon="mdi-account-circle" :image="id.userinfo.data?.picture" />
|
||||||
@ -45,7 +26,7 @@
|
|||||||
|
|
||||||
<v-list density="compact">
|
<v-list density="compact">
|
||||||
<v-list-item title="Solarpass" prepend-icon="mdi-passport-biometric" target="_blank"
|
<v-list-item title="Solarpass" prepend-icon="mdi-passport-biometric" target="_blank"
|
||||||
:href="passportUrl" />
|
:href="passportUrl" />
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
|
||||||
@ -58,7 +39,7 @@
|
|||||||
|
|
||||||
<v-app-bar height="64" color="primary" scroll-behavior="hide" :order="2" flat>
|
<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">
|
<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' }">
|
<router-link :to="{ name: 'explore' }">
|
||||||
<h2 class="ml-2 text-lg font-500">Solian</h2>
|
<h2 class="ml-2 text-lg font-500">Solian</h2>
|
||||||
@ -77,10 +58,10 @@
|
|||||||
</v-main>
|
</v-main>
|
||||||
|
|
||||||
<v-menu open-on-hover open-on-click :open-delay="0" :close-delay="0" location="top"
|
<v-menu open-on-hover open-on-click :open-delay="0" :close-delay="0" location="top"
|
||||||
transition="scroll-y-reverse-transition">
|
transition="scroll-y-reverse-transition">
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }">
|
||||||
<v-fab v-bind="props" appear class="editor-fab" icon="mdi-pencil" color="primary" size="64"
|
<v-fab v-bind="props" appear class="editor-fab" icon="mdi-pencil" color="primary" size="64"
|
||||||
:active="id.userinfo.isLoggedIn" />
|
:active="id.userinfo.isLoggedIn" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="flex flex-col items-center gap-4 mb-4">
|
<div class="flex flex-col items-center gap-4 mb-4">
|
||||||
@ -143,7 +124,10 @@ const passportUrl = computed(() => {
|
|||||||
meta.readWellKnown()
|
meta.readWellKnown()
|
||||||
|
|
||||||
const drawerOpen = ref(true)
|
const drawerOpen = ref(true)
|
||||||
const drawerMini = ref(false)
|
|
||||||
|
function toggleDrawer() {
|
||||||
|
drawerOpen.value = !drawerOpen.value
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -1,28 +1,13 @@
|
|||||||
import { fileURLToPath, URL } from "node:url"
|
import { fileURLToPath, URL } from "node:url"
|
||||||
|
|
||||||
import { defineConfig } from "vite"
|
import { defineConfig } from "vite"
|
||||||
import { VitePWA as vitePWA } from "vite-plugin-pwa"
|
|
||||||
import vue from "@vitejs/plugin-vue"
|
import vue from "@vitejs/plugin-vue"
|
||||||
import vueJsx from "@vitejs/plugin-vue-jsx"
|
import vueJsx from "@vitejs/plugin-vue-jsx"
|
||||||
import unocss from "unocss/vite"
|
import unocss from "unocss/vite"
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [vue(), vueJsx(), unocss()],
|
||||||
vue(),
|
|
||||||
vueJsx(),
|
|
||||||
unocss(),
|
|
||||||
vitePWA({
|
|
||||||
registerType: "autoUpdate",
|
|
||||||
useCredentials: true,
|
|
||||||
manifest: {
|
|
||||||
name: "Solian",
|
|
||||||
short_name: "Solian",
|
|
||||||
description: "The Solar Network entrypoint.",
|
|
||||||
theme_color: "#4b5094",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": fileURLToPath(new URL("./src", import.meta.url))
|
"@": fileURLToPath(new URL("./src", import.meta.url))
|
||||||
|
Reference in New Issue
Block a user