-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
252 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="false"> | ||
<content url="file://$MODULE_DIR$" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const Bans = require(_base + 'models/ban'); | ||
|
||
module.exports = { | ||
'/read/bans': { | ||
methods: ['get'], | ||
fn: function(req, res, next) { | ||
|
||
Bans.find({}, function(err, results) { | ||
if (err) { | ||
return next(err); | ||
} | ||
|
||
res.json({ result: results }); | ||
}); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const Threads = require(_base + "models/thread"); | ||
|
||
module.exports = { | ||
'/read/isAuth': { | ||
methods: ['get'], | ||
fn: function(req, res, next) { | ||
if (req.isAuthenticated()) { | ||
res.json({ result: true }); | ||
} else { | ||
res.json({ result: false }); | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<div class="ban"> | ||
<tbody> | ||
<tr data-type="IP"> | ||
<td>IP</td> | ||
<td><input id="ip" name="ip" type="text" v-model="ip"></td> | ||
</tr> | ||
<tr data-type="Message"> | ||
<td>Message</td> | ||
<td><textarea name="message" cols="48" rows="4" wrap="soft" tabindex="4" v-model="message"></textarea></td> | ||
</tr> | ||
</tbody> | ||
<input type="button" v-on:click="ban" value="Ban"> | ||
<p v-text="error"></p> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
ip: this.$route.params.ip, | ||
message: '', | ||
error: '' | ||
} | ||
}, | ||
methods: { | ||
ban() { | ||
let vm = this; | ||
_api.ban(this.ip, this.message, function (err, res) { | ||
if (err) { | ||
console.log(err); | ||
vm.error = err; | ||
vm.error = err.message; | ||
} | ||
else if (res.error) { | ||
console.log(res.error); | ||
vm.error = res.error; | ||
} | ||
else if (res.result) { | ||
vm.$router.push('/bans'); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<template> | ||
<div class="banlist"> | ||
<header> | ||
<h1 id="title">Image Board Bans</h1> | ||
<div id="description"> | ||
The purpose of this page is to give users insight into what content is being removed, and why. | ||
<br> | ||
Below are the recent bans. | ||
<br> | ||
<br> | ||
Don't be stupid. | ||
</div> | ||
</header> | ||
<table id="ban-entries"> | ||
<thead> | ||
<tr> | ||
<th class="col-ip">IP</th> | ||
<th class="col-message">Reason</th> | ||
<th class="Time">Time</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="ban in bans"> | ||
<td>{{ ban.ip }}</td> | ||
<td>{{ ban.message }}</td> | ||
<td>{{ new Date(ban.time) }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.banlist { | ||
font-family: 'Helvetica Neue', arial, sans-serif; | ||
margin: 5px 0 5px 0; | ||
padding: 0 5px; | ||
font-size: 13px; | ||
background: #eef2ff url(http://s.4cdn.org/image/fade-blue.png) top center repeat-x; | ||
} | ||
#description { | ||
margin-top: 20px; | ||
} | ||
header { | ||
text-align: center; | ||
color: #AF0A0F; | ||
} | ||
#ban-entries { | ||
table-layout: fixed; | ||
background-color: #fff; | ||
cursor: default; | ||
margin: auto; | ||
margin-top: 30px; | ||
background-color: #eef2ff; | ||
} | ||
#ban-entries th { | ||
background-color: #C0C7DE; | ||
} | ||
table, td, th, tr { | ||
border-collapse: collapse; | ||
border: 1px solid black; | ||
text-align: center; | ||
} | ||
#title { | ||
margin-top: 20px; | ||
font-size: 28px; | ||
font-weight: bold; | ||
letter-spacing: -2px; | ||
} | ||
</style> | ||
|
||
<script> | ||
export default { | ||
name: 'BanList', | ||
data () { | ||
return { | ||
bans: [] | ||
} | ||
}, | ||
created() { | ||
let vm = this; | ||
vm.updateBans(); | ||
}, | ||
beforeRouteUpdate (to, from, next) { | ||
let vm = this; | ||
vm.updateBans(); | ||
next(); | ||
}, | ||
methods: { | ||
updateBans() { | ||
let vm = this; | ||
_api.bans(function (err, res) { | ||
if (err) { | ||
console.log(err); | ||
vm.bans = []; | ||
} | ||
else if (res.result) { | ||
vm.bans = res.result; | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
</form> | ||
</template> | ||
|
||
<style> | ||
<style scoped> | ||
</style> | ||
|
||
|
Oops, something went wrong.