Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stop/start all ESME account functionality #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 59 additions & 2 deletions management/ui-management/src/main/webapp/modules/esmes.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ <h3 style="margin: 0px;">
</h3>
<hr style="margin: 10 0px;" />
<span style="float: right;">
<button id="stopAll" style="float: right; margin-right: 20px; margin-left: 5px; height: 30px;" class="btn btn-medium btn-danger" data-toggle="tooltip" data-placement="left" title="Stop all ESME List" onclick="confirmStopAllEsmeAccounts();">
<i class="icon-stop"></i>
</button>
<button id="refresh" style="float: right; margin-right: 20px; margin-left: 20px; height: 30px;" class="btn btn-medium btn-success" data-toggle="tooltip" data-placement="left" title="Refresh ESME List" onclick="updateEsmes();">
<i class="icon-refresh"></i>
</button>
<button id="startAll" style="float: right; margin-right: 5px; margin-left: 5px; height: 30px;" class="btn btn-medium btn-success" data-toggle="tooltip" data-placement="left" title="Start all ESME List" onclick="confirmStartAllEsmeAccounts();">
<i class="icon-play"></i>
</button>
</span>
<span id="esmes-table-wrapper">
<table id="no-esmes-table" class="table" style="display: none;">
Expand Down Expand Up @@ -453,6 +459,7 @@ <h3>Create ESME</h3>
</div>

<script type="text/javascript">
var allEsmeNames = [];
function clientServerFunction(){

var e1 = document.getElementById("smppSessionType");
Expand Down Expand Up @@ -673,7 +680,9 @@ <h3>Create ESME</h3>

var overloadThreshold = response.value.OverloadThreshold;
var normalThreshold = response.value.NormalThreshold;


allEsmeNames.push(name);

if(systemType == null || systemType==""){
systemType = "null";
}
Expand Down Expand Up @@ -2293,7 +2302,55 @@ <h3>Create ESME</h3>
});

}


function confirmStartAllEsmeAccounts() {
if (confirm("Do you want to start all ESME accounts?")) {
startAllEsmeAccounts();
}
}

function startAllEsmeAccounts(){
for (var i = 0; i < allEsmeNames.length; i++) {
mbeanSearch = "org.mobicents.smpp:layer=EsmeManagement,name=SmppManagement";
jolokia.execute(mbeanSearch, 'startEsme', allEsmeNames[i],
{
success: function (value) {

},
error: function (value) {
errorUID = ("st" + new Date().getTime()).hashCode();
createStackTrace(errorUID, value.stacktrace);
}
});
}
updateEsmes();
logToConsole('INFO', 'Successfully started all Esme accounts');
}

function confirmStopAllEsmeAccounts() {
if (confirm("Do you want to stop all ESME accounts?")) {
stopAllEsmeAccounts();
}
}

function stopAllEsmeAccounts(){
for (var i = 0; i < allEsmeNames.length; i++) {
mbeanSearch = "org.mobicents.smpp:layer=EsmeManagement,name=SmppManagement";
jolokia.execute(mbeanSearch, 'stopEsme', allEsmeNames[i],
{
success: function (value) {

},
error: function (value) {
errorUID = ("st" + new Date().getTime()).hashCode();
createStackTrace(errorUID, value.stacktrace);
}
});
}
updateEsmes();
logToConsole('INFO', 'Successfully stopped all Esme accounts');
}

function onModifyEsmeOk(mbeanName, propertyName, spanId){
var skipCheck = false;
onModifyEsmeOk(mbeanName, propertyName, spanId, skipCheck)
Expand Down