Skip to content

Commit fead092

Browse files
committed
Hide / show allowed ips box on demenad
1 parent d0077b8 commit fead092

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

web/js/pages/edit_server.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ $('#backup_type').change(function (){
66
$('#backup_bucket').hide();
77
$('#backup_sftp').show();
88
}
9-
});
9+
});
10+
$('#api').change(function (){
11+
if(this.value == 'yes'){
12+
$('#security_ip').show();
13+
}else{
14+
$('#security_ip').hide();
15+
}
16+
});

web/templates/admin/edit_server.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@
955955
</table>
956956
</td>
957957
</tr>
958-
<tr>
958+
<tr>
959959
<td class="vst-text input-label step-top advanced-options">
960960
<a href="javascript:elementHideShow('security');" class="vst-text">
961961
<i class="fas fa-key"></i><b><?php print _('Security');?> <img src="/images/arrow.png"></b>
@@ -964,21 +964,24 @@
964964
</tr>
965965
<tr>
966966
<td class="vst-text input-label step-left">
967-
<table style="<?php if (empty($v_security_adv)) echo 'display:none';?> ;" id="security">
967+
<table style="<?php if (empty($v_security_adv)) echo 'display:none;';?>" id="security">
968968
<tr>
969969
<td class="vst-text input-label">
970970
<?php print _('Enable API access');?>
971971
</td>
972972
</tr>
973973
<tr>
974974
<td>
975-
<select class="vst-list" name="v_api">
975+
<select class="vst-list" name="v_api" id="api">
976976
<option value='yes'><?php print _('yes'); ?></option>
977977
<option value='no' <?php if($_SESSION['API'] == 'no') echo 'selected' ?> ><?php print _('no'); ?></option>
978978
</select>
979979
<br><br>
980980
</td>
981981
</tr>
982+
<tr>
983+
<td>
984+
<table id="security_ip" style="<?php if ($_SESSION['API'] == "no") echo 'display:none;';?>">
982985
<tr>
983986
<td class="vst-text input-label">
984987
<?php print _('Allowed IP Addresses for API');?> <span class="optional" style="float:right">1 IP address per line</span>
@@ -994,6 +997,8 @@
994997
<br><br>
995998
</td>
996999
</tr>
1000+
</table>
1001+
</td></tr>
9971002
<tr>
9981003
<td class="vst-text input-label">
9991004
<?php print _('Login screen style');?>

0 commit comments

Comments
 (0)