mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt-plugins
This commit is contained in:
commit
f6032004fb
@ -73,7 +73,8 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
|
|||||||
getDevicesOfUser(userName);
|
getDevicesOfUser(userName);
|
||||||
|
|
||||||
for (org.wso2.carbon.device.mgt.common.Device device : deviceList) {
|
for (org.wso2.carbon.device.mgt.common.Device device : deviceList) {
|
||||||
if(applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){
|
if(MDMAppConstants.WEBAPP.equals(applicationOperationAction.getApp().getPlatform()) ||
|
||||||
|
applicationOperationAction.getApp().getPlatform().equalsIgnoreCase(device.getType())){
|
||||||
deviceIdentifiers.add(getDeviceIdentifierByDevice(device));
|
deviceIdentifiers.add(getDeviceIdentifierByDevice(device));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,8 +177,11 @@ public class ApplicationOperationsImpl implements ApplicationOperations {
|
|||||||
operation =
|
operation =
|
||||||
IOSApplicationOperationUtil.createInstallAppOperation(mobileApp);
|
IOSApplicationOperationUtil.createInstallAppOperation(mobileApp);
|
||||||
} else {
|
} else {
|
||||||
operation =
|
if (MDMAppConstants.WEBAPP.equals(app.getPlatform())) {
|
||||||
IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp);
|
operation = IOSApplicationOperationUtil.createWebClipUninstallOperation(mobileApp);
|
||||||
|
} else {
|
||||||
|
operation = IOSApplicationOperationUtil.createAppUninstallOperation(mobileApp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())
|
activity = MDMServiceAPIUtils.getAppManagementService(applicationOperationAction.getTenantId())
|
||||||
|
|||||||
@ -23,6 +23,15 @@ import java.io.Serializable;
|
|||||||
public class RemoveApplication implements Serializable {
|
public class RemoveApplication implements Serializable {
|
||||||
|
|
||||||
private String bundleId;
|
private String bundleId;
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
public String getBundleId() {
|
public String getBundleId() {
|
||||||
return bundleId;
|
return bundleId;
|
||||||
|
|||||||
@ -111,4 +111,22 @@ public class IOSApplicationOperationUtil {
|
|||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create uninstall operations for webclip.
|
||||||
|
*
|
||||||
|
* @param application
|
||||||
|
* @return Uninstall operation
|
||||||
|
* @throws DeviceApplicationException
|
||||||
|
*/
|
||||||
|
public static Operation createWebClipUninstallOperation(MobileApp application) throws
|
||||||
|
DeviceApplicationException {
|
||||||
|
ProfileOperation operation = new ProfileOperation();
|
||||||
|
operation.setCode(MDMAppConstants.IOSConstants.OPCODE_REMOVE_APPLICATION);
|
||||||
|
operation.setType(Operation.Type.PROFILE);
|
||||||
|
RemoveApplication removeApplication = new RemoveApplication();
|
||||||
|
removeApplication.setUrl(application.getIdentifier());
|
||||||
|
operation.setPayLoad(removeApplication.toJSON());
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,8 +32,10 @@
|
|||||||
"identityProviderUrl" : "https://localhost:9443/samlsso",
|
"identityProviderUrl" : "https://localhost:9443/samlsso",
|
||||||
"acs": "https://localhost:9443/emm/uuf/sso/acs",
|
"acs": "https://localhost:9443/emm/uuf/sso/acs",
|
||||||
"identityAlias": "wso2carbon",
|
"identityAlias": "wso2carbon",
|
||||||
"responseSigningEnabled" : "true",
|
"responseSigningEnabled" : true,
|
||||||
"useTenantKey": false
|
"validateAssertionValidityPeriod": true,
|
||||||
|
"validateAudienceRestriction": true,
|
||||||
|
"assertionSigningEnabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generalConfig" : {
|
"generalConfig" : {
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
"httpsWebURL" : "%https.ip%",
|
"httpsWebURL" : "%https.ip%",
|
||||||
"wssURL" : "%https.ip%",
|
"wssURL" : "%https.ip%",
|
||||||
"wsURL" : "%http.ip%",
|
"wsURL" : "%http.ip%",
|
||||||
"dashboardServerURL" : "%https.ip%",
|
|
||||||
"enrollmentDir": "/emm-web-agent/enrollment",
|
"enrollmentDir": "/emm-web-agent/enrollment",
|
||||||
"iOSConfigRoot" : "%https.ip%/ios-enrollment/",
|
"iOSConfigRoot" : "%https.ip%/ios-enrollment/",
|
||||||
"iOSAPIRoot" : "%https.ip%/ios/",
|
"iOSAPIRoot" : "%https.ip%/ios/",
|
||||||
@ -121,5 +120,6 @@
|
|||||||
"isOAuthEnabled" : true,
|
"isOAuthEnabled" : true,
|
||||||
"backendRestEndpoints" : {
|
"backendRestEndpoints" : {
|
||||||
"deviceMgt" : "/api/device-mgt/v1.0"
|
"deviceMgt" : "/api/device-mgt/v1.0"
|
||||||
}
|
},
|
||||||
|
"deviceStatisticsEnabled" : false
|
||||||
}
|
}
|
||||||
@ -51,9 +51,9 @@ function getSelectedDeviceIds() {
|
|||||||
var deviceId = device.data('deviceid');
|
var deviceId = device.data('deviceid');
|
||||||
var deviceType = device.data('type');
|
var deviceType = device.data('type');
|
||||||
deviceIdentifierList.push({
|
deviceIdentifierList.push({
|
||||||
"id": deviceId,
|
"id": deviceId,
|
||||||
"type": deviceType
|
"type": deviceType
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (deviceIdentifierList.length == 0) {
|
if (deviceIdentifierList.length == 0) {
|
||||||
var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable();
|
var thisTable = $(".DTTT_selected").closest('.dataTables_wrapper').find('.dataTable').dataTable();
|
||||||
@ -62,9 +62,9 @@ function getSelectedDeviceIds() {
|
|||||||
var deviceId = $(thisTable.api().row(this).node()).data('deviceid');
|
var deviceId = $(thisTable.api().row(this).node()).data('deviceid');
|
||||||
var deviceType = $(thisTable.api().row(this).node()).data('devicetype');
|
var deviceType = $(thisTable.api().row(this).node()).data('devicetype');
|
||||||
deviceIdentifierList.push({
|
deviceIdentifierList.push({
|
||||||
"id": deviceId,
|
"id": deviceId,
|
||||||
"type": deviceType
|
"type": deviceType
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -102,11 +102,6 @@ function getDevicesByTypes(deviceList) {
|
|||||||
return deviceTypes;
|
return deviceTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
//function unloadOperationBar() {
|
|
||||||
// $("#showOperationsBtn").addClass("hidden");
|
|
||||||
// $(".wr-operations").html("");
|
|
||||||
//}
|
|
||||||
|
|
||||||
function loadOperationBar(deviceType, ownership, mode) {
|
function loadOperationBar(deviceType, ownership, mode) {
|
||||||
var operationBar = $("#operations-bar");
|
var operationBar = $("#operations-bar");
|
||||||
var operationBarSrc = operationBar.attr("src");
|
var operationBarSrc = operationBar.attr("src");
|
||||||
@ -166,7 +161,7 @@ function loadOperationBar(deviceType, ownership, mode) {
|
|||||||
/* adding ownership in addition to device-type
|
/* adding ownership in addition to device-type
|
||||||
as it's vital in cases where UI for the same feature should change
|
as it's vital in cases where UI for the same feature should change
|
||||||
according to ownership
|
according to ownership
|
||||||
*/
|
*/
|
||||||
if (ownership) {
|
if (ownership) {
|
||||||
current.ownership = ownership;
|
current.ownership = ownership;
|
||||||
}
|
}
|
||||||
@ -190,22 +185,21 @@ function loadOperationBar(deviceType, ownership, mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function runOperation(operationName) {
|
function runOperation(operationName) {
|
||||||
|
if (operationName == "NOTIFICATION") {
|
||||||
|
var messageTitle = $("#messageTitle").val();
|
||||||
|
var messageText = $("#messageText").val();
|
||||||
|
if (!messageTitle || !messageText) {
|
||||||
|
var errorMsg = "#notification-error-msg span";
|
||||||
|
var errorMsgWrapper = "#notification-error-msg";
|
||||||
|
$(errorMsg).text("Either the message title / message text or both are empty.");
|
||||||
|
$(errorMsgWrapper).removeClass("hidden");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var deviceIdList = getSelectedDeviceIds();
|
var deviceIdList = getSelectedDeviceIds();
|
||||||
var list = getDevicesByTypes(deviceIdList);
|
var list = getDevicesByTypes(deviceIdList);
|
||||||
|
|
||||||
var successCallback = function (data) {
|
|
||||||
if (operationName == "NOTIFICATION") {
|
|
||||||
$(modalPopupContent).html($("#messageSuccess").html());
|
|
||||||
} else {
|
|
||||||
$(modalPopupContent).html($("#operationSuccess").html());
|
|
||||||
}
|
|
||||||
showPopup();
|
|
||||||
};
|
|
||||||
var errorCallback = function (data) {
|
|
||||||
$(modalPopupContent).html($("#errorOperationUnexpected").html());
|
|
||||||
showPopup();
|
|
||||||
};
|
|
||||||
|
|
||||||
var payload, serviceEndPoint;
|
var payload, serviceEndPoint;
|
||||||
if (list[platformTypeConstants.IOS]) {
|
if (list[platformTypeConstants.IOS]) {
|
||||||
payload =
|
payload =
|
||||||
@ -217,27 +211,22 @@ function runOperation(operationName) {
|
|||||||
serviceEndPoint = operationModule.getAndroidServiceEndpoint(operationName);
|
serviceEndPoint = operationModule.getAndroidServiceEndpoint(operationName);
|
||||||
} else if (list[platformTypeConstants.WINDOWS]) {
|
} else if (list[platformTypeConstants.WINDOWS]) {
|
||||||
payload = operationModule.generatePayload(platformTypeConstants.WINDOWS, operationName,
|
payload = operationModule.generatePayload(platformTypeConstants.WINDOWS, operationName,
|
||||||
list[platformTypeConstants.WINDOWS]);
|
list[platformTypeConstants.WINDOWS]);
|
||||||
serviceEndPoint = operationModule.getWindowsServiceEndpoint(operationName);
|
serviceEndPoint = operationModule.getWindowsServiceEndpoint(operationName);
|
||||||
}
|
}
|
||||||
if (operationName == "NOTIFICATION") {
|
|
||||||
var errorMsgWrapper = "#notification-error-msg";
|
var successCallback = function () {
|
||||||
var errorMsg = "#notification-error-msg span";
|
if (operationName == "NOTIFICATION") {
|
||||||
var messageTitle = $("#messageTitle").val();
|
$(modalPopupContent).html($("#messageSuccess").html());
|
||||||
var messageText = $("#messageText").val();
|
|
||||||
if (!(messageTitle && messageText)) {
|
|
||||||
$(errorMsg).text("Enter a message. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else {
|
} else {
|
||||||
invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback);
|
$(modalPopupContent).html($("#operationSuccess").html());
|
||||||
$(modalPopupContent).removeData();
|
|
||||||
hidePopup();
|
|
||||||
}
|
}
|
||||||
} else {
|
};
|
||||||
invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback);
|
var errorCallback = function () {
|
||||||
$(modalPopupContent).removeData();
|
$(modalPopupContent).html($("#errorOperationUnexpected").html());
|
||||||
hidePopup();
|
};
|
||||||
}
|
|
||||||
|
invokerUtil.post(serviceEndPoint, payload, successCallback, errorCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -25,10 +25,16 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{{@app.context}}">
|
<a href="{{@app.context}}">
|
||||||
<i class="fw fw-dashboard"></i>
|
<i class="fw fw-dashboard"></i>
|
||||||
Resource Dashboard
|
System Resources
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{{#if dashboardAvailable}}
|
||||||
|
{{#if permissions.VIEW_DASHBOARD}}
|
||||||
|
<li><a href="{{serverURL}}/portal/t/{{currentUser.domain}}/dashboards/device-statistics-dashboard/">
|
||||||
|
<i class="fw fw-bar-chart"></i>Device Statistics</a>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
{{#if permissions.LIST_DEVICES}}
|
{{#if permissions.LIST_DEVICES}}
|
||||||
<li>
|
<li>
|
||||||
<!--suppress HtmlUnknownTarget -->
|
<!--suppress HtmlUnknownTarget -->
|
||||||
@ -74,11 +80,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if permissions.VIEW_DASHBOARD}}
|
|
||||||
<li><a href="{{serverURL}}/portal/dashboards/emm-analytics-dashboard/">
|
|
||||||
<i class="fw fw-pie-chart"></i>Device Management Dashboard</a>
|
|
||||||
</li>
|
|
||||||
{{/if}}
|
|
||||||
{{/zone}}
|
{{/zone}}
|
||||||
|
|
||||||
{{#zone "navbarCollapsableRightItems"}}
|
{{#zone "navbarCollapsableRightItems"}}
|
||||||
@ -105,12 +106,13 @@
|
|||||||
<ul class="sidebar-messages"></ul>
|
<ul class="sidebar-messages"></ul>
|
||||||
<br>
|
<br>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
<!--suppress HtmlUnknownTarget -->
|
||||||
<a href="{{@app.context}}/notification-listing" class="btn-operations btn-default">
|
<a href="{{@app.context}}/notification-listing" class="btn-operations btn-default">
|
||||||
<span class="fw-stack">
|
<span class="fw-stack">
|
||||||
<i class="fw fw-ring fw-stroke fw-stack-2x"></i>
|
<i class="fw fw-ring fw-stroke fw-stack-2x"></i>
|
||||||
<i class="fw fw-notification fw-stack-1x"></i>
|
<i class="fw fw-notification fw-stack-1x"></i>
|
||||||
</span>
|
</span>
|
||||||
View All Notifications
|
View All Notifications
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,6 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function onRequest(context) {
|
function onRequest(context) {
|
||||||
|
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
|
||||||
|
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||||
|
var constants = require("/app/modules/constants.js");
|
||||||
|
|
||||||
context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
|
context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
|
||||||
if (arguments.length < 3) {
|
if (arguments.length < 3) {
|
||||||
throw new Error("Handlebars Helper equal needs 2 parameters");
|
throw new Error("Handlebars Helper equal needs 2 parameters");
|
||||||
@ -27,9 +31,7 @@ function onRequest(context) {
|
|||||||
return options.fn(this);
|
return options.fn(this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
|
|
||||||
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
|
|
||||||
var constants = require("/app/modules/constants.js");
|
|
||||||
var links = {
|
var links = {
|
||||||
"user-mgt": [],
|
"user-mgt": [],
|
||||||
"role-mgt": [],
|
"role-mgt": [],
|
||||||
@ -40,7 +42,7 @@ function onRequest(context) {
|
|||||||
|
|
||||||
// following viewModel.link value comes here based on the value passed at the point
|
// following viewModel.link value comes here based on the value passed at the point
|
||||||
// where units are attached to a page zone.
|
// where units are attached to a page zone.
|
||||||
// eg: {{unit "appbar" pageLink="users" title="User Management"}}
|
// eg: {{unit "app-bar" pageLink="users" title="User Management"}}
|
||||||
viewModel["currentActions"] = links[viewModel["pageLink"]];
|
viewModel["currentActions"] = links[viewModel["pageLink"]];
|
||||||
viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"];
|
viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"];
|
||||||
viewModel["currentUser"] = session.get(constants["USER_SESSION_KEY"]);
|
viewModel["currentUser"] = session.get(constants["USER_SESSION_KEY"]);
|
||||||
@ -57,6 +59,8 @@ function onRequest(context) {
|
|||||||
permissions["LIST_NOTIFICATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/notifications/view");
|
permissions["LIST_NOTIFICATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/notifications/view");
|
||||||
permissions["VIEW_DASHBOARD"] = userModule.isAuthorized("/permission/admin/device-mgt/dashboard/view");
|
permissions["VIEW_DASHBOARD"] = userModule.isAuthorized("/permission/admin/device-mgt/dashboard/view");
|
||||||
|
|
||||||
|
viewModel["dashboardAvailable"] = mdmProps["deviceStatisticsEnabled"];
|
||||||
|
|
||||||
viewModel["permissions"] = permissions;
|
viewModel["permissions"] = permissions;
|
||||||
viewModel["appContext"] = mdmProps["appContext"];
|
viewModel["appContext"] = mdmProps["appContext"];
|
||||||
viewModel["serverURL"] = mdmProps["httpsWebURL"];
|
viewModel["serverURL"] = mdmProps["httpsWebURL"];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user