mirror of https://github.com/jumpserver/jumpserver
perf: 放行快捷键 ctrl-c-v
parent
24272d3162
commit
cb2b8bb70b
|
@ -12,6 +12,8 @@ __all__ = [
|
|||
'BaseACL', 'UserBaseACL', 'UserAssetAccountBaseACL',
|
||||
]
|
||||
|
||||
from orgs.utils import tmp_to_org
|
||||
|
||||
|
||||
class ActionChoices(models.TextChoices):
|
||||
reject = 'reject', _('Reject')
|
||||
|
@ -115,7 +117,8 @@ class UserAssetAccountBaseACL(OrgModelMixin, UserBaseACL):
|
|||
queryset = queryset.filter(q)
|
||||
if asset:
|
||||
org_id = asset.org_id
|
||||
q = cls.assets.get_filter_q(asset)
|
||||
with tmp_to_org(org_id):
|
||||
q = cls.assets.get_filter_q(asset)
|
||||
queryset = queryset.filter(q)
|
||||
if account and not account_username:
|
||||
account_username = account.username
|
||||
|
|
|
@ -40,9 +40,9 @@ document.addEventListener("contextmenu", function (event) {
|
|||
event.preventDefault();
|
||||
});
|
||||
|
||||
var AllowedKeys = ['P', 'F', 'p', 'f']
|
||||
var AllowedKeys = ['P', 'F', 'C', 'V']
|
||||
window.addEventListener("keydown", function (e) {
|
||||
if (e.key === "F12" || (e.ctrlKey && !AllowedKeys.includes(e.key))) {
|
||||
if (e.key === "F12" || (e.ctrlKey && !AllowedKeys.includes(e.key.toUpperCase()))) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
console.log('Press key: ', e.ctrlKey ? 'Ctrl' : '', e.shiftKey ? ' Shift' : '', e.key)
|
||||
|
|
Loading…
Reference in New Issue