Random trials to get something working.

This commit is contained in:
Pino de Candia 2018-01-12 23:19:44 +00:00
parent e3570734fa
commit 20b48f3e0c
7 changed files with 10 additions and 39 deletions

View File

@ -18,8 +18,8 @@ from openstack_dashboard.dashboards.project import dashboard
class Hosts(horizon.Panel):
name = _("Hosts")
slug = 'hosts'
permissions = ('openstack.services.ssh',)
name = _("SSH Hosts")
slug = 'sshhosts'
permissions = ('openstack.services.dns',)
dashboard.Project.register(Hosts)

View File

@ -15,11 +15,11 @@
from tatudashboard import exceptions
# The name of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'hosts'
PANEL = 'sshhosts'
# The name of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The name of the panel group the PANEL is associated with.
PANEL_GROUP = 'ssh'
PANEL_GROUP = 'dns'
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE,

View File

@ -28,32 +28,18 @@
angular
.module('tatudashboard.resources.os-tatu-host', [
'ngRoute',
'tatudashboard.resources.os-tatu-host.actions',
'tatudashboard.resources.os-tatu-host.details'
])
.constant(
'tatudashboard.resources.os-tatu-host.resourceType', 'OS::Tatu::Host')
.config(config)
.run(run);
config.$inject = ['$provide', '$windowProvider'];
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'tatudashboard/resources/os-tatu-host/';
$provide.constant('tatudashboard.resources.os-tatu-host.basePath', path);
}
run.$inject = [
'horizon.app.core.detailRoute',
'horizon.framework.conf.resource-type-registry.service',
'tatudashboard.resources.os-tatu-host.api',
'tatudashboard.resources.os-tatu-host.resourceType',
'tatudashboard.resources.util'
];
function run(detailRoute,
registry,
hostApi,
function run(registry,
resourceTypeString,
util) {
var resourceType = registry.getResourceType(resourceTypeString);
@ -92,7 +78,6 @@
id: 'hostname',
priority: 1,
sortDefault: true,
template: '<a ng-href="{$ \'' + detailRoute + 'OS::Tatu::Host/\' + item.instance_id $}">{$ item.hostname $}</a>'
})
.append({
id: 'proj_name',
@ -115,24 +100,10 @@
isServer: false,
singleton: true,
persistent: false
})
.append({
label: gettext('Project'),
name: 'proj_name',
isServer: false,
singleton: true,
persistent: false
});
function listHosts() {
return hostApi.list().then(function onList(response) {
// listFunctions are expected to return data in "items"
response.data.items = response.data.hosts;
util.addTimestampIds(response.data.items, 'updated_at');
return response;
});
return [];
}
}

View File

@ -29,6 +29,6 @@
*/
angular
.module('tatudashboard.resources', [
'tatudashboard.resources.os-tatu-host'
'tatudashboard.resources.os-tatu-ca'
]);
})();

View File

@ -58,8 +58,8 @@
$provide.constant('tatudashboard.basePath', path);
$routeProvider
.when('/project/hosts/', {
templateUrl: path + 'hosts.html'
.when('/project/ssh_ca/', {
templateUrl: path + 'ca.html'
});
}