算法评测平台前端。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
1.3 KiB

<script>
const iconList = {
'Accepted': 'checkmark',
'Wrong Answer': 'remove',
'Runtime Error': 'bomb',
'Invalid Interaction': 'ban',
'Time Limit Exceeded': 'clock',
'Memory Limit Exceeded': 'microchip',
'Output Limit Exceeded': 'print',
'File Error': 'file outline',
'Waiting': 'hourglass half',
'Running': 'spinner',
'Compile Error': 'code',
'Submitted': 'checkmark', // NOI contests
'System Error': 'server',
'No Testdata': 'folder open outline',
'Partially Correct': 'minus',
'Judgement Failed': 'server',
'Skipped': 'fast forward'
};
Vue.component('status-label', {
template: '#statusIconTemplate',
props: ['status', 'indetail', 'progress'],
computed: {
icon() {
if (this.status in iconList) {
return iconList[this.status];
} else {
return 'man';
}
},
colorClass() {
return (this.indetail ? 'status_detail ' : '') + this.status.toLowerCase().split(' ').join('_');
},
outputStatus() {
if (this.status === 'Running' && this.progress) return 'Running ' + this.progress.finished + '/' + this.progress.total;
else return this.status;
}
}
})
</script>
<script type="text/x-template" id="statusIconTemplate">
<span class="status" :class="colorClass">
<i class="icon" :class="icon"></i>
{{ outputStatus }}
</span>
</script>