Commit c5082426 authored by Daniel Suarez Souto's avatar Daniel Suarez Souto
Browse files

First commit of nginx-proxy

parent 49d58cef
......@@ -336,7 +336,9 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
type: Array,
value: function() { return []; }
},
search:{
type:Object
},
filters: {
type: Array,
notify: true,
......@@ -410,12 +412,13 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
if (this.query.length == 0){
//console.log("default search fired")
this.filters = []
this.search = {}
this._query()
}
else {
console.log("Filter")
this.push('filters', {terms: {'schema:articleBody': [this.query]}});
//this.push('filters', {terms: {'schema:articleBody': [this.query]}});
this.search={"schema:articleBody":{"query":this.query,"operator":"and"}}
this._query()
}
......@@ -436,7 +439,8 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
query: {
bool: {
must: this.filters,
}
}/*,
match: this.search*/
},
aggs: {
type: {
......
......@@ -292,8 +292,8 @@ Data can be provided in one of three ways:
_selectionChanged: function() {
//console.log("_selectionChanged")
console.log(this.selection)
console.log(this.rows)
//console.log(this.selection)
//console.log(this.rows)
if(this.selection.length != 0){
var arr = this.rows;
var field = this.field
......@@ -301,52 +301,69 @@ Data can be provided in one of three ways:
var object={}
console.log(sel)
if(sel==null){
console.log("inside")
var col=this.selection[0].column
var param=arr[0][col]
field='schema:author.keyword'
}else{
this.param = arr[sel][0]
var param = this.param
}
var term1 = {};
console.log(field)
/*if (field == "schema:author"){
field = 'schema:author.keyword'
}*/
if (field == "sentiment") field = 'sentiments.marl:hasPolarity'
if (field == "sentiment"){
field = 'sentiments.marl:hasPolarity.keyword'
this.param = arr[sel][0]
var param = this.param
term1[field] = param
}
if (field == "emotion") field = 'emotions.onyx:hasEmotion.onyx:hasEmotionCategory'
term1[field] = param.toLowerCase().split(" ");
if(sel==null){
//console.log("inside")
var col=this.selection[0].column
var param=arr[0][col]
console.log(col)
console.log(param)
field='schema:author.keyword'
var value=param.split(" ")[0]
console.log(value)
var sources=this.sources
for(var key in sources){
if(key.search(value)>=0){
console.log(key)
param=key
break
}
}
term1[field] = param;
}
if (field == 'schema:author.keyword'){
if (field == 'schema:author'){
field='schema:author.keyword'
var sources=this.sources
console.log(sources)
this.param = arr[sel][0]
var param = this.param
//console.log(sources)
var value=param.split(" ")[0]
console.log(value)
for(var key in sources){
console.log(key)
if(key.search(value)>=0)
param=key
if(key.search(value)>=0){
console.log(key)
param=key
break
}
}
term1[field] = param;
}
console.log(term1)
//console.log("param")
//console.log(param)
object = {terms: term1}
object = {term: term1}
if (field == 'schema:datePublished'){
console.log(arr)
//console.log(arr)
param=arr[sel+1][0]
console.log(param)
//console.log(param)
var date = param.toLowerCase().toString().split("-");
var term = date[1]+'-'+date[0]+'-01'
object = {range: {'schema:datePublished': {gte: term, boost: 5}}}
......@@ -471,7 +488,7 @@ Data can be provided in one of three ways:
},
_loadData: function() {
console.log("dataloaded")
//console.log("dataloaded")
this._canDraw = false;
if (this._isReady) {
if (typeof this.data == 'string' || this.data instanceof String) {
......@@ -503,7 +520,7 @@ Data can be provided in one of three ways:
},
_createDataTable: function(data) {
console.log("_createDataTable")
//console.log("_createDataTable")
var dataTable = null;
// If a data object was not passed to this function, default to the
// chart's data attribute. Passing a data object is necessary for
......@@ -516,7 +533,7 @@ Data can be provided in one of three ways:
}
if (!data)
data = [];
console.log(this.cols)
//console.log(this.cols)
if (this.rows && this.rows.length > 0 && this.cols &&
this.cols.length > 0) {
// Create the data table from cols and rows.
......@@ -531,7 +548,7 @@ Data can be provided in one of three ways:
// Create dataTable from the passed data or the data attribute.
// Data can be in the form of raw DataTable data or a two
// dimensional array.
console.log("_createDataTable2")
//console.log("_createDataTable2")
/*data=[
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
......@@ -544,7 +561,7 @@ Data can be provided in one of three ways:
this.rows.push(["9-2018", 2, 5, 4])
this.rows.push(["10-2018", 5, 3, 1])
this.rows.push(["12-2018", 1, 2, 4])*/
console.log(this.rows)
//console.log(this.rows)
if (this.rows && this.cols) {
dataTable = new google.visualization.DataTable(this.rows);
} else if (this.rows.length > 0) {
......@@ -580,17 +597,17 @@ Data can be provided in one of three ways:
var column_titles=['Date']
//var column_titles=["Date", "cnn", "Al Jazeera", "The New York Times"]
var sources=this.data.aggregations['schema:author'].buckets
console.log(sources)
//console.log(sources)
sources.forEach(function(source){
console.log(source)
//console.log(source)
if(source.key.search("Twitter")<0 && source.key.search("Rumiyah")<0 && source.key.search("Dabiq")<0)
column_titles.push(source.key)
})
console.log(column_titles)
//console.log(column_titles)
if(column_titles.length>1){
data.push(column_titles)
console.log(hits)
//console.log(hits)
hits.forEach(function(date) {
var row=[]
row.push(date.key_as_string)
......@@ -618,7 +635,7 @@ Data can be provided in one of three ways:
}else{
data=[]
}
console.log(data)
//console.log(data)
}
else if(this.field == "schema:author"){
var source=this.sources
......
......@@ -317,21 +317,25 @@
var text_highlighted= ""
var beginIndex = e.model.__data__.entity["nif:beginIndex"]
var endIndex = e.model.__data__.entity["nif:endIndex"]
var cnt=0
console.log(beginIndex)
console.log(endIndex)
//var subtext = text.substring(0,beginIndex)
if (beginIndex[0] >= 0) {
text_highlighted = text.substring(0,beginIndex[0]) + "<span class='highlight' style='background-color:yellow'>" + text.substring(beginIndex[0],endIndex[0]+1) + "</span>"
if(text[beginIndex[0]]===' ') cnt+=1
text_highlighted = text.substring(0,beginIndex[0]+cnt) + "<span class='highlight' style='background-color:yellow'>" + text.substring(beginIndex[0]+cnt,endIndex[0]+1+cnt) + "</span>"
for(var i =1 ; i<beginIndex.length;i++){
text_highlighted+=text.substring(endIndex[i-1]+1,beginIndex[i])
if(text[beginIndex[i]+cnt]===' ') cnt+=1
text_highlighted+=text.substring(endIndex[i-1]+1+cnt,beginIndex[i]+cnt)
text_highlighted+="<span class='highlight' style='background-color:yellow'>"
text_highlighted+=text.substring(beginIndex[i],endIndex[i]+1)
text_highlighted+=text.substring(beginIndex[i]+cnt,endIndex[i]+1+cnt)
text_highlighted+="</span>"
}
text_highlighted+= text.substring(endIndex[endIndex.length-1]+1)
text_highlighted+= text.substring(endIndex[endIndex.length-1]+1+cnt)
element.innerHTML = text_highlighted
//console.log(text_highlighted)
//console.log(cnt)
//console.log($('#'+element.parentElement.id+' span').position().top)
$('#'+element.parentElement.id).animate({scrollTop: $('#'+element.parentElement.id).scrollTop() + $('#'+element.parentElement.id + ' span').position().top - 200}, 400)
......
......@@ -265,9 +265,9 @@
getBg: function(entity){
if(!("@type" in entity)){
return "background-color: brown;margin-bottom:5px;"
} else if(entity["@type"] == "schema:Place") {
} else if(entity["@type"][0] == "schema:Place") {
return "background-color: #f90;margin-bottom:5px;"
} else if(entity["@type"] == "schema:Organization") {
} else if(entity["@type"][0] == "schema:Organization") {
return "background-color: #dd4b39;margin-bottom:5px;"
} else {
return "background-color: #00c0ef;margin-bottom:5px;"
......@@ -291,7 +291,7 @@
},
getUri: function(news){
//var uri="http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart']+"&view=FitB";
var uri="http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart']+"&view=FitB";
//console.log(uri)
......@@ -348,18 +348,22 @@
var text_highlighted=""
var beginIndex = e.model.__data__.entity["nif:beginIndex"]
var endIndex = e.model.__data__.entity["nif:endIndex"]
var cnt=0
if (beginIndex[0] >= 0) {
text_highlighted = text.substring(0,beginIndex[0]) + "<span class='highlight' style='background-color:yellow'>" + text.substring(beginIndex[0],endIndex[0]+1) + "</span>"
for(var i =1 ; i<beginIndex.length;i++){
text_highlighted+=text.substring(endIndex[i-1]+1,beginIndex[i])
text_highlighted+="<span class='highlight' style='background-color:yellow'>"
text_highlighted+=text.substring(beginIndex[i],endIndex[i]+1)
text_highlighted+="</span>"
}
text_highlighted+= text.substring(endIndex[endIndex.length-1]+1)
element.innerHTML = text_highlighted
//console.log(text_highlighted)
if(text[beginIndex[0]]===' ') cnt+=1
text_highlighted = text.substring(0,beginIndex[0]+cnt) + "<span class='highlight' style='background-color:yellow'>" + text.substring(beginIndex[0]+cnt,endIndex[0]+1+cnt) + "</span>"
for(var i =1 ; i<beginIndex.length;i++){
if(text[beginIndex[i]+cnt]===' ') cnt+=1
text_highlighted+=text.substring(endIndex[i-1]+1+cnt,beginIndex[i]+cnt)
text_highlighted+="<span class='highlight' style='background-color:yellow'>"
text_highlighted+=text.substring(beginIndex[i]+cnt,endIndex[i]+1+cnt)
text_highlighted+="</span>"
}
text_highlighted+= text.substring(endIndex[endIndex.length-1]+1+cnt)
element.innerHTML = text_highlighted
//console.log(text_highlighted)
//console.log(cnt)
// Select the tab
$('#tabText a').tab('show')
......@@ -373,7 +377,7 @@
setPDF: function(news, index) {
function loadPDF() {
var uri= "http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart'];
console.log(uri)
//console.log(uri)
$('#article'+index).off();
$('#article'+index+' li#tabArticle a').on('shown.bs.tab', function(event) {
if ($('#article'+index+' iframe').length === 0) {
......
......@@ -3,9 +3,7 @@ version: '3'
services:
sefarad:
build: .
image: registry.cluster.gsi.dit.upm.es/trivalent/dashboard-trivalent
ports:
- "8080:8080"
image: trivalent/dashboard-trivalent
volumes:
- .:/usr/src/app
environment:
......@@ -13,22 +11,14 @@ services:
- FUSEKI_ENDPOINT_EXTERNAL=${FUSEKI_ENDPOINT_EXTERNAL-localhost:9300}
networks:
- sefarad-network
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0
environment:
- "discovery.type=single-node"
- "xpack.security.enabled=false"
- "http.cors.enabled=true"
- "http.cors.allow-origin=*"
proxy:
build: nginx/.
image: trivalent/nginx-proxy-dashboard
ports:
- "9200:9200"
- "9300:9300"
networks:
- sefarad-network
- "8081:80"
networks:
sefarad-network:
driver: bridge
volumes:
esdata:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment