From b3e40f026d655501bfa581452c447784604ecb05 Mon Sep 17 00:00:00 2001 From: xudan Date: Fri, 6 Jul 2018 05:16:40 -0400 Subject: Move all web portal code to the new repo dovetail-webportal This is only the first step to simply copy the file here. There still need some more work to make sure all work well. All the changes will be submitted with other patches to make it easily to review. JIRA: DOVETAIL-671 Change-Id: I64d32a9df562184166b6199e2719f298687d1a0a Signed-off-by: xudan --- .../components/application/application.html | 348 +++++ .../application/applicationController.js | 177 +++ .../testapi-ui/components/application/logo-request | 1417 ++++++++++++++++++++ .../components/application/modal/confirmModal.html | 43 + 4 files changed, 1985 insertions(+) create mode 100644 3rd_party/static/testapi-ui/components/application/application.html create mode 100644 3rd_party/static/testapi-ui/components/application/applicationController.js create mode 100644 3rd_party/static/testapi-ui/components/application/logo-request create mode 100644 3rd_party/static/testapi-ui/components/application/modal/confirmModal.html (limited to '3rd_party/static/testapi-ui/components/application') diff --git a/3rd_party/static/testapi-ui/components/application/application.html b/3rd_party/static/testapi-ui/components/application/application.html new file mode 100644 index 0000000..17b17c6 --- /dev/null +++ b/3rd_party/static/testapi-ui/components/application/application.html @@ -0,0 +1,348 @@ + + Logo Request » OpenStack Open Source Cloud Computing Software + + + + + + + +
+
+
+

+

Complete this application then start your CVP journey

+ +

+
+
+ +
+
+ +
+ +
+
+ + + +
+ +
+
+
+ + +
+ +
+
+
+ +
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+
+ + +
+ +
+
+ +
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Create DateOrganization nameOrganization websiteProduct nameProduct specificationsProduct documentationProduct categoriesPrimary contact namePrimary business emailPrimary postal addressPrimary phone numberUser ID TypeUser IDDescriptionSUT versionSUT HW versionOVP versionOVP categoryCompany logoApprove dateApprovedTest IDLocationOperation
{{ app.creation_date | limitTo: 10 }}{{ app.organization_name }}{{ app.organization_web }}{{ app.product_name}}{{app.product_spec}}{{app.product_documentation}}{{ app.product_categories | category }}{{ app.prim_name }}{{ app.prim_email }}{{ app.prim_address }}{{ app.prim_phone }}{{ app.id_type }}{{ app.user_id }}{{ app.description }}{{ app.sut_version }}{{ app.sut_hw_version }}{{ app.ovp_version }}{{ app.ovp_category }}{{ app.company_logo }}{{ app.approve_date }}{{ app.approved }}{{ app.test_id }}{{ app.lab_location | labLocation}}
+ +
+ + +
+
+ +
+
+

Company Logo Upload for Directory

+
+
+ +
+ +
+
+ +
diff --git a/3rd_party/static/testapi-ui/components/application/applicationController.js b/3rd_party/static/testapi-ui/components/application/applicationController.js new file mode 100644 index 0000000..5666ff2 --- /dev/null +++ b/3rd_party/static/testapi-ui/components/application/applicationController.js @@ -0,0 +1,177 @@ +/* + * 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'; + + angular + .module('testapiApp') + .controller('ApplicationController', ApplicationController); + + ApplicationController.$inject = [ + '$http', '$stateParams', '$window', '$sce', + '$uibModal', 'testapiApiUrl', 'raiseAlert', 'ngDialog', '$scope' + ]; + + /** + */ + function ApplicationController($http, $stateParams, $window, $sce, + $uibModal, testapiApiUrl, raiseAlert, ngDialog, $scope) { + + var ctrl = this; + ctrl.uploadLogo=uploadLogo; + + function init(){ + ctrl.organization_name = null; + ctrl.organization_web = null; + ctrl.product_name = null; + ctrl.product_spec = null; + ctrl.product_documentation = null; + ctrl.product_categories = "soft&hard"; + ctrl.prim_name = null; + ctrl.prim_email = null; + ctrl.prim_address = null; + ctrl.prim_phone = null; + ctrl.id_type = "Linux Foundation"; + ctrl.user_id = null; + ctrl.description = null; + ctrl.sut_version = null; + ctrl.sut_hw_version = null; + ctrl.ovp_version = "2018.01"; + ctrl.ovp_category = "Infrastructure"; + ctrl.company_logo = null; + ctrl.approve_date = null; + ctrl.approved = "false"; + ctrl.test_id = null; + ctrl.lab_location="internal"; + ctrl.lab_name = null; + ctrl.lab_email=null; + ctrl.lab_address=null; + ctrl.lab_phone=null; + ctrl.applications = []; + ctrl.showApplications = []; + + ctrl.totalItems = null; + ctrl.currentPage = 1; + ctrl.itemsPerPage = 5; + ctrl.numPages = null; + ctrl.lab_tpl = "lab.tpl.html"; + ctrl.product_tpl = "product.tpl.html"; + //ctrl.lab_html=$sce.trustAsHtml('
{{app.lab_email}}
{{app.lab_address}}
{{app.lab_phone}}
'); + + getApplication(); + } + + + ctrl.submitForm = function(){ + var data = { + "organization_name": ctrl.organization_name, + "organization_web": ctrl.organization_web, + "product_name": ctrl.product_name, + "product_spec": ctrl.product_spec, + "product_documentation": ctrl.product_documentation, + "product_categories": ctrl.product_categories, + "prim_name": ctrl.prim_name, + "prim_email": ctrl.prim_email, + "prim_address": ctrl.prim_address, + "prim_phone": ctrl.prim_phone, + "id_type": ctrl.id_type, + "user_id": ctrl.user_id, + "description": ctrl.description, + "sut_version": ctrl.sut_version, + "sut_hw_version": ctrl.sut_hw_version, + "ovp_version": ctrl.ovp_version, + "ovp_category": ctrl.ovp_category, + "company_logo": ctrl.company_logo, + "approve_date": ctrl.approve_date, + "approved": ctrl.approved, + "test_id": ctrl.test_id, + "lab_location": ctrl.lab_location, + "lab_email": ctrl.lab_email, + "lab_address": ctrl.lab_address, + "lab_phone": ctrl.lab_phone + }; + console.log(data); + $http.post(testapiApiUrl + "/cvp/applications", data).then(function(resp){ + if(resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + getApplication(); + }, function(error){ + }); + } + + ctrl.openConfirmModal = function(){ + var resp = confirm("Are you sure to submit?"); + if (resp) { + ctrl.submitForm(); + } + } + + ctrl.cancelSubmit = function(){ + ngDialog.close(); + } + + ctrl.updatePage = function(){ + getApplication(); + } + + ctrl.deleteApp = function(id){ + var resp = confirm('Are you sure to delete this application?'); + if (!resp) + return; + + var delUrl = testapiApiUrl + "/cvp/applications/" + id; + $http.delete(delUrl) + .then( function(ret) { + if(ret.data.code && ret.data.code != 0) { + alert(ret.data.msg); + return; + } + getApplication(); + }); + } + + function uploadLogo(){ + var file = $scope.logoFile; + var fd = new FormData(); + fd.append('file', file); + + $http.post(testapiApiUrl + "/cvp/applications/uploadlogo", fd, { + transformRequest: angular.identity, + headers: {'Content-Type': undefined} + }).then(function(resp){ + if(resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + }, function(error){ + }); + + }; + + function getApplication(){ + $http.get(testapiApiUrl + "/cvp/applications?page="+ctrl.currentPage+"&signed&per_page="+ctrl.itemsPerPage).then(function(response){ + ctrl.applications = response.data.applications; + ctrl.totalItems = response.data.pagination.total_pages* ctrl.itemsPerPage; + ctrl.currentPage = response.data.pagination.current_page; + ctrl.numPages = response.data.pagination.total_pages; + }, function(error){ + }); + } + + init(); + } +})(); diff --git a/3rd_party/static/testapi-ui/components/application/logo-request b/3rd_party/static/testapi-ui/components/application/logo-request new file mode 100644 index 0000000..c7bb109 --- /dev/null +++ b/3rd_party/static/testapi-ui/components/application/logo-request @@ -0,0 +1,1417 @@ + + + + + + + + + + Logo Request » OpenStack Open Source Cloud Computing Software + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+

Join the global OpenStack community for use cases & training at the OpenStack Summit Sydney, November 6-8     + Register now +

+
+
+ + + + + + +
+ +
+ +
+
+ + +

Request information on OpenStack trademark licensing

+

If you plan to offer an OpenStack-related product or service using a trademark or brand that includes an OpenStack mark (e.g. logo or the word OpenStack), you are required to apply for and obtain a trademark license. We’ve created a family of logos and a set of standards specifically for this purpose. Once we understand more about your product or service, we can determine which (if any) logo program it falls under, and send you the appropriate license for signature.  

+ +
+ + + + + +
+ + +
+ +
+ +
+ + + +
+ + +
+ +
+ +
+ + + +
+ + + + + +
+ +
+ +
+ + + +
+ + +
+ +
+
    + + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + + +
+
+ + + +
+ + +
+ +
+ + + + +
+ + +
+ + + + +
+ +
+ +
+ + + +
+ + +
+ +
+ +
+ +
+ +
+ + + +
+ + +
+ +
+ +
+ +
+ + + +
+ + + If your proposed product name includes the OpenStack word mark, it will need to be approved as part of the licensing process.

+ +
+ +
+ +
+ +
+ + + +
+ + +
+ +
+
    + + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + + +
+
+ + + +
+ + +
+ +
+
    + + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + + +
+
+ + + +
+ + +
+ +
+
    + + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + + +
+
+ + + +
+ + +
+ + + + +
+ + +
+ +
+ +
+ + + +
+ + + + + +
+
+ + +
+ + + + + + +
+ + +
+ + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html b/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html new file mode 100644 index 0000000..749315d --- /dev/null +++ b/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html @@ -0,0 +1,43 @@ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ + -- cgit 1.2.3-korg