nodebb-plugin-dbsearch 5.1.5 → 6.0.0
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/lib/dbsearch.js +0 -1
- package/package.json +2 -2
- package/public/admin.js +1 -1
- package/templates/admin/plugins/dbsearch.tpl +73 -77
package/lib/dbsearch.js
CHANGED
|
@@ -366,7 +366,6 @@ async function reIndexPids(pids, topic) {
|
|
|
366
366
|
async function renderAdmin(req, res) {
|
|
367
367
|
const results = await getGlobalAndPluginData();
|
|
368
368
|
results.plugin.progressData = await getProgress();
|
|
369
|
-
results.plugin.csrf = req.csrfToken();
|
|
370
369
|
res.render('admin/plugins/dbsearch', results.plugin);
|
|
371
370
|
}
|
|
372
371
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-dbsearch",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "A Plugin that lets users search posts and topics",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
"eslint-plugin-import": "2.25.2"
|
|
28
28
|
},
|
|
29
29
|
"nbbpm": {
|
|
30
|
-
"compatibility": "^
|
|
30
|
+
"compatibility": "^3.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/public/admin.js
CHANGED
|
@@ -15,7 +15,7 @@ define('admin/plugins/dbsearch', ['alerts'], function (alerts) {
|
|
|
15
15
|
dbsearch.init = function () {
|
|
16
16
|
$('#save').on('click', function () {
|
|
17
17
|
$.post(config.relative_path + '/api/admin/plugins/dbsearch/save', {
|
|
18
|
-
_csrf:
|
|
18
|
+
_csrf: config.csrf_token,
|
|
19
19
|
topicLimit: $('#topicLimit').val(),
|
|
20
20
|
postLimit: $('#postLimit').val(),
|
|
21
21
|
excludeCategories: $('#exclude-categories').val(),
|
|
@@ -1,77 +1,73 @@
|
|
|
1
|
-
<div class="row">
|
|
2
|
-
<div class="col-
|
|
3
|
-
<div class="
|
|
4
|
-
|
|
5
|
-
<div class="
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
1
|
+
<div class="row">
|
|
2
|
+
<div class="col-12">
|
|
3
|
+
<div class="card">
|
|
4
|
+
<div class="card-header">DB Search</div>
|
|
5
|
+
<div class="card-body row">
|
|
6
|
+
<div class="col-6">
|
|
7
|
+
<div class="mb-3">
|
|
8
|
+
<div class="alert alert-info">
|
|
9
|
+
Topics Indexed: <strong id="topics-indexed">{topicsIndexed}</strong> / <strong>{topicCount}</strong>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div class="progress" style="height:24px;">
|
|
13
|
+
<div class="topic-progress progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:{progressData.topicsPercent}%;min-width: 2em;">{progressData.topicsPercent}%</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="mb-3">
|
|
17
|
+
<div class="alert alert-info">
|
|
18
|
+
Posts Indexed: <strong id="posts-indexed">{postsIndexed}</strong> / <strong>{postCount}</strong>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="progress" style="height:24px;">
|
|
21
|
+
<div class="post-progress progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:{progressData.postsPercent}%;min-width: 2em;">{progressData.postsPercent}%</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<button class="btn btn-warning" id="reindex" <!-- IF working -->disabled<!-- ENDIF working -->>Re Index</button>
|
|
26
|
+
<button class="btn btn-danger" id="clear-index">Clear Index</button>
|
|
27
|
+
<span id="work-in-progress" class="<!-- IF !working -->hidden<!-- ENDIF !working -->">
|
|
28
|
+
<i class="fa fa-gear fa-spin"></i> Working...
|
|
29
|
+
</span>
|
|
30
|
+
|
|
31
|
+
<hr/>
|
|
32
|
+
|
|
33
|
+
<!-- IF languageSupported -->
|
|
34
|
+
<div class="mb-3">
|
|
35
|
+
<label class="form-label">Index Language</label>
|
|
36
|
+
<select class="form-select" id="indexLanguage">
|
|
37
|
+
<!-- BEGIN languages -->
|
|
38
|
+
<option value="{languages.value}" <!-- IF languages.selected -->selected<!-- ENDIF languages.selected -->>{languages.name}</option>
|
|
39
|
+
<!-- END languages -->
|
|
40
|
+
</select>
|
|
41
|
+
</div>
|
|
42
|
+
<button class="btn btn-primary" id="changeLanguage">Change Language</button>
|
|
43
|
+
<hr/>
|
|
44
|
+
<!-- ENDIF languageSupported -->
|
|
45
|
+
|
|
46
|
+
<div class="mb-3">
|
|
47
|
+
<label class="form-label">Topic Limit</label>
|
|
48
|
+
<input id="topicLimit" type="text" class="form-control" placeholder="Number of topics to return" value="{topicLimit}">
|
|
49
|
+
</div>
|
|
50
|
+
<div class="mb-3">
|
|
51
|
+
<label class="form-label">Post Limit</label>
|
|
52
|
+
<input id="postLimit" type="text" class="form-control" placeholder="Number of posts to return" value="{postLimit}">
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div class="col-6">
|
|
57
|
+
<div class="post-search-item">
|
|
58
|
+
<label class="form-label">Select categories to exclude from indexing</label>
|
|
59
|
+
<select multiple class="form-select" id="exclude-categories" size="30">
|
|
60
|
+
<!-- BEGIN allCategories -->
|
|
61
|
+
<option value="{allCategories.value}" <!-- IF allCategories.selected -->selected<!-- ENDIF allCategories.selected -->>{allCategories.text}</option>
|
|
62
|
+
<!-- END allCategories -->
|
|
63
|
+
</select>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
|
|
72
|
+
<i class="material-icons">save</i>
|
|
73
|
+
</button>
|