forked from FoundKeyGang/FoundKey
[Cliewnt] Display drive usagae in drive window
This commit is contained in:
parent
a529b51c2d
commit
73b2c533ec
1 changed files with 21 additions and 3 deletions
|
@ -1,12 +1,24 @@
|
||||||
<mk-drive-browser-window>
|
<mk-drive-browser-window>
|
||||||
<mk-window ref="window" is-modal={ false } width={ '800px' } height={ '500px' }><yield to="header"><i class="fa fa-cloud"></i>ドライブ</yield>
|
<mk-window ref="window" is-modal={ false } width={ '800px' } height={ '500px' }>
|
||||||
<yield to="content">
|
<yield to="header">
|
||||||
<mk-drive-browser multiple={ true } folder={ parent.folder }></mk-drive-browser></yield>
|
<p class="info" if={ parent.usage }><b>{ parent.usage.toFixed(1) }%</b>使用中</p>
|
||||||
|
<i class="fa fa-cloud"></i>ドライブ
|
||||||
|
</yield>
|
||||||
|
<yield to="content">
|
||||||
|
<mk-drive-browser multiple={ true } folder={ parent.folder }></mk-drive-browser>
|
||||||
|
</yield>
|
||||||
</mk-window>
|
</mk-window>
|
||||||
<style type="stylus">
|
<style type="stylus">
|
||||||
:scope
|
:scope
|
||||||
> mk-window
|
> mk-window
|
||||||
[data-yield='header']
|
[data-yield='header']
|
||||||
|
> .info
|
||||||
|
position absolute
|
||||||
|
top 0
|
||||||
|
left 16px
|
||||||
|
margin 0
|
||||||
|
font-size 80%
|
||||||
|
|
||||||
> i
|
> i
|
||||||
margin-right 4px
|
margin-right 4px
|
||||||
|
|
||||||
|
@ -16,12 +28,18 @@
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
|
@mixin \api
|
||||||
|
|
||||||
@folder = if @opts.folder? then @opts.folder else null
|
@folder = if @opts.folder? then @opts.folder else null
|
||||||
|
|
||||||
@on \mount ~>
|
@on \mount ~>
|
||||||
@refs.window.on \closed ~>
|
@refs.window.on \closed ~>
|
||||||
@unmount!
|
@unmount!
|
||||||
|
|
||||||
|
@api \drive .then (info) ~>
|
||||||
|
@update do
|
||||||
|
usage: info.usage / info.capacity * 100
|
||||||
|
|
||||||
@close = ~>
|
@close = ~>
|
||||||
@refs.window.close!
|
@refs.window.close!
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue