From 4b3a02677bfe50709976e5fcfc29d9c51f72f900 Mon Sep 17 00:00:00 2001 From: Pino de Candia Date: Tue, 16 Jan 2018 14:48:40 +0000 Subject: [PATCH] Fixed passthrough API --- tatudashboard/api/__init__.py | 0 tatudashboard/api/rest/__init__.py | 16 ---------------- tatudashboard/dashboards/tatu/__init__.py | 1 + tatudashboard/enabled/_3981_tatu_ca_panel.py | 2 ++ tatudashboard/rest_api/__init__.py | 1 + .../{api/rest => rest_api}/passthrough.py | 0 .../resources/os-tatu-ca/os-tatu-ca.module.js | 18 +++++++++--------- 7 files changed, 13 insertions(+), 25 deletions(-) delete mode 100644 tatudashboard/api/__init__.py delete mode 100644 tatudashboard/api/rest/__init__.py create mode 100644 tatudashboard/rest_api/__init__.py rename tatudashboard/{api/rest => rest_api}/passthrough.py (100%) diff --git a/tatudashboard/api/__init__.py b/tatudashboard/api/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tatudashboard/api/rest/__init__.py b/tatudashboard/api/rest/__init__.py deleted file mode 100644 index 0295f36..0000000 --- a/tatudashboard/api/rest/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. -"""REST API for Horizon dashboard Javascript code. -""" -from . import passthrough # noqa diff --git a/tatudashboard/dashboards/tatu/__init__.py b/tatudashboard/dashboards/tatu/__init__.py index e69de29..915a62c 100644 --- a/tatudashboard/dashboards/tatu/__init__.py +++ b/tatudashboard/dashboards/tatu/__init__.py @@ -0,0 +1 @@ +from tatudashboard import rest_api diff --git a/tatudashboard/enabled/_3981_tatu_ca_panel.py b/tatudashboard/enabled/_3981_tatu_ca_panel.py index 74b49fa..19e9d2b 100644 --- a/tatudashboard/enabled/_3981_tatu_ca_panel.py +++ b/tatudashboard/enabled/_3981_tatu_ca_panel.py @@ -19,6 +19,8 @@ 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.dashboards.tatu.ca.panel.CA' ADD_ANGULAR_MODULES = ['tatudashboard'] diff --git a/tatudashboard/rest_api/__init__.py b/tatudashboard/rest_api/__init__.py new file mode 100644 index 0000000..918d341 --- /dev/null +++ b/tatudashboard/rest_api/__init__.py @@ -0,0 +1 @@ +from . import passthrough diff --git a/tatudashboard/api/rest/passthrough.py b/tatudashboard/rest_api/passthrough.py similarity index 100% rename from tatudashboard/api/rest/passthrough.py rename to tatudashboard/rest_api/passthrough.py 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 index 1ecd12b..a13ea7e 100644 --- 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 @@ -56,28 +56,28 @@ resourceType .setNames(gettext('SSH CA'), gettext('SSH CAs')) .setListFunction(listCAs) - .setProperty('id', { - label: gettext('CA ID') + .setProperty('auth_id', { + label: gettext('Project/CA ID') }) - .setProperty('host_pub_key', { + .setProperty('host_key.pub', { label: gettext('Host Public Key') }) - .setProperty('user_pub_key', { + .setProperty('user_key.pub', { label: gettext('User Public Key') }); resourceType .tableColumns .append({ - id: 'id', + id: 'auth_id', priority: 1 }) .append({ - id: 'host_pub_key', + id: 'host_key.pub', priority: 2 }) .append({ - id: 'user_pub_key', + id: 'user_key.pub', priority: 2 }); @@ -85,9 +85,9 @@ function listCAs() { return caApi.list().then(function onList(response) { // listFunctions are expected to return data in "items" - response.data.items = response.data.CAs; + //response.data.items = response.data.CAs; - util.addTimestampIds(response.data.items, 'updated_at'); + util.addTimestampIds(response.data.items, 'auth_id'); return response; });