TheDesk Tips redesign
This commit is contained in:
parent
1cbd6992e3
commit
0f75972616
|
@ -93,7 +93,7 @@
|
|||
display: grid;
|
||||
grid-template-columns: 3rem 2.3rem 2.5fr 1fr 4.6rem;
|
||||
grid-template-rows: 1.7rem 1.5rem;
|
||||
grid-template-areas: 'cover name name artist refresh' 'cover progress progress progress time';
|
||||
grid-template-areas: 'cover name name name refresh' 'cover progress progress progress time';
|
||||
}
|
||||
#spot-refresh {
|
||||
grid-area: refresh;
|
||||
|
@ -108,18 +108,12 @@
|
|||
overflow: hidden;
|
||||
line-height: 1.92rem;
|
||||
}
|
||||
#spot-artist {
|
||||
grid-area: artist;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
line-height: 1.92rem;
|
||||
}
|
||||
#spot-img {
|
||||
width: 90%;
|
||||
}
|
||||
#spot-time {
|
||||
grid-area: time;
|
||||
line-height: 0.5rem;
|
||||
}
|
||||
.progress {
|
||||
grid-area: progress;
|
||||
|
|
|
@ -170,7 +170,7 @@ onmessage = function(e) {
|
|||
} else if (e.data[0] == 'npCore') {
|
||||
npCore(e.data[1])
|
||||
} else if (e.data[0] == 'renderMem') {
|
||||
renderMem(e.data[1][0], e.data[1][1], e.data[1][2])
|
||||
renderMem(e.data[1][0], e.data[1][1], e.data[1][2], e.data[1][3], e.data[1][4])
|
||||
} else if (e.data[0] == 'updateProg') {
|
||||
updateProg(e.data[1])
|
||||
} else if (e.data[0] == 'updateMess') {
|
||||
|
|
|
@ -204,7 +204,7 @@ ipc.on('memory', function(event, arg) {
|
|||
var use = arg[0]
|
||||
var cpu = arg[1]
|
||||
var total = arg[2]
|
||||
postMessage(['renderMem', [use, cpu, total]], '*')
|
||||
postMessage(['renderMem', [use, cpu, total, arg[3], arg[4]]], '*')
|
||||
})
|
||||
//log
|
||||
ipc.on('logData', function(event, args) {
|
||||
|
|
|
@ -63,16 +63,21 @@ function tips(mode) {
|
|||
function startmem() {
|
||||
postMessage(['sendSinmpleIpc', 'startmem'], '*')
|
||||
}
|
||||
function renderMem(use, cpu, total) {
|
||||
function renderMem(use, cpu, total, core, uptime) {
|
||||
let day = Math.floor(uptime / 60 / 60 / 24)
|
||||
let hour = Math.floor(uptime / 60 /60 % 24)
|
||||
if(hour < 10) hour = '0' + hour
|
||||
let min = Math.floor(uptime / 60 % 60)
|
||||
if(min < 10) min = '0' + min
|
||||
let sec = Math.floor(uptime % 60)
|
||||
if(sec < 10) sec = '0' + sec
|
||||
let time = `${day ? day + ' days ' : ''}${hour ? hour + ':' : ''}${min}:${sec}`
|
||||
//Intel
|
||||
cpu = cpu.replace('Intel(R)', '').replace('(TM)', '').replace(' CPU', '')
|
||||
//AMD
|
||||
cpu = cpu.replace('AMD ', '').replace(/\s[0-9]{1,3}-Core\sProcessor/, '')
|
||||
$('#tips-text').html(
|
||||
escapeHTML(cpu) +
|
||||
'<br>Memory:' +
|
||||
Math.floor(use / 1024 / 1024 / 102.4) / 10 +
|
||||
'/' +
|
||||
Math.floor(total / 1024 / 1024 / 102.4) / 10 +
|
||||
'GB(' +
|
||||
Math.floor((use / total) * 100) +
|
||||
'%)'
|
||||
`${escapeHTML(cpu)} x ${core}<br />RAM: ${Math.floor(use / 1024 / 1024 / 102.4) / 10}/${Math.floor(total / 1024 / 1024 / 102.4) / 10}GB(${Math.floor((use / total) * 100)}%) UP:${time}`
|
||||
)
|
||||
}
|
||||
//トレンドタグ
|
||||
|
@ -196,12 +201,10 @@ function spotifytips() {
|
|||
<i class="material-icons pointer" onclick="nowplaying('spotify');show()" style="font-size:20px">send</i>
|
||||
</div>
|
||||
<div id="spot-cover">
|
||||
<img src="${img}" id="spot-img">
|
||||
<img src="${img}" id="spot-img" draggable="false">
|
||||
</div>
|
||||
<div id="spot-name">
|
||||
${escapeHTML(item.name)}
|
||||
</div>
|
||||
<div id="spot-artist">
|
||||
<span class="gray sml" id="spot-art">${artisttxt}</span>
|
||||
</div>
|
||||
<div id="spot-time">
|
||||
|
|
|
@ -188,8 +188,8 @@ function system(mainWindow, dir, lang, dirname) {
|
|||
})
|
||||
function mems() {
|
||||
var mem = os.totalmem() - os.freemem()
|
||||
if (mainWindow) {
|
||||
event.webContents.send('memory', [mem, os.cpus()[0].model, os.totalmem()])
|
||||
if (mainWindow && event.webContents) {
|
||||
event.webContents.send('memory', [mem, os.cpus()[0].model, os.totalmem(), os.cpus().length, os.uptime()])
|
||||
}
|
||||
}
|
||||
ipc.on('endmem', (e, arg) => {
|
||||
|
|
|
@ -1149,7 +1149,7 @@
|
|||
<a onclick="tipsToggle()" class="nex waves-effect">
|
||||
<i class="material-icons nex" title="@@changeTips@@" data-trans-title="tips">bubble_chart</i>
|
||||
</a>
|
||||
<div id="tips-text" style="width:23rem;"></div>
|
||||
<div id="tips-text" style="width:23rem;line-height: 1rem;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user