isite 2024.6.4 → 2024.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/apps/client-side/site_files/css/bootstrap5-addon.css +5 -1
- package/apps/client-side/site_files/html/directive/i-list.html +1 -1
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +1 -1
- package/apps/client-side/site_files/js/first.js +32 -2
- package/lib/mongodb.js +3 -3
- package/lib/parser.js +0 -1
- package/lib/session.js +1 -43
- package/lib/sessions.js +36 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1133,11 +1133,11 @@ site.onGET('/files/file1.zip', (req, res) => {
|
|
|
1133
1133
|
- Cahnge Site Language
|
|
1134
1134
|
|
|
1135
1135
|
```js
|
|
1136
|
-
$scope.changeLang = function (lang) {
|
|
1136
|
+
$scope.changeLang = function (lang= 'EN' , langDir = 'ltr') {
|
|
1137
1137
|
$http({
|
|
1138
1138
|
method: 'POST',
|
|
1139
1139
|
url: '/x-language/change',
|
|
1140
|
-
data: { name: lang },
|
|
1140
|
+
data: { name: lang , dir : langDir },
|
|
1141
1141
|
}).then(function (response) {
|
|
1142
1142
|
if (response.data.done) {
|
|
1143
1143
|
window.location.reload(!0);
|
|
@@ -100,6 +100,7 @@ i-radio {
|
|
|
100
100
|
|
|
101
101
|
i-button {
|
|
102
102
|
display: contents;
|
|
103
|
+
margin-top: 20px;
|
|
103
104
|
}
|
|
104
105
|
i-button button {
|
|
105
106
|
margin: 5px !important;
|
|
@@ -126,6 +127,9 @@ i-file i-button {
|
|
|
126
127
|
max-width: 100px;
|
|
127
128
|
}
|
|
128
129
|
i-upload {
|
|
130
|
+
display: contents;
|
|
131
|
+
}
|
|
132
|
+
i-upload form{
|
|
129
133
|
display: inline-block;
|
|
130
134
|
}
|
|
131
135
|
i-date .left-10,
|
|
@@ -159,7 +163,7 @@ i-datetime input {
|
|
|
159
163
|
max-height: 100vh;
|
|
160
164
|
}
|
|
161
165
|
.modal-content:has(i-list) {
|
|
162
|
-
min-height:
|
|
166
|
+
min-height: 50px;
|
|
163
167
|
}
|
|
164
168
|
.full .modal-content {
|
|
165
169
|
width: 95vw;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<input class="full-width search form-control" />
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
|
-
<div class="dropdown-item row" ng-repeat="item in items | filter
|
|
12
|
+
<div class="dropdown-item row" ng-repeat="item in items | filter:$filter" ng-click="updateModel(item)">
|
|
13
13
|
<p>{{getValue(item)}} <small ng-show="display2"> {{getValue2(item)}} </small></p>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
@@ -1,4 +1,34 @@
|
|
|
1
|
+
window.SOCIALBROWSERIntegration = function () {
|
|
2
|
+
try {
|
|
3
|
+
let update = false;
|
|
4
|
+
if (window.SOCIALBROWSER && SOCIALBROWSER.var && SOCIALBROWSER.var.blocking && SOCIALBROWSER.var.blocking.popup && SOCIALBROWSER.var.blocking.white_list && document.location.hostname) {
|
|
5
|
+
if (!SOCIALBROWSER.var.blocking.white_list.some((w) => w.url.contains(document.location.hostname))) {
|
|
6
|
+
SOCIALBROWSER.var.blocking.white_list.push({
|
|
7
|
+
url: '*' + document.location.hostname + '*',
|
|
8
|
+
});
|
|
9
|
+
update = true;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (!SOCIALBROWSER.var.blocking.popup.white_list.some((w) => w.url.contains(document.location.hostname))) {
|
|
13
|
+
SOCIALBROWSER.var.blocking.popup.white_list.push({
|
|
14
|
+
url: '*' + document.location.hostname + '*',
|
|
15
|
+
});
|
|
16
|
+
update = true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (update && SOCIALBROWSER.ipc) {
|
|
20
|
+
SOCIALBROWSER.ipc('[update-browser-var]', {
|
|
21
|
+
name: 'blocking',
|
|
22
|
+
data: SOCIALBROWSER.var.blocking,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.log(error);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
1
31
|
if (typeof module === 'object') {
|
|
2
|
-
|
|
3
|
-
|
|
32
|
+
window.module = module;
|
|
33
|
+
module = undefined;
|
|
4
34
|
}
|
package/lib/mongodb.js
CHANGED
|
@@ -556,9 +556,9 @@ module.exports = function init(____0) {
|
|
|
556
556
|
____0.call('mongodb after update many', {
|
|
557
557
|
db: obj.dbName,
|
|
558
558
|
collection: obj.collectionName,
|
|
559
|
-
exists: result.result
|
|
560
|
-
count: result.result
|
|
561
|
-
ok: result.result
|
|
559
|
+
exists: result.result?.n,
|
|
560
|
+
count: result.result?.nModified,
|
|
561
|
+
ok: result.result?.ok,
|
|
562
562
|
where: obj.where,
|
|
563
563
|
update: $update,
|
|
564
564
|
});
|
package/lib/parser.js
CHANGED
|
@@ -267,7 +267,6 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
267
267
|
requestesCount: req.session.requestesCount,
|
|
268
268
|
busy: req.session.$busy,
|
|
269
269
|
ip: req.session.ip,
|
|
270
|
-
ipLookup: req.session.ip_list.find((info) => info.ip == req.session.ip),
|
|
271
270
|
});
|
|
272
271
|
}
|
|
273
272
|
if (v == 'lang') {
|
package/lib/session.js
CHANGED
|
@@ -132,48 +132,7 @@ module.exports = function init(req, res, ____0, callback) {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
if (session.$busy || !____0.options.ipLookup || session.ip == '127.0.0.1') {
|
|
137
|
-
return session;
|
|
138
|
-
}
|
|
139
|
-
session.$busy = !0;
|
|
140
|
-
if (session.ip_list.length === 0 || !session.ip_list.some((info) => info.ip === session.ip)) {
|
|
141
|
-
____0
|
|
142
|
-
.fetch(`http://ip-api.com/json/${session.ip}`, {
|
|
143
|
-
method: 'get',
|
|
144
|
-
headers: { 'Content-Type': 'application/json' },
|
|
145
|
-
})
|
|
146
|
-
.then((res) => {
|
|
147
|
-
if (res.status == 200) {
|
|
148
|
-
return res.json();
|
|
149
|
-
} else {
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
.then((info) => {
|
|
153
|
-
____0.getSession(session, (session) => {
|
|
154
|
-
info.date = new Date();
|
|
155
|
-
info.ip = session.ip;
|
|
156
|
-
session.ip_list.unshift(info);
|
|
157
|
-
session.$busy = !1;
|
|
158
|
-
____0.saveSession(session);
|
|
159
|
-
});
|
|
160
|
-
})
|
|
161
|
-
.catch((err) => {
|
|
162
|
-
setTimeout(() => {
|
|
163
|
-
____0.getSession(session, (session) => {
|
|
164
|
-
session.$busy = !1;
|
|
165
|
-
____0.saveSession(session);
|
|
166
|
-
});
|
|
167
|
-
}, 1000 * 30);
|
|
168
|
-
});
|
|
169
|
-
} else {
|
|
170
|
-
____0.getSession(session, (session) => {
|
|
171
|
-
session.$busy = !1;
|
|
172
|
-
____0.saveSession(session);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
135
|
+
|
|
177
136
|
AssignFeatures();
|
|
178
137
|
|
|
179
138
|
if (____0.security && session.user_id) {
|
|
@@ -189,7 +148,6 @@ module.exports = function init(req, res, ____0, callback) {
|
|
|
189
148
|
}
|
|
190
149
|
____0.saveSession(session);
|
|
191
150
|
callback(session);
|
|
192
|
-
ipInfo(session);
|
|
193
151
|
}
|
|
194
152
|
}
|
|
195
153
|
);
|
package/lib/sessions.js
CHANGED
|
@@ -98,41 +98,43 @@ module.exports = function init(____0) {
|
|
|
98
98
|
session.$exists = !1;
|
|
99
99
|
|
|
100
100
|
if (session.accessToken) {
|
|
101
|
-
let index = sessions.list.findIndex(s=> s && s.accessToken && s.accessToken === session.accessToken);
|
|
102
|
-
if(index > -1){
|
|
101
|
+
let index = sessions.list.findIndex((s) => s && s.accessToken && s.accessToken === session.accessToken);
|
|
102
|
+
if (index > -1) {
|
|
103
103
|
sessions.list[index].requestesCount++;
|
|
104
104
|
session.$exists = !0;
|
|
105
105
|
session.$index = index;
|
|
106
106
|
callback(sessions.list[index]);
|
|
107
|
-
}else {
|
|
107
|
+
} else {
|
|
108
108
|
if (____0.options.session.storage === 'mongodb') {
|
|
109
|
-
sessions.$collection.find(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
109
|
+
sessions.$collection.find(
|
|
110
|
+
{ accessToken: session.accessToken },
|
|
111
|
+
(err, doc) => {
|
|
112
|
+
if (!err && doc) {
|
|
113
|
+
session.$exists = !0;
|
|
114
|
+
session = { ...session, ...doc };
|
|
115
|
+
session.requestesCount++;
|
|
116
|
+
session.$index = sessions.list.length;
|
|
117
|
+
sessions.list.push(session);
|
|
118
|
+
callback(sessions.list[session.$index]);
|
|
119
|
+
} else {
|
|
120
|
+
session.$new = !0;
|
|
121
|
+
session.lang = ____0.options.lang;
|
|
122
|
+
session.theme = ____0.options.theme;
|
|
123
|
+
session.data = [];
|
|
124
|
+
session.requestesCount = 1;
|
|
125
|
+
session.createdTime = new Date().getTime();
|
|
126
|
+
session.$index = sessions.list.length;
|
|
127
|
+
sessions.list.push(session);
|
|
128
|
+
callback(sessions.list[session.$index]);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
true
|
|
132
|
+
);
|
|
130
133
|
} else {
|
|
131
134
|
session.$new = !0;
|
|
132
135
|
session.lang = ____0.options.lang;
|
|
133
136
|
session.theme = ____0.options.theme;
|
|
134
137
|
session.data = [];
|
|
135
|
-
session.ip_list = session.ip_list || [];
|
|
136
138
|
session.requestesCount = 1;
|
|
137
139
|
session.createdTime = new Date().getTime();
|
|
138
140
|
session.$index = sessions.list.length;
|
|
@@ -145,7 +147,6 @@ module.exports = function init(____0) {
|
|
|
145
147
|
session.lang = ____0.options.lang;
|
|
146
148
|
session.theme = ____0.options.theme;
|
|
147
149
|
session.data = [];
|
|
148
|
-
session.ip_list = session.ip_list || [];
|
|
149
150
|
session.requestesCount = 1;
|
|
150
151
|
session.createdTime = new Date().getTime();
|
|
151
152
|
session.$index = sessions.list.length;
|
|
@@ -224,6 +225,15 @@ module.exports = function init(____0) {
|
|
|
224
225
|
|
|
225
226
|
____0.onPOST({ name: '/x-language/change', public: true }, (req, res) => {
|
|
226
227
|
req.session.lang = req.data.name;
|
|
228
|
+
req.session.langDir = req.data.dir;
|
|
229
|
+
if (!req.session.langDir) {
|
|
230
|
+
if (req.session.lang.contains('ar')) {
|
|
231
|
+
req.session.langDir = 'rtl';
|
|
232
|
+
} else {
|
|
233
|
+
req.session.langDir = 'ltr';
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
227
237
|
____0.saveSession(req.session);
|
|
228
238
|
res.json({
|
|
229
239
|
done: true,
|