Added user and host panels

This commit is contained in:
Pino de Candia 2018-01-13 05:38:48 -06:00
parent 5c1cba79d8
commit 1b7c4ecd70
17 changed files with 202 additions and 74 deletions

View File

@ -15,10 +15,10 @@
import horizon
class SSH(horizon.Dashboard):
name = "SSH Management"
class Tatu(horizon.Dashboard):
name = "Tatu (SSH)"
slug = "tatu"
default_panel = "ssh_ca"
default_panel = "ca"
horizon.register(SSH)
horizon.register(Tatu)

View File

@ -12,17 +12,15 @@
# License for the specific language governing permissions and limitations
# under the License.
PANEL = 'ssh_ca'
PANEL = 'ca'
PANEL_GROUP = 'default'
PANEL_DASHBOARD = 'project'
PANEL_DASHBOARD = 'tatu'
# 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
AUTO_DISCOVER_STATIC_FILES = True

View File

@ -0,0 +1,26 @@
# 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 = 'user'
PANEL_GROUP = 'default'
PANEL_DASHBOARD = 'tatu'
# If set to True, this dashboard will not be added to the settings.
DISABLED = False
ADD_PANEL = 'tatudashboard.panels.user.panel.User'
ADD_ANGULAR_MODULES = ['tatudashboard']
AUTO_DISCOVER_STATIC_FILES = True

View File

@ -0,0 +1,26 @@
# 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 = 'host'
PANEL_GROUP = 'default'
PANEL_DASHBOARD = 'tatu'
# If set to True, this dashboard will not be added to the settings.
DISABLED = False
ADD_PANEL = 'tatudashboard.panels.host.panel.CA'
ADD_ANGULAR_MODULES = ['tatudashboard']
AUTO_DISCOVER_STATIC_FILES = True

View File

@ -1,20 +0,0 @@
# Copyright 2013 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 panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'ssh'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = 'SSH'
# The name of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'project'

View File

@ -1,40 +0,0 @@
# Copyright 2013 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 tatudashboard import exceptions
# The name of the panel to be added to HORIZON_CONFIG. Required.
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 = 'dns'
ADD_EXCEPTIONS = {
'recoverable': exceptions.RECOVERABLE,
'not_found': exceptions.NOT_FOUND,
'unauthorized': exceptions.UNAUTHORIZED,
}
ADD_INSTALLED_APPS = ['tatudashboard']
# Python panel class of the PANEL to be added.
ADD_PANEL = (
'tatudashboard.dashboards.project.hosts.panel.Hosts')
ADD_ANGULAR_MODULES = ['tatudashboard']
ADD_SCSS_FILES = ['tatudashboard/tatudashboard.scss']
AUTO_DISCOVER_STATIC_FILES = True

View File

@ -15,11 +15,11 @@
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
from tatudashboard import dashboard
class CA(horizon.Panel):
name = _("SSH CA")
slug = 'ssh_ca'
name = _("Certificate Authorities")
slug = 'ca'
dashboard.Project.register(CA)
dashboard.Tatu.register(CA)

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 tatudashboard import dashboard
class Host(horizon.Panel):
name = _("Hosts")
slug = 'host'
dashboard.Tatu.register(Host)

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

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 tatudashboard import dashboard
class User(horizon.Panel):
name = _("Users")
slug = 'user'
dashboard.Tatu.register(User)

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

@ -58,7 +58,13 @@
$provide.constant('tatudashboard.basePath', path);
$routeProvider
.when('/project/ssh_ca/', {
.when('/tatu/ca/', {
templateUrl: path + 'ca.html'
})
.when('/tatu/user/', {
templateUrl: path + 'ca.html'
})
.when('/tatu/host/', {
templateUrl: path + 'ca.html'
});
}