network-throttle.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <article>
  2. <div bs-panel="controls outline">
  3. <h1 bs-heading>
  4. <icon icon="{{ctrl.section.icon}}"></icon>
  5. {{ctrl.section.title}}
  6. </h1>
  7. </div>
  8. <div bs-panel="no-border" ng-if="ctrl.options.mode === 'snippet'">
  9. <div bs-panel-content="basic">
  10. <p class="lede">Sorry, Network Throttling is only available in Server or Proxy mode.</p>
  11. </div>
  12. </div>
  13. <div bs-panel="no-border" ng-if="ctrl.options.mode !== 'snippet'">
  14. <div bs-panel-content="basic">
  15. <div bs-inputs bs-grid="wide-3 desk-2">
  16. <div bs-grid-item>
  17. <p bs-label-heading>Speed</p>
  18. <div bs-input="inline" ng-repeat="(key, item) in ctrl.throttle.targets | orderObjectBy:'order'">
  19. <input
  20. type="radio"
  21. id="speed-{{item.id}}"
  22. checked name="speed"
  23. ng-model="ctrl.selected"
  24. value="{{item.id}}">
  25. <label for="speed-{{item.id}}" bs-input-label="light">{{item.title}}</label>
  26. </div>
  27. </div>
  28. <div bs-grid-item>
  29. <p bs-label-heading>Port</p>
  30. <div bs-input="text">
  31. <div bs-input="inline">
  32. <input type="radio" name="port-select" id="port-auto" checked value="auto"
  33. ng-model="ctrl.portEntry">
  34. <label for="port-auto" bs-input-label="light">Auto Detection</label>
  35. </div>
  36. <div bs-input="inline">
  37. <input type="radio" id="port-manual" name="port-select" value="manual" ng-model="ctrl.portEntry">
  38. <label for="port-manual" bs-input-label="light">User specified <span ng-if="ctrl.state.portError">(between
  39. 1024 & 65535)</span></label>
  40. </div>
  41. <input id="server-port"
  42. type="text"
  43. value=""
  44. placeholder="Eg: 1024"
  45. ng-model="ctrl.port"
  46. ng-focus="ctrl.portEntry = 'manual'"
  47. custom-validation>
  48. </div>
  49. <br/>
  50. <div ng-class="[ctrl.state.classname]" bs-state-wrapper>
  51. <button
  52. id="create-server"
  53. bs-button="size-small subtle-alt icon-left"
  54. ng-click="ctrl.createServer(ctrl.selected, $event)"
  55. ng-disabled="ctrl.state.waiting"
  56. >
  57. <icon icon="circle-plus"></icon>
  58. Create Server
  59. </button>
  60. <div bs-state-icons>
  61. <icon icon="circle-ok" bs-state="success inline"></icon>
  62. <icon icon="circle-minus" bs-state="waiting inline" bs-anim="spin"></icon>
  63. </div>
  64. </div>
  65. </div>
  66. <div bs-grid-item>
  67. </div>
  68. </div>
  69. </div>
  70. <br/>
  71. <div bs-panel-content="basic">
  72. <h3 ng-if="ctrl.serverCount">Your Servers:</h3>
  73. <h3 ng-if="!ctrl.serverCount">Your Servers will appear here...</h3>
  74. </div>
  75. <ul bs-list="bordered inline-controls" bs-offset="basic" id="throttle-server-list">
  76. <li ng-repeat="(key, item) in ctrl.servers track by key">
  77. <p bs-width="5">{{$index + 1}}.</p>
  78. <p bs-width="10"><b>{{item.speed.id | uppercase}}</b></p>
  79. <p><a href="{{item.urls[0]}}">{{item.urls[0]}}</a></p>
  80. <p><a href="{{item.urls[1]}}">{{item.urls[1]}}</a></p>
  81. <div bs-button-group>
  82. <button href="#" bs-button="subtle-alt icon" ng-click="ctrl.destroyServer(item, key)">
  83. <svg bs-svg-icon><use xlink:href="#svg-bin"></use></svg>
  84. </button>
  85. </div>
  86. </li>
  87. </ul>
  88. </div>
  89. </article>