-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunlist.html
171 lines (160 loc) · 4.07 KB
/
runlist.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Vue Starter</title>
</head>
<body >
<div id="app">
<h2>Feb 2022 H445-2 </h2>
<div>{{timestamp}}</div>
<table>
<tbody>
<tr>
<th>timestamp</th>
<th>run</th>
<th>start</th>
<th>stop</th>
<th>duration</th>
<th>header</th>
<th>ender</th>
<th>num of events</th>
</tr>
<tr v-for="(item) in runlist">
<td>{{item.ts}}</td>
<td>{{item.runinfo.runname}}{{item.runinfo.runnumber}}</td>
<td>{{item.runinfo.startdate}}</td>
<td>{{item.runinfo.stopdate}}</td>
<td>{{duration(item.runinfo.startdate,item.runinfo.stopdate)}}</td>
<td>{{item.runinfo.header}}</td>
<td>{{item.runinfo.ender}}</td>
<td>{{item.eventbuiltnumber}}</td>
</tr>
</tbody>
</table>
<!-- scaler data -->
</div>
<!-- vue.js を読み込んでからVueオブジェクトを記載していく -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
// Vue オブジェクト
var app = new Vue({
el: '#app',
data() {
return {
// object 形式でプロパティを記述していく
runlist: [],
timestamp: "",
run_items: {
}
};
},
// 算出プロパティ(キャッシュされる)
computed: {
},
// 監視プロパティ
watch: {
},
// 関数(キャッシュされない、都度評価される)
methods: {
duration : function (sta,sto) {
if (sto === undefined) return NaN;
var date1 = new Date(sta);
var date2 = new Date(sto);
return (date2.getTime() - date1.getTime()) / 1000.;
},
},
// ライフサイクルフック ---------------------------------------------------
// https://jp.vuejs.org/v2/api/#beforeUpdate
beforeCreate() {
},
created() {
},
mounted() {
setInterval( function () {
now = new Date();
app.timestamp = now.getFullYear()
+ "/" + ("00" + (now.getMonth() + 1)).slice(-2)
+ "/" + ("00" + now.getDate()).slice(-2)
+ " " + ("00" + now.getHours()).slice(-2)
+ ":" + ("00" + now.getMinutes()).slice(-2)
+ ":" + ("00" + now.getSeconds()).slice(-2);
}, 1000);
setInterval (function () {
axios.get('/runlist/runlist.json')
.then(response => {
app.runlist = response.data;
});
} ,1000);
},
beforeUpdate() {
},
updated() {
},
activated() {
},
deactivated() {
},
beforeDestroy() {
},
destroyed() {
}
// ライフサイクルフック ---------------------------------------------------
});
</script>
<style module>
table {
border-collapse: collapse;
}
td {
padding: 2px;
margin: 1px;
border: solid 1px #aaaaaa;
}
.changed {
background-color: #ffff00;
}
.warning {
background-color: #aa0000;
color: white;
text-align: center
}
.normal {
background-color: #8888bb;
color: white;
text-align: center;
}
.notify {
background-color: #bbbb33;
color: black;;
text-align: center
}
.digit-view {
width: 100px;
text-align: right;
padding: 5px;
font-size: 11pt;
}
.digit-input {
width: 90%;
padding: 5px 5px;
border-radius: 3px;
border: 2px solid #ddd;
box-sizing: border-box;
}
.text-input {
width: 100%;
padding: 5px 5px;
border-radius: 3px;
border: 2px solid #ddd;
box-sizing: border-box;
}
.headding-view {
width: 50px;
text-align: center;
font-weight: bold;;
}
</style>
</body>
</html>