201 lines
		
	
	
		
			6.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			201 lines
		
	
	
		
			6.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html ng-app="com.daplie.cloud" ng-strict>
 | 
						|
  <head>
 | 
						|
    <link type="text/css" rel="stylesheet" href="/assets/com.bootstrapcdn/spacelab/bootstrap.css">
 | 
						|
  </head>
 | 
						|
  <body class="fade" ng-class="[ 'in' ]">
 | 
						|
 | 
						|
    <ul>
 | 
						|
      <li>Change API format to verbose arrays and nested objects</li>
 | 
						|
      <li>Set Default Path, Module (dir, api)</li>
 | 
						|
      <li>Set Hostname, Path, Module (dir, api)</li>
 | 
						|
      <li>Show Device Name</li>
 | 
						|
      <li>Login to Daplie</li>
 | 
						|
      <li>Show domains (or ask purchase)</li>
 | 
						|
      <li>Tunnel On</li>
 | 
						|
      <li>Show configured domains</li>
 | 
						|
    </ul>
 | 
						|
 | 
						|
    <div class="container" ng-controller="LoginController as vm" ng-init="vm.setSimple()">
 | 
						|
      <h1 ng-if="!vm.authnUpdated">Initializing... {{vm.hello}}</h1>
 | 
						|
      <div>
 | 
						|
      Configure Remote Server
 | 
						|
      <label>Configuration Address:</label>
 | 
						|
      <input type="text" placeholder="i.e. 192.168.1.100">
 | 
						|
      <label>Configuration Name:</label>
 | 
						|
      <input type="text" placeholder="i.e. localhost.daplie.invalid">
 | 
						|
      <label>Root Certificate Validation (optional):</label>
 | 
						|
      <textarea class="textarea" placeholder="paste the contents of a root.pem here"></textarea>
 | 
						|
      </div>
 | 
						|
 | 
						|
 | 
						|
      <div ng-if="!vm.authnUpdated">
 | 
						|
      <button
 | 
						|
        type="button"
 | 
						|
        class="btn btn-default"
 | 
						|
        ng-disabled="vm.advanced && !vm.providerUri"
 | 
						|
        ng-click="vm.authenticate()"
 | 
						|
        >Login</button>
 | 
						|
      </div>
 | 
						|
      <button
 | 
						|
        type="button"
 | 
						|
        class="btn btn-link"
 | 
						|
        ng-if="!vm.advanced"
 | 
						|
        ng-click="vm.setAdvanced()"
 | 
						|
        >advanced</button>
 | 
						|
      <div ng-if="vm.advanced">
 | 
						|
        <button
 | 
						|
          type="button"
 | 
						|
          class="btn btn-link"
 | 
						|
          ng-click="vm.setSimple();"
 | 
						|
          >simple</button>
 | 
						|
        <input
 | 
						|
          type="text"
 | 
						|
          ng-change="vm.checkProviderUri(vm.myProviderUri)"
 | 
						|
          ng-model="vm.myProviderUri">
 | 
						|
        <br/>
 | 
						|
        <small>todo: allow per-device authorization</small>
 | 
						|
      </div>
 | 
						|
 | 
						|
      <div ng-if="vm.config">
 | 
						|
        <div ng-init="siteconf = vm.config.global">
 | 
						|
          <h1>Server Device Name: <span ng-bind="vm.config.device.hostname"></span></h1>
 | 
						|
          <!-- input class="form-control" ng-model="vm.config.device.hostname" / -->
 | 
						|
 | 
						|
          <h1>Server Working Directory:</h1>
 | 
						|
          <input class="form-control" ng-model="vm.config.cwd" />
 | 
						|
 | 
						|
          <h1>Addresses:</h1>
 | 
						|
          <table class="table">
 | 
						|
            <tr>
 | 
						|
              <th>Interface</th>
 | 
						|
              <th>Address</th>
 | 
						|
              <th>Family</th>
 | 
						|
              <th>Scope</th>
 | 
						|
            </tr>
 | 
						|
            <tr ng-repeat="addr in vm.config.addresses">
 | 
						|
              <td ng-bind="addr.iface"></td>
 | 
						|
              <td ng-bind="addr.address"></td>
 | 
						|
              <td ng-bind="addr.family"></td>
 | 
						|
              <td ng-bind="addr.range"></td>
 | 
						|
            </tr>
 | 
						|
          </table>
 | 
						|
 | 
						|
          <h1>Managed Domains:</h1>
 | 
						|
 | 
						|
          <div ng-if="!vm.domains.length">
 | 
						|
            You don't have any domains with this account.
 | 
						|
            <br/>
 | 
						|
            Try a different account?
 | 
						|
            <br/>
 | 
						|
            <input type="url" placeholder="https://daplie.domains">
 | 
						|
            <button type="button"
 | 
						|
              class="btn"
 | 
						|
              disabled
 | 
						|
              >Login</button>
 | 
						|
          </div>
 | 
						|
 | 
						|
          <div ng-if="vm.domains.length">
 | 
						|
            <h2>Enable Tunnel</h2>
 | 
						|
            <input type="radio" ng-model="vm.config.tunnel.enabled" ng-value="true">
 | 
						|
            <input type="radio" ng-model="vm.config.tunnel.enabled" ng-value="false">
 | 
						|
 | 
						|
            <table class="table">
 | 
						|
              <tr>
 | 
						|
                <th>Domain</th>
 | 
						|
                <th>Sub</th>
 | 
						|
                <th>Devices</th>
 | 
						|
              </tr>
 | 
						|
              <tr ng-repeat="d in vm.dns">
 | 
						|
                <td ng-bind="d.domain"></td>
 | 
						|
                <td ng-bind="d.name"></td>
 | 
						|
                <td>
 | 
						|
                  <span ng-if="!d.domain">
 | 
						|
                    <div ng-repeat="dev in d.devices">
 | 
						|
                      <span ng-bind="dev"
 | 
						|
                        ></span> <button
 | 
						|
                        type="button"
 | 
						|
                        class="btn btn-danger"
 | 
						|
                        ng-click="vm.removeDevice(d, dev)"
 | 
						|
                        >x</button>
 | 
						|
                    </div>
 | 
						|
                  </span>
 | 
						|
                </td>
 | 
						|
              </tr>
 | 
						|
            </table>
 | 
						|
          </div>
 | 
						|
 | 
						|
          <h1>Global Settings:</h1>
 | 
						|
          <br/>
 | 
						|
          <form class="form-inline">
 | 
						|
          <div ng-repeat="path in siteconf.paths">
 | 
						|
            <h2 ng-bind="path.$id"></h2>
 | 
						|
            <div ng-repeat="module in path.modules">
 | 
						|
              <h3>{{module.$id}}</h3>
 | 
						|
              <div ng-repeat="(key, value) in module">
 | 
						|
                <label>{{key}}</label>: <input class="form-control" ng-model="module[key]" />
 | 
						|
              </div>
 | 
						|
            </div>
 | 
						|
            <br/>
 | 
						|
            <br/>
 | 
						|
            <br/>
 | 
						|
          </div>
 | 
						|
          </form>
 | 
						|
        </div>
 | 
						|
 | 
						|
        <h1>Per-Domain Settings:</h1>
 | 
						|
        <div ng-repeat="siteconf in vm.config.sites">
 | 
						|
          <h2 ng-bind="siteconf.$id"></h2>
 | 
						|
          <div ng-repeat="path in siteconf.paths">
 | 
						|
            <h2 ng-bind="path.$id"></h2>
 | 
						|
            <div ng-repeat="module in path.modules">
 | 
						|
              <h3>{{module.$id}}</h3>
 | 
						|
              <div ng-repeat="(key, value) in module">
 | 
						|
                <label>{{key}}</label>: <input class="form-control" ng-model="module[key]" />
 | 
						|
              </div>
 | 
						|
            </div>
 | 
						|
            <br/>
 | 
						|
            <br/>
 | 
						|
            <br/>
 | 
						|
          </div>
 | 
						|
        </div>
 | 
						|
 | 
						|
        <div ng-init="defaultsconf = vm.config.defaults">
 | 
						|
          <h1>Fallback Settings:</h1>
 | 
						|
          <br/>
 | 
						|
          <div ng-repeat="path in siteconf.paths">
 | 
						|
            <h2 ng-bind="path.$id"></h2>
 | 
						|
            <div ng-repeat="module in path.modules">
 | 
						|
              <h3>{{module.$id}}</h3>
 | 
						|
              <div ng-repeat="(key, value) in module">
 | 
						|
                <label>{{key}}</label>: <input class="form-control" ng-model="module[key]" />
 | 
						|
              </div>
 | 
						|
            </div>
 | 
						|
            <br/>
 | 
						|
            <br/>
 | 
						|
            <br/>
 | 
						|
          </div>
 | 
						|
        </div>
 | 
						|
 | 
						|
        <div ng-if="!vm._showvmconfig">
 | 
						|
          <button class="btn-link" ng-click="vm._showvmconfig = true">show config as json</button>
 | 
						|
        </div>
 | 
						|
        <div ng-if="vm._showvmconfig">
 | 
						|
          <button class="btn-link" ng-click="vm._showvmconfig = false">hide config</button>
 | 
						|
          <pre><code ng-bind="vm.config | json">{{vm.config}}</code></pre>
 | 
						|
        </div>
 | 
						|
      </div>
 | 
						|
 | 
						|
    </div>
 | 
						|
 | 
						|
    <script src="/assets/com.jquery/jquery-3.1.1.js"></script>
 | 
						|
    <script src="/assets/com.google/angular.1.6.2.min.js"></script>
 | 
						|
    <script src="/assets/org.oauth3/oauth3.core.js"></script>
 | 
						|
    <script src="/assets/org.oauth3/oauth3.ng.js"></script>
 | 
						|
    <script src="/assets/org.oauth3/oauth3.domains.js"></script>
 | 
						|
    <script src="/assets/org.oauth3/oauth3.dns.js"></script>
 | 
						|
    <script src="/js/app.js"></script>
 | 
						|
 | 
						|
  </body>
 | 
						|
</html>
 |