Skip to content

Commit dc128c9

Browse files
committed
feat: 新增粘贴板创建页面
1 parent 53273ab commit dc128c9

File tree

2 files changed

+44
-90
lines changed

2 files changed

+44
-90
lines changed

src/pages/download/Index.vue

-74
Original file line numberDiff line numberDiff line change
@@ -165,80 +165,6 @@ function getNewVersioArch(arch) {
165165
</div>
166166
</div>
167167
</div>
168-
<!--<div class="livekit-container w-[100%] flex flex-row">
169-
<div id="livekit-title" class="flex flex-col pl-[2rem] py-[1rem]">
170-
<p>
171-
<span id="livekit" class="text-[24pt] leading-none">LiveKit</span>
172-
<span id="livekit-alt" class="flex leading-6 text-[14pt]"
173-
>安同 OS 安装及救援环境</span
174-
>
175-
<span id="livekit" class="text-[16pt] leading-8"
176-
>功能完备,应不时之需</span
177-
>
178-
</p>
179-
<p>
180-
<a href="#">发行说明</a>
181-
<span class="px-[.25rem]">·</span>
182-
<a href="#">配置需求</a>
183-
</p>
184-
</div>
185-
<div
186-
id="livekit-buttons"
187-
class="buttons-col flex flex-col justify-between gap-2 my-[1rem] pr-[8rem] ml-auto"
188-
>
189-
<button
190-
class="w-[224px] m-0 text-white bg-secondary hover:opacity-85 ml-1 cursor-pointer"
191-
>
192-
<p style="button-p">x86-64/AMD64</p>
193-
<p style="button-p">3.1GB ISO</p>
194-
</button>
195-
<button
196-
class="w-[224px] m-0 text-white bg-secondary hover:opacity-85 ml-1 cursor-pointer"
197-
>
198-
<p style="button-p">AArch64</p>
199-
<p style="button-p">3.1GB ISO</p>
200-
</button>
201-
<button
202-
class="w-[224px] m-0 text-white bg-secondary hover:opacity-85 ml-1 cursor-pointer"
203-
>
204-
<p style="button-p">龙架构 (LoongArch)</p>
205-
<p style="button-p">3.1GB ISO</p>
206-
</button>
207-
</div>
208-
</div>
209-
<div class="wsl-container w-[100%] flex flex-row min-h-[12rem]">
210-
<div id="wsl-title" class="flex flex-col pl-[2rem] py-[1rem]">
211-
<p>
212-
<span id="wsl" class="text-[24pt] leading-none">WSL 环境</span>
213-
<span id="wsl-alt" class="flex leading-6 text-[14pt]"
214-
>适用于 WSL 的安同 OS</span
215-
>
216-
<span id="wsl-description" class="text-[16pt] leading-8"
217-
>Windows 与安同双双联手,生产力触手可及</span
218-
>
219-
</p>
220-
<p>
221-
<a href="#">发行说明</a>
222-
<span class="px-[.25rem]">·</span>
223-
<a href="#">配置需求</a>
224-
</p>
225-
</div>
226-
<div
227-
id="wsl-buttons"
228-
class="buttons-col flex flex-col justify-between gap-2 my-[1rem] pr-[8rem] ml-auto"
229-
>
230-
<ms-store-badge
231-
class="mt-auto h-[60px]"
232-
style="max-width: 224px"
233-
productid="9NMDF21NV65Z"
234-
window-mode="popup"
235-
theme="dark"
236-
language="en-us"
237-
animation="on"
238-
>
239-
</ms-store-badge>
240-
</div>
241-
</div>-->
242168
</div>
243169
<category-second title="安同 OS(二级架构)" />
244170
<div class="pt-[20px] pb-[30px] px-[30px]">

src/pages/paste/Index.vue

+44-16
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const languageList = ref([
243243
"Zephir",
244244
]);
245245
246-
const selectDateTime = ref()
246+
const selectDateTime = ref();
247247
const pasteFormData = ref({
248248
title: "",
249249
contents: "",
@@ -252,7 +252,9 @@ const pasteFormData = ref({
252252
password: "",
253253
attachments: [],
254254
});
255-
const pasteRes = ref(null)
255+
const pasteRes = ref(null);
256+
257+
const linkPre = `${window.location.protocol}//${window.location.host}`
256258
257259
const submiting = ref(false);
258260
function submit() {
@@ -261,13 +263,13 @@ function submit() {
261263
.post("/pasteApi/api/paste/submit", pasteFormData.value)
262264
.then((res) => {
263265
submiting.value = false;
264-
pasteRes.value = res.data
266+
pasteRes.value = res.data;
265267
console.log(res.data);
266268
})
267269
.catch((err) => {
268270
submiting.value = false;
269271
console.log(err);
270-
pasteRes.value = {res: 'fail'}
272+
pasteRes.value = { res: "fail" };
271273
});
272274
}
273275
@@ -292,11 +294,22 @@ function removeFile() {
292294
}
293295
function expTimeChange(v) {
294296
if (v == null) {
295-
pasteFormData.value.expiry_time = 0
297+
pasteFormData.value.expiry_time = 0;
296298
} else {
297-
pasteFormData.value.expiry_time = v.getTime() / 1000
299+
pasteFormData.value.expiry_time = v.getTime() / 1000;
298300
}
299-
301+
}
302+
function back() {
303+
pasteRes.value = null
304+
pasteFormData.value = {
305+
title: "",
306+
language: 'text',
307+
content: "",
308+
expiry_time: 0,
309+
password: "",
310+
attachments: [],
311+
};
312+
selectDateTime.value = ''
300313
}
301314
</script>
302315

@@ -331,7 +344,11 @@ function expTimeChange(v) {
331344
>
332345
</el-form-item>
333346
<el-form-item label="到期时间">
334-
<el-date-picker type="datetime" v-model="selectDateTime" @change="expTimeChange" />
347+
<el-date-picker
348+
type="datetime"
349+
v-model="selectDateTime"
350+
@change="expTimeChange"
351+
/>
335352
</el-form-item>
336353
<el-form-item label="密码">
337354
<el-input v-model="pasteFormData.password" />
@@ -349,15 +366,26 @@ function expTimeChange(v) {
349366

350367
<div v-else>
351368
<el-result icon="success" title="成功" v-if="pasteRes.contents">
352-
<template #sub-title>
353-
<a :href="`https://website-2023.aosc.io/paste/detail?id=${pasteRes.paste_id_expr}`" class="text-link">
354-
{{ `https://website-2023.aosc.io/paste/detail?id=${pasteRes.paste_id_repr}` }}
355-
</a>
356-
</template>
357-
</el-result>
358-
<el-result v-else icon="error" sub-title="失败"></el-result>
369+
<template #sub-title>
370+
<a
371+
:href="`${linkPre}paste/detail?id=${pasteRes.paste_id_repr}`"
372+
class="text-link"
373+
>
374+
{{
375+
`${linkPre}paste/detail?id=${pasteRes.paste_id_repr}`
376+
}}
377+
</a>
378+
</template>
379+
<template #extra>
380+
<el-button type="primary" @click="back">返回</el-button>
381+
</template>
382+
</el-result>
383+
<el-result v-else icon="error" sub-title="失败">
384+
<template #extra>
385+
<el-button type="primary" @click="back">返回</el-button>
386+
</template>
387+
</el-result>
359388
</div>
360-
361389
</div>
362390
</template>
363391

0 commit comments

Comments
 (0)