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

Bugfix/json save with wrong format #873

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
844b97e
fix,inspector request miss data
echoyang7 Dec 7, 2023
2f3be85
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Dec 7, 2023
da82dd9
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Dec 8, 2023
ef4402d
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Dec 8, 2023
983b2b1
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Mar 5, 2024
e2e6f39
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Mar 15, 2024
099d3fb
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Mar 19, 2024
5ec76f2
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Apr 24, 2024
aa2baf1
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 May 7, 2024
3def163
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 May 13, 2024
ac3532a
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 May 22, 2024
6a4de91
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Jun 3, 2024
9904069
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Jun 12, 2024
647c468
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Jun 28, 2024
6a302aa
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Aug 20, 2024
33fd475
Merge branch 'master' of https://github.com/Meituan-Dianping/lyrebird
echoyang7 Aug 28, 2024
6c85290
fix bug that json data save with wrong format
echoyang7 Aug 28, 2024
f3d16c9
same bug
echoyang7 Aug 29, 2024
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 frontend/src/views/datamanager/DataDetailPlainConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
save () {
const newData = {}
Object.assign(newData, JSON.parse(this.editorCache.info))
newData['json'] = this.editorCache.json
newData['json'] = JSON.parse(this.editorCache.json)
this.$store.dispatch('saveDataDetail', newData)
},
onJsonPathChange (payload) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/datamanager/DataDetailPlainJSON.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
save () {
const newData = {}
Object.assign(newData, JSON.parse(this.editorCache.info))
newData['json'] = this.editorCache.json
newData['json'] = JSON.parse(this.editorCache.json)
this.$store.dispatch('saveDataDetail', newData)
},
onJsonPathChange (payload) {
Expand Down
13 changes: 9 additions & 4 deletions lyrebird/mock/dm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,15 @@ def activate(self, search_id, **kwargs):
self.activated_group[search_id] = group_info
# Apply config
if config:
try:
self.activate_config = json.loads(config)
except Exception as e:
logger.error('Failed to parse the config, the config did not take effect!')
if isinstance(config, str):
try:
self.activate_config = json.loads(config)
except json.JSONDecodeError:
logger.error('Failed to parse the config, the config did not take effect!')
elif isinstance(config, dict):
self.activate_config = config
else:
logger.error('Config must be a JSON string or a JSON object!')
application._cm.add_config(self.activate_config, type='dm', level=-1, apply_now=True)
# TODO:After activate
self._check_activated_data_rules_contains_request_data()
Expand Down
Loading