mirror of https://github.com/jumpserver/jumpserver
stash it
parent
cc167f1b49
commit
e2f199606e
|
@ -40,3 +40,4 @@ logs/*
|
||||||
release/*
|
release/*
|
||||||
releashe
|
releashe
|
||||||
/apps/script.py
|
/apps/script.py
|
||||||
|
xpack.bak
|
||||||
|
|
|
@ -71,7 +71,6 @@ def migrate_database_to_asset(apps, *args):
|
||||||
except:
|
except:
|
||||||
failed_apps.append(app)
|
failed_apps.append(app)
|
||||||
pass
|
pass
|
||||||
# db.hostname = 'DB-' + db.hostname
|
|
||||||
|
|
||||||
|
|
||||||
def migrate_remote_app_to_asset(apps, *args):
|
def migrate_remote_app_to_asset(apps, *args):
|
||||||
|
@ -154,11 +153,11 @@ def create_app_nodes(apps, org_id):
|
||||||
if not node_keys:
|
if not node_keys:
|
||||||
return
|
return
|
||||||
node_key_split = [key.split(':') for key in node_keys]
|
node_key_split = [key.split(':') for key in node_keys]
|
||||||
next_value = int(max([k[1] for k in node_key_split])) + 1
|
next_value = max([int(k[1]) for k in node_key_split]) + 1
|
||||||
parent_key = node_key_split[0][0]
|
parent_key = node_key_split[0][0]
|
||||||
parent = node_model.objects.get(key=parent_key)
|
next_key = '{}:{}'.format(parent_key, next_value)
|
||||||
next_key = '{}:{}'.format(node_key_split[0][0], next_value)
|
|
||||||
name = 'Apps'
|
name = 'Apps'
|
||||||
|
parent = node_model.objects.get(key=parent_key)
|
||||||
full_value = parent.full_value + '/' + name
|
full_value = parent.full_value + '/' + name
|
||||||
defaults = {
|
defaults = {
|
||||||
'key': next_key, 'value': name, 'parent_key': parent_key,
|
'key': next_key, 'value': name, 'parent_key': parent_key,
|
||||||
|
@ -176,6 +175,7 @@ def migrate_to_nodes(apps, *args):
|
||||||
asset_model = apps.get_model('assets', 'Asset')
|
asset_model = apps.get_model('assets', 'Asset')
|
||||||
orgs = org_model.objects.all()
|
orgs = org_model.objects.all()
|
||||||
|
|
||||||
|
# Todo: 优化一些
|
||||||
for org in orgs:
|
for org in orgs:
|
||||||
node = create_app_nodes(apps, org.id)
|
node = create_app_nodes(apps, org.id)
|
||||||
assets = asset_model.objects.filter(
|
assets = asset_model.objects.filter(
|
||||||
|
|
|
@ -6157,7 +6157,7 @@ msgstr "启用 MFA(OTP)"
|
||||||
|
|
||||||
#: users/templates/users/user_otp_enable_bind.html:6
|
#: users/templates/users/user_otp_enable_bind.html:6
|
||||||
msgid "Bind one-time password authenticator"
|
msgid "Bind one-time password authenticator"
|
||||||
msgstr "绑定MFA验证器"
|
msgstr "绑定 MFA 验证器"
|
||||||
|
|
||||||
#: users/templates/users/user_otp_enable_bind.html:13
|
#: users/templates/users/user_otp_enable_bind.html:13
|
||||||
msgid ""
|
msgid ""
|
||||||
|
|
Loading…
Reference in New Issue