<div class="form-group">
  <div class="input-group">
    <span class="input-group-prepend">
      <span class="input-group-text" data-translate>Tor Onion Service</span>
    </span>
    <input name="onionservice" class="form-control" type="text" value="{{resources.network.onionservice}}" disabled />
    <span class="input-group-append">
      <button class="btn btn-danger" data-ng-disabled="torOnionResetInProgress" data-ng-click="resetOnionPrivateKey()">
        <i class="fa-solid fa-sync"></i>
        <span data-translate>Regenerate</span>
      </button>
    </span>
  </div>
</div>

<div class="card card-default">
  <div class="card-body">
    <form name="adminNetForm">
      <div class="row">
        <div class="col-md-12">
          <div class="form-group" data-ng-if="resources.node.root_tenant">
            <input data-ng-model="resources.network.anonymize_outgoing_connections" type="checkbox">
            <label data-translate>Anonymize outgoing connections</label>
          </div>

          <div class="form-group">
            <input data-ng-model="resources.network.reachable_via_web" type="checkbox">
            <label data-translate>Let the platform be reachable without Tor</label>
          </div>

          <div data-ng-show="resources.network.reachable_via_web">
            <div class="form-group">
              <label data-translate>Roles enabled to use the platform without Tor</label>
            </div>
            <table class="table table-bordered">
              <thead>
                <th data-translate>Role</th>
                <th data-translate>Enabled</th>
              </thead>
              <tbody>
                <tr>
                  <td data-translate>Admin</td>
                  <td>
                    <input data-ng-model="resources.network.https_admin" type="checkbox">
                  </td>
                </tr>
                <tr data-ng-if="resources.network.enable_custodian">
                  <td data-translate>Custodian</td>
                  <td>
                    <input data-ng-model="resources.network.https_custodian" type="checkbox">
                  </td>
                </tr>
                <tr>
                  <td data-translate>Recipient</td>
                  <td>
                    <input data-ng-model="resources.network.https_receiver" type="checkbox">
                  </td>
                </tr>
                <tr>
                  <td data-translate>Whistleblower</td>
                  <td>
                    <input data-ng-model="resources.network.https_whistleblower" type="checkbox">
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <hr />
      <div class="row">
        <div class="col-md-6">
          <button class="btn btn-primary" data-ng-disabled="adminNetForm.$invalid" data-ng-click="Utils.update(resources.network)" type="submit">
            <i class="fa-solid fa-check"></i>
            <span data-translate>Save</span>
          </button>
        </div>
      </div>
    </form>
  </div>
</div>
