Skip to content

Commit

Permalink
add log and server log to game history
Browse files Browse the repository at this point in the history
  • Loading branch information
jamshidi799 committed Apr 9, 2021
1 parent bfb6fa3 commit c7afc59
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 58 deletions.
63 changes: 9 additions & 54 deletions components/dashboard/games_new/HistoryOfGames.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
{{ item.winner ? item.winner.name : '' }}
</template>
<template v-slot:[`item.log`]="{ item }">
<v-btn icon :loading="btnLoading" :ripple="false" :disabled="item.status !== 'successful'">
<v-btn icon :loading="btnLoading" :ripple="false" :disabled="item.status !== 'successful'" :href="item.log">
<v-icon size="30px" class="icon-hover">mdi-download</v-icon>
</v-btn>
</template>
<template v-slot:[`item.serverLog`]="{ item }">
<v-btn icon :loading="btnLoading" :ripple="false" :disabled="item.status !== 'successful'" :href="item.server_log">
<v-icon size="30px" class="icon-hover">mdi-download</v-icon>
</v-btn>
</template>
Expand All @@ -55,43 +60,6 @@
<v-pagination v-model="page" :length="pageCount" total-visible="5" class="my-3" />
<Logo />
</div>

<v-dialog v-model="dialog" width="350">
<v-card>
<v-container>
<div class="dialog-header mb-4 mt-4">
<div>
<h4>دریافت لاگ</h4>
</div>
<div @click="toggleDialog()" style="cursor: pointer">
<h4>
<v-icon>mdi-close</v-icon>
</h4>
</div>
</div>
<v-list-item>
<v-list-item-content>
<v-list-item-title>لاگ سرور</v-list-item-title>
</v-list-item-content>
<v-list-item-action>
<v-btn href="https://www.google.com/" target="_blank">
<v-icon color="primary">mdi-download</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
<v-list-item>
<v-list-item-content>
<v-list-item-title>لاگ گرافیک</v-list-item-title>
</v-list-item-content>
<v-list-item-action>
<v-btn icon href="https://www.google.com/" target="_blank">
<v-icon color="primary">mdi-download</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-container>
</v-card>
</v-dialog>
</div>
</template>

Expand Down Expand Up @@ -140,14 +108,16 @@ export default {
// { text: 'زمان', align: 'center', value: '' },
{ text: 'وضعیت بازی', align: 'center', value: 'status' },
{ text: 'تیم برنده', align: 'center', value: 'winner.name' },
{ text: 'دریافت لاگ', align: 'center', value: 'log' },
{ text: 'لاگ', align: 'center', value: 'log' },
{ text: 'لاگ سرور', align: 'center', value: 'serverLog' },
],
data: [],
currentGame: {
serverLog: '',
graphicLog: '',
},
status_code: 200,
item: null,
};
},
watch: {
Expand Down Expand Up @@ -210,21 +180,6 @@ export default {
else if (res === '') return 'mdi-emoticon-happy-outline';
else if (res === '') return 'mdi-progress-clock';
},
toggleDialog() {
this.dialog = !this.dialog;
},
getGameLog(id) {
this.btnLoading = true;
this.$axios.$get(`challenge/match/${id}`).then(res => {
if (res.status_code === 200) {
this.data = res.data;
this.dialog = true;
} else {
this.$toast.error('خطا در برقراری ارتباط!');
}
});
this.btnLoading = false;
},
},
};
</script>
Expand Down
5 changes: 3 additions & 2 deletions components/dashboard/submission/SubmissionStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export default {
compiling: { i: 'mdi-progress-wrench', color: 'info' },
uploaded: { i: 'mdi-progress-check', color: 'info' },
uploading: { i: 'mdi-progress-upload', color: 'info' },
infra_compile_message: { i: 'mdi-gitlab', color: 'info' },
},
}
};
},
}
};
</script>
21 changes: 20 additions & 1 deletion components/dashboard/submission/SubmissionsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</template>
<template v-slot:[`item.user`]="{ item }">
<!-- {{ item.user.profile.firstname_fa + ' ' + item.user.profile.lastname_fa }} -->
{{item.user}}
{{ item.user }}
</template>
<template v-slot:[`item.submit_time`]="{ item }">
<date-time-formatter :date="item.submit_time" />
Expand All @@ -38,8 +38,20 @@
<v-icon>mdi-download</v-icon>
</v-btn>
</template>
<template v-slot:[`item.log`]="{ item }">
<v-btn icon @click="onDetailClick(item.infra_compile_message)" :disabled="!item.infra_compile_message">
<v-icon>mdi-transit-connection</v-icon>
</v-btn>
</template>
</v-data-table>
<v-pagination v-model="page" :length="pageCount" :total-visible="5" class="my-3" />
<v-dialog v-model="dialog" hide-overlay transition="dialog-bottom-transition" width="500">
<div class="pa-4 bg-color-12">
<p dir="ltr">
{{ detail }}
</p>
</div>
</v-dialog>
</div>
</template>

Expand Down Expand Up @@ -69,6 +81,7 @@ export default {
{ text: this.$t('form.language'), sortable: false, value: 'language', align: 'center' },
{ text: this.$t('dashboard.status'), sortable: false, value: 'status', align: 'center' },
{ text: this.$t('form.file'), sortable: false, value: 'file', align: 'center', width: 70 },
{ text: 'جزییات', sortable: false, value: 'log', align: 'center' },
];
},
},
Expand All @@ -77,6 +90,8 @@ export default {
page: 1,
pageCount: 0,
itemsPerPage: 5,
dialog: false,
detail: '',
};
},
methods: {
Expand All @@ -95,6 +110,10 @@ export default {
this.$toast.error('کد هنوز کامپال نشده است.');
}
},
onDetailClick(text) {
this.dialog = true;
this.detail = text;
},
},
};
</script>
Expand Down
3 changes: 2 additions & 1 deletion locales/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@
"groups": "انتخابی",
"final": "مرحله نهایی",
"primary": "مرحله مقدماتی",
"closing": "مراسم اختتامیه"
"closing": "مراسم اختتامیه",
"infra_compile_message": "کامپایل‌ زیرساخت"
},
"staff": {
"technicalTeam": "تیم فنی",
Expand Down

0 comments on commit c7afc59

Please sign in to comment.