Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
pre 1.0

See merge request Trehinos/Thor!35
  • Loading branch information
Trehinos committed Mar 26, 2023
2 parents 24f3506 + ca0a6aa commit a3604f8
Show file tree
Hide file tree
Showing 43 changed files with 365 additions and 494 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "app/res/static/assets/vendors"]
path = app/res/static/assets/vendors
url = ssh://[email protected]/Trehinos/thor-web-vendors
4 changes: 2 additions & 2 deletions app/res/config/config.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/res/config/security.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/res/config/update.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source: '[email protected]:/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
15 changes: 14 additions & 1 deletion app/res/static/assets/thor/thor.general.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,17 @@ function loadPage(url, params, callback) {
callback(response);
}
});
}
}

const Throttle = {
handler: null,
handle: (func, timeout) => {
if (this.handler !== null) {
clearTimeout(this.handler);
}
this.handler = setTimeout(() => {
func();
this.handler = null;
}, timeout);
}
};
1 change: 1 addition & 0 deletions app/res/static/assets/vendors
Submodule vendors added at a6d71f
2 changes: 1 addition & 1 deletion app/res/static/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ clear/logs:

route/list:
class: Thor\Framework\Commands\Http\RoutesList
description: 'list all routes in app/res/static/routes.yml'
description: 'list all routes in app/res/static/routes.yml'
61 changes: 0 additions & 61 deletions app/res/static/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
16 changes: 16 additions & 0 deletions app/res/static/migrations/1-default-create-user.sql
Original file line number Diff line number Diff line change
@@ -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;



2 changes: 2 additions & 0 deletions app/res/static/migrations/2-default-insert-user.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO `user` (public_id, username, hash, permissions, parameters)
VALUES (HEX(RANDOM_BYTES(16)), 'admin', PASSWORD('password'), '{}', '{}');
2 changes: 0 additions & 2 deletions app/res/static/migrations/migration_1.yml

This file was deleted.

53 changes: 36 additions & 17 deletions app/res/views/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
{% endblock %}

{% block body_content %}
<div style="width: 400px; margin: auto; text-align: center">
<h1 class="mb-4">
<i class="fas fa-lg fa-sign-in"></i><br>
{{ "users.login.connect"|_({appName}) }}
</h1>
<form method="post" action="{{ url('check') }}">
<div class="form-group">
<label for="username">{{ DICT.users.user }}</label>
<input type="text" id="username" name="username" class="form-control">
</div>
<div class="form-group mt-2">
<label for="password">{{ DICT.users.password }}</label>
<input type="password" id="password" name="password" class="form-control">
<div class="container h-100 position-relative w-100">
<div class="position-absolute w-100" style="bottom: 25%; left: 0;">
<div class="container rounded border border-success p-4 bg-dark text-white">
<div class="row">
<div class="col-md-6 text-start d-flex align-items-center justify-content-center">
<h1 class="text-center">
{{ icon('bolt', 'fad', true, '--fa-secondary-opacity: 1; --fa-primary-color: #fe4; --fa-secondary-color: #fc4;') }}<br>
{{ appName }}
</h1>
</div>
<div class="col-md-6">
<form method="post" action="{{ url('check') }}">
<div class="row">
<div class="col-md-6">
<label for="username">{{ DICT.users.user }}</label>
<input type="text" id="username" name="username" class="form-control">
</div>
<div class="col-md-6">
<label for="password">{{ DICT.users.password }}</label>
<input type="password" id="password" name="password" class="form-control">
</div>
</div>
<button class="btn btn-outline-success mt-3">
<i class="fas fa-sign-in"></i> {{ DICT.users.connect }}
</button>
</form>
</div>
</div>
</div>
<button class="btn btn-outline-primary mt-3">
<i class="fas fa-sign-in"></i> {{ DICT.users.connect }}
</button>
</form>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion app/res/views/menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
function menuClick($elem) {
let url = $elem.data("url");
unselect($("#menu ul li a"));
loadPage(url, null, (response) => {
$elem.addClass("active");
unselect($("#menu ul li a"));
if ($elem.hasClass("dropdown-item")) {
$elem.parent().parent().parent().find("a.dropdown-toggle").addClass("active");
}
Expand Down
73 changes: 0 additions & 73 deletions app/res/views/thor/configuration/database.html.twig

This file was deleted.

Loading

0 comments on commit a3604f8

Please sign in to comment.