diff --git a/templates/auto_pt/status.html b/templates/auto_pt/status.html
index 6bdb570..38c0950 100644
--- a/templates/auto_pt/status.html
+++ b/templates/auto_pt/status.html
@@ -109,7 +109,13 @@
- 历史数据
+ 签到
+
+ 更新
+
+ 编辑
+
+ 历史 c
@@ -231,26 +237,26 @@
}
const vm = new Vue({
- el: '#status',
- data() {
- return {
- chart: null,
- ptData: {},
- option: {},
- showList: false,
- showSiteChart: false,
- begInvite: false,
- showLogo: true,
- showLegend: true,
- shuffle: false,
+ el: '#status',
+ data() {
+ return {
+ chart: null,
+ ptData: {},
+ option: {},
+ showList: false,
+ showSiteChart: false,
+ begInvite: false,
+ showLogo: true,
+ showLegend: true,
+ shuffle: false,
- }
- },
- beforeMount() {
+ }
+ },
+ beforeMount() {
- },
- mounted() {
- {#this.chart = this.$refs.charts.chart#}
+ },
+ mounted() {
+ {#this.chart = this.$refs.charts.chart#}
this.getData()
},
watch: {
@@ -263,34 +269,43 @@
deep: true,
}
},
- methods: {
- showHistoryList(id) {
- axios.get(
- "{% url 'site_data_api' %}" + '?id=' + id
- ).then(res => {
- console.log('获取数据列表成功', res.data)
- let data = res.data
- if ((typeof res.data) == "string") {
- data = JSON.parse(data)
- }
- {#console.log(typeof res.data.data)#}
- if (res.data.code === 0) {
- {#this.ptData = res.data.data#}
- {#this.ptData = res.data.data#}
- {#this.setPie()#}
- {#this.setCard()#}
+ methods: {
+ signIn(id) {
+ alert(id)
+ },
+ updateSite(id) {
+ alert(id)
+ },
+ editSite(id) {
+ alert(id)
+ },
+ showHistoryList(id) {
+ axios.get(
+ "{% url 'site_data_api' %}" + '?id=' + id
+ ).then(res => {
+ console.log('获取数据列表成功', res.data)
+ let data = res.data
+ if ((typeof res.data) == "string") {
+ data = JSON.parse(data)
+ }
+ {#console.log(typeof res.data.data)#}
+ if (res.data.code === 0) {
+ {#this.ptData = res.data.data#}
+ {#this.ptData = res.data.data#}
+ {#this.setPie()#}
+ {#this.setCard()#}
- this.setLine(data.data)
- } else {
- this.loading = false
- this.$message({
- type: 'warning',
- message: '获取数据列表失败!'
- });
- }
- })
- //.catch(res => {
- //console.log('获取数据列表失败', res)
+ this.setLine(data.data)
+ } else {
+ this.loading = false
+ this.$message({
+ type: 'warning',
+ message: '获取数据列表失败!'
+ });
+ }
+ })
+ //.catch(res => {
+ //console.log('获取数据列表失败', res)
// this.$message({
// type: 'warning',
// message: '获取数据列表失败!' + res
@@ -311,28 +326,28 @@
this.showLogo = !this.showLogo
this.setPie()
}
- ,
- showLegendMode() {
- this.showLegend = !this.showLegend
- this.setPie()
- }
- ,
- setChartOption(option) {
- {#this.option = option#}
- if (this.chart) {
- this.chart.clear()
+ ,
+ showLegendMode() {
+ this.showLegend = !this.showLegend
+ this.setPie()
}
- this.chart.setOption(option)
- window.addEventListener("resize", () => {
- this.chart.resize()
- })
- //this.$nextTick(() => {//自适应宽度
- // this.chart.resize();
- //})
- }
- ,
- shuffleList() {
- this.shuffle = true
+ ,
+ setChartOption(option) {
+ {#this.option = option#}
+ if (this.chart) {
+ this.chart.clear()
+ }
+ this.chart.setOption(option)
+ window.addEventListener("resize", () => {
+ this.chart.resize()
+ })
+ //this.$nextTick(() => {//自适应宽度
+ // this.chart.resize();
+ //})
+ }
+ ,
+ shuffleList() {
+ this.shuffle = true
this.ptData.status_list.sort(() => {
return Math.random() > 0.5 ? -1 : 1
})
@@ -494,15 +509,15 @@
this.setChartOption(option)
}, 50)
},
- setTree() {
- let ptData = this.ptData
- let begInvite = !this.begInvite
- let uploadedList = []
- let downloadedList = []
- ptData.status_list.forEach((site, index) => {
- uploadedList.push({
- 'value': site.uploaded,
- 'path': 'uploaded/' + site.name,
+ setTree() {
+ let ptData = this.ptData
+ let begInvite = !this.begInvite
+ let uploadedList = []
+ let downloadedList = []
+ ptData.status_list.forEach((site, index) => {
+ uploadedList.push({
+ 'value': site.uploaded,
+ 'path': 'uploaded/' + site.name,
'name': `${site.name}\t${renderSize(site.uploaded)}`
})
downloadedList.push({
@@ -779,9 +794,9 @@
},
- getData() {
- axios.get(
- "{% url "site_status_api" %}"
+ getData() {
+ axios.get(
+ "{% url "site_status_api" %}"
).then(res => {
console.log('获取数据列表成功', res.data)
if (res.data.code === 0) {
@@ -797,9 +812,9 @@
message: '获取数据列表失败!'
});
}
- }).catch(res => {
- console.log('获取数据列表失败', res)
- this.$message({
+ }).catch(res => {
+ console.log('获取数据列表失败', res)
+ this.$message({
type: 'warning',
message: '获取数据列表失败!' + res
});