forked from AkkomaGang/admin-fe
Fix downloading remote packs
This commit is contained in:
parent
dca1f2cce8
commit
9137362dc7
3 changed files with 6 additions and 8 deletions
|
@ -52,17 +52,15 @@ export async function deletePack(host, token, packName) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function downloadFrom(host, instance, packName, as, token) {
|
export async function downloadFrom(instanceAddress, packName, as, host, token) {
|
||||||
if (as.trim() === '') {
|
|
||||||
as = null
|
|
||||||
}
|
|
||||||
|
|
||||||
return await request({
|
return await request({
|
||||||
baseURL: baseName(host),
|
baseURL: baseName(host),
|
||||||
url: '/api/pleroma/emoji/packs/download',
|
url: '/api/pleroma/emoji/packs/download',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: authHeaders(token),
|
headers: authHeaders(token),
|
||||||
data: { url: baseName(instance), name: packName, as },
|
data: as.trim() === ''
|
||||||
|
? { url: baseName(instanceAddress), name: packName }
|
||||||
|
: { url: baseName(instanceAddress), name: packName, as },
|
||||||
timeout: 0
|
timeout: 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ const emojiPacks = {
|
||||||
await deletePack(getters.authHost, getters.token, name)
|
await deletePack(getters.authHost, getters.token, name)
|
||||||
},
|
},
|
||||||
async DownloadFrom({ getters }, { instanceAddress, packName, as }) {
|
async DownloadFrom({ getters }, { instanceAddress, packName, as }) {
|
||||||
const result = await downloadFrom(getters.authHost, instanceAddress, packName, as, getters.token)
|
const result = await downloadFrom(instanceAddress, packName, as, getters.authHost, getters.token)
|
||||||
|
|
||||||
if (result.data === 'ok') {
|
if (result.data === 'ok') {
|
||||||
Message({
|
Message({
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-link
|
<el-link
|
||||||
v-if="pack.pack['can-download']"
|
v-if="pack.pack['can-download'] && pack.pack['fallback-src']"
|
||||||
:href="pack.pack['fallback-src']"
|
:href="pack.pack['fallback-src']"
|
||||||
:underline="false"
|
:underline="false"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
Loading…
Reference in a new issue