Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IDsearch
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IDsearch
IDsearch
Commits
cd174f25
Commit
cd174f25
authored
Jul 11, 2017
by
Nacim Goura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add job
parent
1795aaff
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
220 additions
and
28 deletions
+220
-28
packages
.meteor/packages
+4
-4
release
.meteor/release
+1
-1
versions
.meteor/versions
+13
-13
crawlWebsite.js
imports/api/crawl/website/server/crawlWebsite.js
+1
-0
methods.js
imports/api/indexation/methods.js
+1
-1
indexGeneric.js
imports/api/indexation/server/indexGeneric.js
+4
-2
jobCollection.js
imports/api/job/jobCollection.js
+53
-0
methods.js
imports/api/job/methods.js
+27
-0
register-api.js
imports/startup/server/register-api.js
+2
-0
buttonTabular.html
imports/tabular/buttonTabular.html
+5
-0
configClient.js
imports/tabular/configClient.js
+1
-0
tabularJob.js
imports/tabular/tabularJob.js
+78
-0
indexation.js
imports/ui/pages/admin/indexation/indexation.js
+1
-0
job.html
imports/ui/pages/admin/indexation/job/job.html
+10
-0
job.js
imports/ui/pages/admin/indexation/job/job.js
+4
-0
website.html
imports/ui/pages/admin/indexation/website/website.html
+2
-2
settings.json
settings.json
+13
-5
No files found.
.meteor/packages
View file @
cd174f25
...
...
@@ -7,7 +7,7 @@
# base package
meteor-base@1.1.0 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.19-rc.
3
# The database Meteor supports right now
mongo@1.1.19-rc.
4
# The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.1.3 # Meteor's client-side reactive programming library
...
...
@@ -15,7 +15,7 @@ dynamic-import@0.1.1
# package for compile and minify
standard-minifier-css@1.3.4 # CSS minifier run for production mode
standard-minifier-js@2.1.1-rc.
3
# JS minifier run for production mode
standard-minifier-js@2.1.1-rc.
4
# JS minifier run for production mode
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.8.1 # Enable ECMAScript2015+ syntax in app code
fourseven:scss@4.5.0 # Compile scss to css
...
...
@@ -39,8 +39,8 @@ aldeed:autoform
matb33:collection-hooks
# package for user
accounts-base@1.3.1-rc.
3
accounts-password@1.4.0-rc.
3
accounts-base@1.3.1-rc.
4
accounts-password@1.4.0-rc.
4
alanning:roles
# other packages
...
...
.meteor/release
View file @
cd174f25
METEOR@1.5.1-rc.
3
METEOR@1.5.1-rc.
4
.meteor/versions
View file @
cd174f25
accounts-base@1.3.1-rc.
3
accounts-password@1.4.0-rc.
3
accounts-base@1.3.1-rc.
4
accounts-password@1.4.0-rc.
4
alanning:roles@1.2.16
aldeed:autoform@6.2.0
aldeed:collection2-core@2.0.1
aldeed:tabular@2.1.1
aldeed:template-extension@4.1.0
allow-deny@1.0.6-rc.
3
allow-deny@1.0.6-rc.
4
autoupdate@1.3.12
babel-compiler@6.19.
3
babel-compiler@6.19.
4-rc.4
babel-runtime@1.0.1
base64@1.0.10
binary-heap@1.0.10
...
...
@@ -22,11 +22,11 @@ check@1.2.5
coffeescript@1.12.6_1
cosmos:browserify@0.10.0
dburles:collection-helpers@1.1.0
ddp@1.3.0-rc.
3
ddp-client@2.0.0-rc.
3
ddp-common@1.2.9-rc.
3
ddp@1.3.0-rc.
4
ddp-client@2.0.0-rc.
4
ddp-common@1.2.9-rc.
4
ddp-rate-limiter@1.0.7
ddp-server@2.0.0-rc.
3
ddp-server@2.0.0-rc.
4
deanius:promise@3.1.3
deps@1.0.12
diff-sequence@1.0.7
...
...
@@ -56,17 +56,17 @@ livedata@1.0.18
localstorage@1.1.0
logging@1.1.17
matb33:collection-hooks@0.8.4
meteor@1.7.0-rc.
3
meteor@1.7.0-rc.
4
meteor-base@1.1.0
minifier-css@1.2.16
minifier-js@2.1.1-rc.
3
minifier-js@2.1.1-rc.
4
minimongo@1.2.1
mobile-experience@1.0.4
mobile-status-bar@1.0.14
modules@0.9.2
modules-runtime@0.8.0
momentjs:moment@2.18.1
mongo@1.1.19-rc.
3
mongo@1.1.19-rc.
4
mongo-id@1.0.6
npm-bcrypt@0.9.3
npm-mongo@2.2.24
...
...
@@ -96,7 +96,7 @@ spacebars@1.0.15
spacebars-compiler@1.1.2
srp@1.0.10
standard-minifier-css@1.3.4
standard-minifier-js@2.1.1-rc.
3
standard-minifier-js@2.1.1-rc.
4
templating@1.3.2
templating-compiler@1.3.2
templating-runtime@1.3.2
...
...
@@ -107,5 +107,5 @@ tracker@1.1.3
ui@1.0.13
underscore@1.0.10
url@1.1.0
webapp@1.3.17-rc.
3
webapp@1.3.17-rc.
4
webapp-hashing@1.0.9
imports/api/crawl/website/server/crawlWebsite.js
View file @
cd174f25
...
...
@@ -12,6 +12,7 @@ export default class crawlWebsite extends CrawlGeneric {
/**
* crawl list urls
* @param data
* @param contextIndex
* @returns {Promise}
*/
constructor
(
data
,
contextIndex
)
{
...
...
imports/api/indexation/methods.js
View file @
cd174f25
...
...
@@ -18,7 +18,7 @@ export function initIndexElastic() {
export
function
reIndexElastic
()
{
this
.
unblock
();
const
index
=
new
IndexGeneric
();
return
index
.
reIndex
();
return
index
.
reIndex
(
Meteor
.
userId
()
);
}
export
function
indexWebsite
(
data
)
{
...
...
imports/api/indexation/server/indexGeneric.js
View file @
cd174f25
...
...
@@ -21,13 +21,15 @@ export default class IndexGeneric {
return
elastic
.
bulk
(
data
,
hasFile
);
}
reIndex
()
{
reIndex
(
esType
)
{
const
body
=
{
source
:
{
index
:
'
idsearch
'
,
type
:
esType
,
},
dest
:
{
index
:
'
idsearch2
'
,
index
:
'
idsearch
'
,
type
:
esType
,
},
};
return
elastic
.
reIndex
(
body
);
...
...
imports/api/job/jobCollection.js
0 → 100644
View file @
cd174f25
import
SimpleSchema
from
'
simpl-schema
'
;
import
{
Mongo
}
from
'
meteor/mongo
'
;
/**
* this collection keep tracks of all notification of this application
* @type {Mongo.Collection}
*/
const
jobsCollection
=
new
Mongo
.
Collection
(
'
jobs
'
);
SimpleSchema
.
jobsCollection
=
new
SimpleSchema
({
status
:
{
type
:
String
,
allowedValues
:
[
'
running
'
,
'
stop
'
],
/* autoValue() {
return 'stop';
},*/
defaultValue
:
'
stop
'
,
},
type
:
{
type
:
String
,
allowedValues
:
[
'
website
'
,
'
api
'
,
'
network
'
],
},
name
:
{
type
:
String
,
},
task
:
{
type
:
Object
,
blackbox
:
true
,
defaultValue
:
{},
},
scheduledDate
:
{
type
:
Date
,
required
:
false
,
},
lastExecutionDate
:
{
type
:
Date
,
required
:
false
,
},
userId
:
{
type
:
String
,
},
createdAt
:
{
type
:
Date
,
autoValue
()
{
return
new
Date
();
},
},
});
jobsCollection
.
attachSchema
(
SimpleSchema
.
jobsCollection
);
export
default
jobsCollection
;
imports/api/job/methods.js
0 → 100644
View file @
cd174f25
import
{
Meteor
}
from
'
meteor/meteor
'
;
import
jobCollection
from
'
/imports/api/job/jobCollection
'
;
export
function
addJob
(
data
)
{
check
(
data
,
Object
);
const
job
=
{};
if
(
data
.
urlWebsite
)
{
job
.
type
=
'
website
'
;
job
.
name
=
data
.
urlWebsite
;
}
job
.
userId
=
Meteor
.
userId
();
jobCollection
.
insert
(
job
);
}
export
function
startJob
(
job
)
{
// start job
}
export
function
removeJob
(
id
)
{
jobCollection
.
remove
({
_id
:
id
});
}
Meteor
.
methods
({
addJob
,
removeJob
,
});
imports/startup/server/register-api.js
View file @
cd174f25
// methods
import
'
/imports/api/indexation/methods
'
;
import
'
/imports/api/job/methods
'
;
import
'
/imports/api/account/methods
'
;
import
'
/imports/api/config/methods
'
;
import
'
/imports/api/notif/methods
'
;
...
...
@@ -16,3 +17,4 @@ import '/imports/tabular/tabularUser';
import
'
/imports/tabular/tabularTestSearch
'
;
import
'
/imports/tabular/tabularNotif
'
;
import
'
/imports/tabular/tabularFile
'
;
import
'
/imports/tabular/tabularJob
'
;
imports/tabular/buttonTabular.html
View file @
cd174f25
...
...
@@ -14,3 +14,8 @@
{{/with}}
<button
type=
"button"
class=
"btn btn-xs btn-danger delete-network-file"
>
Supprimer
</button>
</template>
<template
name=
"jobActionTable"
>
<button
type=
"button"
class=
"btn btn-xs btn-primary"
>
Démarrer
</button>
<button
type=
"button"
class=
"btn btn-xs btn-danger"
>
Supprimer
</button>
</template>
imports/tabular/configClient.js
View file @
cd174f25
...
...
@@ -7,5 +7,6 @@ import './tabularUser';
import
'
./tabularTestSearch
'
;
import
'
./tabularNotif
'
;
import
'
./tabularFile
'
;
import
'
./tabularJob
'
;
dataTablesBootstrap
(
window
,
$
);
imports/tabular/tabularJob.js
0 → 100644
View file @
cd174f25
import
Tabular
from
'
meteor/aldeed:tabular
'
;
import
moment
from
'
moment
'
;
import
jobsCollection
from
'
/imports/api/job/jobCollection
'
;
new
Tabular
.
Table
({
name
:
'
Jobs
'
,
collection
:
jobsCollection
,
columns
:
[
{
data
:
'
type
'
,
title
:
'
Type
'
,
},
{
data
:
'
name
'
,
title
:
'
Nom
'
,
},
{
data
:
'
status
'
,
title
:
'
Status
'
,
render
(
val
,
type
,
doc
)
{
return
`<span class="label label-default">
${
val
}
</span>`
;
},
},
{
data
:
'
task
'
,
title
:
'
Tâche
'
,
},
{
data
:
'
scheduledDate
'
,
title
:
'
Date programmé
'
,
render
(
val
,
type
,
doc
)
{
return
val
&&
moment
(
val
).
format
(
'
LLL
'
);
},
},
{
data
:
'
lastExecutionDate
'
,
title
:
'
Date dernière exécution
'
,
render
(
val
,
type
,
doc
)
{
return
val
&&
moment
(
val
).
format
(
'
LLL
'
);
},
},
{
data
:
'
createdAt
'
,
title
:
'
Date de création
'
,
render
(
val
,
type
,
doc
)
{
return
val
&&
moment
(
val
).
format
(
'
LLL
'
);
},
},
{
title
:
'
Action
'
,
tmpl
:
Meteor
.
isClient
&&
Template
.
jobActionTable
,
},
],
selector
()
{
return
{
userId
:
Meteor
.
userId
()
};
},
pageLength
:
20
,
language
:
{
sProcessing
:
'
Traitement en cours...
'
,
sSearch
:
'
Rechercher :
'
,
sLengthMenu
:
'
Afficher _MENU_ éléments
'
,
sInfo
:
"
Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments
"
,
sInfoEmpty
:
"
Affichage de l'élément 0 à 0 sur 0 élément
"
,
sInfoFiltered
:
'
(filtré de _MAX_ éléments au total)
'
,
sInfoPostFix
:
''
,
sLoadingRecords
:
'
Chargement en cours...
'
,
sZeroRecords
:
'
Aucun élément à afficher
'
,
sEmptyTable
:
'
Aucune donnée disponible dans le tableau
'
,
oPaginate
:
{
sFirst
:
'
Premier
'
,
sPrevious
:
'
Précédent
'
,
sNext
:
'
Suivant
'
,
sLast
:
'
Dernier
'
,
},
oAria
:
{
sSortAscending
:
'
: activer pour trier la colonne par ordre croissant
'
,
sSortDescending
:
'
: activer pour trier la colonne par ordre décroissant
'
,
},
},
});
imports/ui/pages/admin/indexation/indexation.js
View file @
cd174f25
...
...
@@ -5,6 +5,7 @@ import { Session } from 'meteor/session';
import
TabsCollection
from
'
/imports/api/tabs/tabsCollection
'
;
import
'
/imports/ui/components/tabs/tabs
'
;
import
'
./job/job
'
;
import
'
./main/main
'
;
import
'
./website/website
'
;
import
'
./api/api
'
;
...
...
imports/ui/pages/admin/indexation/job/job.html
0 → 100644
View file @
cd174f25
<template
name=
"jobIndexationTpl"
>
<div
class=
"panel panel-default wrapper"
>
<h3
class=
"text-center"
>
Liste des jobs
</h3>
<div
class=
"panel-body"
>
{{> tabular table=TabularTables.Jobs class="table table-bordered table-condensed text-center"}}
</div>
</div>
</template>
imports/ui/pages/admin/indexation/job/job.js
0 → 100644
View file @
cd174f25
import
'
/imports/tabular/configClient
'
;
import
'
./job.html
'
;
imports/ui/pages/admin/indexation/website/website.html
View file @
cd174f25
...
...
@@ -5,10 +5,10 @@
<div
class=
"panel panel-default wrapper"
>
<div
class=
"panel-body"
>
<h4
class=
"text-center"
>
Gestion de l'indexation des sites
</h4>
{{#autoForm id="formWebsiteCrawl" schema=formWebsiteCrawlSchema
buttonContent="Indexer" type="method" meteormethod="indexWebsite
" }}
{{#autoForm id="formWebsiteCrawl" schema=formWebsiteCrawlSchema
type="method" meteormethod="addJob
" }}
{{> afQuickField name='urlWebsite'}}
{{> afQuickField name='nameConfig' options=optionSelectConfig }}
<button
type=
"submit"
class=
"btn btn-success"
>
Index
er
</button>
<button
type=
"submit"
class=
"btn btn-success"
>
Valid
er
</button>
{{/autoForm}}
<hr>
...
...
settings.json
View file @
cd174f25
{
"private"
:
{
"elasticsearch"
:
{
"host"
:
"localhost:9201"
,
"esIndex"
:
"idsearch"
"host"
:
"localhost:9201"
}
},
"public"
:
{
...
...
@@ -17,6 +16,15 @@
"closable"
:
false
,
"sort"
:
1
},
{
"module"
:
"indexation"
,
"layout"
:
"jobIndexationTpl"
,
"label"
:
"Job"
,
"state"
:
{},
"activ"
:
false
,
"closable"
:
false
,
"sort"
:
2
},
{
"module"
:
"indexation"
,
"layout"
:
"siteIndexationTpl"
,
...
...
@@ -24,7 +32,7 @@
"state"
:
{},
"activ"
:
false
,
"closable"
:
false
,
"sort"
:
2
"sort"
:
3
},
{
"module"
:
"indexation"
,
...
...
@@ -33,7 +41,7 @@
"state"
:
{},
"activ"
:
false
,
"closable"
:
false
,
"sort"
:
3
"sort"
:
4
},
{
"module"
:
"indexation"
,
...
...
@@ -42,7 +50,7 @@
"state"
:
{},
"activ"
:
false
,
"closable"
:
false
,
"sort"
:
4
"sort"
:
5
}
],
"account"
:
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment