Browse Source

Update urls

pull/10/head
Hironsan 6 years ago
parent
commit
0a8ffef90e
3 changed files with 9 additions and 8 deletions
  1. 2
      doccano/app/app/urls.py
  2. 9
      doccano/app/server/static/main.js
  3. 6
      doccano/app/server/urls.py

2
doccano/app/app/urls.py

@ -18,6 +18,6 @@ from django.urls import path, include
urlpatterns = [
path('annotation/', include('server.urls')),
path('projects/', include('server.urls')),
path('admin/', admin.site.urls),
]

9
doccano/app/server/static/main.js

@ -37,13 +37,13 @@ var app = new Vue({
},
],
labels: [],
guideline: 'annotation guideline'
guideline: ''
},
methods: {
addLabel: function (label) {
this.items[this.cur]['labels'].push({
"text": label,
"prob": null
'text': label,
'prob': null
})
},
deleteLabel: function (index) {
@ -58,8 +58,9 @@ var app = new Vue({
},
created: function () {
console.log('created');
var base_url = window.location.href.split('/').slice(3, 5).join('/');
var self = this;
axios.get('/annotation/api/label')
axios.get('/' + base_url + '/apis/label')
.then(function (response) {
console.log('label request');
self.labels = response.data['labels'];

6
doccano/app/server/urls.py

@ -3,7 +3,7 @@ from django.urls import path
from .views import AnnotationView, AnnotationAPIView, LabelAPIView
urlpatterns = [
path('', AnnotationView.as_view()),
path('api/annotation/', AnnotationAPIView.as_view()),
path('api/label/', LabelAPIView.as_view()),
path('<int:project_id>/docs', AnnotationView.as_view()),
path('<int:project_id>/apis/data', AnnotationAPIView.as_view()),
path('<int:project_id>/apis/label', LabelAPIView.as_view()),
]
Loading…
Cancel
Save