-
Notifications
You must be signed in to change notification settings - Fork 2
/
old_viewer.php
89 lines (87 loc) · 4.15 KB
/
old_viewer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php include "head.php";
Guard::init()->SLTRequired();
?>
<div class="searchBox-container">
<a href="./search?type=cases"><input type="text" class="searchBox" id="searchQuery" placeholder="Search All Cases"><button class="searchCases" id="searchCases">Search</button></a>
</div>
<div class="grid new" id="root" v-cloak>
<div class="grid__col grid__col--2-of-6" style="padding-left: 20px !important;">
<h1 class="info-title new">Case List <i @click="loadCases" class="fas fa-redo-alt" style="float: right;cursor: pointer;"></i></h1>
<div style='height: calc(100vh - 118px) !important;overflow: auto;' class="selectionPanel">
<div class="selectionTab" v-for="r in reports" @click="loadFullCase(r.id)">
<span style="float: right;font-size: 12px;">Lead: {{r.lead_staff}}</span>
<span style="font-size: 25px;">{{r.id}}-{{r.reporting_player[0].name}}<br>
<span style="font-size: 12px; padding: 0;">
<span v-if="r.pa" class="punishmentincase">Punishment Report</span>
<span v-if="r.ba" class="banincase">Ban Report</span>
<span class="timestamp">{{r.timestamp}}</span>
<span class="typeofreport">{{r.typeofreport}}</span>
</span>
</span>
</div>
</div>
</div>
<div class="grid__col grid__col--4-of-6">
<div class="infoPanelContainer" style='height: calc(100vh - 49px);overflow: auto;'>
<div v-if="!fullReportOpen" class="infoPanel">
<div class="pre_title">Select Case For Details</div>
</div>
<div v-else id="case_info" class="infoPanel">
<h2><span>Case ID:</span> {{openReport.id}}-<span v-html="openReport.players[0].name"></span></h2>
<p id="case"><span>Lead Staff:</span> <span v-html="openReport.lead_staff"></span></p>
<p id="case"><span>Other Staff:</span> <span v-html="openReport.other_staff"></span></p>
<p id="case"><span>Type Of Report:</span><br> {{openReport.typeofreport}}</p>
<section style="padding-left: 10px;" style="text-transform: capitalize;">
<span>Players Involved:</span>
<p v-for="p in openReport.players" style="color: #999;margin: 4px 0;">{{p.type}}: <span v-html="p.name"></span></p>
</section>
<p id="case"><span>Description Of Events:</span><br> {{openReport.doe}}</p>
<p id="case"><span>Timestamp:</span> {{openReport.timestamp}}</p>
<div v-for="pr in openReport.punishments" v-html="pr.html"></div>
<div v-for="br in openReport.bans" v-html="br.html"></div>
</div>
</div>
</div>
</div>
<script>
let vm = new Vue({
el: '#root',
data: {
reports: [],
openReport: {},
fullReportOpen: false,
offset: 0
},
methods: {
loadFullCase(id) {
$.get(`api/v2/cases/${id}/info`, data => {
data = JSON.parse(data);
if (data.code === 200) {
this.openReport = data.response.report;
this.fullReportOpen = true;
}
});
},
loadCases() {
$.get('api/v2/cases/list', {
'offset': this.offset
}, data => {
data = JSON.parse(data);
this.reports = [];
for (let i = 0; i < Object.keys(data.caseno).length; i++) {
let c = data.caseno[i];
this.reports.push(c);
}
});
},
loadLiveCase(data) {
this.reports.unshift(data);
}
},
mounted() {
this.loadCases();
}
});
let caseInfoChannel = pusher.subscribe(`caseInformation`);
caseInfoChannel.bind("receive", vm.loadLiveCase);
</script>