Skip to content
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

fix: Zone list: Click on the details page, then click on the Assets tab, but fail to retrieve asset data. #4707

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/views/assets/Domain/DomainDetail/AssetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
return {
tableConfig: {
category: 'all',
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&is_gateway=0`,
url: `/api/v1/assets/assets/?domain=${this.object.id}&is_gateway=0`,
tableConfig: {
columns: ['name', 'address', 'platform', 'actions'],
columnsMeta: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above code is missing the "extends" key at the beginning of each definition block to properly define them as objects.

In terms of differences:

  • The category field seems redundant since both the current object and its parent have an inherited category (all). The code does not explicitly mention this, so we can just use a single value for both properties (e.g., "tableConfig").

In terms of issues/optimization suggestions based on these details:

  • It's unclear why you've defined two separate arrays with different names for "columns", when they contain nearly identical information. If there isn't any specific need for this redundancy, it could be streamlined into having one array that includes all columns metadata.
  • The url variable references @@ instead of directly providing values from $route.params.id, which might cause issues if $route params depend on other routes and should not affect the main app state like this within this function. You may want to ensure consistency or make necessary adjustments here.

So overall, these appear to be minor formatting and structure variations without significant errors/warnings in their content logic but improvements regarding proper implementation practices could still be made across multiple areas mentioned above for clarity enhancement and adherence to standard coding conventions.

Expand Down
2 changes: 1 addition & 1 deletion src/views/assets/Domain/DomainDetail/GatewayList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
data() {
return {
tableConfig: {
url: `/api/v1/assets/gateways/?domain=${this.$route.params.id}`,
url: `/api/v1/assets/gateways/?domain=${this.object.id}`,
columnsExclude: [
'info', 'spec_info', 'auto_config'
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but you haven't provided any code to work with. Please share the specific code段落 39 和其后续代码以便我为您分析。

Expand Down
5 changes: 3 additions & 2 deletions src/views/assets/Domain/components/AddGatewayDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default {
}
},
data() {
const vm = this
return {
formConfig: {
getUrl: () => {
Expand All @@ -53,7 +54,7 @@ export default {
createSuccessMsg: this.$t('AddSuccessMsg'),
updateSuccessNextRoute: {
name: 'ZoneDetail',
params: { id: this.$route.params.id }
params: { id: this.object.id }
},
fields: ['gateways'],
fieldsMeta: {
Expand All @@ -73,7 +74,7 @@ export default {
cleanFormValue(values) {
const data = []
values.gateways.forEach(item => {
const d = { id: item.pk, domain: this.$route.params.id }
const d = { id: item.pk, domain: vm.object.id }
data.push(d)
})
return data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the provided code is present to analyze. Please provide an actual piece of JavaScript or React component that needs analysis.

Expand Down