kui-shell
Version:
This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool
33 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const { modCmd } = require('./util');
const _modes = [
{ mode: 'get', label: 'About' },
{ mode: 'api', label: 'API' },
{ mode: 'config', label: 'Configure' }
].map(_ => Object.assign(_, {
onclick: false,
command: ({ name }) => `${modCmd} ${_.mode} "${name}"`
}));
const buttons = [
{
mode: 'status',
label: 'Status',
fontawesome: 'fas fa-info-circle',
balloon: 'Detailed status',
balloonLength: 'medium',
actAsButton: true,
flush: 'right',
echo: true,
noHistory: false,
command: ({ name }) => `${modCmd}
status "${name}"`
}
];
exports.modes = (defaultMode, api, choices) => {
const modes = _modes
.filter(({ mode }) => mode === 'get' || (mode === 'api' && api) || (mode === 'config' && choices))
.map(_ => (_.mode === defaultMode ? Object.assign({}, _, { defaultMode: true }) : _));
return modes.concat(buttons);
};
//# sourceMappingURL=modes.js.map