Skip to content

Commit

Permalink
fix encoder and decoder error; DataManager folder detail display over…
Browse files Browse the repository at this point in the history
…flow (#725)
  • Loading branch information
yumiguan authored Dec 14, 2022
1 parent 3e5b9ac commit 73b963e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 11 deletions.
6 changes: 3 additions & 3 deletions frontend/src/views/checker/CheckerDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export default {
codeType: 'python'
}
},
mounted () {
this.$bus.$on('keydown', this.onKeyDown)
activated () {
this.$bus.$on('keydown', this.onKeyDown)
},
beforeDestroy () {
deactivated () {
this.$bus.$off('keydown', this.onKeyDown)
},
computed: {
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/views/datamanager/DataDetailFolder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ export default {
beforeDestroy () {
this.$bus.$off('keydown', this.onKeyDown)
},
activated () {
this.$bus.$on('keydown', this.onKeyDown)
},
deactivated () {
this.$bus.$off('keydown', this.onKeyDown)
},
computed: {
nodeInfo () {
return this.$store.state.dataManager.focusNodeInfo
Expand Down Expand Up @@ -217,15 +223,16 @@ export default {
}
.data-detail-content {
margin: 10px 5px 10px 10px;
height: calc(100vh - 44px - 40px - 30px - 1px - 33px - 12px - 28px);
height: calc(100vh - 44px - 40px - 30px - 1px - 33px - 10px - 10px - 10px - 28px);
/* total:100vh
header: 44px
title: 40px
button-bar: 30px
border: 1px
tab: 33px
tree
margin-bottom: 12px
margin-bottom: 10px
detail
margin-bottom: 10px
footer: 28px
*/
overflow-y: scroll;
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/views/datamanager/DataDetailHttpData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ export default {
beforeDestroy () {
this.$bus.$off('keydown', this.onKeyDown)
},
activated () {
this.$bus.$on('keydown', this.onKeyDown)
},
deactivated () {
this.$bus.$off('keydown', this.onKeyDown)
},
computed: {
currentTab: {
get () {
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/views/datamanager/DataDetailPlainJSON.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ export default {
beforeDestroy () {
this.$bus.$off('keydown', this.onKeyDown)
},
activated () {
this.$bus.$on('keydown', this.onKeyDown)
},
deactivated () {
this.$bus.$off('keydown', this.onKeyDown)
},
computed: {
currentTab: {
get () {
Expand Down
5 changes: 3 additions & 2 deletions lyrebird/checker/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

class CustomDecoder:

def __call__(self, rules=None, *args, **kw):
def __call__(self, rules=None, rank=0, *args, **kw):
def func(origin_func):
func_type = checker.TYPE_DECODER
if not checker.scripts_tmp_storage.get(func_type):
checker.scripts_tmp_storage[func_type] = []
checker.scripts_tmp_storage[func_type].append({
'name': origin_func.__name__,
'func': origin_func,
'rules': rules
'rules': rules,
'rank': rank
})
return origin_func
return func
Expand Down
5 changes: 3 additions & 2 deletions lyrebird/checker/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

class CustomEncoder:

def __call__(self, rules=None, *args, **kw):
def __call__(self, rules=None, rank=0, *args, **kw):
def func(origin_func):
func_type = checker.TYPE_ENCODER
if not checker.scripts_tmp_storage.get(func_type):
checker.scripts_tmp_storage[func_type] = []
checker.scripts_tmp_storage[func_type].append({
'name': origin_func.__name__,
'func': origin_func,
'rules': rules
'rules': rules,
'rank': rank
})
return origin_func
return func
Expand Down
2 changes: 1 addition & 1 deletion lyrebird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
IVERSION = (2, 11, 0)
IVERSION = (2, 11, 1)
VERSION = ".".join(str(i) for i in IVERSION)
LYREBIRD = "Lyrebird " + VERSION

0 comments on commit 73b963e

Please sign in to comment.