diff --git a/tatudashboard/dashboard.py b/tatudashboard/dashboard.py new file mode 100644 index 0000000..43f24a1 --- /dev/null +++ b/tatudashboard/dashboard.py @@ -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) diff --git a/tatudashboard/dashboards/project/dummy/__init__.py b/tatudashboard/dashboards/project/dummy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tatudashboard/dashboards/project/dummy/panel.py b/tatudashboard/dashboards/project/dummy/panel.py new file mode 100644 index 0000000..1ecfa5e --- /dev/null +++ b/tatudashboard/dashboards/project/dummy/panel.py @@ -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) diff --git a/tatudashboard/enabled/_3980_ssh_dashboard.py b/tatudashboard/enabled/_3980_ssh_dashboard.py new file mode 100644 index 0000000..3781704 --- /dev/null +++ b/tatudashboard/enabled/_3980_ssh_dashboard.py @@ -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 diff --git a/tatudashboard/enabled/_3981_ssh_ca_panel.py b/tatudashboard/enabled/_3981_ssh_ca_panel.py new file mode 100644 index 0000000..af1a113 --- /dev/null +++ b/tatudashboard/enabled/_3981_ssh_ca_panel.py @@ -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 diff --git a/tatudashboard/panels/__init__.py b/tatudashboard/panels/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tatudashboard/panels/ca/__init__.py b/tatudashboard/panels/ca/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tatudashboard/panels/ca/panel.py b/tatudashboard/panels/ca/panel.py new file mode 100644 index 0000000..7d59174 --- /dev/null +++ b/tatudashboard/panels/ca/panel.py @@ -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) diff --git a/tatudashboard/panels/ca/urls.py b/tatudashboard/panels/ca/urls.py new file mode 100644 index 0000000..74e443d --- /dev/null +++ b/tatudashboard/panels/ca/urls.py @@ -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'), +] diff --git a/tatudashboard/panels/ca/views.py b/tatudashboard/panels/ca/views.py new file mode 100644 index 0000000..aa7edc8 --- /dev/null +++ b/tatudashboard/panels/ca/views.py @@ -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' diff --git a/tatudashboard/static/tatudashboard/ca.html b/tatudashboard/static/tatudashboard/ca.html new file mode 100644 index 0000000..84a6ae3 --- /dev/null +++ b/tatudashboard/static/tatudashboard/ca.html @@ -0,0 +1,4 @@ + + + diff --git a/tatudashboard/static/tatudashboard/resources/os-tatu-ca/os-tatu-ca.module.js b/tatudashboard/static/tatudashboard/resources/os-tatu-ca/os-tatu-ca.module.js new file mode 100644 index 0000000..4928407 --- /dev/null +++ b/tatudashboard/static/tatudashboard/resources/os-tatu-ca/os-tatu-ca.module.js @@ -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 []; + } + } + +})();