diff --git a/.gitignore b/.gitignore index 9a5f6d9..dc0b011 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ # Web vendors (to be installed manually) # see https://github.com/Trehinos/Thor#web-vendors-not-included /web/assets -/app/res/static/assets/vendors # Variables files (created on runtime by the application) /var/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..778659a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "app/res/static/assets/vendors"] + path = app/res/static/assets/vendors + url = ssh://git@asgard.trehinos.eu/Trehinos/thor-web-vendors diff --git a/app/res/config/config.yml b/app/res/config/config.yml index cdaa185..0480e51 100644 --- a/app/res/config/config.yml +++ b/app/res/config/config.yml @@ -1,7 +1,7 @@ app_vendor: Trehinos app_name: Thor -app_version: 0.9.6 -app_version_name: ω +app_version: 1.0.0 +app_version_name: 'Thor v1' env: DEV lang: fr timezone: Europe/Paris diff --git a/app/res/config/security.yml b/app/res/config/security.yml index 38d1429..2df0269 100644 --- a/app/res/config/security.yml +++ b/app/res/config/security.yml @@ -1,6 +1,8 @@ security: true pdo-handler: default security-factory: 'Thor\Framework\Factories\SecurityFactory:produceSecurity' +user-class: 'Thor\Framework\Security\DbUser' +username-field: 'username' firewalls: - pattern: /index.php diff --git a/app/res/config/update.yml b/app/res/config/update.yml index 4dc86c0..2a22c9a 100644 --- a/app/res/config/update.yml +++ b/app/res/config/update.yml @@ -1,6 +1,7 @@ source: 'git@github.com:/Trehinos/Thor.git' +branch: dev composer-command: ~/composer.phar composer-options: '--ignore-platform-reqs' migration-folder: migrations/ -migration-index: 0 +migration-index: 2 after-update: thor/after-update diff --git a/app/res/static/assets/thor/thor.general.js b/app/res/static/assets/thor/thor.general.js index 8d7c13d..454acae 100644 --- a/app/res/static/assets/thor/thor.general.js +++ b/app/res/static/assets/thor/thor.general.js @@ -13,4 +13,17 @@ function loadPage(url, params, callback) { callback(response); } }); -} \ No newline at end of file +} + +const Throttle = { + handler: null, + handle: (func, timeout) => { + if (this.handler !== null) { + clearTimeout(this.handler); + } + this.handler = setTimeout(() => { + func(); + this.handler = null; + }, timeout); + } +}; diff --git a/app/res/static/assets/vendors b/app/res/static/assets/vendors new file mode 160000 index 0000000..a6d71f6 --- /dev/null +++ b/app/res/static/assets/vendors @@ -0,0 +1 @@ +Subproject commit a6d71f602067b8ed66473777df941155b628cf41 diff --git a/app/res/static/commands.yml b/app/res/static/commands.yml index 9d152b4..a25a82c 100644 --- a/app/res/static/commands.yml +++ b/app/res/static/commands.yml @@ -177,4 +177,4 @@ clear/logs: route/list: class: Thor\Framework\Commands\Http\RoutesList - description: 'list all routes in app/res/static/routes.yml' \ No newline at end of file + description: 'list all routes in app/res/static/routes.yml' diff --git a/app/res/static/menu.yml b/app/res/static/menu.yml index 8371715..942aca3 100644 --- a/app/res/static/menu.yml +++ b/app/res/static/menu.yml @@ -3,68 +3,16 @@ route: index-page key: CTRL+F2 - label: Configurations - route: config-not-implemented icon: cogs group: - label: Configuration générale route: config-config icon: cog - - icon: database - route: database-config - label: Bases de données - - icon: shield-alt - route: security-config - label: Securité - - icon: sync - route: config-not-implemented - label: Mises à jour - disabled: true - - icon: image - route: config-not-implemented - label: Twig et assets - disabled: true - divider - - label: Données statiques - icon: file-alt - route: config-not-implemented - disabled: true - - icon: atom - route: config-not-implemented - label: Kernels - disabled: true - - icon: globe - route: config-not-implemented - label: Langues - disabled: true - icon: gavel route: manage-permissions label: users_permissions - - icon: cogs - route: config-not-implemented - label: Paramètres utilisateurs - divider - - icon: play - route: config-not-implemented - label: Tâches - disabled: true - - icon: terminal - route: config-not-implemented - label: Commandes - disabled: true - - divider - - icon: route - route: config-not-implemented - label: Routes - disabled: true - - icon: list - route: config-not-implemented - label: Menu - disabled: true - - divider - - label: Données - icon: database - route: config-not-implemented - disabled: true - label: users icon: users route: users @@ -73,15 +21,6 @@ route: users-table label: Tableau utilisateurs (test) - divider - - icon: cube - route: config-not-implemented - label: Classes PdoTables - disabled: true - - icon: table - route: config-not-implemented - label: Crud - disabled: true - - divider - label: documentation icon: books route: documentation diff --git a/app/res/static/migrations/1-default-create-user.sql b/app/res/static/migrations/1-default-create-user.sql new file mode 100644 index 0000000..3d60855 --- /dev/null +++ b/app/res/static/migrations/1-default-create-user.sql @@ -0,0 +1,16 @@ +CREATE TABLE `user` +( + `public_id` varchar(255) NOT NULL, + `id` int(10) NOT NULL AUTO_INCREMENT, + `username` varchar(255) NOT NULL, + `hash` varchar(255) NOT NULL, + `permissions` JSON NOT NULL, + `parameters` JSON NOT NULL, + + PRIMARY KEY (`id`), + UNIQUE KEY `uniq_public_id` (`public_id`), + UNIQUE KEY `uniq_username` (`username`) +) DEFAULT CHARSET=utf8mb4; + + + diff --git a/app/res/static/migrations/2-default-insert-user.sql b/app/res/static/migrations/2-default-insert-user.sql new file mode 100644 index 0000000..3456db2 --- /dev/null +++ b/app/res/static/migrations/2-default-insert-user.sql @@ -0,0 +1,2 @@ +INSERT INTO `user` (public_id, username, hash, permissions, parameters) +VALUES (HEX(RANDOM_BYTES(16)), 'admin', PASSWORD('password'), '{}', '{}'); diff --git a/app/res/static/migrations/migration_1.yml b/app/res/static/migrations/migration_1.yml deleted file mode 100644 index 88ac853..0000000 --- a/app/res/static/migrations/migration_1.yml +++ /dev/null @@ -1,2 +0,0 @@ -default: - - "UPDATE user SET username='admin' WHERE username='admini'" \ No newline at end of file diff --git a/app/res/views/login.html.twig b/app/res/views/login.html.twig index 3a3befd..d888ad0 100644 --- a/app/res/views/login.html.twig +++ b/app/res/views/login.html.twig @@ -9,38 +9,57 @@ #menu { display: none; } + #footer { position: fixed; width: 100%; text-align: center; height: 60px; } + #content { margin: 0; padding-top: 64px; width: 100%; } + + body { + background: #333; + color: #fff; + } {% endblock %} {% block body_content %} -