mirror of
https://repository.entgra.net/community/product-iots.git
synced 2025-09-16 23:32:19 +00:00
Set trigger to display add group popup
This commit is contained in:
parent
9f99e6e4da
commit
91ab732dba
@ -30,6 +30,35 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="wr-stats-board-tile">
|
||||||
|
<div class="tile-name">Groups</div>
|
||||||
|
<div>
|
||||||
|
<div class="tile-icon"><i class="fw fw-policy"></i></div>
|
||||||
|
<div class="tile-stats">
|
||||||
|
<span id="group-count">Loading...</span>
|
||||||
|
<span class="tile-stats-free">
|
||||||
|
<a href="groups">
|
||||||
|
<span class="fw-stack">
|
||||||
|
<i class="fw fw-ring fw-stack-2x"></i>
|
||||||
|
<i class="fw fw-view fw-stack-1x"></i>
|
||||||
|
</span>
|
||||||
|
View
|
||||||
|
</a>
|
||||||
|
<a href="groups/add-group">
|
||||||
|
<span class="fw-stack">
|
||||||
|
<i class="fw fw-ring fw-stack-2x"></i>
|
||||||
|
<i class="fw fw-add fw-stack-1x"></i>
|
||||||
|
</span>
|
||||||
|
Add
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{#if permissions.ADD_USER}}
|
{{#if permissions.ADD_USER}}
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="wr-stats-board-tile">
|
<div class="wr-stats-board-tile">
|
||||||
@ -59,33 +88,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="wr-stats-board-tile">
|
|
||||||
<div class="tile-name">Groups</div>
|
|
||||||
<div>
|
|
||||||
<div class="tile-icon"><i class="fw fw-policy"></i></div>
|
|
||||||
<div class="tile-stats">
|
|
||||||
<span id="group-count">Loading...</span>
|
|
||||||
<span class="tile-stats-free">
|
|
||||||
<a href="groups">
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-view fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
View
|
|
||||||
</a>
|
|
||||||
<a href="groups/add-group">
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-add fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
Add
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="wr-stats-board-tile">
|
<div class="wr-stats-board-tile">
|
||||||
|
|||||||
@ -64,7 +64,14 @@ $(document).ready(function () {
|
|||||||
return $("#content-filter-types").html();
|
return $("#content-filter-types").html();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
loadGroups();
|
||||||
changeGroupView('grid', $('a.ctrl-filter-grid'));
|
changeGroupView('grid', $('a.ctrl-filter-grid'));
|
||||||
|
|
||||||
|
var path = window.location.pathname;
|
||||||
|
if (path == '/iotserver/groups/add-group'){
|
||||||
|
addNewGroup();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -168,9 +175,6 @@ function loadGroups(searchType, searchParam) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$(document).ready(function () {
|
|
||||||
loadGroups();
|
|
||||||
});
|
|
||||||
|
|
||||||
function formatDates() {
|
function formatDates() {
|
||||||
$(".formatDate").each(function () {
|
$(".formatDate").each(function () {
|
||||||
@ -236,58 +240,60 @@ function attachGroupAdding() {
|
|||||||
* when a user clicks on "Remove" link
|
* when a user clicks on "Remove" link
|
||||||
* on Group Management page in WSO2 IoT Server Console.
|
* on Group Management page in WSO2 IoT Server Console.
|
||||||
*/
|
*/
|
||||||
$("a.add-group-link").click(function () {
|
$("a.add-group-link").click(addNewGroup);
|
||||||
var addGroupApi = "/iotserver/api/group/add";
|
}
|
||||||
$(modalPopupContent).html($('#add-group-modal-content').html());
|
|
||||||
showPopup();
|
|
||||||
|
|
||||||
$("a#add-group-yes-link").click(function () {
|
var addNewGroup = function () {
|
||||||
var newGroupName = $('#add-group-name').val();
|
var addGroupApi = "/iotserver/api/group/add";
|
||||||
var newGroupDescription = $('#add-group-description').val();
|
$(modalPopupContent).html($('#add-group-modal-content').html());
|
||||||
var group = {"name": newGroupName, "description": newGroupDescription};
|
showPopup();
|
||||||
invokerUtil.post(
|
|
||||||
addGroupApi,
|
$("a#add-group-yes-link").click(function () {
|
||||||
group,
|
var newGroupName = $('#add-group-name').val();
|
||||||
function (data, txtStatus, jqxhr) {
|
var newGroupDescription = $('#add-group-description').val();
|
||||||
var status = jqxhr.status;
|
var group = {"name": newGroupName, "description": newGroupDescription};
|
||||||
if (status == 200) {
|
invokerUtil.post(
|
||||||
if (data != "false") {
|
addGroupApi,
|
||||||
$(modalPopupContent).html($('#add-group-200-content').html());
|
group,
|
||||||
loadGroups();
|
function (data, txtStatus, jqxhr) {
|
||||||
setTimeout(function () {
|
var status = jqxhr.status;
|
||||||
hidePopup();
|
if (status == 200) {
|
||||||
}, 2000);
|
if (data != "false") {
|
||||||
} else {
|
$(modalPopupContent).html($('#add-group-200-content').html());
|
||||||
$(modalPopupContent).html($('#group-400-content').html());
|
loadGroups();
|
||||||
$("a#group-400-link").click(function () {
|
setTimeout(function () {
|
||||||
hidePopup();
|
hidePopup();
|
||||||
});
|
}, 2000);
|
||||||
}
|
} else {
|
||||||
} else if (status == 400) {
|
|
||||||
$(modalPopupContent).html($('#group-400-content').html());
|
$(modalPopupContent).html($('#group-400-content').html());
|
||||||
$("a#group-400-link").click(function () {
|
$("a#group-400-link").click(function () {
|
||||||
hidePopup();
|
hidePopup();
|
||||||
});
|
});
|
||||||
} else if (status == 403) {
|
|
||||||
$(modalPopupContent).html($('#agroup-403-content').html());
|
|
||||||
$("a#group-403-link").click(function () {
|
|
||||||
hidePopup();
|
|
||||||
});
|
|
||||||
} else if (status == 409) {
|
|
||||||
$(modalPopupContent).html($('#group-409-content').html());
|
|
||||||
$("a#group-409-link").click(function () {
|
|
||||||
hidePopup();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, errorHandler
|
} else if (status == 400) {
|
||||||
);
|
$(modalPopupContent).html($('#group-400-content').html());
|
||||||
});
|
$("a#group-400-link").click(function () {
|
||||||
|
hidePopup();
|
||||||
$("a#add-group-cancel-link").click(function () {
|
});
|
||||||
hidePopup();
|
} else if (status == 403) {
|
||||||
});
|
$(modalPopupContent).html($('#agroup-403-content').html());
|
||||||
|
$("a#group-403-link").click(function () {
|
||||||
|
hidePopup();
|
||||||
|
});
|
||||||
|
} else if (status == 409) {
|
||||||
|
$(modalPopupContent).html($('#group-409-content').html());
|
||||||
|
$("a#group-409-link").click(function () {
|
||||||
|
hidePopup();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, errorHandler
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("a#add-group-cancel-link").click(function () {
|
||||||
|
hidePopup();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user