summaryrefslogtreecommitdiffstats
path: root/management-interface/views/satellites.htm
blob: 2d151f7665b72460cde54d8ce5d4ff6e265ec8d2 (plain) (blame)
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
<check if="{{ @loggedin }}">
  <true>
    <check if="{{ @action }}=='edit'">
      <div class="jumbotron">
        <h2>Edit</h2>
        <form name="edit" action="{{ @hostname }}do/savesatellite" method="post" role="form">
          <div class="form-group">
            <label for="organization">Organization*</label>
            <input type="text" class="form-control" name="organization" id="organization" value="{{ @editprefix["organization"] }}">
          </div>
          <div class="form-group">
            <label for="address">Address*</label>
            <input type="text" class="form-control" name="address"  id="address" value="{{ @editprefix["address"] }}">
          </div>
          <div class="form-group">
            <label for="name">Name*</label>
            <input type="text" class="form-control" name="name" id="name" value="{{ @editprefix["name"] }}">
          </div>
          <div class="form-group">
            <label for="prefix">Prefix*</label>
            <input type="text" class="form-control" name="prefix" id="prefix" value="{{ @editprefix["prefix"] }}" disabled>
  	    <span class="help-bock">If you use a prefix that is already in use, it will be overwritten</span>
          </div>
          <div class="form-group">
            <label for="prefix">Public key</label>
            <textarea class="form-control" name="publickey"  id="publickey">{{ @base64key }}</textarea>
          </div>
  	  <span class="help-block">Fields marked with * are mandatory</span>
	  <input type="hidden" name="prefix" value="{{ @editprefix["prefix"] }}">
	  <div class="form-group">
            <button type="submit" class="btn btn-primary">Submit</button>
	    <a class="btn btn-danger" role="button" href="{{ @hostname }}site/satellites?action=edit&prefix={{ @@editprefix["prefix"] }}">Reset</a>
	  </div>
        </form>
      </div>
    </check>
    <check if="{{ @action }}=='new'">
      <div class="jumbotron">
	<h2>New</h2>
	<form name="new" action="{{ @hostname }}do/newsatellite" method="post" role="form">
          <div class="form-group">
            <label for="organization">Organization*</label>
            <input type="text" class="form-control" name="organization" id="organization" value="{{ @new["organization"] }}">
          </div>
          <div class="form-group">
            <label for="address">Address*</label>
            <input type="text" class="form-control" name="address"  id="address" value="{{ @new["address"] }}">
          </div>
          <div class="form-group">
            <label for="name">Name*</label>
            <input type="text" class="form-control" name="name" id="name" value="{{ @new["name"] }}">
          </div>
          <div class="form-group">
            <label for="prefix">Prefix*</label>
            <input type="text" class="form-control" name="prefix" id="prefix" value="{{ @new["prefix"] }}">
            <span class="help-bock">If you use a prefix that is already in use, it will be overwritten</span>
          </div>
          <div class="form-group">
            <label for="prefix">Public key</label>
            <textarea class="form-control" name="publickey" id="publickey">{{ @new['publickey'] }}</textarea>
          </div>
          <span class="help-block">Fields marked with * are mandatory</span>
          <div class="form-group">
            <button type="submit" class="btn btn-primary">Submit</button>
            <button class="btn btn-danger" role="button" type="reset">Reset</button>
          </div>
	  <input type="hidden" name="action" value="new" />
	</form>
      </div>
    </check>
    <div class="jumbotron">
    <h2>List of all satellite public keys</h2>
    <form action="{{ @hostname }}site/satellites" method="get" class="form-inline" role="form">
      <table class="table table-striped table-responsive">
        <thead> 
          <tr>
	    <th>
	      <input name="checkall" type="checkbox"> 
	    </th> 
            <th>
				<a href="?order=organization&di=<check if='{{ @order }}=="organization" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Organization</a>
				<check if="{{ @order }}=='organization'">
					<check if="{{ @di }}=='ASC'"><true>&uarr;</true><false>&darr;</false></check>
				</check>
				</th>
            <th>
				<a href="?order=address&di=<check if='{{ @order }}=="address" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Address</a>
				<check if="{{ @order }}=='address'">
					<check if="{{ @di }}=='ASC'"><true>&uarr;</true><false>&darr;</false></check>
				</check>
			</th>
            <th>
				<a href="?order=name&di=<check if='{{ @order }}=="name" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Name</a>
				<check if="{{ @order }}=='name'">
					<check if="{{ @di }}=='ASC'"><true>&uarr;</true><false>&darr;</false></check>
				</check>
			</th>
            <th>
				<a href="?order=prefix&di=<check if='{{ @order }}=="prefix" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Prefix</a>
				<check if="{{ @order }}=='prefix'">
					<check if="{{ @di }}=='ASC'"><true>&uarr;</true><false>&darr;</false></check>
				</check>
			</th>
	    <th>Public key</th>
          </tr>   
	</thead>
        <tbody>
          <repeat group="{{ @result }}" value="{{ @item }}">
            <tr class="organization">
              <td>
                <input type="checkbox" name="prefix[]" value="{{ @item.prefix }}">
              </td>
              <td>{{ @item.organization }}</td>
              <td>{{ @item.address  }}</td>
              <td><a href="{{ @hostname }}site/satellites/?action=edit&prefix={{ @item.prefix }}">{{ @item.name  }}</a></td>
              <td>{{ @item.prefix}}</td>
              <td><check if="{{ @item.publickey}} == ''"><true>no</true><false>yes</false></check></td>
            </tr>
          </repeat>
        </tbody>
      </table>
      <div class="form-group">
	<label for="action">Action:</label>
        <select id="action" name="action" class="form-control"><option>delete</option></select>
      </div>
      <div class="form-group">
	<button class="btn btn-primary" type="submit">Go</button>
      </div>
    <div style="float:right">
      <a href="{{ @hostname }}site/satellites?action=new" class="btn btn-default" role="button">New</a>
    </div>
    </form>
  </true>
  <false>
    <p class="bg-danger">Please <a href="{{ $hostname }}site/login">login</a></p>
  </false>
</check>
</div>