Only show panesl when the service is in catalog
Change-Id: I6d21cecb143b5bdc1ebaa509650950ae9f7fb5c1
This commit is contained in:
parent
c9eb35865d
commit
499ace271b
|
@ -15,9 +15,11 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from django.conf import settings # noqa
|
||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
|
service_type = getattr(settings, 'MONITORING_SERVICE_TYPE', 'monitoring')
|
||||||
|
|
||||||
class Monitoring(horizon.Dashboard):
|
class Monitoring(horizon.Dashboard):
|
||||||
name = _("Monitoring")
|
name = _("Monitoring")
|
||||||
|
@ -25,5 +27,6 @@ class Monitoring(horizon.Dashboard):
|
||||||
panels = ('overview', 'alarmdefs', 'alarms', 'notifications',)
|
panels = ('overview', 'alarmdefs', 'alarms', 'notifications',)
|
||||||
default_panel = 'overview'
|
default_panel = 'overview'
|
||||||
policy_rules = (("monitoring", "monitoring:monitoring"),)
|
policy_rules = (("monitoring", "monitoring:monitoring"),)
|
||||||
|
permissions = (('openstack.services.' + service_type),)
|
||||||
|
|
||||||
horizon.register(Monitoring)
|
horizon.register(Monitoring)
|
||||||
|
|
|
@ -10,6 +10,18 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from openstack_dashboard.test.test_data import keystone_data
|
||||||
|
|
||||||
|
monasca = {
|
||||||
|
"type": "monitoring",
|
||||||
|
"name": "Monitoring",
|
||||||
|
"endpoints_links": [],
|
||||||
|
"endpoints": [
|
||||||
|
{"region": "RegionOne",
|
||||||
|
"adminURL": "http://admin.monasca.example.com:8386/v1.1",
|
||||||
|
"publicURL": "http://public.monasca.example.com:8386/v1.1",
|
||||||
|
"internalURL": "http://int.monasca.example.com:8386/v1.1"}]}
|
||||||
|
keystone_data.SERVICE_CATALOG.append(monasca)
|
||||||
|
|
||||||
def data(TEST):
|
def data(TEST):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue