Merge branch 'release-2.0.x' of https://github.com/wso2/carbon-device-mgt into release-2.0.x

revert-70aa11f8
ayyoob 8 years ago
commit 93ae646c50

@ -201,8 +201,8 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<groupId>org.json.wso2</groupId>
<artifactId>json</artifactId>
</dependency>
<dependency>
<groupId>commons-codec.wso2</groupId>

@ -29,6 +29,7 @@ import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.json.JSONObject;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.mgt.common.Device;
@ -330,27 +331,103 @@ public interface DeviceManagementService {
@HeaderParam("If-Modified-Since")
String ifModifiedSince);
//device delete request would looks like follows
//device rename request would looks like follows
//POST devices/type/virtual_firealarm/id/us06ww93auzp/rename
@POST
@Path("/type/{device-type}/id/{device-id}/rename")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON,
httpMethod = "POST",
value = "Update the device specified by device id",
notes = "Returns the status of the updated device operation.",
tags = "Device Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:update")
})
}
)
@ApiResponses(
value = {
@ApiResponse(
code = 200,
message = "OK. \n Successfully fetched information of the device.",
response = Device.class,
responseHeaders = {
@ResponseHeader(
name = "Content-Type",
description = "The content type of the body"),
@ResponseHeader(
name = "ETag",
description = "Entity Tag of the response resource.\n" +
"Used by caches, or in conditional requests."),
@ResponseHeader(
name = "Last-Modified",
description = "Date and time the resource has been modified the last time.\n" +
"Used by caches, or in conditional requests."),
}),
@ApiResponse(
code = 304,
message = "Not Modified. Empty body because the client already has the latest " +
"version of the requested resource."),
@ApiResponse(
code = 400,
message = "Bad Request. \n Invalid request or validation error.",
response = ErrorResponse.class),
@ApiResponse(
code = 404,
message = "Not Found. \n No device is found under the provided type and id.",
response = ErrorResponse.class),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n " +
"Server error occurred while retrieving information requested device.",
response = ErrorResponse.class)
})
Response renameDevice(
@ApiParam(
name = "device",
value = "The payload containing new name for device with updated name.",
required = true)
Device device,
@ApiParam(
name = "device-type",
value = "The device type, such as ios, android or windows.",
required = true)
@PathParam("device-type")
@Size(max = 45)
String deviceType,
@ApiParam(
name = "device-id",
value = "The device identifier of the device.",
required = true)
@PathParam("device-id")
@Size(max = 45)
String deviceId);
//device remove request would looks like follows
//DELETE devices/type/virtual_firealarm/id/us06ww93auzp
@DELETE
@Path("/type/{device-type}/id/{device-id}")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
consumes = MediaType.APPLICATION_JSON,
httpMethod = "DELETE",
value = "Delete the device specified by device id",
value = "Remove the device specified by device id",
notes = "Returns the status of the deleted device operation.",
tags = "Device Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:delete")
})
@Extension(properties = {
@ExtensionProperty(name = Constants.SCOPE, value = "perm:devices:delete")
})
}
)
@ApiResponses(
value = {
@ApiResponse(
code = 200,
message = "OK. \n Successfully fetched information of the device.",
message = "OK. \n Successfully deleted the device.",
response = Device.class,
responseHeaders = {
@ResponseHeader(
@ -383,7 +460,6 @@ public interface DeviceManagementService {
"Server error occurred while retrieving information requested device.",
response = ErrorResponse.class)
})
//TODO need to introduce delete permission
Response deleteDevice(
@ApiParam(
name = "device-type",
@ -391,15 +467,14 @@ public interface DeviceManagementService {
required = true)
@PathParam("device-type")
@Size(max = 45)
String deviceType,
String deviceType,
@ApiParam(
name = "device-id",
value = "The device identifier of the device.",
required = true)
@PathParam("device-id")
@Size(max = 45)
String deviceId);
String deviceId);
@GET
@Path("/{type}/{id}/features")

@ -21,13 +21,22 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.Feature;
import org.wso2.carbon.device.mgt.common.FeatureManager;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.common.policy.mgt.Policy;
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.NonComplianceData;
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
import org.wso2.carbon.device.mgt.common.search.SearchContext;
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
import org.wso2.carbon.device.mgt.core.search.mgt.SearchManagerService;
@ -40,15 +49,20 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.OperationList;
import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceManagementService;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
import org.wso2.carbon.device.mgt.common.policy.mgt.Policy;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.NonComplianceData;
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import javax.validation.constraints.Size;
import javax.ws.rs.*;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.text.ParseException;
@ -225,14 +239,47 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@Override
@Path("/type/{device-type}/id/{device-id}")
public Response deleteDevice(@PathParam("device-type") String deviceType, @PathParam("device-id") String deviceId) {
DeviceManagementProviderService deviceManagementProviderService =
DeviceMgtAPIUtils.getDeviceManagementService();
try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(deviceId, deviceType);
Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier);
if (persistedDevice == null) {
return Response.status(Response.Status.NOT_FOUND).build();
}
boolean response = deviceManagementProviderService.disenrollDevice(deviceIdentifier);
return Response.status(Response.Status.OK).entity(response).build();
log.info("Deleting " + deviceType + " " + deviceId + "is not supported");
} catch (DeviceManagementException e) {
String msg = "Error encountered while deleting device of type : " + deviceType + " and " +
"ID : " + deviceId;
log.error(msg);
return Response.status(Response.Status.BAD_REQUEST).entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()
).build();
}
}
@POST
@Override
@Path("/type/{device-type}/id/{device-id}/rename")
public Response renameDevice(Device device, @PathParam("device-type") String deviceType,
@PathParam("device-id") String deviceId) {
DeviceManagementProviderService deviceManagementProviderService = DeviceMgtAPIUtils.getDeviceManagementService();
try {
return Response.status(Response.Status.BAD_REQUEST).entity("{Deleting device(s) is not supported}").build();
} catch (Exception e) {
String msg = "Error occurred while deleting device(s)";
log.error(msg, e);
return Response.serverError().entity(new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
Device persistedDevice = deviceManagementProviderService.getDevice(new DeviceIdentifier
(deviceId, deviceType));
persistedDevice.setName(device.getName());
boolean response = deviceManagementProviderService.modifyEnrollment(persistedDevice);
return Response.status(Response.Status.CREATED).entity(response).build();
} catch (DeviceManagementException e) {
log.error("Error encountered while updating device of type : " + deviceType + " and " +
"ID : " + deviceId);
return Response.status(Response.Status.BAD_REQUEST).entity(
new ErrorResponse.ErrorResponseBuilder().setMessage("Error while updating " +
"device of type " + deviceType + " and ID : " + deviceId).build()).build();
}
}

@ -404,10 +404,15 @@ public class RoleManagementServiceImpl implements RoleManagementService {
// Get all role permissions
final UIPermissionNode rolePermissions = this.getAllRolePermissions(roleName, userRealm);
List<String> permissions = new ArrayList<String>();
final UIPermissionNode emmRolePermissions = (UIPermissionNode)this.getRolePermissions(roleName);
List<String> emmConsolePermissions = new ArrayList<String>();
this.getAuthorizedPermissions(emmRolePermissions, emmConsolePermissions);
emmConsolePermissions.removeAll(new ArrayList<String>(Arrays.asList(roleInfo.getPermissions())));
this.getAuthorizedPermissions(rolePermissions, permissions);
for (String permission : roleInfo.getPermissions()) {
permissions.add(permission);
}
permissions.removeAll(emmConsolePermissions);
String [] allApplicablePerms = new String[permissions.size()];
allApplicablePerms = permissions.toArray(allApplicablePerms);
roleInfo.setPermissions(allApplicablePerms);

@ -55,7 +55,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerService {
@Override
public boolean addPermission(Permission permission) throws PermissionManagementException {
// adding a permission to the tree
permission.setPath(PermissionUtils.getAbsolutePermissionPath(permission.getPath()));
permission.setPath(permission.getPath());
permissionTree.addPermission(permission);
return PermissionUtils.putPermission(permission);
}

@ -89,6 +89,7 @@
"perm:devices:operations",
"perm:devices:search",
"perm:devices:details",
"perm:devices:update",
"perm:devices:view",
"perm:view-configuration",
"perm:manage-configuration",

@ -77,7 +77,7 @@
</button>
<a href="{{@app.context}}/certificates/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Certificate

@ -36,7 +36,7 @@
<li>
<a href="{{@app.context}}/certificates/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-document fw-stack-1x"></i>
</span>
Add Certificate

@ -17,7 +17,7 @@
data-click-event="remove-form" onclick="javascript:removeCertificate('{{serialNumber}}')"
class="btn padding-reduce-on-grid-view remove-user-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Remove</span>

@ -40,7 +40,7 @@
{{#if deviceCount}}
<a href="{{@app.context}}/devices">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View
@ -49,7 +49,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/device/enroll">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add
@ -63,7 +63,7 @@
<div class="wr-stats-board-tile">
<div class="tile-name">Groups</div>
<div>
<div class="tile-icon"><i class="fw fw-grouping"></i></div>
<div class="tile-icon"><i class="fw fw-group"></i></div>
<div class="tile-stats">
<span id="group-count">{{groupCount}}</span>
<span class="tile-stats-free">
@ -71,7 +71,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/groups">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View
@ -80,7 +80,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/group/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add
@ -102,7 +102,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/users">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View
@ -111,7 +111,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/user/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add
@ -133,7 +133,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policies">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View
@ -142,7 +142,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policy/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add
@ -164,7 +164,7 @@
<!--suppress HtmlUnknownTarget -->
<a id="device-count-view-btn" href="{{@app.context}}/roles">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View
@ -173,7 +173,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/role/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add

@ -32,7 +32,7 @@
{{#equal status "INACTIVE"}}
<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view claim-btn" data-deviceid="{{deviceIdentifier}}">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-edit fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Claim</span>

@ -52,7 +52,7 @@
<a href="{{@app.context}}/devices" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Assign from My Devices
</a>
@ -61,7 +61,7 @@
<a href="{{@app.context}}/group/{{group.id}}/analytics" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-statistics fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
View Analytics
</a>
@ -72,7 +72,7 @@
<a href="{{@app.context}}/device/enroll" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Enroll Device
</a>
@ -185,8 +185,8 @@
class="btn square-element add-devices-to-group-link"
data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-grouping fw-stack-1x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-group fw-stack-1x"></i>
</span>
Add to Group
</a>
@ -198,7 +198,7 @@
class="btn square-element remove-device-link"
data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
{{#if group}}
@ -249,7 +249,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/devices" class="btn-operations btn-default">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Assign from My Devices
@ -259,7 +259,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/device/enroll" class="btn-operations btn-default">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Enroll New Device
@ -276,7 +276,7 @@
<h3 class="pull-left modal-title">
<span>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-grouping fw-stack-1x"></i>
</span> Device Grouping
</span>

@ -327,7 +327,7 @@ function loadDevices(searchType, searchParam) {
html += '<a href="' + context + '/device/' + deviceType + '/analytics?deviceId=' +
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +
' class="btn padding-reduce-on-grid-view"><span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Analytics</span>';
}
@ -337,8 +337,8 @@ function loadDevices(searchType, searchParam) {
+
'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' +
row.name + '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-grouping fw-stack-1x"></i></span>' +
row.name + '"><span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-group fw-stack-1x"></i></span>' +
'<span class="hidden-xs hidden-on-grid-view">Group</span></a>';
}
@ -346,7 +346,7 @@ function loadDevices(searchType, searchParam) {
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view edit-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '">'
+ '<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-edit fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
var groupOwner = $('#group_owner').text();
@ -355,7 +355,7 @@ function loadDevices(searchType, searchParam) {
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '">'
+ '<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-delete fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Remove from group</span>';
} else {
@ -363,7 +363,7 @@ function loadDevices(searchType, searchParam) {
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-device-link" '
+ 'data-deviceid="' + deviceIdentifier + '" data-devicetype="' + deviceType
+ '" data-devicename="' + row.name + '">'
+ '<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>'
+ '<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>'
+ '<i class="fw fw-delete fw-stack-1x"></i></span>'
+ '<span class="hidden-xs hidden-on-grid-view">Delete</span>';
}
@ -730,7 +730,7 @@ function attachDeviceEvents() {
var deviceId = $(this).data("deviceid");
var deviceType = $(this).data("devicetype");
var deviceName = $(this).data("devicename");
var serviceURL = "/api/device-mgt/v1.0/devices/type/" + deviceType + "/id/" + deviceId;
var serviceURL = "/api/device-mgt/v1.0/devices/type/" + deviceType + "/id/" + deviceId + "/rename";
$(modalPopupContent).html($('#edit-device-modal-content').html());
$('#edit-device-name').val(deviceName);
@ -738,7 +738,9 @@ function attachDeviceEvents() {
$("a#edit-device-yes-link").click(function () {
var newDeviceName = $('#edit-device-name').val();
invokerUtil.put(serviceURL, {"name": newDeviceName}, function (message) {
var request = {};
request['name'] = newDeviceName;
invokerUtil.post(serviceURL, request, function (message) {
$(modalPopupContent).html($('#edit-device-200-content').html());
setTimeout(function () {
hidePopup();

@ -70,7 +70,7 @@
<p class="text-center">
<a href="{{@app.context}}/devices" class="wr-btn">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Assign from My Devices

@ -41,7 +41,7 @@
<a href="{{@app.context}}/group/add" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add Group
</a>
@ -80,7 +80,7 @@
<div id="ast-container" class="ast-container list-view">
<div class="ctrl-info-panel col-centered text-center wr-login">
<h3 class="text-muted">
<i class="fw fw-grouping fw-3x"></i>
<i class="fw fw-group fw-3x"></i>
</h3>
<h3 class="text-muted">You don't have any group registered at the moment</h3>
{{#if permissions.ADD_GROUP}}
@ -88,7 +88,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/group/add" class="btn-operations btn-default">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add New Group
@ -104,7 +104,7 @@
<h3 class="pull-left modal-title">
<span>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-share fw-stack-1x"></i>
</span> Group Sharing
</span>
@ -146,7 +146,7 @@
<h3 class="pull-left modal-title">
<span>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-bookmark fw-stack-1x"></i>
</span> Group Sharing Role
</span>
@ -263,7 +263,7 @@
<h3 class="pull-left modal-title">
<span>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-edit fw-stack-1x"></i>
</span> Update Group
</span>

@ -182,7 +182,7 @@ function loadGroups() {
if ($.hasPermission("VIEW_GROUP_DEVICES")) {
html += '<a href="group/' + row.groupId
+ '/analytics" data-click-event="remove-form" class="btn padding-reduce-on-grid-view">' +
'<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>'
'<span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i><i class="fw fw-statistics fw-stack-1x"></i></span>'
+
'<span class="hidden-xs hidden-on-grid-view">Analytics</span></a>';
}
@ -192,7 +192,7 @@ function loadGroups() {
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view share-group-link" data-group-id="'
+ row.groupId + '" ' +
'data-group-owner="' + row.owner
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-share fw-stack-1x"></i></span>'
+ '"><span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i><i class="fw fw-share fw-stack-1x"></i></span>'
+
'<span class="hidden-xs hidden-on-grid-view">Share</span></a>';
}
@ -202,7 +202,7 @@ function loadGroups() {
+ row.name + '" ' +
'data-group-owner="' + row.owner + '" data-group-description="' + row.description
+ '" data-group-id="' + row.groupId
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i>' +
+ '"><span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-edit fw-stack-1x"></i></span><span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
}
if ($.hasPermission("REMOVE_GROUP")) {
@ -210,7 +210,7 @@ function loadGroups() {
'<a href="#" data-click-event="remove-form" class="btn padding-reduce-on-grid-view remove-group-link" data-group-id="'
+ row.groupId + '" ' +
'data-group-owner="' + row.owner
+ '"><span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i><i class="fw fw-delete fw-stack-1x"></i>'
+ '"><span class="fw-stack"><i class="fw fw-circle-outline fw-stack-2x"></i><i class="fw fw-delete fw-stack-1x"></i>'
+
'</span><span class="hidden-xs hidden-on-grid-view">Delete</span></a>';
}

@ -49,7 +49,7 @@
<a href="{{@app.context}}/policy/add" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add New Policy
</a>
@ -63,7 +63,7 @@
<a href="{{@app.context}}/policy/priority" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-throttling-policy fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Policy Priority
</a>
@ -74,7 +74,7 @@
<a href="#" class="cu-btn" id="appbar-btn-apply-changes">
<span class="icon fw-stack">
<i class="fw fw-check fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Apply Changes To Devices
</a>
@ -97,7 +97,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policy/add" class="btn-operations btn-default">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add New Policy
@ -146,7 +146,7 @@
<a href="#" data-click-event="remove-form" class="btn square-element policy-remove-link"
data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
Remove
@ -157,7 +157,7 @@
<a href="#" data-click-event="remove-form" class="btn square-element policy-publish-link"
data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="glyphicon glyphicon-floppy-saved"></i>
</span>
Publish
@ -167,7 +167,7 @@
<a href="#" data-click-event="remove-form" class="btn square-element policy-unpublish-link"
data-toggle="modal" data-target="#modalDemo">
<span class="icon fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="glyphicon glyphicon-floppy-remove"></i>
</span>
Unpublish
@ -182,9 +182,9 @@
{{#each policyListToView}}
<tr data-type="selectable" data-id="{{id}}" data-status="{{status}}">
<td class="remove-padding icon-only content-fill viewEnabledIcon"
data-url="{{@app.context}}/policy/view?id={{id}}" data-id="{{id}}">
<div class="thumbnail icon" style="padding-top: 30px; padding-bottom: 30px;">
<i class="fw fw-{{deviceTypeIcon}}" style="font-size: 59px"></i>
data-url="{{@app.context}}/policy/view?id={{id}}&deviceType={{platform}}" data-id="{{id}}">
<div class="thumbnail icon">
<img src="{{icon}}">
</div>
</td>
<td
@ -239,12 +239,12 @@
</td>
<td class="text-right content-fill text-left-on-grid-view no-wrap">
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policy/edit?id={{id}}"
<a href="{{@app.context}}/policy/edit?id={{id}}&deviceType={{platform}}"
data-id="{{id}}"
data-click-event="remove-form"
class="btn padding-reduce-on-grid-view policy-update-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-edit fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Re-Configure</span>

@ -33,6 +33,11 @@ function onRequest(context) {
var response = policyModule.getAllPolicies();
if (response["status"] == "success") {
var policyListToView = response["content"];
for(var index in policyListToView) {
if(policyListToView.hasOwnProperty(index)) {
policyListToView[index]["icon"] = utility.getDeviceThumb(policyListToView[index]["platform"]);
}
}
page["policyListToView"] = policyListToView;
var policyCount = policyListToView.length;
if (policyCount == 0) {

@ -126,7 +126,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/role/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Role

@ -144,7 +144,7 @@ function loadRoles() {
'data-click-event="edit-form" ' +
'class="btn padding-reduce-on-grid-view edit-role-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-bookmark fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom">' +
'<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>' +
@ -158,7 +158,7 @@ function loadRoles() {
'data-click-event="edit-form" ' +
'class="btn padding-reduce-on-grid-view edit-permission-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-security-policy fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom">' +
'<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>' +
@ -171,7 +171,7 @@ function loadRoles() {
'data-click-event="remove-form" ' +
'class="btn padding-reduce-on-grid-view remove-role-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-delete fw-stack-1x"></i>' +
'</span>' +
'<span class="hidden-xs hidden-on-grid-view">Remove</span>' +

@ -14,7 +14,7 @@
data-click-event="edit-form"
class="btn padding-reduce-on-grid-view edit-role-link" title="Edit Role">
<span class="fw-stack fw-lg">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-user fw-stack-1x"></i>
<span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>
@ -29,7 +29,7 @@
data-click-event="edit-form" class="btn padding-reduce-on-grid-view edit-permission-link"
title="Edit Role Permissions">
<span class="fw-stack fw-lg">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-security-policy fw-stack-1x"></i>
<span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>
@ -44,7 +44,7 @@
<a data-role="{{roleName}}" data-click-event="remove-form"
class="btn padding-reduce-on-grid-view remove-role-link" title="Remove Role">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Remove</span>

@ -40,7 +40,7 @@
<a href="{{@app.context}}/role/add" class="cu-btn">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add Role
</a>

@ -143,7 +143,7 @@
</button>
<a href="{{@app.context}}/user/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another User

@ -130,7 +130,7 @@
</button>
<a href="{{@app.context}}/user/view?username={{editUser.username}}" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View Updated User

@ -146,7 +146,7 @@
class="cu-btn-inner policy-view-link"
data-id="{{deviceIdentifier}}">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View

@ -89,8 +89,8 @@ $("a#invite-user-link").click(function () {
});
},
function () {
modalDialog.header('<span class="fw-stack"><i class="fw fw-ring fw-stack-2x"></i> <i class="fw ' +
'fw-error fw-stack-1x"></i></span> Unexpected Error !');
modalDialog.header('<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw ' +
'fw-error fw-stack-1x"></i> </span> Unexpected Error !');
modalDialog.content('An unexpected error occurred. Try again later.');
modalDialog.footer('<div class="buttons"><a href="#" id="invite-user-error-link" ' +
'class="btn-operations">Ok </a></div>');
@ -124,7 +124,7 @@ function getSelectedUsernames() {
* on User Listing page in WSO2 MDM Console.
*/
function resetPassword(username) {
modalDialog.header('<span class="fw-stack"> <i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-key ' +
modalDialog.header('<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-key ' +
'fw-stack-1x"></i> </span> Reset Password');
modalDialog.content($("#modal-content-reset-password").html());
modalDialog.footer('<div class="buttons"> <a href="#" id="reset-password-yes-link" class="btn-operations"> Save ' +
@ -341,7 +341,7 @@ function loadUsers() {
'data-click-event="edit-form" ' +
'class="btn padding-reduce-on-grid-view edit-user-link"> ' +
'<span class="fw-stack"> ' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-edit fw-stack-1x"></i>' +
'</span><span class="hidden-xs hidden-on-grid-view">Edit</span></a>';
@ -350,7 +350,7 @@ function loadUsers() {
'onclick="javascript:resetPassword(\'' + data.filter + '\')" ' +
'class="btn padding-reduce-on-grid-view remove-user-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-key fw-stack-1x"></i>' +
'</span><span class="hidden-xs hidden-on-grid-view">Reset Password</span></a>';
@ -359,7 +359,7 @@ function loadUsers() {
'onclick="javascript:removeUser(\'' + data.filter + '\')" ' +
'class="btn padding-reduce-on-grid-view remove-user-link">' +
'<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-delete fw-stack-1x"></i>' +
'</span><span class="hidden-xs hidden-on-grid-view">Remove</span></a>';

@ -22,7 +22,7 @@
<a href="user/edit?username={{username}}" data-username="{{username}}"
data-click-event="edit-form" class="btn padding-reduce-on-grid-view edit-user-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-edit fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Edit</span>
@ -36,7 +36,7 @@
data-click-event="remove-form" onclick="removeUser('{{username}}', '{{userid}}')"
class="btn padding-reduce-on-grid-view remove-user-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-delete fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Remove</span>
@ -50,7 +50,7 @@
data-click-event="edit-form" onclick="resetPassword('{{username}}')"
class="btn padding-reduce-on-grid-view remove-user-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-key fw-stack-1x"></i>
<span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i>

@ -40,7 +40,7 @@
<a href="{{@app.context}}/user/add">
<span class="icon fw-stack">
<i class="fw fw-add fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
Add User
</a>

@ -54,7 +54,7 @@
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-service fw-stack-1x"></i>
</span>
{{name}}
@ -105,7 +105,7 @@
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i id="status-icon" class="fw fw-error fw-stack-1x"></i>
</span>
<br>

@ -9,7 +9,7 @@ function toggleEmailInvite(){
modalDialog.header('<h4 class="pull-left modal-title"><span class="fw-stack add-margin-right-1x">' +
'<i class="fw fw-user fw-stack-2x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom">' +
'<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-circle-outline fw-stack-2x"></i>' +
'<i class="fw fw-circle fw-stack-2x fw-stroke text-info"></i>' +
'<i class="fw fw-add fw-stack-1x fw-inverse"></i></span></span>Send Invites</h4>');
modalDialog.content($("#invite-by-email-body").html());
@ -73,7 +73,7 @@ function sendInvites(){
});
},
function () {
modalDialog.header('<span class="fw-stack"> <i class="fw fw-ring fw-stack-2x"></i> <i class="fw ' +
modalDialog.header('<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw ' +
'fw-error fw-stack-1x"></i> </span> Unexpected Error !');
modalDialog.content('An unexpected error occurred. Try again later.');
modalDialog.footer('<div class="buttons"> <a href="#" id="invite-user-error-link" ' +

@ -22,7 +22,7 @@
<span class="fw-stack">
<i class="fw fw-mobile fw-stack-2x"></i>
<span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-circle fw-stack-2x fw-stroke text-info"></i>
<i class="fw fw-add fw-stack-1x fw-inverse"></i>
</span>

@ -80,7 +80,7 @@
<ul>
{{#itr deviceType.ingredients}}
<span class="fw-stack fw-lg margin-right">
<i class="fw fw-ring fw-stack-2x"> </i>
<i class="fw fw-circle-outline fw-stack-2x"> </i>
<i class="fw fw-right-arrow fw-stack-1x"></i>
</span> {{value}}<br/>
<!--<p class="padding-top-double"><span class="circle">0{{key}}</span> {{value}}</p>-->

@ -46,7 +46,7 @@
<a href="https://docs.wso2.com/display/IoTS300/Quick+Start+Guide" target="_blank"
class="btn-operations btn-default">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-document fw-stack-1x"></i>
</span>
Quick Startup Guide

@ -12,7 +12,7 @@
<a href="{{appContext}}/device/{{deviceTypeName}}/enroll"
data-click-event="remove-form" class="btn col-md-12">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-check fw-stack-1x"></i>
</span>
<span>Select</span>

@ -40,7 +40,7 @@
<a href="{{appContext}}/policy/effective-policy?type={{deviceType}}&id={{deviceId}}"
class="cu-btn-inner policy-view-link" data-id="{{id}}">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View

@ -29,7 +29,7 @@
data-click-event="remove-form"
class="policy-view-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">View</span>
@ -38,7 +38,7 @@
data-id="{{id}}" data-click-event="remove-form"
class="policy-update-link">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-settings fw-stack-1x"></i>
</span>
<span class="hidden-xs hidden-on-grid-view">Re-Configure</span>

@ -22,7 +22,7 @@
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i>
</span>
Unauthorized action!

@ -21,7 +21,7 @@
<td style="text-align: center;">
<a href="device/{{deviceType}}?id={{deviceIdentifier}}" data-id="{{id}}" data-url="device/{{deviceType}}?id={{deviceIdentifier}}" class="new-notification" data-click-event="remove-form">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
</a>
@ -59,7 +59,7 @@
<td style="text-align: center;">
<a href="device/{{deviceType}}?id={{deviceIdentifier}}" data-click-event="remove-form">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
</a>

@ -50,7 +50,7 @@
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policy/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add another policy

@ -2,6 +2,8 @@
{{#if isAuthorized }}
<span id="logged-in-user" class="hidden" data-username="{{user.username}}" data-domain="{{user.domain}}"
data-tenant-id="{{user.tenantId}}"></span>
<span id="policy-operations" class="hidden" data-template="{{policyOperations.template}}"
data-script="{{policyOperations.script}}" data-style="{{policyOperations.style}}"></span>
<div class="row">
<div class="col-md-12">
@ -42,7 +44,7 @@
</button>
<a href="{{@app.context}}/policies/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add another policy

@ -17,8 +17,8 @@
*/
function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js");
var deviceType = request.getParameter("deviceType");
var utility = require("/app/modules/utility.js").utility;
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
@ -31,12 +31,30 @@ function onRequest(context) {
if (usersResult.status == "success") {
context.users = usersResult.content;
}
context["groups"] = groupModule.getGroups();
var user = userModule.getCarbonUser();
context["user"] = {username: user.username, domain: user.domain, tenantId: user.tenantId};
context["policyOperations"] = {};
var policyEditSrc = "/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-edit");
if (new File(policyEditSrc).isExists()) {
var policyOperationsTemplateSrc = policyEditSrc + "/public/templates/" + deviceType + "-policy-edit.hbs";
if (new File(policyOperationsTemplateSrc).isExists()) {
context["policyOperations"].template = "/public/cdmf.unit.device.type." + deviceType +
".policy-edit/templates/" + deviceType + "-policy-edit.hbs";
}
var policyOperationsScriptSrc = policyEditSrc + "/public/js/" + deviceType + "-policy-edit.js";
if (new File(policyOperationsScriptSrc).isExists()) {
context["policyOperations"].script = "/public/cdmf.unit.device.type." + deviceType + ".policy-edit/js/" +
deviceType + "-policy-edit.js";
}
var policyOperationsStylesSrc = policyEditSrc + "/public/css/" + deviceType + "-policy-edit.css";
if (new File(policyOperationsStylesSrc).isExists()) {
context["policyOperations"].style = "/public/cdmf.unit.device.type." + deviceType + ".policy-edit/css/" +
deviceType + "-policy-edit.css";
}
}
context.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage");
context.isAuthorizedViewUsers = userModule.isAuthorized("/permission/admin/device-mgt/roles/view");
context.isAuthorizedViewRoles = userModule.isAuthorized("/permission/admin/device-mgt/users/view");

@ -179,52 +179,47 @@ skipStep["policy-platform"] = function (policyPayloadObj) {
$("#policy-profile-page-wizard-title").text("EDIT " + policy["platform"] + " POLICY - " + policy["name"]);
var deviceType = policy["platform"];
var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
'.policy-edit/templates/' + deviceType + '-policy-edit.hbs';
var policyOperationsScriptSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
'.policy-edit/js/' + deviceType + '-policy-edit.js';
var policyOperationsStylesSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
'.policy-edit/css/' + deviceType + '-policy-edit.css';
var policyOperationsTemplateCacheKey = deviceType + '-policy-operations';
$.isResourceExists(policyOperationsTemplateSrc, function (status) {
if (status) {
$.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) {
var content = template();
$("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden");
$.isResourceExists(policyOperationsScriptSrc, function (status) {
if (status) {
hasPolicyProfileScript = true;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = policyOperationsScriptSrc;
$(".wr-advance-operations").prepend(script);
/*
This method should be implemented in the relevant plugin side and should include the logic to
populate the policy profile in the plugin specific UI.
*/
polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
});
});
$.isResourceExists(policyOperationsStylesSrc, function (status) {
if (status) {
var style = document.createElement('link');
style.type = 'text/css';
style.rel = 'stylesheet';
style.href = policyOperationsStylesSrc;
$(".wr-advance-operations").prepend(style);
}
});
var policyOperations = $("#policy-operations");
var policyEditTemplateSrc = $(policyOperations).data("template");
var policyEditScriptSrc = $(policyOperations).data("script");
var policyEditStylesSrc = $(policyOperations).data("style");
var policyEditTemplateCacheKey = deviceType + '-policy-edit';
if (policyEditTemplateSrc) {
if (policyEditScriptSrc) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = context + policyEditScriptSrc;
$(".wr-advance-operations").prepend(script);
hasPolicyProfileScript = true;
} else {
$("#generic-policy-operations").removeClass("hidden");
hasPolicyProfileScript = false;
}
$(".wr-advance-operations-init").addClass("hidden");
});
$.template(policyEditTemplateCacheKey, context + policyEditTemplateSrc, function (template) {
var content = template();
$("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden");
if (hasPolicyProfileScript) {
/*
This method should be implemented in the relevant plugin side and should include the logic to
populate the policy profile in the plugin specific UI.
*/
polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
});
} else {
$("#generic-policy-operations").removeClass("hidden");
}
if (policyEditStylesSrc) {
var style = document.createElement('link');
style.type = 'text/css';
style.rel = 'stylesheet';
style.href = context + policyEditStylesSrc;
$(".wr-advance-operations").prepend(style);
}
$(".wr-advance-operations-init").addClass("hidden");
if(!hasPolicyProfileScript) {
if (!hasPolicyProfileScript) {
populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
};

@ -36,7 +36,7 @@
<span class="editable-text wr-sort-index">
<input type="text" id="dd" class="index">
<span class="icon fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-edit fw-stack-1x"></i>
</span>
</span>

@ -67,52 +67,47 @@ var displayPolicy = function (policyPayloadObj) {
}
var deviceType = policy["platform"];
var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
'.policy-view/templates/' + deviceType + '-policy-view.hbs';
var policyOperationsScriptSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
'.policy-view/js/' + deviceType + '-policy-view.js';
var policyOperationsStylesSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
'.policy-view/css/' + deviceType + '-policy-view.css';
var policyOperationsTemplateCacheKey = deviceType + '-policy-operations';
var policyOperations = $("#policy-operations");
var policyViewTemplateSrc = $(policyOperations).data("template");
var policyViewScriptSrc = $(policyOperations).data("script");
var policyViewStylesSrc = $(policyOperations).data("style");
var policyViewTemplateCacheKey = deviceType + '-policy-view';
$.isResourceExists(policyOperationsTemplateSrc, function (status) {
if (status) {
$.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) {
var content = template();
$("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden");
$.isResourceExists(policyOperationsScriptSrc, function (status) {
if (status) {
hasPolicyProfileScript = true;
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = policyOperationsScriptSrc;
$(".wr-advance-operations").prepend(script);
/*
This method should be implemented in the relevant plugin side and should include the logic to
populate the policy profile in the plugin specific UI.
*/
polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
});
});
$.isResourceExists(policyOperationsStylesSrc, function (status) {
if (status) {
var style = document.createElement('link');
style.type = 'text/css';
style.rel = 'stylesheet';
style.href = policyOperationsStylesSrc;
$(".wr-advance-operations").prepend(style);
}
});
if (policyViewTemplateSrc) {
if (policyViewScriptSrc) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = context + policyViewScriptSrc;
$(".wr-advance-operations").prepend(script);
hasPolicyProfileScript = true;
} else {
$("#generic-policy-operations").removeClass("hidden");
hasPolicyProfileScript = false;
}
$(".wr-advance-operations-init").addClass("hidden");
});
$.template(policyViewTemplateCacheKey, context + policyViewTemplateSrc, function (template) {
var content = template();
$("#device-type-policy-operations").html(content).removeClass("hidden");
$(".policy-platform").addClass("hidden");
if (hasPolicyProfileScript) {
/*
This method should be implemented in the relevant plugin side and should include the logic to
populate the policy profile in the plugin specific UI.
*/
polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
});
} else {
$("#generic-policy-operations").removeClass("hidden");
}
if (policyViewStylesSrc) {
var style = document.createElement('link');
style.type = 'text/css';
style.rel = 'stylesheet';
style.href = context + policyViewStylesSrc;
$(".wr-advance-operations").prepend(style);
}
$(".wr-advance-operations-init").addClass("hidden");
if(!hasPolicyProfileScript) {
if (!hasPolicyProfileScript) {
populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
};

@ -8,7 +8,8 @@
</div>
</div>
{{/defineZone}}
<span id="policy-operations" class="hidden" data-template="{{template}}" data-script="{{script}}"
data-style="{{style}}"></span>
<!-- #page-content-wrapper -->
<div class="page-content-wrapper">
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">

@ -17,10 +17,27 @@
*/
function onRequest(context) {
// var log = new Log("policy-view-edit-unit backend js");
// var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
// context.roles = userModule.getRoles();
context.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/view");
return context;
var utility = require("/app/modules/utility.js").utility;
var page = {};
var deviceType = request.getParameter("deviceType");
var policyViewSrc = "/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-view");
if (new File(policyViewSrc).isExists()) {
var policyOperationsTemplateSrc = policyViewSrc + "/public/templates/" + deviceType + "-policy-view.hbs";
if (new File(policyOperationsTemplateSrc).isExists()) {
page.template = "/public/cdmf.unit.device.type." + deviceType + ".policy-view/templates/" + deviceType +
"-policy-view.hbs";
}
var policyOperationsScriptSrc = policyViewSrc + "/public/js/" + deviceType + "-policy-view.js";
if (new File(policyOperationsScriptSrc).isExists()) {
page.script = "/public/cdmf.unit.device.type." + deviceType + ".policy-view/js/" + deviceType +
"-policy-view.js";
}
var policyOperationsStylesSrc = policyViewSrc + "/public/css/" + deviceType + "-policy-view.css";
if (new File(policyOperationsStylesSrc).isExists()) {
page.style = "/public/cdmf.unit.device.type." + deviceType + ".policy-view/css/" + deviceType +
"-policy-view.css";
}
}
page.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/view");
return page;
}

@ -77,7 +77,7 @@
</button>
<a href="{{@app.context}}/role/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Role

@ -70,7 +70,7 @@
<a href="{{@app.context}}/roles/edit-role/{{role.roleName}}"
class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
View Updated Role

@ -19,10 +19,7 @@
<ul class="nav navbar-right float-remove-xs text-center-xs">
<li class="visible-inline-block">
<a href="#" class="dropdown" data-toggle="dropdown">
<span class="icon fw-stack fw-lg">
<i class="fw fw-circle fw-stack-2x"></i>
<i class="fw fw-user fw-stack-1x fw-inverse"></i>
</span>
<i class="fw fw-user fw-lg fw-helper fw-helper-inverse fw-helper-circle"></i>
<span class="hidden-xs add-padding-left-1x">
{{#if isSuperTenant }}
{{@user.username}}<span class="caret"></span>
@ -48,7 +45,7 @@
<span class="fw-stack">
<i class="fw fw-user fw-stack-2x"></i>
<span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-circle fw-stack-2x fw-stroke text-info"></i>
<i class="fw fw-edit fw-stack-1x fw-inverse"></i>
</span>

@ -23,11 +23,11 @@
<div class="modal-header">
<h3 class="pull-left modal-title">
<span class="fw-stack error-msg-icon hidden">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i>
</span>
<span class="fw-stack warning-msg-icon hidden">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-warning fw-stack-1x"></i>
</span>
<span id="modal-title-text"></span>

@ -40,7 +40,7 @@
{{#if permissions.LIST_GROUPS}}
<li>
<a href="{{@app.context}}/groups">
<i class="fw fw-grouping"></i>
<i class="fw fw-group"></i>
Group Management
</a>
</li>

@ -1811,7 +1811,7 @@ a.btn:hover, .btn:hover {
margin-right: -1px;
}
.remove-icon-ring-on-hover:hover .fw-ring {
.remove-icon-ring-on-hover:hover .fw-circle-outline {
display: none;
}
@ -4556,7 +4556,7 @@ a.wr-side-panel-toggle-btn.selected {
color: #526A84;
}
.wr-advance-operations .wr-hidden-operations-nav a.selected span span > i.fw.fw-circle.fw-stack-2x{
color: #fff;
color: #526A84;
}
.wr-advance-operations .wr-hidden-operations-nav a.selected span span > i.fw.fw-circle.fw-stack-2x.fw-stroke.fw-inverse{
color: #526A84;
@ -5138,7 +5138,7 @@ a.cu-btn-inner.inverse:hover {
font-size: 14px;
}
.multi-view .content .panel-body .well fieldset legend a:hover .icon.fw-stack .fw-ring {
.multi-view .content .panel-body .well fieldset legend a:hover .icon.fw-stack .fw-circle-outline {
display: none;
}
@ -6507,6 +6507,10 @@ select > option:hover {
font-weight:400;
}
.header .fw:before {
color: #000;
}
/* Adding style for required fields */
.required:before {
content: "*";

@ -24,7 +24,7 @@
{{#defineZone "toggleMenuRight-icon"}}
<span class="icon fw-stack">
<i class="fw fw-settings fw-stack-1x"></i>
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-circle-outline fw-stack-2x"></i>
</span>
{{/defineZone}}
</a>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 337 KiB

After

Width:  |  Height:  |  Size: 385 KiB

Loading…
Cancel
Save