mirror of
https://github.com/Eugeny/tabby-web.git
synced 2025-06-10 06:29:55 +00:00
wip
This commit is contained in:
parent
6bd5aff8b7
commit
3ff34b2618
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ build
|
||||
*.d.ts
|
||||
.env
|
||||
yarn-error.log
|
||||
static
|
||||
|
@ -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:
|
||||
|
@ -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",
|
||||
|
14
poetry.lock
generated
14
poetry.lock
generated
@ -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"},
|
||||
|
@ -1,5 +1,5 @@
|
||||
[tool.poetry]
|
||||
name = "terminus-web"
|
||||
name = "tabby-web"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = ["Your Name <you@example.com>"]
|
||||
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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<string> {
|
||||
return '{}'
|
||||
return `{
|
||||
recoverTabs: false
|
||||
}`
|
||||
}
|
||||
|
||||
async saveConfig (content: string): Promise<void> {
|
||||
@ -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'
|
||||
|
||||
|
@ -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
|
||||
|
@ -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',
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -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%')
|
||||
|
@ -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,
|
||||
|
@ -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'
|
0
tabby/app/migrations/__init__.py
Normal file
0
tabby/app/migrations/__init__.py
Normal file
@ -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
|
||||
|
@ -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
|
9
tabby/urls.py
Normal file
9
tabby/urls.py
Normal file
@ -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),
|
||||
]
|
7
tabby/wsgi.py
Normal file
7
tabby/wsgi.py
Normal file
@ -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()
|
@ -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),
|
||||
]
|
@ -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()
|
@ -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/
|
||||
},
|
||||
{
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user