From 10de4b539c82fce09b765700d217002c01279201 Mon Sep 17 00:00:00 2001 From: Frogg Date: Thu, 7 May 2026 10:59:29 +0200 Subject: [PATCH] =?UTF-8?q?Ajustement=20de=20couleur=20et=20am=C3=A9liorat?= =?UTF-8?q?ion=20d'affichage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 777-welcome.sh | 4 +++- TODO.md | 50 ++++++++++++++++++++++------------------- config/config_colors.sh | 3 +++ func/message.sh | 4 ++-- func/message_display.sh | 26 ++++++++++----------- func/system_info.sh | 39 +++++++++++++++++++++----------- inc/infos.sh | 2 +- inc/ps1.sh | 11 +++++---- inc/warnings.sh | 6 ++--- 9 files changed, 85 insertions(+), 60 deletions(-) diff --git a/777-welcome.sh b/777-welcome.sh index 5b70683..aa5a7c0 100755 --- a/777-welcome.sh +++ b/777-welcome.sh @@ -58,5 +58,7 @@ display_dashboard ################ if [[ $HAS_WELCOME_CONF_ERROR -eq 1 ]];then - msg_error "TODO PROPOSER UNE INSTALL DE CE QUI MANQUE" + msg_error "❎ TODO PROPOSER UNE INSTALL DE CE QUI MANQUE" + msg_error "faire une commande avec proposition, et l autre action pour mettre en place les propositions" + msg_error "basées sur les choses trouvées sur le systeme" fi \ No newline at end of file diff --git a/TODO.md b/TODO.md index c227fad..9d68ba4 100644 --- a/TODO.md +++ b/TODO.md @@ -1,20 +1,11 @@ -# ZABBIX -- config Proxmox (dl le template) -- config ndv -- config gita - - +# BUG +> PS1 quand on remonte l historique peut bug +> Si bare sur deux ligne bug du couleur fond +> # SCRIPT -- VARIABLE SUPER GLOBALE POUR EVITER LE MAIL A CHAQUE WELCOME -- verifier si git est installé -- verifier si Zabbix agent est installé -- n'afficher que les services présents -- ajouter le service de la base de gitea -- faire le redirect port 80 -- ajouter https sur gitea -- faire la connexion git sans faire pass a chaque fois +- VERIF SI NOM DE L ENV DISPO - faire un menu tool d install - dont : - confg mail @@ -22,10 +13,21 @@ - conf ip - conf nom de machine - menu qui propose des choix + - faire la connexion git sans faire pass a chaque fois en script -# SERVER -- mettre les scripts sur tous les linux +Ajouter des alias GIT +> mettre le reset +> git fetch origin +> git reset --hard origin/main +git clean -fd + +>> rename la machine +hostnamectl set-hostname gitea +> /etc/hosts (changer le nom de la machine) +> > /etc/hostname (changer le nom de la machine) + +# config de ADMIN_MAIL dans le ENV ajouter ADMIN_MAIL dans /etc/environment ADMIN_MAIL="admin@frogg.fr" @@ -33,13 +35,15 @@ ADMIN_MAIL="admin@frogg.fr" jq pour les json en bash ncdu -# config de ADMIN_MAIL dans le ENV +# GITEA +- faire le redirect port 80 +- ajouter https sur gitea -faire une page demo des couleurs +# SERVER +- mettre les scripts sur tous les linux +# ZABBIX +- config Proxmox (dl le template) +- config ndv +- config gita - ->> rename la machine -hostnamectl set-hostname gitea -> /etc/hosts (changer le nom de la machine) -> > /etc/hostname (changer le nom de la machine) \ No newline at end of file diff --git a/config/config_colors.sh b/config/config_colors.sh index 60e723f..e6e6d96 100644 --- a/config/config_colors.sh +++ b/config/config_colors.sh @@ -23,3 +23,6 @@ COLOR_DARK_GREEN_BG='\033[48;5;28m' COLOR_DARK_GRAY_BG='\033[48;5;239m' COLOR_LIGHT_BLUE_BG='\033[48;5;31m' COLOR_LIGHT_RED_BG='\033[01;101m' + +# Les Asci sympas : +# 🐧 🌀 🍥 ✅ ❎ ❌ ⭕ ℹ️🔄🚨🆔 🆗 🆕 🆙 \ No newline at end of file diff --git a/func/message.sh b/func/message.sh index cdfd704..16965a8 100644 --- a/func/message.sh +++ b/func/message.sh @@ -10,10 +10,10 @@ msg_status_text() echo -e "${COLOR_YELLOW}⚡ ${msg}${NONE}" ;; error|err) - echo -e "${COLOR_RED}❌ ${msg}${NONE}" + echo -e "${COLOR_LIGHT_RED}❎ ${msg}${NONE}" ;; info|inf) - echo -e "${COLOR_BLUE}ℹ ${msg}${NONE}" + echo -e "${COLOR_LIGHT_BLUE}ℹ️ ${msg}${NONE}" ;; *) echo -e "${msg}" diff --git a/func/message_display.sh b/func/message_display.sh index a450e0d..f70fea4 100644 --- a/func/message_display.sh +++ b/func/message_display.sh @@ -1,6 +1,6 @@ display_line() { - local width=27 label_with_dots formatted_label + local width=26 label_with_dots formatted_label # On calcule combien de points ajouter (Largeur - longueur du label) # On utilise une astuce simple : on ajoute 27 points au label et on coupe à 27. @@ -57,8 +57,8 @@ draw_bar() { ((pct < 0)) && pct=0 # Sélection automatique de la couleur - local color="${COLOR_BLUE}" - if (( pct >= 90 )); then color="${COLOR_RED}" + local color="${COLOR_LIGHT_BLUE}" + if (( pct >= 90 )); then color="${COLOR_LIGHT_RED}" elif (( pct >= 70 )); then color="${COLOR_ORANGE}" elif (( pct >= 50 )); then color="${COLOR_YELLOW}" elif (( pct >= 30 )); then color="${COLOR_LIGHT_GREEN}" @@ -70,7 +70,7 @@ draw_bar() { local empty=$((size - filled)) # Affichage de la barre - printf "[" + printf "${NONE}[" echo -ne "${color}" for ((i=0; i/dev/null) [[ -z "$branch" ]] && return + project=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null) + current_bg=$COLOR_DARK_GREEN_BG current_color=$COLOR_DARK_GREEN - status="✅" + status="🆗" if [[ -n $(git status --porcelain 2>/dev/null) ]]; then current_bg=$COLOR_LIGHT_RED_BG current_color=$COLOR_LIGHT_RED - status="▼" + #status="▼" + status="🔄" fi - echo -ne "${COLOR_DARK_GRAY}${current_bg}${SEP}${COLOR_WHITE} ${status} git:[${branch}]${current_bg}${NONE}${current_color}${SEP}${NONE}" + echo -ne "${COLOR_DARK_GRAY}${current_bg}${SEP}${COLOR_WHITE} [${project}/${branch}]${status}${current_bg}${NONE}${current_color}${SEP}${NONE}" } set_ps1() { diff --git a/inc/warnings.sh b/inc/warnings.sh index f91bcfc..f8029a7 100644 --- a/inc/warnings.sh +++ b/inc/warnings.sh @@ -18,7 +18,7 @@ check_ssh_failed_logins() { failed_con=$($sudo_cmd journalctl _SYSTEMD_UNIT=ssh.service --since "24 hours ago" 2>/dev/null | grep -c "Failed password") if [[ ${failed_con:-0} -gt 0 ]]; then - echo -e " ${COLOR_RED}⚡ ATTENTION :${COLOR_GRAY} ${failed_con} tentatives de connexion échouées ces dernières 24h !${NONE}" + echo -e " ${COLOR_LIGHT_RED}⚡ ATTENTION :${COLOR_GRAY} ${failed_con} tentatives de connexion échouées ces dernières 24h !${NONE}" echo -e "${COLOR_GREEN}======================================================================${NONE}" fi } @@ -29,8 +29,8 @@ check_active_sessions() { other_users=$(who | wc -l) if [[ ${other_users:-0} -gt 1 ]]; then - echo -e " ${COLOR_RED}⚡ ATTENTION :${COLOR_GRAY} Il y a actuellement $((other_users - 1)) autre(s) session(s) active(s).${NONE}" - echo -e "${COLOR_RED} ╔════════════════════════════════════════════════╗" + echo -e " ${COLOR_LIGHT_RED}⚡ ATTENTION :${COLOR_GRAY} Il y a actuellement $((other_users - 1)) autre(s) session(s) active(s).${NONE}" + echo -e "${COLOR_LIGHT_RED} ╔════════════════════════════════════════════════╗" printf " ║ %-10s %-10s %-8s %-15s ║\n" "USER" "DATE" "HEURE" "IP" echo " ╠════════════════════════════════════════════════╣"