Skip to content

Commit

Permalink
add link to the metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
SophiaNSL committed Aug 15, 2024
1 parent 3856aa3 commit 08950dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/argus.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const ArgusJS = function(token, mdrUrl) {
put: (url, data) => fetch(`${mdrUrl}${url}`, { "method": "PUT", "headers": { "Content-Type": "application/json; charset=UTF-8", "Authorization": "Bearer " + currentToken.access }, body: JSON.stringify(data) }),
patch: (url, data) => fetch(`${mdrUrl}${url}`, { "method": "PATCH", "headers": { "Content-Type": "application/json; charset=UTF-8", "Authorization": "Bearer " + currentToken.access }, body: JSON.stringify(data) }),
delete: (url) => fetch(`${mdrUrl}${url}`, { "method": "DELETE", "headers": { "Authorization": "Bearer " + currentToken.access } }),
graphql: (query) => fetch(mdrUrl + "/api/graphql/json", { "method": "POST", "headers": { "Accept": "application/json", "Content-Type": "application/graphql", "Authorization": "Bearer " + currentToken.access}, body: query})
graphql: (query) => fetch(mdrUrl + "/api/graphql/json", { "method": "POST", "headers": { "Accept": "application/json", "Content-Type": "application/graphql", "Authorization": "Bearer " + currentToken.access}, body: query}),
// this mdrUrl is only for this argus-3d-graph-app
mdrUrl: () => mdrUrl,
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ new Vue({
property: '#fb9a99',
},
argusJS: null,
baseurl: '',
},
computed: {
prettyMap: function() {
Expand All @@ -45,6 +46,7 @@ new Vue({
mounted: async function() {
this.initGraph()
this.argusJS = await initArgusJS()
this.baseurl = this.argusJS.mdrUrl()
},
methods: {
requestUuid: function(node) {
Expand Down Expand Up @@ -213,6 +215,8 @@ new Vue({
const containerPaddingRight = parseInt(getComputedStyle(container).getPropertyValue('padding-right'))
const graphWidth = containerWidth - containerPaddingLeft - containerPaddingRight
graphElem.style.width = `${graphWidth}px`
// this console.log should be kept
console.log("graphElem.style.width: ", graphElem.style.width)

import(/* webpackChunkName: "3d-force-graph" */ '3d-force-graph').then(tdfg => {

Expand All @@ -231,8 +235,7 @@ new Vue({
this.displayInfo = {
Name: node.name,
Type: this.unCamel(node.type),
// currently this link needs the baseurl, which cannot retrive from the argusJS
// Link: `${this.baseurl}/item/${node.id}`, // Set the display info (runs on node click).
Link: `${this.baseurl}/item/${node.id}`, // Set the display info (runs on node click).
}
},
unCamel: function(text) {
Expand Down
2 changes: 1 addition & 1 deletion webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = merge(common, {
},
devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
contentBase: './docs',
port: 9001,
headers: {
"Access-Control-Allow-Origin": "*",
Expand Down

0 comments on commit 08950dd

Please sign in to comment.