aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-09-25 15:57:59 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-09-25 15:57:59 +0200
commitbe97a1be587f42a4688825244b025b06172c442a (patch)
tree95dbaba0d39451efd3ae084e219b6df726d9dc11
parentc06f52837e5b4aab5335e5a66885c48c24a148a2 (diff)
downloadguichet-be97a1be587f42a4688825244b025b06172c442a.tar.gz
guichet-be97a1be587f42a4688825244b025b06172c442a.zip
fix some templates
-rw-r--r--quotas.go4
-rw-r--r--templates/garage_key.html20
-rw-r--r--templates/garage_website_list.html2
-rw-r--r--templates/home.html6
-rw-r--r--templates/profile.html2
5 files changed, 17 insertions, 17 deletions
diff --git a/quotas.go b/quotas.go
index e077ac8..3eec9b8 100644
--- a/quotas.go
+++ b/quotas.go
@@ -58,11 +58,11 @@ func entryToQuota(entry *ldap.Entry, field string) (int64, error) {
func NewUserQuotaFromEntry(entry *ldap.Entry) *UserQuota {
quotas := NewUserQuota()
- if q, err := entryToQuota(entry, FIELD_QUOTA_WEBSITE_COUNT); err != nil {
+ if q, err := entryToQuota(entry, FIELD_QUOTA_WEBSITE_COUNT); err == nil {
quotas.WebsiteCount = q
}
- if q, err := entryToQuota(entry, FIELD_QUOTA_WEBSITE_SIZE_BURSTED); err != nil {
+ if q, err := entryToQuota(entry, FIELD_QUOTA_WEBSITE_SIZE_BURSTED); err == nil {
quotas.WebsiteSizeBursted = q
}
diff --git a/templates/garage_key.html b/templates/garage_key.html
index b839fcb..e1a9019 100644
--- a/templates/garage_key.html
+++ b/templates/garage_key.html
@@ -21,12 +21,12 @@
<table class="table mt-4">
<tbody>
<tr>
- <th scope="row">Identifiant de clé</th>
- <td>{{ .Key.AccessKeyId }}</td>
+ <th scope="row" class="col-md-2">Identifiant de clé</th>
+ <td>{{ .S3KeyInfo.AccessKeyId }}</td>
</tr>
<tr>
<th scope="row">Clé secrète</th>
- <td>{{ .Key.SecretAccessKey }}</td>
+ <td><a href="#" onclick="document.getElementById('secret_key').style.display='inline'; this.style.display='none'">Cliquer pour afficher la clé secrète</a><span id="secret_key" style="display: none">{{ .S3KeyInfo.SecretAccessKey }}</span></td>
</tr>
<tr>
<th scope="row">Région</th>
@@ -58,12 +58,12 @@
</button>
</h2>
</div>
- <div id="awscli" class="collapse show" aria-labelledby="awscli-title" data-parent="#softconfig">
+ <div id="awscli" class="collapse" aria-labelledby="awscli-title" data-parent="#softconfig">
<div class="card-body">
<p>Créez un fichier nommé <code>~/.awsrc</code> :</p>
<pre>
-export AWS_ACCESS_KEY_ID={{ .Key.AccessKeyId }}
-export AWS_SECRET_ACCESS_KEY={{ .Key.SecretAccessKey }}
+export AWS_ACCESS_KEY_ID={{ .S3KeyInfo.AccessKeyId }}
+export AWS_SECRET_ACCESS_KEY={{ .S3KeyInfo.SecretAccessKey }}
export AWS_DEFAULT_REGION='garage'
function aws { command aws --endpoint-url https://garage.deuxfleurs.fr $@ ; }
@@ -97,8 +97,8 @@ aws s3 cp /tmp/a.txt s3://my-bucket
mc alias set \
garage \
https://garage.deuxfleurs.fr \
- {{ .Key.AccessKeyId }} \
- {{ .Key.SecretAccessKey }} \
+ {{ .S3KeyInfo.AccessKeyId }} \
+ {{ .S3KeyInfo.SecretAccessKey }} \
--api S3v4
</pre>
<p>Et ensuite pour utiliser Minio CLI avec :</p>
@@ -176,7 +176,7 @@ hugo deploy
<tbody>
<tr>
<th scope="row">Nom d'utilisateur-ice</th>
- <td>{{ .Status.Info.Username }}</td>
+ <td>{{ .Login.Info.Username }}</td>
</tr>
<tr>
<th scope="row">Mot de passe</th>
@@ -207,7 +207,7 @@ hugo deploy
<div class="card-body">
<p>Un exemple avec SCP :</p>
<pre>
-scp -oHostKeyAlgorithms=+ssh-rsa -P2222 -r ./public {{ .Status.Info.Username }}@bagage.deuxfleurs.fr:mon_bucket/
+scp -oHostKeyAlgorithms=+ssh-rsa -P2222 -r ./public {{ .Login.Info.Username }}@bagage.deuxfleurs.fr:mon_bucket/
</pre>
</div>
</div>
diff --git a/templates/garage_website_list.html b/templates/garage_website_list.html
index ded8096..0f4a3b3 100644
--- a/templates/garage_website_list.html
+++ b/templates/garage_website_list.html
@@ -15,7 +15,7 @@
<th scope="col">URLs</th>
</thead>
<tbody>
- {{ range $buck := .Key.Buckets }}
+ {{ range $buck := .S3KeyInfo.Buckets }}
{{ if $buck.GlobalAliases }}
<tr>
<td>
diff --git a/templates/home.html b/templates/home.html
index 241a59d..3dad6b6 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -2,7 +2,7 @@
{{define "body"}}
<div class="alert alert-info">
- Bienvenue, <strong>{{ .Login.WelcomeName }}</strong> !
+ Bienvenue, <strong>{{ .User.WelcomeName }}</strong> !
</div>
<div class="d-flex">
<a class="ml-auto btn btn-sm btn-dark" href="/logout">Se déconnecter</a>
@@ -33,7 +33,7 @@
</div>
</div>
-{{if .Login.CanInvite}}
+{{if .User.Capabilities.CanInvite}}
<div class="card mt-3">
<div class="card-header">
Inviter des gens sur Deuxfleurs
@@ -45,7 +45,7 @@
</div>
{{end}}
-{{if .Login.CanAdmin}}
+{{if .User.Capabilities.CanAdmin}}
<div class="card mt-3">
<div class="card-header">
Administration
diff --git a/templates/profile.html b/templates/profile.html
index 56461eb..17965a6 100644
--- a/templates/profile.html
+++ b/templates/profile.html
@@ -20,7 +20,7 @@
<div class="form-row">
<div class="form-group col-md-6">
<label>Identifiant:</label>
- <input type="text" disabled="true" class="form-control" value="{{ .Status.Info.Username }}" />
+ <input type="text" disabled="true" class="form-control" value="{{ .User.Login.Info.Username }}" />
</div>
<div class="form-group col-md-6">
<label for="mail">Adresse e-mail:</label>