More attempts.

This commit is contained in:
Pino de Candia 2018-01-12 23:20:30 +00:00
parent 20b48f3e0c
commit 5c1cba79d8
12 changed files with 250 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# Copyright (c) 2016 Huawei, Inc.
#
# 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.
import horizon
class SSH(horizon.Dashboard):
name = "SSH Management"
slug = "tatu"
default_panel = "ssh_ca"
horizon.register(SSH)

View File

@ -0,0 +1,25 @@
# (c) Copyright 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.
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Hosts(horizon.Panel):
name = _("SSH Hosts")
slug = 'ssh_hosts'
permissions = ('openstack.services.dns',)
dashboard.Project.register(Hosts)

View File

@ -0,0 +1,25 @@
# Copyright (c) 2017 Huawei, Inc.
#
# 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 = 'tatu'
# If set to True, this dashboard will not be added to the settings.
DISABLED = False
ADD_INSTALLED_APPS = ['tatudashboard']
# Automatically discover static resources in installed apps
AUTO_DISCOVER_STATIC_FILES = True

View File

@ -0,0 +1,28 @@
# Copyright (c) 2017 Huawei, Inc.
#
# 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.
PANEL = 'ssh_ca'
PANEL_GROUP = 'default'
PANEL_DASHBOARD = 'project'
# If set to True, this dashboard will not be added to the settings.
DISABLED = False
ADD_INSTALLED_APPS = ['tatudashboard']
ADD_PANEL = 'tatudashboard.panels.ca.panel.CA'
ADD_ANGULAR_MODULES = ['tatudashboard']
AUTO_DISCOVER_STATIC_FILES = True

View File

View File

View File

@ -0,0 +1,25 @@
# Copyright (c) 2016 Huawei, Inc.
#
# 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.
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class CA(horizon.Panel):
name = _("SSH CA")
slug = 'ssh_ca'
dashboard.Project.register(CA)

View File

@ -0,0 +1,22 @@
# Copyright (c) 2016 Huawei, Inc.
#
# 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.
from django.conf.urls import url
from . import views
urlpatterns = [
url('', views.IndexView.as_view(), name='index'),
]

View File

@ -0,0 +1,19 @@
# Copyright (c) 2016 Huawei, Inc.
#
# 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.
from django.views import generic
class IndexView(generic.TemplateView):
template_name = 'angular.html'

View File

@ -0,0 +1,4 @@
<hz-resource-panel resource-type-name="OS::Tatu::CA">
<hz-resource-table resource-type-name="OS::Tatu::CA"
track-by="_timestampId"></hz-resource-table>
</hz-resource-panel>

View File

@ -0,0 +1,78 @@
/**
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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.
*/
(function () {
'use strict';
/**
* @ngdoc overview
* @ngname tatudashboard.resources.os-tatu-host
*
* @description
* Provides all of the services and widgets required
* to support and display SSH (Tatu) host related content.
*/
angular
.module('tatudashboard.resources.os-tatu-ca', [
'ngRoute',
])
.constant(
'tatudashboard.resources.os-tatu-host.resourceType', 'OS::Tatu::CA')
.run(run);
run.$inject = [
'horizon.framework.conf.resource-type-registry.service',
'tatudashboard.resources.os-tatu-host.resourceType'
];
function run(registry,
resourceTypeString) {
var resourceType = registry.getResourceType(resourceTypeString);
resourceType
.setNames(gettext('SSH CA'), gettext('SSH CAs'))
.setListFunction(listCAs)
.setProperty('id', {
label: gettext('CA ID')
})
.setProperty('host_pub_key', {
label: gettext('Host Public Key'),
})
.setProperty('user_pub_key', {
label: gettext('User Public Key'),
});
resourceType
.tableColumns
.append({
id: 'id',
priority: 1
})
.append({
id: 'host_pub_key',
priority: 2,
})
.append({
id: 'user_pub_key',
priority: 2,
});
function listHosts() {
return [];
}
}
})();