chore: run prettier
This commit is contained in:
parent
9cdbbc3a00
commit
155d7bb876
76 changed files with 788 additions and 550 deletions
|
@ -1,30 +1,27 @@
|
|||
import http from '@/api/http';
|
||||
import { Egg, rawDataToEgg } from '@/api/admin/eggs/getEgg';
|
||||
|
||||
type Egg2 = Omit<Omit<Partial<Egg>, 'configFiles'>, 'configStartup'> & { configFiles: string, configStartup: string };
|
||||
type Egg2 = Omit<Omit<Partial<Egg>, 'configFiles'>, 'configStartup'> & { configFiles: string; configStartup: string };
|
||||
|
||||
export default (egg: Partial<Egg2>): Promise<Egg> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post(
|
||||
'/api/application/eggs',
|
||||
{
|
||||
nest_id: egg.nestId,
|
||||
name: egg.name,
|
||||
description: egg.description,
|
||||
features: egg.features,
|
||||
docker_images: egg.dockerImages,
|
||||
config_files: egg.configFiles,
|
||||
config_startup: egg.configStartup,
|
||||
config_stop: egg.configStop,
|
||||
config_from: egg.configFrom,
|
||||
startup: egg.startup,
|
||||
script_container: egg.scriptContainer,
|
||||
copy_script_from: egg.copyScriptFrom,
|
||||
script_entry: egg.scriptEntry,
|
||||
script_is_privileged: egg.scriptIsPrivileged,
|
||||
script_install: egg.scriptInstall,
|
||||
},
|
||||
)
|
||||
http.post('/api/application/eggs', {
|
||||
nest_id: egg.nestId,
|
||||
name: egg.name,
|
||||
description: egg.description,
|
||||
features: egg.features,
|
||||
docker_images: egg.dockerImages,
|
||||
config_files: egg.configFiles,
|
||||
config_startup: egg.configStartup,
|
||||
config_stop: egg.configStop,
|
||||
config_from: egg.configFrom,
|
||||
startup: egg.startup,
|
||||
script_container: egg.scriptContainer,
|
||||
copy_script_from: egg.copyScriptFrom,
|
||||
script_entry: egg.scriptEntry,
|
||||
script_is_privileged: egg.scriptIsPrivileged,
|
||||
script_install: egg.scriptInstall,
|
||||
})
|
||||
.then(({ data }) => resolve(rawDataToEgg(data)))
|
||||
.catch(reject);
|
||||
});
|
||||
|
|
|
@ -5,18 +5,15 @@ import { Transformers } from '@definitions/admin';
|
|||
export type CreateEggVariable = Omit<EggVariable, 'id' | 'eggId' | 'createdAt' | 'updatedAt' | 'relationships'>;
|
||||
|
||||
export default async (eggId: number, variable: CreateEggVariable): Promise<EggVariable> => {
|
||||
const { data } = await http.post(
|
||||
`/api/application/eggs/${eggId}/variables`,
|
||||
{
|
||||
name: variable.name,
|
||||
description: variable.description,
|
||||
env_variable: variable.environmentVariable,
|
||||
default_value: variable.defaultValue,
|
||||
user_viewable: variable.isUserViewable,
|
||||
user_editable: variable.isUserEditable,
|
||||
rules: variable.rules,
|
||||
},
|
||||
);
|
||||
const { data } = await http.post(`/api/application/eggs/${eggId}/variables`, {
|
||||
name: variable.name,
|
||||
description: variable.description,
|
||||
env_variable: variable.environmentVariable,
|
||||
default_value: variable.defaultValue,
|
||||
user_viewable: variable.isUserViewable,
|
||||
user_editable: variable.isUserEditable,
|
||||
rules: variable.rules,
|
||||
});
|
||||
|
||||
return Transformers.toEggVariable(data);
|
||||
};
|
||||
|
|
|
@ -1,30 +1,27 @@
|
|||
import http from '@/api/http';
|
||||
import { Egg, rawDataToEgg } from '@/api/admin/eggs/getEgg';
|
||||
|
||||
type Egg2 = Omit<Omit<Partial<Egg>, 'configFiles'>, 'configStartup'> & { configFiles?: string, configStartup?: string };
|
||||
type Egg2 = Omit<Omit<Partial<Egg>, 'configFiles'>, 'configStartup'> & { configFiles?: string; configStartup?: string };
|
||||
|
||||
export default (id: number, egg: Partial<Egg2>): Promise<Egg> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.patch(
|
||||
`/api/application/eggs/${id}`,
|
||||
{
|
||||
nest_id: egg.nestId,
|
||||
name: egg.name,
|
||||
description: egg.description,
|
||||
features: egg.features,
|
||||
docker_images: egg.dockerImages,
|
||||
config_files: egg.configFiles,
|
||||
config_startup: egg.configStartup,
|
||||
config_stop: egg.configStop,
|
||||
config_from: egg.configFrom,
|
||||
startup: egg.startup,
|
||||
script_container: egg.scriptContainer,
|
||||
copy_script_from: egg.copyScriptFrom,
|
||||
script_entry: egg.scriptEntry,
|
||||
script_is_privileged: egg.scriptIsPrivileged,
|
||||
script_install: egg.scriptInstall,
|
||||
},
|
||||
)
|
||||
http.patch(`/api/application/eggs/${id}`, {
|
||||
nest_id: egg.nestId,
|
||||
name: egg.name,
|
||||
description: egg.description,
|
||||
features: egg.features,
|
||||
docker_images: egg.dockerImages,
|
||||
config_files: egg.configFiles,
|
||||
config_startup: egg.configStartup,
|
||||
config_stop: egg.configStop,
|
||||
config_from: egg.configFrom,
|
||||
startup: egg.startup,
|
||||
script_container: egg.scriptContainer,
|
||||
copy_script_from: egg.copyScriptFrom,
|
||||
script_entry: egg.scriptEntry,
|
||||
script_is_privileged: egg.scriptIsPrivileged,
|
||||
script_install: egg.scriptInstall,
|
||||
})
|
||||
.then(({ data }) => resolve(rawDataToEgg(data)))
|
||||
.catch(reject);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,10 @@ import http from '@/api/http';
|
|||
import { EggVariable } from '@/api/admin/egg';
|
||||
import { Transformers } from '@definitions/admin';
|
||||
|
||||
export default async (eggId: number, variables: Omit<EggVariable, 'eggId' | 'createdAt' | 'updatedAt'>[]): Promise<EggVariable[]> => {
|
||||
export default async (
|
||||
eggId: number,
|
||||
variables: Omit<EggVariable, 'eggId' | 'createdAt' | 'updatedAt'>[],
|
||||
): Promise<EggVariable[]> => {
|
||||
const { data } = await http.patch(
|
||||
`/api/application/eggs/${eggId}/variables`,
|
||||
variables.map(variable => ({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue