Fix issues in connectedcup device

application-manager-new
charitha 8 years ago
parent 85c5be77c3
commit 5feb7f82f2

@ -1,8 +1,47 @@
<iframe src="{{dashboardserverURL}}/portal/gadgets/connected-cup-analytics/landing" width="100%" height="1700" frameBorder="0"></iframe>
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
<style>
#rangeSliderWrapper{ display: none;}
</style>
WSO2 Inc. licenses this file to you 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.
}}
<span id="connectedcup-details" data-devices="{{devices}}" data-devicename="{{device.name}}"
data-deviceid="{{device.deviceIdentifier}}"
data-appcontext="{{@app.context}}"></span>
<div id="connectedcup-div-chart" data-backend-api-url= {{backendApiUri}}>
<div class="chartWrapper" id="chartWrapper">
<h3 id="span-title">Temperature</h3>
<div id="y_axis-temperature" class="custom_y_axis"></div>
<div class="legend_container">
<div id="smoother-temperature" title="Smoothing"></div>
<div id="legend-temperature"></div>
</div>
<div id="chart-temperature" class="custom_rickshaw_graph"></div>
<div id="x_axis-temperature" class="custom_x_axis"></div>
<div id="slider-temperature" class="custom_slider"></div>
</div>
<div class="chartWrapper" id="chartWrapper">
<h3 id="span-title">Coffee Level</h3>
<div id="y_axis-coffeelevel" class="custom_y_axis"></div>
<div class="legend_container">
<div id="smoother-coffeelevel" title="Smoothing"></div>
<div id="legend-coffeelevel"></div>
</div>
<div id="chart-coffeelevel" class="custom_rickshaw_graph"></div>
<div id="x_axis-coffeelevel" class="custom_x_axis"></div>
<div id="slider-coffeelevel" class="custom_slider"></div>
</div>
</div>
{{#zone "bottomJs"}}
{{js "js/connectedcup.js"}}

@ -17,30 +17,26 @@
*/
function onRequest(context) {
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
var devices = context.unit.params.devices;
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter('deviceId');
var deviceId = request.getParameter("deviceId");
if (devices) {
return {
'devices': stringify(devices),
'backendApiUri': devicemgtProps['httpsURL'] + '/connectedcup/stats/',
'dashboardserverURL': devicemgtProps['dashboardserverURL']
"devices": stringify(devices),
"backendApiUri": "/connectedcup/stats/"
};
} else if (deviceType && deviceId) {
var deviceModule = require('/app/modules/device.js').deviceModule;
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != 'error') {
if (device && device.status != "error") {
return {
'device': device.content,
'backendApiUri': devicemgtProps['httpsURL'] + '/connectedcup/stats/' + deviceId,
'dashboardserverURL': devicemgtProps['dashboardserverURL']
"device": device.content,
"backendApiUri": "/connectedcup/stats/" + deviceId
};
} else {
response.sendError(404, 'Device Id ' + deviceId + ' of type ' + deviceType + ' cannot be found!');
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit();
}
}
}
}

@ -224,7 +224,8 @@ function drawGraph_connectedcup(from, to) {
if (devices) {
getData();
} else {
var backendApiUrl = $('#connectedcup-div-chart').data('backend-api-url') + '/sensors/temperature' + '?from=' + from + '&to=' + to;
var backendApiUrl = $('#connectedcup-div-chart').data('backend-api-url') + '/sensors/temperature'
+ '?from=' + from + '&to=' + to;
var successCallback = function (data) {
if (data) {
drawTemperatureLineGraph(JSON.parse(data));
@ -249,8 +250,7 @@ function drawGraph_connectedcup(from, to) {
return;
}
var backendApiUrl = $('#connectedcup-div-chart').data('backend-api-url') + devices[deviceIndex].deviceIdentifier
+ '/sensors/temperature'
+ '?from=' + from + '&to=' + to;
+ '/sensors/temperature?from=' + from + '&to=' + to;
var successCallback = function (data) {
if (data) {
drawTemperatureLineGraph(JSON.parse(data));
@ -264,7 +264,7 @@ function drawGraph_connectedcup(from, to) {
getData();
});
var coffeeLevelApiUrl = $('#connectedcup-div-chart').data('backend-api-url') + devices[deviceIndex].deviceIdentifier
+ '/sensors/coffeelevel' + '?from=' + from + '&to=' + to;
+ '/sensors/coffeelevel?from=' + from + '&to=' + to;
var successCallbackCoffeeLevel = function (data) {
if (data) {

@ -24,49 +24,43 @@
</div>
{{/zone}}
{{#zone "device-detail-properties"}}
<div class="media">
<div class="media-left col-xs-12 col-sm-2 col-md-2 col-lg-2">
<ul class="list-group" role="tablist">
<li class="active">
<a class="list-group-item" href="#device_statistics" role="tab" data-toggle="tab"
aria-controls="device_statistics">Device Statistics</a>
</li>
<li><a class="list-group-item" href="#event_log" role="tab" data-toggle="tab"
aria-controls="event_log">Operations Log</a></li>
</ul>
</div>
<div class="media-body add-padding-left-5x remove-padding-xs tab-content">
<div class="panel-group tab-content">
{{#zone "device-view-tabs"}}
<li class="active"><a class="list-group-item" href="#device_statistics" role="tab"
data-toggle="tab" aria-controls="device_statistics">Device
Statistics</a>
</li>
<li><a class="list-group-item" href="#event_log" role="tab" data-toggle="tab"
aria-controls="event_log">Operations Log</a></li>
{{/zone}}
<div class="panel panel-default tab-pane active"
id="device_statistics" role="tabpanel" aria-labelledby="device_statistics">
<div class="panel-heading">Device Statistics</div>
{{unit "cdmf.unit.device.type.connectedcup.realtime.analytics-view" device=device}}
</div>
<div class="panel panel-default tab-pane" id="event_log" role="tabpanel"
aria-labelledby="event_log">
<div class="panel-heading">Operations Log <span><a href="#"
id="refresh-operations"><i
class="fw fw-refresh"></i></a></span></div>
<div class="panel-body">
<div id="operations-spinner" class="wr-advance-operations-init hidden">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;
Loading Operations Log . . .
<br>
<br>
</div>
<div id="operations-log-container">
<div class="panel-body">
Not available yet
</div>
<br class="c-both"/>
</div>
</div>
{{#zone "device-view-tab-contents"}}
<div class="panel panel-default tab-pane active"
id="device_statistics" role="tabpanel" aria-labelledby="device_statistics">
<div class="panel-heading">Device Statistics</div>
{{unit "cdmf.unit.device.type.connectedcup.realtime.analytics-view" device=device}}
</div>
<div class="panel panel-default tab-pane" id="event_log" role="tabpanel"
aria-labelledby="event_log">
<div class="panel-heading">Operations Log <span><a href="#"
id="refresh-operations"><i
class="fw fw-refresh"></i></a></span></div>
<div class="panel-body">
<div id="operations-spinner" class="wr-advance-operations-init hidden">
<br>
<i class="fw fw-settings fw-spin fw-2x"></i>
Loading Operations Log . . .
<br>
<br>
</div>
<div id="operations-log-container">
<div class="panel-body">
Not available yet
</div>
<br class="c-both"/>
</div>
</div>
</div>

@ -18,26 +18,23 @@
function onRequest(context) {
var log = new Log('detail.js');
var deviceType = context.uriParams.deviceType;
var deviceId = request.getParameter('id');
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
if (deviceType && deviceId) {
var deviceModule = require('/app/modules/device.js').deviceModule;
var device = deviceModule.viewDevice(deviceType, deviceId);
var deviceModule = require("/app/modules/business-controllers/device.js").deviceModule;
var deviceData = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != 'error') {
if (deviceData && deviceData.status != 'error') {
var device = deviceData.content;
var constants = require('/app/modules/constants.js');
var tokenPair = session.get(constants.ACCESS_TOKEN_PAIR_IDENTIFIER);
var token = '';
var tokenPair = JSON.parse(session.get(constants.TOKEN_PAIR));
if (tokenPair) {
token = tokenPair.accessToken;
device.accessToken = tokenPair.accessToken;
}
device.accessToken = token;
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
device.ip = devicemgtProps['httpsWebURL'];
return {'device': device.content};
return {'device': deviceData.content};
}
}
}

@ -1,8 +1,25 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you 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.
}}
{{unit "cdmf.unit.lib.rickshaw-graph"}}
<div id="div-chart" data-websocketurl="{{websocketEndpoint}}">
<div class="chartWrapper" id="chartWrapper">
<div id="y_axis" class="custom_y_axis">Temperature</div>
<div id="y_axis" class="custom_y_axis" style="margin-top: -20px;">Temperature</div>
<div class="legend_container">
<div id="smoother" title="Smoothing"></div>
<div id="legend"></div>

@ -17,16 +17,28 @@
*/
function onRequest(context) {
var log = new Log("stats.js");
var carbonServer = require("carbon").server;
var device = context.unit.params.device;
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
var constants = require('/app/modules/constants.js');
var websocketEndpoint = devicemgtProps['wssURL'].replace('https', 'wss');
var tokenPair = session.get(constants.ACCESS_TOKEN_PAIR_IDENTIFIER);
var token = '';
if (tokenPair) {
token = tokenPair.accessToken;
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var websocketEndpoint = devicemgtProps["wssURL"].replace("https", "wss");
var jwtService = carbonServer.osgiService(
'org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService');
var jwtClient = jwtService.getJWTClient();
var encodedClientKeys = session.get(constants["ENCODED_TENANT_BASED_WEB_SOCKET_CLIENT_CREDENTIALS"]);
var token = "";
if (encodedClientKeys) {
var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"];
var resp = tokenUtil.decode(encodedClientKeys).split(":");
var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {});
if (tokenPair) {
token = tokenPair.accessToken;
}
websocketEndpoint = websocketEndpoint + "/secured-websocket/org.wso2.iot.devices.temperature/1.0.0?"
+ "deviceId=" + device.deviceIdentifier + "&deviceType=" + device.type;
var websocketToken= {'name':'websocket-token','value': token, 'path':'/', "maxAge":18000};
response.addCookie(websocketToken);
}
websocketEndpoint = websocketEndpoint + '/secured-outputui/org.wso2.iot.connectedcup/1.0.0?' +
'token=' + token + '&deviceId=' + device.deviceIdentifier;
return {'device': device, 'websocketEndpoint': websocketEndpoint};
}
return {"device": device, "websocketEndpoint": websocketEndpoint};
}

@ -18,41 +18,30 @@
var ws;
var graph;
var temperatureData = [];
var coffeeData = [];
var temperature = 0;
var coffeelevel = 0;
var lastTime = 0;
var palette = new Rickshaw.Color.Palette({scheme: 'classic9'});
var chartData = [];
var palette = new Rickshaw.Color.Palette({scheme: "classic9"});
$(window).load(function () {
var tNow = new Date().getTime() / 1000;
for (var i = 0; i < 30; i++) {
temperatureData.push({
x: tNow - (30 - i) * 15,
y: parseFloat(0)
});
coffeeData.push({
x: tNow - (30 - i) * 15,
y: parseFloat(0)
});
chartData.push({
x: tNow - (30 - i) * 15,
y: parseFloat(0)
});
}
graph = new Rickshaw.Graph({
element: document.getElementById('chart'),
width: $('#div-chart').width() - 50,
element: document.getElementById("chart"),
width: $("#div-chart").width() - 50,
height: 300,
renderer: 'line',
renderer: "line",
interpolation: "linear",
padding: {top: 0.2, left: 0.0, right: 0.0, bottom: 0.2},
xScale: d3.time.scale(),
series: [{
'color': palette.color(),
'data': coffeeData,
'name': 'Coffee Level'
}, {
'color': palette.color(),
'data': temperatureData,
'name': 'Temperature'
'data': chartData,
'name': "Temperature"
}]
});
@ -77,11 +66,11 @@ $(window).load(function () {
formatter: function (series, x, y) {
var date = '<span class="date">' + moment(x * 1000).format('Do MMM YYYY h:mm:ss a') + '</span>';
var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>';
return swatch + series.name + ': ' + parseInt(y) + '<br>' + date;
return swatch + series.name + ": " + parseInt(y) + '<br>' + date;
}
});
var websocketUrl = $('#div-chart').data('websocketurl');
var websocketUrl = $("#div-chart").data("websocketurl");
connect(websocketUrl)
});
@ -101,25 +90,12 @@ function connect(target) {
if (ws) {
ws.onmessage = function (event) {
var dataPoint = JSON.parse(event.data);
if (lastTime < parseInt(dataPoint[4]) / 1000) {
lastTime = parseInt(dataPoint[4]) / 1000;
if (dataPoint[3] == 'temperature') {
temperature = parseFloat(dataPoint[5]);
} else if (dataPoint[3] == 'coffeelevel') {
coffeelevel = parseFloat(dataPoint[6]);
}
temperatureData.push({
x: lastTime,
y: temperature
});
temperatureData.shift();
coffeeData.push({
x: lastTime,
y: coffeelevel
});
coffeeData.shift();
graph.update();
}
chartData.push({
x: parseInt(dataPoint[4]) / 1000,
y: parseFloat(dataPoint[5])
});
chartData.shift();
graph.update();
};
}
}

@ -0,0 +1,66 @@
/*
* Copyright (c) 2017, 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.
*/
.circle {
background: none repeat scroll 0 0 #191919;
border-radius: 50px;
height: 50px;
padding: 10px;
width: 50px;
color: #fff;
}
.padding-top-double {
padding-top: 20px;
}
.padding-double {
padding: 20px;
}
.grey {
color: #333;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #7f7f7f;
margin: 1em 0;
padding: 0;
opacity: 0.2;
}
.light-grey {
color: #7c7c7c;
}
.uppercase {
text-transform: uppercase;
}
.grey-bg {
background-color: #f6f4f4;
}
.doc-link{
background: none;
color: #000;
padding: 10px 0px;
}
.doc-link a {
color: #006eff;
}

@ -16,13 +16,13 @@
* under the License.
*/
var modalPopup = '.wr-modalpopup';
var modalPopupContainer = modalPopup + ' .modalpopup-container';
var modalPopupContent = modalPopup + ' .modalpopup-content';
var body = 'body';
var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-content";
var body = "body";
/*
* set popup maximum height function.
* Set popup maximum height function.
*/
function setPopupMaxHeight() {
$(modalPopupContent).css('max-height', ($(body).height() - ($(body).height() / 100 * 30)));
@ -33,36 +33,14 @@ function setPopupMaxHeight() {
* show popup function.
*/
function showPopup() {
$(modalPopup).show();
$(modalPopup).modal('show');
setPopupMaxHeight();
$('#downloadForm').validate({
rules: {
deviceName: {
minlength: 4,
required: true
}
},
highlight: function (element) {
$(element).closest('.control-group').removeClass('success').addClass('error');
},
success: function (element) {
$(element).closest('.control-group').removeClass('error').addClass('success');
$('label[for=deviceName]').remove();
}
});
var deviceType = '';
var deviceType = "";
$('.deviceType').each(function () {
if (this.value != '') {
deviceType = this.value;
}
});
if (deviceType == 'digitaldisplay') {
$('.sketchType').remove();
$('input[name="sketchType"][value="digitaldisplay"]').prop('checked', true);
$('label[for="digitaldisplay"]').text('Simple Agent');
} else {
$('.sketchTypes').remove();
}
}
/*
@ -72,7 +50,7 @@ function hidePopup() {
$('label[for=deviceName]').remove();
$('.control-group').removeClass('success').removeClass('error');
$(modalPopupContent).html('');
$(modalPopup).hide();
$(modalPopup).modal('hide');
}
/*
@ -88,46 +66,9 @@ function attachEvents() {
* when a user clicks on "Download" link
* on Device Management page in WSO2 DC Console.
*/
$('a.download-link').click(function () {
var sketchType = $(this).data('sketchtype');
var deviceType = $(this).data('devicetype');
var downloadDeviceAPI = '/devicemgt/api/devices/sketch/generate_link';
var payload = {'sketchType': sketchType, 'deviceType': deviceType};
$("a.download-link").click(function () {
$(modalPopupContent).html($('#download-device-modal-content').html());
showPopup();
var deviceName;
$('a#download-device-download-link').click(function () {
$('.new-device-name').each(function () {
if (this.value != '') {
deviceName = this.value;
}
});
$('label[for=deviceName]').remove();
if (deviceName && deviceName.length >= 4) {
payload.deviceName = deviceName;
invokerUtil.post(
downloadDeviceAPI,
payload,
function (data, textStatus, jqxhr) {
doAction(data);
},
function (data) {
doAction(data);
}
);
} else if (deviceName) {
$('.controls').append('<label for="deviceName" generated="true" class="error" style="display: inline-block;">Please enter at least 4 characters.</label>');
$('.control-group').removeClass('success').addClass('error');
} else {
$('.controls').append('<label for="deviceName" generated="true" class="error" style="display: inline-block;">This field is required.</label>');
$('.control-group').removeClass('success').addClass('error');
}
});
$('a#download-device-cancel-link').click(function () {
hidePopup();
});
});
}
@ -141,33 +82,40 @@ function downloadAgent() {
values[this.name] = $(this).val();
});
var payload = {};
payload.name = $inputs[0].value;
payload.owner = $inputs[1].value;
var connectedCupRegisterURL = '/connectedcup/device/register?name=' + encodeURI(payload.name);
invokerUtil.post(
connectedCupRegisterURL,
payload,
function (data, textStatus, jqxhr) {
hidePopup();
},
function (data) {
hidePopup();
}
);
var deviceName;
var deviceName = $inputs[0].value;
$('.new-device-name').each(function () {
if (this.value != '') {
deviceName = this.value;
}
});
if (deviceName && deviceName.length >= 4) {
setTimeout(function () {
hidePopup();
}, 1000);
var deviceNameFormat = /^[^~?!#$:;%^*`+={}\[\]\\()|<>,'"]{1,30}$/;
if (deviceName && deviceName.length < 4) {
$("#invalid-username-error-msg span").text("Device name should be more than 3 letters!");
$("#invalid-username-error-msg").removeClass("hidden");
} else if (deviceName && deviceNameFormat.test(deviceName)) {
var payload = {};
payload.name = $inputs[0].value;
payload.owner = $inputs[1].value;
var connectedCupRegisterURL = '/connectedcup/device/register?name=' + encodeURI(payload.name);
invokerUtil.post(
connectedCupRegisterURL,
payload,
function (data, textStatus, jqxhr) {
$(modalPopupContent).html($('#device-created-content').html());
$('#device-created-link').click(function () {
hidePopup();
});
setTimeout(function () {
hidePopup();
}, 1000);
},
function (data) {
doAction(data)
}
);
} else {
$("#invalid-username-error-msg span").text("Invalid device name");
$("#invalid-username-error-msg").removeClass("hidden");
}
}
@ -202,4 +150,4 @@ function doAction(data) {
hidePopup();
});
}
}
}

@ -1,16 +1,28 @@
<div class="col-lg-12 margin-top-double" xmlns="http://www.w3.org/1999/html">
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you 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.
}}
<div class="col-lg-12 margin-top-double">
<h1 class="grey ">Connected Cup</h1>
<hr>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 padding-top">
<div class="col-xs-12 col-sm-4 col-md-3 col-lg-3 padding-top">
<img src="{{@unit.publicUri}}/images/coffeecup.png" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
<h4 class="doc-link">Click
<a href="https://docs.wso2.com/display/IoTS100/Sample+-+Getting+the+Connected+Cup+into+the+WSO2+IoT+Server"
target="_blank">[ here ]</a> for latest instructions and troubleshooting.</h4>
</div>
<div class="col-xs-12 col-sm-6 col-md-8 col-lg-8 padding-top">
<div class="col-xs-12 col-sm-8 col-md-9 col-lg-9 padding-top">
<h3 class="uppercase">What it Does</h3>
<hr>
<p class="grey margin-top">Connected cup is a virtual simulation of a smart coffee cup from the IOT Hardware
@ -18,35 +30,36 @@
around with the temperature and Coffee level. And the information will be relayed back to
the IoTServer and summarized.
</p>
<p>The device supports communication via HTTPS only.</p>
<br>
<h3 class="uppercase">What You Need</h3>
<hr>
<ul class="list-unstyled">
<li class="padding-top-double"><span class="circle">STEP 01</span>&nbsp;&nbsp;&nbsp;Go ahead and
[Crete an Instance] of the Device.
<li class="padding-top-double">
<span class="badge">STEP 01</span>
Go ahead and [Download] the Device.
</li>
<li class="padding-top-double"><span class="circle">STEP 02</span>&nbsp;&nbsp;&nbsp;Give a name to your
Connected Cup instance.
<li>
<span class="badge">STEP 02</span>
Proceed to [Prepare] section.
</li>
<li class="padding-top-double"><span class="circle">STEP 03</span>&nbsp;&nbsp;&nbsp;Read
[Try Out] section
to further experiment with the device.
<li>
<span class="badge">STEP 03</span>
Read [Try Out] section to further experiment with the device.
</li>
</ul>
<br>
<a href="/api-store/apis/info?name={{@uriParams.deviceType}}&version=1.0.0&provider=admin"
class="btn-operations" target="_blank"><i class="fw fw-api"></i> View API</i> &nbsp;</a>
<a href="#" class="download-link btn-operations"><i class="fw fw-download"></i>Create an Instance</a>
class="btn-operations"
target="_blank"><i class="fw fw-api"></i> View API</i>
</a>
<a href="#" class="download-link btn-operations">
<i class="fw fw-download"></i>Create an instance</a>
<div id="download-device-modal-content" class="hide">
<div class="modal-content">
<div class="row">
<div class="col-md-7 col-centered">
<h3>Name your device and download the agent from following link.</h3>
<h3>Name your Connected cup instance.</h3>
<br/>
<form id="downloadForm">
<div class="control-group">
@ -69,16 +82,16 @@
</div>
</div>
<div id="download-device-modal-content-links" class="hide">
<div id="device-created-content" class="hide">
<div class="modal-content">
<div class="row">
<div class="col-md-7 col-centered center-container">
<h3>Please download the file from following link(Press CTRL+C).</h3>
<br/>
<div>
<input id="download-device-url" style="color:#3f3f3f;padding:5px"
type="text" value="" placeholder="Type here" size="60">
<h3>Connected cup device created. </h3>
<p> Select instance of the Connected Cup you created from the "Devices" section. </p>
<div class="buttons">
<a href="#" id="device-created-link" class="btn-operations">
&nbsp;&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;&nbsp;
</a>
</div>
</div>
</div>
@ -176,75 +189,28 @@
<p class="grey margin-top">Access your Device</p>
<br/>
<ul>
<p class="padding-top-double"><span class="circle">01</span> Select instance of the Connected Cup you created from the "Devices" section and click "View".</p>
<p class="padding-top-double"><span class="circle">01</span> Select instance of the Connected Cup you created from the "Devices" section.</p>
<p class="padding-top-double"><span class="circle">02</span> Click the [Go to Device] button from the "Operations" section and you will be able to view and experiment with the device.</p>
</ul>
<br>
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-12 padding-double">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 padding-double">
<h3 class="uppercase">Connected Cup Agent</h3><hr>
<p class="grey margin-top">Click on the image to zoom</p>
<center>
<a href="{{@unit.publicUri}}/images/coffee_stats.png" target="_blank">
<img src="{{@unit.publicUri}}/images/coffee_stats.png" class="img-responsive" style="max-width: 500px; max-height: 500px">
<img src="{{@unit.publicUri}}/images/coffee_stats.png" class="img-responsive">
</a>
</center>
<br/>
</div>
</div>
<style type="text/css">
.circle {
background: none repeat scroll 0 0 #191919;
border-radius: 50px;
height: 50px;
padding: 10px;
width: 50px;
color: #fff;
}
.padding-top-double {
padding-top: 20px;
}
.padding-double {
padding: 20px;
}
.grey {
color: #333;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #7f7f7f;
margin: 1em 0;
padding: 0;
opacity: 0.2;
}
.light-grey {
color: #7c7c7c;
}
.uppercase {
text-transform: uppercase;
}
.grey-bg {
background-color: #f6f4f4;
}
.doc-link {
background: #11375B;
padding: 20px;
color: white;
margin-top: 0;
}
.doc-link a {
color: white;
}
</style>
{{#zone "topCss"}}
{{css "css/styles.css"}}
{{/zone}}
{{#zone "bottomJs"}}
{{js "/js/download.js"}}
{{js "/js/jquery.validate.js"}}
{{/zone}}
{{/zone}}

@ -24,6 +24,10 @@
<version>1</version>
</parent>
<modules>
<module>connectedcup</module>
</modules>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.iot.devicemgt-plugins</groupId>
<artifactId>iot-devicetype-samples</artifactId>
@ -46,13 +50,13 @@
<goal>p2-repo-gen</goal>
</goals>
<configuration>
<metadataRepository>file:\${basedir}/p2-repo</metadataRepository>
<artifactRepository>file:\${basedir}/p2-repo</artifactRepository>
<metadataRepository>file:${basedir}/p2-repo</metadataRepository>
<artifactRepository>file:${basedir}/p2-repo</artifactRepository>
<publishArtifacts>true</publishArtifacts>
<publishArtifactRepository>true</publishArtifactRepository>
<featureArtifacts>
<featureArtifactDef>
org.coffeeking:org.coffeeking.connectedcup.feature:\${carbon.device.mgt.plugin.version}
org.coffeeking:org.coffeeking.connectedcup.feature:${carbon.device.mgt.plugin.version}
</featureArtifactDef>
</featureArtifacts>
</configuration>
@ -65,14 +69,14 @@
</goals>
<configuration>
<profile>default</profile>
<metadataRepository>file:\${basedir}/p2-repo</metadataRepository>
<artifactRepository>file:\${basedir}/p2-repo</artifactRepository>
<destination>\${basedir}/../core/repository/components</destination>
<metadataRepository>file:${basedir}/p2-repo</metadataRepository>
<artifactRepository>file:${basedir}/p2-repo</artifactRepository>
<destination>${basedir}/../core/repository/components</destination>
<deleteOldProfileFiles>false</deleteOldProfileFiles>
<features>
<feature>
<id>org.coffeeking.connectedcup.feature.group</id>
<version>\${carbon.device.mgt.plugin.version}</version>
<version>${carbon.device.mgt.plugin.version}</version>
</feature>
</features>
</configuration>

Loading…
Cancel
Save