|
17 | 17 | src="@/assets/img/discord-connector.png" |
18 | 18 | class="img-fluid" |
19 | 19 | style="width: 80px;" |
20 | | - > |
| 20 | + /> |
21 | 21 | </div> |
22 | 22 | <div class="col"> |
23 | 23 | <h1 class="h5 mb-0">Connecteur 4sucres-Discord</h1> |
24 | 24 | <span class="text-muted">{{ config.version }}</span> |
25 | | - <br> |
| 25 | + <br /> |
26 | 26 | <div class="mt-3"> |
27 | 27 | <button class="btn btn-primary btn-sm" @click="gotoPage(2)"> |
28 | 28 | Ah oui oui |
29 | | - <font-awesome-icon icon="angle-right"/> |
| 29 | + <font-awesome-icon icon="angle-right" /> |
30 | 30 | </button> |
31 | 31 | </div> |
32 | 32 | </div> |
|
53 | 53 | <div class="text-right"> |
54 | 54 | <button class="btn btn-primary" @click="gotoPage(3)"> |
55 | 55 | Je prends la main |
56 | | - <font-awesome-icon icon="angle-right"/> |
| 56 | + <font-awesome-icon icon="angle-right" /> |
57 | 57 | </button> |
58 | 58 | </div> |
59 | 59 | </div> |
|
119 | 119 | placeholder="oGyw2AaPwiwO9FBIPEiBNNuYTPJvmNCClpyariSf" |
120 | 120 | type="text" |
121 | 121 | :disabled="accounts.fourSucres.connecting || accounts.fourSucres.connected " |
122 | | - > |
| 122 | + /> |
123 | 123 |
|
124 | 124 | <div |
125 | 125 | class="p-1 text-danger" |
|
128 | 128 | </div> |
129 | 129 | </div> |
130 | 130 | </div> |
131 | | - <hr class="m-0"> |
| 131 | + <hr class="m-0" /> |
132 | 132 | <div class="card-body"> |
133 | 133 | <div class="row align-items-center"> |
134 | 134 | <div class="col-auto pr-0"> |
|
178 | 178 | placeholder="NNuYTPJvmNCClpyariSfoGyw2AaPwiwO9FBIPEiB" |
179 | 179 | type="text" |
180 | 180 | :disabled="accounts.discord.connecting || accounts.discord.connected" |
181 | | - > |
| 181 | + /> |
182 | 182 | <div |
183 | 183 | class="p-1 text-danger" |
184 | 184 | v-show="accounts.discord.hasError" |
|
190 | 190 | <div class="text-right"> |
191 | 191 | <button class="btn btn-primary" @click="connect()"> |
192 | 192 | Valider |
193 | | - <font-awesome-icon icon="check"/> |
| 193 | + <font-awesome-icon icon="check" /> |
194 | 194 | </button> |
195 | 195 | </div> |
196 | 196 | </div> |
|
204 | 204 | > |
205 | 205 | <div class="text-left"> |
206 | 206 | <div class="mb-5 mx-auto" style="width: 350px"> |
207 | | - <FourSucresLogo/> |
| 207 | + <FourSucresLogo /> |
208 | 208 | </div> |
209 | 209 | <div class="row align-items-center"> |
210 | 210 | <div class="col-auto"> |
211 | | - <font-awesome-icon icon="sync" spin size="2x"/> |
| 211 | + <font-awesome-icon icon="sync" spin size="2x" /> |
212 | 212 | </div> |
213 | 213 | <div class="col"> |
214 | 214 | <h1 class="h5 mb-0">Échanges en cours</h1> |
|
229 | 229 | > |
230 | 230 | <div class="text-left"> |
231 | 231 | <div class="mb-5 mx-auto" style="width: 350px"> |
232 | | - <FourSucresLogo/> |
| 232 | + <FourSucresLogo /> |
233 | 233 | </div> |
234 | 234 | <div class="row align-items-center"> |
235 | 235 | <div class="col-auto"> |
236 | | - <font-awesome-icon icon="check" size="2x"/> |
| 236 | + <font-awesome-icon icon="check" size="2x" /> |
237 | 237 | </div> |
238 | 238 | <div class="col"> |
239 | 239 | <h1 class="h5 mb-0 text-success">Synchronisation terminée !</h1> |
|
252 | 252 | > |
253 | 253 | <div class="text-left"> |
254 | 254 | <div class="mb-5 mx-auto" style="width: 350px"> |
255 | | - <FourSucresLogo/> |
| 255 | + <FourSucresLogo /> |
256 | 256 | </div> |
257 | 257 | <div class="row align-items-center"> |
258 | 258 | <div class="col-auto"> |
259 | | - <font-awesome-icon icon="times" size="2x"/> |
| 259 | + <font-awesome-icon icon="times" size="2x" /> |
260 | 260 | </div> |
261 | 261 | <div class="col"> |
262 | 262 | <h1 class="h5 mb-0 text-danger">Erreur !</h1> |
@@ -333,9 +333,9 @@ export default { |
333 | 333 | axios.defaults.headers.common["Content-Type"] = |
334 | 334 | "application/x-www-form-urlencoded"; |
335 | 335 | axios.defaults.headers.common["Accept"] = "application/json"; |
336 | | - axios.defaults.headers.common["Authorization"] = `Bearer ${ |
337 | | - this.accounts.fourSucres.token |
338 | | - }`; |
| 336 | + axios.defaults.headers.common[ |
| 337 | + "Authorization" |
| 338 | + ] = `Bearer ${this.accounts.fourSucres.token}`; |
339 | 339 | axios.defaults.baseURL = "https://" + this.config.server + "/api/v1/"; |
340 | 340 |
|
341 | 341 | axios |
@@ -396,30 +396,34 @@ export default { |
396 | 396 | this.gotoPage(6); |
397 | 397 | } |
398 | 398 |
|
| 399 | + let postEmojis = []; |
| 400 | +
|
399 | 401 | for (const emoji of guild[1].emojis) { |
400 | | - this.loading.status = |
401 | | - "Serveur : " + |
402 | | - guild[1].name + |
403 | | - "<br>Emoji : <code>:" + |
404 | | - emoji[1].name + |
405 | | - ":</code>"; |
| 402 | + postEmojis.push({ |
| 403 | + id: emoji[0], |
| 404 | + name: emoji[1].name, |
| 405 | + animated: emoji[1].animated, |
| 406 | + deleted: emoji[1].deleted, |
| 407 | + }); |
| 408 | + } |
| 409 | +
|
| 410 | + if (postEmojis.length) { |
| 411 | + this.loading.status = "Serveur : " + guild[1].name; |
| 412 | +
|
406 | 413 | try { |
407 | | - await axios({ |
408 | | - url: "discord-emojis", |
409 | | - method: "post", |
410 | | - data: { |
411 | | - id: emoji[0], |
412 | | - name: emoji[1].name, |
413 | | - animated: emoji[1].animated, |
414 | | - deleted: emoji[1].deleted, |
415 | | - guild_id: guild[0] |
416 | | - } |
417 | | - }); |
418 | | - } catch (error) { |
419 | | - console.log(error); |
420 | | - this.gotoPage(6); |
| 414 | + await axios({ |
| 415 | + url: "discord-emojis", |
| 416 | + method: "post", |
| 417 | + data: { |
| 418 | + guild_id: guild[0], |
| 419 | + emojis: postEmojis |
| 420 | + } |
| 421 | + }); |
| 422 | + } catch (error) { |
| 423 | + console.log(error); |
| 424 | + this.gotoPage(6); |
| 425 | + } |
421 | 426 | } |
422 | | - } |
423 | 427 | } |
424 | 428 |
|
425 | 429 | this.gotoPage(5); |
|
0 commit comments