Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
ba9db27b
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ba9db27b
编写于
9月 11, 2016
作者:
N
Nicolas Hennion
提交者:
GitHub
9月 11, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #914 from nclsHart/webui-ongoing-alert-counter
[Web UI] display ongoing alert counter in favicon
上级
b9881f12
82b05c35
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
45 addition
and
16 deletion
+45
-16
glances/outputs/static/bower.json
glances/outputs/static/bower.json
+2
-1
glances/outputs/static/js/services/core/favicon.js
glances/outputs/static/js/services/core/favicon.js
+14
-0
glances/outputs/static/js/services/core/glances_stats.js
glances/outputs/static/js/services/core/glances_stats.js
+1
-1
glances/outputs/static/js/services/plugins/glances_alert.js
glances/outputs/static/js/services/plugins/glances_alert.js
+9
-1
glances/outputs/static/js/stats_controller.js
glances/outputs/static/js/stats_controller.js
+10
-4
glances/outputs/static/public/js/main.js
glances/outputs/static/public/js/main.js
+1
-1
glances/outputs/static/public/js/vendor.js
glances/outputs/static/public/js/vendor.js
+8
-8
未找到文件。
glances/outputs/static/bower.json
浏览文件 @
ba9db27b
...
...
@@ -4,6 +4,7 @@
"dependencies"
:
{
"angular"
:
"^1.5.8"
,
"angular-route"
:
"^1.5.8"
,
"lodash"
:
"^4.13.1"
"lodash"
:
"^4.13.1"
,
"favico.js"
:
"^0.3.10"
}
}
glances/outputs/static/js/services/core/favicon.js
0 → 100644
浏览文件 @
ba9db27b
glancesApp
.
service
(
'
favicoService
'
,
function
()
{
var
favico
=
new
Favico
({
animation
:
'
none
'
});
this
.
badge
=
function
(
nb
)
{
favico
.
badge
(
nb
);
};
this
.
reset
=
function
()
{
favico
.
reset
();
};
});
glances/outputs/static/js/services/core/glances_stats.js
浏览文件 @
ba9db27b
...
...
@@ -5,7 +5,7 @@ glancesApp.service('GlancesStats', function($http, $injector, $q, GlancesPlugin)
'
alert
'
:
'
GlancesPluginAlert
'
,
'
cpu
'
:
'
GlancesPluginCpu
'
,
'
diskio
'
:
'
GlancesPluginDiskio
'
,
'
irq
'
:
'
GlancesPluginIrq
'
,
'
irq
'
:
'
GlancesPluginIrq
'
,
'
docker
'
:
'
GlancesPluginDocker
'
,
'
ip
'
:
'
GlancesPluginIp
'
,
'
fs
'
:
'
GlancesPluginFs
'
,
...
...
glances/outputs/static/js/services/plugins/glances_alert.js
浏览文件 @
ba9db27b
...
...
@@ -29,7 +29,7 @@ glancesApp.service('GlancesPluginAlert', function () {
,
minutes
=
parseInt
((
duration
/
(
1000
*
60
))
%
60
)
,
hours
=
parseInt
((
duration
/
(
1000
*
60
*
60
))
%
24
);
alert
.
duration
=
_
.
pad
Left
(
hours
,
2
,
'
0
'
)
+
"
:
"
+
_
.
padLeft
(
minutes
,
2
,
'
0
'
)
+
"
:
"
+
_
.
padLef
t
(
seconds
,
2
,
'
0
'
);
alert
.
duration
=
_
.
pad
Start
(
hours
,
2
,
'
0
'
)
+
"
:
"
+
_
.
padStart
(
minutes
,
2
,
'
0
'
)
+
"
:
"
+
_
.
padStar
t
(
seconds
,
2
,
'
0
'
);
}
_alerts
.
push
(
alert
);
...
...
@@ -47,4 +47,12 @@ glancesApp.service('GlancesPluginAlert', function () {
this
.
count
=
function
()
{
return
_alerts
.
length
;
};
this
.
hasOngoingAlerts
=
function
()
{
return
_
.
filter
(
_alerts
,
{
'
ongoing
'
:
true
}).
length
>
0
;
};
this
.
countOngoingAlerts
=
function
()
{
return
_
.
filter
(
_alerts
,
{
'
ongoing
'
:
true
}).
length
;
}
});
glances/outputs/static/js/stats_controller.js
浏览文件 @
ba9db27b
glancesApp
.
controller
(
'
statsController
'
,
function
(
$scope
,
$rootScope
,
$interval
,
GlancesStats
,
help
,
arguments
)
{
glancesApp
.
controller
(
'
statsController
'
,
function
(
$scope
,
$rootScope
,
$interval
,
GlancesStats
,
help
,
arguments
,
favicoService
)
{
$scope
.
help
=
help
;
$scope
.
arguments
=
arguments
;
...
...
@@ -24,7 +24,7 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
$scope
.
statsAlert
=
GlancesStats
.
getPlugin
(
'
alert
'
);
$scope
.
statsCpu
=
GlancesStats
.
getPlugin
(
'
cpu
'
);
$scope
.
statsDiskio
=
GlancesStats
.
getPlugin
(
'
diskio
'
);
$scope
.
statsIrq
=
GlancesStats
.
getPlugin
(
'
irq
'
);
$scope
.
statsIrq
=
GlancesStats
.
getPlugin
(
'
irq
'
);
$scope
.
statsDocker
=
GlancesStats
.
getPlugin
(
'
docker
'
);
$scope
.
statsFs
=
GlancesStats
.
getPlugin
(
'
fs
'
);
$scope
.
statsFolders
=
GlancesStats
.
getPlugin
(
'
folders
'
);
...
...
@@ -46,6 +46,12 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
$rootScope
.
title
=
$scope
.
statsSystem
.
hostname
+
'
- Glances
'
;
if
(
$scope
.
statsAlert
.
hasOngoingAlerts
())
{
favicoService
.
badge
(
$scope
.
statsAlert
.
countOngoingAlerts
());
}
else
{
favicoService
.
reset
();
}
$scope
.
is_disconnected
=
false
;
$scope
.
dataLoaded
=
true
;
},
function
()
{
...
...
@@ -104,8 +110,8 @@ glancesApp.controller('statsController', function ($scope, $rootScope, $interval
// d => Show/hide disk I/O stats
$scope
.
arguments
.
disable_diskio
=
!
$scope
.
arguments
.
disable_diskio
;
break
;
case
$event
.
shiftKey
&&
$event
.
keyCode
==
keycodes
.
Q
:
//
R
=> Show/hide IRQ
case
$event
.
shiftKey
&&
$event
.
keyCode
==
keycodes
.
Q
:
//
Q
=> Show/hide IRQ
$scope
.
arguments
.
disable_irq
=
!
$scope
.
arguments
.
disable_irq
;
break
;
case
!
$event
.
shiftKey
&&
$event
.
keyCode
==
keycodes
.
f
:
...
...
glances/outputs/static/public/js/main.js
浏览文件 @
ba9db27b
此差异已折叠。
点击以展开。
glances/outputs/static/public/js/vendor.js
浏览文件 @
ba9db27b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录