v0.5.104: админ видит (личное) у своих компаний в dropdown

This commit is contained in:
2026-06-15 13:41:01 +04:00
parent f00b7f3e87
commit 2545bc97f1
4 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ipwhitelist",
"version": "0.5.103",
"version": "0.5.104",
"description": "IP WhiteList microservice for cloud provider",
"main": "server.js",
"scripts": {
+1 -1
View File
@@ -9,7 +9,7 @@
// ═══════════════════════════════════════════════════════════════════════════════
module.exports = {
version: '0.5.100',
version: '0.5.101',
// ── IAM ──────────────────────────────────────────────────────────────────
iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user',
+2
View File
@@ -51,10 +51,12 @@ function createUserRouter() {
let companies;
if (isAdmin) {
const all = await q.getAllCompanies();
const ownIds = new Set(req.allClientIds || []);
companies = all.map(c => ({
client_id: c.client_id,
name: c.name || c.client_id,
active_count: c.active_count,
isPersonal: ownIds.has(c.client_id),
}));
} else {
companies = (req.profiles && req.profiles.length > 0)
+1 -1
View File
@@ -170,7 +170,7 @@
<select name="switchTo" onchange="this.form.submit()">
<% companies.forEach(function(c) { %>
<option value="<%= c.client_id %>" <%= c.client_id === activeClientId ? 'selected' : '' %>>
<%= c.name %> (<%= c.client_id %>)<% if (c.active_count != null) { %> — <%= c.active_count %> зап.<% } %>
<%= c.name %> (<%= c.client_id %>)<% if (c.isPersonal) { %> (личное)<% } %><% if (c.active_count != null) { %> — <%= c.active_count %> зап.<% } %>
</option>
<% }) %>
</select>