Skip to content

Commit

Permalink
[fix] upload
Browse files Browse the repository at this point in the history
  • Loading branch information
WindLX committed Dec 10, 2023
1 parent 0a3a66c commit a4d1e4a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[system]
host = "127.0.0.1"
port = 13955
port = 13956
backend_host = "127.0.0.1"
backend_port = 13956

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pap",
"private": true,
"version": "0.2.0",
"version": "0.2.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements_release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ annotated-types==0.6.0
anyio==3.7.1
bcrypt==4.0
cffi==1.16.0
charset-normalizer==3.3.2.1
charset-normalizer==3.3.2
click==8.1.7
cryptography==41.0.5
ecdsa==0.18.0
Expand Down
5 changes: 2 additions & 3 deletions src/components/Content/Resourcespace.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ElLoading, ElEmpty, ElInput, ElButton } from 'element-plus';
import { ElLoading, ElInput, ElButton } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { ResourceSchema } from '@/schemas/resource';
import ResourceAdd from '../Resource/ResourceAdd.vue';
Expand Down Expand Up @@ -37,13 +37,12 @@ onMounted(async () => {
</el-button>
</template>
</el-input>
<div class="cards" id="cards-loader" v-if="resources.length !== 0">
<div class="cards" id="cards-loader">
<ResourceCard v-for="(resource, index) in resources" :key="index" :name="resource.name" :url="resource.url"
@delete="handleDeleteResource(index)" v-show="filterName(resource.name)">
</ResourceCard>
<ResourceAdd @upload="handleAddNewResource" :is-card="true" />
</div>
<ElEmpty v-else class="empty" description="暂无托管资源" />
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Resource/ResourceAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ async function uploadFileAsync() {
const loadingInstance = ElLoading.service({ target: "#cards-loader", fullscreen: true })
const file = fileInputRef.value!.files![0];
const formData = await createFormDataAsync(file)
loadingInstance.close()
const newResource = await ResourceApi.uploadResource(formData)
loadingInstance.close()
emits('upload', newResource)
}
</script>
Expand Down

0 comments on commit a4d1e4a

Please sign in to comment.