本文整理汇总了Python中freenasUI.freeadmin.tree.TreeNode.app_name方法的典型用法代码示例。如果您正苦于以下问题:Python TreeNode.app_name方法的具体用法?Python TreeNode.app_name怎么用?Python TreeNode.app_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freenasUI.freeadmin.tree.TreeNode
的用法示例。
在下文中一共展示了TreeNode.app_name方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def __init__(self, *args, **kwargs):
super(Linkss, self).__init__(*args, **kwargs)
laggadd = TreeNode('Add')
laggadd.name = _(u'Create Link Aggregation')
laggadd.view = 'freeadmin_network_lagginterface_add'
laggadd.type = 'object'
laggadd.icon = u'AddLAGGIcon'
laggadd.model = 'LAGGInterface'
laggadd.app_name = 'network'
laggview = TreeNode('View')
laggview.gname = 'View'
laggview.name = _(u'View Link Aggregations')
laggview.type = 'opennetwork'
laggview.icon = u'ViewAllLAGGsIcon'
laggview.model = 'LAGGInterface'
laggview.app_name = 'network'
self.append_children([laggadd, laggview])
for value, name in LAGGType:
laggs = models.LAGGInterface.objects.filter(lagg_protocol__exact=value)
if laggs.count() > 0:
nav = TreeNode()
nav.name = name
nav.icon = u'LAGGIcon'
nav._children = []
self.append_child(nav)
for lagg in laggs:
subnav = TreeNode()
subnav.name = lagg.lagg_interface.int_name
subnav.icon = u'LAGGIcon'
subnav._children = []
nav.append_child(subnav)
laggm = models.LAGGInterfaceMembers.objects.filter(
lagg_interfacegroup__exact=lagg.id
).order_by('lagg_ordernum')
for member in laggm:
subsubnav = TreeNode()
subsubnav.name = member.lagg_physnic
subsubnav.type = 'editobject'
subsubnav.icon = u'LAGGIcon'
subsubnav.view = 'freeadmin_network_lagginterfacemembers_edit'
subsubnav.app_name = 'network'
subsubnav.model = 'LAGGInterfaceMembers' + lagg.lagg_interface.int_name
subsubnav.kwargs = {'oid': member.id}
subsubnav.append_url = '?deletable=false'
subsubnav._children = []
subnav.append_child(subsubnav)
示例2: __init__
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def __init__(self, *args, **kwargs):
super(Linkss, self).__init__(*args, **kwargs)
laggadd = TreeNode("Add")
laggadd.name = _(u"Create Link Aggregation")
laggadd.view = "freeadmin_network_lagginterface_add"
laggadd.type = "object"
laggadd.icon = u"AddLAGGIcon"
laggadd.model = "LAGGInterface"
laggadd.app_name = "network"
laggview = TreeNode("View")
laggview.gname = "View"
laggview.name = _(u"View Link Aggregations")
laggview.type = "opennetwork"
laggview.icon = u"ViewAllLAGGsIcon"
laggview.model = "LAGGInterface"
laggview.app_name = "network"
self.append_children([laggadd, laggview])
for value, name in LAGGType:
laggs = models.LAGGInterface.objects.filter(lagg_protocol__exact=value)
if laggs.count() > 0:
nav = TreeNode()
nav.name = name
nav.icon = u"LAGGIcon"
nav._children = []
self.append_child(nav)
for lagg in laggs:
subnav = TreeNode()
subnav.name = lagg.lagg_interface.int_name
subnav.icon = u"LAGGIcon"
subnav._children = []
nav.append_child(subnav)
laggm = models.LAGGInterfaceMembers.objects.filter(lagg_interfacegroup__exact=lagg.id).order_by(
"lagg_ordernum"
)
for member in laggm:
subsubnav = TreeNode()
subsubnav.name = member.lagg_physnic
subsubnav.type = "editobject"
subsubnav.icon = u"LAGGIcon"
subsubnav.view = "freeadmin_network_lagginterfacemembers_edit"
subsubnav.app_name = "network"
subsubnav.model = "LAGGInterfaceMembers" + lagg.lagg_interface.int_name
subsubnav.kwargs = {"oid": member.id}
subsubnav.append_url = "?deletable=false"
subsubnav._children = []
subnav.append_child(subsubnav)
示例3: _gen_dataset
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def _gen_dataset(self, node, dataset):
if dataset.name.startswith('.'):
return
nav = TreeNode(dataset.name)
nav.name = dataset.mountpoint
nav.icon = u'VolumesIcon'
ds = TreeNode('Dataset')
ds.name = _(u'Create Dataset')
ds.view = 'storage_dataset'
ds.icon = u'AddDatasetIcon'
ds.type = 'object'
ds.kwargs = {'fs': dataset.path}
nav.append_child(ds)
subnav = TreeNode('ChangePermissions')
subnav.name = _(u'Change Permissions')
subnav.type = 'editobject'
subnav.view = 'storage_mp_permission'
subnav.kwargs = {'path': dataset.mountpoint}
subnav.model = 'Volumes'
subnav.icon = u'ChangePasswordIcon'
subnav.app_name = 'storage'
zv = AddZVol()
zv.kwargs = {'parent': dataset.path}
node.append_child(nav)
nav.append_child(subnav)
nav.append_child(zv)
for child in dataset.children:
self._gen_dataset(nav, child)
示例4: __init__
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def __init__(self, *args, **kwargs):
super(Volumes, self).__init__(*args, **kwargs)
self.append_children([
AddVolume(),
ImportVolume(),
AutoImportVolume(),
ViewVolumes(),
ViewDisks(),
])
if not appPool.hook_feature_disabled('ufs'):
self.append_child(AddVolumeUFS())
has_multipath = models.Disk.objects.exclude(
disk_multipath_name=''
).exists()
if has_multipath:
self.append_child(ViewMultipaths())
mp = models.MountPoint.objects.select_related().order_by('-id')
for i in mp:
nav = TreeNode(i.mp_volume.id)
nav.name = i.mp_path
nav.order = -i.id
nav.model = 'Volume'
nav.kwargs = {'oid': i.mp_volume.id, 'model': 'Volume'}
nav.icon = u'VolumesIcon'
if i.mp_volume.vol_fstype == 'ZFS':
ds = TreeNode('Dataset')
ds.name = _(u'Create ZFS Dataset')
ds.view = 'storage_dataset'
ds.icon = u'AddDatasetIcon'
ds.type = 'object'
ds.kwargs = {'fs': i.mp_volume.vol_name}
nav.append_child(ds)
zv = AddZVol()
zv.kwargs = {'parent': i.mp_volume.vol_name}
nav.append_child(zv)
subnav = TreeNode('ChangePermissions')
subnav.name = _('Change Permissions')
subnav.type = 'editobject'
subnav.view = 'storage_mp_permission'
subnav.kwargs = {'path': i.mp_path}
subnav.model = 'Volume'
subnav.icon = u'ChangePasswordIcon'
subnav.app_name = 'storage'
datasets = i.mp_volume.get_datasets(hierarchical=True)
if datasets:
for name, d in datasets.items():
# TODO: non-recursive algo
self._gen_dataset(nav, d)
nav.append_child(subnav)
self.insert_child(0, nav)
示例5: __init__
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def __init__(self, *args, **kwargs):
super(Volumes, self).__init__(*args, **kwargs)
self.append_children([
AddVolume(),
ImportDisk(),
ImportVolume(),
ViewVolumes(),
ViewDisks(),
])
if not notifier().is_freenas():
self.append_child(ViewEnclosure())
has_multipath = models.Disk.objects.exclude(
disk_multipath_name=''
).exists()
if has_multipath:
self.append_child(ViewMultipaths())
for i in models.Volume.objects.order_by('-id'):
nav = TreeNode(i.id)
nav.name = i.vol_path
nav.order = -i.id
nav.model = 'Volume'
nav.kwargs = {'oid': i.id, 'model': 'Volume'}
nav.icon = 'VolumesIcon'
ds = TreeNode('Dataset')
ds.name = _('Create Dataset')
ds.view = 'storage_dataset'
ds.icon = 'AddDatasetIcon'
ds.type = 'object'
ds.kwargs = {'fs': i.vol_name}
nav.append_child(ds)
zv = AddZVol()
zv.kwargs = {'parent': i.vol_name}
nav.append_child(zv)
subnav = TreeNode('ChangePermissions')
subnav.name = _('Change Permissions')
subnav.type = 'editobject'
subnav.view = 'storage_mp_permission'
subnav.kwargs = {'path': i.vol_path}
subnav.model = 'Volume'
subnav.icon = 'ChangePasswordIcon'
subnav.app_name = 'storage'
datasets = i.get_datasets(hierarchical=True)
if datasets:
for name, d in list(datasets.items()):
# TODO: non-recursive algo
self._gen_dataset(nav, d)
nav.append_child(subnav)
self.insert_child(0, nav)
示例6: new_storage_node_mkdir
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_storage_node_mkdir(self, jail):
storage_node_add = TreeNode()
storage_node_add.name = _('Make Directory')
storage_node_add.type = 'editobject'
storage_node_add.view = 'jail_mkdir'
storage_node_add.kwargs = { 'id': jail.id }
storage_node_add.icon = u'JailMkdirIcon'
storage_node_add.app_name = 'jails'
return storage_node_add
示例7: new_jail_node_view
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_jail_node_view(self, jail):
jail_node_view = TreeNode()
jail_node_view.name = _('Edit')
jail_node_view.type = 'editobject'
jail_node_view.view = 'jail_edit'
jail_node_view.kwargs = { 'id': jail.id }
jail_node_view.model = 'Jails'
jail_node_view.icon = u'SettingsIcon'
jail_node_view.app_name = 'jails'
return jail_node_view
示例8: new_storage_node_add
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_storage_node_add(self, jail):
storage_node_add = TreeNode()
storage_node_add.name = _('Add Storage')
storage_node_add.type = 'editobject'
storage_node_add.view = 'jail_storage_add'
storage_node_add.kwargs = { 'jail_id': jail.id }
storage_node_add.model = 'NullMountPoint'
storage_node_add.icon = u'JailStorageIcon'
storage_node_add.app_name = 'jails'
return storage_node_add
示例9: new_storage_node_view
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_storage_node_view(self, nmp):
storage_node_view = TreeNode()
storage_node_view.name = _('%s' % nmp.destination)
storage_node_view.type = 'editobject'
storage_node_view.view = 'jail_storage_view'
storage_node_view.kwargs = { 'id': nmp.id }
storage_node_view.model = 'NullMountPoint'
storage_node_view.icon = u'SettingsIcon'
storage_node_view.app_name = 'jails'
return storage_node_view
示例10: new_storage_node_view
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_storage_node_view(self, nmp):
storage_node_view = TreeNode()
storage_node_view.name = nmp.destination
storage_node_view.gname = nmp.id
storage_node_view.type = 'editobject'
storage_node_view.view = 'freeadmin_jails_jailmountpoint_edit'
storage_node_view.kwargs = {'oid': nmp.id}
storage_node_view.model = 'JailMountPoint'
storage_node_view.icon = u'SettingsIcon'
storage_node_view.app_name = 'jails'
return storage_node_view
示例11: new_activedirectory_node
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_activedirectory_node(self):
ad_node = TreeNode("Active Directory")
ad_node.name = 'Active Directory'
ad_node.app_name = 'activedirectory'
ad_node.icon = u'ActiveDirectoryIcon'
try:
ad = ActiveDirectory.objects.order_by("-id")[0]
ad_node.kwargs = {'oid': ad.id}
ad_node.type = 'editobject'
ad_node.view = 'freeadmin_services_activedirectory_edit'
except IndexError:
ad_node.type = 'object'
ad_node.view = 'freeadmin_services_activedirectory_add'
return ad_node
示例12: new_ldap_node
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_ldap_node(self):
ldap_node = TreeNode("LDAP")
ldap_node.name = 'LDAP'
ldap_node.app_name = 'ldap'
ldap_node.icon = u'LDAPIcon'
try:
ldap = LDAP.objects.order_by("-id")[0]
ldap_node.kwargs = {'oid': ldap.id}
ldap_node.type = 'editobject'
ldap_node.view = 'freeadmin_services_ldap_edit'
except IndexError:
ldap_node.type = 'object'
ldap_node.view = 'freeadmin_services_ldap_add'
return ldap_node
示例13: new_nis_node
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_nis_node(self):
nis_node = TreeNode("NIS")
nis_node.name = 'NIS'
nis_node.app_name = 'nis'
nis_node.icon = u'NISIcon'
try:
nis = NIS.objects.order_by("-id")[0]
nis_node.kwargs = {'oid': nis.id}
nis_node.type = 'editobject'
nis_node.view = 'freeadmin_services_nis_edit'
except IndexError:
nis_node.type = 'object'
nis_node.view = 'freeadmin_services_nis_add'
return nis_node
示例14: new_nt4_node
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_nt4_node(self):
nt4_node = TreeNode("NT4")
nt4_node.name = 'NT4'
nt4_node.app_name = 'nt4'
nt4_node.icon = u'NT4Icon'
try:
nt4 = NT4.objects.order_by("-id")[0]
nt4_node.kwargs = {'oid': nt4.id}
nt4_node.type = 'editobject'
nt4_node.view = 'freeadmin_services_nt4_edit'
except IndexError:
nt4_node.type = 'object'
nt4_node.view = 'freeadmin_services_nt4_add'
return nt4_node
示例15: new_domaincontroller_node
# 需要导入模块: from freenasUI.freeadmin.tree import TreeNode [as 别名]
# 或者: from freenasUI.freeadmin.tree.TreeNode import app_name [as 别名]
def new_domaincontroller_node(self):
ad_node = TreeNode("Domain Controller")
ad_node.name = 'Domain Controller'
ad_node.app_name = 'domaincontroller'
ad_node.icon = u'DomainControllerIcon'
try:
ad = DomainController.objects.order_by("-id")[0]
ad_node.kwargs = {'oid': ad.id}
ad_node.type = 'editobject'
ad_node.view = 'freeadmin_services_domaincontroller_edit'
except IndexError:
ad_node.type = 'object'
ad_node.view = 'freeadmin_services_domaincontroller_add'
return ad_node