3
3
< head >
4
4
< title > {{.Title}}</ title >
5
5
< meta charset ="utf-8 ">
6
- <!-- <meta http-equiv="refresh" content="5"> -->
7
6
< meta name ="viewport " content ="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no ">
8
7
< link rel ="shortcut icon " type ="image/png " href ="https://kubernetes.io/images/favicon.png ">
9
- < link href ='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons ' rel ="stylesheet ">
10
- < link href ="https://unpkg.com/vuetify/dist/vuetify.min.css " rel ="stylesheet ">
8
+ < link href ="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900 " rel ="stylesheet ">
9
+ < link href ="https://fonts.googleapis.com/css?family=Material+Icons " rel ="stylesheet ">
10
+ < link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/vuetify.min.css "
rel ="
stylesheet "
>
11
11
< style >
12
12
[v-cloak ] {
13
13
display : none;
19
19
< v-app dark >
20
20
< v-content >
21
21
< section >
22
- < v-parallax src =" # " height =" 600 " :class ="info.color ">
22
+ < v-parallax id =" parallax-hero " src =" # " :class ="info.color ">
23
23
< v-layout
24
24
column
25
25
align-center
@@ -41,6 +41,14 @@ <h1 class="white--text mb-2 display-1 text-xs-center">${ info.message }</h1>
41
41
</ v-badge >
42
42
Ping
43
43
</ v-btn >
44
+
45
+ < template >
46
+ < v-timeline >
47
+ < v-timeline-item :color ="tlColor1 "> < h3 > ${ tlName1 }</ h3 > </ v-timeline-item >
48
+ < v-timeline-item :color ="tlColor2 "> < h3 slot ="opposite "> ${ tlName2 }</ h3 > </ v-timeline-item >
49
+ </ v-timeline >
50
+ </ template >
51
+
44
52
</ v-layout >
45
53
</ v-parallax >
46
54
</ section >
@@ -49,7 +57,7 @@ <h1 class="white--text mb-2 display-1 text-xs-center">${ info.message }</h1>
49
57
< v-flex xs12 >
50
58
< div class ="white--text ml-3 ">
51
59
Powered
52
- by < a class ="white--text " href ="https://github.com/stefanprodan/k8s- podinfo " target ="_blank "> podinfo</ a >
60
+ by < a class ="white--text " href ="https://github.com/stefanprodan/podinfo " target ="_blank "> podinfo</ a >
53
61
version ${ info.version } revision ${ info.revision }
54
62
</ div >
55
63
</ v-flex >
@@ -71,9 +79,17 @@ <h1 class="white--text mb-2 display-1 text-xs-center">${ info.message }</h1>
71
79
info : { } ,
72
80
timer : '' ,
73
81
color : '' ,
74
- pings : 0
82
+ pings : 0 ,
83
+ calls : 0 ,
84
+ tlName1 : '' ,
85
+ tlColor1 : 'grey' ,
86
+ tlName2 : '' ,
87
+ tlColor2 : 'grey' ,
75
88
}
76
89
} ,
90
+ mounted : function ( ) {
91
+ document . getElementById ( 'parallax-hero' ) . style . height = '100vh'
92
+ } ,
77
93
created : function ( ) {
78
94
this . getInfo ( ) ;
79
95
this . timer = setInterval ( this . getInfo , 3000 )
@@ -85,18 +101,31 @@ <h1 class="white--text mb-2 display-1 text-xs-center">${ info.message }</h1>
85
101
xhr . open ( 'GET' , "api/info" )
86
102
xhr . onload = function ( ) {
87
103
data = JSON . parse ( xhr . responseText )
88
- // reload page when the version changes
89
104
if ( self . info . version ) {
90
105
if ( self . info . version != data . version ) {
91
106
console . log ( "New version" , data . version )
92
- //window.location.reload()
93
107
}
94
108
}
95
109
self . info = data
96
110
self . info . color = parseInt ( data . version . split ( '.' ) . reverse ( ) [ 0 ] , 10 ) === 0
97
111
? 'blue'
98
112
: 'green'
99
113
document . title = data . hostname
114
+
115
+ if ( ( self . calls % 2 ) === 0 ) {
116
+ self . tlColor1 = parseInt ( data . version . split ( '.' ) . reverse ( ) [ 0 ] , 10 ) === 0
117
+ ? 'blue'
118
+ : 'green'
119
+ self . tlColor2 = 'grey'
120
+ self . tlName1 = data . version
121
+ } else {
122
+ self . tlColor1 = 'grey'
123
+ self . tlColor2 = parseInt ( data . version . split ( '.' ) . reverse ( ) [ 0 ] , 10 ) === 0
124
+ ? 'blue'
125
+ : 'green'
126
+ self . tlName2 = data . version
127
+ }
128
+ self . calls ++
100
129
}
101
130
xhr . onerror = function ( ) {
102
131
console . log ( xhr . responseText || 'Network request failed' )
0 commit comments