Initialize the UI code
[holmes/rule-management.git] / rulemgt / src / main / frontend / src / alarm / app / correlation-ruleInfo / ruleInfo.component.html
1 <!--
2  Copyright 2017 ZTE Corporation.
3
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7
8      http://www.apache.org/licenses/LICENSE-2.0
9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 -->
16 <div class="container" style="margin-top: 20px">
17     <form #ruleForm="ngForm" class="form-group row" (submit)="onSubmit(ruleName)">
18         <div class="form-body">
19
20             <div class="row form-group col-xs-12 ">
21                 <label for="userName" class="col-xs-2 col-form-label labelstyle">
22                         <span>{{"field_rule_name_Add_Page"|translate}}</span>
23                         <span style="color: red">*</span>
24                     </label>
25                 <div class="col-xs-6" style="margin-left: -100px">
26                     <input class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required" style="width: 60%" type="text" name="rulename"
27                         [(ngModel)]="queryRule.rulename" id="ruleNameInput" readonly="{{addBottonStatus}}" #ruleName="ngModel"
28                         required>
29                 </div>
30             </div>
31
32             <div class="row form-group col-xs-12">
33                 <label for="userName" class="col-xs-2 col-form-label labelstyle">
34                         <span>{{"field_description"|translate}}</span>
35                     </label>
36                 <div class="col-xs-6" style="margin-left: -100px">
37                     <input class="form-control ng-untouched ng-pristine ng-valid" readonly="{{addBottonStatus}}" style="width: 60%" type="text"
38                         [(ngModel)]="queryRule.description" name="description">
39                 </div>
40             </div>
41
42             <div id="state" class="row form-group col-xs-12">
43                 <label class="col-xs-2 col-form-label labelstyle">
44                          <span>{{"common_status"|translate}}</span>
45                      </label>
46
47                 <div class="col-xs-6" style="margin-left: -113px">
48                     <div *ngIf="queryRule.enabled == 0">
49                         <div class="col-xs-3" >
50                             <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='0'>
51                             <label for="radio1" >{{"common_off"|translate}}</label>
52                         </div>
53                         <div class="col-xs-3" >
54                             <input class="magic-radio" type="radio" name="radio"  [(ngModel)]="queryRule.enabled" value='1'>
55                             <label for="radio1" (click)="switch()">{{"common_on"|translate}}</label>
56                         </div>
57                     </div>
58                     <div *ngIf="queryRule.enabled == 1">
59                         <div class="col-xs-3" >
60                             <input class="magic-radio" type="radio" name="radio" [(ngModel)]="queryRule.enabled" value='0'>
61                             <label for="radio1" (click)="switch()">{{"common_off"|translate}}</label>
62                         </div>
63                         <div class="col-xs-3" >
64                             <input class="magic-radio" type="radio" name="radio"  [(ngModel)]="queryRule.enabled" value='1'>
65                             <label for="radio1" >{{"common_on"|translate}}</label>
66                         </div>
67                     </div>
68                     
69                     
70
71                 </div>
72
73             </div>
74
75             <div class="row form-group col-xs-12">
76                 <label for="" class="col-xs-2 col-form-label labelstyle">
77                         <span>{{"common_file"|translate}}</span>
78                     </label>
79                 <div class="col-xs-6" style="margin-left: -100px">
80                     <div class="btn-group btn-group-circle">
81                         <span class="importDivArea mmlBatchBtnBar">
82                             <button class="btn btn-info" id="importBtn" disabled="{{addBottonStatus}}">
83                                 <span class="ict-import"></span>
84                         <span>{{"import"|translate}}</span>
85                         </button>
86                         <div id="importDiv" class="container upload">
87                             <form id="fileupload" #fileForm="ngForm" role="form" enctype="multipart/form-data">
88                                 <div class="file-preview">
89                                     <div id="dropzone" class="file-drop-zone">
90                                         <div class="file-drop-zone-title">
91                                             <span>{{"file_import"|translate}}</span>
92                                         </div>
93                                     </div>
94                                 </div>
95
96                                 <div class="input-group fileupload-btn">
97                                     <div id="fileName" class="form-control file-caption">task2.zip</div>
98                                     <span class="input-group-btn" id="btnGroup">
99                                             <span class="btn btn-primary fileinput-button white radius_s blue1-active" id="browse" data-placement="bottom" data-toggle="tooltip">
100                                                 <span class="importBtnFontSize">{{"common_browse"|translate}}</span>
101                                     <input type="file" name="file" title=" " accept=".txt" multiple="">
102                                     </span>
103                                     <button id="fileremove" class="btn btn-default" type="button">
104                                                 <span class="importBtnFontSize">{{"common_remove"|translate}}</span>
105                                             </button>
106                                     <button id="filesubmit" class="btn btn-default" type="button">{{"common_confirm"|translate}}</button>
107                                     </span>
108                                 </div>
109
110                             </form>
111                         </div>
112                         </span>
113                     </div>
114                 </div>
115             </div>
116
117             <div class="row form-group col-xs-12">
118                 <label for="" class="col-xs-2 col-form-label labelstyle">
119                         <span>{{"message_rule_content"|translate}}</span>
120                         <span style="color: red">*</span>
121                     </label>
122                 <div class="col-xs-8" style="margin-left: -100px">
123                     <div class="form-group">
124                         <textarea id="cmds" class="form-control" readonly="{{addBottonStatus}}" [(ngModel)]="queryRule.content" name="content" rows="12"
125                             cols="80" required placeholder="package example">
126                          </textarea>
127
128                     </div>
129                 </div>
130             </div>
131
132             <div class="row form-group col-xs-12 " style="margin-left: 73px">
133                 <div class="col-xs-8 ">
134                     <label class="myclass" id="checkLabel">
135                         <button type="button" (click)="checkContent('check')" disabled="{{addBottonStatus}}" class="btn btn-info">{{"common_check"|translate}}</button>
136                     </label>
137                     <label class="myclass" id="updateLabel">
138                         <button type="button"  disabled="{{addBottonStatus}}" class="btn btn-info" (click)="update()">{{"common_update"|translate}}</button>
139                     </label>
140                     <label class="myclass" id="saveLabel">
141                         <button type="submit"  disabled="{{addBottonStatus}}" class="btn btn-info">{{"common_save"|translate}}</button>
142                     </label>
143                     <label class="myclass" id="cancelLabel">
144                         <button type="button" routerLink='/alarmRule' class="btn btn-info">{{"common_cancel"|translate}}</button>
145                     </label>
146                 </div>
147             </div>
148         </div>
149     </form>
150 </div>