Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Opolka
vue-cdbp
Commits
048b4d37
Commit
048b4d37
authored
Dec 20, 2018
by
Markus Opolka
Browse files
Make API url central
parent
830ec60e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
048b4d37
...
...
@@ -4,6 +4,8 @@ LABEL maintainer="markus.opolka@fau.de"
COPY
. /app
WORKDIR
/app
# This is so lazy...
RUN
sed
's/localhost/geuselambix.phil.uni-erlangen.de/'
src/main.js
RUN
yarn
install
RUN
yarn run build
...
...
src/components/Features.vue
View file @
048b4d37
...
...
@@ -126,7 +126,7 @@ export default {
// Call feature search API with parameters
this
.
searching
=
true
let
url
=
'
http://localhost:3000/
api/features/
'
let
url
=
'
api/features/
'
// Adding the lettername to the API endpoint
if
(
this
.
selected
!==
'
Toutes
'
)
{
url
=
url
+
this
.
selected
...
...
@@ -168,14 +168,14 @@ export default {
},
created
()
{
// Get feature glossary
this
.
$http
.
get
(
'
http://localhost:3000/
api/glossary/features
'
).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/glossary/features
'
).
then
(
function
(
data
)
{
this
.
feature_categories_glossary
=
data
.
body
.
categories
this
.
feature_types_glossary
=
data
.
body
.
types
this
.
feature_subtypes_glossary
=
data
.
body
.
subtypes
})
// Create list of all letters
this
.
$http
.
get
(
'
http://localhost:3000/
api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/metadata/table
'
).
then
(
function
(
data
)
{
for
(
let
letter
of
data
.
body
)
{
if
(
letter
.
valid
)
{
this
.
letters
.
push
({
text
:
letter
.
title
})
...
...
src/components/Letter.vue
View file @
048b4d37
...
...
@@ -142,7 +142,7 @@ export default {
created
()
{
// Get Name from Router and call API
this
.
lettername
=
this
.
$route
.
params
.
letter
this
.
$http
.
get
(
'
http://localhost:3000/
api/letters/
'
+
this
.
lettername
).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/letters/
'
+
this
.
lettername
).
then
(
function
(
data
)
{
// If there's only one element xml-js makes no array... great stuff -.-
if
(
data
.
body
.
TEI
.
text
.
head
.
graphic
instanceof
Array
)
{
...
...
src/components/Letters.vue
View file @
048b4d37
...
...
@@ -67,13 +67,13 @@ export default {
reload
()
{
// Trigger Backend to reload cache
this
.
reloading
=
true
this
.
$http
.
get
(
'
http://localhost:3000/
api/metadata/reload
'
).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/metadata/reload
'
).
then
(
function
(
data
)
{
this
.
load
(
true
)
})
},
load
(
snack
)
{
// Initial load of metadata
this
.
$http
.
get
(
'
http://localhost:3000/
api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
letters
=
data
.
body
this
.
reloading
=
false
this
.
snackbar
=
snack
...
...
src/components/Metadata.vue
View file @
048b4d37
...
...
@@ -87,7 +87,7 @@ export default {
}
},
created
()
{
this
.
$http
.
get
(
'
http://localhost:3000/
api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/metadata/table
'
).
then
(
function
(
data
)
{
this
.
items
=
data
.
body
})
}
...
...
src/components/Search.vue
View file @
048b4d37
...
...
@@ -87,7 +87,7 @@ export default {
// Remove undefined values
Object
.
keys
(
params
).
forEach
((
key
)
=>
(
params
[
key
]
==
null
)
&&
delete
params
[
key
])
this
.
searching
=
true
this
.
$http
.
get
(
'
http://localhost:3000/
api/search/
'
,
{
params
:
params
}).
then
(
function
(
data
)
{
this
.
$http
.
get
(
'
api/search/
'
,
{
params
:
params
}).
then
(
function
(
data
)
{
this
.
results
=
data
.
body
this
.
searching
=
false
})
...
...
src/main.js
View file @
048b4d37
...
...
@@ -11,10 +11,12 @@ import '../node_modules/vuetify/dist/vuetify.min.css'
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
Vuetify
)
Vue
.
use
(
VueResource
)
Vue
.
component
(
'
feature
'
,
Feature
)
Vue
.
component
(
'
result
'
,
Result
)
Vue
.
use
(
VueResource
)
Vue
.
http
.
options
.
root
=
'
http://localhost:3000
'
/* eslint-disable no-new */
new
Vue
({
el
:
'
#app
'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment