Skip to content

Commit

Permalink
updated archive branch
Browse files Browse the repository at this point in the history
  • Loading branch information
msramalho committed Jan 31, 2021
1 parent 8a9244a commit 85a4297
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 27 deletions.
3 changes: 2 additions & 1 deletion ui/components/LogsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
<script>
export default {
async fetch() {
const data = await this.$axios.get(`logs`);
// const data = await this.$axios.get(`logs`);
const data = await this.$axios.get(`logs.json`);
this.logs = data.data;
},
data() {
Expand Down
5 changes: 2 additions & 3 deletions ui/components/PlotStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ export default {
async fetch() {
this.loading_user_tweets = true;
this.loading_mb = true;
const r = await this.$axios.get(`db_logs`, {
// params: { max_items: 500 },
});
// const r = await this.$axios.get(`db_logs`, {});
const data = await this.$axios.get(`db_logs.json`);
r.data.last_updated = new Date(
Date.parse(r.data.last_updated)
).toLocaleTimeString();
Expand Down
3 changes: 2 additions & 1 deletion ui/components/Statistics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
<script>
export default {
async fetch() {
const data = await this.$axios.get(`stats`);
// const data = await this.$axios.get(`stats`);
const data = await this.$axios.get(`stats.json`);
this.stats = data.data;
},
data() {
Expand Down
10 changes: 4 additions & 6 deletions ui/components/elections/Candidates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,8 @@ import Plotly from "plotly.js-dist";
export default {
async fetch() {
this.loading_plot = true;
const r = await this.$axios.get(`task_data`, {
params: { task_name: "measure candidates" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "measure candidates" }});
const r = await this.$axios.get(`task_data_measure_candidates.json`);
this.fetchHateSpeech();
// read relevant data
this.x = r.data.history[0].map((d) => new Date(d));
Expand Down Expand Up @@ -335,9 +334,8 @@ export default {
return arr.reduce((a, b) => Math.max(a, b));
},
async fetchHateSpeech() {
const r = await this.$axios.get(`task_data`, {
params: { task_name: "measure hatespeech" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "measure hatespeech" },});
const r = await this.$axios.get(`task_data_measure_hatespeech.json`);
this.hatespeech.x = r.data.history[0].map((d) => new Date(d));
this.hatespeech.candidates = {};
r.data.history[1].forEach((list, i) => {
Expand Down
7 changes: 4 additions & 3 deletions ui/components/elections/Polarization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ import Plotly from "plotly.js-dist";
export default {
async fetch() {
this.loading_plot = true;
const r = await this.$axios.get(`task_data`, {
params: { task_name: "measure followers polarization" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "measure followers polarization" },});
const r = await this.$axios.get(
`task_data_measure_followers_polarization.json`
);
// this.date = r.data.history[0][0]; //only contains this date
this.candidates = r.data.history[1][0].candidates;
Expand Down
5 changes: 2 additions & 3 deletions ui/components/general/CreationDates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import Plotly from "plotly.js-dist";
export default {
async fetch() {
this.loading_plot = true;
const r = await this.$axios.get(`task_data`, {
params: { task_name: "measure creation dates" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "measure creation dates" },});
const r = await this.$axios.get(`task_data_measure_creation_dates.json`);
this.date = r.data.history[0][0]; //only contains this date
this.data_points = r.data.history[1][0].filter(
Expand Down
5 changes: 2 additions & 3 deletions ui/components/general/TweetTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ import Plotly from "plotly.js-dist";
export default {
async fetch() {
this.loading_plot = true;
const r = await this.$axios.get(`task_data`, {
params: { task_name: "count by type" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "count by type" },});
const r = await this.$axios.get(`task_data_count_by_type.json`);
this.x = r.data.history[0].map((d) => new Date(d));
this.y = r.data.history[1];
Expand Down
5 changes: 2 additions & 3 deletions ui/components/malicious/Fakenews.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ import Plotly from "plotly.js-dist";
export default {
async fetch() {
this.loading_plot = true;
const r = await this.$axios.get(`task_data`, {
params: { task_name: "measure fakenews" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "measure fakenews" },});
const r = await this.$axios.get(`task_data_measure_fakenews.json`);
// console.log(r.data);
// read relevant data
Expand Down
5 changes: 2 additions & 3 deletions ui/components/malicious/Suspensions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ import Plotly from "plotly.js-dist";
export default {
async fetch() {
this.loading_plot = true;
const r = await this.$axios.get(`task_data`, {
params: { task_name: "measure suspensions" },
});
// const r = await this.$axios.get(`task_data`, {params: { task_name: "measure suspensions" },});
const r = await this.$axios.get(`task_data_measure_suspensions.json`);
// read relevant data
this.x = r.data.history[0].map((d) => new Date(d)).reverse();
Expand Down
1 change: 1 addition & 0 deletions ui/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"home": "Home",
"change_lang": "Ver em Português",
"title": "Election Watch - 2021 Portuguese Presidentials",
"archived_warning": "Displaying archived data (2020/09/02 - 2021/01/31)",
"source_code": "Source Code",
"links": {
"source_code": {
Expand Down
1 change: 1 addition & 0 deletions ui/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"home": "Início",
"change_lang": "View in English",
"title": "Election Watch - Presidenciais Portuguesas 2021",
"archived_warning": "Usando dados arquivados (2020/09/02 - 2021/01/31)",
"source_code": "Código Fonte",
"links": {
"source_code": {
Expand Down
4 changes: 4 additions & 0 deletions ui/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
<v-icon>mdi-{{ `chevron-${miniVariant ? "right" : "left"}` }}</v-icon>
</v-btn>
<v-toolbar-title v-text="this.$t('default.title')" />
<span
style="color: red; margin-left: 10px"
v-text="this.$t('default.archived_warning')"
></span>
<v-spacer />
<v-text-field
flat
Expand Down
3 changes: 2 additions & 1 deletion ui/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export default {
['@nuxtjs/axios', {
// baseURL: "http://35.234.106.142/",
// baseURL: process.env.DEPLOY_ENV === 'GH_PAGES' ? "https://peaceful-forest-55095.herokuapp.com/http://35.234.106.142/" : "http://localhost:5000/"
baseURL: process.env.DEPLOY_ENV === 'GH_PAGES' ? "https://election-watch-api.msramalho.xyz" : "http://35.234.106.142/"
// baseURL: process.env.DEPLOY_ENV === 'GH_PAGES' ? "https://election-watch-api.msramalho.xyz" : "http://35.234.106.142/"
baseURL: process.env.DEPLOY_ENV === 'GH_PAGES' ? "https://msramalho.github.io/election-watch-portugal-presidentials-2021" : "http://localhost:5000/"
// baseURL: "http://localhost:5000/"
}],
'cookie-universal-nuxt',
Expand Down

0 comments on commit 85a4297

Please sign in to comment.