-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(app): fix sync custom app failed #8310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,8 @@ export namespace App { | |
| tags?: string[]; | ||
| type?: string; | ||
| recommend?: boolean; | ||
| resource?: string; | ||
| showCurrentArch?: boolean; | ||
| } | ||
|
|
||
| export interface AppParams { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code snippet has been edited with two new fields added to an existing interface within a TypeScript class named
Optimization Suggestions:
This updated interface now provides more flexibility and functionality than before, allowing customization based on specific use cases. It will need adequate testing to ensure all expected behaviors work correctly after deployment. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,7 +167,7 @@ | |
| </LayoutContent> | ||
| <Install ref="installRef" /> | ||
| <Detail ref="detailRef" /> | ||
| <TaskLog ref="taskLogRef" @close="search(req)" /> | ||
| <TaskLog ref="taskLogRef" @close="refresh" /> | ||
| </template> | ||
|
|
||
| <script lang="ts" setup> | ||
|
|
@@ -189,6 +189,7 @@ import { newUUID, jumpToPath } from '@/utils/util'; | |
| import Detail from '../detail/index.vue'; | ||
| import TaskLog from '@/components/log/task/index.vue'; | ||
| import { storeToRefs } from 'pinia'; | ||
| import bus from '@/global/bus'; | ||
|
|
||
| const globalStore = GlobalStore(); | ||
| const { isProductPro } = storeToRefs(globalStore); | ||
|
|
@@ -228,12 +229,28 @@ const detailRef = ref(); | |
| const taskLogRef = ref(); | ||
| const syncCustomAppstore = ref(false); | ||
|
|
||
| const refresh = () => { | ||
| search(req); | ||
| }; | ||
|
|
||
| const search = async (req: App.AppReq) => { | ||
| loading.value = true; | ||
| req.pageSize = paginationConfig.pageSize; | ||
| req.page = paginationConfig.currentPage; | ||
| localStorage.setItem('app-page-size', req.pageSize + ''); | ||
| await searchApp(req) | ||
|
|
||
| const customReq = { | ||
| page: req.page, | ||
| pageSize: req.pageSize, | ||
| tags: req.tags, | ||
| name: req.name, | ||
| resource: req.resource, | ||
| showCurrentArch: req.showCurrentArch, | ||
| }; | ||
| if (syncCustomAppstore.value && req.resource === 'remote') { | ||
| customReq.resource = 'custom'; | ||
| } | ||
| await searchApp(customReq) | ||
| .then((res) => { | ||
| apps.value = res.data.items; | ||
| paginationConfig.total = res.data.total; | ||
|
|
@@ -341,6 +358,9 @@ const searchByName = () => { | |
| }; | ||
|
|
||
| onMounted(async () => { | ||
| bus.on('refreshTask', () => { | ||
| search(req); | ||
| }); | ||
| if (router.currentRoute.value.query.install) { | ||
| installKey.value = String(router.currentRoute.value.query.install); | ||
| const params = { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Differences Analysis and Suggestions:1.
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ | |
| </div> | ||
| <MdEditor previewOnly v-model="app.readMe" :theme="isDarkTheme ? 'dark' : 'light'" /> | ||
| </DrawerPro> | ||
| <Install ref="installRef"></Install> | ||
| <Install ref="installRef" /> | ||
| </template> | ||
|
|
||
| <script lang="ts" setup> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code difference you provided is minor and does not contain any irregularities, potential issues, or optimizations to suggest. The changes from If there were any other changes or discrepancies that should be considered, please specify them so I can assist further.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code snippet you provided appears to be an HTML template section from a Vue.js component. Here is a quick review of the changes mentioned: Removed Code (New Line 67): <Install ref="installRef"></Install>Changed Class Property ('v-if') on No Other Irregularities or Potential Issues Found: The remaining syntax looks mostly correct, with no apparent errors, missing semicolons, incorrect property names, etc. Suggested Optimization:Since there are no significant logical or performance issues in this part of the code, I'd recommend focusing on other components or sections that might require attention based on their complexity and usage within the overall system. If you have more specific parts of the application requiring further testing or optimization, feel free to ask! |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet appears to be a part of an interface definition using TypeScript for an application configuration object. The main changes include adding two new properties:
resourceandshowCurrentArch. Here's a concise review of these additions:New Property:
Another New Property:
Potential Issues:
Optimization Suggestions:
resourceandshowCurrentArch) are optional, it's reasonable to ensure that there isn't excessive redundancy in your codebase where similar options are defined more than once without considering which ones are actually required by different use cases.Overall, the additions appear functional unless additional context provides clues about their intended roles and constraints within specific parts of the application.