Update and enable the clustering app
This commit is contained in:
@@ -26,6 +26,6 @@ def add_clustering_jobs():
|
||||
|
||||
add_clustering_jobs()
|
||||
register_tool(tool_link)
|
||||
register_setup(setup_link)
|
||||
#register_setup(setup_link)
|
||||
bind_links([Node, 'node_list'], [node_list], menu_name='secondary_menu')
|
||||
bind_links(['clustering_config_edit'], [clustering_config_edit], menu_name='secondary_menu')
|
||||
|
||||
7
apps/clustering/icons.py
Normal file
7
apps/clustering/icons.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from icons.literals import (SERVER)
|
||||
from icons import Icon
|
||||
|
||||
icon_tool_link = Icon(SERVER)
|
||||
icon_node_link = Icon(SERVER)
|
||||
@@ -5,8 +5,9 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from navigation.api import Link
|
||||
|
||||
from .permissions import PERMISSION_NODES_VIEW, PERMISSION_EDIT_CLUSTER_CONFIGURATION
|
||||
from .icons import icon_tool_link, icon_node_link
|
||||
|
||||
tool_link = Link(text=_(u'clustering'), view='node_list', icon='server.png', permissions=[PERMISSION_NODES_VIEW])
|
||||
node_list = Link(text=_(u'node list'), view='node_list', sprite='server', permissions=[PERMISSION_NODES_VIEW])
|
||||
tool_link = Link(text=_(u'clustering'), view='node_list', icon=icon_tool_link, permissions=[PERMISSION_NODES_VIEW])
|
||||
node_list = Link(text=_(u'node list'), view='node_list', icon=icon_node_link, permissions=[PERMISSION_NODES_VIEW])
|
||||
clustering_config_edit = Link(text=_(u'edit cluster configuration'), view='clustering_config_edit', sprite='server_edit', permissions=[PERMISSION_EDIT_CLUSTER_CONFIGURATION])
|
||||
setup_link = Link(text=_(u'cluster configuration'), view='clustering_config_edit', icon='server.png', permissions=[PERMISSION_EDIT_CLUSTER_CONFIGURATION])
|
||||
|
||||
34
apps/clustering/registry.py
Normal file
34
apps/clustering/registry.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from smart_settings import ClusterScope
|
||||
|
||||
from .icons import icon_tool_link
|
||||
from .literals import (DEFAULT_NODE_HEARTBEAT_INTERVAL, DEFAULT_NODE_HEARTBEAT_TIMEOUT,
|
||||
DEFAULT_DEAD_NODE_REMOVAL_INTERVAL)
|
||||
|
||||
label = _(u'Clustering')
|
||||
description = _(u'Registers nodes into a Citadel (Mayan EDMS cluster).')
|
||||
dependencies = ['app_registry', 'icons', 'navigation', 'scheduler']
|
||||
icon = icon_tool_link
|
||||
settings = [
|
||||
{
|
||||
'name': 'NODE_HEARTBEAT_INTERVAL',
|
||||
'default': DEFAULT_NODE_HEARTBEAT_INTERVAL,
|
||||
'description': _(u'Interval of time (in seconds) for the node\'s heartbeat update to the cluster.'),
|
||||
'scopes': [ClusterScope()]
|
||||
},
|
||||
{
|
||||
'name': 'NODE_HEARTBEAT_TIMEOUT',
|
||||
'default': DEFAULT_NODE_HEARTBEAT_TIMEOUT,
|
||||
'description': _(u'After this amount of time a node without heartbeat updates is considered dead and removed from the cluster node list.'),
|
||||
'scopes': [ClusterScope()]
|
||||
},
|
||||
{
|
||||
'name': 'DEAD_NODE_REMOVAL_INTERVAL',
|
||||
'default': DEFAULT_DEAD_NODE_REMOVAL_INTERVAL,
|
||||
'description': _(u'Interval of time to check the cluster for unresponsive nodes and remove them from the cluster.'),
|
||||
'scopes': [ClusterScope()]
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user