-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(appstore): Add Synchronization of Main Node Application Store Pa… #7612
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 |
|---|---|---|
|
|
@@ -175,7 +175,14 @@ | |
| <script lang="ts" setup> | ||
| import { App } from '@/api/interface/app'; | ||
| import { onMounted, reactive, ref, computed } from 'vue'; | ||
| import { GetAppTags, SearchApp, SyncApp, SyncCutomAppStore, SyncLocalApp } from '@/api/modules/app'; | ||
| import { | ||
| GetAppTags, | ||
| SearchApp, | ||
| SyncApp, | ||
| SyncCutomAppStore, | ||
| SyncLocalApp, | ||
| getCurrentNodeCustomAppConfig, | ||
| } from '@/api/modules/app'; | ||
| import Install from '../detail/install/index.vue'; | ||
| import router from '@/routers'; | ||
| import { MsgSuccess } from '@/utils/message'; | ||
|
|
@@ -184,7 +191,6 @@ import { getLanguage, newUUID } from '@/utils/util'; | |
| import Detail from '../detail/index.vue'; | ||
| import TaskLog from '@/components/task-log/index.vue'; | ||
| import { storeToRefs } from 'pinia'; | ||
| import { GetCustomAppStoreConfig } from '@/xpack/api/modules/app'; | ||
|
|
||
| const globalStore = GlobalStore(); | ||
| const { isProductPro } = storeToRefs(globalStore); | ||
|
|
@@ -350,7 +356,7 @@ onMounted(async () => { | |
| } | ||
| search(req); | ||
| if (isProductPro.value) { | ||
| const res = await GetCustomAppStoreConfig(); | ||
| const res = await getCurrentNodeCustomAppConfig(); | ||
| if (res && res.data) { | ||
| syncCustomAppstore.value = res.data.status === 'enable'; | ||
| } | ||
|
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. There don't seem to be any syntax errors or unusual coding practices that would indicate an issue with the provided code snippet. However, it should be noted that this is not a typical Vue.js application; the code snippets you've shared do not appear to fit within a normal Vue project context. For optimization considerations:
As stated earlier, I believe these code samples aren’t relevant to a regular Vue project and could potentially cause confusion without specific context about their purpose and use cases. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,10 @@ | |
| </el-input> | ||
| <span class="input-help">{{ $t('app.defaultWebDomainHepler') }}</span> | ||
| </el-form-item> | ||
| <CustomSetting v-if="isProductPro" /> | ||
| <CustomSetting v-if="isProductPro && globalStore.isMaster" /> | ||
| <el-form-item v-if="!globalStore.isMaster && useCustomApp"> | ||
| <el-text type="warning">{{ $t('app.customAppHelper') }}</el-text> | ||
| </el-form-item> | ||
| </el-col> | ||
| </el-row> | ||
| </el-form> | ||
|
|
@@ -38,7 +41,7 @@ | |
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { GetAppStoreConfig } from '@/api/modules/app'; | ||
| import { GetAppStoreConfig, getCurrentNodeCustomAppConfig } from '@/api/modules/app'; | ||
| import { Rules } from '@/global/form-rules'; | ||
| import { FormRules } from 'element-plus'; | ||
| import CustomSetting from '@/xpack/views/appstore/index.vue'; | ||
|
|
@@ -59,6 +62,7 @@ const loading = ref(false); | |
| const configForm = ref(); | ||
| const protocol = ref('http://'); | ||
| const domainRef = ref(); | ||
| const useCustomApp = ref(false); | ||
|
|
||
| function getUrl(url: string) { | ||
| const regex = /^(https?:\/\/)(.*)/; | ||
|
|
@@ -99,7 +103,18 @@ const setDefaultDomain = () => { | |
| }); | ||
| }; | ||
|
|
||
| const getNodeConfig = async () => { | ||
| if (globalStore.isMaster) { | ||
| return; | ||
| } | ||
| const res = await getCurrentNodeCustomAppConfig(); | ||
| if (res && res.data) { | ||
| useCustomApp.value = res.data.status === 'enable'; | ||
| } | ||
| }; | ||
|
|
||
| onMounted(() => { | ||
| search(); | ||
| getNodeConfig(); | ||
| }); | ||
| </script> | ||
|
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 does not contain any clear violations of standards or potential issues. It doesn't seem to have significant design flaws in terms of layout, coding format or functionality. Any optimizations would mostly need context about how it's being used elsewhere in the app or system. However, minor tweaks like removing extra space around |
||
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.
I apologize, but I'm unable to assist without more context or specific code examples from both versions of the code. You'll need to post either current code or some relevant snippets showing what you want checked against a previous version.