Feature(custom): add 3s intermedia to avoid github api rate limit

This commit is contained in:
Kuingsmile
2026-01-27 15:55:41 +08:00
parent a6f54e6493
commit 9910973732
8 changed files with 31 additions and 11 deletions

View File

@@ -28,6 +28,7 @@
- 文件浏览页面新增列表模式支持。
- 现在第一次启动时根据系统语言自动选择界面语言
- 现在windows系统第一次启动时会默认显示主界面
- 管理页面-Github上传多个文件时增加了3s的间隔时间避免触发Github的API速率限制
- 现在支持手动关闭 GPU 加速,解决部分硬件兼容性导致的黑屏或闪烁问题
- 新增高级动画设置,开启后可获得更佳的 UI 交互体验

View File

@@ -28,6 +28,7 @@ Use custom `javascript` scripts to extend PicList's functionality without the ne
- Optimized the configuration saving logic for independent image hosting processing settings.
- Now automatically selects the interface language based on the system language on the first launch.
- Now the main interface will be displayed by default on the first launch of Windows systems.
- Added a 3-second interval when uploading multiple files to GitHub on the management page to avoid triggering GitHub's API rate limits.
- Now supports manually disabling GPU acceleration to resolve black screen or flickering issues caused by some hardware compatibility.
- Added advanced animation settings for a better UI interaction experience when enabled.

View File

@@ -480,7 +480,8 @@ class GithubApi {
targetFileBucket: repo,
targetFileRegion: region,
})
gotUpload(
await gotUpload(
instance,
`${this.baseUrl}/repos/${this.username}/${repo}/contents/${trimKey}`,
'PUT',
@@ -496,6 +497,7 @@ class GithubApi {
false,
getAgent(this.proxy),
)
await new Promise(resolve => setTimeout(resolve, 3000))
}
return true
}

View File

@@ -39,6 +39,7 @@ import { onClickOutside } from '@vueuse/core'
import { ChevronDownIcon, SortAscIcon } from 'lucide-vue-next'
import { nextTick, ref } from 'vue'
const emit = defineEmits<(e: 'change', key: string) => void>()
const dropdownRef = ref(null)
const modelValue = defineModel<string>()
const triggerRef = ref<HTMLElement | null>(null)
@@ -47,6 +48,7 @@ const optionsRef = ref<HTMLElement | null>(null)
function selectItem(key: string) {
modelValue.value = key
dropDownOpen.value = false
emit('change', key)
}
const dropDownOpen = ref(false)

View File

@@ -19,6 +19,7 @@
title=""
:key-list="customDomainList.map(item => item.value)"
:fronticon="false"
@change="handleChangeCustomUrlInput"
/>
<input
v-else-if="isShowCustomDomainInput"
@@ -914,7 +915,7 @@
width="900px"
height="90vh"
>
<div class="no-scrollbar w-full flex-1 overflow-hidden rounded-md border border-border p-4 shadow-md">
<div class="no-scrollbar h-full w-full flex-1 overflow-hidden rounded-md border border-border p-4 shadow-md">
<div class="flex h-full w-full flex-col">
<!-- Download Tasks Tabs -->
<div class="flex flex-1 flex-col gap-2 overflow-hidden border-t border-border-secondary">

View File

@@ -139,6 +139,7 @@
v-if="picBedSwitchDialogVisible"
v-model:visible="picBedSwitchDialogVisible"
:title="t('pages.manage.main.switchPicBed')"
height="auto"
>
<div class="no-scrollbar h-full w-full overflow-auto p-8">
<div class="grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-4">

View File

@@ -10,6 +10,14 @@
<h1 class="m-0 text-2xl font-semibold tracking-tight text-main">{{ t('pages.manage.setting.title') }}</h1>
</div>
</div>
<div class="flex flex-wrap gap-3 overflow-visible">
<CustomButton
type="primary"
:icon="FileText"
:text="t('pages.settings.sync.editCloudConfigFile')"
@click="openFile('manage.json')"
/>
</div>
</div>
<div
class="relative flex h-full w-full flex-1 items-center justify-center overflow-hidden rounded-2xl border border-border-secondary p-1 shadow-md"
@@ -18,9 +26,10 @@
<!-- Cache Info Card -->
<SettingSection :title="t('pages.manage.setting.section.cache')" :icon="Trash2Icon" only-one-row>
<CustomButton
type="secondary"
type="custom"
:icon="Trash2Icon"
class="bg-warning/20 p-4!"
class="bg-warning/50 p-4! text-secondary hover:bg-warning/80 hover:text-white"
:text-class="'group-hover:text-white'"
:text="
t('pages.manage.setting.clearCache', {
percent: dbSizeAvailableRate,
@@ -135,7 +144,7 @@
</template>
<script lang="ts" setup>
import { Download, Edit2Icon, FolderIcon, Settings, Trash2Icon } from 'lucide-vue-next'
import { Download, Edit2Icon, FileText, FolderIcon, Settings, Trash2Icon } from 'lucide-vue-next'
import { computed, nextTick, onBeforeMount, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
@@ -303,6 +312,10 @@ async function initData() {
await nextTick() // 确保DOM更新完成
}
async function openFile(file: string) {
window.electron.sendRPC(IRPCActionType.PICLIST_OPEN_FILE, file)
}
async function handleDownloadDirClick() {
const result = await window.electron.triggerRPC<any>(IRPCActionType.MANAGE_SELECT_DOWNLOAD_FOLDER)
if (result) {

View File

@@ -619,13 +619,12 @@
<ListTodoIcon class="text-accent opacity-90" :size="48" />
<h4 class="m-0 text-xl font-semibold text-main">{{ t('pages.upload.taskQueue.empty') }}</h4>
<p class="m-0 max-w-[400px] text-base text-secondary">{{ t('pages.upload.taskQueue.emptyHint') }}</p>
<button
class="flex cursor-pointer items-center justify-center gap-2 rounded-md bg-accent px-4 py-2.5 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-all duration-fast ease-standard hover:-translate-y-[2px] hover:shadow-md"
<CustomButton
type="primary"
:icon="PlusIcon"
:text="t('pages.upload.taskQueue.selectFiles')"
@click="addFilesToTask"
>
<PlusIcon :size="16" />
<span class="mt-0.5">{{ t('pages.upload.taskQueue.selectFiles') }}</span>
</button>
/>
</div>
</div>
</CustomModal>