Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const showResource = async (yaml: KubeResource, filepath: string, tab: Tab) => {
debug('showing one resource', yaml)
if (Capabilities.inBrowser()) {
injectCSS({
css: require('@kui-shell/plugin-k8s/web/css/main.css').toString(),
key: 'kedit'
})
} else {
const ourRoot = dirname(require.resolve('@kui-shell/plugin-k8s/package.json'))
injectCSS(join(ourRoot, 'web/css/main.css'))
}
// override the type shown in the sidecar header to show the
// resource kind
const typeOverride = yaml.kind
const nameOverride = (resource: KubeResource) => (resource.metadata && resource.metadata.name) || basename(filepath)
// add our mode buttons
const resource = {
kind: yaml.kind,
filepathForDrilldown: filepath,
const showResource = async (yaml, filepath: string, tab: ITab, parsedOptions: ParsedOptions, execOptions: IExecOptions) => {
debug('showing one resource', yaml)
if (inBrowser()) {
injectCSS({ css: require('@kui-shell/plugin-k8s/web/css/main.css').toString(), key: 'kedit' })
} else {
const ourRoot = dirname(require.resolve('@kui-shell/plugin-k8s/package.json'))
injectCSS(join(ourRoot, 'web/css/main.css'))
}
// override the type shown in the sidecar header to show the
// resource kind
const typeOverride = yaml.kind
const nameOverride = (resource: IKubeResource) => (resource.metadata && resource.metadata.name) || basename(filepath)
// add our mode buttons
const resource = { kind: yaml.kind, filepathForDrilldown: filepath, yaml }
const addModeButtons = (defaultMode: string) => response => {
response['modes'] = (response['modes'] || []).concat([
{ mode: 'edit', direct: openAsForm },
{ mode: 'raw', direct: openInEditor },