Skip to content

Commit

Permalink
#4104 Updates following discussions with Eric
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-developer committed Dec 29, 2024
1 parent 15e03e8 commit 275a97b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 33 deletions.
34 changes: 28 additions & 6 deletions html/documentation/troubleshooting/reportingIssues.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,29 @@
If no one has already reported the problem, create a new Issue.
</p>

<h4>How to report an Issue</h4>
<h3>How to report an Issue</h3>
<h4>The automated method</h4>
<blockquote>This id the preferred method and should be used if you have access to the WebUI</blockquote>
<p>Select the 'Getting Support' menu option from the WebUI. This will display the support log generation page</p>
<p>Towards the bottom of the page is a button that will generate a support file that you can attach to your discussion</p>
<p>Clicking the button will display a message describing what data will be included. Click ok and the newly generated
support log will be displayed, you can generate multiple logs and the latest one is displayed in green if there is more than one log<p>
<p>If you know the discussion number from GitHub then clicking on the GitHub icon will allow you to add this, this will then
provide a quick link to the discussion for you</p>

<p>Once you have created the support log create a new <a external="true" href="https://github.com/AllskyTeam/allsky/discussions">Discussion</a>
in GitHub and <strong>attach</strong> the zip file you downloaded. You can now added the GitHub reference in the WebUI if you wish
</p>

<blockquote>This GitHub discussion number can be found fromt the URL in github - Its the number at the end so in the following examle<br>
https://github.com/AllskyTeam/allsky/discussions/4001
<br>
the discussion number is 4001
</blockquote>


<h4>The manual method</h4>
<blockquote>This method should only be used if you are unable to use the automated method</blockquote>
<p>
The first step is to create a log file
(<span class="fileName">/var/log/allsky.log</span>)
Expand All @@ -65,7 +87,7 @@ <h4>How to report an Issue</h4>
</p>
<p>
Create a new
<a external="true" href="https://github.com/AllskyTeam/allsky/issues">Issue</a>
<a external="true" href="https://github.com/AllskyTeam/allsky/discussions">Discussion</a>
in GitHub and <strong>attach</strong>
<span class="fileName">/tmp/allsky.log</span>
and <span class="fileName">/tmp/settings.json.txt</span> to it
Expand All @@ -74,16 +96,16 @@ <h4>How to report an Issue</h4>
<br>
<p>
<blockquote>
GitHub only accepts files ending in <span class="fileName">.txt</span>
and <span class="fileName">.log</span>.
GitHub only accepts certain file types. See this
<a external="true" href="https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files">URL</a>
for details of the file types supported

If your file has a different extension,
append a <span class="fileName">.txt</span> to it, e.g.,
<span class="fileName">settings.json.txt</span>.
</blockquote>
</p>
<p>
Do NOT zip your files; it makes it hard to read on a phone.
If you feel you need to zip a file you probably didn't follow the instructions above.
</p>


Expand Down
3 changes: 2 additions & 1 deletion html/includes/support.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<div class="row">
<div class="panel panel-primary">
<div class="panel-heading"><i class="fa fa-code fa-question"></i> Support Information</div>
<div class="panel-heading"><i class="fa fa-code fa-question"></i> Getting Support</div>
<div class="panel-body as-support-loading">


Expand All @@ -39,6 +39,7 @@
<div class="alert alert-success" role="alert">
<p>If you have a <b>QUESTION</b> or want to suggest a <b>NEW FEATURE</b>, add a new <a external="true" href="https://github.com/AllskyTeam/allsky/discussions">Discussion</a> item via the link at the top of any GitHub page; do <u>not</u> submit an Issue.</p>
<p>If you found a <b>BUG</b> or something isn't working right, first look in the <a external="true" href="https://github.com/AllskyTeam/allsky/discussions">Discussions</a> area and at existing <a external="true" href="https://github.com/AllskyTeam/allsky/issues">Issues</a>. If no one has already reported the problem, create a new Issue.</p>
<p>Further information can be found in the Allsky documentation <a external="true" href="/documentation/troubleshooting/reportingIssues.html">Reporting Issues</a></p>
</div>

<div class="alert alert-danger" role="alert">
Expand Down
32 changes: 10 additions & 22 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function DisplayTorProxyConfig() {}
case "overlay": $Title = "Overlay Editor"; break;
case "module": $Title = "Module Manager"; break;
case "live_view": $Title = "Liveview"; break;
case "support": $Title = "Getting Support"; break;
default: $Title = "Allsky WebUI"; break;
}
?>
Expand Down Expand Up @@ -304,7 +305,7 @@ function DisplayTorProxyConfig() {}
<a external="true" href="/documentation"><i class="fa fa-book fa-fw"></i> Allsky Documentation </a>
</li>
<li>
<a href="index.php?page=support"><i class="fa fa-question fa-fw"></i> Support Information</a>
<a href="index.php?page=support"><i class="fa fa-question fa-fw"></i> Getting Support</a>
</li>
<li>
<span onclick="switchTheme()"><i class="fa fa-moon fa-fw"></i> Light/Dark mode</span>
Expand Down Expand Up @@ -349,31 +350,21 @@ function DisplayTorProxyConfig() {}
echo "<div class='row'>"; echo "<div class='system-message'>";
echo "<div class='title'>System Messages</div>";
foreach ($contents_array as $line) {
// Format: id, cmd_txt, level (i.e., CSS class), date, count, message [, url]
// 0 1 2 3 4 5 6
$cmd = "";
// Format: level (i.e., CSS class), date, count, message [, url]
// 0 1 2 3 4
$message_array = explode("\t", $line);
$message = getVariableOrDefault($message_array, 5, null);
$message = getVariableOrDefault($message_array, 3, null);
if ($message !== null) {
$id = getVariableOrDefault($message_array, 0, "");
$cmd_txt = getVariableOrDefault($message_array, 1, "");
$level = $message_array[2];
$date = $message_array[3];
$count = $message_array[4];
$url = getVariableOrDefault($message_array, 6, "");
$level = $message_array[0];
$date = $message_array[1];
$count = $message_array[2];
$url = getVariableOrDefault($message_array, 4, "");
if ($url !== "") {
$m1 = "<a href='$url' title='Click for more information' target='_messages'>";
$m2 = "<i class='fa fa-external-link-alt fa-fw'></i>";
$m2 = "<span class='externalSmall'>$m2</span>";
$message = "${m1}${message}${m2}</a>";
$message = "$m1 $message $m2</a>";
}

if ($id !== "") {
$m1 = "<br><a href='/execute.php?cmd=" . urlencode($id) . "'";
$m1 .= " class='executeAction' title='Click to perform action' target='_actions'>";
$message .= "${m1}${cmd_txt}</a>";
}

if ($count == 1)
$message .= " &nbsp; ($date)";
else
Expand All @@ -383,9 +374,6 @@ function DisplayTorProxyConfig() {}
$message = "INTERNAL ERROR: Poorly formatted message: $line";
}
$status->addMessage($message, $level);
if ($cmd !== "") {
$status->addMessage($cmd, $level);
}
}
$status->showMessages();
echo "<br><div class='message-button'>";
Expand Down
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,9 @@ set_permissions()
fi
done
fi

# Ensure the support folder has the correct owner and group
chown "${ALLSKY_OWNER}":"${WEBSERVER_GROUP}" "${ALLSKY_WEBUI}/support"
}


Expand Down
17 changes: 13 additions & 4 deletions support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,25 @@ function init()

sudo apt install -y tree > /dev/null 2>&1
sudo apt install -y i2c-tools > /dev/null 2>&1
sudo systemctl enable pigpiod 2>&1
sudo systemctl start pigpiod 2>&1
}

function print_info() {
function print_info()
{
local LABEL=$1
local VALUE=$2
printf "%-20s : %-20s\n" "${LABEL}" "${VALUE}"
}

function print() {
function print()
{
local LABEL=$1
echo "${LABEL}"
}

function print_heading(){
function print_heading()
{
local LABEL=$1

printf "\n\n%-20s\n" "${LABEL} - $(date)"
Expand Down Expand Up @@ -147,6 +152,7 @@ function collect_support_info()
###

### Allsky file information
cd "${ALLSKY_HOME}"
ALLSKY_VERSION="$( head -1 "./version" )"
DEBUG_LEVEL=$(jq .debuglevel ./config/settings.json)
ALLSKY_FILES="$(tree -ugp --gitignore --prune -I '.git|__pycache__' "${ALLSKY_HOME}")"
Expand Down Expand Up @@ -348,6 +354,9 @@ function generate_support_info()
truncate -s 0 "${TEMP_DIR}/config/overlay/config/tmp/overlay/de421.bsp"
# Truncate all of the module configs until we can obfuscate any sensitive data
find "${TEMP_DIR}"/config/modules -type f -exec truncate -s 0 {} +
# Truncate the font files
find "${TEMP_DIR}"/config/overlay/system_fonts -type f -exec truncate -s 0 {} +


SUPPORT_ZIP_NAME="${SUPPORT_ZIP_NAME//ISSUE/${ISSUE_NUMBER}}"
DIALOG_COMPLETE_MESSAGE="${DIALOG_COMPLETE_MESSAGE//ZIPNAME/${SUPPORT_ZIP_NAME}}"
Expand All @@ -358,7 +367,7 @@ function generate_support_info()
sudo chmod g+wx "${TEMP_DIR}/${SUPPORT_ZIP_NAME}"
sudo chmod u+wx "${TEMP_DIR}/${SUPPORT_ZIP_NAME}"
sudo mv "${TEMP_DIR}/${SUPPORT_ZIP_NAME}" "${SUPPORT_DIR}"
trap 'rm -rf "${TEMP_DIR}"' EXIT
#trap 'rm -rf "${TEMP_DIR}"' EXIT
}

####
Expand Down

0 comments on commit 275a97b

Please sign in to comment.