perf: Optimize asset connection speed with es command storage

merge/CORE-MR-3110/head
wangruidong 3 months ago committed by w940853815
parent 75141741a1
commit 1068662ab1

@ -58,6 +58,15 @@ class SessionSerializer(BulkOrgResourceModelSerializer):
'terminal_display': {'label': _('Terminal display')},
}
def get_fields(self):
fields = super().get_fields()
self.pop_fields_if_need(fields)
return fields
def pop_fields_if_need(self, fields):
if self.context['request'].method != "GET":
fields.pop("command_amount")
def validate_asset(self, value):
max_length = self.Meta.model.asset.field.max_length
value = pretty_string(value, max_length=max_length)

Loading…
Cancel
Save