This commit is contained in:
2020-06-18 17:40:41 +00:00
parent d218c6cd3c
commit 04d5fd47b7
3 changed files with 27 additions and 27 deletions

View File

@@ -7,7 +7,7 @@
/*global $, app */
app.ravLicenses = (function() {
app.ravLicenses = (function () {
"use strict";
//---------------- BEGIN MODULE SCOPE VARIABLES --------------
var stateMap = {},
@@ -26,16 +26,16 @@ app.ravLicenses = (function() {
//------------------- BEGIN PUBLIC METHODS -------------------
//CONFIGMODULE
//
configModule = function(context) {
configModule = function (context) {
stateMap.context = context.context;
if (stateMap.context.params.id) {
stateMap.id = stateMap.context.params.id;//siteid
stateMap.id = stateMap.context.params.id; //siteid
}
};
//INITMODULE
//
initModule = function($container) {
initModule = function ($container) {
if (typeof $container === "undefined") {
$container = $("#app-shell-main-content");
}
@@ -46,28 +46,29 @@ app.ravLicenses = (function() {
//===================
//Get licenses
app.api.get("rvl/list/"+ stateMap.id, function(res) {
app.api.get("rvl/list/" + stateMap.id, function (res) {
if (res.error) {
$.gevent.publish("app-show-error", res.msg);
} else {
var $appList = $("#rf-list");
$appList.append('<ul class="list-group">');
$.each(res, function(i, obj) {
$appList.append(
"<li class='list-group-item'><a href=\"#!/ravLicense/" +
obj.id +
'">' +
app.utilB.genListColumn(obj.regto) +
"&nbsp;&nbsp;" +
app.utilB.genListColumn(
app.utilB.epochToShortDate(obj.dtCreated)
) +
"</a></li>"
);
$appList.append("<ul >");
let first = true;
$.each(res, function (i, obj) {
let itemClass = "alert alert-success";
if (!first) {
itemClass = "alert alert-secondary";
}
$appList.append(
"<li class='my-5'>" +
"<div class='" +
itemClass +
"' role='alert'><pre>" +
obj.key +
"</pre></div>" +
"</li>"
);
first = false;
});
$appList.append("</ul>");
@@ -75,7 +76,8 @@ app.ravLicenses = (function() {
});
//=========/licenses==============
app.nav.contextClear();
app.nav.contextClear(); ///ravLicense/122
app.nav.contextAddLink("ravLicense/" + stateMap.id, "New", "plus");
};
//PUBLIC METHODS