diff --git a/.gitignore b/.gitignore index a547bf36..56bf7b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,139 @@ dist-ssr *.njsproj *.sln *.sw? + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.env.local +.env.development.local +.env.test.local +.env.production.local + +.bash_history +.bashrc +.init_done +.profile +.sudo_as_admin_successful +.wget-hsts +.git-credentials +.docker/ +.bash_logout + +# VSCode Files +.vscode-server/ + +# Configs +.config/ + +# .dotnet +.dotnet/ + +# .local +.local/ \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index d5f8b403..5e6c4e2b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,8 +19,8 @@ FROM nginx:alpine RUN apk add --no-cache nodejs npm COPY docker/nginx.conf /etc/nginx/nginx.conf COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html -COPY --from=backend-build /backend /backend -COPY --from=backend-build /backend/entrypoint.sh /backend/entrypoint.sh +COPY --from=backend-build src/backend/ /src/backend/ +COPY --from=backend-build src/backend/entrypoint.sh /src/backend/entrypoint.sh # Configure start-up RUN chmod +x /backend/entrypoint.sh diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 563fa9a0..00000000 --- a/src/.gitignore +++ /dev/null @@ -1,149 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -.bash_history -.bashrc -.init_done -.profile -.sudo_as_admin_successful -.wget-hsts -.git-credentials -.docker/ -.bash_logout - -# VSCode Files -.vscode-server/ - -# Configs -.config/ - -# .dotnet -.dotnet/ - -# .local -.local/ \ No newline at end of file diff --git a/src/App.css b/src/App.css index 5b5bd089..779f3eb4 100644 --- a/src/App.css +++ b/src/App.css @@ -7,8 +7,6 @@ .sidebar { display: flex; - flex-shrink: 1; - flex-grow: 1; flex-direction: column; gap: 0.5em; position: fixed; @@ -24,39 +22,49 @@ .topbar { display: flex; - flex-shrink: 0; - flex-grow: 1; flex-direction: row; position: fixed; - justify-content: space-between; align-items: center; - text-align: center; - padding: 30px; + padding: 8px; background-color: #323232; top: 0; left: 14em; right: 0; - width: calc(100% - 14em); - min-height: 36px; - height: auto; - font-size: 16px; - gap: 0.5em; + height: 48px; overflow-x: auto; + gap: 8px; + border-bottom: 1px solid #404040; } -.topbar button { - padding: 0.5em 1em; - background-color: #444; - border: none; +.tab-item { + display: flex; + align-items: center; + gap: 4px; + background: #404040; border-radius: 4px; - color: white; - cursor: pointer; - white-space: nowrap; + padding: 4px; + flex-shrink: 0; /* Prevent tabs from shrinking */ } -.topbar button.active-tab { - background-color: #1a1a1a; - border-bottom: 2px solid white; +.tab-item button { + padding: 6px 12px; + background: none; + border: none; + color: #fff; + cursor: pointer; +} + +.tab-close { + padding: 2px 6px !important; + border-radius: 50%; +} + +.tab-close:hover { + background: #ff5555 !important; +} + +.active-tab { + background: #1a1a1a !important; } .terminal-tab { @@ -66,6 +74,8 @@ right: 0; bottom: 0; display: none; + width: 100%; + height: 100%; } .terminal-tab.active { @@ -74,8 +84,6 @@ .add-host { display: flex; - flex-shrink: 1; - flex-grow: 1; flex-direction: column; justify-content: space-between; position: fixed; @@ -125,7 +133,7 @@ .terminal-wrapper { position: fixed; - top: 96px; + top: 64px; left: 14em; right: 0; bottom: 0; diff --git a/src/App.jsx b/src/App.jsx index 97c7e3ba..cb3be95f 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -31,6 +31,14 @@ function App() { } }; + const closeTab = (id) => { + const newTerminals = terminals.filter(t => t.id !== id); + setTerminals(newTerminals); + if (activeTab === id) { + setActiveTab(newTerminals[0]?.id || null); + } + }; + return ( <>