Skip to content

Commit

Permalink
Merge branch 'js' of github.com:78/ssbc into js
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoxia committed Jun 24, 2019
2 parents dc5f41a + 4b5b216 commit 4df4d2b
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 17 deletions.
10 changes: 10 additions & 0 deletions web/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ html {
.highlight {
color: red;
}


a{
color: #1a0dab;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
23 changes: 16 additions & 7 deletions web/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<template>
<el-container>
<el-header>
<h1 class="title">
手撕包菜
</h1>
</el-header>
<el-main>
<div class="content">
<h1 class="title">
手撕包菜
</h1>
<p class="subtitle">
Search <b>anything</b> you want :D
</p>
<div style="margin-top: 15px;" v-on:keyup.enter="submit">
<div style="margin-top: 30px;" v-on:keyup.enter="submit">
<el-input placeholder="Movie names" v-model="keyword" class="input-keyword">
<el-button slot="append" v-on:click="submit" icon="el-icon-search">Search</el-button>
</el-input>
</div>
<p class="rank">
<a href="/log">Today Logs Rank</a>
<el-button type="text" @click="goLogsRank">Logs Rank</el-button>
<el-button type="text" @click="goSpider">Spider Report</el-button>
</p>
</div>
</el-main>
Expand Down Expand Up @@ -44,6 +45,14 @@ export default {
const url = '/search?q=' + encodeURIComponent(this.keyword)
window.location = url
}
},
goLogsRank() {
window.location = '/log'
},
goSpider() {
window.location = '/spider'
}
}
};
Expand Down Expand Up @@ -75,14 +84,14 @@ export default {
}
.content {
position: absolute;
top: 50%;
top: 20%;
left: 50%;
margin-left: -250px;
margin-top: -50px;
}
.rank {
text-align: center;
margin-top: 20px;
margin-top: 15px;
}
</style>
6 changes: 3 additions & 3 deletions web/pages/log.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div>
<el-page-header @back="goBack" title="" content="Today Logs Rank">
<el-page-header @back="goBack" title="" :content="'Logs Rank ' + date">
</el-page-header>
<el-table
size="small"
:data="tableData"
style="width: 100%">
<el-table-column
Expand Down Expand Up @@ -51,7 +51,7 @@ export default {
count: 20
}
const res = await $axios.$get('/apis/log', {params: params})
return {tableData: res.items, currentPage: page}
return {tableData: res.items, currentPage: page, date: res.date}
},
methods: {
Expand Down
7 changes: 0 additions & 7 deletions web/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ export default {
color: #555;
}
.item .name a{
color: #1a0dab;
text-decoration: none;
}
.item .name a:hover {
text-decoration: underline;
}
.el-pagination {
margin: 30px 0 10px 0;
Expand Down
60 changes: 60 additions & 0 deletions web/pages/spider.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<div>
<el-page-header @back="goBack" title="" content="Spider Status">
</el-page-header>
<el-table
size="small"
:data="tableData"
style="width: 100%">
<el-table-column
label="Date"
prop="_id"
width="200">
</el-table-column>
<el-table-column
prop="new_hashes"
label="New Hashes"
width="200">
</el-table-column>
<el-table-column
prop="total_reqs"
label="Total Requests"
width="200">
</el-table-column>
<el-table-column
prop="valid_reqs"
label="Valid Requests"
width="200">
</el-table-column>
</el-table>
</div>
</template>


<script type="text/javascript">
export default {
layout: 'search',
async asyncData({$axios, error, query}) {
const params = {}
const res = await $axios.$get('/apis/spider', {params: params})
return {tableData: res.items.slice(0, 30)}
},
methods: {
goBack() {
window.history.length > 1
? this.$router.go(-1)
: this.$router.push('/')
}
}
};
</script>

<style type="text/css" scoped>
.el-page-header {
margin: 0 0 10px 0;
}
</style>

0 comments on commit 4df4d2b

Please sign in to comment.