@resultcrafter/aimanager-instagram-connector 0.1.0 → 0.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/index.js +108 -53
- package/package.json +6 -2
- package/template/configure.html +114 -216
- package/template/detail.html +28 -107
- package/template/error.html +10 -16
package/index.js
CHANGED
|
@@ -36,6 +36,7 @@ let VERIFY_TOKEN = null;
|
|
|
36
36
|
let GRAPH_URL = null;
|
|
37
37
|
let DASHBOARD_BASE_URL = null;
|
|
38
38
|
let BRAND_NAME = null;
|
|
39
|
+
let SHOW_INFO_MESSAGE = false;
|
|
39
40
|
// Handlebars register helpers
|
|
40
41
|
handlebars.registerHelper('isEqual', (a, b) => {
|
|
41
42
|
if (a == b) {
|
|
@@ -46,7 +47,7 @@ handlebars.registerHelper('isEqual', (a, b) => {
|
|
|
46
47
|
})
|
|
47
48
|
|
|
48
49
|
router.get('/', async (req, res) => {
|
|
49
|
-
res.send('Welcome on
|
|
50
|
+
res.send('Welcome on AI Manager Instagram Connector!')
|
|
50
51
|
})
|
|
51
52
|
|
|
52
53
|
router.get('/detail', async (req, res) => {
|
|
@@ -191,7 +192,7 @@ router.get('/configure', async (req, res) => {
|
|
|
191
192
|
var replacements = {
|
|
192
193
|
app_version: pjson.version,
|
|
193
194
|
project_id: project_id,
|
|
194
|
-
|
|
195
|
+
ig_token: settings.ig_token || settings.access_token,
|
|
195
196
|
token: token,
|
|
196
197
|
app_id: app_id,
|
|
197
198
|
endpoint: BASE_URL,
|
|
@@ -199,7 +200,10 @@ router.get('/configure', async (req, res) => {
|
|
|
199
200
|
isEmpty: true,
|
|
200
201
|
department_id: settings.department_id,
|
|
201
202
|
departments: departments,
|
|
202
|
-
brand_name: BRAND_NAME
|
|
203
|
+
brand_name: BRAND_NAME,
|
|
204
|
+
instagram_username: settings.instagram_username || settings.user_info?.username || 'Instagram Account',
|
|
205
|
+
show_info_message: settings.show_info_message !== undefined ? settings.show_info_message : true,
|
|
206
|
+
subscription_id: settings.subscription_id
|
|
203
207
|
}
|
|
204
208
|
var html = template(replacements)
|
|
205
209
|
res.send(html);
|
|
@@ -212,10 +216,11 @@ router.get('/configure', async (req, res) => {
|
|
|
212
216
|
var replacements = {
|
|
213
217
|
app_version: pjson.version,
|
|
214
218
|
project_id: project_id,
|
|
219
|
+
ig_token: null,
|
|
215
220
|
token: token,
|
|
221
|
+
app_id: app_id,
|
|
216
222
|
endpoint: BASE_URL,
|
|
217
223
|
departments: departments,
|
|
218
|
-
redirect_uri: `https://www.facebook.com/v14.0/dialog/oauth?client_id=${FB_APP_ID}&redirect_uri=${BASE_URL}/oauth?&scope=public_profile%2C%20email%2C%20pages_show_list%2C%20pages_messaging%2C%20business_management&state={"project_id":"${project_id}","app_id":"${app_id}","token":"${token}"}`,
|
|
219
224
|
brand_name: BRAND_NAME
|
|
220
225
|
}
|
|
221
226
|
var html = template(replacements);
|
|
@@ -237,8 +242,10 @@ router.post('/update', async (req, res) => {
|
|
|
237
242
|
let CONTENT_KEY = "instagram-" + project_id;
|
|
238
243
|
let settings = await db.get(CONTENT_KEY);
|
|
239
244
|
|
|
240
|
-
settings
|
|
241
|
-
|
|
245
|
+
if (settings) {
|
|
246
|
+
settings.department_id = department_id;
|
|
247
|
+
await db.set(CONTENT_KEY, settings);
|
|
248
|
+
}
|
|
242
249
|
|
|
243
250
|
// get departments
|
|
244
251
|
const tdChannel = new TiledeskChannel({ settings: { project_id: project_id, token: token }, API_URL: API_URL });
|
|
@@ -251,15 +258,18 @@ router.post('/update', async (req, res) => {
|
|
|
251
258
|
var replacements = {
|
|
252
259
|
app_version: pjson.version,
|
|
253
260
|
project_id: project_id,
|
|
254
|
-
|
|
261
|
+
ig_token: settings ? (settings.ig_token || settings.access_token) : null,
|
|
255
262
|
token: token,
|
|
256
263
|
app_id: app_id,
|
|
257
264
|
endpoint: BASE_URL,
|
|
258
|
-
pages: settings.pages,
|
|
265
|
+
pages: settings ? settings.pages : null,
|
|
259
266
|
isEmpty: true,
|
|
260
|
-
department_id: settings.department_id,
|
|
267
|
+
department_id: settings ? settings.department_id : null,
|
|
261
268
|
departments: departments,
|
|
262
|
-
brand_name: BRAND_NAME
|
|
269
|
+
brand_name: BRAND_NAME,
|
|
270
|
+
show_info_message: settings ? (settings.show_info_message !== undefined ? settings.show_info_message : true) : true,
|
|
271
|
+
instagram_username: settings ? (settings.instagram_username || settings.user_info?.username || 'Instagram Account') : null,
|
|
272
|
+
subscription_id: settings ? settings.subscription_id : null
|
|
263
273
|
}
|
|
264
274
|
var html = template(replacements)
|
|
265
275
|
res.send(html);
|
|
@@ -267,9 +277,48 @@ router.post('/update', async (req, res) => {
|
|
|
267
277
|
|
|
268
278
|
})
|
|
269
279
|
|
|
280
|
+
router.post('/update_advanced', async (req, res) => {
|
|
281
|
+
winston.verbose("(fbm) /update_advanced");
|
|
282
|
+
|
|
283
|
+
let project_id = req.body.project_id;
|
|
284
|
+
let show_info_message = req.body.show_info_message === 'on';
|
|
285
|
+
|
|
286
|
+
let CONTENT_KEY = "instagram-" + project_id;
|
|
287
|
+
let settings = await db.get(CONTENT_KEY);
|
|
288
|
+
|
|
289
|
+
if (settings) {
|
|
290
|
+
settings.show_info_message = show_info_message;
|
|
291
|
+
await db.set(CONTENT_KEY, settings);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const tdChannel = new TiledeskChannel({ settings: { project_id: project_id, token: req.body.token }, API_URL: API_URL });
|
|
295
|
+
let departments = await tdChannel.getDepartments(req.body.token).catch(() => []);
|
|
296
|
+
|
|
297
|
+
readHTMLFile('/configure.html', (err, html) => {
|
|
298
|
+
var template = handlebars.compile(html);
|
|
299
|
+
var replacements = {
|
|
300
|
+
app_version: pjson.version,
|
|
301
|
+
project_id: project_id,
|
|
302
|
+
ig_token: settings ? (settings.ig_token || settings.access_token) : null,
|
|
303
|
+
token: req.body.token,
|
|
304
|
+
endpoint: BASE_URL,
|
|
305
|
+
pages: settings ? settings.pages : null,
|
|
306
|
+
isEmpty: true,
|
|
307
|
+
department_id: settings ? settings.department_id : null,
|
|
308
|
+
departments: departments,
|
|
309
|
+
brand_name: BRAND_NAME,
|
|
310
|
+
show_info_message: show_info_message,
|
|
311
|
+
instagram_username: settings ? (settings.instagram_username || settings.user_info?.username || 'Instagram Account') : null,
|
|
312
|
+
subscription_id: settings ? settings.subscription_id : null
|
|
313
|
+
}
|
|
314
|
+
var html = template(replacements)
|
|
315
|
+
res.send(html);
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
|
|
270
319
|
router.post('/tiledesk', async (req, res) => {
|
|
271
|
-
winston.verbose("(fbm) Message received from
|
|
272
|
-
winston.debug("(fbm) Message received from
|
|
320
|
+
winston.verbose("(fbm) Message received from AI Manager");
|
|
321
|
+
winston.debug("(fbm) Message received from AI Manager body: ", req.body);
|
|
273
322
|
|
|
274
323
|
let tiledeskChannelMessage = req.body.payload;
|
|
275
324
|
let project_id = req.body.payload.id_project;
|
|
@@ -346,7 +395,7 @@ router.post('/tiledesk', async (req, res) => {
|
|
|
346
395
|
const tdChannel = new TiledeskChannel({ settings: settings, API_URL: API_URL })
|
|
347
396
|
try {
|
|
348
397
|
await tdChannel.send(tiledeskJsonMessage, message_info, settings.department_id);
|
|
349
|
-
winston.verbose("(wab) Expiration message sent to
|
|
398
|
+
winston.verbose("(wab) Expiration message sent to AI Manager")
|
|
350
399
|
return res.sendStatus(200);
|
|
351
400
|
} catch (err) {
|
|
352
401
|
return res.status(500).send({ success: false, error: "Error sending exoìpiration message" });
|
|
@@ -520,7 +569,7 @@ router.post('/webhookFB', async (req, res) => {
|
|
|
520
569
|
if (tiledeskJsonMessage) {
|
|
521
570
|
try {
|
|
522
571
|
await tdChannel.send(tiledeskJsonMessage, message_info, settings.department_id);
|
|
523
|
-
winston.verbose("(fbm) Message sent to
|
|
572
|
+
winston.verbose("(fbm) Message sent to AI Manager")
|
|
524
573
|
} catch (err) {
|
|
525
574
|
return res.status(500).send({ success: false, error: "Error sending exoìpiration message" });
|
|
526
575
|
}
|
|
@@ -536,7 +585,7 @@ router.post('/webhookFB', async (req, res) => {
|
|
|
536
585
|
if (tiledeskJsonMessage) {
|
|
537
586
|
try {
|
|
538
587
|
await tdChannel.send(tiledeskJsonMessage, message_info, settings.department_id);
|
|
539
|
-
winston.verbose("(fbm) Message sent to
|
|
588
|
+
winston.verbose("(fbm) Message sent to AI Manager")
|
|
540
589
|
} catch (err) {
|
|
541
590
|
return res.status(500).send({ success: false, error: "Error sending message" });
|
|
542
591
|
}
|
|
@@ -718,20 +767,22 @@ router.post('/enablePage', async (req, res) => {
|
|
|
718
767
|
var replacements = {
|
|
719
768
|
app_version: pjson.version,
|
|
720
769
|
project_id: project_id,
|
|
721
|
-
|
|
770
|
+
ig_token: settings.ig_token || settings.access_token,
|
|
722
771
|
token: token,
|
|
723
772
|
endpoint: BASE_URL,
|
|
724
773
|
pages: settings.pages,
|
|
725
774
|
department_id: settings.department_id,
|
|
726
775
|
departments: departments,
|
|
727
|
-
brand_name: BRAND_NAME
|
|
776
|
+
brand_name: BRAND_NAME,
|
|
777
|
+
show_info_message: settings.show_info_message !== undefined ? settings.show_info_message : true,
|
|
778
|
+
instagram_username: settings.instagram_username || settings.user_info?.username || 'Instagram Account',
|
|
779
|
+
subscription_id: settings.subscription_id
|
|
728
780
|
}
|
|
729
781
|
var html = template(replacements)
|
|
730
782
|
return res.send(html);
|
|
731
783
|
})
|
|
732
784
|
|
|
733
785
|
} else {
|
|
734
|
-
// pagina attiva per qualche progetto --> reject
|
|
735
786
|
winston.verbose("Page already in use in another project");
|
|
736
787
|
let alert = "Unable to activate " + page_name + ". Page already in use in another project."
|
|
737
788
|
|
|
@@ -740,14 +791,17 @@ router.post('/enablePage', async (req, res) => {
|
|
|
740
791
|
var replacements = {
|
|
741
792
|
app_version: pjson.version,
|
|
742
793
|
project_id: project_id,
|
|
743
|
-
|
|
794
|
+
ig_token: settings.ig_token || settings.access_token,
|
|
744
795
|
token: token,
|
|
745
796
|
endpoint: BASE_URL,
|
|
746
797
|
pages: settings.pages,
|
|
747
798
|
department_id: settings.department_id,
|
|
748
799
|
departments: departments,
|
|
749
800
|
brand_name: BRAND_NAME,
|
|
750
|
-
show_alert_modal: true
|
|
801
|
+
show_alert_modal: true,
|
|
802
|
+
show_info_message: settings.show_info_message !== undefined ? settings.show_info_message : true,
|
|
803
|
+
instagram_username: settings.instagram_username || settings.user_info?.username || 'Instagram Account',
|
|
804
|
+
subscription_id: settings.subscription_id
|
|
751
805
|
}
|
|
752
806
|
var html = template(replacements)
|
|
753
807
|
return res.send(html);
|
|
@@ -786,15 +840,16 @@ router.post('/disablePage', async (req, res) => {
|
|
|
786
840
|
var replacements = {
|
|
787
841
|
app_version: pjson.version,
|
|
788
842
|
project_id: project_id,
|
|
789
|
-
|
|
843
|
+
ig_token: settings.ig_token || settings.access_token,
|
|
790
844
|
token: token,
|
|
791
845
|
endpoint: BASE_URL,
|
|
792
846
|
pages: settings.pages,
|
|
793
847
|
department_id: settings.department_id,
|
|
794
848
|
departments: departments,
|
|
795
|
-
brand_name: BRAND_NAME
|
|
796
|
-
|
|
797
|
-
|
|
849
|
+
brand_name: BRAND_NAME,
|
|
850
|
+
show_info_message: settings.show_info_message !== undefined ? settings.show_info_message : true,
|
|
851
|
+
instagram_username: settings.instagram_username || settings.user_info?.username || 'Instagram Account',
|
|
852
|
+
subscription_id: settings.subscription_id
|
|
798
853
|
}
|
|
799
854
|
var html = template(replacements)
|
|
800
855
|
return res.send(html);
|
|
@@ -812,49 +867,49 @@ router.post('/disconnect', async (req, res) => {
|
|
|
812
867
|
let CONTENT_KEY = "instagram-" + project_id;
|
|
813
868
|
|
|
814
869
|
let settings = await db.get(CONTENT_KEY);
|
|
815
|
-
const active_page = settings.pages.find(p => p.active === true);
|
|
816
870
|
|
|
817
|
-
if (
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
871
|
+
if (settings && settings.pages) {
|
|
872
|
+
const active_page = settings.pages.find(p => p.active === true);
|
|
873
|
+
if (active_page) {
|
|
874
|
+
let PAGE_KEY = "instagram-page-" + active_page.id;
|
|
875
|
+
await db.remove(PAGE_KEY)
|
|
876
|
+
winston.debug("(fbm) Page deleted.");
|
|
877
|
+
}
|
|
821
878
|
}
|
|
822
879
|
|
|
823
880
|
await db.remove(CONTENT_KEY)
|
|
824
881
|
winston.verbose("(fbm) Content deleted.");
|
|
825
882
|
|
|
826
883
|
const tdClient = new TiledeskSubscriptionClient({ API_URL: API_URL, project_id: project_id, token: token })
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
readHTMLFile('/configure.html', (err, html) => {
|
|
884
|
+
if (settings && settings.subscription_id) {
|
|
885
|
+
tdClient.unsubscribe(settings.subscription_id).catch((err) => {
|
|
886
|
+
winston.error("(fbm) unsubscribe error: ", err);
|
|
887
|
+
});
|
|
888
|
+
}
|
|
834
889
|
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
project_id: project_id,
|
|
839
|
-
token: token,
|
|
840
|
-
endpoint: BASE_URL,
|
|
841
|
-
departments: departments,
|
|
842
|
-
brand_name: BRAND_NAME,
|
|
843
|
-
redirect_uri: `https://www.facebook.com/v14.0/dialog/oauth?client_id=${FB_APP_ID}&redirect_uri=${BASE_URL}/oauth?&scope=public_profile%2C%20email%2C%20pages_show_list%2C%20pages_messaging%2C%20business_management&state={"project_id":"${project_id}","app_id":"${settings.app_id}","token":"${token}"}`
|
|
844
|
-
}
|
|
845
|
-
var html = template(replacements)
|
|
846
|
-
return res.send(html);
|
|
847
|
-
})
|
|
890
|
+
const tdChannel = new TiledeskChannel({ settings: { project_id: project_id, token: token }, API_URL: API_URL })
|
|
891
|
+
let departments = await tdChannel.getDepartments(token).catch(() => []);
|
|
892
|
+
winston.debug("(fbm) found " + departments.length + " departments")
|
|
848
893
|
|
|
849
|
-
|
|
850
|
-
|
|
894
|
+
readHTMLFile('/configure.html', (err, html) => {
|
|
895
|
+
var template = handlebars.compile(html);
|
|
896
|
+
var replacements = {
|
|
897
|
+
app_version: pjson.version,
|
|
898
|
+
project_id: project_id,
|
|
899
|
+
ig_token: null,
|
|
900
|
+
token: token,
|
|
901
|
+
endpoint: BASE_URL,
|
|
902
|
+
departments: departments,
|
|
903
|
+
brand_name: BRAND_NAME
|
|
904
|
+
}
|
|
905
|
+
var html = template(replacements)
|
|
906
|
+
return res.send(html);
|
|
851
907
|
})
|
|
852
908
|
|
|
853
|
-
|
|
854
909
|
})
|
|
855
910
|
|
|
856
911
|
function startApp(settings, callback) {
|
|
857
|
-
winston.info("(fbm) Starting Instagram App");
|
|
912
|
+
winston.info("(fbm) Starting AI Manager Instagram App");
|
|
858
913
|
|
|
859
914
|
if (!settings.MONGODB_URL) {
|
|
860
915
|
winston.error("(fbm) MONGODB_URL is mandatory. Exit...");
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resultcrafter/aimanager-instagram-connector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "AI Manager Instagram DM connector",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "mocha",
|
|
8
8
|
"start": "node index.js"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"aimanager",
|
|
12
|
+
"instagram",
|
|
13
|
+
"connector"
|
|
14
|
+
],
|
|
11
15
|
"author": "ResultCrafter",
|
|
12
16
|
"license": "MIT",
|
|
13
17
|
"dependencies": {
|
package/template/configure.html
CHANGED
|
@@ -6,21 +6,16 @@
|
|
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
|
|
9
|
-
<!-- Bootstrap 5.3 CSS -->
|
|
10
9
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
11
10
|
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
|
12
11
|
crossorigin="anonymous">
|
|
13
12
|
|
|
14
|
-
<!-- Font Awesome 7 (latest version) -->
|
|
15
13
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" crossorigin="anonymous" />
|
|
16
|
-
|
|
17
|
-
<!-- Font Poppins -->
|
|
14
|
+
|
|
18
15
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet" />
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
<link rel="stylesheet" href="./css/configure.css">
|
|
17
|
+
<link rel="stylesheet" href="./css/configure.css">
|
|
22
18
|
|
|
23
|
-
<!-- Bootstrap 5.3 JavaScript Bundle (include Popper) -->
|
|
24
19
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
25
20
|
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
26
21
|
crossorigin="anonymous">
|
|
@@ -31,13 +26,11 @@
|
|
|
31
26
|
font-family: 'Poppins', serif;
|
|
32
27
|
}
|
|
33
28
|
</style>
|
|
34
|
-
|
|
29
|
+
|
|
35
30
|
</head>
|
|
36
31
|
|
|
37
|
-
|
|
38
32
|
<body>
|
|
39
33
|
|
|
40
|
-
<!-- Success modal -->
|
|
41
34
|
{{#if show_success_modal}}
|
|
42
35
|
<div id="success-update-modal" class="success-modal">
|
|
43
36
|
<div class="modal-content">
|
|
@@ -48,7 +41,6 @@
|
|
|
48
41
|
</div>
|
|
49
42
|
{{/if}}
|
|
50
43
|
|
|
51
|
-
<!-- Error modal -->
|
|
52
44
|
{{#if show_error_modal}}
|
|
53
45
|
<div id="error-update-modal" class="error-modal">
|
|
54
46
|
<div class="modal-content">
|
|
@@ -59,7 +51,6 @@
|
|
|
59
51
|
</div>
|
|
60
52
|
{{/if}}
|
|
61
53
|
|
|
62
|
-
<!-- Alert modal -->
|
|
63
54
|
{{#if show_alert_modal}}
|
|
64
55
|
<div id="alert-update-modal" class="alert-modal">
|
|
65
56
|
<div class="modal-content">
|
|
@@ -70,220 +61,93 @@
|
|
|
70
61
|
</div>
|
|
71
62
|
{{/if}}
|
|
72
63
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<!-- HEADER -->
|
|
76
64
|
<div class="header">
|
|
77
65
|
<div class="header-content">
|
|
78
66
|
<div class="logo-title">
|
|
79
67
|
<div class="logo-container">
|
|
80
|
-
<img src="https://
|
|
68
|
+
<img src="https://aimanager.resultcrafter.com/assets/img/int/instagram-icon.png" width="60px" height="60px">
|
|
81
69
|
</div>
|
|
82
70
|
<div class="title-version">
|
|
83
|
-
<p class="title">
|
|
84
|
-
<div class="status-box" style="padding: 0px 8px; letter-spacing: 1px; height: 18px;">
|
|
71
|
+
<p class="title">Instagram Connector</p>
|
|
72
|
+
<div class="status-box" style="padding: 0px 8px; letter-spacing: 1px; height: 18px;">
|
|
85
73
|
<p style="margin-bottom: 0px;">{{ app_version }}</p>
|
|
86
74
|
</div>
|
|
87
75
|
</div>
|
|
88
76
|
</div>
|
|
89
|
-
<div class="status-box">
|
|
90
|
-
<p style="margin-bottom: 0px; margin-right: 8px;">Status: </p>
|
|
91
|
-
{{#if
|
|
77
|
+
<div class="status-box">
|
|
78
|
+
<p style="margin-bottom: 0px; margin-right: 8px;">Status: </p>
|
|
79
|
+
{{#if ig_token}}
|
|
92
80
|
<i class="fa fa-circle green-circle"></i>
|
|
93
81
|
<p style="margin-bottom: 0px;">Connected</p>
|
|
94
82
|
{{else}}
|
|
95
83
|
<i class="fa fa-circle red-circle"></i>
|
|
96
|
-
<p style="margin-bottom: 0px;">Disconnected</p>
|
|
84
|
+
<p style="margin-bottom: 0px;">Disconnected</p>
|
|
97
85
|
{{/if}}
|
|
98
86
|
</div>
|
|
99
87
|
</div>
|
|
100
88
|
</div>
|
|
101
89
|
|
|
102
|
-
<!-- INFO BOX -->
|
|
103
|
-
{{#unless brand_name}}
|
|
104
90
|
<div class="info-box">
|
|
91
|
+
{{#unless brand_name}}
|
|
105
92
|
<div class="info-list">
|
|
106
93
|
<ul>
|
|
107
94
|
<div class="list-element">
|
|
108
|
-
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="
|
|
109
|
-
<h7>
|
|
110
|
-
</div>
|
|
111
|
-
<div class="list-element">
|
|
112
|
-
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="16" height="16" style="margin-right: 10px;"/>
|
|
113
|
-
<h7>Customer support agent engages with social media visitors with text, voice and video chat.</h7>
|
|
114
|
-
</div>
|
|
115
|
-
<div class="list-element">
|
|
116
|
-
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="16" height="16" style="margin-right: 10px;"/>
|
|
117
|
-
<h7>Allow offline messaging.</h7>
|
|
95
|
+
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="20" height="20" style="margin-right: 10px;"/>
|
|
96
|
+
<h7>Integrate Instagram DM with AI Manager.</h7>
|
|
118
97
|
</div>
|
|
119
98
|
<div class="list-element">
|
|
120
|
-
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="
|
|
121
|
-
<h7>
|
|
99
|
+
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="20" height="20" style="margin-right: 10px;"/>
|
|
100
|
+
<h7>Once a Direct Message is received on Instagram, receive an alert on your AI Manager account.</h7>
|
|
122
101
|
</div>
|
|
123
102
|
<div class="list-element">
|
|
124
|
-
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="
|
|
125
|
-
<h7>
|
|
103
|
+
<img src="https://cdn-icons-png.flaticon.com/512/1443/1443000.png" width="20" height="20" style="margin-right: 10px;"/>
|
|
104
|
+
<h7>Enable instant messaging and answer multiple conversations, everything from AI Manager account.</h7>
|
|
126
105
|
</div>
|
|
127
106
|
</ul>
|
|
128
107
|
</div>
|
|
108
|
+
{{/unless}}
|
|
129
109
|
</div>
|
|
130
|
-
{{/unless}}
|
|
131
110
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<div class="docs-box">
|
|
111
|
+
<div class="docs-box">
|
|
112
|
+
{{#unless brand_name}}
|
|
135
113
|
<div class="docs-section">
|
|
136
114
|
<p style="margin-top: 20px; font-size: 18px; font-weight: 600;">Before you start</p>
|
|
137
|
-
|
|
138
115
|
<div style="padding: 20px; background-color: #2fa2dc24; border-radius: 8px; width: 600px; margin-bottom: 5px;">
|
|
139
116
|
<div style="display: flex; flex-direction: row; align-items: baseline;">
|
|
140
117
|
<div>
|
|
141
|
-
<img src="https://
|
|
118
|
+
<img src="https://freeiconshop.com/wp-content/uploads/edd/arrow-flat.png" width="20px" height="auto" style="margin-right: 10px;">
|
|
142
119
|
</div>
|
|
143
120
|
<div>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
121
|
+
<a href="https://gethelp.tiledesk.com/articles/facebook-instagram/" target="_blank">How to integrate Instagram with AI Manager</a>
|
|
122
|
+
<p style="color: grey; margin-bottom: 0px;">Everything you need to know to integrate Instagram DM with AI Manager</p>
|
|
123
|
+
</div>
|
|
147
124
|
</div>
|
|
148
125
|
</div>
|
|
149
|
-
|
|
150
126
|
</div>
|
|
127
|
+
{{/unless}}
|
|
151
128
|
</div>
|
|
152
|
-
{{/unless}}
|
|
153
|
-
|
|
154
|
-
|
|
155
129
|
|
|
156
|
-
<!-- CONFIGURE BOX -->
|
|
157
130
|
<div class="configure-box">
|
|
158
|
-
|
|
159
|
-
|
|
160
131
|
<div class="configure">
|
|
161
132
|
<p class="title" style="margin-bottom: 20px;">Your Configuration</p>
|
|
162
133
|
|
|
163
|
-
{{#if
|
|
164
|
-
|
|
165
|
-
<div class="
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
</
|
|
174
|
-
</
|
|
175
|
-
</div>
|
|
176
|
-
-->
|
|
177
|
-
|
|
178
|
-
<!--
|
|
179
|
-
<p class="custom-label">Select the Facebook page to activate</p>
|
|
180
|
-
<div class="pages-container">
|
|
181
|
-
{{#each pages}}
|
|
182
|
-
<div class="page-button">
|
|
183
|
-
{{ name }}
|
|
184
|
-
</div>
|
|
185
|
-
{{/each}}
|
|
186
|
-
</div>
|
|
187
|
-
-->
|
|
188
|
-
<!--
|
|
189
|
-
<p>Tiledesk available on the page</p>
|
|
190
|
-
<div class="pages-container">
|
|
191
|
-
{{#each pages}}
|
|
192
|
-
{{#if (isEqual active true)}}
|
|
193
|
-
|
|
194
|
-
<div class="page-button">{{ name }}</div>
|
|
195
|
-
|
|
196
|
-
{{/if}}
|
|
197
|
-
{{/each}}
|
|
198
|
-
</div>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<p class="custom-label">Select the Facebook page to activate</p>
|
|
202
|
-
<div class="pages-container">
|
|
203
|
-
{{#each pages}}
|
|
204
|
-
{{#if (isEqual active false)}}
|
|
205
|
-
<form action="./enablePage" method="post">
|
|
206
|
-
<input type="hidden" name="project_id" value="{{ ../project_id }}">
|
|
207
|
-
<input type="hidden" name="app_id" value="{{ ../app_id }}">
|
|
208
|
-
<input type="hidden" name="token" value="{{ ../token }}">
|
|
209
|
-
<input type="hidden" name="page_name" value="{{ name }}">
|
|
210
|
-
<input type="submit" class="page-button" value="{{ name }}">
|
|
211
|
-
</form>
|
|
212
|
-
{{/if}}
|
|
213
|
-
{{/each}}
|
|
214
|
-
</div>
|
|
215
|
-
-->
|
|
216
|
-
|
|
217
|
-
<!--
|
|
218
|
-
<p class="custom-label">Select the Facebook page to activate</p>
|
|
219
|
-
<div class="pages-containter" style="display: flex;">
|
|
220
|
-
{{#each pages}}
|
|
221
|
-
{{#if (isEqual active true)}}
|
|
222
|
-
|
|
223
|
-
<button class="page-item-selected">
|
|
224
|
-
<div class="image-container">
|
|
225
|
-
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/04/Facebook_f_logo_%282021%29.svg/2048px-Facebook_f_logo_%282021%29.svg.png" width="30" height="auto">
|
|
226
|
-
<img src="https://static.vecteezy.com/system/resources/previews/010/152/436/original/tick-check-mark-icon-sign-symbol-design-free-png.png" width="30" height="auto">
|
|
227
|
-
|
|
228
|
-
</div>
|
|
229
|
-
<div class="name-container">{{ name }}</div>
|
|
230
|
-
</button>
|
|
231
|
-
{{else}}
|
|
232
|
-
<button class="page-item">
|
|
233
|
-
<div class="image-container">
|
|
234
|
-
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/04/Facebook_f_logo_%282021%29.svg/2048px-Facebook_f_logo_%282021%29.svg.png" width="30" height="auto">
|
|
235
|
-
</div>
|
|
236
|
-
<div class="name-container">{{ name }}</div>
|
|
237
|
-
</button>
|
|
238
|
-
{{/if}}
|
|
239
|
-
{{/each}}
|
|
240
|
-
</div>
|
|
241
|
-
-->
|
|
242
|
-
|
|
243
|
-
<p class="custom-label">Select the Facebook page to activate</p>
|
|
244
|
-
<div class="pages-container">
|
|
245
|
-
{{#each pages}}
|
|
246
|
-
|
|
247
|
-
{{#if (isEqual active true)}}
|
|
248
|
-
|
|
249
|
-
<form action="./disablePage" method="post">
|
|
250
|
-
<div class="over-input-div-selected" onclick="submitInputSelected.click()">
|
|
251
|
-
<div style="display: flex; justify-content: space-between; align_items: center;">
|
|
252
|
-
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/04/Facebook_f_logo_%282021%29.svg/2048px-Facebook_f_logo_%282021%29.svg.png" width="30" height="auto">
|
|
253
|
-
<img class="tick-image" src="https://static.vecteezy.com/system/resources/previews/010/152/436/original/tick-check-mark-icon-sign-symbol-design-free-png.png" width="30" height="auto">
|
|
254
|
-
</div>
|
|
255
|
-
<div style="display: flex; justify-content: center; color: #bdbdbd">Tap to disable</div>
|
|
256
|
-
</div>
|
|
257
|
-
|
|
258
|
-
<input type="hidden" name="project_id" value="{{ ../project_id }}">
|
|
259
|
-
<input type="hidden" name="app_id" value="{{ ../app_id }}">
|
|
260
|
-
<input type="hidden" name="token" value="{{ ../token }}">
|
|
261
|
-
<input type="hidden" name="page_name" value="{{ name }}">
|
|
262
|
-
<input id="submitInputSelected" type="submit" class="page-button-selected-new" value="{{ name }}">
|
|
263
|
-
</form>
|
|
264
|
-
|
|
265
|
-
{{else}}
|
|
266
|
-
|
|
267
|
-
<form action="./enablePage" method="post">
|
|
268
|
-
<div class="over-input-div" onclick="submitInput.click()">
|
|
269
|
-
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/04/Facebook_f_logo_%282021%29.svg/2048px-Facebook_f_logo_%282021%29.svg.png" width="30" height="auto">
|
|
270
|
-
</div>
|
|
271
|
-
<input type="hidden" name="project_id" value="{{ ../project_id }}">
|
|
272
|
-
<input type="hidden" name="app_id" value="{{ ../app_id }}">
|
|
273
|
-
<input type="hidden" name="token" value="{{ ../token }}">
|
|
274
|
-
<input type="hidden" name="page_name" value="{{ name }}">
|
|
275
|
-
<input id="submitInput" type="submit" class="page-button-new" value="{{ name }}">
|
|
276
|
-
</form>
|
|
277
|
-
|
|
278
|
-
{{/if}}
|
|
279
|
-
|
|
280
|
-
{{/each}}
|
|
134
|
+
{{#if ig_token}}
|
|
135
|
+
<div style="min-width: 600px">
|
|
136
|
+
<div class="form-group" style="width: 522px;">
|
|
137
|
+
<label class="input-label" for="instagram_account">Instagram Account</label>
|
|
138
|
+
<div style="display: flex; flex-direction: row; align-items: center;">
|
|
139
|
+
<input type="text" class="form-control custom-input" value="{{ instagram_username }}" disabled placeholder="Connected Instagram account">
|
|
140
|
+
<span style="margin-left: 10px;">
|
|
141
|
+
<i class="fa fa-question-circle custom-tooltip">
|
|
142
|
+
<span class="custom-tooltiptext">The Instagram Business or Creator account connected via OAuth</span>
|
|
143
|
+
</i>
|
|
144
|
+
</span>
|
|
145
|
+
</div>
|
|
281
146
|
</div>
|
|
282
147
|
|
|
283
|
-
|
|
284
|
-
<div class="form-group" style="width: 522px; margin-top: 30px;">
|
|
148
|
+
<div class="form-group" style="width: 522px;">
|
|
285
149
|
<label class="input-label" for="department">Department <span style="font-weight: normal;">(Optional)</span></label>
|
|
286
|
-
<form id="selection-form" action="./update" method="post">
|
|
150
|
+
<form id="selection-form" action="./update" method="post">
|
|
287
151
|
<div style="display: flex; flex-direction: row; align-items: center;">
|
|
288
152
|
<select class="custom-select form-control" name="department" onchange="document.getElementById('selection-form').submit();">
|
|
289
153
|
{{#each departments}}
|
|
@@ -296,7 +160,7 @@
|
|
|
296
160
|
</select>
|
|
297
161
|
<span style="margin-left: 10px;">
|
|
298
162
|
<i class="fa fa-question-circle custom-tooltip">
|
|
299
|
-
<span class="custom-tooltiptext">Select the department where you want to open conversations coming from
|
|
163
|
+
<span class="custom-tooltiptext">Select the department where you want to open conversations coming from Instagram. Conversations are sent on the Default Department by default.</span>
|
|
300
164
|
</i>
|
|
301
165
|
</span>
|
|
302
166
|
</div>
|
|
@@ -305,74 +169,108 @@
|
|
|
305
169
|
<input type="hidden" name="token" value="{{ token }}">
|
|
306
170
|
</form>
|
|
307
171
|
</div>
|
|
308
|
-
|
|
309
|
-
|
|
172
|
+
</div>
|
|
310
173
|
{{else}}
|
|
311
|
-
|
|
174
|
+
<div>
|
|
175
|
+
<button class="btn" style="width: 200px; background-color: #0ba2dc; color: white; font-weight: 500;" onclick="connectInstagram()">Connect Instagram</button>
|
|
176
|
+
</div>
|
|
312
177
|
{{/if}}
|
|
313
178
|
|
|
314
|
-
|
|
315
179
|
</div>
|
|
180
|
+
</div>
|
|
316
181
|
|
|
182
|
+
{{#if ig_token}}
|
|
183
|
+
<div class="advanced-box">
|
|
184
|
+
<div class="advanced">
|
|
185
|
+
<p class="title" style="margin-bottom: 20px;">Advanced</p>
|
|
186
|
+
<form action="./update_advanced" id="advanced_form" method="post">
|
|
187
|
+
<div class="item">
|
|
188
|
+
<div class="toggle-pill-dark" style="display: flex; flex-direction: row; height: 26px;">
|
|
189
|
+
<div style="margin-right: 10px">
|
|
190
|
+
{{#if show_info_message}}
|
|
191
|
+
<input type="checkbox" id="show_info_message" name="show_info_message" checked onclick="update_advanced()">
|
|
192
|
+
{{else}}
|
|
193
|
+
<input type="checkbox" id="show_info_message" name="show_info_message" onclick="update_advanced()">
|
|
194
|
+
{{/if}}
|
|
195
|
+
<label for="show_info_message"></label>
|
|
196
|
+
<input type="hidden" name="project_id" value="{{ project_id }}" />
|
|
197
|
+
<input type="submit" style="display: none">
|
|
198
|
+
</div>
|
|
199
|
+
<p>Show info message</p>
|
|
200
|
+
</div>
|
|
201
|
+
<p class="option-description">Choose whether to send info messages on the visitor's chat.</p>
|
|
202
|
+
</div>
|
|
203
|
+
</form>
|
|
204
|
+
</div>
|
|
317
205
|
</div>
|
|
206
|
+
{{/if}}
|
|
318
207
|
|
|
319
|
-
|
|
208
|
+
{{#if ig_token}}
|
|
320
209
|
<div class="disconnect-box">
|
|
321
210
|
<div class="disconnect">
|
|
322
|
-
<p class="title" style="margin-bottom: 20px;"> Disconnect</p>
|
|
323
|
-
|
|
324
|
-
<!-- Disconnect Button -->
|
|
325
|
-
{{#if connected}}
|
|
211
|
+
<p class="title" style="margin-bottom: 20px;"> Disconnect</p>
|
|
326
212
|
<div>
|
|
327
213
|
{{#if brand_name}}
|
|
328
|
-
<p style="color: rgb(140, 140, 140);">The
|
|
214
|
+
<p style="color: rgb(140, 140, 140);">The Instagram App is configured on your {{ brand_name }} project.</p>
|
|
329
215
|
{{else}}
|
|
330
|
-
<p style="color: rgb(140, 140, 140);">The
|
|
216
|
+
<p style="color: rgb(140, 140, 140);">The Instagram App is configured on your AI Manager project.</p>
|
|
331
217
|
{{/if}}
|
|
332
|
-
|
|
333
|
-
<p>By clicking on disconnect you will no longer be able to receive messages from the WhatsApp channel</p>
|
|
218
|
+
<p>By clicking on disconnect you will no longer be able to receive messages from the Instagram channel</p>
|
|
334
219
|
<form action="./disconnect" method="post">
|
|
335
220
|
<input type="hidden" name="project_id" value="{{ project_id }}">
|
|
336
|
-
|
|
337
|
-
|
|
221
|
+
<input type="hidden" name="token" value="{{ token }}">
|
|
222
|
+
<input type="hidden" name="subscription_id" value="{{ subscription_id }}">
|
|
338
223
|
<input type="submit" class="btn disconnect-button" style="margin-top: 10px; width: 160px;" value="Disconnect">
|
|
339
224
|
</form>
|
|
340
225
|
</div>
|
|
341
|
-
|
|
342
|
-
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
{{else}}
|
|
229
|
+
<div class="disconnect-box" style="background-color: white;">
|
|
230
|
+
<div class="disconnect">
|
|
231
|
+
<p class="title" style="margin-bottom: 20px;"> Disconnect</p>
|
|
232
|
+
<div>
|
|
343
233
|
{{#if brand_name}}
|
|
344
|
-
<p style="color: rgb(140, 140, 140);">The
|
|
234
|
+
<p style="color: rgb(140, 140, 140);">The Instagram App is not yet configured on your {{ brand_name}} project.</p>
|
|
345
235
|
{{else}}
|
|
346
|
-
<p style="color: rgb(140, 140, 140);">The
|
|
236
|
+
<p style="color: rgb(140, 140, 140);">The Instagram App is not yet configured on your AI Manager project.</p>
|
|
347
237
|
{{/if}}
|
|
348
|
-
|
|
238
|
+
</div>
|
|
349
239
|
</div>
|
|
350
240
|
</div>
|
|
241
|
+
{{/if}}
|
|
351
242
|
|
|
243
|
+
<script>
|
|
244
|
+
|
|
245
|
+
function connectInstagram() {
|
|
246
|
+
var width = 600;
|
|
247
|
+
var height = 700;
|
|
248
|
+
var left = (screen.width - width) / 2;
|
|
249
|
+
var top = (screen.height - height) / 2;
|
|
250
|
+
var oauthUrl = './auth/instagram/start?project_id={{ project_id }}&token={{ token }}&app_id={{ app_id }}';
|
|
251
|
+
var popup = window.open(oauthUrl, 'instagram-oauth', 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
|
|
252
|
+
|
|
253
|
+
var timer = setInterval(function() {
|
|
254
|
+
try {
|
|
255
|
+
if (popup.closed) {
|
|
256
|
+
clearInterval(timer);
|
|
257
|
+
window.location.reload();
|
|
258
|
+
}
|
|
259
|
+
} catch (e) {
|
|
260
|
+
|
|
261
|
+
}
|
|
262
|
+
}, 1000);
|
|
263
|
+
}
|
|
352
264
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
function copyTextToClipboard() {
|
|
356
|
-
const proxyUrl = document.getElementById('proxy_url').select()
|
|
357
|
-
|
|
358
|
-
//document.querySelector('textarea').select();
|
|
265
|
+
function update_advanced() {
|
|
359
266
|
try {
|
|
360
|
-
document.
|
|
361
|
-
console.log('Async: Copied to clipboard!');
|
|
362
|
-
let el1 = document.getElementById('copy-div');
|
|
363
|
-
el1.style.visibility = 'hidden';
|
|
364
|
-
|
|
365
|
-
let el2 = document.getElementById('copied-div');
|
|
366
|
-
el2.style.visibility = 'visible';
|
|
367
|
-
|
|
368
|
-
//let btn = document.getElementById('copy-btn');
|
|
369
|
-
//btn.value = "Copied!";
|
|
267
|
+
document.getElementById("advanced_form").submit();
|
|
370
268
|
} catch (err) {
|
|
371
|
-
console.error('
|
|
269
|
+
console.error('Could not update advanced options: ', err);
|
|
372
270
|
}
|
|
373
271
|
}
|
|
374
|
-
|
|
272
|
+
|
|
375
273
|
</script>
|
|
376
|
-
|
|
274
|
+
|
|
377
275
|
</body>
|
|
378
|
-
</html>
|
|
276
|
+
</html>
|
package/template/detail.html
CHANGED
|
@@ -6,21 +6,16 @@
|
|
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
|
|
9
|
-
<!-- Bootstrap 5.3 CSS -->
|
|
10
9
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
11
10
|
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
|
12
11
|
crossorigin="anonymous">
|
|
13
12
|
|
|
14
|
-
<!-- Font Awesome 7 (latest version) -->
|
|
15
13
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" crossorigin="anonymous" />
|
|
16
|
-
|
|
17
|
-
<!-- Font Poppins -->
|
|
14
|
+
|
|
18
15
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet" />
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
<link rel="stylesheet" href="./css/detail.css">
|
|
17
|
+
<link rel="stylesheet" href="./css/detail.css">
|
|
22
18
|
|
|
23
|
-
<!-- Bootstrap 5.3 JavaScript Bundle (include Popper) -->
|
|
24
19
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
25
20
|
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
26
21
|
crossorigin="anonymous">
|
|
@@ -36,11 +31,11 @@
|
|
|
36
31
|
<body style="display: flex; justify-content: center;">
|
|
37
32
|
<div class="content">
|
|
38
33
|
<div style="margin-top: 10px;">
|
|
39
|
-
<p style="font-size: 20px;">
|
|
34
|
+
<p style="font-size: 20px;">AI Manager <b>App Store</b></p>
|
|
40
35
|
</div>
|
|
41
36
|
|
|
42
37
|
<hr style="margin-top: 10px; margin-bottom: 10px">
|
|
43
|
-
|
|
38
|
+
|
|
44
39
|
<div class="installation-info-box">
|
|
45
40
|
{{#if isAvailable}}
|
|
46
41
|
<p style="margin: 0px; color: #676767; font-size: 13px;">You can install this application for free.</p>
|
|
@@ -49,17 +44,16 @@
|
|
|
49
44
|
{{/if}}
|
|
50
45
|
</div>
|
|
51
46
|
|
|
52
|
-
|
|
53
47
|
<div class="icon-and-title" style="margin-top: 20px;">
|
|
54
48
|
<div>
|
|
55
|
-
<img src="https://
|
|
49
|
+
<img src="https://aimanager.resultcrafter.com/assets/img/int/instagram-icon.png" width="180" height="auto" />
|
|
56
50
|
</div>
|
|
57
|
-
|
|
51
|
+
|
|
58
52
|
<div style="display: flex; flex-direction: row; justify-content: space-between; margin-left: 40px; width: 100%;">
|
|
59
53
|
<div>
|
|
60
|
-
<p style="font-size: 26px; font-weight: 500; margin-bottom: 0px;">
|
|
61
|
-
<p style="color: #676767; font-size: 16px; margin-bottom: 5px;">Connect your
|
|
62
|
-
<a style="font-size: 18px;" href="https://
|
|
54
|
+
<p style="font-size: 26px; font-weight: 500; margin-bottom: 0px;">Instagram</p>
|
|
55
|
+
<p style="color: #676767; font-size: 16px; margin-bottom: 5px;">Connect your Instagram account with AI Manager</p>
|
|
56
|
+
<a style="font-size: 18px;" href="https://resultcrafter.com/" target="_blank">AI Manager</a>
|
|
63
57
|
|
|
64
58
|
{{#if isAvailable}}
|
|
65
59
|
<p style="font-size: 15px; color: #676767; font-style: italic; margin-bottom: 0px; margin-top: 20px;">Free</p>
|
|
@@ -73,31 +67,23 @@
|
|
|
73
67
|
</div>
|
|
74
68
|
|
|
75
69
|
<div style="display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end;">
|
|
76
|
-
|
|
70
|
+
|
|
77
71
|
{{#if installed}}
|
|
78
|
-
|
|
79
|
-
<!-- Open button -->
|
|
80
|
-
{{#if isAvailable}}
|
|
72
|
+
|
|
81
73
|
<form action="./configure" method="get">
|
|
82
74
|
<input type="hidden" name="project_id" value="{{ project_id }}" />
|
|
83
75
|
<input type="hidden" name="app_id" value="{{ app_id }}" />
|
|
84
76
|
<input type="hidden" name="token" value="{{ token }}" />
|
|
85
77
|
<input type="submit" class="btn install-button" value="Open">
|
|
86
78
|
</form>
|
|
87
|
-
|
|
88
|
-
<button class="btn install-button" disabled>Open</button>
|
|
89
|
-
{{/if}}
|
|
90
|
-
|
|
91
|
-
<!-- Uninstall button -->
|
|
79
|
+
|
|
92
80
|
<button class="btn uninstall-button" onclick="document.getElementById('uninstall-modal').style.display='flex'">Uninstall</button>
|
|
93
|
-
|
|
94
|
-
<!-- Uninstall modal -->
|
|
81
|
+
|
|
95
82
|
<div id="uninstall-modal" class="modal">
|
|
96
83
|
<div class="modal-content">
|
|
97
|
-
|
|
98
|
-
<h2>Facebook Instagram</h2>
|
|
84
|
+
<h2>Instagram</h2>
|
|
99
85
|
<div style="margin-top: 20px;">
|
|
100
|
-
<img src="https://
|
|
86
|
+
<img src="https://aimanager.resultcrafter.com/assets/img/int/instagram-icon.png" width="70" height="auto" />
|
|
101
87
|
</div>
|
|
102
88
|
<p style="margin-top: 20px; margin-bottom: 20px;">Are you sure you want to uninstall this app?</p>
|
|
103
89
|
|
|
@@ -113,7 +99,7 @@
|
|
|
113
99
|
</div>
|
|
114
100
|
</div>
|
|
115
101
|
</div>
|
|
116
|
-
|
|
102
|
+
|
|
117
103
|
{{else}}
|
|
118
104
|
|
|
119
105
|
{{#if isAvailable}}
|
|
@@ -121,14 +107,12 @@
|
|
|
121
107
|
{{else}}
|
|
122
108
|
<button class="btn install-button" disabled>Install</button>
|
|
123
109
|
{{/if}}
|
|
124
|
-
|
|
125
|
-
<!-- Install modal -->
|
|
110
|
+
|
|
126
111
|
<div id="install-modal" class="modal">
|
|
127
112
|
<div class="modal-content">
|
|
128
|
-
|
|
129
|
-
<h2>Facebook Instagram</h2>
|
|
113
|
+
<h2>Instagram</h2>
|
|
130
114
|
<div style="margin-top: 20px;">
|
|
131
|
-
<img src="https://
|
|
115
|
+
<img src="https://aimanager.resultcrafter.com/assets/img/int/instagram-icon.png" width="70" height="auto" />
|
|
132
116
|
</div>
|
|
133
117
|
<p style="margin-top: 20px; margin-bottom: 20px;">Are you sure you want to install this app?</p>
|
|
134
118
|
|
|
@@ -153,27 +137,18 @@
|
|
|
153
137
|
<hr style="margin-top: 20px; margin-bottom: 20px">
|
|
154
138
|
|
|
155
139
|
<p style="font-size: 18px;"><b>Screenshot from the application</b></p>
|
|
156
|
-
<!--<img src="https://media.discordapp.net/attachments/998542078587973734/1018841949534429184/2211.jpg?width=1055&height=686" style="width: 100%; height: 50%;"/>
|
|
157
|
-
<img src="https://images-ext-2.discordapp.net/external/iKwvEo-ovnWVU0wvDgOwYZXdI9jfL-kKVsTZE2-ha5M/%3Fcrop%3D1/https/tiledesk.com/wp-content/uploads/2022/08/banner-adaptive-part2-1200x480.png" style="width: 100%; height: auto;"/>-->
|
|
158
140
|
|
|
159
141
|
<div class="scrollmenu">
|
|
160
|
-
|
|
161
142
|
<img src="https://user-images.githubusercontent.com/45603238/195042381-995ff805-359d-4d97-af67-f86f937c175a.jpg" class="screenshot" />
|
|
162
|
-
|
|
163
143
|
<img src="https://user-images.githubusercontent.com/45603238/195042391-6560424b-6a20-48ef-a5b3-981f9cbda5db.jpg" class="screenshot" />
|
|
164
|
-
|
|
165
|
-
<img src=" https://user-images.githubusercontent.com/45603238/195042354-e8ce2b8b-4a82-45b6-8ac1-c1d1bcf77e40.jpg" class="screenshot"/>
|
|
166
|
-
|
|
144
|
+
<img src="https://user-images.githubusercontent.com/45603238/195042354-e8ce2b8b-4a82-45b6-8ac1-c1d1bcf77e40.jpg" class="screenshot"/>
|
|
167
145
|
<img src="https://user-images.githubusercontent.com/45603238/196982373-6b17cf76-6608-45bf-86da-551c14c46e0f.png" class="screenshot" />
|
|
168
|
-
|
|
169
|
-
|
|
170
146
|
</div>
|
|
171
|
-
|
|
172
|
-
|
|
147
|
+
|
|
173
148
|
<hr style="margin-top: 20px; margin-bottom: 20px">
|
|
174
149
|
|
|
175
150
|
<div>
|
|
176
|
-
<h7>Receive
|
|
151
|
+
<h7>Receive Instagram Direct Messages in your AI Manager dashboard. Seamlessly Chat with your targeted audience on Instagram right from the AI Manager dashboard.</h7>
|
|
177
152
|
|
|
178
153
|
<ul style="margin-top: 10px; padding: 0px;">
|
|
179
154
|
<div class="list-element">
|
|
@@ -198,40 +173,30 @@
|
|
|
198
173
|
</div>
|
|
199
174
|
</ul>
|
|
200
175
|
|
|
201
|
-
<!--
|
|
202
|
-
<ul style="padding: 10px 20px;">
|
|
203
|
-
<li><h7>Integrate your Whatsapp number with Tiledesk.</h7></li>
|
|
204
|
-
<li><h7>Once a chat is initiated on your Whatsapp number, receive an alert on your Tiledesk account.</h7></li>
|
|
205
|
-
<li><h7>Enable instant messaging and answer multiple conversations - everything from Tiledesk account.</h7></li>
|
|
206
|
-
</ul>-->
|
|
207
|
-
|
|
208
176
|
<div style="padding: 20px; background-color: aliceblue; border-radius: 8px;">
|
|
209
177
|
<div style="display: flex; flex-direction: row; align-items: baseline;">
|
|
210
178
|
<div>
|
|
211
|
-
<img src="https://freeiconshop.com/wp-content/uploads/edd/arrow-flat.png" width="20px" height="auto" style="margin-right: 10px;">
|
|
179
|
+
<img src="https://freeiconshop.com/wp-content/uploads/edd/arrow-flat.png" width="20px" height="auto" style="margin-right: 10px;">
|
|
212
180
|
</div>
|
|
213
181
|
<div>
|
|
214
|
-
<a href="https://gethelp.tiledesk.com/articles/facebook-instagram/" target="_blank">How to integrate
|
|
215
|
-
<p style="color: grey; margin-bottom: 0px;">Everything you need to know to integrate
|
|
182
|
+
<a href="https://gethelp.tiledesk.com/articles/facebook-instagram/" target="_blank">How to integrate Instagram with AI Manager</a>
|
|
183
|
+
<p style="color: grey; margin-bottom: 0px;">Everything you need to know to integrate Instagram DM with AI Manager</p>
|
|
216
184
|
</div>
|
|
217
185
|
</div>
|
|
218
|
-
|
|
219
|
-
|
|
220
186
|
</div>
|
|
221
187
|
</div>
|
|
222
188
|
|
|
223
|
-
|
|
224
189
|
<hr style="margin-top: 20px; margin-bottom: 20px">
|
|
225
190
|
|
|
226
191
|
<p style="font-size: 18px;"><b>What's new?</b></p>
|
|
227
|
-
|
|
192
|
+
|
|
228
193
|
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 15px;">
|
|
229
194
|
<div>
|
|
230
195
|
<p style="margin-bottom: 0px">Bug fixes and minor improvements</p>
|
|
231
196
|
</div>
|
|
232
197
|
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.19</b></p>
|
|
233
198
|
</div>
|
|
234
|
-
|
|
199
|
+
|
|
235
200
|
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 15px;">
|
|
236
201
|
<div>
|
|
237
202
|
<p style="margin-bottom: 0px">Plans upgrade</p>
|
|
@@ -246,51 +211,7 @@
|
|
|
246
211
|
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.16</b></p>
|
|
247
212
|
</div>
|
|
248
213
|
|
|
249
|
-
<!--
|
|
250
|
-
|
|
251
|
-
<hr style="margin-top: 20px; margin-bottom: 20px">
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
<p style="font-size: 18px;"><b>Other from Tiledesk</b> <a onclick="getParent()" target="_blank" style="font-size: 13px; margin-left: 15px;">View all</a></p>
|
|
255
|
-
|
|
256
|
-
<div>
|
|
257
|
-
<p>Visit our store and discovery all the available apps!</p>
|
|
258
|
-
</div>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
<div style="display: flex;">
|
|
262
|
-
<div class="app-summary-div">
|
|
263
|
-
<img src="https://cdn3.iconfinder.com/data/icons/social-media-chamfered-corner/154/telegram-512.png" width="110" height="auto">
|
|
264
|
-
<p class="app-summary-name">Telegram</p>
|
|
265
|
-
</div>
|
|
266
|
-
|
|
267
|
-
<div class="app-summary-div">
|
|
268
|
-
<img src="https://cdn.jim-nielsen.com/ios/512/instagram-2020-11-17.png" width="110" height="auto">
|
|
269
|
-
<p class="app-summary-name">Facebook Instagram</p>
|
|
270
|
-
</div>
|
|
271
|
-
|
|
272
|
-
<div class="app-summary-div">
|
|
273
|
-
<img src="https://i.ibb.co/yWz3bZ5/2022-04-21-11-28-20.jpg" width="110" height="auto">
|
|
274
|
-
<p class="app-summary-name">Help Center</p>
|
|
275
|
-
</div>
|
|
276
|
-
|
|
277
|
-
<div class="app-summary-div">
|
|
278
|
-
<img src="https://i.pinimg.com/474x/f4/07/55/f407552380549b7ce1b508c5a6639b38.jpg" width="110" height="auto">
|
|
279
|
-
<p class="app-summary-name">Github</p>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
-->
|
|
283
|
-
|
|
284
214
|
<hr style="margin-top: 50px; margin-bottom: 20px">
|
|
285
215
|
|
|
286
|
-
<!--
|
|
287
|
-
<script>
|
|
288
|
-
function getParent() {
|
|
289
|
-
let parent_base = document.referrer;
|
|
290
|
-
let app_store_url = parent_base + "dashboard/#/project/"+ {{project_id}} +"/app-store/"
|
|
291
|
-
}
|
|
292
|
-
</script>
|
|
293
|
-
-->
|
|
294
|
-
|
|
295
|
-
|
|
296
216
|
</body>
|
|
217
|
+
</html>
|
package/template/error.html
CHANGED
|
@@ -6,21 +6,16 @@
|
|
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
8
|
|
|
9
|
-
<!-- Bootstrap 5.3 CSS -->
|
|
10
9
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
|
11
10
|
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
|
12
11
|
crossorigin="anonymous">
|
|
13
12
|
|
|
14
|
-
<!-- Font Awesome 7 (latest version) -->
|
|
15
13
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" crossorigin="anonymous" />
|
|
16
|
-
|
|
17
|
-
<!-- Font Poppins -->
|
|
14
|
+
|
|
18
15
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet" />
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
<link rel="stylesheet" href="./css/error.css">
|
|
17
|
+
<link rel="stylesheet" href="./css/error.css">
|
|
22
18
|
|
|
23
|
-
<!-- Bootstrap 5.3 JavaScript Bundle (include Popper) -->
|
|
24
19
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
25
20
|
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
|
26
21
|
crossorigin="anonymous">
|
|
@@ -31,22 +26,20 @@
|
|
|
31
26
|
font-family: 'Poppins', serif;
|
|
32
27
|
}
|
|
33
28
|
</style>
|
|
34
|
-
|
|
29
|
+
|
|
35
30
|
</head>
|
|
36
31
|
|
|
37
|
-
|
|
38
32
|
<body>
|
|
39
|
-
|
|
40
|
-
<!-- HEADER -->
|
|
33
|
+
|
|
41
34
|
<div class="header">
|
|
42
35
|
<div class="header-content">
|
|
43
36
|
<div class="logo-title">
|
|
44
37
|
<div class="logo-container">
|
|
45
|
-
<img src="https://
|
|
38
|
+
<img src="https://aimanager.resultcrafter.com/assets/img/int/instagram-icon.png" width="60px" height="60px">
|
|
46
39
|
</div>
|
|
47
40
|
<div class="title-version">
|
|
48
|
-
<p class="title">
|
|
49
|
-
<div class="status-box" style="padding: 0px 8px; letter-spacing: 1px; height: 18px;">
|
|
41
|
+
<p class="title">Instagram Connector</p>
|
|
42
|
+
<div class="status-box" style="padding: 0px 8px; letter-spacing: 1px; height: 18px;">
|
|
50
43
|
<p style="margin-bottom: 0px;">{{ app_version }}</p>
|
|
51
44
|
</div>
|
|
52
45
|
</div>
|
|
@@ -60,5 +53,6 @@
|
|
|
60
53
|
<p>{{ error_message }}</p>
|
|
61
54
|
</div>
|
|
62
55
|
</div>
|
|
63
|
-
|
|
64
|
-
</body>
|
|
56
|
+
|
|
57
|
+
</body>
|
|
58
|
+
</html>
|