Browse Source

Add URL validation

pull/341/head
Hironsan 5 years ago
parent
commit
0a94421bcc
8 changed files with 140 additions and 245 deletions
  1. 85
      frontend/pages/projects/_id/annotation/index.vue
  2. 210
      frontend/pages/projects/_id/classification/index.vue
  3. 2
      frontend/pages/projects/_id/dataset/index.vue
  4. 1
      frontend/pages/projects/_id/download/index.vue
  5. 1
      frontend/pages/projects/_id/guideline/index.vue
  6. 2
      frontend/pages/projects/_id/labels/index.vue
  7. 2
      frontend/pages/projects/_id/members/index.vue
  8. 82
      frontend/pages/projects/_id/seq2seq/index.vue

85
frontend/pages/projects/_id/annotation/index.vue

@ -27,49 +27,54 @@ import SideBarLabeling from '~/components/organisms/SideBarLabeling'
export default {
layout: 'annotation',
components: {
EntityItemBox,
SideBarLabeling
},
data: () => ({
progress: 30,
metadata: '{"wikiPageId":2}',
search: '',
labels: [
{
id: 1,
name: 'Location',
color: '#E91E63',
shortcut: 'l'
},
{
id: 2,
name: 'Organization',
color: '#03A9F4',
shortcut: 'o'
},
{
id: 3,
name: 'Person',
color: '#009688',
shortcut: 'p'
},
{
id: 4,
name: 'Date',
color: '#FF6F00',
shortcut: 'd'
},
{
id: 5,
name: 'Other',
color: '#333333',
shortcut: 't'
}
]
})
data() {
return {
progress: 30,
metadata: '{"wikiPageId":2}',
search: '',
labels: [
{
id: 1,
name: 'Location',
color: '#E91E63',
shortcut: 'l'
},
{
id: 2,
name: 'Organization',
color: '#03A9F4',
shortcut: 'o'
},
{
id: 3,
name: 'Person',
color: '#009688',
shortcut: 'p'
},
{
id: 4,
name: 'Date',
color: '#FF6F00',
shortcut: 'd'
},
{
id: 5,
name: 'Other',
color: '#333333',
shortcut: 't'
}
]
}
},
validate({ params }) {
return /^\d+$/.test(params.id)
}
}
</script>
<style scoped>
</style>

210
frontend/pages/projects/_id/classification/index.vue

@ -23,179 +23,53 @@ import SideBarLabeling from '~/components/organisms/SideBarLabeling'
export default {
layout: 'annotation',
components: {
TextClassification,
SideBarLabeling
},
data: () => ({
progress: 30,
metadata: '{"wikiPageId":2}',
search: '',
content: 'Sony',
text:
'Barack Hussein Obama II (born August 4, 1961) is an American attorney and politician who served as the 44th president of the United States from 2009 to 2017. A member of the Democratic Party, he was the first African American to be elected to the presidency. He previously served as a U.S. senator from Illinois from 2005 to 2008 and an Illinois state senator from 1997 to 2004.',
labelName: 'ORG',
labels: [
{
id: 1,
name: 'Location',
color: '#E91E63',
shortcut: 'l'
},
{
id: 2,
name: 'Organization',
color: '#03A9F4',
shortcut: 'o'
},
{
id: 3,
name: 'Person',
color: '#009688',
shortcut: 'p'
},
{
id: 4,
name: 'Date',
color: '#FF6F00',
shortcut: 'd'
},
{
id: 5,
name: 'Other',
color: '#333333',
shortcut: 't'
}
],
annotations: [
{
id: 2,
prob: 0.0,
label: 3,
start_offset: 0,
end_offset: 23,
user: 1,
document: 1
},
{
id: 3,
prob: 0.0,
label: 4,
start_offset: 30,
end_offset: 44,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 1,
start_offset: 125,
end_offset: 138,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 4,
start_offset: 144,
end_offset: 148,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 4,
start_offset: 152,
end_offset: 156,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 2,
start_offset: 174,
end_offset: 190,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 1,
start_offset: 285,
end_offset: 289,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 1,
start_offset: 303,
end_offset: 311,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 4,
start_offset: 317,
end_offset: 321,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 4,
start_offset: 325,
end_offset: 329,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 1,
start_offset: 337,
end_offset: 345,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 4,
start_offset: 365,
end_offset: 369,
user: 1,
document: 1
},
{
id: 2,
prob: 0.0,
label: 4,
start_offset: 373,
end_offset: 377,
user: 1,
document: 1
}
]
}),
methods: {
save() {},
cancel() {},
open() {},
close() {}
data() {
return {
progress: 30,
metadata: '{"wikiPageId":2}',
labels: [
{
id: 1,
name: 'Location',
color: '#E91E63',
shortcut: 'l'
},
{
id: 2,
name: 'Organization',
color: '#03A9F4',
shortcut: 'o'
},
{
id: 3,
name: 'Person',
color: '#009688',
shortcut: 'p'
},
{
id: 4,
name: 'Date',
color: '#FF6F00',
shortcut: 'd'
},
{
id: 5,
name: 'Other',
color: '#333333',
shortcut: 't'
}
]
}
},
validate({ params }) {
return /^\d+$/.test(params.id)
}
}
</script>
<style scoped>
</style>

2
frontend/pages/projects/_id/dataset/index.vue

@ -15,11 +15,13 @@ import DocumentDeletionButton from '@/components/containers/DocumentDeletionButt
export default {
layout: 'project',
components: {
DocumentList,
DocumentUploadButton,
DocumentDeletionButton
},
validate({ params }) {
return /^\d+$/.test(params.id)
}

1
frontend/pages/projects/_id/download/index.vue

@ -12,6 +12,7 @@
<script>
export default {
layout: 'project',
computed: {
url() {
const projectId = this.$route.params.id

1
frontend/pages/projects/_id/guideline/index.vue

@ -16,6 +16,7 @@ import { mapState, mapActions } from 'vuex'
export default {
layout: 'project',
components: {
Editor
},

2
frontend/pages/projects/_id/labels/index.vue

@ -15,11 +15,13 @@ import LabelDeletionButton from '@/components/containers/LabelDeletionButton'
export default {
layout: 'project',
components: {
LabelList,
LabelCreationButton,
LabelDeletionButton
},
validate({ params }) {
return /^\d+$/.test(params.id)
}

2
frontend/pages/projects/_id/members/index.vue

@ -15,11 +15,13 @@ import MemberDeletionButton from '@/components/containers/MemberDeletionButton'
export default {
layout: 'project',
components: {
MemberList,
MemberAdditionButton,
MemberDeletionButton
},
validate({ params }) {
return /^\d+$/.test(params.id)
}

82
frontend/pages/projects/_id/seq2seq/index.vue

@ -23,47 +23,55 @@ import SideBarLabeling from '~/components/organisms/SideBarLabeling'
export default {
layout: 'annotation',
components: {
Seq2seqContainer,
SideBarLabeling
},
data: () => ({
progress: 30,
metadata: '{"wikiPageId":2}',
search: '',
labels: [
{
id: 1,
name: 'Location',
color: '#E91E63',
shortcut: 'l'
},
{
id: 2,
name: 'Organization',
color: '#03A9F4',
shortcut: 'o'
},
{
id: 3,
name: 'Person',
color: '#009688',
shortcut: 'p'
},
{
id: 4,
name: 'Date',
color: '#FF6F00',
shortcut: 'd'
},
{
id: 5,
name: 'Other',
color: '#333333',
shortcut: 't'
}
]
})
data() {
return {
progress: 30,
metadata: '{"wikiPageId":2}',
search: '',
labels: [
{
id: 1,
name: 'Location',
color: '#E91E63',
shortcut: 'l'
},
{
id: 2,
name: 'Organization',
color: '#03A9F4',
shortcut: 'o'
},
{
id: 3,
name: 'Person',
color: '#009688',
shortcut: 'p'
},
{
id: 4,
name: 'Date',
color: '#FF6F00',
shortcut: 'd'
},
{
id: 5,
name: 'Other',
color: '#333333',
shortcut: 't'
}
]
}
},
validate({ params }) {
return /^\d+$/.test(params.id)
}
}
</script>

Loading…
Cancel
Save