Parent: [1ca3b4] (diff)

Child: [ec34d8] (diff)

Download this file

editRule.html    159 lines (157 with data), 8.6 kB

  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
<!-- made by Miguel Rodrigues @ KBZ miguel.rodrigues@knowledgebiz.pt -->
<h1>Edit RuleID: {{rulesid}}</h1>
<br>
<div class="alert alert-danger" role="alert" ng-if="error">
<strong>{{error}}</strong>
</div>
<div class="row" ng-if="!data" ng-if="!error">
<div class="col-xs-12">
<div class="text-right">
<button type="button" class="btn btn-outline-primary" ng-click="redirectAppManager()">Application Manager for {{developerid}}</button>
<button type="button" class="btn btn-outline-primary" ng-click="redirectRuleManager()">Application Rules for {{appID}}</button>
</div>
</div>
</div>
<br>
<div class="alert alert-success" ng-if="data" ng-if="!error">
<strong>{{noData}}</strong>
</div>
<!-- APP RULES EDITION FORM -->
<div class="alert alert-warning" ng-if="!data" ng-if="!error">
<strong>Below the fields are the current values of the rule, if you want to keep please copy the values to the respective fields</strong>
</div>
<div class="container" ng-if="!data" ng-if="!error">
<form>
<div class="form-group row has-danger">
<label class="col-sm-2 col-form-label">Description</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="description" placeholder="Same Description">
<div ng-if="successDescription == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successDescription == 2"><font color="red">Fail! Wrong Input, cannot be null</font></div>
<small class="form-text text-muted">Actual Rule Description: {{rule.description}}</small>
</div>
</div>
<div class="form-group row has-danger">
<label class="col-sm-2 col-form-label">Parameter</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="parameter" placeholder="Which Parameter">
<div ng-if="successParameter == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successParameter == 2"><font color="red">Fail! Wrong Input, cannot be null</font></div>
<small class="form-text text-muted">Actual Rule Parameter: {{rule.parameter}}</small>
</div>
</div>
<div class="form-group row has-danger">
<label class="col-sm-2 col-form-label">Condition Value</label>
<div class="col-sm-5">
<select class="form-control form-control-danger" ng-model="conditionValue" ng-init="conditionValue='<'">
<option value="<">Less (<)</option>
<option value="<=">Less or Equal (<=)</option>
<option value=">">Bigger (>)</option>
<option value=">=">Bigger or Equal (>=)</option>
</select>
<small class="form-text text-muted">Actual Rule Condition Value: {{rule.conditionValue}}</small>
</div>
</div>
<div class="form-group row has-danger">
<label class="col-sm-2 col-form-label">Control Value</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="controlValue" placeholder="20">
<div ng-if="successControlValue == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successControlValue == 2"><font color="red">Fail! Wrong Input, only numbers</font></div>
<small class="form-text text-muted">Actual Rule Control Value: {{rule.controlValue}}</small>
</div>
</div>
<div class="form-group row has-danger">
<label class="col-sm-2 col-form-label">Threshold (Percentage Value)</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="threshold" placeholder="20">
<div ng-if="successThreshold == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successThreshold == 2"><font color="red">Fail! Wrong Input, only numbers</font></div>
<div ng-if="successThreshold == 3"><font color="red">Fail! Number have to be Lower then 100</font></div>
<div ng-if="successThreshold == 4"><font color="red">Fail! Number have to be Higher then 100</font></div>
<small class="form-text text-muted">Actual Rule Threshold: {{rule.thresold}}<br></small>
<!--<small class="form-text text-muted">For Condition Value: < or <= <br>Threshold Value Higher then 100% <br> For Condition Value > or >= <br>Threshold Value Lower then 100%</small> -->
</div>
</div>
<div class="form-group row has-danger">
<label class="col-sm-2 col-form-label">Notify Type</label>
<div class="col-sm-5">
<select class="form-control form-control-danger" ng-model="notifyType" ng-init="notifyType='Email'">
<option value="Email" selected>Email</option>
<option value="HTTP Request">HTTP Request</option>
</select>
<small class="form-text text-muted">Actual Rule Notify Type: {{rule.notifyType}}<br></small>
</div>
</div>
<div class="form-group row has-danger" ng-show="notifyType == 'Email'">
<label class="col-sm-2 col-form-label">Emails</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="emailsTo" placeholder="All Emails">
<div ng-if="successEmails == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successEmails == 2"><font color="red">Fail! Wrong Input</font></div>
<small class="form-text text-muted">Actual Rule Emails: {{rule.emailsTo}}<br></small>
</div>
</div>
<div class="form-group row has-danger" ng-show="notifyType == 'Email'">
<label class="col-sm-2 col-form-label">Notification Type</label>
<div class="col-sm-5">
<select class="form-control form-control-danger" ng-model="notificationType" ng-init="notificationType='1'">
<option value="1" selected>End of Month (1)</option>
<option value="2">End of Two Weeks (2)</option>
<option value="3">End of Week (3)</option>
<option value="4">End of Three Days (4)</option>
<option value="5">Urgent - Immediately (5)</option>
</select>
<small class="form-text text-muted">Actual Rule Notification Type: {{rule.notificationType}}<br></small>
</div>
</div>
<div class="form-group row has-danger" ng-show="notifyType == 'HTTP Request'">
<label class="col-sm-2 col-form-label">Hostname</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="hostname" placeholder="Which Hostname">
<div ng-if="successHostname == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successHostname == 2"><font color="red">Fail! Wrong Input</font></div>
<small class="form-text text-muted">Actual Rule Hostname: {{rule.hostname}}<br></small>
</div>
</div>
<div class="form-group row has-danger" ng-show="notifyType == 'HTTP Request'">
<label class="col-sm-2 col-form-label">Port</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="port" placeholder="Which Port">
<div ng-if="successPort == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successPort == 2"><font color="red">Fail! Wrong Input, only numbers</font></div>
<small class="form-text text-muted">Actual Rule Port: {{rule.port}}<br></small>
</div>
</div>
<div class="form-group row has-danger" ng-show="notifyType == 'HTTP Request'">
<label class="col-sm-2 col-form-label">Path</label>
<div class="col-sm-5">
<input type="text" class="form-control form-control-danger" ng-model="path" placeholder="Which Path">
<div ng-if="successPath == 1"><font color="green">Success! You've done it.</font></div>
<div ng-if="successPath == 2"><font color="red">Fail! Wrong Input</font></div>
<small class="form-text text-muted">Actual Rule Path: {{rule.path}}<br></small>
</div>
</div>
<div class="form-group row has-danger" ng-show="notifyType == 'HTTP Request'">
<label class="col-sm-2 col-form-label">Method</label>
<div class="col-sm-5">
<select class="form-control form-control-danger" ng-model="method" ng-init="method='POST'">
<option value="POST">POST</option>
<option value="GET">GET</option>
<option value="PUT">PUT</option>
<option value="DELETE">DELETE</option>
</select>
</div>
</div>
<center>
<button class="btn btn-primary" type="button" value="Send" ng-click="postdata(description, parameter, conditionValue, controlValue, threshold, notifyType, notificationType, hostname, port, path, method, emailsTo)" ng-if="!data" ng-if="!error">Edit Rule</button>
</center>
</form>
</div>
<br><br>
<div class="alert alert-success" ng-if="show">
<strong>Success!</strong> You have successfully created the Rule.
</div>
<div class="alert alert-danger" ng-if="showError">
<strong>Error!</strong> Error to creating a Rule.
</div>