-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.js
48 lines (41 loc) · 979 Bytes
/
model.js
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
/********************************************************************
* The model.
*******************************************************************/
var JenkinsState = {
OK: 1,
FAIL: 2,
OK_AND_BUILD: 3,
FAIL_AND_BUILD: 4
};
var LampState = {
ON: 1,
OFF: 2,
BLINK: 3
};
var JobState = {
COLOR: 'color',
CONDITION: 'condition'
};
function Job() {
this.type = 'color';
this.path = null;
this.ignore = [];
this.colorJsonPath = '';
}
function LampData() {
var id, type, name, path, ignore, colorJsonPath,
red, orange, green;
this.id = '?';
this.name = 'undefined';
this.enabled = true;
this.job = null;
this.red = LampState.OFF;
this.orange = LampState.OFF;
this.green = LampState.OFF;
}
// export the class
module.exports.JenkinsState = JenkinsState;
module.exports.LampState = LampState;
module.exports.LampData = LampData;
module.exports.JobState = JobState;
module.exports.Job = Job;