Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions sqli/services/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@


def setup_database(app: Application):
# create connection to the database
app.on_startup.append(_init_pg)
# shutdown db connection on exit
app.on_cleanup.append(_close_pg)


async def _init_pg(app: Application):
conf = app['config']['db']

dsn = (
'dbname={database} user={user} password={password} host={host} port={port}'
'dbname={database} user={user} password=<SECRET> host={host} port={port}'
.format(**conf)
)
db = await aiopg.create_pool(dsn)
Expand Down
3 changes: 1 addition & 2 deletions sqli/services/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def setup_redis(app: Application):

async def _init_redis(app: Application):
conf = app['config']['redis']
redis = await aioredis.create_pool((conf['host'], conf['port']),
db=conf['db'])
redis = await aioredis.create_pool((conf['host'], conf['port']), db=conf['db'])
app['redis'] = redis


Expand Down
32 changes: 27 additions & 5 deletions sqli/static/js/materialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -5914,18 +5914,35 @@ if (jQuery) {
}
};

var closeFABMenu = function (btn) {
var $this = btn;
const closeFABMenu = function (btn) {
const $this = $(btn);
// Get direction option
var horizontal = $this.hasClass('horizontal');
var offsetY, offsetX;
const horizontal = $this.hasClass('horizontal');
let offsetY, offsetX;

if (horizontal === true) {
offsetX = 40;
} else {
offsetY = 40;
}

try {
if (horizontal === true) {
$this.find('ul .btn-floating').velocity(
{ translateY: 0, translateX: offsetX },
{ duration: 0 }
);
} else {
$this.find('ul .btn-floating').velocity(
{ translateY: offsetY, translateX: 0 },
{ duration: 0 }
);
}
} catch (error) {
console.error('Error in closeFABMenu:', error);
}
}

$this.removeClass('active');
var time = 0;
$this.find('ul .btn-floating').velocity("stop", true);
Expand Down Expand Up @@ -5988,7 +6005,8 @@ if (jQuery) {
transition: 'transform .2s'
});

setTimeout(function () {
const ANIMATION_DELAY = 100;
const animateMenu = () => {
btn.css({
overflow: 'hidden',
'background-color': fabColor
Expand All @@ -5998,6 +6016,10 @@ if (jQuery) {
transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
});
menu.find('> li > a').css({
};

// Use requestAnimationFrame for better performance and to avoid potential race conditions
requestAnimationFrame(animateMenu);
opacity: 1
});

Expand Down