all changes are committed
This commit is contained in:
+8
-5
@@ -1,10 +1,13 @@
|
||||
import {decrypt} from "./cookiehelper.js";
|
||||
import {decrypt, isAuthenticated} from "./cookiehelper.js";
|
||||
import {_serverUrl} from "./setting.js";
|
||||
|
||||
let serverUrl = _serverUrl();
|
||||
let baseUserInfo = decrypt(document.cookie.split("=")[1]);
|
||||
let baseSessionId = baseUserInfo.sessionId;
|
||||
|
||||
let baseSessionId, baseUserInfo;
|
||||
if (isAuthenticated()) {
|
||||
baseUserInfo = decrypt(document.cookie.split("=")[1]);
|
||||
baseSessionId = baseUserInfo.sessionId;
|
||||
} else {
|
||||
window.location = "../login";
|
||||
}
|
||||
export function getData(url) {
|
||||
var datastr = null;
|
||||
var method = "GET";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const cryptoProvider = window["CryptoJS"];
|
||||
const cryptoAlgorithm = window["CryptoJS"].AES;
|
||||
const _secretKey = "unibase";
|
||||
|
||||
export function encrypt(content) {
|
||||
return cryptoAlgorithm.encrypt(content, _secretKey).toString();
|
||||
}
|
||||
|
||||
+6
-3
@@ -1,4 +1,7 @@
|
||||
import {getCookie} from "./cookiehelper.js";
|
||||
import {getCookie, isAuthenticated} from "./cookiehelper.js";
|
||||
import {initListIndex} from "./list.index.js";
|
||||
|
||||
initListIndex();
|
||||
if (isAuthenticated()) {
|
||||
initListIndex();
|
||||
} else {
|
||||
window.location = "../login";
|
||||
}
|
||||
|
||||
+140
-32
@@ -1,8 +1,8 @@
|
||||
/*Data loading start here*/
|
||||
import {getCookie} from "./cookiehelper.js";
|
||||
|
||||
import {getCookie, isAuthenticated} from "./cookiehelper.js";
|
||||
import {getData, getDataObj} from "./base.js";
|
||||
import {_serverUrl} from "./setting.js";
|
||||
export var connection;
|
||||
|
||||
function createLoad(data) {
|
||||
let html = "";
|
||||
@@ -35,7 +35,7 @@ function createLoad(data) {
|
||||
<div class="frm-ifre frm-ifre-${number}" id="frm-ifre-${number}" style="right:${width}px">
|
||||
<div>
|
||||
<ul class="m-0 p-0">
|
||||
<li class="frm-hdr">
|
||||
<li class="frm-hdr d-none">
|
||||
<div class="app-title-ifrm">${appName}</div>
|
||||
<div class="ctrl">
|
||||
<a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
|
||||
@@ -45,6 +45,12 @@ function createLoad(data) {
|
||||
</div>
|
||||
</li>
|
||||
<li class="frm-bdy">
|
||||
<div class="ctrl-vrtl">
|
||||
<a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
|
||||
<a href="javascript:;" class="maximum" data-unid="${number}"><span><i class="la la-expand"></i></span></a>
|
||||
<a href="javascript:;" class="compress d-none" data-unid="${number}"><span><i class="las la-compress"></i></span></a>
|
||||
<a href="javascript:;" class="close" data-unid="${number}"><span><i class="la la-times"></i></span></a>
|
||||
</div>
|
||||
<iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/${pk_id}/${appConfigurationId}/loadform"></iframe>
|
||||
</li>
|
||||
<li class="frm-ftr"></li>
|
||||
@@ -53,7 +59,7 @@ function createLoad(data) {
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
$("#list-page").append(fomrhtml);
|
||||
$("#list-page").parent("body").append(fomrhtml);
|
||||
window.window.postMessage("ld-frm-ifrme", "*");
|
||||
hdrCrtnClckEvnt(number);
|
||||
});
|
||||
@@ -65,11 +71,13 @@ function hdrCrtnClckEvnt(number) {
|
||||
let isPopUpState = $(this).attr("data-ispopup");
|
||||
let height = $(`.frm-ifre-${id}`).find(".frm-hdr").height();
|
||||
$(".list-page").css({filter: "unset", opacity: 1});
|
||||
$(`.frm-ifre-${id} .frm-hdr`).toggleClass("d-none");
|
||||
$(`.frm-ifre-${id} .frm-bdy`).toggleClass("d-none");
|
||||
if (isPopUpState == "true") {
|
||||
// popup large
|
||||
$(this).attr("data-ispopup", "false");
|
||||
$(`.frm-ifre-${id} .maximum`).addClass("d-none");
|
||||
$(`.frm-ifre-${id} .minimize`).attr("data-ispopup", "false");
|
||||
$(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
|
||||
$(`.frm-ifre-${id}`).attr("data-ispop_up", "false");
|
||||
$(`.frm-ifre-${id}`).css({
|
||||
@@ -81,6 +89,7 @@ function hdrCrtnClckEvnt(number) {
|
||||
// popup small
|
||||
$(this).attr("data-ispopup", "true");
|
||||
$(`.frm-ifre-${id} .maximum`).removeClass("d-none");
|
||||
$(`.frm-ifre-${id} .minimize`).attr("data-ispopup", "true");
|
||||
$(`.frm-ifre-${id}`).attr("data-ispop_up", "true");
|
||||
$(`.frm-ifre-${id}`).css({
|
||||
width: "",
|
||||
@@ -120,6 +129,26 @@ function hdrCrtnClckEvnt(number) {
|
||||
});
|
||||
}
|
||||
function loadData() {
|
||||
$(".bdy-ul").empty();
|
||||
$('[class="refrsh"]')
|
||||
.unbind()
|
||||
.on("click", function () {
|
||||
loadData();
|
||||
});
|
||||
$('[data-clck="ri-grid-fill"]').on("click", function () {
|
||||
$(".apps-list").toggleClass("d-flex");
|
||||
});
|
||||
getData("apis/v4/unibase/platform/apps/myapps").then(function (response) {
|
||||
let result = JSON.parse(response.result);
|
||||
let html = "";
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
html += `<li class="appsBind" data-myappid="${result[i].MyAppId}"><img src="../imgs/${result[i].ImageUrl}" ><span class="appTitle">${result[i].AppTitle}</span></li>`;
|
||||
}
|
||||
$("#apps-list").html(html);
|
||||
$("li.appsBind").on("click", function () {
|
||||
$(".apps-list").removeClass("d-flex");
|
||||
});
|
||||
});
|
||||
getData(
|
||||
"apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/6/PageSize/20"
|
||||
).then(function (result) {
|
||||
@@ -132,17 +161,15 @@ function loadData() {
|
||||
<div class="accordion-header" id="accHeader-${response[i].ReminderId}">
|
||||
<div class="notifiListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${response[i].ReminderId}" aria-expanded="false" aria-controls="collapseOne">
|
||||
<div class="row m-0 w-100 p-0 ">
|
||||
<div class="col-1 ">
|
||||
<input class="form-check-input mx-1" type="checkbox" value="" id="flexCheckDefault">
|
||||
<div class="col-3 px-0 d-flex flex-row text-truncate">
|
||||
<input class="form-check-input mr-2" type="checkbox" value="" id="flexCheckDefault">
|
||||
<div class="mx-3 w-75 text-truncate">
|
||||
<span class="mx-1">${response[i].Subject}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-truncate">
|
||||
<span class="mx-1">${response[i].Subject}</span>
|
||||
</div>
|
||||
<div class="col-5 text-truncate">
|
||||
<span class="mx-1">${response[i].Message}</span>
|
||||
</div>
|
||||
<div class="col-2 text-truncate">
|
||||
<span class="mx-1">22 minutes ago</span>
|
||||
<div class="col-9 text-truncate d-flex justify-content-between">
|
||||
<span class="mx-1 w-mes">${response[i].Message}</span>
|
||||
<span class="mx-1 t-sec-min">22 mins</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,7 +183,12 @@ function loadData() {
|
||||
}
|
||||
bdyUI += "</div>";
|
||||
$(".bdy-ul").append(bdyUI);
|
||||
|
||||
$('.sub-nav-item[data-buttonType="inbox"] .length').remove();
|
||||
$('.sub-nav-item[data-buttonType="inbox"]').append(
|
||||
`<span class="length badge rounded-pill bg-light text-dark ml-auto">${
|
||||
$(".item-li").length
|
||||
}</span>`
|
||||
);
|
||||
$(".notifiListItms").on("click", function () {
|
||||
let _this = $(this).parents(".item-li");
|
||||
let obj = {
|
||||
@@ -236,17 +268,15 @@ function loadData() {
|
||||
<div class="accordion-header" id="accHeader-${response[i].ReminderId}">
|
||||
<div class="tskListItms accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-${response[i].ReminderId}" aria-expanded="false" aria-controls="collapseOne">
|
||||
<div class="row m-0 w-100 p-0 ">
|
||||
<div class="col-1 ">
|
||||
<input class="form-check-input mx-1" type="checkbox" value="" id="flexCheckDefault">
|
||||
<div class="col-3 px-0 d-flex flex-row text-truncate">
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
|
||||
<div class="mx-3 w-75 text-truncat">
|
||||
<span class="mx-1">${response[i].Subject}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-truncate">
|
||||
<span class="mx-1">${response[i].Subject}</span>
|
||||
</div>
|
||||
<div class="col-5 text-truncate">
|
||||
<span class="mx-1">${response[i].Message}</span>
|
||||
</div>
|
||||
<div class="col-2 text-truncate">
|
||||
<span class="mx-1">2 seconds</span>
|
||||
<div class="col-9 text-truncate d-flex justify-content-between">
|
||||
<span class="mx-1 w-mes">${response[i].Message}</span>
|
||||
<span class="mx-1 t-sec-min">22 mins</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -303,10 +333,24 @@ function loadData() {
|
||||
await createLoad(appName);
|
||||
});
|
||||
});
|
||||
|
||||
getData("apis/v4/unibase/reminders/platform/getunreadreminderscount").then(
|
||||
function (response) {
|
||||
let result = JSON.parse(response.result);
|
||||
let count = Number(result.NotificationCount) + Number(result.TasksCount);
|
||||
$('[data-buttontype="inbox"] .length').text(count);
|
||||
$('[data-notification="count"]').text(count);
|
||||
if (count > 40) {
|
||||
$('[data-paggtn="true"]').text(`1-40 of ${count}`);
|
||||
} else {
|
||||
$(".li-pgn").empty();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
function iFrmeWdth() {
|
||||
let width = 0,
|
||||
erwdth = 20;
|
||||
erwdth = 32;
|
||||
$(".frm-ifre").each(function (i, e) {
|
||||
if ($(this).length == 0) {
|
||||
erwdth = 0;
|
||||
@@ -319,7 +363,7 @@ function iFrmeWdth() {
|
||||
}
|
||||
function resetwidth() {
|
||||
let width = 0,
|
||||
erwdth = 20;
|
||||
erwdth = 32;
|
||||
$(".frm-ifre").each(function (i, e) {
|
||||
if (i == 0) {
|
||||
$(this).css("right", width + "px");
|
||||
@@ -342,7 +386,6 @@ export function detailClick() {
|
||||
const cookie = getCookie("_idty");
|
||||
if (cookie) {
|
||||
const {unibaseId, tenantId, userId} = JSON.parse(cookie);
|
||||
debugger;
|
||||
$("#detailIframe").html(
|
||||
`<iframe width="100%" style="min-height:calc(100vh - ${$(
|
||||
".tp-bar"
|
||||
@@ -351,22 +394,82 @@ export function detailClick() {
|
||||
}
|
||||
});
|
||||
}
|
||||
export function signaRInit() {
|
||||
var huburl = _serverUrl() + "notificationhub";
|
||||
connection = new window["signalR"].HubConnectionBuilder()
|
||||
.withUrl(huburl)
|
||||
.build();
|
||||
register();
|
||||
}
|
||||
export async function register() {
|
||||
connection.on("sendnotification", (obj) => {
|
||||
$(".ctr-lst-pge .bdy-ul").empty();
|
||||
loadData();
|
||||
});
|
||||
const cookie = getCookie("_idty");
|
||||
const {unibaseId, tenantId, userId, sessionId, name} = JSON.parse(cookie);
|
||||
let packet = {
|
||||
UserId: Number(userId),
|
||||
UserName: name,
|
||||
UnibaseId: unibaseId,
|
||||
TenantId: Number(tenantId),
|
||||
SessionId: sessionId,
|
||||
};
|
||||
try {
|
||||
const stringConnection = await connection.start();
|
||||
await connection.invoke("Connect", packet);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
export function resetClckEvnt() {
|
||||
$(".ChtAppIfrme").remove();
|
||||
$(".lft-nav-bar .lft-nav-bar-2").removeClass("d-none");
|
||||
$(".ctr-lst-pge, .rtr-nav-bar").removeClass("d-none");
|
||||
$(".lft-nav-bar").css("width", "");
|
||||
}
|
||||
|
||||
export function initListIndex() {
|
||||
let _userInfo = atob(document.cookie.split("=")[1]);
|
||||
let userInfo = " JSON.parse(_userInfo).result";
|
||||
let sessionId = "userInfo.sessionId";
|
||||
|
||||
signaRInit();
|
||||
let usrinfoHTML = `<li><a class="dropdown-item" href="javascript:void(0);">${userInfo.name}</a></li>
|
||||
<li><a class="dropdown-item" href="javascript:void(0);">Cloud Settings</a></li>
|
||||
<li><a class="dropdown-item" href="javascript:void(0);">Help</a></li>
|
||||
<li><a class="dropdown-item" href="javascript:void(0);">Logoff</a></li>`;
|
||||
<li><a class="dropdown-item" href="javascript:void(0);" data-btn="logoff">Logoff</a></li>`;
|
||||
$(".icn-circle").text(userInfo?.name?.charAt(0)?.toUpperCase());
|
||||
$(".uindtls").html(usrinfoHTML);
|
||||
|
||||
$('[data-btn="logoff"]').on("click", function () {
|
||||
document.cookie = "_idty=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
||||
window.location = "../login";
|
||||
});
|
||||
// List Page loading
|
||||
|
||||
/*Data loading start here*/
|
||||
$(".nav-lft-item").on("click", function () {
|
||||
$(".nav-lft-item").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
if ($(this).attr("data-application") != "Chat Application") {
|
||||
resetClckEvnt();
|
||||
}
|
||||
});
|
||||
$(".nav-lft-item[data-application='Chat Application']").on(
|
||||
"click",
|
||||
function () {
|
||||
const serverUrl = _serverUrl();
|
||||
const cookie = getCookie("_idty");
|
||||
const {unibaseId, tenantId, userId} = JSON.parse(cookie);
|
||||
$(".lft-nav-bar .lft-nav-bar-2").addClass("d-none");
|
||||
$(".ctr-lst-pge, .rtr-nav-bar").addClass("d-none");
|
||||
$(".lft-nav-bar").css("width", "var(--rtrWidth)");
|
||||
$(".btm-bar .ChtAppIfrme").remove();
|
||||
$(".btm-bar").append(`<div class="ChtAppIfrme w-100">
|
||||
<iframe class="" style="height:100%; width:100%" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/loadChat"></iframe>
|
||||
</div>`);
|
||||
}
|
||||
);
|
||||
$(".mnNvIcn").click(function () {
|
||||
$(".lft-nav-bar").toggleClass("lft-nav-bar-Wrap");
|
||||
$(".ctr-lst-pge").toggleClass("lft-nav-bar-Wrap");
|
||||
@@ -388,5 +491,10 @@ export function initListIndex() {
|
||||
$(".sub-nav-item").not(".more.active").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
loadData();
|
||||
|
||||
try {
|
||||
loadData();
|
||||
} catch (error) {
|
||||
console.log("LoadData Method is not loading, and getting error");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ export function _serverUrl() {
|
||||
// sachin 2.0 commitw
|
||||
// sudheer 1.0 new branch
|
||||
// merge request another time
|
||||
return "http://localhost:3088/";
|
||||
//return "http://localhost:3088/";
|
||||
//return "http://localhost:3086/";
|
||||
//return "https://c01.bizgaze.app/";
|
||||
//return "http://192.168.88.99:4001/";
|
||||
return "https://c02.bizgaze.app/";
|
||||
//return "https://dev.bizgaze.app/";
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user