Skip to content

Commit

Permalink
Add all components versions in About modal
Browse files Browse the repository at this point in the history
  • Loading branch information
urubens committed Sep 3, 2020
1 parent da33c97 commit 09d6805
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cytomine-web-ui",
"version": "1.2.0",
"version": "1.2.1",
"scripts": {
"translations-csv2json": "i18n-csv2json-cli --from src/locales/translations.csv --to src/locales/json --format",
"watch-translations": "onchange -i 'src/locales/translations.csv' -- npm run translations-csv2json",
Expand Down
50 changes: 49 additions & 1 deletion public/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,53 @@
"VIEWER_ANNOTATIONS_REFRESH_INTERVAL": 10000,
"MEMBERS_ACTIVITY_REFRESH_INTERVAL": 30000,
"STORAGE_REFRESH_INTERVAL": 10000,
"ONGOING_UPLOAD_REFRESH_INTERVAL": 500
"ONGOING_UPLOAD_REFRESH_INTERVAL": 500,
"PRELOADED_SLICES": 50,
"ANNOTATIONS_MAX_ITEMS_PER_CATEGORY": 50,

"CYTOMINE_FLAVOR": "ULiege",
"CYTOMINE_VERSION": "?",

"CORE_NAMESPACE": "cytomineuliege",
"CORE_VERSION": "?",
"IMS_NAMESPACE": "cytomineuliege",
"IMS_VERSION": "?",
"WEB_UI_NAMESPACE": "cytomineuliege",
"WEB_UI_VERSION": "?",
"NGINX_NAMESPACE": "cytomineuliege",
"NGINX_VERSION": "?",
"MEMCACHED_NAMESPACE": "cytomineuliege",
"MEMCACHED_VERSION": "?",
"POSTGRES_NAMESPACE": "cytomineuliege",
"POSTGRES_VERSION": "?",
"MONGODB_NAMESPACE": "cytomineuliege",
"MONGODB_VERSION": "?",
"BACKUP_NAMESPACE": "cytomineuliege",
"BACKUP_VERSION": "?",
"IIPCYTO_NAMESPACE": "cytomineuliege",
"IIPCYTO_VERSION": "?",

"IIPJP2_ENABLED": true,
"IIPJP2_NAMESPACE": "cytomineuliege",
"IIPJP2_VERSION": "?",

"BIOFORMAT_ENABLED": true,
"BIOFORMAT_NAMESPACE": "cytomineuliege",
"BIOFORMAT_VERSION": "?",

"SOFTWARE_ENABLED": true,
"SOFTWARE_ROUTER_NAMESPACE": "cytomineuliege",
"SOFTWARE_ROUTER_VERSION": "?",
"RABBITMQ_NAMESPACE": "cytomineuliege",
"RABBITMQ_VERSION": "?",
"SLURM_NAMESPACE": "cytomineuliege",
"SLURM_VERSION": "?",

"RETRIEVAL_ENABLED": false,
"RETRIEVAL_NAMESPACE": "cytomineuliege",
"RETRIEVAL_VERSION": "?",

"IRIS_ENABLED": false,
"IRIS_NAMESPACE": "cytomineuliege",
"IRIS_VERSION": "?"
}
10 changes: 5 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ export default {
}
},
async created() {
let Settings;
let settings;
await axios
.get('configuration.json')
.then(response => (Settings = response.data));
.then(response => (settings = response.data));

for(var i in constants){
if(Settings.hasOwnProperty(i)) {
constants[i] = Settings[i];
for (let i in settings) {
if (constants.hasOwnProperty(i) || i.includes('_NAMESPACE') || i.includes('_VERSION') || i.includes('_ENABLED')) {
constants[i] = settings[i];
}
}
Object.freeze(constants);
Expand Down
47 changes: 43 additions & 4 deletions src/components/navbar/AboutCytomineModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,30 @@
<template v-if="!loading">
<dl>
<dt>{{$t('version')}}</dt>
<dd>{{version || '?'}}</dd>
<dd>{{version || '?'}}
<template v-if="constants['CYTOMINE_FLAVOR']">({{constants['CYTOMINE_FLAVOR'] || '?'}})</template>
<b-collapse :open="false">
<template #trigger="{open}">
<button class="button is-small">
{{$t(open ? 'button-hide' : 'button-show')}}
</button>
</template>
<dl>
<template v-for="component in componentsInfos" >
<dt :key="`${component.name}-dt`" :class="{'has-text-grey': !component.enabled}">
{{component.name}}
<span v-if="!component.enabled" class="is-italic is-lowercase"> ({{$t('disabled')}})</span>
</dt>
<dd :key="component.name">
<div class="tags has-addons">
<span class="tag">{{component.namespace || '?'}}</span>
<span class="tag is-primary">{{component.version || '?'}}</span>
</div>
</dd>
</template>
</dl>
</b-collapse>
</dd>

<dt>{{$t('sponsors')}}</dt>
<dd>
Expand Down Expand Up @@ -107,21 +130,37 @@ export default {
components: {CytomineModalCard},
data() {
return {
version: null,
coreVersion: null,
loading: true,
flavour: 'ULiege'
open: false,
};
},
computed: {
apiDocLink() {
let core = constants.CYTOMINE_CORE_HOST;
return `${core}/restApiDoc/?doc_url=${core}/restApiDoc/api`;
},
version() {
return constants['CYTOMINE_VERSION'];
},
constants() {
return constants;
},
componentsInfos() {
return this.constants['COMPONENTS'].map(component => {
return {
'name': component,
'enabled': constants[`${component}_ENABLED`] == null || constants[`${component}_ENABLED`],
'version': constants[`${component}_VERSION`],
'namespace': constants[`${component}_NAMESPACE`]
};
});
}
},
async created() {
try {
let {version} = await Cytomine.instance.ping();
this.version = (version) ? `${version} ${this.flavour}` : null;
this.coreVersion = (version) ? version : null;
}
catch(error) {
console.log(error);
Expand Down
5 changes: 5 additions & 0 deletions src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ export default {
DEFAULT_PROPERTY_KEY: '@DEFAULT_PROPERTY',
ANNOTATIONS_MAX_ITEMS_PER_CATEGORY: 50,
DEFAULT_IMAGE_CONTROLS_STEP: 2,
// ---
CYTOMINE_FLAVOR: null,
CYTOMINE_VERSION: null,
COMPONENTS: ['CORE', 'IMS', 'WEB_UI', 'NGINX', 'POSTGRES', 'MONGODB', 'BACKUP', 'IIPCYTO', 'IIPJP2', 'MEMCACHED',
'BIOFORMAT', 'HMS', 'SOFTWARE_ROUTER', 'RABBITMQ', 'SLURM', 'RETRIEVAL', 'IRIS']
};

0 comments on commit 09d6805

Please sign in to comment.