feat: connect alpine workspace management to admin api

This commit is contained in:
a.tolmachev
2026-03-30 23:03:25 +03:00
parent 0cec8cc826
commit 91854a4153
8 changed files with 624 additions and 218 deletions
+17 -10
View File
@@ -13,6 +13,7 @@
<script>try{if(!localStorage.getItem('crank_user'))window.location.replace('login.html');}catch(e){}</script>
<script src="js/config.js"></script>
<script src="js/i18n.js"></script>
<script src="js/api.js"></script>
<script src="js/workspace.js"></script>
</head>
<body>
@@ -101,6 +102,12 @@
<!-- ── Sidebar nav ── -->
<nav class="settings-nav" id="settings-nav">
<button class="settings-nav-item" data-section="workspace">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M2 5.5h12M4 2.5h8a1.5 1.5 0 011.5 1.5v8A1.5 1.5 0 0112 13.5H4A1.5 1.5 0 012.5 12V4A1.5 1.5 0 014 2.5z"/>
</svg>
<span>Workspace</span>
</button>
<button class="settings-nav-item active" data-section="profile">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<circle cx="8" cy="5" r="3"/>
@@ -126,7 +133,7 @@
<!-- ── Content ── -->
<div id="settings-content">
<div id="section-workspace" style="display:none;">
<div id="section-workspace" class="section-anchor">
<div class="section-card" style="margin-bottom: 20px;">
<div class="section-card-header">
<div>
@@ -137,21 +144,21 @@
<div class="section-card-body" style="padding-bottom:8px;">
<div class="field-group">
<label class="field-label" data-i18n="settings.ws.name">Workspace name</label>
<input class="field-input" type="text" value="acme-workspace" autocomplete="off">
<input class="field-input" id="settings-ws-slug" type="text" value="acme-workspace" autocomplete="off">
<div class="field-hint">Used in API endpoints and across the console. Only lowercase letters, numbers and hyphens.</div>
</div>
<div class="field-group">
<label class="field-label" data-i18n="settings.ws.display">Display name</label>
<input class="field-input" type="text" value="Acme Corp" autocomplete="off">
<input class="field-input" id="settings-ws-display-name" type="text" value="Acme Corp" autocomplete="off">
</div>
<div class="field-group">
<label class="field-label">Description <span style="font-size:11px;color:var(--text-muted);">(optional)</span></label>
<textarea class="field-textarea" rows="2" placeholder="What does this workspace do?">Primary production workspace for CRM and e-commerce API operations.</textarea>
<textarea class="field-textarea" id="settings-ws-description" rows="2" placeholder="What does this workspace do?">Primary production workspace for CRM and e-commerce API operations.</textarea>
</div>
<div class="field-row">
<div class="field-group">
<label class="field-label" data-i18n="settings.ws.tz">Timezone</label>
<select class="field-select">
<select class="field-select" id="settings-ws-timezone">
<option selected>UTC</option>
<option>America/New_York</option>
<option>America/Los_Angeles</option>
@@ -162,10 +169,10 @@
</div>
<div class="field-group">
<label class="field-label" data-i18n="settings.ws.protocol">Default protocol</label>
<select class="field-select">
<option selected>REST / HTTP</option>
<option>GraphQL</option>
<option>gRPC</option>
<select class="field-select" id="settings-ws-protocol">
<option value="rest" selected>REST / HTTP</option>
<option value="graphql">GraphQL</option>
<option value="grpc">gRPC</option>
</select>
</div>
</div>
@@ -188,7 +195,7 @@
</div>
<div style="display:flex;justify-content:flex-end;padding-top:4px;">
<button class="btn-primary" type="button"><span data-i18n="btn.save">Save changes</span></button>
<button class="btn-primary" id="settings-ws-save-btn" type="button"><span data-i18n="btn.save">Save changes</span></button>
</div>
</div>
</div>