diff options
author | Jannik Schönartz | 2017-02-27 07:53:38 +0100 |
---|---|---|
committer | Jannik Schönartz | 2017-02-27 07:53:38 +0100 |
commit | 52406c0dd2017baed38df39a0574f1e8bbd549b8 (patch) | |
tree | 2335acef3bfb593d43e8eac28c5700b8c02646ed /modules-available/locationinfo/templates/credentials.html | |
parent | Bugfixes (diff) | |
download | slx-admin-52406c0dd2017baed38df39a0574f1e8bbd549b8.tar.gz slx-admin-52406c0dd2017baed38df39a0574f1e8bbd549b8.tar.xz slx-admin-52406c0dd2017baed38df39a0574f1e8bbd549b8.zip |
Admin panel: New server GUI now using the backend types.
Diffstat (limited to 'modules-available/locationinfo/templates/credentials.html')
-rw-r--r-- | modules-available/locationinfo/templates/credentials.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules-available/locationinfo/templates/credentials.html b/modules-available/locationinfo/templates/credentials.html new file mode 100644 index 00000000..6933db75 --- /dev/null +++ b/modules-available/locationinfo/templates/credentials.html @@ -0,0 +1,31 @@ +<div> + <form method="post" action="?do=locationinfo" id="credentialsForm"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="updateCredentials"> + <input type="hidden" name="id" value="{{id}}"> + <div id="div"></div> + <button type="submit" class="btn btn-primary">{{lang_save}}</button> + </form> +</div> +<script type="text/javascript"> + +// {{name}} name of auth {{type}} type of auth (string, int etc.) {{value}} value from the db +{{#credentials}} + if("{{type}}" == "string") { + $("#div").before('<label>{{name}}</label><br><input required type="text" name="{{name}}" value="{{value}}" form="credentialsForm"><br><br>'); + } else if("{{type}}" == "int") { + $("#div").before('<label>{{name}}</label><br><input required type="number" name="{{name}}" value="{{value}}" form="credentialsForm"><br><br>'); + } else if("{{type}}" == "bool") { + $("#div").before('<label>{{name}}</label><br><input required type="checkbox" name="{{name}}" value="{{value}}" form="credentialsForm"><br><br>'); + } else if("{{type}}" == "array") { + $("#div").before('<label>{{name}}</label><br>\ + <select name="{{name}}" form="credentialsForm">\ + {{#array}}\ + <option value="{{option}}" {{#active}}selected{{/active}}>{{option}}</option>\ + {{/array}}\ + </select>\ + <br><br>'); + } +{{/credentials}} + +</script> |