OXYGENHUB
# 3d5c825aebba oxygenhub / templates / org_settings.html
7.9 KiB · HTML · last changed An organisation's storage policy 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% import "webhooks_panel.html" as w %}
3
{% import "assistants_panel.html" as ai %}
4
{% import "variables_panel.html" as va %}
5
{% import "secrets_panel.html" as se %}
6
{% block title %}{{ org.name }} settings{% endblock %}
7
{% block content %}
8
<div class="head"><h1>{{ org.name }} <small>organisation settings · <a href="/{{ org.name }}">repositories</a></small></h1></div>
9
<div class="sectioned">
10
<nav class="section-nav" aria-label="Sections">
11
  <a href="#general">General</a>
12
  <a href="#logo">Logo</a>
13
  <a href="#members">Members</a>
14
  <a href="#webhooks">Webhooks</a>
15
  <a href="#variables">Variables</a>
16
  <a href="#secrets">Secrets</a>
17
  <a href="#assistants">AI assistants</a>
18
  <a href="#teams">Teams</a>
19
  <a href="#storage">Storage</a>
20
</nav>
21
<div class="sections">
22
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
23
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
24
<form class="card" id="general" method="post" action="/orgs/{{ org.name }}/settings">
25
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
26
  <label for="display_name">Display name</label><input type="text" id="display_name" name="display_name" value="{{ org.display_name }}">
27
  <label for="description">Description</label><input type="text" id="description" name="description" value="{{ org.description }}">
28
  <label for="default_role">Members' default role on the organisation's repositories</label>
29
  <select id="default_role" name="default_role">{% for r in ["none", "read", "triage", "write", "maintain", "admin"] %}<option value="{{ r }}"{% if org.default_role.as_str() == *r %} selected{% endif %}>{{ r }}</option>{% endfor %}</select>
30
  <button type="submit">SAVE</button>
31
</form>
32
<form class="card picture-card" id="logo" method="post" action="/orgs/{{ org.name }}/settings/avatar" enctype="multipart/form-data">
33
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
34
  <h2>Logo</h2>
35
  <div class="picture-row">
36
    <img class="avatar xl" src="/avatar/{{ org.name }}?v={{ org.avatar }}" alt="{{ org.name }} logo" width="96" height="96">
37
    <div>
38
      <label for="logo-file">Upload a logo</label>
39
      <input type="file" id="logo-file" name="picture" accept="image/png,image/jpeg,image/webp">
40
      <p class="small mute">PNG (transparency is kept), JPEG or WebP, up to 5 MiB. It is cropped to the middle square and resized to 400×400.</p>
41
      <button type="submit" name="action" value="upload">UPLOAD</button>
42
      {% if !org.avatar.is_empty() %}<button type="submit" name="action" value="remove" class="danger-btn">REMOVE</button>{% endif %}
43
    </div>
44
  </div>
45
</form>
46
<section class="panel" id="members">
47
  <h2>Members</h2>
48
  <table class="small">{% for (a, r) in members %}<tr><td><a href="/{{ a.username }}">{{ a.username }}</a></td><td>{{ r }}</td>
49
  <td><form class="tiny" method="post" action="/orgs/{{ org.name }}/settings/members"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="username" value="{{ a.username }}"><button name="remove" value="1">remove</button></form></td></tr>{% endfor %}</table>
50
  <form class="card" method="post" action="/orgs/{{ org.name }}/settings/members">
51
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
52
    <div class="row"><div><label for="username">Account</label><input type="text" id="username" name="username" required></div>
53
    <div><label for="role">Role</label><select id="role" name="role"><option value="member">member</option><option value="owner">owner</option></select></div></div>
54
    <button type="submit">ADD OR CHANGE</button>
55
  </form>
56
</section>
57
<form class="card" id="storage" method="post" action="/orgs/{{ org.name }}/settings/storage">
58
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
59
  <h2>Storage</h2>
60
  <p class="small mute">Where the organisation's new repositories may live. Repositories that exist stay where they are.</p>
61
  <label class="check"><input type="checkbox" name="require_bucket" value="1"{% if policy.require_bucket %} checked{% endif %}> Keep every new repository in a bucket, not on this server's disk</label>
62
  <label for="allowed">Buckets allowed, one store URL prefix per line (empty: any bucket)</label>
63
  <textarea id="allowed" name="allowed" rows="3" placeholder="s3://acme-london/repos/&#10;gs://acme-eu/" spellcheck="false">{{ policy.allowed.join("\n") }}</textarea>
64
  <p class="small mute">Listing the organisation's own buckets keeps its data where those buckets are: the provider, the region, the country.</p>
65
  <button type="submit">SAVE</button>
66
</form>
67
<section class="panel" id="teams">
68
  <h2>Teams</h2>
69
  {% for (t, ms) in teams %}
70
  <p><strong>{{ t.name }}</strong>: {% for a in ms %}{{ a.username }}{% if !loop.last %}, {% endif %}{% endfor %}{% if ms.is_empty() %}<span class="mute">nobody yet</span>{% endif %}
71
  <form class="tiny" method="post" action="/orgs/{{ org.name }}/settings/teams"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="team" value="{{ t.name }}"><button name="action" value="delete">delete team</button></form></p>
72
  {% endfor %}
73
  <form class="card" method="post" action="/orgs/{{ org.name }}/settings/teams">
74
    <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
75
    <div class="row"><div><label for="team">Team</label><input type="text" id="team" name="team" required></div>
76
    <div><label for="tuser">Account (for add or remove)</label><input type="text" id="tuser" name="username"></div></div>
77
    <div class="choice"><button type="submit" name="action" value="create">CREATE TEAM</button> <button type="submit" name="action" value="add">ADD MEMBER</button> <button type="submit" name="action" value="remove">REMOVE MEMBER</button></div>
78
  </form>
79
</section>
80
<section class="panel" id="runners">
81
  <h2>Runners</h2>
82
  <p class="small">The OxygenFlow runners that may take this organisation's jobs: the site's, the organisation's, and those of its repositories.</p>
83
  {% if let Some(t) = runner_token %}<p class="note">Register a runner for the organisation with:</p><pre class="snippet">flow runner register {{ shell.base_url }} --token {{ t }} --name NAME</pre>{% endif %}
84
  {% if runners.is_empty() %}<p class="mute small">None yet: runs wait until a runner that serves them is added.</p>{% else %}
85
  <div class="table"><table>
86
  <tr><th>Runner</th><th>Status</th><th>Serves</th><th>Machine</th><th></th></tr>
87
  {% for (r, serves, own) in runners %}<tr><td><strong>{{ r.name }}</strong></td><td><span class="runner-status st-{{ r.status() }}">{{ r.status() }}</span></td><td class="small">{{ serves }}</td><td class="small">{% if r.arch.is_empty() %}<span class="mute">unknown</span>{% else %}{{ r.arch }} · {{ r.os }}{% endif %}</td>
88
  <td>{% if *own %}<form class="tiny" method="post" action="/orgs/{{ org.name }}/settings/runners/{{ r.id }}/remove" onsubmit="return confirm('Remove {{ r.name }}? Its credential stops working.')"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button class="danger-btn">remove</button></form>{% endif %}</td></tr>{% endfor %}
89
  </table></div>{% endif %}
90
  <form method="post" action="/orgs/{{ org.name }}/settings/runners/token"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit">Add a runner for the organisation</button></form>
91
</section>
92
{% call w::panel("/orgs/" ~ org.name ~ "/settings", hooks, shell.csrf, "These hear every repository of the organisation, as well as each repository's own webhooks.") %}
93
{% call va::panel("/orgs/" ~ org.name ~ "/settings", variables, shell.csrf, "Jobs of every repository of the organisation get these, beside the site's and each repository's own.") %}
94
{% call se::panel("/orgs/" ~ org.name ~ "/settings", secrets, shell.csrf, "Jobs of every repository of the organisation may use these, beside the site's and each repository's own.") %}
95
{% call ai::panel("/orgs/" ~ org.name ~ "/settings", assistants, shell.csrf, "Every repository of the organisation may ask these, beside the site's and its own.") %}
96
</div>
97
</div>
98
{% endblock %}