ui(admin): too many changes, not enough commits
This commit is contained in:
parent
bca2338863
commit
8aa9641ec2
44 changed files with 1955 additions and 334 deletions
23
resources/scripts/api/admin/nodes/getAllocations.ts
Normal file
23
resources/scripts/api/admin/nodes/getAllocations.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import http from '@/api/http';
|
||||
import { rawDataToServerAllocation } from '@/api/transformers';
|
||||
|
||||
export interface Allocation {
|
||||
id: number;
|
||||
ip: string;
|
||||
alias: string | null;
|
||||
port: number;
|
||||
notes: string | null;
|
||||
isDefault: boolean;
|
||||
}
|
||||
|
||||
export default (uuid: string): Promise<[ Allocation, string[] ]> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(`/api/application/allocations/${uuid}`)
|
||||
.then(({ data }) => resolve([
|
||||
rawDataToServerAllocation(data),
|
||||
// eslint-disable-next-line camelcase
|
||||
data.meta?.is_allocation_owner ? [ '*' ] : (data.meta?.user_permissions || []),
|
||||
]))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue