Commit ea082fb2 authored by PkSM3's avatar PkSM3

[UPDATE] monitorer ok, but on hold for the moment

parent 73e3d6d5
...@@ -6,6 +6,8 @@ from rest_v1_0 import api, ngrams, graph ...@@ -6,6 +6,8 @@ from rest_v1_0 import api, ngrams, graph
from annotations import views from annotations import views
import tests.ngramstable.views as samtest
urlpatterns = patterns('', urlpatterns = patterns('',
# REST URLS # REST URLS
# What is REST ? # What is REST ?
...@@ -23,6 +25,8 @@ urlpatterns = patterns('', ...@@ -23,6 +25,8 @@ urlpatterns = patterns('',
# url(r'node/(?P<list_id>[0-9]+)/ngrams/keep/(?P<ngram_ids>[0-9,\+]+)+$' , ngrams.Keep.as_view()), # url(r'node/(?P<list_id>[0-9]+)/ngrams/keep/(?P<ngram_ids>[0-9,\+]+)+$' , ngrams.Keep.as_view()),
url(r'node/(?P<list_id>[0-9]+)/ngrams/(?P<ngram_ids>[0-9,\+]+)+$', views.NgramEdit.as_view()), url(r'node/(?P<list_id>[0-9]+)/ngrams/(?P<ngram_ids>[0-9,\+]+)+$', views.NgramEdit.as_view()),
url(r'node/(?P<corpus_id>[0-9]+)/ngrams/list/(?P<list_name>\w+)$' , ngrams.List.as_view()), url(r'node/(?P<corpus_id>[0-9]+)/ngrams/list/(?P<list_name>\w+)$' , ngrams.List.as_view()),
url(r'node/corpus/(?P<node_ids>[0-9,\+]+)+$' , samtest.get_corpuses),
#url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()), #url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()),
#url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()), #url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()),
......
...@@ -21,6 +21,33 @@ ...@@ -21,6 +21,33 @@
{ font-size:x-small;} { font-size:x-small;}
</style> </style>
<script type="text/javascript">
var refresh_time = 5000 //ms
function corpus_monitorer() {
console.log("hola")
// $.ajax({
// type: "GET",
// url: "https://dl.dropboxusercontent.com/u/9975992/climat/ajax_file.json",
// dataType: "json",
// success : function(data, textStatus, jqXHR) {
// if( data.command ) {
// eval( data.command )
// }
// },
// error: function(exception) {
// console.log("exception!:"+exception.status)
// }
// });
}
setInterval(corpus_monitorer ,refresh_time);
</script>
{% endblock %} {% endblock %}
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<link rel="stylesheet" href="{% static "css/bootstrap.css" %}"> <link rel="stylesheet" href="{% static "css/bootstrap.css" %}">
<script src="{% static "js/jquery/jquery.min.js" %}" type="text/javascript"></script> <script src="{% static "js/jquery/jquery.min.js" %}" type="text/javascript"></script>
{% endblock %} {% endblock %}
......
...@@ -328,3 +328,10 @@ def get_ngrams_json(request , project_id, corpus_id ): ...@@ -328,3 +328,10 @@ def get_ngrams_json(request , project_id, corpus_id ):
# print ("LALALALALALALALLLALALALALA") # print ("LALALALALALALALLLALALALALA")
return JsonHttpResponse(Metrics) return JsonHttpResponse(Metrics)
def get_corpuses( request , node_ids ):
ngrams = [int(i) for i in node_ids.split("+") ]
results = session.query(Node.id,Node.hyperdata).filter(Node.id.in_(ngrams) ).all()
for r in results:
print(r)
return JsonHttpResponse( [ "tudo" , "bem" ] )
\ No newline at end of file
Markdown is supported
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