Преглед изворни кода

feat(details): add CPU info to details (#2172)

* feat(details): add CPU info to details
* fix(docs): further improvements to templates
Daniel Gibbs пре 7 година
родитељ
комит
7e23279b48

+ 4 - 4
.github/ISSUE_TEMPLATE/bug_report.md

@@ -23,13 +23,13 @@ Any general support issues on GitHub will be migrated to [LinuxGSM-Support](http
 
 ## User Story
 
-As a \[user description], I want \[desired action] so that \[desired outcome].
+As a [user description], I want [desired action] so that [desired outcome].
 
 ## Basic info
 
-* Distro \[Ubuntu 18.04]
-* Game \[Garry's Mod]
-* Feature \[Monitor]
+* Distro: [Ubuntu 18.04]
+* Game: [Garry's Mod]
+* Command: [Monitor]
 
 ## Further Information
 

+ 4 - 6
.github/ISSUE_TEMPLATE/feature_request.md

@@ -23,15 +23,13 @@ Any general support issues on GitHub will be migrated to [LinuxGSM-Support](http
 
 ## User Story
 
-As a \[user description], I want \[desired action] so that \[desired outcome].
+As a [user description], I want [desired action] so that [desired outcome].
 
 ## Basic info
 
-As a \[user description], I want \[desired action] so that \[desired outcome]
-
-* Distro \[Ubuntu 18.04]
-* Game \[Garry's Mod]
-* Feature \[Monitor]
+* Distro: [Ubuntu 18.04]
+* Game: [Garry's Mod]
+* Command: [Monitor]
 
 ## Further Information
 

+ 2 - 2
.github/ISSUE_TEMPLATE/new-server-request.md

@@ -6,7 +6,7 @@ about: Suggest a new game server to be added
 
 ## What game server would you like adding?
 
-\[game server]
+[game server]
 
 ## Can you link to any tutorials or guides?
 
@@ -19,7 +19,7 @@ Provide any useful documentation or resources that might help.
 
 If yes Use SteamDB to get the appid. (https://steamdb.info).
 
-\[appid]
+[appid]
 
 ## Is the server supported on Linux?
 

+ 5 - 3
lgsm/functions/info_distro.sh

@@ -89,8 +89,10 @@ days=$(( uptime/60/60/24 ))
 ## Average server load
 load=$(uptime|awk -F 'load average: ' '{ print $2 }')
 
-## Memory information
-
+## CPU information
+cpumodel=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
+cpucores=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)
+cpufreuency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
 
 ## Memory information
 # Available RAM and swap.
@@ -232,4 +234,4 @@ if [ ! "$(command -v jq 2>/dev/null)" ]; then
 			fi
 		fi
 	fi
-fi
+fi

+ 6 - 0
lgsm/functions/info_messages.sh

@@ -74,6 +74,12 @@ fn_info_message_performance(){
 		echo -e "${blue}Avg Load:\t${default}${load}"
 	} | column -s $'\t' -t
 	echo -e ""
+	{
+		echo -e "${blue}CPU Model:\t${default}${cpumodel}"
+		echo -e "${blue}CPU Cores:\t${default}${cpucores}"
+		echo -e "${blue}CPU Frequency:\t${default}${cpufreuency}"
+	} | column -s $'\t' -t	
+	echo -e ""
 	{
 		echo -e "${blue}Mem:\t${blue}total\tused\tfree\tcached\tavailable${default}"
 		echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"