diff --git a/.gitignore b/.gitignore index 7a35e79..38bbb07 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ build *.d.ts .env yarn-error.log +static diff --git a/manage.py b/manage.py index 40a3ac4..e367650 100755 --- a/manage.py +++ b/manage.py @@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'terminus.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tabby.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/package.json b/package.json index c5b96d0..8dca051 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@fortawesome/free-solid-svg-icons": "^5.15.3", "@ng-bootstrap/ng-bootstrap": "11.0.0-beta.1", "@ngtools/webpack": "^12.0.4", - "@terminus-term/to-string-loader": "^1.1.7-beta.1", + "@tabby-gang/to-string-loader": "^1.1.7-beta.1", "@types/node": "^11.9.5", "apply-loader": "^2.0.0", "awesome-typescript-loader": "^5.2.1", diff --git a/poetry.lock b/poetry.lock index 03edad9..9409364 100644 --- a/poetry.lock +++ b/poetry.lock @@ -144,6 +144,14 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +[[package]] +name = "dj-database-url" +version = "0.5.0" +description = "Use Database URLs in your Django Application." +category = "main" +optional = false +python-versions = "*" + [[package]] name = "django" version = "3.2.3" @@ -653,7 +661,7 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "7ddd4096097eb58dc20601d3334a56507c893607ff156155070c4c865108c563" +content-hash = "68dc9c46c30477fc44a54fe157921c2e5a8efac1f1bdb42bfe0de0a4c8595f46" [metadata.files] asgiref = [ @@ -753,6 +761,10 @@ defusedxml = [ {file = "defusedxml-0.7.1-py2.py3-none-any.whl", hash = "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61"}, {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, ] +dj-database-url = [ + {file = "dj-database-url-0.5.0.tar.gz", hash = "sha256:4aeaeb1f573c74835b0686a2b46b85990571159ffc21aa57ecd4d1e1cb334163"}, + {file = "dj_database_url-0.5.0-py2.py3-none-any.whl", hash = "sha256:851785365761ebe4994a921b433062309eb882fedd318e1b0fcecc607ed02da9"}, +] django = [ {file = "Django-3.2.3-py3-none-any.whl", hash = "sha256:7e0a1393d18c16b503663752a8b6790880c5084412618990ce8a81cc908b4962"}, {file = "Django-3.2.3.tar.gz", hash = "sha256:13ac78dbfd189532cad8f383a27e58e18b3d33f80009ceb476d7fcbfc5dcebd8"}, diff --git a/pyproject.toml b/pyproject.toml index 16a9ef7..ebf0246 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "terminus-web" +name = "tabby-web" version = "0.1.0" description = "" authors = ["Your Name "] @@ -15,6 +15,7 @@ social-auth-app-django = "^4.0.0" python-dotenv = "^0.17.1" websockets = "^9.1" gql = "^2.0.0" +dj-database-url = "^0.5.0" [tool.poetry.dev-dependencies] flake8 = "^3.9.2" diff --git a/src/components/home.component.pug b/src/components/home.component.pug index ee721d2..623cc48 100644 --- a/src/components/home.component.pug +++ b/src/components/home.component.pug @@ -73,7 +73,7 @@ ul li Multiple #[strong nested panes] li #[strong Progress bars] and activity notifications for tabs - li Terminus remembers open tabs and panes where you left off + li Tabby remembers open tabs and panes where you left off li Tabs on #[strong any side of the window] li Optional #[strong quake mode] (terminal docked to a side of the screen) li Optional #[strong global hotkey] to focus/hide the terminal diff --git a/src/components/home.component.ts b/src/components/home.component.ts index fa609df..dcec657 100644 --- a/src/components/home.component.ts +++ b/src/components/home.component.ts @@ -8,11 +8,13 @@ import { ActivatedRoute } from '@angular/router' class DemoConnector { constructor (targetWindow: Window, private version: Version) { - targetWindow['terminusWebDemoDataPath'] = `${this.getDistURL()}/${version.version}/terminus-web-demo/data` + targetWindow['tabbyWebDemoDataPath'] = `${this.getDistURL()}/${version.version}/tabby-web-demo/data` } async loadConfig (): Promise { - return '{}' + return `{ + recoverTabs: false + }` } async saveConfig (content: string): Promise { @@ -28,12 +30,12 @@ class DemoConnector { getPluginsToLoad (): string[] { return [ - 'terminus-core', - 'terminus-settings', - 'terminus-terminal', - 'terminus-community-color-schemes', - 'terminus-web', - 'terminus-web-demo', + 'tabby-core', + 'tabby-settings', + 'tabby-terminal', + 'tabby-community-color-schemes', + 'tabby-web', + 'tabby-web-demo', ] } } @@ -46,7 +48,7 @@ class DemoConnector { export class HomeComponent { @ViewChild('iframe') iframe: ElementRef connector: DemoConnector - githubURL = 'https://github.com/Eugeny/terminus' + githubURL = 'https://github.com/Eugeny/tabby' releaseURL = `${this.githubURL}/releases/latest` donationURL = 'https://ko-fi.com/eugeny' diff --git a/src/index.pug b/src/index.pug index 1de7191..bcac3ff 100644 --- a/src/index.pug +++ b/src/index.pug @@ -4,6 +4,6 @@ html base(href='/') meta(name='viewport', content='initial-scale=1, minimal-ui, shrink-to-fit=no') script(src='/build/index.js', defer) - title Terminus + title Tabby body app diff --git a/src/services/appConnector.service.ts b/src/services/appConnector.service.ts index 2f8dc74..f41fdf5 100644 --- a/src/services/appConnector.service.ts +++ b/src/services/appConnector.service.ts @@ -125,12 +125,12 @@ export class AppConnectorService { getPluginsToLoad (): string[] { return [ - 'terminus-core', - 'terminus-settings', - 'terminus-terminal', - 'terminus-ssh', - 'terminus-community-color-schemes', - 'terminus-web', + 'tabby-core', + 'tabby-settings', + 'tabby-terminal', + 'tabby-ssh', + 'tabby-community-color-schemes', + 'tabby-web', ] } diff --git a/src/terminal.pug b/src/terminal.pug index f86eae9..d4f1918 100644 --- a/src/terminal.pug +++ b/src/terminal.pug @@ -1,5 +1,5 @@ doctype html -html.terminus +html.tabby head meta(charset='UTF-8') script(src='/build/terminal.js') @@ -10,8 +10,8 @@ html.terminus app-root(style='display: none') .preload-logo div - .terminus-logo - h1.terminus-title Terminus + .tabby-logo + h1.tabby-title Tabby sup α .progress .bar(style='width: 0%') diff --git a/src/terminal.ts b/src/terminal.ts index bdb06ba..a4b6fc3 100644 --- a/src/terminal.ts +++ b/src/terminal.ts @@ -31,17 +31,17 @@ async function start () { await webRequire(`${baseUrl}/web/dist/preload.js`) await webRequire(`${baseUrl}/web/dist/bundle.js`) - const terminus = window['Terminus'] + const tabby = window['Tabby'] const pluginModules = [] for (const plugin of connector.getPluginsToLoad()) { - pluginModules.push(await terminus.loadPlugin(`${baseUrl}/${plugin}`)) + pluginModules.push(await tabby.loadPlugin(`${baseUrl}/${plugin}`)) } document.querySelector('app-root')['style'].display = 'flex' const config = connector.loadConfig() - terminus.bootstrap({ + tabby.bootstrap({ packageModules: pluginModules, bootstrapData: { config, diff --git a/terminus/__init__.py b/static/.gitkeep similarity index 100% rename from terminus/__init__.py rename to static/.gitkeep diff --git a/terminus/app/__init__.py b/tabby/__init__.py similarity index 100% rename from terminus/app/__init__.py rename to tabby/__init__.py diff --git a/terminus/app/migrations/__init__.py b/tabby/app/__init__.py similarity index 100% rename from terminus/app/migrations/__init__.py rename to tabby/app/__init__.py diff --git a/terminus/app/admin.py b/tabby/app/admin.py similarity index 100% rename from terminus/app/admin.py rename to tabby/app/admin.py diff --git a/terminus/app/api.py b/tabby/app/api.py similarity index 100% rename from terminus/app/api.py rename to tabby/app/api.py diff --git a/terminus/app/apps.py b/tabby/app/apps.py similarity index 82% rename from terminus/app/apps.py rename to tabby/app/apps.py index 50516e5..296cbf2 100644 --- a/terminus/app/apps.py +++ b/tabby/app/apps.py @@ -1,5 +1,6 @@ from django.apps import AppConfig + class AppConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' - name = 'terminus.app' + name = 'tabby.app' diff --git a/terminus/app/consumers.py b/tabby/app/consumers.py similarity index 100% rename from terminus/app/consumers.py rename to tabby/app/consumers.py diff --git a/terminus/app/migrations/0001_initial.py b/tabby/app/migrations/0001_initial.py similarity index 100% rename from terminus/app/migrations/0001_initial.py rename to tabby/app/migrations/0001_initial.py diff --git a/terminus/app/migrations/0002_auto_20210605_2137.py b/tabby/app/migrations/0002_auto_20210605_2137.py similarity index 100% rename from terminus/app/migrations/0002_auto_20210605_2137.py rename to tabby/app/migrations/0002_auto_20210605_2137.py diff --git a/terminus/app/migrations/0003_user_custom_connection_gateway.py b/tabby/app/migrations/0003_user_custom_connection_gateway.py similarity index 100% rename from terminus/app/migrations/0003_user_custom_connection_gateway.py rename to tabby/app/migrations/0003_user_custom_connection_gateway.py diff --git a/terminus/app/migrations/0004_user_custom_connection_gateway_token.py b/tabby/app/migrations/0004_user_custom_connection_gateway_token.py similarity index 100% rename from terminus/app/migrations/0004_user_custom_connection_gateway_token.py rename to tabby/app/migrations/0004_user_custom_connection_gateway_token.py diff --git a/tabby/app/migrations/__init__.py b/tabby/app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/terminus/app/models.py b/tabby/app/models.py similarity index 100% rename from terminus/app/models.py rename to tabby/app/models.py diff --git a/terminus/app/sponsors.py b/tabby/app/sponsors.py similarity index 100% rename from terminus/app/sponsors.py rename to tabby/app/sponsors.py diff --git a/terminus/app/tests.py b/tabby/app/tests.py similarity index 100% rename from terminus/app/tests.py rename to tabby/app/tests.py diff --git a/terminus/app/urls.py b/tabby/app/urls.py similarity index 100% rename from terminus/app/urls.py rename to tabby/app/urls.py diff --git a/terminus/app/views.py b/tabby/app/views.py similarity index 100% rename from terminus/app/views.py rename to tabby/app/views.py diff --git a/terminus/asgi.py b/tabby/asgi.py similarity index 84% rename from terminus/asgi.py rename to tabby/asgi.py index 8b18cf0..8a5467b 100644 --- a/terminus/asgi.py +++ b/tabby/asgi.py @@ -4,7 +4,7 @@ from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'terminus.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tabby.settings') from .app.urls import websocket_urlpatterns diff --git a/terminus/settings.py b/tabby/settings.py similarity index 93% rename from terminus/settings.py rename to tabby/settings.py index a36aac6..2b16a55 100644 --- a/terminus/settings.py +++ b/tabby/settings.py @@ -1,4 +1,5 @@ import os +import dj_database_url from dotenv import load_dotenv from pathlib import Path @@ -32,7 +33,7 @@ INSTALLED_APPS = [ 'channels', 'rest_framework', 'social_django', - 'terminus.app', + 'tabby.app', ] MIDDLEWARE = [ @@ -45,7 +46,7 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'terminus.urls' +ROOT_URLCONF = 'tabby.urls' TEMPLATES = [ { @@ -63,18 +64,15 @@ TEMPLATES = [ }, ] -ASGI_APPLICATION = 'terminus.asgi.application' -WSGI_APPLICATION = 'terminus.wsgi.application' +ASGI_APPLICATION = 'tabby.asgi.application' +WSGI_APPLICATION = 'tabby.wsgi.application' # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - } + 'default': dj_database_url.config(conn_max_age=600) } @@ -116,6 +114,8 @@ USE_TZ = True # https://docs.djangoproject.com/en/3.2/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = BASE_DIR / 'static' +STATICFILES_DIRS = [BASE_DIR / 'build'] # Default primary key field type # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field diff --git a/tabby/urls.py b/tabby/urls.py new file mode 100644 index 0000000..9e9c46b --- /dev/null +++ b/tabby/urls.py @@ -0,0 +1,9 @@ +from django.contrib import admin +from django.urls import path, include +from .app.urls import urlpatterns + +urlpatterns = [ + path('', include(urlpatterns)), + path('api/1/auth/social/', include('social_django.urls', namespace='social')), + path('admin/', admin.site.urls), +] diff --git a/tabby/wsgi.py b/tabby/wsgi.py new file mode 100644 index 0000000..7c90597 --- /dev/null +++ b/tabby/wsgi.py @@ -0,0 +1,7 @@ +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tabby.settings') + +application = get_wsgi_application() diff --git a/terminus/urls.py b/terminus/urls.py deleted file mode 100644 index acd111b..0000000 --- a/terminus/urls.py +++ /dev/null @@ -1,24 +0,0 @@ -"""terminus URL Configuration - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/3.2/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" -from django.contrib import admin -from django.urls import path, include -from .app.urls import urlpatterns - -urlpatterns = [ - path('', include(urlpatterns)), - path('api/1/auth/social/', include('social_django.urls', namespace='social')), - path('admin/', admin.site.urls), -] diff --git a/terminus/wsgi.py b/terminus/wsgi.py deleted file mode 100644 index 39c7ea2..0000000 --- a/terminus/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for terminus project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'terminus.settings') - -application = get_wsgi_application() diff --git a/webpack.config.js b/webpack.config.js index 45df1d9..cd39c56 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -32,7 +32,7 @@ module.exports = { test: /\.[jt]sx?$/, loader: '@ngtools/webpack', }, - { test: /terminus\/app\/dist/, use: ['script-loader'] }, + { test: /tabby\/app\/dist/, use: ['script-loader'] }, { test: /\.pug$/, use: ['apply-loader', 'pug-loader'], @@ -40,7 +40,7 @@ module.exports = { }, { test: /\.scss$/, - use: ['@terminus-term/to-string-loader', 'css-loader', 'sass-loader'], + use: ['@tabby-gang/to-string-loader', 'css-loader', 'sass-loader'], include: /component\.scss/ }, { diff --git a/yarn.lock b/yarn.lock index ce062c4..52a34ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -335,10 +335,10 @@ dependencies: enhanced-resolve "5.7.0" -"@terminus-term/to-string-loader@^1.1.7-beta.1": - version "1.1.7-beta.1" - resolved "https://registry.yarnpkg.com/@terminus-term/to-string-loader/-/to-string-loader-1.1.7-beta.1.tgz#5a622830a7f12ebbb2e2c600c621f586259dc7fe" - integrity sha512-mYUDUYkEKpr/mS4LucALv4QKHsF8xWXcYChQdN2nZIXCoXJoBQFsQPSzdcAeCzbl/XDsyop/mI5vIA34RnDd0Q== +"@tabby-gang/to-string-loader@^1.1.7-beta.1": + version "1.1.7-beta.2" + resolved "https://registry.yarnpkg.com/@tabby-gang/to-string-loader/-/to-string-loader-1.1.7-beta.2.tgz#5519ec87d5b3a49998e74d01c26c269770be50c8" + integrity sha512-2hgj8KMl2Qm4dcruu1iFZqeIMXLvMpNrEKIDjEjei5NbQ/aOagOozPQV4B/jlTDybiLiXzx33Ys6Xj/8tVXZMw== dependencies: loader-utils "^1.0.0"