Skip to content

Commit

Permalink
Added device field
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Aug 7, 2023
1 parent d7f1dc6 commit 44e9637
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

description 'Jefferson Lab Alarm Warning System (JAWS) web admin interface'
group 'org.jlab'
version '4.2.0'
version '4.3.0'

// IndexDB Client-side cache data version
ext.cacheVersion = '1'
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jlab/jaws/json/AlarmInstanceMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ interface AlarmInstanceMixin {
@JsonProperty
Object getSource();

@JsonProperty
String getDevice();

@JsonProperty
List<String> getLocation();

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/jlab/jaws/model/JAWSModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ public JAWSModel() {
valueFields.add(new FieldDefinition("contact", FieldType.STRING));
classModel.setValueFields(valueFields);

instanceModel.setTableColumns(Arrays.asList(new String[]{"name", "class", "location", "epicspv"}));
instanceModel.setTableColumns(Arrays.asList(new String[]{"name", "class", "device", "location", "epicspv"}));
keyFields = new ArrayList<>();
keyFields.add(new FieldDefinition("name", FieldType.STRING));
instanceModel.setKeyFields(keyFields);
valueFields = new ArrayList<>();
valueFields.add(new FieldDefinition("class", FieldType.STRING));
valueFields.add(new FieldDefinition("device", FieldType.STRING));
valueFields.add(new FieldDefinition("location", FieldType.MULTI_ENUM));
valueFields.add(new FieldDefinition("epicspv", FieldType.STRING));
valueFields.add(new FieldDefinition("maskedby", FieldType.STRING));
Expand Down Expand Up @@ -109,7 +110,7 @@ public JAWSModel() {
valueFields.addAll(activationModel.getValueFields());
notificationModel.setValueFields(valueFields);

registrationModel.setTableColumns(Arrays.asList(new String[]{"name", "category", "class", "location", "priority", "contact", "epicspv"}));
registrationModel.setTableColumns(Arrays.asList(new String[]{"name", "category", "class", "device", "location", "priority", "contact", "epicspv"}));
keyFields = new ArrayList<>();
keyFields.add(new FieldDefinition("name", FieldType.STRING));
registrationModel.setKeyFields(keyFields);
Expand Down
9 changes: 6 additions & 3 deletions src/main/webapp/resources/modules/jaws-admin-gui/entities.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ class AlarmClass {
}

class AlarmInstance {
constructor(name, alarmclass, location, maskedby, screencommand, epicspv) {
constructor(name, alarmclass, device, location, maskedby, screencommand, epicspv) {
this.name = name;
this.class = alarmclass;
this.device = device;
this.location = location;
this.maskedby = maskedby;
this.screencommand = screencommand;
Expand Down Expand Up @@ -62,7 +63,7 @@ class AlarmOverride {

class EffectiveAlarm {
constructor(name, priority, category, rationale, action, contact, filterable, latchable,
ondelay, offdelay, alarmclass, location, maskedby, screencommand, epicspv, state) {
ondelay, offdelay, alarmclass, device, location, maskedby, screencommand, epicspv, state) {
this.name = name;

this.priority = priority;
Expand All @@ -76,6 +77,7 @@ class EffectiveAlarm {
this.offdelay = offdelay;

this.class = alarmclass;
this.device = device;
this.location = location;
this.maskedby = maskedby;
this.screencommand = screencommand;
Expand Down Expand Up @@ -108,10 +110,11 @@ class EffectiveNotification {
}

class EffectiveRegistration {
constructor(name, alarmclass, priority, location, category, rationale, action, contact,
constructor(name, alarmclass, device, priority, location, category, rationale, action, contact,
filterable, latchable, ondelay, offdelay, maskedby, screencommand, epicspv) {
this.name = name;
this.class = alarmclass;
this.device = device;
this.priority = priority;
this.location = location;
this.category = category;
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ let toAlarm = function(key, value) {
value.registration.ondelay,
value.registration.offdelay,
value.registration.class,
value.registration.device,
value.registration.location,
value.registration.maskedby,
value.registration.screencommand,
Expand Down Expand Up @@ -156,6 +157,7 @@ let toInstance = function(key, value) {
return new AlarmInstance(
key,
value.alarmclass,
value.device,
value.location,
value.maskedby,
value.screencommand,
Expand Down Expand Up @@ -210,6 +212,7 @@ let toRegistration = function(key, value) {
return new EffectiveRegistration(
key,
value.alarmclass,
value.device,
value.priority,
value.location,
value.category,
Expand Down

0 comments on commit 44e9637

Please sign in to comment.