PageRenderTime 53ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/app_settings.html

https://gitlab.com/lileeyao/airnotifier
HTML | 269 lines | 237 code | 32 blank | 0 comment | 0 complexity | da9a4104883d22fc99a036072912c309 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. {% extends "base.html" %}
  2. {% block navbar %}
  3. {{ modules.NavBar('applications') }}
  4. {% end %}
  5. {% block tabbaritems %}
  6. {{ modules.TabBar(app, 'settings') }}
  7. {% end %}
  8. {% block sidebaritems %}
  9. {{ modules.AppSideBar(app, 'settings') }}
  10. {% end %}
  11. {% block body %}
  12. {% if 'error' in globals() %}
  13. <div class="alert">
  14. <strong>{{ error }}</strong>
  15. </div>
  16. {% end %}
  17. <form class="form-horizontal" id="form-app-settings" method="post">
  18. <input type="hidden" name="appname" value="{{app['shortname']}}" />
  19. <fieldset>
  20. <legend>{{ _('General') }}</legend>
  21. <div class="control-group">
  22. <label class="control-label" for="shortname"> {{ _('Short name') }}</label>
  23. <div class="controls">
  24. <input type="text" class="input-xlarge" id="shortname" readonly="readonly" value="{{app['shortname']}}">
  25. <p class="help-block">Unique identifier for your app.</p>
  26. </div>
  27. </div>
  28. <div class="control-group">
  29. <label class="control-label" for="appfullname">{{ _('Full name') }}</label>
  30. <div class="controls">
  31. <input type="text" class="input-xlarge" id="appfullname" name="appfullname" value="{{ app.get('fullname', '') }}">
  32. </div>
  33. </div>
  34. {% if app['enableapns'] != 1 %}
  35. <div class="control-group">
  36. <label class="control-label" for="connections">Connections</label>
  37. <div class="controls">
  38. <input type="text" class="input-xlarge" id="connections" pattern="[0-9]+" name="connections" value="{{app['connections']}}">
  39. <p class="help-block ">This will restart APNs</p>
  40. </div>
  41. </div>
  42. {% end %}
  43. <div class="control-group">
  44. <label class="control-label" for="keydesc">{{ _('Blocked IP list') }}</label>
  45. <div class="controls">
  46. <textarea rows="10" class="input-xlarge" id="ipaddr" name="blockediplist">{{ app.get('blockediplist', '') }}</textarea>
  47. </div>
  48. </div>
  49. <div class="control-group">
  50. <label class="control-label" for="appdescription">Description</label>
  51. <div class="controls">
  52. <textarea class="input-xlarge" id="appdescription" rows="6" name="appdescription">{{app.get('description', '')}}</textarea>
  53. </div>
  54. </div>
  55. <div class="form-actions">
  56. <button type="submit" class="btn btn-primary">{{ _('Apply') }}</button>
  57. </div>
  58. </fieldset>
  59. </form>
  60. <form class="form-horizontal" id="form-ios-settings" method="post">
  61. <fieldset>
  62. <legend>{{ _('Apple push notification settings') }}</legend>
  63. <div class="control-group">
  64. <label class="control-label"> {{ _('APNs service') }}</label>
  65. <div class="controls">
  66. <input type="hidden" name="appname" value="{{app['shortname']}}" />
  67. {% if app.get('enableapns', False) %}
  68. <input type="hidden" name="stopapns" value="true" />
  69. <button type="submit" class="btn btn-danger">{{ _('Stop') }}</button>
  70. {% else %}
  71. <input type="hidden" name="launchapns" value="true" />
  72. <button type="submit" class="btn btn-primary">{{ _('Launch') }}</button>
  73. {% end %}
  74. <p class="help-block">You have to stop the service to see more options</p>
  75. </div>
  76. </div>
  77. </form>
  78. {% if app['enableapns'] != 1 %}
  79. <form class="form-horizontal" method="post">
  80. <div class="control-group">
  81. <label class="control-label"> {{ _('Set mode') }}</label>
  82. <div class="controls">
  83. <input type="hidden" name="appname" value="{{app['shortname']}}" />
  84. {% if not app.has_key('environment') or (app.has_key('environment') and app['environment'] == 'sandbox') %}
  85. <input type="hidden" name="turnonproduction" value="true">
  86. <button type="submit" class="btn btn-info">{{ _('Enter production mode') }}</button>
  87. {% else %}
  88. <input type="hidden" name="turnonsandbox" value="true">
  89. <button type="submit" class="btn btn-info">{{ _('Enter sandbox mode') }}</button>
  90. {% end %}
  91. </div>
  92. </div>
  93. </form>
  94. {% end %}
  95. <form class="form-horizontal" method="post">
  96. <input type="hidden" name="appname" value="{{app['shortname']}}" />
  97. <label class="control-label"> {{ _('Feedback service') }}</label>
  98. <div class="control-group">
  99. <div class="controls">
  100. <input type="hidden" name="performfeedbacktask" value="true" />
  101. <button type="submit" class="btn btn-primary">{{ _('Clean up') }}</button>
  102. <p class="help-block">Clean up unused device tokens</p>
  103. </div>
  104. </div>
  105. </form>
  106. {% if app['enableapns'] != 1 %}
  107. <form class="form-horizontal" method="post" enctype="multipart/form-data">
  108. <input type="hidden" name="appname" value="{{app['shortname']}}" />
  109. <div class="control-group">
  110. <label class="control-label" for="certfileinput">{{ _('Certification') }}</label>
  111. <div class="controls">
  112. {% if app.get('certfile', False) %}
  113. <div class="alert alert-success">
  114. {{ _('Already uploaded') }}
  115. {% else %}
  116. <div class="alert alert-error">
  117. {{ _('Certificate not set') }}
  118. {% end %}
  119. <input class="input-file" id="certfileinput" type="file" name="appcertfile">
  120. </div>
  121. </div>
  122. </div>
  123. <div class="control-group">
  124. <label class="control-label" for="keyfileinput">{{ _('Key') }}</label>
  125. <div class="controls">
  126. {% if app.get('keyfile', False) %}
  127. <div class="alert alert-success">
  128. {{ _('Already uploaded') }}
  129. {% else %}
  130. <div class="alert alert-error">
  131. {{ _('Key not set') }}
  132. {% end %}
  133. <input class="input-file" id="keyfileinput" type="file" name="appkeyfile">
  134. </div>
  135. </div>
  136. </div>
  137. <div class="form-actions">
  138. <button type="submit" class="btn btn-primary">{{ _('Upload') }}</button>
  139. </div>
  140. {% end %}
  141. </fieldset>
  142. </form>
  143. <form class="form-horizontal" id="form-gcm-settings" method="post">
  144. <input type="hidden" name="appname" value="{{app['shortname']}}" />
  145. <fieldset>
  146. <legend>{{ _('Google cloud messaging settings') }}</legend>
  147. <div class="control-group">
  148. <label class="control-label" for="form-element-gcmprojectnumber"> {{ _('Project number') }}</label>
  149. <div class="controls">
  150. <input type="text" class="input-xlarge" id="form-element-gcmprojectnumber" name="gcmprojectnumber" value="{{app['gcmprojectnumber']}}">
  151. <p class="help-block">Android app project number</p>
  152. </div>
  153. </div>
  154. <div class="control-group">
  155. <label class="control-label" for="form-element-gcmapikey">{{ _('API key') }}</label>
  156. <div class="controls">
  157. <input type="text" class="input-xlarge" id="form-element-gcmapikey" name="gcmapikey" value="{{app.get('gcmapikey', '')}}">
  158. </div>
  159. </div>
  160. <div class="form-actions">
  161. <button type="submit" class="btn btn-primary">{{ _('Save') }}</button>
  162. </div>
  163. </fieldset>
  164. </form>
  165. <form class="form-horizontal" id="form-wns-settings" method="post">
  166. <fieldset>
  167. <legend>{{ _('WNS settings') }}</legend>
  168. <div class="control-group">
  169. <label class="control-label" for="form-element-wnsclientid"> {{ _('Client ID') }}</label>
  170. <div class="controls">
  171. <input type="text" class="input-xlarge" id="form-element-wnsclientid" name="wnsclientid" value="{{app.get('wnsclientid', '')}}">
  172. <p class="help-block">Client ID</p>
  173. </div>
  174. </div>
  175. <div class="control-group">
  176. <label class="control-label" for="form-element-wnsclientsecret">{{ _('Client secret') }}</label>
  177. <div class="controls">
  178. <input type="text" class="input-xlarge" id="form-element-wnsclientsecret" name="wnsclientsecret" value="{{app.get('wnsclientsecret', '')}}">
  179. </div>
  180. </div>
  181. <div class="form-actions">
  182. <button type="submit" class="btn btn-primary">{{ _('Save') }}</button>
  183. </div>
  184. </fieldset>
  185. </form>
  186. <form class="form-horizontal" method="post" enctype="multipart/form-data">
  187. <fieldset>
  188. <legend>{{ _('MPNS settings') }}</legend>
  189. <div class="control-group">
  190. <label class="control-label" for="id-mpnscertificatefile">{{ _('Certificate (this is optional)') }}</label>
  191. <div class="controls">
  192. {% if app.get('mpnscertificatefile', False) %}
  193. <div class="alert alert-success">
  194. {{ _('Already uploaded') }}
  195. {% else %}
  196. <div class="alert alert-warning">
  197. {{ _('MPNS certificate not set') }}
  198. {% end %}
  199. <input class="input-file" id="id-mpnscertificatefile" type="file" name="mpnscertificatefile">
  200. </div>
  201. </div>
  202. </div>
  203. <div class="form-actions">
  204. <button type="submit" class="btn btn-primary">{{ _('Upload') }}</button>
  205. </div>
  206. </fieldset>
  207. </form>
  208. <form class="form-horizontal" method="post" enctype="multipart/form-data">
  209. <fieldset>
  210. <legend>{{ _('Clickatell(SMS) settings') }}</legend>
  211. <div class="control-group">
  212. <label class="control-label" for="form-element-clickatellusername"> {{ _('Username') }}</label>
  213. <div class="controls">
  214. <input type="text" class="input-xlarge" id="form-element-clickatellusername" name="clickatellusername" value="{{app.get('clickatellusername', '')}}">
  215. <p class="help-block"></p>
  216. </div>
  217. </div>
  218. <div class="control-group">
  219. <label class="control-label" for="form-element-clickatellpassword"> {{ _('Password') }}</label>
  220. <div class="controls">
  221. <input type="text" class="input-xlarge" id="form-element-clickatellpassword" name="clickatellpassword" value="{{app.get('clickatellpassword', '')}}">
  222. <p class="help-block"></p>
  223. </div>
  224. </div>
  225. <div class="control-group">
  226. <label class="control-label" for="form-element-clickatellappid"> {{ _('App ID') }}</label>
  227. <div class="controls">
  228. <input type="text" class="input-xlarge" id="form-element-clickatellappid" name="clickatellappid" value="{{app.get('clickatellappid', '')}}">
  229. <p class="help-block"></p>
  230. </div>
  231. </div>
  232. <div class="form-actions">
  233. <button type="submit" class="btn btn-primary">{{ _('Save') }}</button>
  234. </div>
  235. </fieldset>
  236. </form>
  237. {% end %}