Merge pull request #1518 from zackspear/refactor/6-13-feedback

refactor(vue): update feedback & improvements
This commit is contained in:
tom mortensen
2023-11-21 10:53:35 -08:00
committed by GitHub
12 changed files with 67 additions and 50 deletions

View File

@@ -49,11 +49,11 @@ class RebootDetails
$this->rebootType = $rebootForDowngrade ? 'downgrade' : ($rebootForUpdate ? 'update' : '');
// Detect if third-party drivers were part of the update process
$processWaitingThirdParthDrivers = "inotifywait -q /boot/changes.txt -e move_self,delete_self";
$processWaitingThirdPartyDrivers = "inotifywait -q /boot/changes.txt -e move_self,delete_self";
// Run the ps command to list processes and check if the process is running
$ps_command = "ps aux | grep -E \"$processWaitingThirdParthDrivers\" | grep -v \"grep -E\"";
$ps_command = "ps aux | grep -E \"$processWaitingThirdPartyDrivers\" | grep -v \"grep -E\"";
$output = shell_exec($ps_command) ?? '';
if (strpos($output, $processWaitingThirdParthDrivers) !== false) {
if ($this->rebootType != '' && strpos($output, $processWaitingThirdPartyDrivers) !== false) {
$this->rebootType = 'thirdPartyDriversDownloading';
}
}

View File

@@ -45,9 +45,11 @@ class ServerState
"nokeyserver" => 'NO_KEY_SERVER',
"withdrawn" => 'WITHDRAWN',
];
private $osVersion;
private $osVersionBranch;
private $registered;
private $rebootDetails;
private $caseModel = '';
/**
* Constructor to initialize class properties and gather server information.
@@ -83,13 +85,21 @@ class ServerState
: (file_exists('/var/log/plugins/dynamix.unraid.net.staging.plg')
? trim(@exec('/usr/local/sbin/plugin version /var/log/plugins/dynamix.unraid.net.staging.plg 2>/dev/null'))
: 'base-' . $this->var['version']);
/**
* @todo can we read this from somewhere other than the flash? Connect page uses this path and /boot/config/plugins/dynamix.my.servers/myservers.cfg…
* - $myservers_memory_cfg_path ='/var/local/emhttp/myservers.cfg';
* - $mystatus = (file_exists($myservers_memory_cfg_path)) ? @parse_ini_file($myservers_memory_cfg_path) : [];
*/
$this->myserversFlashCfgPath = '/boot/config/plugins/dynamix.my.servers/myservers.cfg';
$this->myservers = file_exists($this->myserversFlashCfgPath) ? @parse_ini_file($this->myserversFlashCfgPath, true) : [];
$this->osVersion = $this->var['version'];
$this->osVersionBranch = trim(@exec('plugin category /var/log/plugins/unRAIDServer.plg') ?? 'stable');
$this->registered = !empty($this->myservers['remote']['apikey']) && $this->connectPluginInstalled;
$caseModelFile = '/boot/config/plugins/dynamix/case-model.cfg';
$this->caseModel = file_exists($caseModelFile) ? file_get_contents($caseModelFile) : '';
$this->rebootDetails = new RebootDetails();
}
@@ -111,6 +121,7 @@ class ServerState
"apiKey" => $this->myservers['upc']['apikey'] ?? '',
"apiVersion" => $this->myservers['api']['version'] ?? '',
"avatar" => (!empty($this->myservers['remote']['avatar']) && $this->connectPluginInstalled) ? $this->myservers['remote']['avatar'] : '',
"caseModel" => $this->caseModel,
"config" => [
'valid' => ($this->var['configValid'] === 'yes'),
'error' => isset($this->configErrorEnum[$this->var['configValid']]) ? $this->configErrorEnum[$this->var['configValid']] : 'UNKNOWN_ERROR',

View File

@@ -34,6 +34,9 @@
* $wCTranslations->getTranslations();
* ```
*/
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Translations.php";
class WebComponentTranslations
{
private $translations = [];
@@ -384,6 +387,10 @@ class WebComponentTranslations
return $this->translations ?? [];
}
/**
* @param $urlEncode {bool}
* @return string
*/
public function getTranslationsJson($urlEncode = false)
{
if ($urlEncode) {

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
{
".nuxt/nuxt-custom-elements/entries/unraid-components.client.css": {
"file": "_nuxt/unraid-components.client-060d5fb6.css",
"file": "_nuxt/unraid-components.client-5fd7df52.css",
"src": ".nuxt/nuxt-custom-elements/entries/unraid-components.client.css"
},
".nuxt/nuxt-custom-elements/entries/unraid-components.client.mjs": {
"css": [
"_nuxt/unraid-components.client-060d5fb6.css"
"_nuxt/unraid-components.client-5fd7df52.css"
],
"file": "_nuxt/unraid-components.client-bc281878.js",
"file": "_nuxt/unraid-components.client-9c876343.js",
"isEntry": true,
"src": ".nuxt/nuxt-custom-elements/entries/unraid-components.client.mjs"
}

View File

@@ -15,7 +15,6 @@ $file = $_POST['file']??'';
$model = $_POST['model']??'';
$root = "/boot/config/plugins/dynamix";
$name = "$root/$file";
if (realpath(dirname($name)) == $root) {
switch ($_POST['mode']??'') {
case 'set':

View File

@@ -242,7 +242,7 @@ div.vmtemplate:hover{background-color:#edeaef}
div.vmtemplate{height:12rem;width:12rem;border:1px solid #f3f0f4}
div.vmtemplate img{margin-top:20px}
div.up{margin-top:-20px;border:1px solid #f3f0f4;padding:4px 6px;overflow:auto}
div.spinner{text-align:center;cursor:not-allowed;}
div.spinner{text-align:center;cursor:wait;}
div.spinner.fixed{display:none;position:fixed;top:0;left:0;z-index:99999;bottom:0;right:0;margin:0;}
div.spinner .unraid_mark{height:64px; position:fixed;top:50%;left:50%;margin-top:-16px;margin-left:-64px;}
div.spinner .unraid_mark_2,div .unraid_mark_4{animation:mark_2 1.5s ease infinite}

View File

@@ -229,7 +229,7 @@ div.Panel i.PanelIcon{font-size:32px;color:#f2f2f2}
div.user-list{float:left;padding:10px;margin-right:10px;margin-bottom:24px;border:1px solid #2f2f2f;border-radius:5px;line-height:2rem;height:10rem;width:10rem;background-color:#262626}
div.user-list img{width:auto;max-width:48px;height:48px;margin-bottom:16px}
div.up{margin-top:-30px;border:1px solid #2b2b2b;padding:4px 6px;overflow:auto}
div.spinner{text-align:center;cursor:not-allowed;}
div.spinner{text-align:center;cursor:wait;}
div.spinner.fixed{display:none;position:fixed;top:0;left:0;z-index:99999;bottom:0;right:0;margin:0;}
div.spinner .unraid_mark{height:64px; position:fixed;top:50%;left:50%;margin-top:-16px;margin-left:-64px;}
div.spinner .unraid_mark_2,div .unraid_mark_4{animation:mark_2 1.5s ease infinite}

View File

@@ -242,7 +242,7 @@ div.vmtemplate:hover{background-color:#121510}
div.vmtemplate{height:12rem;width:12rem;border:1px solid #0c0f0b}
div.vmtemplate img{margin-top:20px}
div.up{margin-top:-20px;border:1px solid #0c0f0b;padding:4px 6px;overflow:auto}
div.spinner{text-align:center;cursor:not-allowed;}
div.spinner{text-align:center;cursor:wait;}
div.spinner.fixed{display:none;position:fixed;top:0;left:0;z-index:99999;bottom:0;right:0;margin:0;}
div.spinner .unraid_mark{height:64px; position:fixed;top:50%;left:50%;margin-top:-16px;margin-left:-64px;}
div.spinner .unraid_mark_2,div .unraid_mark_4{animation:mark_2 1.5s ease infinite}

View File

@@ -229,7 +229,7 @@ div.Panel i.PanelIcon{font-size:32px;color:#1c1b1b}
div.user-list{float:left;padding:10px;margin-right:10px;margin-bottom:24px;border:1px solid #dedede;border-radius:5px;line-height:2rem;height:10rem;width:10rem;background-color:#e8e8e8}
div.user-list img{width:auto;max-width:48px;height:48px;margin-bottom:16px}
div.up{margin-top:-30px;border:1px solid #e3e3e3;padding:4px 6px;overflow:auto}
div.spinner{text-align:center;cursor:not-allowed;}
div.spinner{text-align:center;cursor:wait;}
div.spinner.fixed{display:none;position:fixed;top:0;left:0;z-index:99999;bottom:0;right:0;margin:0;}
div.spinner .unraid_mark{height:64px; position:fixed;top:50%;left:50%;margin-top:-16px;margin-left:-64px;}
div.spinner .unraid_mark_2,div .unraid_mark_4{animation:mark_2 1.5s ease infinite}