mdkcontroller 1.1.0 → 1.1.2
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/Cores/login/index.html +91 -91
- package/demoApp.js +7 -0
- package/main.js +6 -1
- package/package.json +1 -2
package/Cores/login/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta charset="UTF-8">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
<!--===============================================================================================-->
|
|
9
|
-
<link rel="icon" type="image/png" href="images/icons/favicon.ico"
|
|
9
|
+
<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
|
|
10
10
|
<!--===============================================================================================-->
|
|
11
11
|
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
|
|
12
12
|
<!--===============================================================================================-->
|
|
@@ -25,121 +25,121 @@
|
|
|
25
25
|
|
|
26
26
|
<body>
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
<div class="limiter">
|
|
29
|
+
<div class="container-login100">
|
|
30
|
+
<div class="wrap-login100">
|
|
31
|
+
<div class="login100-pic js-tilt" data-tilt>
|
|
32
|
+
<img src="images/img-01.png" alt="IMG">
|
|
33
|
+
</div>
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<form id="formLogin" class="login100-form validate-form" action="../../api/users/login">
|
|
36
36
|
<span class="login100-form-title">
|
|
37
37
|
Member Login
|
|
38
38
|
</span>
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
<div class="wrap-input100 validate-input" data-validate="UserName is required">
|
|
41
|
+
<input class="input100" type="text" name="userName" placeholder="UserName">
|
|
42
|
+
<span class="focus-input100"></span>
|
|
43
|
+
<span class="symbol-input100">
|
|
44
44
|
<i class="fa fa-envelope" aria-hidden="true"></i>
|
|
45
45
|
</span>
|
|
46
|
-
|
|
46
|
+
</div>
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
<div class="wrap-input100 validate-input" data-validate="Password is required">
|
|
49
|
+
<input class="input100" type="password" name="password" placeholder="Password">
|
|
50
|
+
<span class="focus-input100"></span>
|
|
51
|
+
<span class="symbol-input100">
|
|
52
52
|
<i class="fa fa-lock" aria-hidden="true"></i>
|
|
53
53
|
</span>
|
|
54
|
-
|
|
54
|
+
</div>
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
<div class="container-login100-form-btn">
|
|
57
|
+
<button class="login100-form-btn">
|
|
58
|
+
Login
|
|
59
|
+
</button>
|
|
60
|
+
</div>
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
<div class="text-center p-t-12">
|
|
63
63
|
<span class="txt1">
|
|
64
64
|
Forgot
|
|
65
65
|
</span>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
<a class="txt2" href="#">
|
|
67
|
+
Username / Password?
|
|
68
|
+
</a>
|
|
69
|
+
</div>
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</div>
|
|
71
|
+
<div class="text-center p-t-136">
|
|
72
|
+
<a class="txt2" href="register.html">
|
|
73
|
+
Create your Account
|
|
74
|
+
<i class="fa fa-long-arrow-right m-l-5" aria-hidden="true"></i>
|
|
75
|
+
</a>
|
|
76
|
+
</div>
|
|
77
|
+
</form>
|
|
79
78
|
</div>
|
|
80
79
|
</div>
|
|
80
|
+
</div>
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</div>
|
|
87
|
-
<span onclick="closeDialog()"><i class="fa fa-window-close" aria-hidden="true"></i></span>
|
|
82
|
+
<div id="overlay" class="overlay">
|
|
83
|
+
<div class="overlay_boder">
|
|
84
|
+
<div class="overlay_box">
|
|
85
|
+
<div class="overlay_inner">This is a dialog window</div>
|
|
88
86
|
</div>
|
|
87
|
+
<span onclick="closeDialog()"><i class="fa fa-window-close" aria-hidden="true"></i></span>
|
|
89
88
|
</div>
|
|
89
|
+
</div>
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
92
|
+
<!--===============================================================================================-->
|
|
93
|
+
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
|
|
94
|
+
<!--===============================================================================================-->
|
|
95
|
+
<script src="vendor/bootstrap/js/popper.js"></script>
|
|
96
|
+
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
|
97
|
+
<!--===============================================================================================-->
|
|
98
|
+
<script src="vendor/select2/select2.min.js"></script>
|
|
99
|
+
<!--===============================================================================================-->
|
|
100
|
+
<script src="vendor/tilt/tilt.jquery.min.js"></script>
|
|
101
|
+
<script>
|
|
102
|
+
$('.js-tilt').tilt({
|
|
103
|
+
scale: 1.1
|
|
104
|
+
})
|
|
105
|
+
</script>
|
|
106
|
+
<!--===============================================================================================-->
|
|
107
|
+
<script src="js/main.js"></script>
|
|
108
|
+
<script src="../file/dk.js"></script>
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
<script>
|
|
111
|
+
$('#formLogin').on('submit', function (event) {
|
|
112
|
+
if (event.result) {
|
|
113
|
+
const form = event.currentTarget;
|
|
114
|
+
const formData = new FormData(form);
|
|
115
|
+
fetch(form.action, {
|
|
116
|
+
method: "POST",
|
|
117
|
+
headers: {
|
|
118
|
+
'Content-Type': 'application/json'
|
|
119
|
+
},
|
|
120
|
+
body: JSON.stringify(Object.fromEntries(formData.entries()))
|
|
121
|
+
})
|
|
122
|
+
.then(response => {
|
|
123
|
+
if (response.ok) {
|
|
124
|
+
return response.json();
|
|
125
|
+
} else {
|
|
126
|
+
throw new Error('API request failed');
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
.then(data => {
|
|
130
|
+
if (data.success) {
|
|
131
|
+
window.location.href = "../../";
|
|
132
|
+
} else {
|
|
133
|
+
DK.showMessage(data.message, 3);
|
|
134
|
+
}
|
|
121
135
|
})
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
.then(data => {
|
|
130
|
-
if (data.success) {
|
|
131
|
-
window.location.href = "../../Pages/";
|
|
132
|
-
} else {
|
|
133
|
-
DK.showMessage(data.message, 3);
|
|
134
|
-
}
|
|
135
|
-
})
|
|
136
|
-
.catch(error => {
|
|
137
|
-
DK.showMessage(error, 4);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
return false;
|
|
141
|
-
});
|
|
142
|
-
</script>
|
|
136
|
+
.catch(error => {
|
|
137
|
+
DK.showMessage(error, 4);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
});
|
|
142
|
+
</script>
|
|
143
143
|
|
|
144
144
|
</body>
|
|
145
145
|
|
package/demoApp.js
CHANGED
|
@@ -4,8 +4,15 @@ import {Router} from "express";
|
|
|
4
4
|
|
|
5
5
|
const cfg = {
|
|
6
6
|
redirectHome: function (req, res) {
|
|
7
|
+
// Path in current project
|
|
7
8
|
res.redirect("/pages/DemoHomeV1/home");
|
|
8
9
|
}
|
|
10
|
+
// ,trySkipAuth: function (req, res, next) {
|
|
11
|
+
// if (true) {
|
|
12
|
+
// next();
|
|
13
|
+
// }
|
|
14
|
+
// return true;
|
|
15
|
+
// }
|
|
9
16
|
}
|
|
10
17
|
const _sv = await Root("khanhnbd", cfg);
|
|
11
18
|
const app = _sv.server;
|
package/main.js
CHANGED
|
@@ -51,7 +51,11 @@ export default async function (appname, cfgHandler = {}) {
|
|
|
51
51
|
break;
|
|
52
52
|
default:
|
|
53
53
|
if (req.path.toLowerCase().indexOf("/pages/") >= 0) {
|
|
54
|
-
|
|
54
|
+
if (cfgHandler.trySkipAuth && cfgHandler.trySkipAuth(req, res, next)) {
|
|
55
|
+
//something work.
|
|
56
|
+
} else {
|
|
57
|
+
res.redirect("/Cores/Login");
|
|
58
|
+
}
|
|
55
59
|
return;
|
|
56
60
|
}
|
|
57
61
|
break;
|
|
@@ -66,6 +70,7 @@ export default async function (appname, cfgHandler = {}) {
|
|
|
66
70
|
server: app,
|
|
67
71
|
database: db,
|
|
68
72
|
authen: auth,
|
|
73
|
+
serverBase : server,
|
|
69
74
|
startListen:
|
|
70
75
|
function (kport = 8095) {
|
|
71
76
|
server.listen(kport, () => {
|
package/package.json
CHANGED
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
"fluent-ffmpeg": "^2.1.2",
|
|
7
7
|
"handlebars": "^4.7.8",
|
|
8
8
|
"lowdb": "^7.0.1",
|
|
9
|
-
"mdkcontroller": "^1.0.0",
|
|
10
9
|
"socket.io": "^4.7.2"
|
|
11
10
|
},
|
|
12
11
|
"name": "mdkcontroller",
|
|
13
|
-
"version": "1.1.
|
|
12
|
+
"version": "1.1.2",
|
|
14
13
|
"keywords": [],
|
|
15
14
|
"author": "KHANHNBD <khanh272421@gmail.com>",
|
|
16
15
|
"license": "ISC",
|