Implemented downloading client config

This commit is contained in:
Daniel Lundin
2019-07-20 13:28:45 +02:00
parent 44c98b72b8
commit 0762143528
3 changed files with 8 additions and 6 deletions
+5 -2
View File
@@ -2,6 +2,7 @@
import { link } from "svelte-routing"; import { link } from "svelte-routing";
export let client; export let client;
export let user;
let clientId = client[0]; let clientId = client[0];
let dev = client[1]; let dev = client[1];
@@ -15,6 +16,8 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<a href="/client/{clientId}" use:link role="button" class="btn btn-secondary material-icons float-right">edit</a>
<h4 class="card-title">{client.Name}</h4> <h4 class="card-title">{client.Name}</h4>
<dl class="row"> <dl class="row">
<dt class="col-sm-2">IP</dt> <dt class="col-sm-2">IP</dt>
@@ -23,8 +26,8 @@
<dd class="col-sm-10">{dev.PublicKey}</dd> <dd class="col-sm-10">{dev.PublicKey}</dd>
</dl> </dl>
<a href="/client/{clientId}/config" role="button" class="btn btn-primary">Download Config</a> <a href="/api/v1/users/{user}/clients/{clientId}?format=config" role="button" class="btn btn-raised btn-primary">Download Config</a>
<a href="/client/{clientId}" use:link role="button" class="btn btn-primary material-icons float-right">edit</a>
</div> </div>
</div> </div>
+1 -1
View File
@@ -17,7 +17,7 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
{#each clients as dev} {#each clients as dev}
<li><Client client={dev}/></li> <li><Client user={user} client={dev}/></li>
{/each} {/each}
</ul> </ul>
+2 -3
View File
@@ -17,13 +17,12 @@
<h2>Edit Client {client.Name}</h2> <h2>Edit Client {client.Name}</h2>
<form> <form>
<div class="form-group">
<div class="form-group">
<label for="name" class="bmd-label-floating">Client Name</label> <label for="name" class="bmd-label-floating">Client Name</label>
<input type="email" class="form-control" id="name" value={client.Name}> <input type="email" class="form-control" id="name" value={client.Name}>
<span class="bmd-help">Friendly name of client.</span> <span class="bmd-help">Friendly name of client.</span>
</div> </div>
</form> </form>
<p> <p>
{client} {client}
</p> </p>