This commit is contained in:
Generated
+660
-650
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@
|
|||||||
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']">取件码</label>
|
:class="[isDarkMode ? 'text-gray-300' : 'text-gray-800']">取件码</label>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<input id="code" v-model="code" type="text" ref="codeInput"
|
<input id="code" v-model="code" type="text" ref="codeInput"
|
||||||
class="w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10"
|
class="w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10"
|
||||||
:class="[
|
:class="[
|
||||||
isDarkMode ? 'bg-gray-700 bg-opacity-50' : 'bg-gray-100',
|
isDarkMode ? 'bg-gray-700 bg-opacity-50' : 'bg-gray-100',
|
||||||
{ 'ring-2 ring-red-500': error },
|
{ 'ring-2 ring-red-500': error },
|
||||||
@@ -229,8 +229,7 @@
|
|||||||
<CopyIcon class="w-4 h-4" />
|
<CopyIcon class="w-4 h-4" />
|
||||||
复制
|
复制
|
||||||
</button>
|
</button>
|
||||||
<button @click="showPreview = false"
|
<button @click="showPreview = false" class="p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10"
|
||||||
class="p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10"
|
|
||||||
:class="[
|
:class="[
|
||||||
isDarkMode
|
isDarkMode
|
||||||
? 'text-gray-400 hover:text-white hover:bg-white'
|
? 'text-gray-400 hover:text-white hover:bg-white'
|
||||||
@@ -241,13 +240,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1 overflow-y-auto custom-scrollbar">
|
<div class="flex-1 overflow-y-auto custom-scrollbar">
|
||||||
<div class="prose max-w-none p-6 rounded-xl"
|
<div class="prose max-w-none p-6 rounded-xl" :class="[
|
||||||
:class="[
|
isDarkMode
|
||||||
isDarkMode
|
? 'prose-invert bg-gray-900 bg-opacity-50'
|
||||||
? 'prose-invert bg-gray-900 bg-opacity-50'
|
: 'bg-gray-50'
|
||||||
: 'bg-gray-50'
|
]" v-html="renderedContent">
|
||||||
]"
|
|
||||||
v-html="renderedContent">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -515,6 +512,7 @@ const showContentPreview = () => {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@keyframes blob {
|
@keyframes blob {
|
||||||
|
|
||||||
0%,
|
0%,
|
||||||
100% {
|
100% {
|
||||||
transform: translate(0, 0) scale(1);
|
transform: translate(0, 0) scale(1);
|
||||||
|
|||||||
@@ -638,7 +638,8 @@ const handlePaste = async (event: ClipboardEvent) => {
|
|||||||
const items = event.clipboardData?.items
|
const items = event.clipboardData?.items
|
||||||
if (!items) return
|
if (!items) return
|
||||||
|
|
||||||
for (const item of items) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
const item = items[i]
|
||||||
if (item.kind === 'file') {
|
if (item.kind === 'file') {
|
||||||
const file = item.getAsFile()
|
const file = item.getAsFile()
|
||||||
if (file) {
|
if (file) {
|
||||||
@@ -762,6 +763,40 @@ const getUnit = (value: string = expirationMethod.value) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getExpirationTime = (method: string, value: string) => {
|
||||||
|
if (method === 'forever') {
|
||||||
|
return '永久'
|
||||||
|
}
|
||||||
|
if (method === 'count') {
|
||||||
|
return `${value}次后过期`
|
||||||
|
}
|
||||||
|
|
||||||
|
const now = new Date()
|
||||||
|
const expireValue = parseInt(value)
|
||||||
|
|
||||||
|
switch (method) {
|
||||||
|
case 'minute':
|
||||||
|
now.setMinutes(now.getMinutes() + expireValue)
|
||||||
|
break
|
||||||
|
case 'hour':
|
||||||
|
now.setHours(now.getHours() + expireValue)
|
||||||
|
break
|
||||||
|
case 'day':
|
||||||
|
now.setDate(now.getDate() + expireValue)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
return `${value}${getUnit(method)}后过期`
|
||||||
|
}
|
||||||
|
|
||||||
|
const year = now.getFullYear()
|
||||||
|
const month = (now.getMonth() + 1).toString().padStart(2, '0')
|
||||||
|
const day = now.getDate().toString().padStart(2, '0')
|
||||||
|
const hours = now.getHours().toString().padStart(2, '0')
|
||||||
|
const minutes = now.getMinutes().toString().padStart(2, '0')
|
||||||
|
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}过期`
|
||||||
|
}
|
||||||
|
|
||||||
const handleChunkUpload = async (file: File) => {
|
const handleChunkUpload = async (file: File) => {
|
||||||
try {
|
try {
|
||||||
// 默认切片大小为5MB
|
// 默认切片大小为5MB
|
||||||
@@ -959,7 +994,7 @@ const handleSubmit = async () => {
|
|||||||
expiration:
|
expiration:
|
||||||
expirationMethod.value === 'forever'
|
expirationMethod.value === 'forever'
|
||||||
? '永久'
|
? '永久'
|
||||||
: `${expirationValue.value}${getUnit()}后过期`,
|
: getExpirationTime(expirationMethod.value, expirationValue.value),
|
||||||
retrieveCode: retrieveCode
|
retrieveCode: retrieveCode
|
||||||
}
|
}
|
||||||
fileDataStore.addShareData(newRecord)
|
fileDataStore.addShareData(newRecord)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<h2 class="text-2xl font-bold mb-6" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
|
<h2 class="text-2xl font-bold mb-6" :class="[isDarkMode ? 'text-white' : 'text-gray-800']">
|
||||||
仪表盘
|
仪表盘
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<!-- 统计卡片区域 -->
|
<!-- 统计卡片区域 -->
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
||||||
<div class="p-6 rounded-lg shadow-md transition-colors duration-300"
|
<div class="p-6 rounded-lg shadow-md transition-colors duration-300"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|||||||
Reference in New Issue
Block a user