Merge branch 'cloud-3.1.0' of https://github.com/wso2/product-iots into cloud-3.1.0

application-manager-new
ayyoob 8 years ago
commit 59b86f9d50

@ -1456,5 +1456,31 @@
</outputDirectory> </outputDirectory>
<fileMode>755</fileMode> <fileMode>755</fileMode>
</file> </file>
<file>
<source>
src/repository/cloud/portal/common.css
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/portal/css
</outputDirectory>
</file>
<file>
<source>
src/repository/cloud/portal/portal.js
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/portal/js
</outputDirectory>
</file>
<file>
<source>
src/repository/cloud/portal/global-navigation.jag
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/portal/theme/templates
</outputDirectory>
</file>
</files> </files>
</assembly> </assembly>

@ -0,0 +1,245 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* 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.
*/
.truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/**
* Validation messages
*/
.required {
color: #e74c3c;
}
.required-error {
background: #a94442;
border: 1px solid #a94442;
padding: 6px 12px;
color: #fff;
}
/**
* Theme overrides
*/
.breadcrumb li .fw-home {
float: left;
padding-top: 2px;
margin-right: 5px;
}
/**
* Auth menu
*/
.auth .hidden-xs {
line-height: 38px;
}
.auth-xs {
color: #fff;
}
.auth-xs ul {
list-style: none;
padding: 0;
margin: 0;
line-height: 28px;
background-color: #2a80b9;
}
.auth-xs li {
color: #ccc;
}
.auth-xs li a {
display: block;
color: #fff;
}
.auth-xs li a:hover {
background-color: #499dd5;
}
ul.dropdown-menu.more-actions-button {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
width: 40px;
background: #F9F9F9;
border-bottom: 1px solid #EFEFEF;
min-width: 45px;
}
ul.dropdown-menu.more-actions-button > li {
height: 40px;
width: 40px;
border: 1px;
}
ul.dropdown-menu.more-actions-button > li > button {
border-bottom: 1px solid #e4e4e4;
border-top: 1px solid darkred;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: none;
box-shadow: none;
border: 0px;
}
.btn-custom {
border-width: 1px;
}
.cloud-menu .popover {
border-radius: 0px;
width: 24em;
left: -21.1em !important;
max-width: 32em;
background-color: #006690
}
.cloud-menu .popover-title,.navbar-header .popover-title {
background-color: #006690;
font-size: 16px;
border-bottom: none;
font-weight: 400;
}
.cloud-menu .popover.bottom>.arrow{
margin-left:-2px;
}
.cloud-menu .popover.bottom>.arrow:after,.navbar-header .popover.bottom>.arrow:after{
border-bottom-color: #006690;
}
.cloud-block {
float: left;
width: 8.2em;
height: 8.2em;
background-color: #fff;
margin: 0.5em 0em 0.5em 0.5em;
text-align: center;
vertical-align: middle;
}
.cloud-name {
font-size:14px;
margin-top: .5em;
font-weight: 400;
}
.cloud-menu-popover {
position: relative;
float: right;
padding: 0px 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
color: #fff;
cursor: pointer;
}
#cloud-menu-popover-xs {
color: #fff;
line-height:24px;
border: none;
margin-right: 15px!important;
}
.navbar-toggle{
border:none;
border-radius: 0px;
}
.navbar-header .popover {
border-radius: 0px;
width: 21em;
max-width:32em;
background-color: #006690;
}
.navbar-header .popover .popover-content{
padding:0px;
}
.cloud-menu .popover-content {
padding: 0px;
}
.cloud-actions {
background-color: #005578;
float: left;
position: absolute;
width: 100%;
left: 0px;
overflow:hidden;
}
.cloud-actions h3 {
font-size: 16px;
font-weight: 400;
padding-left: 14px;
margin-top: 10px;
}
.cloud-block-invert {
color: #fff;
float: left;
width: 8.2em;
height: 8.2em;
background-color: #1f1f1f;
margin: 0.5em 0em 0.5em 0.5em;
text-align: center;
cursor: pointer;
}
.cloud-block-default {
color: #006690;
background-color: #fff;
cursor: pointer;
}
.cloud-actions a:hover {
color: #d7d5d5;
background-color: #3d3d3d;
text-decoration: none
}
.cloud-apps a {
text-decoration: none;
color: #006690 !important;
cursor: pointer
}
.cloud-apps a:hover {
text-decoration: none;
color: #006690;
background-color: #c5c5c5;
}
.cloud-apps .cloud-actions a {
color: #fff
}
.add-padding-top-3x {
padding-top: 15px !important;
}
.nav li a{
color: #fff;
}
.cloud-menu-content li a{
color:inherit;
}
html{
height: 100%;
}
body{
height: calc(100% - 50px);
}

@ -0,0 +1,289 @@
<%
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* 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.
*/
%>
<%
var query = request.getQueryString();
var dest = encodeURIComponent(originalURI + (query ? '?' + query : ''));
%>
<header class="header header-default">
<div class="container-fluid">
<div class="pull-left brand float-remove-xs text-center-xs">
<a href="<%=tenantedUrlPrefix%>./dashboards">
<img src="<%=urlPrefix%>libs/theme-wso2_1.0/images/logo-inverse.svg" alt="WSO2" title="WSO2" class="logo">
<h1>Cloud</h1>
</a>
</div>
<div class="pull-right auth float-remove-xs text-center-xs">
<% if (user) { %>
<ul class="nav navbar-right float-remove-xs text-center-xs">
<li class="visible-inline-block">
<a href="#" target="_self" title="
<%=user.domain%>
">
<span class="icon fw-stack fw-lg">
<i class="fw fw-organization fw-stack-1x" title=" {{@user.domain}}"></i>
</span>
<span class="hidden-xs">
<%=user.domain%>
</span>
</a>
</li>
<li class="visible-inline-block">
<a href="#" target="_blank" class="dropdown" data-toggle="dropdown" title="Account">
<span class="icon fw-stack fw-lg" style="color: red">
<i class="fw fw-resource fw-stack-1x" title="Account"></i>
</span>
<span class="hidden-xs" style="color: red">
Trial 14 days to upgrade
</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right float-remove-xs position-static-xs text-center-xs remove-margin-xs slideInDown"
role="menu">
<li>
<a title="Upgrade Now"
href="https://cloudmgt.clouddev.wso2.com/cloudmgt/site/pages/payment-plans.jag?cloud-type=device_cloud"
target="_self">
<i class="fw fw-export" title="Upgrade Now"></i> Upgrade Now
</a>
</li>
<li>
<a title="Monetization"
href="https://cloudmgt.clouddev.wso2.com/cloudmgt/site/pages/monetization-dashboard.jag"
target="_self">
<i class="fa fa-money fa-lg" title="Monetization"></i> Monetization
</a>
</li>
<li>
<a title="Request Extension"
href="https://cloudmgt.clouddev.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud&amp;request-extension=true"
target="_blank">
<i class="fw fw-mail" title="Request Extension"></i> Request Extension
</a>
</li>
</ul>
</li>
<li class="visible-inline-block">
<a href="#" target="null" class="dropdown" data-toggle="dropdown" title="App Management">
<span class="icon fw-stack fw-lg">
<i class="fw fw-settings fw-stack-1x" title="App Management"></i>
</span>
<span class="hidden-xs">
App Management
</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right float-remove-xs position-static-xs text-center-xs remove-margin-xs slideInDown"
role="menu">
<li class="visible-inline-block">
<a title="Mobile App Publisher" href="https://devicemgt.clouddev.wso2.com/publisher"
target="_self">
<i class="fw fw-user" title="Mobilr App Publisher"></i> App Publisher
</a>
</li>
<li class="visible-inline-block">
<a title="App Store " href="https://devicemgt.clouddev.wso2.com/store"
target="_self">
<i class="fw fw-store" title="App Store"></i> App Store
</a>
</li>
</ul>
</li>
<li class="visible-inline-block">
<a href="https://cloudmgt.clouddev.wso2.com/cloudmgt/site/pages/contact-us.jag" target="_self"
title="Support">
<span class="icon fw-stack fw-lg" style="color: #ff8c27;">
<i class="fw fw-mail fw-stack-1x" title="Support"></i>
</span>
<span class="hidden-xs" style="color: #ff8c27;">
Support
</span>
</a>
</li>
<li class="visible-inline-block">
<a href="#" target="null" class="dropdown" data-toggle="dropdown" title="Documentation">
<span class="icon fw-stack fw-lg">
<i class="fw fw-document fw-stack-1x" title="Documentation"></i>
</span>
<span class="hidden-xs">
Documentation
</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right float-remove-xs position-static-xs text-center-xs remove-margin-xs slideInDown"
role="menu">
<li>
<a title="API Cloud"
href="https://docs.wso2.com/display/APICloud/WSO2+API+Cloud+Documentation"
target="_blank">
<i class="fw fw-api" title="API Cloud"></i> API Cloud
</a>
</li>
<li>
<a title="App Cloud"
href="https://docs.wso2.com/display/AppCloud/WSO2+App+Cloud+Documentation"
target="_blank">
<i class="fw fw-application" title="App Cloud"></i> App Cloud
</a>
</li>
<li>
<a title="App Cloud"
href="https://docs.wso2.com/display/AppCloud/WSO2+Device+Cloud+Documentation"
target="_blank">
<i class="fw fw-application" title="App Cloud"></i> Device Cloud
</a>
</li>
<li>
<a title="API Cloud Walkthrough"
href="https://api.clouddev.wso2.com/publisher?interactiveTutorial=true"
target="_self">
<i class="fw fw-document" title="API Cloud Walkthrough"></i> API Cloud Walkthrough
</a>
</li>
</ul>
</li>
<li class="visible-inline-block">
<a href="#" class="dropdown" data-toggle="dropdown" title="user">
<span class="icon fw-stack fw-lg">
<i class="fw fw-circle-outline fw-stack-2x" title="User"></i>
<i class="fw fw-user fw-stack-1x" title="User"></i>
</span>
<span class="hidden-xs">
<%=user.username%></span><span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right float-remove-xs position-static-xs text-center-xs remove-margin-xs slideInDown"
role="menu">
<li>
<a title="Profile"
href="https://cloudmgt.clouddev.wso2.com/cloudmgt/site/pages/user-profile.jag"
target="_self">
<i class="fw fw-user" title="Profile"></i> Profile
</a>
</li>
<li>
<a title="Change Password"
href="https://cloudmgt.clouddev.wso2.com/cloudmgt/site/pages/change-password.jag"
target="_self">
<i class="fw fw-lock" title="Change Password"></i> Change Password
</a>
</li>
<li>
<a title="Logout" href="https://api.clouddev.wso2.com/publisher/site/pages/logout.jag"
target="_self">
<i class="fw fw-sign-out" title="Logout"></i> Logout
</a>
</li>
</ul>
</li>
<li class="visible-inline-block cloud-menu">
<a href="#" id="cloud-menu-popover">
<span class="icon fw-stack fw-lg">
<i class="fw fw-tiles fw-stack-1x" data-toggle="popover" data-placement="bottom"
data-original-title="" title=""></i>
</span>
<span class="hidden-xs">
</span>
</a>
</li>
</ul>
</div>
<% } else { %>
<a href="<%=urlPrefix%>login?destination=<%=dest%>" class="dropdown" data-toggle="dropdown">
<%= i18n.localize("login.label")%>
</a>
<% } %>
</div>
<div class="cloud-menu-content hide">
<div id="popover-head" class="hide">Navigate to Cloud</div>
<div id="popover-content" class="hide">
<div class="cloud-apps">
<a href="https://api.cloud.wso2.com/publisher" target="_self" class="cloud-block add-padding-top-3x">
<i class="fw fw-api fw-3x"></i>
<div class="cloud-name">API Cloud</div>
</a>
<a href="https://apps.cloud.wso2.com/appmgt" target="_self" class="cloud-block add-padding-top-3x">
<i class="fw fw-application fw-3x"></i>
<div class="cloud-name">App Cloud</div>
</a>
<a href="https://devicemgt.cloud.wso2.com/devicemgt" target="_self" class="cloud-block add-padding-top-3x">
<i class="fw fw-mobile fw-3x"></i>
<div class="cloud-name">Device Cloud</div>
</a>
<div class="clearfix"></div><!-- to make seperate -->
</div>
<div class="cloud-actions">
<h3>Manage your cloud</h3>
<a href="https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/organization.jag" target="_self" class="cloud-block-invert add-padding-top-3x">
<i class="fw fw-organization fw-3x"></i>
<div class="cloud-name">Organization</div>
</a>
<a href="https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/user.jag" target="_self" class="cloud-block-invert add-padding-top-3x">
<i class="fa fa-users fa-3x"></i>
<div class="cloud-name">Members</div>
</a>
</div>
</div>
</div>
</div>
</header>

@ -0,0 +1,204 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* 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 () {
var dashboardsApi = ues.utils.tenantPrefix() + 'apis/dashboards';
var dashboards = [];
var isStillLoading = false;
var nextStart = 0;
var hasMore = true;
/**
* Page count.
* @const
*/
var PAGE_COUNT = 10;
// Pre-compiling handlebar templates
var dashboardsListHbs = Handlebars.compile($("#ues-dashboards-list-hbs").html());
var dashboardThumbnailHbs = Handlebars.compile($("#ues-dashboard-thumbnail-hbs").html());
var dashboardConfirmHbs = Handlebars.compile($("#ues-dashboard-confirm-hbs").html());
var dashboardsEmptyHbs = Handlebars.compile($("#ues-dashboards-empty-hbs").html());
Handlebars.registerPartial('ues-dashboard-thumbnail-hbs', dashboardThumbnailHbs);
/**
* Find the dashboard using dashboard id.
* @param id
* @return {object}
* @private
* */
var findDashboard = function (id) {
var i;
var dashboard;
var length = dashboards.length;
for (i = 0; i < length; i++) {
dashboard = dashboards[i];
if (dashboard.id === id) {
return dashboard;
}
}
};
/**
* Delete the selected dashboard
* @param el:-selected dashboard element
* @private
* */
var deleteDashboard = function (el) {
var button = Ladda.create(el[0]);
button.start();
var id = el.closest('.ues-dashboard').data('id');
$.ajax({
url: dashboardsApi + '/' + id,
method: 'DELETE',
async : false,
success: function () {
button.stop();
location.reload();
},
error: function () {
button.stop();
}
});
};
/**
* Load the list of dashboards available.
* @private
* */
var loadDashboards = function () {
isStillLoading = true;
if (!hasMore) {
isStillLoading = false;
$('.ues-dashboard').each(function (i, obj) {
if ($(this).find('.ues-dashboard-share').length) {
$(this).addClass("shared");
}
});
return;
}
ues.store.assets('dashboard', {
start: nextStart,
count: PAGE_COUNT
}, function (err, data) {
var dashboardsEl = $('#ues-portal').find('.ues-dashboards');
hasMore = data.length;
if (!hasMore && nextStart === 0) {
dashboardsEl.append(dashboardsEmptyHbs());
return;
}
nextStart += PAGE_COUNT;
dashboards = dashboards.concat(data);
dashboardsEl.append(dashboardsListHbs(data));
var win = $(window);
var doc = $(document);
isStillLoading = false;
if (doc.height() > win.height()) {
return;
}
loadDashboards();
$(".disable").on('click', function (event) {
event.preventDefault();
});
});
};
/**
* Initialize the UI functionality such as binding events.
* @private
* */
var initUI = function () {
var portal = $('#ues-portal');
portal.on('click', '.ues-dashboards .ues-dashboard-trash-handle', function (e) {
e.preventDefault();
var thiz = $(this);
var dashboardEl = thiz.closest('.ues-dashboard');
var id = dashboardEl.data('id');
var dashboard = findDashboard(id);
dashboardEl.html(dashboardConfirmHbs(dashboard));
});
portal.on('click', '.ues-dashboards .ues-dashboard-trash-confirm', function (e) {
e.preventDefault();
deleteDashboard($(this));
});
portal.on('click', '.ues-dashboards .ues-dashboard-trash-cancel', function (e) {
e.preventDefault();
var thiz = $(this);
var dashboardEl = thiz.closest('.ues-dashboard');
var id = dashboardEl.data('id');
var dashboard = findDashboard(id);
dashboardEl.html(dashboardThumbnailHbs(dashboard));
});
portal.on('click', '.ues-view:not(.disable)', function(e) {
e.preventDefault();
window.open($(this).attr('href'), '_blank');
});
$('#filter-dashboards a').on('click', function () {
$('#filter').html($(this).text());
var filter = $(this).data('filter');
$('.ues-dashboard-container').each(function (i, obj) {
if (filter === "All") {
$(this).show();
} else {
if ($(this).find('.ues-dashboard-share').length) {
filter === "Shared" ? $(this).show() : $(this).hide();
} else {
filter === "Shared" ? $(this).hide() : $(this).show();
}
}
});
});
$(window).scroll(function () {
var win = $(window);
var doc = $(document);
if (win.scrollTop() + win.height() < doc.height() - 100) {
return;
}
if (!isStillLoading) {
loadDashboards();
}
});
};
$(document).ready(function () {
$('#cloud-menu-popover i.fw-tiles').popover({
html: true,
trigger:'click',
title: function() {
return $("#popover-head").html();
},
content: function() {
return $("#popover-content").html();
}
});
});
initUI();
loadDashboards();
});

@ -92,5 +92,6 @@
<filtered>true</filtered> <filtered>true</filtered>
<fileMode>644</fileMode> <fileMode>644</fileMode>
</file> </file>
</files> </files>
</assembly> </assembly>

Loading…
Cancel
Save