Skip to content

Commit

Permalink
fix: make content scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
mo4islona committed Apr 10, 2023
1 parent 9b3740d commit e9d5c31
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
12 changes: 1 addition & 11 deletions src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@ import inquirer from 'inquirer';
import yaml from 'js-yaml';
import targz from 'targz';

import {
DeployResponse,
deploySquid,
DeployStatus,
getDeploy,
isVersionExists,
streamSquidLogs,
uploadFile,
} from '../api';
import { CliCommand } from '../command';
import { deploySquid, isVersionExists, uploadFile } from '../api';
import { DeployCommand } from '../deploy-command';
import { Manifest } from '../manifest';
import { doUntil } from '../utils';

const compressAsync = promisify(targz.compress);

Expand Down
1 change: 1 addition & 0 deletions src/ui/components/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class Tabs extends Element {

autoCommandKeys: false,
keys: true,
mouse: true,

style: {
item: {
Expand Down
5 changes: 4 additions & 1 deletion src/ui/components/VersionDbAccessTab.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chalk from 'chalk';
import blessed, { Element } from 'reblessed';

import { chalkMainColor } from '../theme';
import { chalkMainColor, scrollBarTheme } from '../theme';

import { VersionTab } from './Tabs';
import { SquidVersion } from './types';
Expand Down Expand Up @@ -38,6 +38,9 @@ export class VersionDbAccessTab implements VersionTab {
parent.append(
blessed.box({
content: lines.join('\n'),
scrollable: true,
mouse: true,
scrollbar: scrollBarTheme,
}),
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/VersionLogsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import blessed, { Element, List, Log } from 'reblessed';

import { streamSquidLogs, versionHistoryLogs } from '../../api';
import { pretty } from '../../logs';
import { mainColor } from '../theme';
import { mainColor, scrollBarTheme } from '../theme';

import { Loader } from './Loader';
import { VersionTab } from './Tabs';
Expand All @@ -17,7 +17,7 @@ export class VersionLogTab implements VersionTab {
width: '100%',
height: '100%',
scrollable: true,
scrollbar: true,
scrollbar: scrollBarTheme,
alwaysScroll: true,
mouse: true,
style: {
Expand Down
5 changes: 4 additions & 1 deletion src/ui/components/VersionSummaryTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import chalk from 'chalk';
import bytes from 'pretty-bytes';
import blessed, { Element } from 'reblessed';

import { chalkMainColor } from '../theme';
import { chalkMainColor, scrollBarTheme } from '../theme';

import { VersionTab } from './Tabs';
import { SquidVersion } from './types';
Expand Down Expand Up @@ -45,6 +45,9 @@ export class VersionSummaryTab implements VersionTab {
parent.append(
blessed.box({
content: lines.join('\n'),
scrollable: true,
mouse: true,
scrollbar: scrollBarTheme,
}),
);
}
Expand Down
10 changes: 10 additions & 0 deletions src/ui/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import chalk from 'chalk';

export const mainColor = 'blue';
export const chalkMainColor = chalk.blue;
export const mainLightColor = 'bright-blue';

export const defaultBoxTheme = {
tags: true,
Expand All @@ -19,3 +20,12 @@ export const defaultBoxTheme = {
},
},
};

export const scrollBarTheme = {
style: {
bg: mainLightColor,
},
track: {
bg: mainColor,
},
};

0 comments on commit e9d5c31

Please sign in to comment.