Skip to content

Commit 9536f0c

Browse files
committed
Fix info/inspect of stacklet
1 parent 8044bfa commit 9536f0c

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

bin/dropstack-inspect

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,44 +54,48 @@ function inspect({name, save}) {
5454
type: data ? data.serviceType : settings.type,
5555
stateful: data ? data.serviceStateful : settings.stateful,
5656
variables: data ? (data.serviceVariables || []).join(',') : settings.variables,
57-
serviceUrl: data ? data.serviceUrl : settings.url,
57+
serviceUrl: data ? data.serviceUrl : settings.serviceUrl,
58+
alias: data ? data.serviceAlias : settings.alias,
59+
domain: data ? data.serviceDomain : settings.domain,
5860
excludes: data ? data.serviceExcludes : settings.excludes || [],
59-
mappings: data ? data.serviceMappings : settings.mappings || []
61+
mappings: data ? data.serviceMappings : settings.mappings || [],
62+
ssl_key: data ? data.ssl_key : settings.ssl_key,
63+
ssl_cert: data ? data.ssl_cert : settings.ssl_cert
6064
})
6165
)
6266
)
6367
.then(data => {
6468
let message = chalk.green(`Service informations for ${chalk.bold(data.name)}\n\n`);
65-
message += chalk.gray(`URL : ${chalk.white(`https://${data.serviceUrl.replace('https://', '')}`)}\n`);
66-
message += chalk.gray(`Type : ${chalk.white(`${data.type.toUpperCase()}`)}\n`);
67-
message += chalk.gray(`Stateful : ${chalk.white(`${Boolean(data.stateful)}`)}\n`);
68-
message += chalk.gray(`Instances : ${chalk.white(`${data.instances}`)}\n`);
69-
message += chalk.gray(`Domain : ${chalk.white(`${data.domain || data.alias || '-'}`)}\n`);
70-
message += chalk.gray(`Alias : ${chalk.white(`${data.alias || '-'}`)}\n`);
71-
if (data.createdAt) message += chalk.gray(`Created : ${chalk.white(`${new Date(data.createdAt)}`)}\n`);
72-
if (data.modifiedAt) message += chalk.gray(`Modified : ${chalk.white(`${new Date(data.modifiedAt)}`)}\n`);
69+
message += chalk.gray(`URL : ${chalk.white(`${data.serviceUrl.replace('https://', '')}`)}\n`);
70+
message += chalk.gray(`Type : ${chalk.white(`${data.type.toUpperCase()}`)}\n`);
71+
message += chalk.gray(`Stateful : ${chalk.white(`${Boolean(data.stateful)}`)}\n`);
72+
message += chalk.gray(`Instances : ${chalk.white(`${data.instances}`)}\n`);
73+
message += chalk.gray(`Domain/Alias : ${chalk.white(`${data.domain || data.alias || '-'}`)}\n`);
74+
message += chalk.gray(`Custom SSL : ${chalk.white(`${Boolean(data.ssl_key) && Boolean(data.ssl_cert)}`)}\n`);
75+
if (data.createdAt) message += chalk.gray(`Created : ${chalk.white(`${new Date(data.createdAt)}`)}\n`);
76+
if (data.modifiedAt) message += chalk.gray(`Modified : ${chalk.white(`${new Date(data.modifiedAt)}`)}\n`);
7377

74-
if (!data.variables) message += chalk.gray(`\nVariables : ${chalk.white('-')}`);
78+
if (!data.variables) message += chalk.gray(`\nVariables : ${chalk.white('-')}`);
7579
if (data.variables) {
7680
data.variables.split(',').forEach(variable => {
77-
message += chalk.gray(`\nVariables : ${chalk.white(`${variable}`)}`);
81+
message += chalk.gray(`\nVariables : ${chalk.white(`${variable}`)}`);
7882
});
7983
}
8084

81-
if (!data.excludes) message += chalk.gray(`\nExcludes : ${chalk.white('-')}`);
85+
if (!data.excludes) message += chalk.gray(`\nExcludes : ${chalk.white('-')}`);
8286
if (data.excludes) {
8387
message += '\n';
8488
data.excludes.forEach(exclude => {
85-
message += chalk.gray(`\nExcludes : ${chalk.white(`${exclude}`)}`);
89+
message += chalk.gray(`\nExcludes : ${chalk.white(`${exclude}`)}`);
8690
});
8791
}
8892

89-
if (!data.mappings) message += chalk.gray(`\nMappings : ${chalk.white('-')}`);
93+
if (!data.mappings) message += chalk.gray(`\nMappings : ${chalk.white('-')}`);
9094
if (data.mappings) {
9195
message += '\n';
9296
Object.keys(data.mappings).forEach(mapping => {
9397
message += chalk.gray(
94-
`\nMapping : ${chalk.white(mapping)} ${chalk.gray('->')} ${chalk.white(`${data.mappings[mapping]}`)}`
98+
`\nMapping : ${chalk.white(mapping)} ${chalk.gray('->')} ${chalk.white(`${data.mappings[mapping]}`)}`
9599
);
96100
});
97101
}

0 commit comments

Comments
 (0)