Skip to content
Snippets Groups Projects
Verified Commit d6551a20 authored by Martin Weise's avatar Martin Weise
Browse files
parent 279dda62
Branches
Tags
1 merge request!393Wrong dependencies
...@@ -417,6 +417,7 @@ services: ...@@ -417,6 +417,7 @@ services:
hostname: metric-db hostname: metric-db
image: docker.io/bitnami/prometheus:2.54.1-debian-12-r4 image: docker.io/bitnami/prometheus:2.54.1-debian-12-r4
volumes: volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml - ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- metric-db-data:/opt/bitnami/prometheus/data - metric-db-data:/opt/bitnami/prometheus/data
healthcheck: healthcheck:
......
...@@ -4,9 +4,9 @@ import uuid ...@@ -4,9 +4,9 @@ import uuid
from dbrepo.RestClient import RestClient from dbrepo.RestClient import RestClient
endpoint = os.getenv('METADATA_SERVICE_ENDPOINT', 'https://dbrepo1.ec.tuwien.ac.at') endpoint = os.getenv('METADATA_SERVICE_ENDPOINT', 'http://localhost')
username = os.getenv('SYSTEM_USERNAME', 'admin') username = os.getenv('SYSTEM_USERNAME', 'admin')
password = os.getenv('SYSTEM_PASSWORD', 'f24870437f82adf567c0b03179f15e21') password = os.getenv('SYSTEM_PASSWORD', 'admin')
client = RestClient(endpoint=endpoint, username=username, password=password) client = RestClient(endpoint=endpoint, username=username, password=password)
plan: [str] = [] plan: [str] = []
...@@ -89,12 +89,17 @@ def update_databases() -> None: ...@@ -89,12 +89,17 @@ def update_databases() -> None:
plan.append(f"UPDATE mdb_view SET vdbid = '{new_id}' WHERE vdbid = '{old_id}';") plan.append(f"UPDATE mdb_view SET vdbid = '{new_id}' WHERE vdbid = '{old_id}';")
plan.append(f"UPDATE mdb_identifiers SET dbid = '{new_id}' WHERE dbid = '{old_id}';") plan.append(f"UPDATE mdb_identifiers SET dbid = '{new_id}' WHERE dbid = '{old_id}';")
plan.append(f"UPDATE mdb_access SET aDBID = '{new_id}' WHERE aDBID = '{old_id}';") plan.append(f"UPDATE mdb_access SET aDBID = '{new_id}' WHERE aDBID = '{old_id}';")
for view in database.views: for _view in database.views:
v_old_id: int = view.id v_old_id: int = _view.id
v_new_id: uuid = uuid.uuid4() v_new_id: uuid = uuid.uuid4()
view = client.get_view(database_id=_database.id, view_id=_view.id)
plan.append(f"UPDATE mdb_view SET ID = '{v_new_id}' WHERE ID = '{v_old_id}';") plan.append(f"UPDATE mdb_view SET ID = '{v_new_id}' WHERE ID = '{v_old_id}';")
plan.append(f"UPDATE mdb_view_columns SET view_id = '{v_new_id}' WHERE view_id = '{v_old_id}';")
plan.append(f"UPDATE mdb_identifiers SET vid = '{v_new_id}' WHERE vid = '{v_old_id}';") plan.append(f"UPDATE mdb_identifiers SET vid = '{v_new_id}' WHERE vid = '{v_old_id}';")
plan.append(f"UPDATE mdb_view_columns SET id = UUID(), view_id = '{v_new_id}' WHERE id = '{v_old_id}';") for column in view.columns:
vc_old_id: int = column.id
vc_new_id: uuid = uuid.uuid4()
plan.append(f"UPDATE mdb_view_columns SET id = '{vc_new_id}' WHERE id = '{vc_old_id}';")
for table in database.tables: for table in database.tables:
tbl_old_id: int = table.id tbl_old_id: int = table.id
tbl_new_id: uuid = uuid.uuid4() tbl_new_id: uuid = uuid.uuid4()
...@@ -192,8 +197,8 @@ def update_identifiers() -> None: ...@@ -192,8 +197,8 @@ def update_identifiers() -> None:
f_old_id = funder.id f_old_id = funder.id
f_new_id: uuid = uuid.uuid4() f_new_id: uuid = uuid.uuid4()
plan.append(f"UPDATE mdb_identifier_funders SET id = '{f_new_id}' WHERE id = '{f_old_id}';") plan.append(f"UPDATE mdb_identifier_funders SET id = '{f_new_id}' WHERE id = '{f_old_id}';")
for funder in identifier.related: for related_identifier in identifier.related_identifiers:
r_old_id = funder.id r_old_id = related_identifier.id
r_new_id: uuid = uuid.uuid4() r_new_id: uuid = uuid.uuid4()
plan.append(f"UPDATE mdb_identifier_related SET id = '{r_new_id}' WHERE id = '{r_old_id}';") plan.append(f"UPDATE mdb_identifier_related SET id = '{r_new_id}' WHERE id = '{r_old_id}';")
plan.append("COMMIT;") plan.append("COMMIT;")
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</div> </div>
</v-list-item> </v-list-item>
<v-list-item <v-list-item
v-if="identifier.related_identifiers && identifier.related_identifiers.length > 0" v-if="identifier.related_identifiers"
:title="$t('pages.identifier.related-identifiers.title')" :title="$t('pages.identifier.related-identifiers.title')"
density="compact"> density="compact">
<p <p
......
...@@ -273,6 +273,9 @@ export const useIdentifierService = (): any => { ...@@ -273,6 +273,9 @@ export const useIdentifierService = (): any => {
const regex: RegExp = /(10[.][0-9]{4,}[^\s"\/<>]*\/[^\s"<>]+)/g const regex: RegExp = /(10[.][0-9]{4,}[^\s"\/<>]*\/[^\s"<>]+)/g
const matches: RegExpMatchArray | null = val.match(regex) const matches: RegExpMatchArray | null = val.match(regex)
if (matches && matches.length > 0) { if (matches && matches.length > 0) {
if (config.public.doi.endpoint) {
return `${config.public.doi.endpoint}/${matches[0]}`
}
return `https://doi.org/${matches[0]}` return `https://doi.org/${matches[0]}`
} }
if (val.startsWith('http')) { if (val.startsWith('http')) {
......
...@@ -98,7 +98,6 @@ export default defineNuxtConfig({ ...@@ -98,7 +98,6 @@ export default defineNuxtConfig({
} }
}, },
doi: { doi: {
enabled: false,
endpoint: 'https://doi.org' endpoint: 'https://doi.org'
}, },
links: {} links: {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment