mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-29 00:26:56 +00:00
* perf: optimize the connection of operation logs to ES to prevent ES downtime from causing the core component to become unhealthy. * perf: sync publish message --------- Co-authored-by: jiangweidong <1053570670@qq.com>
16 lines
446 B
Python
16 lines
446 B
Python
from perms.const import ActionChoices
|
|
|
|
|
|
class BaseOperateStorage(object):
|
|
@staticmethod
|
|
def get_type():
|
|
return 'base'
|
|
|
|
@staticmethod
|
|
def _get_special_handler(resource_type):
|
|
# 根据资源类型,处理特殊字段
|
|
resource_map = {
|
|
'Asset permission': lambda k, v: ActionChoices.display(int(v)) if k == 'Actions' else v
|
|
}
|
|
return resource_map.get(resource_type, lambda k, v: v)
|