Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bojan dev #9

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
586 changes: 391 additions & 195 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file added src/assets/Linux.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Windows.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions src/components/Device.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template lang="pug">
div()
.layout-padding.relative-position(v-if="!loading && thisDevice.name")
h6.text-center(style="padding: 0px; margin: 0px;") {{thisDevice.name}}
h6.text-center(style="padding: 0px; margin: 0px;") {{thisDevice.name}}
q-icon.float-lefth.on-right.inline( style="padding-bottom:3px;" :name='parseDevice.icon(thisDevice)' :color="parseDevice.color(thisDevice)")
q-tooltip Your Device Name

q-card(style='width:90vw; max-height:410px;')
q-card-media.relative-position
q-btn.infobtn.absolute-top-right(color='blue' flat round @click="openConfigModal()")
Expand All @@ -22,7 +22,7 @@ div()
div(v-if="thisDevice.power") {{thisDevice.power.toFixed(4)}}
div(v-else)
| 0.0
small(v-if="thisDevice.pending") Pending:{{thisDevice.pending.toFixed(0)}}
small(v-if="thisDevice.pending") Pending:{{thisDevice.pending.toFixed(0)}}
q-tooltip Pending power can take 24 hours or more to be verified.
q-btn.absolute-right(flat @click="refreshDevice()")
q-tooltip Refresh Device
Expand All @@ -37,16 +37,16 @@ div()
p(v-else) Downloading Work Units....
q-card-main(v-if="toggle" style="max-height:195px; overflow:scroll; padding-top:0px;")
div(v-if="activeTasks.length > 0" v-for="(task,index) in activeTasks" :key='task.slot[0]' style="margin-bottom:5px;")

q-progress( style="height:10px;" v-if="task.active_task_state[0] == 1 && !onBatteries" :buffer="0" height="40px" stripe :percentage="modulateTaskProgress(task.checkpoint_fraction_done[0])")
q-progress(v-else :buffer="0" height="40px" stripe :percentage="task.checkpoint_fraction_done[0]*100" color="grey-4")
q-tooltip
q-tooltip
p(style="margin:0px;") Task:
| {{task.result_name[0]}}
| {{task.result_name[0]}}
div(style="height:10px;")
p(style="margin:0px;") Progress:
| {{(task.checkpoint_fraction_done[0]*100).toFixed(0)}}%

q-card-separator
q-card-actions.taller.relative-position()
q-btn(small round flat)
Expand Down Expand Up @@ -218,7 +218,7 @@ export default {
setTimeout(() => {
window.olark('api.box.hide')
console.log("INIT")
console.log('LOCAL DEVICE',window.local.ipcRenderer.sendSync('localDevice'))
console.log('LOCAL DEVICE',window.local.ipcRenderer.sendSync('localDevice'))
if (this.initialized){
if (masterInterval) clearInterval(masterInterval)
masterInterval = setInterval(this.init, 180000)
Expand All @@ -232,8 +232,8 @@ export default {
},
props: ['thisUser', 'authenticated', 'api', 'thisModal', 'ch'],
mounted() {
console.log('this.route',this.$route.name)
if (!this.$route.name === 'Desktop') return
console.log('this.route',this.$route.name);
if (!this.$route.name === 'Desktop') return;
if (masterInterval) clearInterval(masterInterval)
// masterInterval = setInterval(this.init, 10000)
this.init()
Expand Down Expand Up @@ -270,7 +270,7 @@ export default {
window.local.ipcRenderer.on('deviceReady', (event, device) => {
console.log('GOT DEVICE:', device)
})
window.local.ipcRenderer.on('boinc.error', (event, error) => {
window.local.ipcRenderer.on('boinc.error', (event, error) => {

console.error('boinc.error', error)
// if (typeof error == "string") alert(error)
Expand All @@ -283,7 +283,7 @@ export default {
// }
})
}
},
},
watch: {
activeTasks(value) {
if (value.length > 0) {
Expand Down Expand Up @@ -340,7 +340,7 @@ export default {
this.actionbg.backgroundColor = 'white'
window.local.ipcRenderer.send('boinc.cmd', 'quit')
clearInterval(this.deviceStatePoll)
}
}
// var result = await this.api.device.updateStatus(deviceStatus)
} catch (error) {
ec(error)
Expand Down Expand Up @@ -376,4 +376,4 @@ export default {
body {
user-select: none;
}
</style>
</style>
40 changes: 20 additions & 20 deletions src/components/Leaderboards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
div
.row.justify-center
.col-xs-12
q-card(v-if="globalStats")
q-card(v-if="globalStats")
p.light-paragraph.text-center Network Stats
.row.justify-center
.col-auto
Expand All @@ -19,16 +19,16 @@ div
div(style="width:200px;")
.row.justify-center
h5 {{parseInt(globalStats.averagePower).toLocaleString()}}
p.light-paragraph.text-center Average Power
p.light-paragraph.text-center Average Power
.row
.col-md-12.col-lg-6(style="padding-bottom:15px; max-height:520px;")
q-card(style="height:100%; overflow:auto;")
p.light-paragraph.text-center Top Movers (48hrs)
table.q-table.horizontal-separator(style="width:100%")
thead
tr
th
th.relative-position(style="width:50px;")
th
th.relative-position(style="width:50px;")
q-tooltip Boid Power change Percentage
q-icon.absolute-center(name="fa-percent" color="grey-7" size="25px" style="padding-top:15px;")
img.absolute-center(src="/statics/images/BoidPower.svg" style="height:30px; top:15px; padding-right:45px;")
Expand Down Expand Up @@ -56,7 +56,7 @@ div
p.light-paragraph.text-center Recently Added Team Promotions
div(style="height:430px; overflow:auto;")
promoCard.cursor-pointer.clickable(
v-for="promo of recentPromotions"
v-for="promo of recentPromotions"
:key="promo.id" :promo="promo"
:basic="true"
@click.native="$router.push({name:'Team',params:{teamname:promo.team.name},query:{promo:promo.id}})"
Expand All @@ -73,9 +73,9 @@ div
small Power Tier
div(style="padding:4px;")
.row
q-btn(big :class="{tierBtn:index === selectedTier}"
v-for="(tier,index) of tiersLeaderboard.length"
:key="index"
q-btn(big :class="{tierBtn:index === selectedTier}"
v-for="(tier,index) of tiersLeaderboard.length"
:key="index"
@click="selectedTier = index") {{index}}
.col-auto
.row.justify-center
Expand All @@ -86,8 +86,8 @@ div
table.q-table.horizontal-separator(v-if="!showSocial" style="width:100%")
thead
tr
th
th.relative-position(style="width:50px;")
th
th.relative-position(style="width:50px;")
q-tooltip Boid Power change Percentage
img.absolute-center(src="/statics/images/BoidPower.svg" style="height:30px; top:15px; padding-right:15px;")
tbody( v-for="(user,index) in selectedLeaderboard" :key="user.id").full-width
Expand All @@ -114,10 +114,10 @@ div
tr
th.relative-position
small.light-paragraph.absolute-left Does not include team leaders.
th.relative-position(style="width:30px;")
th.relative-position(style="width:30px;")
q-tooltip Active users invited(tier 1+)
q-icon.absolute-center(name="fa-users" style="top:15px;" color="grey-8")
th.relative-position(style="width:30px;")
th.relative-position(style="width:30px;")
q-tooltip Boid Power from social invites only
p.absolute-left(style="height:30px; top:5px; padding-left:10px;") S
img.absolute-center(src="/statics/images/BoidPower.svg" style="height:30px; top:15px; padding-right:5px;")
Expand Down Expand Up @@ -147,7 +147,7 @@ div
thead
tr
th(style="width:0px;")
th.relative-position(style="width:50px;")
th.relative-position(style="width:50px;")
q-tooltip Team Boid Power
img.absolute-center(src="/statics/images/BoidPower.svg" style="height:30px; top:15px;")
tbody(v-for="(team,index) in teamLeaderboard" :key="team.id")
Expand All @@ -167,7 +167,7 @@ div
import promoCard from '@/promoCard.vue'

export default {

name: 'index',
data() {
return {
Expand All @@ -185,7 +185,7 @@ export default {
components:{promoCard},
computed: {
recentPromotions(){
if (!this.promotions) return
if (!this.promotions) return
const now = Date.now()
return this.promotions.map((el,i,arr)=>{
if (Date.parse(el.startDate) > now ){el.active = false}else{el.active = true}
Expand All @@ -208,7 +208,7 @@ export default {
},
watch: {
team(val) {
console.log('gotTeam', val)
// console.log('gotTeam', val)
},
selectedTier(val){
if (val != null) {
Expand All @@ -219,18 +219,18 @@ export default {
else return this.showSocial = true, this.selectedLeaderboard = null
},
thisUser(val){
console.log(val)
// console.log("leader1>>>>",val)
if (!val.tier) this.selectedTier = 0
if (!this.selectedTier && this.showSocial != true ) this.selectedTier = val.tier
},
tiersLeaderboard(val){
console.log(val)
// console.log("leader2>>>",val)
if(!val) return
if (this.showSocial === false) this.selectedLeaderboard = val[this.selectedTier]
}
},
async mounted() {
console.log('MOUNTED LEADERBOARDS')
// console.log('MOUNTED LEADERBOARDS')
this.refreshLeaderboard()

// console.log(this.socialLeaderboard)
Expand Down Expand Up @@ -259,4 +259,4 @@ p
.user:hover {
background-color: $grey-2
}
</style>
</style>
35 changes: 20 additions & 15 deletions src/components/User.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
img.tokenimg( :src="thatUser.team.image")
td {{thatUser.team.name}}
.col-xs-12.col-sm-6.col-md-12
//- q-card(@click="ended=false")
q-card(@click="ended=false")
p.light-paragraph.text-center Team Prizes Won
div(v-if="teamPromotions")
h6.light-paragraph List of team Promotions
Expand Down Expand Up @@ -103,25 +103,27 @@
q-icon.text-center.absolute-left(v-if="stat.icon != 'add'" color="green-2" :name='stat.icon' style="font-size:45px; z-index:-4;")
q-tooltip {{stat.label}}
.row(style="width:100%; margin:0 !important;")
//- q-card.animate-scale.relative-position(v-if="thisUser.tokens" style="width:100%;")
q-card.animate-scale.relative-position(v-if="thisUser.tokens" style="width:100%;")
.h6.light-paragraph.text-center User Devices
.row(v-if="authenticated" @click="$e.$emit('showInfoModal',info.devices)")
.row(v-if="authenticated")
.col( v-for="(device, index) in userDevice" :key="device.id")
.col-xs-6.col-sm-3.col-md-2.col-lg-2
q-card.relative-position.ellipsis(style="min-width:70px; padding:10px;")
q-item-tile(label style="user-select: none;") {{index+1}}. {{device.name}} {{device.type}}
q-item-tile.relative-position(style="padding-left:15px;" sublabel) CPU: {{device.boincPower.toLocaleString()}}
|{{displayPending(device)}}
q-tooltip Device Power (Pending)
img.absolute-left(src="/statics/images/BoidPower.svg" style="height:20px; left:0px;")
q-item-tile.relative-position(style="padding-left:15px;" sublabel) GPU: {{device.rvnPower.toLocaleString()}}
div.absolute-top-left(style="width:100px; height:30px;")
img.absolute-left(src="/statics/images/BoidPower.svg" style="height:20px; left:0px;")
q-card.relative-position.ellipsis(style="min-width:70px; padding:10px;" @click="$router.push({name:'deviceTest',params:{deviceId:device.id}})")
q-item-side()
q-icon(:name="parseDevice.icon(device)" :color="parseDevice.color(device)") {{device.name}}{{device.type}}
q-item-tile(label style="user-select: none;")
q-item-tile.relative-position(style="padding-left:15px;" sublabel) CPU: {{device.boincPower.toLocaleString()}}
|{{displayPending(device)}}
q-tooltip Device Power (Pending)
img.absolute-left(src="/statics/images/BoidPower.svg" style="height:20px; left:0px;")
q-item-tile.relative-position(style="padding-left:15px;" sublabel) GPU: {{device.rvnPower.toLocaleString()}}
div.absolute-top-left(style="width:100px; height:30px;")
img.absolute-left(src="/statics/images/BoidPower.svg" style="height:20px; left:0px;")
.row.justify-center(style="width:100%; margin:0 !important;" v-if="thatUser.devices.length > 3 " )
q-btn(flat :class="{activeTab:true}" style = "background-color:#ddca43;" @click="deviceDisplay(false)" v-if="!devShowFlag") Show more
q-btn(flat :class="{activeTab:true}" style = "background-color:#ddca43;" @click="deviceDisplay(true)" v-else) Hide
//- .row(style="width:100%; margin:0 !important;")
//- q-card.animate-scale.relative-position(style="width:100%; padding:10px;")
.row(style="width:100%; margin:0 !important;")
q-card.animate-scale.relative-position(style="width:100%; padding:10px;")
.h6.light-paragraph.text-center Work Units and Pow Shores
.row.justify-center(style="width:100%; padding:10px;")
q-btn(flat :class="{activeTab:powDisplay === false}" @click="powDisplay = false")
Expand All @@ -136,6 +138,7 @@
import userChart from '@/userChart.vue'
import parseSocials from 'lib/parseSocial.js'
import promoCard from '@/promoCard.vue'
import parseDevice from 'src/lib/parseDevice'

var info = require('src/lib/infoText.json')

Expand All @@ -145,7 +148,9 @@
data () {
return {
user:[],
parseDevice,
userTeam:[],
openURL,
info,
parseSocial:[],
chartData:null,
Expand Down Expand Up @@ -428,4 +433,4 @@
.activeTab
background-color: $green-7
color: white
</style>
</style>
Loading