mirror of
https://repository.entgra.net/community/product-iots.git
synced 2025-09-16 23:32:19 +00:00
adding ui changes
This commit is contained in:
parent
c092542b8e
commit
c68df4d3a2
@ -80,5 +80,5 @@ public interface DeviceTypeService {
|
||||
@GET
|
||||
@Produces("application/zip")
|
||||
@Permission(scope = "CONNECTEDLAP_user", permissions = {"/permission/admin/device-mgt/download"})
|
||||
Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketchType") String sketchType);
|
||||
Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketchType") String sketchType,@QueryParam("osType") String osType);
|
||||
}
|
||||
@ -24,7 +24,7 @@ import org.wso2.connectedlap.api.util.APIUtil;
|
||||
import org.wso2.connectedlap.api.util.ZipUtil;
|
||||
import org.wso2.connectedlap.plugin.constants.DeviceTypeConstants;
|
||||
import org.wso2.connectedlap.api.DeviceTypeService;
|
||||
import org.wso2.connectedlap.plugin.impl.uti.ConnectedLapResponse;
|
||||
import org.wso2.connectedlap.plugin.impl.util.ConnectedLapResponse;
|
||||
import org.wso2.connectedlap.plugin.impl.util.ConnectedLapDevice;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@ -265,9 +265,9 @@ public class DeviceTypeServiceImpl implements DeviceTypeService {
|
||||
@GET
|
||||
@Produces("application/zip")
|
||||
public Response downloadSketch(@QueryParam("deviceName") String deviceName,
|
||||
@QueryParam("sketchType") String sketchType) {
|
||||
@QueryParam("sketchType") String sketchType, @QueryParam("osType") String osType) {
|
||||
try {
|
||||
ZipArchive zipFile = createDownloadFile(APIUtil.getAuthenticatedUser(), deviceName, sketchType);
|
||||
ZipArchive zipFile = createDownloadFile(APIUtil.getAuthenticatedUser(), deviceName, sketchType ,osType);
|
||||
Response.ResponseBuilder response = Response.ok(FileUtils.readFileToByteArray(zipFile.getZipFile()));
|
||||
response.status(Response.Status.OK);
|
||||
response.type("application/zip");
|
||||
@ -301,7 +301,7 @@ public class DeviceTypeServiceImpl implements DeviceTypeService {
|
||||
return Long.toString(l, Character.MAX_RADIX);
|
||||
}
|
||||
|
||||
private ZipArchive createDownloadFile(String owner, String deviceName, String sketchType)
|
||||
private ZipArchive createDownloadFile(String owner, String deviceName, String sketchType , String osType)
|
||||
throws DeviceManagementException, JWTClientException, APIManagerException,
|
||||
UserStoreException {
|
||||
|
||||
@ -329,7 +329,7 @@ public class DeviceTypeServiceImpl implements DeviceTypeService {
|
||||
|
||||
ZipUtil ziputil = new ZipUtil();
|
||||
ZipArchive zipFile = ziputil.createZipFile(owner, APIUtil.getTenantDomainOftheUser(), sketchType,
|
||||
deviceId, deviceName, accessToken, refreshToken);
|
||||
deviceId, deviceName, accessToken, refreshToken,osType);
|
||||
return zipFile;
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ public class ZipUtil {
|
||||
|
||||
public ZipArchive createZipFile(String owner, String tenantDomain, String deviceType,
|
||||
String deviceId, String deviceName, String token,
|
||||
String refreshToken) throws DeviceManagementException {
|
||||
String refreshToken,String osType) throws DeviceManagementException {
|
||||
|
||||
String sketchFolder = "repository" + File.separator + "resources" + File.separator + "sketches";
|
||||
String archivesPath = CarbonUtils.getCarbonHome() + File.separator + sketchFolder + File.separator + "archives" +
|
||||
@ -75,6 +75,7 @@ public class ZipUtil {
|
||||
contextParams.put("MQTT_EP", mqttEndpoint);
|
||||
contextParams.put("DEVICE_TOKEN", token);
|
||||
contextParams.put("DEVICE_REFRESH_TOKEN", refreshToken);
|
||||
contextParams.put("OS_TYPE", osType);
|
||||
|
||||
ZipArchive zipFile;
|
||||
zipFile = Utils.getSketchArchive(archivesPath, templateSketchPath, contextParams, deviceName);
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.wso2.connectedlap.plugin.impl.uti;
|
||||
package org.wso2.connectedlap.plugin.impl.util;
|
||||
|
||||
public class ConnectedLapResponse {
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 MiB |
@ -14,12 +14,25 @@
|
||||
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 padding-top">
|
||||
<h3 class="uppercase">What it Does</h3>
|
||||
<hr>
|
||||
<p class="grey margin-top">Connect a CONNECTEDLAP to WSO2 IoT Server and manage it.</p>
|
||||
<p>Add brief description what this device type does</p>
|
||||
<p class="grey margin-top">Connect a computer with this application to WSO2 IoT Server and visualize usage data.</p>
|
||||
|
||||
<h3 class="uppercase">What You Need</h3>
|
||||
<p>Add hardware requirement which will be required to make this device type </p>
|
||||
<br>
|
||||
<hr>
|
||||
<p class="grey margin-top">You should have an Android Device to get started.</p>
|
||||
<ul class="list-unstyled">
|
||||
<li class="padding-top-double">
|
||||
<span class="circle">STEP 01</span>
|
||||
Go ahead and [Download] the Device.
|
||||
</li>
|
||||
<li class="padding-top-double">
|
||||
<span class="circle">STEP 02</span>
|
||||
Proceed to [Prepare] section.
|
||||
</li>
|
||||
<li class="padding-top-double">
|
||||
<span class="circle">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"
|
||||
@ -42,6 +55,11 @@
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label for="sel1">Select OS Type</label>
|
||||
<select class="form-control" name="osType" style="width:40%;margin-bottom:0.5%" onchange="this.form.submit()">
|
||||
<option name="linux" value="linux">Ubuntu</option>
|
||||
<option name="mac" value="mac">MacOS</option>
|
||||
</select>
|
||||
<input class="new-device-name" style="color:#3f3f3f;padding:5px"
|
||||
type="text"
|
||||
placeholder="Ex. Lobby_DigitalDisplay"
|
||||
@ -151,46 +169,52 @@
|
||||
<h3 class="uppercase">Prepare</h3>
|
||||
<hr>
|
||||
<ul class="list-unstyled">
|
||||
<li class="padding-top-double"><span class="circle">01</span> Add how you are goining to
|
||||
prepare your device
|
||||
<li class="padding-top-double"><span class="circle">01</span> Download your Connectedlap using [Download Agent] button above.
|
||||
</li>
|
||||
<li class="padding-top-double"><span class="circle">02</span> Unzip the downloaded Agent.
|
||||
</li>
|
||||
<li class="padding-top-double"><span class="circle">03</span> Move into the unzipped Agent folder.
|
||||
</li>
|
||||
<li class="padding-top-double"><span class="circle">04</span> On terminal to run this command: [sudo sh startagent.sh].
|
||||
</li>
|
||||
<li class="padding-top-double"><span class="circle">05</span> Give the Super-Admin password.
|
||||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 padding-double">
|
||||
<h3 class="uppercase">Schematic Diagram</h3>
|
||||
<hr>
|
||||
<p class="grey margin-top">Click on the image to zoom</p>
|
||||
<center>
|
||||
<a href="{{@unit.publicUri}}/images/schematicsGuide.png" target="_blank">
|
||||
<img src="{{@unit.publicUri}}/images/schematicsGuide.png" class="img-responsive">
|
||||
</a>
|
||||
</center>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 padding-double">
|
||||
<h3 class="uppercase">Try Out</h3>
|
||||
<hr>
|
||||
<ul class="list-unstyled">
|
||||
<li class="padding-top-double">
|
||||
<span class="circle">01</span>
|
||||
You can view all your connected devices at
|
||||
You can view all your connected devices at [Device Management] page.
|
||||
<a href="{{@app.context}}/devices">[Device Management]</a> page.
|
||||
</li>
|
||||
<li class="padding-top-double">
|
||||
<span class="circle">02</span>
|
||||
Select one of connected devices and check for available control
|
||||
operations and monitor Real-Time data.
|
||||
Select one of connected devices and monitor Real-Time data.
|
||||
</li>
|
||||
<li class="padding-top-double">
|
||||
<span class="circle">03</span>
|
||||
You can also view analytics of the data published to IoT-Server by
|
||||
navigating to Device Analytics page.
|
||||
You can also view analytics of the data published to IoT-Server by navigating to Device Analytics page.
|
||||
</li>
|
||||
</ul>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 padding-double">
|
||||
<h3 class="uppercase"></h3>
|
||||
<br>
|
||||
<hr>
|
||||
<p class="grey margin-top">Click on the image to zoom</p>
|
||||
<center>
|
||||
<a href="{{@unit.publicUri}}/images/deviceview.png" target="_blank">
|
||||
<img src="{{@unit.publicUri}}/images/deviceview.png" class="img-responsive">
|
||||
</a>
|
||||
</center>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
{{#zone "topCss"}}
|
||||
<style type="text/css">
|
||||
|
||||
@ -27,6 +27,7 @@ https-ep=${HTTPS_EP}
|
||||
auth-method=token
|
||||
auth-token=${DEVICE_TOKEN}
|
||||
refresh-token=${DEVICE_REFRESH_TOKEN}
|
||||
os-type=${OS_TYPE}
|
||||
push-interval=15
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user