mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
fix dashboard refresh
This commit is contained in:
@@ -197,8 +197,13 @@ async function getPluginDashboard(id: string) {
|
|||||||
try {
|
try {
|
||||||
api.get(`/plugin/dashboard/${id}`).then((res: any) => {
|
api.get(`/plugin/dashboard/${id}`).then((res: any) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
// 保存到仪表板配置中
|
// 保存到仪表板配置中,如果已经存在则替换
|
||||||
dashboardConfigs.value.push(res)
|
const index = dashboardConfigs.value.findIndex((item: { id: string }) => item.id === id)
|
||||||
|
if (index !== -1) {
|
||||||
|
dashboardConfigs.value[index] = res
|
||||||
|
} else {
|
||||||
|
dashboardConfigs.value.push(res)
|
||||||
|
}
|
||||||
// 排序
|
// 排序
|
||||||
sortDashboardConfigs()
|
sortDashboardConfigs()
|
||||||
// 定时刷新
|
// 定时刷新
|
||||||
|
|||||||
Reference in New Issue
Block a user