General dashboard enhancements

rename _50_freezer.py to _50_freezer.py.example
updated readme to point to freezer launchpad
improved readability for actions and jobs in the ui

Change-Id: Ib07719e5f91443ea6716f940b6b125b872505088
This commit is contained in:
memo 2015-11-26 15:02:47 +00:00
parent 0e1c12a475
commit 1435d33732
9 changed files with 35 additions and 46 deletions

View File

@ -5,16 +5,15 @@ Freezer - Horizon Dashboard
freezer-web-ui is a horizon plugin based in django aimed at providing an interaction
with freezer
* Release management: https://launchpad.net/freezer-web-ui
* Blueprints and feature specifications: https://blueprints.launchpad.net/freezer-web-ui
* Issue tracking: https://bugs.launchpad.net/freezer-web-ui
* Release management: https://launchpad.net/freezer
* Blueprints and feature specifications: https://blueprints.launchpad.net/freezer
* Issue tracking: https://bugs.launchpad.net/freezer
Requirements
============
Freezer Freezer Dashboard requires a freezer API client to be installed in the same environment as horizon::
pip install parsedatetime>=1.4
git clone https://github.com/openstack/freezer
cd freezer
python setup.py install (is important that freezer is installed from source and not with pip and
@ -51,9 +50,7 @@ To install freezer dashboard for development you need to do the following::
# cd freezer-web-ui
# cp _50_freezer.py /opt/stack/horizon/openstack_dashboard/enabled
# modify _50_freezer.py (line 9) and point the path to the freezer repo.
# cp _50_freezer.py.example /opt/stack/horizon/openstack_dashboard/enabled/_50_freezer.py
# cd /opt/stack/horizon/
@ -72,12 +69,14 @@ To deploy freezer dashboard in production you need to do the following::
# cd freezer-web-ui
# cp _50_freezer.py /opt/stack/horizon/openstack_dashboard/enabled/
# cp _50_freezer.py.example /opt/stack/horizon/openstack_dashboard/enabled/_50_freezer.py
# make sure freezer is installed from source as detailed in the first step
# restart apache2 service
A new tab called "Disaster Recovery" will be on your panels.
A new tab called "Disaster Recovery" will appear on your panels.
Tox

View File

View File

@ -1,24 +0,0 @@
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The name of the dashboard to be added to HORIZON['dashboards']. Required.
DASHBOARD = 'disaster_recovery'
# If set to True, this dashboard will not be added to the settings.
DISABLED = False
# A list of applications to be added to INSTALLED_APPS.
ADD_INSTALLED_APPS = [
'disaster_recovery',
]

10
_50_freezer.py.example Normal file
View File

@ -0,0 +1,10 @@
# The name of the dashboard to be added to HORIZON['dashboards']. Required.
DASHBOARD = 'disaster_recovery'
# If set to True, this dashboard will not be added to the settings.
DISABLED = False
# A list of applications to be added to INSTALLED_APPS.
ADD_INSTALLED_APPS = [
'disaster_recovery',
]

View File

@ -177,12 +177,12 @@ class ActionConfigurationAction(workflows.Action):
def _check_container(self, cleaned_data):
if not cleaned_data.get('container'):
msg = _("You must define a container.")
msg = _("You must define a container or path to backup.")
self._errors['container'] = self.error_class([msg])
def _check_backup_name(self, cleaned_data):
if not cleaned_data.get('backup_name'):
msg = _("You must define an backup name.")
msg = _("You must define a job name.")
self._errors['backup_name'] = self.error_class([msg])
def _check_path_to_backup(self, cleaned_data):

View File

@ -87,6 +87,7 @@ class Job(object):
job.get('description'),
job.get('job_schedule', {}).get('result'),
job.get('job_schedule', {}).get('event'),
job.get('client_id')
) for job in jobs]
def get(self, job_id, json=False):
@ -99,7 +100,8 @@ class Job(object):
job.get('job_id'),
job.get('description'),
job.get('job_schedule', {}).get('result'),
job.get('job_schedule', {}).get('event'))
job.get('job_schedule', {}).get('event'),
job.get('client_id'))
def create(self, job):
return self._build(job)
@ -333,7 +335,7 @@ class Action(object):
action['freezer_action'].get('backup_name'),
action['freezer_action'].get('path_to_backup')
or action['freezer_action'].get('restore_abs_path'),
action['freezer_action'].get('storage'),
action['freezer_action'].get('storage')
) for action in actions]
def get(self, job_id, json=False):

View File

@ -142,13 +142,16 @@ class CreateJob(tables.LinkAction):
class JobsTable(tables.DataTable):
job_name = tables.Column("description",
link=get_link,
verbose_name=_("Job Name"))
verbose_name=_("Name"))
client_id = tables.Column("client_id",
verbose_name=_("Host"))
event = tables.Column("event",
verbose_name=_("Job Status"))
verbose_name=_("Status"))
result = tables.Column("result",
verbose_name=_("Job Result"))
verbose_name=_("Result"))
def get_object_id(self, row):
return row.id

View File

@ -53,13 +53,13 @@ if (job_id !== "") {
$.each(data.available, function (index, item) {
$("#actions_available").append(
"<li class='list-group-item' id=" + item.action_id + ">" +
item.freezer_action.backup_name + "</li>"
"(" + item.freezer_action.action + ")" + " " + item.freezer_action.backup_name + "</li>"
);
});
$.each(data.selected, function (index, item) {
$("#actions_selected").append(
"<li class='list-group-item' id=" + item.action_id + ">" +
item.freezer_action.backup_name + "</li>"
"(" + item.freezer_action.action + ")" + " " + item.freezer_action.backup_name + "</li>"
);
});
},
@ -82,8 +82,7 @@ if (job_id !== "") {
$.each(data, function (index, item) {
$("#actions_available").append(
"<li class='list-group-item' id=" + item.action_id + ">" +
item.freezer_action.backup_name +
"</li>"
"(" + item.freezer_action.action + ")" + " " + item.freezer_action.backup_name + "</li>"
);
});
},

View File

@ -73,13 +73,13 @@ class SessionObject(object):
class JobObject(object):
def __init__(self, job_id, description, result, event, client_id=None):
def __init__(self, job_id, description, result, event, client_id='_'):
self.job_id = job_id
self.id = job_id
self.description = description
self.result = result or 'pending'
self.event = event or 'stop'
self.client_id = client_id
self.client_id = client_id.split('_')[1]
class JobsInSessionObject(object):