summaryrefslogtreecommitdiffstats
path: root/modules-available/baseconfig/templates/_page.html
blob: 273ee50c9c422469da65c6bdffb0808d702c9adb (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<h1>{{lang_basicConfiguration}}</h1>
<p>{{lang_clientRelatedConfig}}</p>
<form action="?do=BaseConfig" method="post">
	<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
		<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;">
		<input type="password" name="password_fake" id="password_fake" value="" style="display:none;">
		{{#categories}}
		<div class="panel panel-default">
			<div class="panel-heading" role="tab" id="heading{{category_id}}">
				<a data-toggle="collapse" data-parent="#accordion" href="#collapse{{category_id}}" aria-expanded="false" aria-controls="collapse{{category_id}}">
					{{category_name}}
				</a>
			</div>
			<div id="collapse{{category_id}}" class="accordion-body collapse" role="tabpanel" aria-labelledby="heading{{category_id}}">
				<div class="panel-body">
					<div class="list-group">
						{{#settings}}
						<div class="list-group-item {{class}}">
							<div class="row">
								<div class="col-md-1" style="width:118px;">
									<input type="checkbox" name="switch[{{setting}}]" {{checked}}> 
								</div>
								<div class="col-md-4">
									{{setting}}
									<div class="slx-default">{{defaultvalue}}</div>
								</div>
								<div class="col-md-4">
									{{{item}}}
								</div>
								<div class="col-md-2">
									<a class="btn btn-default" data-toggle="modal" data-target="#help-{{setting}}"><span class="glyphicon glyphicon-question-sign"></span></a>
								</div>
							</div>
						</div>
						<div class="modal fade" id="help-{{setting}}" tabindex="-1" role="dialog">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">{{setting}}</div>
									<div class="modal-body">{{{description}}}</div>
									<div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div>
								</div>
							</div>
						</div>
						{{/settings}}
					</div>
					<div id="cat-extra-{{category_id}}">

					</div>
				</div>
			</div>
		</div>
		{{/categories}}



		<!-- User Managment Section -->
		<div class="panel panel-default">
			<div class="panel-heading" role="tab" id="headingUsers">
				<a data-toggle="collapse" data-parent="#accordion" href="#collapseUsers" aria-expanded="false" aria-controls="collapseUsers">
					{{lang_catUser}}
				</a>
				<span style="display:inline-block; float: right; margin-top: -7px;">
					<a class="btn btn-default " data-toggle="modal" data-target="#add-user">
						<span class="glyphicon glyphicon-plus"></span>
					</a>
				</span>
			</div>
			<div id="collapseUsers" class="accordion-body collapse" role="tabpanel" aria-labelledby="headingUsers">
				<div class="panel-body">
					<div class="list-group">
						{{#users}}
						<div class="list-group-item">
							<div class="row">
								<div class="col-md-5">
									<input name="user-{{id}}-name" type="text" class="form-control" size="30" value="{{name}}" />
								</div>
								<div class="col-md-5">
									<input name="user-{{id}}-password" type="text" class="form-control" size="30" placeholder="{{lang_userPasswd}}" />
								</div>
								<div class="col-md-2">
									<a class="btn btn-danger" href="?do=BaseConfig&deleteUser={{id}}&token={{token}}" ><span class="glyphicon glyphicon-trash"></span> {{lang_delete}}</a>
								</div>
							</div>
						</div>
						{{/users}}
					</div>
				</div>
			</div>
		</div>
	</div>
	<input type="hidden" name="token" value="{{token}}">
	<button class="btn btn-lg btn-primary" type="submit">{{lang_save}}</button>
	<button class="btn btn-lg btn-primary" type="reset">{{lang_reset}}</button>
	<a class="btn btn-lg btn-primary" href="api.php?do=getconfig">Download</a>
</form>
<p>
	<form method="post" action="?do=BaseConfig">
		<input type="hidden" name="token" value="{{token}}">
		<input type="hidden" name="action" value="reset">
		<button class="btn btn-default" type="submit" onclick="return confirm('{{lang_resetConfirm}}');">{{lang_resetDefault}}</button>
	</form>
</p>
<!-- Create User Window -->
<form action="?do=BaseConfig" method="post">
	<div class="modal fade" id="add-user" tabindex="-1" role="dialog">
		<div class="modal-dialog">

			<div class="modal-content">
				<div class="modal-header">{{lang_newUser}}</div>
				<div class="modal-body">

					<p>
						<input name="new-user-name" placeholder="{{lang_userName}}" class="form-control" type="text">
					</p>
					<p>
						<input name="new-user-passwd" placeholder="{{lang_userPasswd}}" class="form-control" type="password">
					</p>
					<input type="submit" class="btn btn-primary" value="{{lang_create}}">
				</div>
				<div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div>
			</div>
		</div>
	</div>
	<input type="hidden" name="action" value="new_user">
	<input type="hidden" name="token" value="{{token}}">
</form>
<!-- Create Partition Window -->
<form action="?do=BaseConfig" method="post">
	<div class="modal fade" id="add-partition" tabindex="-1" role="dialog">
		<div class="modal-dialog">

			<div class="modal-content">
				<div class="modal-header">{{lang_newPartition}}</div>
				<div class="modal-body">

					<div class="input-group">
						<span class="input-group-addon">{{lang_partitionId}}</span>
						<input name="new-partition-id" class="form-control" type="text">
					</div>
					<p class="help-block">{{lang_helpId}}</p>
					<div class="input-group">
						<span class="input-group-addon">{{lang_partitionSize}}</span>
						<input name="new-partition-size" class="form-control" type="text">
					</div>
					<p class="help-block">{{lang_helpSize}}</p>
					<div class="input-group">
						<span class="input-group-addon">{{lang_partitionMountPoint}}</span>
						<input name="new-partition-mount-point" class="form-control" type="text">
					</div>
					<p class="help-block">{{lang_helpMountPoint}}</p>
					<div class="input-group">
						<span class="input-group-addon">{{lang_partitionOptions}}</span>
						<input name="new-partition-options" class="form-control" type="text">
					</div>
					<p class="help-block">{{lang_helpOptions}}</p>
					<input type="submit" class="btn btn-primary" value="{{lang_create}}">
				</div>
				<div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div>
			</div>
		</div>
	</div>
	<input type="hidden" name="action" value="new_partition">
	<input type="hidden" name="token" value="{{token}}">
</form>
<script type="text/javascript">

function saveConfig(){
	if(confirm('{{lang_confirm}}'))
		window.location = 'api.php?do=getconfig&user={{user}}&save=true';
	else
		window.location = 'api.php?do=getconfig&user={{user}}';
}

document.addEventListener("DOMContentLoaded", function() {
	document.getElementById("cat-extra-6").innerHTML = "<div class='list-group'> <div class='list-group-item' style='background-color:#f5f5f5;color:#428bca;'> " +
	"{{lang_catPartition}} <span style='display:inline-block; float: right; margin-top: -7px;'> <a class='btn btn-default ' data-toggle='modal' " +
	"data-target='#add-partition'> <span class='glyphicon glyphicon-plus'></span> </a> </span> </div> {{#partitions}} <div class='list-group-item'> " +
	"<div class='row'> <div class='col-md-1'> <input name='partition-{{id}}-partition_id' type='text' class='form-control' size='30' value='{{partition_id}}'" +
	" placeholder='{{lang_partitionId}}' /> </div> <div class='col-md-1'> <input name='partition-{{id}}-size' type='text' class='form-control' size='30' " +
	"value='{{size}}' placeholder='{{lang_partitionSize}}'/> </div> <div class='col-md-4'> <input name='partition-{{id}}-mount_point' type='text' " +
	"class='form-control' size='30' value='{{mount_point}}' placeholder='{{lang_partitionMountPoint}}'/> </div> <div class='col-md-4'> <input " +
	"name='partition-{{id}}-options' type='text' class='form-control' size='30' value='{{options}}' placeholder='{{lang_partitionOptions}}'/> </div> " +
	"<div class='col-md-2'> <a class='btn btn-danger' href='?do=BaseConfig&deletePartition={{id}}&token={{token}}' ><span class='glyphicon glyphicon-trash'>" +
	"</span> {{lang_delete}}</a> </div> </div> </div> {{/partitions}} </div> </div>";
	$("[name^='switch']").bootstrapSwitch();
}

</script>