Skip to content

Commit c9963cb

Browse files
feat(app): fix sync custom app failed
1 parent c93d229 commit c9963cb

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

frontend/src/api/interface/app.ts

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export namespace App {
7070
tags?: string[];
7171
type?: string;
7272
recommend?: boolean;
73+
resource?: string;
74+
showCurrentArch?: boolean;
7375
}
7476

7577
export interface AppParams {

frontend/src/views/app-store/apps/index.vue

+22-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
</LayoutContent>
168168
<Install ref="installRef" />
169169
<Detail ref="detailRef" />
170-
<TaskLog ref="taskLogRef" @close="search(req)" />
170+
<TaskLog ref="taskLogRef" @close="refresh" />
171171
</template>
172172

173173
<script lang="ts" setup>
@@ -189,6 +189,7 @@ import { newUUID, jumpToPath } from '@/utils/util';
189189
import Detail from '../detail/index.vue';
190190
import TaskLog from '@/components/log/task/index.vue';
191191
import { storeToRefs } from 'pinia';
192+
import bus from '@/global/bus';
192193
193194
const globalStore = GlobalStore();
194195
const { isProductPro } = storeToRefs(globalStore);
@@ -228,12 +229,28 @@ const detailRef = ref();
228229
const taskLogRef = ref();
229230
const syncCustomAppstore = ref(false);
230231
232+
const refresh = () => {
233+
search(req);
234+
};
235+
231236
const search = async (req: App.AppReq) => {
232237
loading.value = true;
233238
req.pageSize = paginationConfig.pageSize;
234239
req.page = paginationConfig.currentPage;
235240
localStorage.setItem('app-page-size', req.pageSize + '');
236-
await searchApp(req)
241+
242+
const customReq = {
243+
page: req.page,
244+
pageSize: req.pageSize,
245+
tags: req.tags,
246+
name: req.name,
247+
resource: req.resource,
248+
showCurrentArch: req.showCurrentArch,
249+
};
250+
if (syncCustomAppstore.value && req.resource === 'remote') {
251+
customReq.resource = 'custom';
252+
}
253+
await searchApp(customReq)
237254
.then((res) => {
238255
apps.value = res.data.items;
239256
paginationConfig.total = res.data.total;
@@ -341,6 +358,9 @@ const searchByName = () => {
341358
};
342359
343360
onMounted(async () => {
361+
bus.on('refreshTask', () => {
362+
search(req);
363+
});
344364
if (router.currentRoute.value.query.install) {
345365
installKey.value = String(router.currentRoute.value.query.install);
346366
const params = {

frontend/src/views/app-store/detail/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</div>
6363
<MdEditor previewOnly v-model="app.readMe" :theme="isDarkTheme ? 'dark' : 'light'" />
6464
</DrawerPro>
65-
<Install ref="installRef"></Install>
65+
<Install ref="installRef" />
6666
</template>
6767

6868
<script lang="ts" setup>

frontend/src/views/app-store/installed/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
<PortJumpDialog ref="dialogPortJumpRef" />
391391
<AppIgnore ref="ignoreRef" @close="search" />
392392
<ComposeLogs ref="composeLogRef" />
393-
<TaskLog ref="taskLogRef" />
393+
<TaskLog ref="taskLogRef" @close="search" />
394394
<Detail ref="detailRef" />
395395
</template>
396396

0 commit comments

Comments
 (0)