Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
5df3c8be
Commit
5df3c8be
authored
2 years ago
by
Inga Kirschnick
Browse files
Options
Downloads
Patches
Plain Diff
bug fixes
parent
3e9d7495
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/static/js/App.js
+17
-3
17 additions, 3 deletions
app/static/js/App.js
app/static/js/RessourceLists/SpacyNLPPipelineModelList.js
+6
-1
6 additions, 1 deletion
app/static/js/RessourceLists/SpacyNLPPipelineModelList.js
app/static/js/Utils.js
+166
-44
166 additions, 44 deletions
app/static/js/Utils.js
with
189 additions
and
48 deletions
app/static/js/App.js
+
17
−
3
View file @
5df3c8be
...
@@ -16,10 +16,24 @@ class App {
...
@@ -16,10 +16,24 @@ class App {
this
.
data
.
promises
.
getUser
[
userId
]
=
new
Promise
((
resolve
,
reject
)
=>
{
this
.
data
.
promises
.
getUser
[
userId
]
=
new
Promise
((
resolve
,
reject
)
=>
{
fetch
(
`/users/
${
userId
}
?backrefs=true&relationships=true`
,
{
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/users/
${
userId
}
?backrefs=true&relationships=true`
,
{
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
return
response
.
json
();},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
this
.
flash
(
'
Forbidden
'
,
'
error
'
);}
switch
(
response
.
status
)
{
if
(
response
.
status
===
404
)
{
this
.
flash
(
'
Not Found
'
,
'
error
'
);}
case
403
:
{
this
.
flash
(
'
Forbidden
'
,
'
error
'
);
break
;
}
case
404
:
{
this
.
flash
(
'
Not Found
'
,
'
error
'
);
break
;
}
default
:
{
response
.
json
();
break
;
}
}
},
(
response
)
=>
{
this
.
flash
(
'
Something went wrong
'
,
'
error
'
);
reject
(
response
);
reject
(
response
);
}
}
)
)
...
...
This diff is collapsed.
Click to expand it.
app/static/js/RessourceLists/SpacyNLPPipelineModelList.js
+
6
−
1
View file @
5df3c8be
...
@@ -31,7 +31,7 @@ class SpaCyNLPPipelineModelList extends RessourceList {
...
@@ -31,7 +31,7 @@ class SpaCyNLPPipelineModelList extends RessourceList {
<td><b><span class="title"></span> <span class="version"></span></b><br><i><span class="description"></span></i></td>
<td><b><span class="title"></span> <span class="version"></span></b><br><i><span class="description"></span></i></td>
<td><a class="publisher-url"><span class="publisher"></span></a> (<span class="publishing-year"></span>)<br><a class="publishing-url"><span class="publishing-url-2"></span></a></td>
<td><a class="publisher-url"><span class="publisher"></span></a> (<span class="publishing-year"></span>)<br><a class="publishing-url"><span class="publishing-url-2"></span></a></td>
<td>
<td>
<div class="switch action-switch center-align" data-action="share-request">
<div class="switch action-switch center-align" data-action="share-request"
data-user-role=
>
<span class="share"></span>
<span class="share"></span>
<label>
<label>
<input type="checkbox" class="shared">
<input type="checkbox" class="shared">
...
@@ -86,6 +86,11 @@ class SpaCyNLPPipelineModelList extends RessourceList {
...
@@ -86,6 +86,11 @@ class SpaCyNLPPipelineModelList extends RessourceList {
init
(
user
)
{
init
(
user
)
{
this
.
_init
(
user
.
spacy_nlp_pipeline_models
);
this
.
_init
(
user
.
spacy_nlp_pipeline_models
);
for
(
let
switchElement
of
this
.
listjs
.
list
.
querySelectorAll
(
'
.shared
'
))
{
if
(
user
.
role
.
name
!==
'
Administrator
'
||
user
.
role
.
name
!==
'
Contributor
'
)
{
switchElement
.
setAttribute
(
'
disabled
'
,
''
);
}
}
}
}
_init
(
ressources
)
{
_init
(
ressources
)
{
...
...
This diff is collapsed.
Click to expand it.
app/static/js/Utils.js
+
166
−
44
View file @
5df3c8be
...
@@ -12,13 +12,27 @@ class Utils {
...
@@ -12,13 +12,27 @@ class Utils {
fetch
(
`/corpora/
${
corpus
.
id
}
/build`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/corpora/
${
corpus
.
id
}
/build`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`Corpus "
${
corpus
.
title
}
" marked for building`
,
'
corpus
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
case
409
:
app
.
flash
(
'
Conflict
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`Corpus "
${
corpus
.
title
}
" marked for building`
,
'
corpus
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
if
(
response
.
status
===
409
)
{
app
.
flash
(
'
Conflict
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -61,12 +75,23 @@ class Utils {
...
@@ -61,12 +75,23 @@ class Utils {
fetch
(
`/corpora/
${
corpus
.
id
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/corpora/
${
corpus
.
id
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`Corpus "
${
corpusTitle
}
" marked for deletion`
,
'
corpus
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`Corpus "
${
corpus
.
title
}
" marked for deletion`
,
'
corpus
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -112,12 +137,23 @@ class Utils {
...
@@ -112,12 +137,23 @@ class Utils {
fetch
(
`/corpora/
${
corpusId
}
/files/
${
corpusFileId
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/corpora/
${
corpusId
}
/files/
${
corpusFileId
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`Corpus file "
${
corpusFileTitle
}
" marked for deletion`
,
'
corpus
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`Corpus file "
${
corpusFileTitle
}
" marked for deletion`
,
'
corpus
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -160,12 +196,23 @@ class Utils {
...
@@ -160,12 +196,23 @@ class Utils {
fetch
(
`/contributions/spacy-nlp-pipeline-models/
${
spaCyNLPPipelineModelId
}
`
,
{
method
:
'
DELETE
'
})
fetch
(
`/contributions/spacy-nlp-pipeline-models/
${
spaCyNLPPipelineModelId
}
`
,
{
method
:
'
DELETE
'
})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`SpaCy NLP Pipeline Model "
${
spaCyNLPPipelineModelTitle
}
" marked for deletion`
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`SpaCy NLP Pipeline Model "
${
spaCyNLPPipelineModelTitle
}
" marked for deletion`
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -208,12 +255,24 @@ class Utils {
...
@@ -208,12 +255,24 @@ class Utils {
fetch
(
`/contributions/tesseract-ocr-pipeline-models/
${
tesseractOCRPipelineModelId
}
`
,
{
method
:
'
DELETE
'
})
fetch
(
`/contributions/tesseract-ocr-pipeline-models/
${
tesseractOCRPipelineModelId
}
`
,
{
method
:
'
DELETE
'
})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`Tesseract OCR Pipeline Model "
${
tesseractOCRPipelineModelTitle
}
" marked for deletion`
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`Tesseract OCR Pipeline Model "
${
tesseractOCRPipelineModelTitle
}
" marked for deletion`
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -258,12 +317,23 @@ class Utils {
...
@@ -258,12 +317,23 @@ class Utils {
fetch
(
`/jobs/
${
job
.
id
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/jobs/
${
job
.
id
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`Job "
${
jobTitle
}
" marked for deletion`
,
'
job
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`Job "
${
jobTitle
}
" marked for deletion`
,
'
job
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -279,12 +349,23 @@ class Utils {
...
@@ -279,12 +349,23 @@ class Utils {
fetch
(
`/jobs/
${
job
.
id
}
/log`
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json, text/plain
'
}})
fetch
(
`/jobs/
${
job
.
id
}
/log`
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json, text/plain
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
resolve
(
response
);
switch
(
response
.
status
)
{
return
response
.
text
();
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
resolve
(
response
);
response
.
text
();
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
)
)
...
@@ -355,13 +436,26 @@ class Utils {
...
@@ -355,13 +436,26 @@ class Utils {
fetch
(
`/jobs/
${
job
.
id
}
/restart`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/jobs/
${
job
.
id
}
/restart`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`Job "
${
jobTitle
}
" restarted.`
,
'
job
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
case
409
:
app
.
flash
(
'
Conflict
'
,
'
error
'
);
reject
(
response
);
default
:
app
.
flash
(
`Job "
${
jobTitle
}
" restarted.`
,
'
job
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
if
(
response
.
status
===
409
)
{
app
.
flash
(
'
Conflict
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -406,12 +500,24 @@ class Utils {
...
@@ -406,12 +500,24 @@ class Utils {
fetch
(
`/users/
${
user
.
id
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/users/
${
user
.
id
}
`
,
{
method
:
'
DELETE
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
`User "
${
userName
}
" marked for deletion`
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
case
404
:
app
.
flash
(
'
Not Found
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
`User "
${
userName
}
" marked for deletion`
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
if
(
response
.
status
===
404
)
{
app
.
flash
(
'
Not Found
'
,
'
error
'
);}
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -432,11 +538,19 @@ class Utils {
...
@@ -432,11 +538,19 @@ class Utils {
fetch
(
`/contributions/tesseract-ocr-pipeline-models/
${
tesseractOCRPipelineModel
.
id
}
/toggle-public-status`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/contributions/tesseract-ocr-pipeline-models/
${
tesseractOCRPipelineModel
.
id
}
/toggle-public-status`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
msg
,
'
corpus
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
msg
,
'
corpus
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
reject
(
response
);
reject
(
response
);
}
}
);
);
...
@@ -455,11 +569,19 @@ class Utils {
...
@@ -455,11 +569,19 @@ class Utils {
fetch
(
`/contributions/spacy-nlp-pipeline-models/
${
spaCyNLPPipelineModel
.
id
}
/toggle-public-status`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
fetch
(
`/contributions/spacy-nlp-pipeline-models/
${
spaCyNLPPipelineModel
.
id
}
/toggle-public-status`
,
{
method
:
'
POST
'
,
headers
:
{
Accept
:
'
application/json
'
}})
.
then
(
.
then
(
(
response
)
=>
{
(
response
)
=>
{
app
.
flash
(
msg
,
'
corpus
'
);
switch
(
response
.
status
)
{
resolve
(
response
);
case
403
:
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
reject
(
response
);
break
;
default
:
app
.
flash
(
msg
,
'
corpus
'
);
resolve
(
response
);
break
;
}
},
},
(
response
)
=>
{
(
response
)
=>
{
if
(
response
.
status
===
403
)
{
app
.
flash
(
'
Forbidden
'
,
'
error
'
);
}
app
.
flash
(
'
Something went wrong
'
,
'
error
'
);
reject
(
response
);
reject
(
response
);
}
}
);
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment