isite 2023.1.7 → 2023.1.10
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/apps/charts/app.js +1 -1
- package/apps/charts/site_files/html/index.html +1 -1
- package/apps/charts/site_files/js/chart-animated.js +1 -20
- package/apps/charts/site_files/js/charts.js +1 -1
- package/apps/charts/site_files/js/custom.js +151 -153
- package/apps/client-side/app.js +0 -1
- package/apps/client-side/site_files/css/bootstrap5-addon.css +18 -6
- package/apps/client-side/site_files/css/dropdown.css +0 -3
- package/apps/client-side/site_files/css/effect.css +5 -0
- package/apps/client-side/site_files/css/layout.css +2 -6
- package/apps/client-side/site_files/css/print.css +1 -0
- package/apps/client-side/site_files/html/directive/i-date-old.html +24 -0
- package/apps/client-side/site_files/html/directive/i-date.html +19 -15
- package/apps/client-side/site_files/html/directive/i-datetime.html +11 -22
- package/apps/client-side/site_files/js/angular.min.js +0 -1
- package/apps/client-side/site_files/js/base64.min.js +1 -0
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +72 -108
- package/apps/client-side/site_files/js/site.js +10 -2
- package/index.js +1 -0
- package/lib/mongodb.js +10 -5
- package/lib/parser.js +32 -2
- package/lib/security.js +9 -5
- package/object-options/index.js +48 -5
- package/package.json +1 -1
|
@@ -263,7 +263,7 @@ app.directive('iButton', function () {
|
|
|
263
263
|
$scope.fa = 'fas fa-sign-out-alt';
|
|
264
264
|
$scope.class = 'btn-light';
|
|
265
265
|
} else if ($scope.type.like('*push*')) {
|
|
266
|
-
$scope.fa = 'fas fa-
|
|
266
|
+
$scope.fa = 'fas fa-plus-circle';
|
|
267
267
|
$scope.class = 'btn-primary';
|
|
268
268
|
} else if ($scope.type.like('*cancel*')) {
|
|
269
269
|
$scope.fa = 'fas fa-minus-circle';
|
|
@@ -586,45 +586,34 @@ app.directive('iDate', function () {
|
|
|
586
586
|
restrict: 'E',
|
|
587
587
|
required: 'ngModel',
|
|
588
588
|
scope: {
|
|
589
|
+
v: '@',
|
|
590
|
+
id2: '@',
|
|
589
591
|
label: '@',
|
|
590
|
-
|
|
591
|
-
|
|
592
|
+
type: '@',
|
|
593
|
+
class2: '@',
|
|
594
|
+
disabled: '@',
|
|
592
595
|
ngModel: '=',
|
|
593
596
|
ngChange: '&',
|
|
597
|
+
ngKeydown: '&',
|
|
594
598
|
},
|
|
595
599
|
link: function ($scope, element, attrs) {
|
|
600
|
+
$scope.id2 = $scope.id2 || 'input_' + Math.random().toString().replace('0.', '');
|
|
601
|
+
$scope.v = $scope.v || '';
|
|
602
|
+
$scope.requird = '';
|
|
603
|
+
if ($scope.v.like('*r*')) {
|
|
604
|
+
$scope.requird = '*';
|
|
605
|
+
}
|
|
596
606
|
if (typeof attrs.disabled !== 'undefined') {
|
|
597
607
|
attrs.disabled = 'disabled';
|
|
598
608
|
} else {
|
|
599
609
|
attrs.disabled = '';
|
|
600
610
|
}
|
|
601
|
-
$scope.
|
|
611
|
+
$scope.class2 = $scope.class2 || '';
|
|
602
612
|
|
|
603
613
|
$scope.model = {};
|
|
604
614
|
|
|
605
|
-
$scope.days = [];
|
|
606
|
-
for (let i = 1; i < 32; i++) {
|
|
607
|
-
$scope.days.push({
|
|
608
|
-
id: i,
|
|
609
|
-
name: i,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
$scope.years = [];
|
|
613
|
-
for (let i = $scope.year; i < 2100; i++) {
|
|
614
|
-
$scope.years.push({
|
|
615
|
-
id: i,
|
|
616
|
-
name: i,
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
$scope.dayTitle = 'Day';
|
|
620
|
-
$scope.monthTitle = 'Month';
|
|
621
|
-
$scope.yearTitle = 'Year';
|
|
622
|
-
|
|
623
615
|
$scope.lang = site.session ? site.session.lang : 'en';
|
|
624
616
|
if ($scope.lang === 'ar') {
|
|
625
|
-
$scope.dayTitle = 'يوم';
|
|
626
|
-
$scope.monthTitle = 'شهر';
|
|
627
|
-
$scope.yearTitle = 'سنة';
|
|
628
617
|
$scope.monthes = [
|
|
629
618
|
{ id: 0, name: 'يناير' },
|
|
630
619
|
{ id: 1, name: 'فبراير' },
|
|
@@ -641,18 +630,18 @@ app.directive('iDate', function () {
|
|
|
641
630
|
];
|
|
642
631
|
} else {
|
|
643
632
|
$scope.monthes = [
|
|
644
|
-
{ id: 0, name: '
|
|
645
|
-
{ id: 1, name: '
|
|
646
|
-
{ id: 2, name: '
|
|
647
|
-
{ id: 3, name: '
|
|
633
|
+
{ id: 0, name: 'January' },
|
|
634
|
+
{ id: 1, name: 'February' },
|
|
635
|
+
{ id: 2, name: 'March' },
|
|
636
|
+
{ id: 3, name: 'April' },
|
|
648
637
|
{ id: 4, name: 'May' },
|
|
649
|
-
{ id: 5, name: '
|
|
650
|
-
{ id: 6, name: '
|
|
651
|
-
{ id: 7, name: '
|
|
652
|
-
{ id: 8, name: '
|
|
653
|
-
{ id: 9, name: '
|
|
654
|
-
{ id: 10, name: '
|
|
655
|
-
{ id: 11, name: '
|
|
638
|
+
{ id: 5, name: 'June' },
|
|
639
|
+
{ id: 6, name: 'July' },
|
|
640
|
+
{ id: 7, name: 'August' },
|
|
641
|
+
{ id: 8, name: 'September' },
|
|
642
|
+
{ id: 9, name: 'October' },
|
|
643
|
+
{ id: 10, name: 'November' },
|
|
644
|
+
{ id: 11, name: 'December' },
|
|
656
645
|
];
|
|
657
646
|
}
|
|
658
647
|
|
|
@@ -660,16 +649,17 @@ app.directive('iDate', function () {
|
|
|
660
649
|
if (ngModel) {
|
|
661
650
|
ngModel = new Date(ngModel);
|
|
662
651
|
$scope.model = $scope.model || {};
|
|
663
|
-
$scope.model.selectedDay =
|
|
652
|
+
$scope.model.selectedDay = site.addZero(ngModel.getDate(), 2);
|
|
664
653
|
$scope.model.selectedMonth = $scope.monthes.find((m) => m.id == ngModel.getMonth());
|
|
665
|
-
$scope.model.selectedYear =
|
|
666
|
-
$
|
|
654
|
+
$scope.model.selectedYear = ngModel.getFullYear();
|
|
655
|
+
$(element).attr('value', ngModel.getTime());
|
|
656
|
+
$scope.ngModel1 = new Date(ngModel);
|
|
667
657
|
} else {
|
|
668
658
|
$scope.model = $scope.model || {};
|
|
669
659
|
$scope.model.selectedDay = null;
|
|
670
660
|
$scope.model.selectedMonth = null;
|
|
671
661
|
$scope.model.selectedYear = null;
|
|
672
|
-
$
|
|
662
|
+
$(element).attr('value', '');
|
|
673
663
|
}
|
|
674
664
|
});
|
|
675
665
|
|
|
@@ -677,9 +667,8 @@ app.directive('iDate', function () {
|
|
|
677
667
|
$scope.ngModel = new Date();
|
|
678
668
|
};
|
|
679
669
|
$scope.updateDate = function (date) {
|
|
680
|
-
if ($scope.
|
|
681
|
-
|
|
682
|
-
$scope.ngModel = new Date($scope.model.selectedYear.id, $scope.model.selectedMonth.id, $scope.model.selectedDay.id, now.getHours(), now.getMinutes(), now.getSeconds());
|
|
670
|
+
if ($scope.ngModel1) {
|
|
671
|
+
$scope.ngModel = $scope.ngModel1;
|
|
683
672
|
$scope.editOnly = false;
|
|
684
673
|
if ($scope.ngChange) {
|
|
685
674
|
$scope.ngChange();
|
|
@@ -704,65 +693,34 @@ app.directive('iDatetime', function () {
|
|
|
704
693
|
restrict: 'E',
|
|
705
694
|
required: 'ngModel',
|
|
706
695
|
scope: {
|
|
696
|
+
v: '@',
|
|
697
|
+
id2: '@',
|
|
707
698
|
label: '@',
|
|
708
|
-
|
|
709
|
-
|
|
699
|
+
type: '@',
|
|
700
|
+
class2: '@',
|
|
701
|
+
disabled: '@',
|
|
710
702
|
ngModel: '=',
|
|
711
703
|
ngChange: '&',
|
|
704
|
+
ngKeydown: '&',
|
|
712
705
|
},
|
|
713
706
|
link: function ($scope, element, attrs) {
|
|
707
|
+
$scope.id2 = $scope.id2 || 'input_' + Math.random().toString().replace('0.', '');
|
|
708
|
+
$scope.v = $scope.v || '';
|
|
709
|
+
$scope.requird = '';
|
|
710
|
+
if ($scope.v.like('*r*')) {
|
|
711
|
+
$scope.requird = '*';
|
|
712
|
+
}
|
|
714
713
|
if (typeof attrs.disabled !== 'undefined') {
|
|
715
714
|
attrs.disabled = 'disabled';
|
|
716
715
|
} else {
|
|
717
716
|
attrs.disabled = '';
|
|
718
717
|
}
|
|
719
|
-
$scope.
|
|
718
|
+
$scope.class2 = $scope.class2 || '';
|
|
720
719
|
|
|
721
720
|
$scope.model = {};
|
|
722
721
|
|
|
723
|
-
$scope.hours = [];
|
|
724
|
-
for (let i = 0; i < 24; i++) {
|
|
725
|
-
$scope.hours.push({
|
|
726
|
-
id: i,
|
|
727
|
-
name: i < 10 ? '0' + i : i,
|
|
728
|
-
});
|
|
729
|
-
}
|
|
730
|
-
$scope.minutes = [];
|
|
731
|
-
for (let i = 0; i < 60; i++) {
|
|
732
|
-
$scope.minutes.push({
|
|
733
|
-
id: i,
|
|
734
|
-
name: i < 10 ? '0' + i : i,
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
$scope.days = [];
|
|
739
|
-
for (let i = 1; i < 32; i++) {
|
|
740
|
-
$scope.days.push({
|
|
741
|
-
id: i,
|
|
742
|
-
name: i,
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
$scope.years = [];
|
|
747
|
-
for (let i = $scope.year; i < 2100; i++) {
|
|
748
|
-
$scope.years.push({
|
|
749
|
-
id: i,
|
|
750
|
-
name: i,
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
$scope.dayTitle = 'Day';
|
|
754
|
-
$scope.monthTitle = 'Month';
|
|
755
|
-
$scope.yearTitle = 'Year';
|
|
756
|
-
$scope.hourTitle = 'Hour';
|
|
757
|
-
$scope.minuteTitle = 'Minute';
|
|
758
|
-
|
|
759
722
|
$scope.lang = site.session ? site.session.lang : 'en';
|
|
760
723
|
if ($scope.lang === 'ar') {
|
|
761
|
-
$scope.dayTitle = 'يوم';
|
|
762
|
-
$scope.monthTitle = 'شهر';
|
|
763
|
-
$scope.yearTitle = 'سنة';
|
|
764
|
-
$scope.hourTitle = 'ساعة';
|
|
765
|
-
$scope.minuteTitle = 'دقيقة';
|
|
766
724
|
$scope.monthes = [
|
|
767
725
|
{ id: 0, name: 'يناير' },
|
|
768
726
|
{ id: 1, name: 'فبراير' },
|
|
@@ -779,18 +737,18 @@ app.directive('iDatetime', function () {
|
|
|
779
737
|
];
|
|
780
738
|
} else {
|
|
781
739
|
$scope.monthes = [
|
|
782
|
-
{ id: 0, name: '
|
|
783
|
-
{ id: 1, name: '
|
|
784
|
-
{ id: 2, name: '
|
|
785
|
-
{ id: 3, name: '
|
|
740
|
+
{ id: 0, name: 'January' },
|
|
741
|
+
{ id: 1, name: 'February' },
|
|
742
|
+
{ id: 2, name: 'March' },
|
|
743
|
+
{ id: 3, name: 'April' },
|
|
786
744
|
{ id: 4, name: 'May' },
|
|
787
|
-
{ id: 5, name: '
|
|
788
|
-
{ id: 6, name: '
|
|
789
|
-
{ id: 7, name: '
|
|
790
|
-
{ id: 8, name: '
|
|
791
|
-
{ id: 9, name: '
|
|
792
|
-
{ id: 10, name: '
|
|
793
|
-
{ id: 11, name: '
|
|
745
|
+
{ id: 5, name: 'June' },
|
|
746
|
+
{ id: 6, name: 'July' },
|
|
747
|
+
{ id: 7, name: 'August' },
|
|
748
|
+
{ id: 8, name: 'September' },
|
|
749
|
+
{ id: 9, name: 'October' },
|
|
750
|
+
{ id: 10, name: 'November' },
|
|
751
|
+
{ id: 11, name: 'December' },
|
|
794
752
|
];
|
|
795
753
|
}
|
|
796
754
|
|
|
@@ -798,11 +756,14 @@ app.directive('iDatetime', function () {
|
|
|
798
756
|
if (ngModel) {
|
|
799
757
|
ngModel = new Date(ngModel);
|
|
800
758
|
$scope.model = $scope.model || {};
|
|
801
|
-
$scope.model.selectedDay =
|
|
759
|
+
$scope.model.selectedDay = site.addZero(ngModel.getDate(), 2);
|
|
802
760
|
$scope.model.selectedMonth = $scope.monthes.find((m) => m.id == ngModel.getMonth());
|
|
803
|
-
$scope.model.selectedYear =
|
|
804
|
-
$scope.model.selectedHour =
|
|
805
|
-
$scope.model.selectedMinute =
|
|
761
|
+
$scope.model.selectedYear = ngModel.getFullYear();
|
|
762
|
+
$scope.model.selectedHour = site.addZero(ngModel.getHours(), 2);
|
|
763
|
+
$scope.model.selectedMinute = site.addZero(ngModel.getMinutes(), 2);
|
|
764
|
+
|
|
765
|
+
$scope.ngModel1 = new Date(ngModel);
|
|
766
|
+
$scope.ngModel2 = new Date(0, 0, 0, ngModel.getHours(), ngModel.getMinutes());
|
|
806
767
|
$(element).attr('value', ngModel.getTime());
|
|
807
768
|
} else {
|
|
808
769
|
$scope.model = $scope.model || {};
|
|
@@ -820,8 +781,10 @@ app.directive('iDatetime', function () {
|
|
|
820
781
|
};
|
|
821
782
|
|
|
822
783
|
$scope.updateDate = function (date) {
|
|
823
|
-
|
|
824
|
-
|
|
784
|
+
let time = $('#time_' + $scope.id2).val();
|
|
785
|
+
|
|
786
|
+
if ($scope.ngModel1 && time) {
|
|
787
|
+
$scope.ngModel = new Date($scope.ngModel1.getFullYear(), $scope.ngModel1.getMonth(), $scope.ngModel1.getDate(), time.split(':')[0], time.split(':')[1], 0);
|
|
825
788
|
$scope.editOnly = false;
|
|
826
789
|
$(element).attr('value', $scope.ngModel.getTime());
|
|
827
790
|
if ($scope.ngChange) {
|
|
@@ -1214,10 +1177,11 @@ app.directive('iUpload', [
|
|
|
1214
1177
|
$(progress).show();
|
|
1215
1178
|
progress.value = e.loaded;
|
|
1216
1179
|
progress.max = e.total;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1180
|
+
} else if (data) {
|
|
1181
|
+
if ($scope.onUploaded) {
|
|
1182
|
+
console.log(err, data, e);
|
|
1183
|
+
$scope.onUploaded({ $data: data });
|
|
1184
|
+
}
|
|
1221
1185
|
}
|
|
1222
1186
|
}
|
|
1223
1187
|
);
|
|
@@ -592,11 +592,12 @@
|
|
|
592
592
|
if (tabHeader) {
|
|
593
593
|
let tabs = tabHeader.parentNode;
|
|
594
594
|
if (tabs) {
|
|
595
|
+
console.log(tabs);
|
|
595
596
|
tabs.querySelectorAll('.tab-content').forEach((tabContent) => {
|
|
596
597
|
tabContent.style.display = 'none';
|
|
597
598
|
});
|
|
598
599
|
tabs.querySelectorAll('.tab-link').forEach((tabLink) => {
|
|
599
|
-
if (tabLink.getAttribute('onclick').contains(tabContentSelector + "'")) {
|
|
600
|
+
if (tabLink.getAttribute('onclick') && tabLink.getAttribute('onclick').contains(tabContentSelector + "'")) {
|
|
600
601
|
tabLink.classList.add('active');
|
|
601
602
|
} else {
|
|
602
603
|
tabLink.classList.remove('active');
|
|
@@ -701,7 +702,14 @@
|
|
|
701
702
|
en: 'Data Is Required',
|
|
702
703
|
ar: 'هذا البيان مطلوب',
|
|
703
704
|
});
|
|
704
|
-
} else if (el.nodeName === '
|
|
705
|
+
} else if (el.nodeName === 'I-DATE' && !el.getAttribute('value')) {
|
|
706
|
+
el.classList.add('is-invalid');
|
|
707
|
+
res.ok = !1;
|
|
708
|
+
res.messages.push({
|
|
709
|
+
en: 'Data Is Required',
|
|
710
|
+
ar: 'هذا البيان مطلوب',
|
|
711
|
+
});
|
|
712
|
+
} else if (el.nodeName === 'INPUT' || el.nodeName === 'SELECT' || el.nodeName === 'TEXTAREA' || el.nodeName === 'I-DATETIME'|| el.nodeName === 'I-DATE') {
|
|
705
713
|
el.classList.add('is-valid');
|
|
706
714
|
}
|
|
707
715
|
} else if (vl.like('ml*')) {
|
package/index.js
CHANGED
|
@@ -17,6 +17,7 @@ module.exports = function init(options) {
|
|
|
17
17
|
____0.zlib = require('zlib');
|
|
18
18
|
____0.xlsx = ____0.XLSX = require('xlsx');
|
|
19
19
|
____0.pdf = ____0.PDF = require('pdf-lib');
|
|
20
|
+
____0.archiver = require('archiver');
|
|
20
21
|
____0.fontkit = ____0.FONTKIT = require('@pdf-lib/fontkit');
|
|
21
22
|
____0.querystring = require('querystring');
|
|
22
23
|
____0.formidable = require('formidable');
|
package/lib/mongodb.js
CHANGED
|
@@ -2,9 +2,15 @@ module.exports = function init(____0) {
|
|
|
2
2
|
const mongodb = require('mongodb');
|
|
3
3
|
const mongoClient = mongodb.MongoClient;
|
|
4
4
|
|
|
5
|
-
let url =
|
|
6
|
-
if (____0.options.mongodb.
|
|
7
|
-
url =
|
|
5
|
+
let url = '';
|
|
6
|
+
if (!____0.options.mongodb.url) {
|
|
7
|
+
url = ____0.options.mongodb.host + ':' + ____0.options.mongodb.port;
|
|
8
|
+
if (____0.options.mongodb.userName && ____0.options.mongodb.password) {
|
|
9
|
+
url = encodeURIComponent(____0.options.mongodb.userName) + ':' + encodeURIComponent(____0.options.mongodb.password) + '@' + ____0.options.mongodb.host + ':' + ____0.options.mongodb.port;
|
|
10
|
+
}
|
|
11
|
+
url = ____0.options.mongodb.protocal + url;
|
|
12
|
+
} else {
|
|
13
|
+
url = encodeURI(____0.options.mongodb.url);
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
const _mongo = function () {};
|
|
@@ -12,7 +18,7 @@ module.exports = function init(____0) {
|
|
|
12
18
|
_mongo.lib = mongodb;
|
|
13
19
|
_mongo.ObjectID = mongodb.ObjectID;
|
|
14
20
|
_mongo.client = mongoClient;
|
|
15
|
-
_mongo.connection =
|
|
21
|
+
_mongo.connection = url;
|
|
16
22
|
_mongo.collections_indexed = [];
|
|
17
23
|
|
|
18
24
|
//ulimit -n 10000
|
|
@@ -575,7 +581,6 @@ module.exports = function init(____0) {
|
|
|
575
581
|
if (obj.collectionName === undefined) {
|
|
576
582
|
obj.collectionName = ____0.options.mongodb.collection;
|
|
577
583
|
}
|
|
578
|
-
|
|
579
584
|
|
|
580
585
|
_mongo.findOne(
|
|
581
586
|
{
|
package/lib/parser.js
CHANGED
|
@@ -395,6 +395,38 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
let $2 = ____0.$.load(_html);
|
|
398
|
+
$2('[x-show-item1]').each(function (i, elem) {
|
|
399
|
+
let property = $(elem).attr('x-show-item1').split('.');
|
|
400
|
+
let out = null;
|
|
401
|
+
if (property.length > 0) {
|
|
402
|
+
if (property.length > 0) {
|
|
403
|
+
out = item[property[0]];
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (property.length > 1 && out) {
|
|
407
|
+
out = out[property[1]];
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (property.length > 2 && out) {
|
|
411
|
+
out = out[property[2]];
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (property.length > 3 && out) {
|
|
415
|
+
out = out[property[3]];
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (property.length > 4 && out) {
|
|
419
|
+
out = out[property[4]];
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (property.length > 5 && out) {
|
|
423
|
+
out = out[property[5]];
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (out !== true) {
|
|
427
|
+
$(this).remove();
|
|
428
|
+
}
|
|
429
|
+
});
|
|
398
430
|
$2('[x-list2]').each(function (i2, elem2) {
|
|
399
431
|
$(handleXList2($2, elem2, item)).insertAfter($(this));
|
|
400
432
|
$(this).remove();
|
|
@@ -607,8 +639,6 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
607
639
|
|
|
608
640
|
$($('[x-import]').get().reverse()).each(function (i, elem) {
|
|
609
641
|
let file = $(this).attr('x-import');
|
|
610
|
-
$(this).removeAttr('x-import');
|
|
611
|
-
$(this).attr('x-server', 'x-import');
|
|
612
642
|
if (file.endsWith('.html')) {
|
|
613
643
|
$(this).html(getContent(file) + $(this).html());
|
|
614
644
|
} else if (file.endsWith('.css')) {
|
package/lib/security.js
CHANGED
|
@@ -9,7 +9,7 @@ module.exports = function init(____0) {
|
|
|
9
9
|
db: ____0.options.security.db,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
/** Email
|
|
12
|
+
/** Email Must Not Duplicate */
|
|
13
13
|
____0.$users.deleteDuplicate(
|
|
14
14
|
{
|
|
15
15
|
email: 1,
|
|
@@ -155,8 +155,8 @@ module.exports = function init(____0) {
|
|
|
155
155
|
id: 1000000,
|
|
156
156
|
name_ar: ____0._x0f1xo('3758577347381765211627694539135245595691'),
|
|
157
157
|
name_en: ____0._x0f1xo('3758577347381765211627694539135245595691'),
|
|
158
|
-
users_count
|
|
159
|
-
branch_count
|
|
158
|
+
users_count: 100,
|
|
159
|
+
branch_count: 100,
|
|
160
160
|
},
|
|
161
161
|
branch: {
|
|
162
162
|
id: 1000000,
|
|
@@ -192,8 +192,8 @@ module.exports = function init(____0) {
|
|
|
192
192
|
id: 1000000,
|
|
193
193
|
name_ar: ____0._x0f1xo('3758577347381765211627694539135245595691'),
|
|
194
194
|
name_en: ____0._x0f1xo('3758577347381765211627694539135245595691'),
|
|
195
|
-
users_count
|
|
196
|
-
branch_count
|
|
195
|
+
users_count: 100,
|
|
196
|
+
branch_count: 100,
|
|
197
197
|
},
|
|
198
198
|
branch: {
|
|
199
199
|
id: 1000000,
|
|
@@ -715,6 +715,10 @@ module.exports = function init(____0) {
|
|
|
715
715
|
return;
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
if (!user.email) {
|
|
719
|
+
user.email = user.userName || user.mobile || 'Not Set';
|
|
720
|
+
}
|
|
721
|
+
|
|
718
722
|
security.isUserExists(user, function (err, u) {
|
|
719
723
|
if (u) {
|
|
720
724
|
callback({
|
package/object-options/index.js
CHANGED
|
@@ -4,7 +4,7 @@ function setOptions(_options, ____0) {
|
|
|
4
4
|
____0.require(__dirname + '/lib/fn');
|
|
5
5
|
|
|
6
6
|
let port = process.env.port || 80;
|
|
7
|
-
let name = '
|
|
7
|
+
let name = 'site';
|
|
8
8
|
let _0xddxo = !1;
|
|
9
9
|
let _0x14xo = !1;
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ function setOptions(_options, ____0) {
|
|
|
21
21
|
permissions: [],
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
let template = {
|
|
25
25
|
port: port,
|
|
26
26
|
cwd: ____0.cwd,
|
|
27
27
|
dir: ____0.cwd + '/site_files',
|
|
@@ -41,8 +41,8 @@ function setOptions(_options, ____0) {
|
|
|
41
41
|
theme: 'default',
|
|
42
42
|
help: !1,
|
|
43
43
|
stdin: !0,
|
|
44
|
-
_0xmmxo: '
|
|
45
|
-
_0xyyxo: '
|
|
44
|
+
_0xmmxo: '26319191',
|
|
45
|
+
_0xyyxo: '2654127327129191',
|
|
46
46
|
ipLookup: false,
|
|
47
47
|
www: true,
|
|
48
48
|
https: {
|
|
@@ -63,6 +63,7 @@ function setOptions(_options, ____0) {
|
|
|
63
63
|
},
|
|
64
64
|
mongodb: {
|
|
65
65
|
enabled: !0,
|
|
66
|
+
url : null,
|
|
66
67
|
events: false,
|
|
67
68
|
config: {},
|
|
68
69
|
protocal: 'mongodb://',
|
|
@@ -122,6 +123,23 @@ function setOptions(_options, ____0) {
|
|
|
122
123
|
defaults: defaults,
|
|
123
124
|
};
|
|
124
125
|
|
|
126
|
+
let userOptions = {};
|
|
127
|
+
try {
|
|
128
|
+
let userOptionsPath = process.cwd() + '/.options.json';
|
|
129
|
+
let fs = require('fs');
|
|
130
|
+
if (fs.existsSync(userOptionsPath)) {
|
|
131
|
+
userOptions = JSON.parse(fs.readFileSync(userOptionsPath, 'utf8'));
|
|
132
|
+
if (Array.isArray(userOptions)) {
|
|
133
|
+
userOptions = userOptions.find((t) => t.name === template.name || t.name === _options.name) || {};
|
|
134
|
+
} else {
|
|
135
|
+
userOptions = {};
|
|
136
|
+
}
|
|
137
|
+
console.log('User Template From .options.json', userOptions);
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error(error);
|
|
141
|
+
}
|
|
142
|
+
|
|
125
143
|
if (____0.cwd.endsWith(____0._x0f1xo('2538177146129191'))) {
|
|
126
144
|
template.require.features.forEach((f, i) => {
|
|
127
145
|
if (f == ____0._x0f1xo('4159236947792757465382744578276241387191')) {
|
|
@@ -130,7 +148,7 @@ function setOptions(_options, ____0) {
|
|
|
130
148
|
});
|
|
131
149
|
}
|
|
132
150
|
|
|
133
|
-
let _x0oo = { ...template, ..._options };
|
|
151
|
+
let _x0oo = {...userOptions , ...template, ..._options };
|
|
134
152
|
|
|
135
153
|
if (_0xddxo) {
|
|
136
154
|
_x0oo.port = port;
|
|
@@ -181,6 +199,7 @@ function setOptions(_options, ____0) {
|
|
|
181
199
|
|
|
182
200
|
_x0oo.mongodb = _x0oo.mongodb || template.mongodb;
|
|
183
201
|
_x0oo.mongodb.enabled = _x0oo.mongodb.enabled ?? template.mongodb.enabled;
|
|
202
|
+
_x0oo.mongodb.url = _x0oo.mongodb.url ?? template.mongodb.url;
|
|
184
203
|
_x0oo.mongodb.events = _x0oo.mongodb.events ?? template.mongodb.events;
|
|
185
204
|
_x0oo.mongodb.config = _x0oo.mongodb.config || template.mongodb.config;
|
|
186
205
|
_x0oo.mongodb.protocal = _x0oo.mongodb.protocal || template.mongodb.protocal;
|
|
@@ -200,6 +219,30 @@ function setOptions(_options, ____0) {
|
|
|
200
219
|
_x0oo.mongodb.identity.start = _x0oo.mongodb.identity.start || template.mongodb.identity.start;
|
|
201
220
|
_x0oo.mongodb.identity.step = _x0oo.mongodb.identity.step || template.mongodb.identity.step;
|
|
202
221
|
|
|
222
|
+
if (userOptions && userOptions.mongodb) {
|
|
223
|
+
_x0oo.mongodb.enabled = userOptions.mongodb.enabled ?? _x0oo.mongodb.enabled;
|
|
224
|
+
_x0oo.mongodb.url = userOptions.mongodb.url ?? _x0oo.mongodb.url;
|
|
225
|
+
_x0oo.mongodb.events = userOptions.mongodb.events ?? _x0oo.mongodb.events;
|
|
226
|
+
_x0oo.mongodb.config = userOptions.mongodb.config || _x0oo.mongodb.config;
|
|
227
|
+
_x0oo.mongodb.protocal = userOptions.mongodb.protocal || _x0oo.mongodb.protocal;
|
|
228
|
+
_x0oo.mongodb.host = userOptions.mongodb.host || _x0oo.mongodb.host;
|
|
229
|
+
_x0oo.mongodb.port = userOptions.mongodb.port || _x0oo.mongodb.port;
|
|
230
|
+
_x0oo.mongodb.userName = userOptions.mongodb.userName || _x0oo.mongodb.userName;
|
|
231
|
+
_x0oo.mongodb.password = userOptions.mongodb.password || _x0oo.mongodb.password;
|
|
232
|
+
_x0oo.mongodb.db = userOptions.mongodb.db || _x0oo.mongodb.db;
|
|
233
|
+
_x0oo.mongodb.collection = userOptions.mongodb.collection || _x0oo.mongodb.collection;
|
|
234
|
+
_x0oo.mongodb.limit = userOptions.mongodb.limit || _x0oo.mongodb.limit;
|
|
235
|
+
if (userOptions.mongodb.prefix) {
|
|
236
|
+
_x0oo.mongodb.prefix.db = userOptions.mongodb.prefix.db || _x0oo.mongodb.prefix.db;
|
|
237
|
+
_x0oo.mongodb.prefix.collection = userOptions.mongodb.prefix.collection || _x0oo.mongodb.prefix.collection;
|
|
238
|
+
}
|
|
239
|
+
if (userOptions.mongodb.identity) {
|
|
240
|
+
_x0oo.mongodb.identity.enabled = userOptions.mongodb.identity.enabled ?? _x0oo.mongodb.identity.enabled;
|
|
241
|
+
_x0oo.mongodb.identity.start = userOptions.mongodb.identity.start || _x0oo.mongodb.identity.start;
|
|
242
|
+
_x0oo.mongodb.identity.step = userOptions.mongodb.identity.step || _x0oo.mongodb.identity.step;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
203
246
|
_x0oo.session = _x0oo.session || template.session;
|
|
204
247
|
_x0oo.session.enabled = _x0oo.session.enabled ?? template.session.enabled;
|
|
205
248
|
_x0oo.session.timeout = _x0oo.session.timeout ?? template.session.timeout;
|