model-manager 0.0.3-1.0 → 0.0.5
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/administration/test_data.js +29 -29
- package/administration.html +6 -79
- package/app-update.yml +0 -0
- package/assets/css/admin.css +5 -173
- package/assets/css/checkout.css +1 -1
- package/assets/css/dialog_checkout.css +1 -22
- package/checkout.html +1 -2
- package/checkout_admin.html +1 -2
- package/index.html +1 -2
- package/index_admin.html +1 -2
- package/js/load_items.js +14 -1
- package/login.html +5 -3
- package/main.js +33 -62
- package/package.json +16 -11
- package/preload.js +1 -1
- package/update.html +48 -0
- package/assets/css/dialog_admin.css +0 -73
- package/assets/spinner_2.gif +0 -0
- package/assets/white/admin/check.svg +0 -1
- package/js/load_admin.js +0 -32
|
@@ -9,38 +9,38 @@
|
|
|
9
9
|
// console.log("1 document inserted");
|
|
10
10
|
// client.db.close();
|
|
11
11
|
// });
|
|
12
|
-
//
|
|
12
|
+
// });
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const { MongoClient, ServerApiVersion } = require('mongodb');
|
|
15
|
+
const uri = "mongodb+srv://adminmn:eQJ62Cszrvi7VgD@mnmodeldatabase.zsxqn.mongodb.net/myFirstDatabase?retryWrites=true&w=majority";
|
|
16
|
+
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const database = client.db("modeldatabase");
|
|
19
|
+
const models = database.collection("models");
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
client.connect(err => {
|
|
22
|
+
if (err) throw err;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
models.deleteMany();
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
var modelobj1 = {released: true, model_name: "Diamond Pickaxe", model_creator: "Prisemut", model_path: "./models/bird.geo.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
27
|
+
var modelobj2 = {released: true, model_name: "Diamond Sword", model_creator: "Prisemut", model_path: "./models/jellyfish.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
28
|
+
var modelobj3 = {released: true, model_name: "Airplane", model_creator: "Prisemut", model_path: "./models/stone_golem.geo.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
29
|
+
var modelobj4 = {released: true, model_name: "Jet", model_creator: "Prisemut", model_path: "./models/stone_golem.geo.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
30
|
+
var modelobj5 = {released: true, model_name: "Jeep", model_creator: "Prisemut", model_path: "./models/stone_golem.geo.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
31
|
+
var modelobj6 = {released: true, model_name: "Guy", model_creator: "Prisemut", model_path: "./models/stone_golem.geo.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
32
|
+
var modelobj7 = {released: true, model_name: "Woman", model_creator: "Prisemut", model_path: "./models/stone_golem.geo.gltf", thumbnail: "./imgs/testing.png", has_anims: true, has_behavior: true, has_textures: true, animations: ["idle","walk"], behavior: ["hostile mob", "aggressive mob"], textures: ["red", "blue", "green", "orange", "yellow"], tags: ["test", "template"]}
|
|
33
|
+
models.insertOne(modelobj1);
|
|
34
|
+
models.insertOne(modelobj2);
|
|
35
|
+
models.insertOne(modelobj3);
|
|
36
|
+
models.insertOne(modelobj4);
|
|
37
|
+
models.insertOne(modelobj5);
|
|
38
|
+
models.insertOne(modelobj6);
|
|
39
|
+
models.insertOne(modelobj7);
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
models.find().forEach( function(item) {
|
|
42
|
+
item.animations.forEach(function (item,index) {
|
|
43
|
+
console.log(item)
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
package/administration.html
CHANGED
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
|
6
6
|
<link href="./assets/css/basic.css" rel="stylesheet">
|
|
7
|
-
<link href="./assets/css/dialog_admin.css" rel="stylesheet">
|
|
8
7
|
<link href="./assets/css/admin.css" rel="stylesheet">
|
|
9
|
-
<title>Administration</title>
|
|
10
8
|
</head>
|
|
11
9
|
<body>
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
<section id="head">
|
|
15
13
|
<div class="drag-field-head">
|
|
16
|
-
<p class="drag-field-text">
|
|
14
|
+
<p class="drag-field-text">MN-Modelstore</p>
|
|
17
15
|
</div>
|
|
18
16
|
<div class="win-btn">
|
|
19
17
|
<a class="btn-win" id="close-button">
|
|
@@ -54,35 +52,15 @@
|
|
|
54
52
|
<section id="main-content">
|
|
55
53
|
<div class="admin-content">
|
|
56
54
|
<div class="div2">
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<h3 id="loading-text">loading...</h3>
|
|
62
|
-
<img id="loading-image" src="assets/spinner_2.gif" alt="Loading..." width="70px"/>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
</ul>
|
|
66
|
-
</div>
|
|
55
|
+
<button>Create</button>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="div3">
|
|
58
|
+
<button>Create</button>
|
|
67
59
|
</div>
|
|
68
60
|
</div>
|
|
69
|
-
|
|
70
61
|
</section>
|
|
71
|
-
|
|
72
|
-
<!--Popup renderer-->
|
|
73
|
-
<div id="body-overlay"></div>
|
|
74
|
-
<div class="dialog" id="dialog">
|
|
75
|
-
<a href="#" role="button" class="dialog-close-button" id="dialog-close-button">
|
|
76
|
-
<image src="assets/white/close_white_24dp.svg"> </image>
|
|
77
|
-
</a>
|
|
78
|
-
<pre id="item-listing">
|
|
79
|
-
<h1>Items:</h1>
|
|
80
|
-
</pre>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
|
|
62
|
+
|
|
84
63
|
<script>
|
|
85
|
-
|
|
86
64
|
document.getElementById("close-button").addEventListener('click', event => {
|
|
87
65
|
window.api.send("toMain", "closeWindow");
|
|
88
66
|
});
|
|
@@ -92,58 +70,7 @@
|
|
|
92
70
|
document.getElementById("home-side").onclick = function () {
|
|
93
71
|
location.href = "./index_admin.html";
|
|
94
72
|
};
|
|
95
|
-
|
|
96
|
-
var ul = document.getElementById('order-listing');
|
|
97
|
-
ul.addEventListener('click', function(e) {
|
|
98
|
-
if (e.target.tagName === 'LI'){
|
|
99
|
-
var target = e.target; // Clicked element
|
|
100
|
-
document.getElementById("dialog").classList.add("visable");
|
|
101
|
-
document.getElementById("body-overlay").classList.add("visable");
|
|
102
|
-
|
|
103
|
-
var items = document.createElement('code')
|
|
104
|
-
var splitted_text = target.dataset.item_obj.split(",")
|
|
105
|
-
|
|
106
|
-
for (item in splitted_text) {
|
|
107
|
-
items.innerHTML = items.innerHTML + "\n" + splitted_text[item]
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var h1 = document.createElement('h1')
|
|
112
|
-
h1.innerHTML = "Items ordered:"
|
|
113
|
-
document.getElementById("item-listing").innerHTML = ""
|
|
114
|
-
document.getElementById("item-listing").appendChild(h1)
|
|
115
|
-
document.getElementById("item-listing").appendChild(items)
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
document.getElementById('body-overlay').addEventListener('click', function(e) {
|
|
120
|
-
document.getElementById("dialog").classList.remove("visable");
|
|
121
|
-
document.getElementById("body-overlay").classList.remove("visable");
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
document.getElementById('dialog-close-button').addEventListener('click', function(e) {
|
|
126
|
-
document.getElementById("dialog").classList.remove("visable");
|
|
127
|
-
document.getElementById("body-overlay").classList.remove("visable");
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
document.onkeydown = function(evt) {
|
|
131
|
-
evt = evt || window.event;
|
|
132
|
-
var isEscape = false;
|
|
133
|
-
if ("key" in evt) {
|
|
134
|
-
isEscape = (evt.key === "Escape" || evt.key === "Esc");
|
|
135
|
-
} else {
|
|
136
|
-
isEscape = (evt.keyCode === 27);
|
|
137
|
-
}
|
|
138
|
-
if (isEscape) {
|
|
139
|
-
document.getElementById("dialog").classList.remove("visable");
|
|
140
|
-
document.getElementById("body-overlay").classList.remove("visable");
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
|
|
145
73
|
</script>
|
|
146
|
-
<script src="js/load_admin.js"></script>
|
|
147
74
|
|
|
148
75
|
</body>
|
|
149
76
|
</html>
|
package/app-update.yml
ADDED
|
File without changes
|
package/assets/css/admin.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
-webkit-backdrop-filter: blur(25px) saturate(0%);
|
|
4
4
|
background-color: #2C2F33;
|
|
5
5
|
border-radius: 12px;
|
|
6
|
-
border: 1px solid
|
|
6
|
+
border: 1px solid rgba(255, 255, 255, 0.125);
|
|
7
7
|
width: 20%;
|
|
8
8
|
height: 17%;
|
|
9
9
|
position: relative;
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
position:relative;
|
|
52
52
|
}
|
|
53
53
|
.div2 {
|
|
54
|
-
grid-area: 1 / 1 / 6 /
|
|
54
|
+
grid-area: 1 / 1 / 6 / 4;
|
|
55
55
|
background-color: #2C2F33;
|
|
56
56
|
position: relative;
|
|
57
57
|
border-radius: 15px;
|
|
58
58
|
}
|
|
59
59
|
.div3 {
|
|
60
|
-
grid-area: 1 / 4 /
|
|
60
|
+
grid-area: 1 / 4 / 5 / 6;
|
|
61
61
|
background-color: #2C2F33;
|
|
62
62
|
position: relative;
|
|
63
63
|
border-radius: 15px;
|
|
@@ -69,179 +69,11 @@ button {
|
|
|
69
69
|
font-size: 15px;
|
|
70
70
|
background: linear-gradient(348deg, #5353e6 0%, #5199b6 48%, #0ebcdf 85%);
|
|
71
71
|
border-radius: 25px;
|
|
72
|
-
height:
|
|
73
|
-
width:
|
|
72
|
+
height: 5%;
|
|
73
|
+
width: 15%;
|
|
74
74
|
border: 0px;
|
|
75
75
|
filter: drop-shadow(0 0 20px #121212);
|
|
76
76
|
position: absolute;
|
|
77
77
|
bottom: 1%;
|
|
78
78
|
right: 1%;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.order_list {
|
|
82
|
-
width: 90%;
|
|
83
|
-
height: 90%;
|
|
84
|
-
margin: 0 auto;
|
|
85
|
-
padding: 10px;
|
|
86
|
-
position: relative;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
ul {
|
|
90
|
-
list-style-type: none;
|
|
91
|
-
overflow:hidden; overflow-y:scroll;
|
|
92
|
-
width: 100%;
|
|
93
|
-
height: 95%;
|
|
94
|
-
}
|
|
95
|
-
li {
|
|
96
|
-
border-bottom: #5353e6 1px solid;
|
|
97
|
-
background: #2C2F33;
|
|
98
|
-
padding: 15px;
|
|
99
|
-
margin: 15px;
|
|
100
|
-
font-style: normal;
|
|
101
|
-
word-spacing: 38px;
|
|
102
|
-
border-radius: 25px;
|
|
103
|
-
filter: drop-shadow(0 0 4px #181818);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
li:hover {
|
|
107
|
-
animation-name: hoverfadeli;
|
|
108
|
-
animation-duration: 0.3s;
|
|
109
|
-
animation-fill-mode: forwards;
|
|
110
|
-
border-radius: 25px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@keyframes hoverfadeli {
|
|
114
|
-
from {
|
|
115
|
-
background: #2C2F33;
|
|
116
|
-
}
|
|
117
|
-
to {
|
|
118
|
-
background: #5a5d5e41;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
::-webkit-scrollbar {
|
|
125
|
-
width: 7px;
|
|
126
|
-
height: 10px;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
::-webkit-scrollbar-track {
|
|
130
|
-
background-color: #2C2F33;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
::-webkit-scrollbar-thumb {
|
|
134
|
-
background: linear-gradient(348deg, #5353e6 0%, #5199b6 48%, #0ebcdf 85%);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
::-webkit-scrollbar-thumb {
|
|
138
|
-
background-color: #d6dee1;
|
|
139
|
-
border-radius: 20px;
|
|
140
|
-
}
|
|
141
|
-
::-webkit-scrollbar-thumb:hover {
|
|
142
|
-
background-color: #a8bbbf;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
li a {
|
|
146
|
-
position: relative;
|
|
147
|
-
float: right;
|
|
148
|
-
border-radius: 55px;
|
|
149
|
-
transform: translateY(-20%);
|
|
150
|
-
width: 6%;
|
|
151
|
-
}
|
|
152
|
-
li a img {
|
|
153
|
-
transform: translateX(10%);
|
|
154
|
-
height: 80%;
|
|
155
|
-
width: 80%;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
li a:hover {
|
|
159
|
-
animation-name: hoverfade;
|
|
160
|
-
animation-duration: 0.2s;
|
|
161
|
-
animation-fill-mode: forwards;
|
|
162
|
-
}
|
|
163
|
-
@keyframes hoverfade {
|
|
164
|
-
from {
|
|
165
|
-
opacity: 100%;
|
|
166
|
-
}
|
|
167
|
-
to{
|
|
168
|
-
opacity: 10%;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/* For large screens */
|
|
173
|
-
@media only screen and (max-width: 1500px) {
|
|
174
|
-
li {
|
|
175
|
-
border-bottom: #5353e6 1px solid;
|
|
176
|
-
background: #2C2F33;
|
|
177
|
-
padding: 15px;
|
|
178
|
-
margin: 15px;
|
|
179
|
-
font-style: normal;
|
|
180
|
-
word-spacing: 22px;
|
|
181
|
-
border-radius: 25px;
|
|
182
|
-
filter: drop-shadow(0 0 4px #181818);
|
|
183
|
-
}
|
|
184
|
-
li a img {
|
|
185
|
-
transform: translateX(10%);
|
|
186
|
-
height: 80%;
|
|
187
|
-
width: 80%;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
@media only screen and (min-width: 1501px) {
|
|
192
|
-
li {
|
|
193
|
-
border-bottom: #5353e6 1px solid;
|
|
194
|
-
background: #2C2F33;
|
|
195
|
-
padding: 15px;
|
|
196
|
-
margin: 15px;
|
|
197
|
-
font-style: normal;
|
|
198
|
-
word-spacing: 38px;
|
|
199
|
-
border-radius: 25px;
|
|
200
|
-
filter: drop-shadow(0 0 4px #181818);
|
|
201
|
-
}
|
|
202
|
-
li a img {
|
|
203
|
-
transform: translateX(10%);
|
|
204
|
-
height: 50%;
|
|
205
|
-
width: 50%;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
input {
|
|
211
|
-
padding: 15px;
|
|
212
|
-
margin: 15px;
|
|
213
|
-
font-style: normal;
|
|
214
|
-
word-spacing: 38px;
|
|
215
|
-
border-radius: 25px;
|
|
216
|
-
font-size: 15px;
|
|
217
|
-
appearance: none;
|
|
218
|
-
display: inline-block;
|
|
219
|
-
background: #4e4f50;
|
|
220
|
-
border: 1px solid #4e4f50;
|
|
221
|
-
border-top: 1px solid #4e4f50;
|
|
222
|
-
box-sizing: border-box;
|
|
223
|
-
border-radius: 25px;
|
|
224
|
-
width: 80%;
|
|
225
|
-
color: #c2c2c2;
|
|
226
|
-
outline: none;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
#loading {
|
|
230
|
-
pointer-events: none;
|
|
231
|
-
position: fixed;
|
|
232
|
-
display: block;
|
|
233
|
-
width: 100%;
|
|
234
|
-
height: 80%;
|
|
235
|
-
top: 0;
|
|
236
|
-
left: 0;
|
|
237
|
-
text-align: center;
|
|
238
|
-
opacity: 0.7;
|
|
239
|
-
z-index: 99;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
p {
|
|
243
|
-
font-size: 20px;
|
|
244
|
-
font-style: italic;
|
|
245
|
-
margin: 14px;
|
|
246
|
-
margin-left: 20px;
|
|
247
79
|
}
|
package/assets/css/checkout.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
padding: 10px;
|
|
20
20
|
border-radius: 5px;
|
|
21
21
|
width: 60%;
|
|
22
|
-
background-color:
|
|
22
|
+
background-color: rgb(45, 48, 52);
|
|
23
23
|
z-index: 1000001;
|
|
24
24
|
opacity: 0;
|
|
25
25
|
pointer-events: none;
|
|
@@ -153,25 +153,4 @@
|
|
|
153
153
|
}
|
|
154
154
|
.control-checkbox input:checked + .control_indicator::before {
|
|
155
155
|
animation-name: s-ripple-dup;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
::-webkit-scrollbar {
|
|
159
|
-
width: 7px;
|
|
160
|
-
height: 10px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
::-webkit-scrollbar-track {
|
|
164
|
-
background-color: #2d3034;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
::-webkit-scrollbar-thumb {
|
|
168
|
-
background: linear-gradient(348deg, #5353e6 0%, #5199b6 48%, #0ebcdf 85%);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
::-webkit-scrollbar-thumb {
|
|
172
|
-
background-color: #d6dee1;
|
|
173
|
-
border-radius: 20px;
|
|
174
|
-
}
|
|
175
|
-
::-webkit-scrollbar-thumb:hover {
|
|
176
|
-
background-color: #a8bbbf;
|
|
177
156
|
}
|
package/checkout.html
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
|
6
6
|
<link href="assets/css/checkout.css" rel="stylesheet">
|
|
7
7
|
<link href="assets/css/dialog_checkout.css" rel="stylesheet">
|
|
8
|
-
<title>Checkout</title>
|
|
9
8
|
</head>
|
|
10
9
|
<body>
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
<section id="head">
|
|
14
13
|
<div class="drag-field-head">
|
|
15
|
-
<p class="drag-field-text">
|
|
14
|
+
<p class="drag-field-text">MN-Modelstore [a0.1]</p>
|
|
16
15
|
</div>
|
|
17
16
|
<div class="win-btn">
|
|
18
17
|
<a class="btn-win" id="close-button">
|
package/checkout_admin.html
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
|
6
6
|
<link href="assets/css/checkout.css" rel="stylesheet">
|
|
7
7
|
<link href="assets/css/dialog_checkout.css" rel="stylesheet">
|
|
8
|
-
<title>Checkout</title>
|
|
9
8
|
</head>
|
|
10
9
|
<body>
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
<section id="head">
|
|
14
13
|
<div class="drag-field-head">
|
|
15
|
-
<p class="drag-field-text">
|
|
14
|
+
<p class="drag-field-text">MN-Modelstore [a0.1]</p>
|
|
16
15
|
</div>
|
|
17
16
|
<div class="win-btn">
|
|
18
17
|
<a class="btn-win" id="close-button">
|
package/index.html
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
|
6
6
|
<link href="./assets/css/basic.css" rel="stylesheet">
|
|
7
7
|
<link href="./assets/css/dialog.css" rel="stylesheet">
|
|
8
|
-
<title>Browse</title>
|
|
9
8
|
</head>
|
|
10
9
|
<body>
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
<section id="head">
|
|
14
13
|
<div class="drag-field-head">
|
|
15
|
-
<p class="drag-field-text">
|
|
14
|
+
<p class="drag-field-text">MN-Modelstore</p>
|
|
16
15
|
</div>
|
|
17
16
|
<div class="win-btn">
|
|
18
17
|
<a class="btn-win" id="close-button">
|
package/index_admin.html
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
|
|
6
6
|
<link href="./assets/css/basic.css" rel="stylesheet">
|
|
7
7
|
<link href="./assets/css/dialog.css" rel="stylesheet">
|
|
8
|
-
<title>Browse</title>
|
|
9
8
|
</head>
|
|
10
9
|
<body>
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
<section id="head">
|
|
14
13
|
<div class="drag-field-head">
|
|
15
|
-
<p class="drag-field-text">
|
|
14
|
+
<p class="drag-field-text">MN-Modelstore</p>
|
|
16
15
|
</div>
|
|
17
16
|
<div class="win-btn">
|
|
18
17
|
<a class="btn-win" id="close-button">
|
package/js/load_items.js
CHANGED
|
@@ -248,7 +248,20 @@ window.api.receive('item_channel', function (data, evt) {
|
|
|
248
248
|
const controls = new OrbitControls(camera,renderer.domElement);
|
|
249
249
|
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
function resizeCanvasToDisplaySize() {
|
|
252
|
+
const canvas = renderer.domElement;
|
|
253
|
+
const width = canvas.clientWidth;
|
|
254
|
+
const height = canvas.clientHeight;
|
|
255
|
+
if (canvas.width !== width ||canvas.height !== height) {
|
|
256
|
+
// you must pass false here or three.js sadly fights the browser
|
|
257
|
+
renderer.setSize(width, height, false);
|
|
258
|
+
camera.aspect = width / height;
|
|
259
|
+
camera.updateProjectionMatrix();
|
|
260
|
+
|
|
261
|
+
// set render target sizes here
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
|
|
253
266
|
camera.position.y = 1;
|
|
254
267
|
camera.position.x = 3;
|
package/login.html
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
+
<!-- Design by foolishdeveloper.com -->
|
|
5
|
+
<title>Glassmorphism login Form Tutorial in html css</title>
|
|
6
|
+
|
|
4
7
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
5
8
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
6
9
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&display=swap" rel="stylesheet">
|
|
7
|
-
<title>Login</title>
|
|
8
10
|
<!--Stylesheet-->
|
|
9
11
|
<style media="screen">
|
|
10
12
|
*,
|
|
@@ -259,10 +261,10 @@ button > span {
|
|
|
259
261
|
window.api.receive('login_response', function (data, evt) {
|
|
260
262
|
if (data == "n") {
|
|
261
263
|
document.getElementById("alert").classList.remove("invis")
|
|
262
|
-
} else if (data
|
|
264
|
+
} else if (data = "y-0") {
|
|
263
265
|
location.href = "./index_admin.html";
|
|
264
266
|
window.api.send("change_window", input)
|
|
265
|
-
} else if (data
|
|
267
|
+
} else if (data = "y-1") {
|
|
266
268
|
location.href = "./index.html";
|
|
267
269
|
window.api.send("change_window", input)
|
|
268
270
|
}
|
package/main.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
|
-
// todo: need to remove this before compiling the software
|
|
2
|
+
// // todo: need to remove this before compiling the software
|
|
3
3
|
// require('electron-reload')(__dirname, {
|
|
4
4
|
// electron: path.join(__dirname, 'node_modules', '.bin', 'electron')
|
|
5
5
|
// });
|
|
6
6
|
const { app, BrowserWindow, ipcMain, dialog } = require('electron');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { autoUpdater } = require('electron-github-autoupdater')
|
|
10
|
-
|
|
11
|
-
autoUpdater({
|
|
12
|
-
owner: "Mine-North",
|
|
13
|
-
repo: "Mine-North-Model-Tool",
|
|
14
|
-
accessToken: "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"
|
|
15
|
-
})
|
|
7
|
+
const { autoUpdater } = require('electron-updater')
|
|
16
8
|
|
|
17
9
|
var cart = [];
|
|
18
10
|
var logged_user;
|
|
@@ -36,7 +28,7 @@ const loginWindow = () => {
|
|
|
36
28
|
preload: path.join(__dirname, 'preload.js')
|
|
37
29
|
}
|
|
38
30
|
})
|
|
39
|
-
win.webContents.openDevTools(true)
|
|
31
|
+
// win.webContents.openDevTools(true)
|
|
40
32
|
win.loadURL(`file://${__dirname}/login.html`)
|
|
41
33
|
|
|
42
34
|
ipcMain.on("change_window", (event, args) => {
|
|
@@ -44,7 +36,7 @@ const loginWindow = () => {
|
|
|
44
36
|
createWindow();
|
|
45
37
|
});
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
autoUpdater.checkForUpdates();
|
|
48
40
|
}
|
|
49
41
|
|
|
50
42
|
|
|
@@ -93,24 +85,12 @@ ipcMain.on("toMain", (event, args) => {
|
|
|
93
85
|
const database = client.db("modeldatabase");
|
|
94
86
|
const orders = database.collection("orders");
|
|
95
87
|
|
|
96
|
-
// lets clean the order array first
|
|
97
|
-
var final_cart = cart.filter(function(item, pos, self) {
|
|
98
|
-
return self.indexOf(item) == pos;
|
|
99
|
-
})
|
|
100
|
-
|
|
101
88
|
client.connect(err => {
|
|
102
89
|
if (err) {
|
|
103
90
|
event.sender.send('order_response', "error")
|
|
104
91
|
throw err
|
|
105
92
|
}
|
|
106
|
-
|
|
107
|
-
var existing_order = 0;
|
|
108
|
-
// count existing orders
|
|
109
|
-
orders.find().forEach( function(item) {
|
|
110
|
-
existing_order++;
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
var modelobj1 = {order_by: logged_user, orders: final_cart, order_number: existing_order+1}
|
|
93
|
+
var modelobj1 = {order_by: logged_user, orders: cart}
|
|
114
94
|
orders.insertOne(modelobj1);
|
|
115
95
|
cart = [];
|
|
116
96
|
event.sender.send('order_response', "success")
|
|
@@ -157,7 +137,6 @@ ipcMain.on("database_request", (event, args) => {
|
|
|
157
137
|
const database = client.db("modeldatabase");
|
|
158
138
|
const models = database.collection("models");
|
|
159
139
|
const users = database.collection("users");
|
|
160
|
-
const orders = database.collection("orders");
|
|
161
140
|
|
|
162
141
|
if(args == "rqID") {
|
|
163
142
|
client.connect(err => {
|
|
@@ -244,42 +223,6 @@ ipcMain.on("database_request", (event, args) => {
|
|
|
244
223
|
});
|
|
245
224
|
});
|
|
246
225
|
}
|
|
247
|
-
|
|
248
|
-
if (args == "rq_orderdata") {
|
|
249
|
-
client.connect(err => {
|
|
250
|
-
var data = []
|
|
251
|
-
var count = 0;
|
|
252
|
-
orders.find().forEach( function(item) {
|
|
253
|
-
data = []
|
|
254
|
-
var order_number = item.order_number
|
|
255
|
-
var orderer = item.order_by
|
|
256
|
-
var orders = item.orders
|
|
257
|
-
count = count+1;
|
|
258
|
-
data.push({
|
|
259
|
-
order_number,
|
|
260
|
-
orderer,
|
|
261
|
-
orders
|
|
262
|
-
})
|
|
263
|
-
event.sender.send('admin_channel', data)
|
|
264
|
-
if (count == 1) {
|
|
265
|
-
event.sender.send('renderer', "stop-spinner")
|
|
266
|
-
}
|
|
267
|
-
client.close();
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
if (args.includes("delete_order")) {
|
|
273
|
-
var splitted_data = args.split(":")
|
|
274
|
-
var order_id = splitted_data[1];
|
|
275
|
-
|
|
276
|
-
client.connect(err => {
|
|
277
|
-
console.log("looking to delete order number " + order_id);
|
|
278
|
-
orders.deleteOne({ order_number: parseInt(order_id) });
|
|
279
|
-
|
|
280
|
-
event.sender.send('renderer', "reload_side")
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
226
|
});
|
|
284
227
|
|
|
285
228
|
|
|
@@ -303,4 +246,32 @@ ipcMain.on("storage_request", (event, args) => {
|
|
|
303
246
|
|
|
304
247
|
ipcMain.on("cart_request", (event, args) => {
|
|
305
248
|
event.sender.send("cart_answer", cart)
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
// auto updater
|
|
254
|
+
autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {
|
|
255
|
+
const dialogOpts = {
|
|
256
|
+
type: 'info',
|
|
257
|
+
buttons: ['Ok'],
|
|
258
|
+
title: 'Application Update',
|
|
259
|
+
message: process.platform === "win32" ? releaseNotes : releaseName,
|
|
260
|
+
detail: 'A new version is being downloaded.'
|
|
261
|
+
}
|
|
262
|
+
dialog.showMessageBox(dialogOpts, (response) => {
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
autoUpdater.on("update-downloaded", (_event, releaseNotes, releaseName) => {
|
|
267
|
+
const dialogOpts = {
|
|
268
|
+
type: 'info',
|
|
269
|
+
buttons: ['Restart'],
|
|
270
|
+
title: 'Application Update',
|
|
271
|
+
message: process.platform === "win32" ? releaseNotes : releaseName,
|
|
272
|
+
detail: 'A new version has been downloaded. You need to restart the tool!'
|
|
273
|
+
}
|
|
274
|
+
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
|
275
|
+
if (returnValue.response === 0) autoUpdater.quitAndInstall()
|
|
276
|
+
});
|
|
306
277
|
});
|
package/package.json
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "model-manager",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"main": "main.js",
|
|
5
|
-
"license":
|
|
5
|
+
"license": null,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "electron .",
|
|
8
8
|
"publish": "electron-builder --win --publish always"
|
|
9
9
|
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/Mine-North/Mine-North-Model-Tool"
|
|
13
|
+
},
|
|
10
14
|
"keywords": [],
|
|
11
15
|
"author": "Tristan H.",
|
|
12
16
|
"description": "A Tool for managing all model assets of Mine-North.",
|
|
13
17
|
"dependencies": {
|
|
14
|
-
"electron-
|
|
15
|
-
"electron-
|
|
18
|
+
"electron-json-storage": "^4.5.0",
|
|
19
|
+
"electron-storage": "^1.0.7",
|
|
20
|
+
"electron-store": "^8.0.1",
|
|
16
21
|
"electron-updater": "^5.0.5",
|
|
17
22
|
"mongodb": "^4.5.0",
|
|
18
23
|
"swup": "^2.0.14",
|
|
@@ -21,20 +26,20 @@
|
|
|
21
26
|
},
|
|
22
27
|
"devDependencies": {
|
|
23
28
|
"electron": "^19.0.8",
|
|
24
|
-
"electron-
|
|
29
|
+
"electron-builder": "^23.1.0",
|
|
25
30
|
"electron-reload": "^2.0.0-alpha.1"
|
|
26
31
|
},
|
|
27
32
|
"build": {
|
|
28
|
-
"appId": "
|
|
33
|
+
"appId": "model-manager",
|
|
29
34
|
"productName": "ModelManager",
|
|
30
35
|
"win": {
|
|
31
36
|
"publish": [
|
|
32
37
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
"provider": "github",
|
|
39
|
+
"private": true,
|
|
40
|
+
"owner": " Mine-North",
|
|
41
|
+
"repo": "Mine-North-Model-Tool",
|
|
42
|
+
"token": "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"
|
|
38
43
|
}
|
|
39
44
|
]
|
|
40
45
|
}
|
package/preload.js
CHANGED
|
@@ -16,7 +16,7 @@ contextBridge.exposeInMainWorld(
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
receive: (channel, func) => {
|
|
19
|
-
let validChannels = ["fromMain", "item_channel", "item_channel2", "data_usage", "renderer", "login_response", "storage_answer", "cart_answer", "start_app", "order_response"
|
|
19
|
+
let validChannels = ["fromMain", "item_channel", "item_channel2", "data_usage", "renderer", "login_response", "storage_answer", "cart_answer", "start_app", "order_response"];
|
|
20
20
|
if (validChannels.includes(channel)) {
|
|
21
21
|
// Deliberately strip event as it includes `sender`
|
|
22
22
|
ipcRenderer.on(channel, (event, ...args) => func(...args));
|
package/update.html
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
5
|
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&display=swap" rel="stylesheet">
|
|
6
|
+
<!--Stylesheet-->
|
|
7
|
+
<style media="screen">
|
|
8
|
+
body {
|
|
9
|
+
background: #1a1a1a;
|
|
10
|
+
color: whitesmoke;
|
|
11
|
+
}
|
|
12
|
+
#control {
|
|
13
|
+
-webkit-app-region: drag;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
z-index: 99;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
position: absolute;
|
|
20
|
+
background: transparent;
|
|
21
|
+
}
|
|
22
|
+
#download {
|
|
23
|
+
position: absolute;
|
|
24
|
+
bottom: 15px;
|
|
25
|
+
width: 80%;
|
|
26
|
+
left: 10%;
|
|
27
|
+
height: 25px;
|
|
28
|
+
}
|
|
29
|
+
#download-label {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 10vh;
|
|
32
|
+
width: 97%;
|
|
33
|
+
text-align: center;
|
|
34
|
+
font-size: 48px;
|
|
35
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
36
|
+
font-weight: 300;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
</head>
|
|
40
|
+
<body>
|
|
41
|
+
|
|
42
|
+
<div id="control"></div>
|
|
43
|
+
<label for="download" id="download-label"></label>
|
|
44
|
+
<progress id="download" max="100" value="20"></progress>
|
|
45
|
+
<script src="./js/update.js"></script>
|
|
46
|
+
<!-- start_app -> channel to send data -->
|
|
47
|
+
</body>
|
|
48
|
+
</html>
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
#body-overlay {
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
right: 0;
|
|
5
|
-
bottom: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
background-color: rgb(24, 24, 24, 0.8);
|
|
8
|
-
z-index: 100000;
|
|
9
|
-
opacity: 0;
|
|
10
|
-
pointer-events: none;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.dialog {
|
|
14
|
-
height: 60%;
|
|
15
|
-
position: fixed;
|
|
16
|
-
left: 50%;
|
|
17
|
-
top: 50%;
|
|
18
|
-
transform: translate(-50%, -50%);
|
|
19
|
-
padding: 10px;
|
|
20
|
-
width: 50%;
|
|
21
|
-
background-color: #2C2F33;
|
|
22
|
-
z-index: 1000001;
|
|
23
|
-
opacity: 0;
|
|
24
|
-
pointer-events: none;
|
|
25
|
-
border-radius: 25px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
#body-overlay.visable, .dialog.visable {
|
|
29
|
-
opacity: 1;
|
|
30
|
-
pointer-events: auto;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
#item-dialog {
|
|
34
|
-
width: 45%;
|
|
35
|
-
}
|
|
36
|
-
.dialog-close-button {
|
|
37
|
-
position: absolute;
|
|
38
|
-
top: 6px;
|
|
39
|
-
right: 8px;
|
|
40
|
-
font-size: 32px;
|
|
41
|
-
line-height: 32px;
|
|
42
|
-
text-decoration: none;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
pre {
|
|
46
|
-
width: 80%;
|
|
47
|
-
height: 80%;
|
|
48
|
-
margin-top: 5%;
|
|
49
|
-
border-radius: 25px;
|
|
50
|
-
margin-left: 10%;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
code {
|
|
54
|
-
font-size: 20px;
|
|
55
|
-
position: relative;
|
|
56
|
-
transform: translateX(-50%);
|
|
57
|
-
}
|
|
58
|
-
@media only screen and (max-width: 1500px) {
|
|
59
|
-
code {
|
|
60
|
-
font-size: 16px;
|
|
61
|
-
position: relative;
|
|
62
|
-
transform: translateX(-50%);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@media only screen and (min-width: 1501px) {
|
|
67
|
-
code {
|
|
68
|
-
font-size: 20px;
|
|
69
|
-
position: relative;
|
|
70
|
-
transform: translateX(-50%);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
package/assets/spinner_2.gif
DELETED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48" fill="#ECECEC"><path d="M18.9 35.7 7.7 24.5l2.15-2.15 9.05 9.05 19.2-19.2 2.15 2.15Z"/></svg>
|
package/js/load_admin.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
window.api.send("database_request", "rq_orderdata");
|
|
2
|
-
|
|
3
|
-
window.api.receive('admin_channel', function (data, evt) {
|
|
4
|
-
var list = document.getElementById("order-listing")
|
|
5
|
-
var a = document.createElement('a')
|
|
6
|
-
a.id = "finish_order"
|
|
7
|
-
var img_in_a = document.createElement('img')
|
|
8
|
-
img_in_a.src = "./assets/white/admin/check.svg"
|
|
9
|
-
a.appendChild(img_in_a);
|
|
10
|
-
var newLI = document.createElement('li')
|
|
11
|
-
newLI.id = "order-item"
|
|
12
|
-
newLI.dataset.order_id = data[0].order_number
|
|
13
|
-
a.dataset.order_id = data[0].order_number
|
|
14
|
-
newLI.dataset.item_obj = data[0].orders
|
|
15
|
-
newLI.innerHTML = "Ordercode: #" + data[0].order_number + " | Orderer: " + data[0].orderer + " | Items: " + data[0].orders.length
|
|
16
|
-
newLI.appendChild(a);
|
|
17
|
-
list.appendChild(newLI);
|
|
18
|
-
document.querySelectorAll("#finish_order").forEach(function (item) {
|
|
19
|
-
item.addEventListener('click', function() {
|
|
20
|
-
window.api.send("database_request", "delete_order:" + item.dataset.order_id);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
window.api.receive('renderer', function (data, evt) {
|
|
26
|
-
if(data == "stop-spinner") {
|
|
27
|
-
document.getElementById("loading").remove();
|
|
28
|
-
} else if (data == "reload_side") {
|
|
29
|
-
|
|
30
|
-
location.reload()
|
|
31
|
-
}
|
|
32
|
-
});
|