Skip to content

Commit 805901d

Browse files
committed
Merge branch 'master' into update-django-to-v5
2 parents c4e924b + cf7f3e4 commit 805901d

File tree

10 files changed

+536
-10
lines changed

10 files changed

+536
-10
lines changed

kubernetes/helm/values.dev.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,3 @@ memcachedServiceMemory: "3400"
2323
# Nginx
2424
nginxReplicas: 1
2525

26-
# RNAcentral
27-
rnacentralReplicas: 1

kubernetes/helm/values.fallback.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ database: db-fb
1313
proxy: proxy-hx
1414

1515
# RNAcentral
16-
rnacentralReplicas: 6
16+
rnacentralReplicas: 1

kubernetes/helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ nginxLimitsMemory: "2000Mi"
4646
# RNAcentral
4747
rnacentralBranch: master
4848
rnacentralPort: 8000
49-
rnacentralReplicas: 8
49+
rnacentralReplicas: 1
5050
rnacentralRequestsMemory: "2000Mi"
5151
rnacentralRequestsCPU: "1000m"
5252
rnacentralLimitsMemory: "2000Mi"

rnacentral/portal/config/expert_databases.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,4 +1594,18 @@
15941594
"status": "",
15951595
"version": "as of Nov 2024",
15961596
},
1597+
{
1598+
"name": "Sci-ModoM",
1599+
"label": "Sci-ModoM",
1600+
"url": "https://scimodom.dieterichlab.org/",
1601+
"description": "Sci-ModoM: The quantitative database of transcriptome-wide high-throughput RNA modification sites",
1602+
"hint": "Sci-ModoM is a quantitative database of transcriptome-wide high-throughput RNA modification sites",
1603+
"tags": ["", "", ""],
1604+
"abbreviation": "",
1605+
"examples": [],
1606+
"references": [],
1607+
"imported": False,
1608+
"status": "",
1609+
"version": "",
1610+
},
15971611
]
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
(function() {
2+
const { useState, useEffect } = React;
3+
4+
const TrainingPanel = () => {
5+
const [liveData, setLiveData] = useState(null);
6+
const [onDemandData, setOnDemandData] = useState(null);
7+
8+
useEffect(() => {
9+
const getData = async () => {
10+
fetch(
11+
"https://www.ebi.ac.uk/ebisearch/ws/rest/ebiweb_training_events?format=json&query=domain_source:ebiweb_training_events%20AND%20timeframe:upcoming&start=0&size=2&fieldurl=true&fields=title,description,start_date,end_date,date_time_clean,resource_training_page,type,training_type,url,venue,materials,status,timeframe,resource_training_page,course_image&facetcount=50&sort=start_date&facets=resource_training_page:RNAcentral"
12+
)
13+
.then((Response) => Response.json())
14+
.then((findresponse) => {
15+
setLiveData(findresponse);
16+
})
17+
.catch((error) => {
18+
console.error("Error fetching live training data:", error);
19+
});
20+
21+
fetch(
22+
"https://www.ebi.ac.uk/ebisearch/ws/rest/ebiweb_training_online?format=json&query=domain_source:ebiweb_training_online&start=0&size=2&fields=title,subtitle,description,type,url&sort=title&facets=resource_training_page:RNAcentral"
23+
)
24+
.then((Response) => Response.json())
25+
.then((findresponse) => {
26+
setOnDemandData(findresponse);
27+
})
28+
.catch((error) => {
29+
console.error("Error fetching on-demand training data:", error);
30+
});
31+
};
32+
getData();
33+
}, []);
34+
35+
useEffect(() => {
36+
// Initialize vfTabs after component renders
37+
setTimeout(() => {
38+
if (window.vfTabs) {
39+
window.vfTabs();
40+
}
41+
}, 100);
42+
}, [liveData, onDemandData]);
43+
44+
const formatDesc = (content) => {
45+
if (content) {
46+
let safeContent = content.replace(/(<([^>]+)>)/gi, "");
47+
let slicedContent =
48+
safeContent.length > 200
49+
? safeContent.slice(0, 200).split(" ").slice(0, -1).join(" ") + "..."
50+
: safeContent;
51+
return slicedContent;
52+
}
53+
};
54+
55+
return React.createElement(
56+
React.Fragment,
57+
null,
58+
React.createElement("h2", {
59+
className: "text-center",
60+
style: { marginTop: '10px', marginBottom: '2px' }
61+
}, "Training"),
62+
React.createElement("div", { className: "row" },
63+
React.createElement("p", {
64+
className: "text-center col-md-8 col-md-offset-2"
65+
}, "Learn how to use RNAcentral's features")
66+
),
67+
React.createElement("div", { style: { backgroundColor: 'white', padding: '15px', marginLeft: '-10px', marginRight: '-10px', marginBottom: '-10px', borderTop: '1px solid #e3e3e3' } },
68+
React.createElement("div", { className: "vf-tabs" },
69+
React.createElement("ul", { className: "vf-tabs__list", "data-vf-js-tabs": true },
70+
React.createElement("li", { className: "vf-tabs__item" },
71+
React.createElement("a", { className: "vf-tabs__link", href: "#vf-tabs__section--2" },
72+
"On-demand training"
73+
)
74+
),
75+
React.createElement("li", { className: "vf-tabs__item" },
76+
React.createElement("a", { className: "vf-tabs__link", href: "#vf-tabs__section--1" },
77+
"Live training"
78+
)
79+
)
80+
)
81+
),
82+
React.createElement("div", { className: "vf-tabs-content", "data-vf-js-tabs-content": true },
83+
React.createElement("section", { className: "vf-tabs__section", id: "vf-tabs__section--2" },
84+
React.createElement("div", { className: "vf-grid vf-grid__col-2" },
85+
onDemandData && onDemandData.entries && onDemandData.entries.length > 0
86+
? onDemandData.entries.map((item, index) =>
87+
React.createElement("div", {
88+
key: index,
89+
className: "vf-summary vf-summary--event"
90+
},
91+
React.createElement("p", { className: "vf-summary__date" }, item.fields.type),
92+
React.createElement("h3", { className: "vf-summary__title" },
93+
React.createElement("a", {
94+
href: item.fields.url ? item.fields.url[0] : '#',
95+
target: "_blank",
96+
rel: "noopener noreferrer",
97+
className: "vf-summary__link"
98+
},
99+
item.fields.title,
100+
item.fields.subtitle && item.fields.subtitle[0] && item.fields.subtitle[0].length > 0
101+
? ": " + item.fields.subtitle[0]
102+
: ""
103+
)
104+
),
105+
React.createElement("div", null,
106+
React.createElement("div", { className: "vf-summary__text" },
107+
formatDesc(item.fields.description ? item.fields.description[0] : '')
108+
)
109+
)
110+
)
111+
)
112+
: React.createElement("p", { className: "text-center" }, "No on-demand training materials available.")
113+
)
114+
),
115+
React.createElement("section", { className: "vf-tabs__section", id: "vf-tabs__section--1" },
116+
React.createElement("div", { className: "vf-grid vf-grid__col-2" },
117+
liveData && liveData.entries && liveData.entries.length > 0
118+
? liveData.entries.map((item, index) =>
119+
React.createElement("div", {
120+
key: index,
121+
className: "vf-summary vf-summary--event"
122+
},
123+
React.createElement("p", { className: "vf-summary__date" }, item.fields.type),
124+
React.createElement("h3", { className: "vf-summary__title" },
125+
React.createElement("a", {
126+
href: item.fields.url ? item.fields.url[0] : '#',
127+
target: "_blank",
128+
rel: "noopener noreferrer",
129+
className: "vf-summary__link"
130+
}, item.fields.title)
131+
),
132+
React.createElement("div", null,
133+
React.createElement("div", { className: "vf-summary__text" },
134+
formatDesc(item.fields.description ? item.fields.description[0] : '')
135+
),
136+
React.createElement("div", { className: "vf-summary__location" },
137+
React.createElement("div", { className: "vf-u-margin__top--400" }),
138+
React.createElement("span", null, item.fields.status),
139+
" | ",
140+
React.createElement("span", null,
141+
React.createElement("i", { className: "icon icon-common icon-calendar-alt" }),
142+
" ",
143+
item.fields.date_time_clean
144+
),
145+
React.createElement("span", null,
146+
" | ",
147+
React.createElement("i", { className: "icon icon-common icon-location" }),
148+
" ",
149+
item.fields.venue === "null" || !item.fields.venue ? "Online" : item.fields.venue
150+
)
151+
)
152+
)
153+
)
154+
)
155+
: React.createElement("p", { className: "text-center" }, "No upcoming live training events available.")
156+
)
157+
)
158+
)
159+
)
160+
);
161+
};
162+
163+
// Wait for DOM to be ready
164+
if (document.readyState === 'loading') {
165+
document.addEventListener('DOMContentLoaded', function() {
166+
const rootElement = document.getElementById("training-widget-root");
167+
if (rootElement && window.ReactDOM) {
168+
ReactDOM.render(React.createElement(TrainingPanel), rootElement);
169+
}
170+
});
171+
} else {
172+
const rootElement = document.getElementById("training-widget-root");
173+
if (rootElement && window.ReactDOM) {
174+
ReactDOM.render(React.createElement(TrainingPanel), rootElement);
175+
}
176+
}
177+
})();
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<!--
2+
Copyright [2009-2017] EMBL-European Bioinformatics Institute
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
-->
13+
14+
{% extends "portal/base.html" %}
15+
16+
{% block meta_tags %}
17+
{{ block.super }}
18+
<meta name="description" content="RNAcentral website health check"/>
19+
{% endblock %}
20+
21+
{% block title %}
22+
Website Status
23+
{% endblock %}
24+
25+
{% block content %}
26+
27+
<h1>
28+
RNACentral Health Check
29+
</h1>
30+
31+
<div class="row">
32+
33+
<div class="col-md-6">
34+
35+
<p>
36+
We continuously monitor the status of <a href="{% url 'homepage' %}">rnacentral.org</a> and its related services.
37+
If any problems are detected, a notice will appear on this page.
38+
Please <a href="{% url 'contact-us' %}">contact us</a>
39+
if you are experiencing problems not reflected here.
40+
</p>
41+
42+
<table class="table table-hover">
43+
<tr>
44+
<td><strong>Database status</strong></td>
45+
<td>
46+
{% if context.database.status_code == 200 %}
47+
</span> <span class="badge badge-success"><span class="glyphicon glyphicon-ok"></span></span>
48+
{% else %}
49+
<span>{{ context.database.message }} </span>
50+
<span class="badge badge-error"><span class="glyphicon glyphicon-warning-sign"></span></span>
51+
{% endif %}
52+
</td>
53+
</tr>
54+
<tr>
55+
<td><strong>API</strong></td>
56+
<td>
57+
{% if context.api.status_code == 200 %}
58+
<span class="badge badge-success"><span class="glyphicon glyphicon-ok"></span></span>
59+
{% else %}
60+
<span>{{ context.api.message }} </span>
61+
<span class="badge badge-error"><span class="glyphicon glyphicon-warning-sign"></span></span>
62+
{% endif %}
63+
</td>
64+
</tr>
65+
<tr>
66+
<td><strong>Search</strong></td>
67+
<td>
68+
{% if context.search.status_code == 200 %}
69+
<span class="badge badge-success"><span class="glyphicon glyphicon-ok"></span></span>
70+
{% else %}
71+
<span>{{ context.search.message }} </span>
72+
<span class="badge badge-error"><span class="glyphicon glyphicon-warning-sign"></span></span>
73+
{% endif %}
74+
</td>
75+
</tr>
76+
</table>
77+
78+
<br>
79+
80+
{% if context.overall_status %}
81+
<div class="alert alert-success">All systems operational</div>
82+
{% else %}
83+
<div class="alert alert-danger"><span class="glyphicon glyphicon-warning-sign"></span> Some services are down</div>
84+
{% endif %}
85+
86+
</div>
87+
88+
</div>
89+
90+
{% endblock content %}

rnacentral/portal/templates/portal/homepage.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ <h3 class="text-center margin-bottom-0px"><i class="fa fa-bullhorn"></i> Announc
145145
<div class="panel-body">
146146
<p class="margin-top-5px">
147147
<a href="{{ context.blog_url }}" class="thumbnail">
148-
<img class="hvr-grow" src="{% static 'img/timeline/release-v24.png' %}" alt="Release announcement">
148+
<img class="hvr-grow" src="{% static 'img/timeline/release-v26.png' %}" alt="Release announcement">
149149
</a>
150150
</p>
151151
<ul class="list-inline" style="margin-left: 5px; margin-top: -10px">
@@ -176,7 +176,7 @@ <h3 class="text-center margin-bottom-0px"><i class="fa fa-pencil"></i> Citing RN
176176
</div>
177177

178178
</div>
179-
179+
180180
<div class="row">
181181

182182
<p class="lead text-center margin-bottom-0px">
@@ -217,10 +217,20 @@ <h3 class="text-center margin-bottom-0px"><i class="fa fa-pencil"></i> Citing RN
217217

218218
</div>
219219

220+
<!-- TRAINING WIDGET -->
221+
{% include "portal/training-widget.html" %}
222+
220223
</div>
221224
{% endblock content %}
222225

223226
{% block extra_js_uncompressed %}
227+
<!-- Load React from CDN -->
228+
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
229+
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
230+
231+
<!-- React Training Widget -->
232+
<script src="{% static 'js/components/training-widget/training-widget.js' %}"></script>
233+
224234
<script>
225235
$(document).ready(function() {
226236
$('#expert-databases').slick({
@@ -377,4 +387,4 @@ <h3 class="text-center margin-bottom-0px"><i class="fa fa-pencil"></i> Citing RN
377387
}
378388
]
379389
</script>
380-
{% endblock %}
390+
{% endblock %}

0 commit comments

Comments
 (0)