yex
This commit is contained in:
@@ -77,6 +77,46 @@
|
||||
<div class="gw-form-actions"><button type="submit" class="admin-btn admin-btn-primary">Save model route</button></div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="gw-section">
|
||||
<div class="gw-section-head">
|
||||
<h3>Quota rules</h3>
|
||||
</div>
|
||||
<p class="gw-section-hint">Rolling 24h USD caps on <code class="gw-code">/openai/v1/*</code>. A rule scopes by any combination of role, specific user, and app label (the <code class="gw-code">X-App-Reference</code> header); the most specific active match wins, and a rule that omits a dimension pools spend across everyone matching it (e.g. an app-only rule caps that app's combined usage across all callers). With no matching rule, the global defaults below apply per caller. A limit of 0 means unlimited.</p>
|
||||
<div class="gw-default" id="gw-quota-defaults" role="status" aria-live="polite"></div>
|
||||
<div class="admin-table-wrap">
|
||||
<table class="admin-table">
|
||||
<caption class="sr-only">Quota rules</caption>
|
||||
<thead>
|
||||
<tr><th scope="col">Scope</th><th scope="col">Limit / 24h</th><th scope="col">Spent 24h</th><th scope="col">Active</th><th scope="col">Label</th><th scope="col" class="gw-actions">Actions</th></tr>
|
||||
</thead>
|
||||
<tbody id="gw-quota-rules"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<form class="gw-form" id="gw-quota-form" autocomplete="off" role="group" aria-label="Add or update quota rule">
|
||||
<p class="gw-form-title">Add or update quota rule</p>
|
||||
<input type="hidden" id="gw-quota-uid" name="uid" value="">
|
||||
<div class="gw-field"><label for="gw-quota-owner-kind">Role</label>
|
||||
<select id="gw-quota-owner-kind" name="owner_kind">
|
||||
<option value="">any</option>
|
||||
<option value="user">member</option>
|
||||
<option value="admin">admin</option>
|
||||
<option value="anonymous">guest (unauthenticated)</option>
|
||||
<option value="internal">internal (DevPlace's own services)</option>
|
||||
<option value="key">static access key</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="gw-field"><label for="gw-quota-owner-id">Specific user uid</label><input type="text" id="gw-quota-owner-id" name="owner_id" placeholder="(optional) exact uid, blank = any"></div>
|
||||
<div class="gw-field"><label for="gw-quota-app-reference">App reference</label><input type="text" id="gw-quota-app-reference" name="app_reference" placeholder="(optional) devplace-bots-v-1-0-0, blank = any"></div>
|
||||
<div class="gw-field"><label for="gw-quota-limit">Limit / 24h ($)</label><input type="number" id="gw-quota-limit" name="limit_usd" min="0" step="0.01" value="0" title="0 = unlimited"></div>
|
||||
<div class="gw-field"><label for="gw-quota-active">Active</label><select id="gw-quota-active" name="is_active"><option value="1">Yes</option><option value="0">No</option></select></div>
|
||||
<div class="gw-field"><label for="gw-quota-label">Label</label><input type="text" id="gw-quota-label" name="label" placeholder="(optional) admin note" maxlength="200"></div>
|
||||
<div class="gw-form-actions">
|
||||
<button type="submit" class="admin-btn admin-btn-primary">Save quota rule</button>
|
||||
<button type="button" class="admin-btn admin-btn-sm" id="gw-quota-cancel-edit" hidden>Cancel edit</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
|
||||
Reference in New Issue
Block a user