refactor: web components renamed to unraid-

This commit is contained in:
Zack Spear
2023-07-24 16:51:36 -07:00
parent 3303549565
commit d46b9e5ec8
4 changed files with 10 additions and 10 deletions

View File

@@ -526,7 +526,7 @@ _(Allow Remote Access)_:
<?endif?>
&nbsp;
: <connect-wan-ip-check php-wan-ip="<?=@file_get_contents('https://wanip4.unraid.net/')?>"></connect-wan-ip-check>
: <unraid-wan-ip-check php-wan-ip="<?=@file_get_contents('https://wanip4.unraid.net/')?>"></unraid-wan-ip-check>
<div markdown="1" id="wanpanel" style="display:'none'">
@@ -691,7 +691,7 @@ $(function() {
: <span>_(Questions? See <a href="https://docs.unraid.net/category/unraid-connect" target="_blank">the documentation</a>.)_</span>
_(Account status)_:
: <connect-auth></connect-auth>
: <unraid-auth></unraid-auth>
<?if($isRegistered):?>
_(Connected to Unraid Connect Cloud)_:
@@ -703,6 +703,6 @@ _(Connected to Unraid Connect Cloud)_:
<?endif // end check for ($isRegistered) ?>
_(Download unraid-api Logs)_:
: <connect-download-api-logs></connect-download-api-logs>
: <unraid-download-api-logs></unraid-download-api-logs>
</div>
<!-- end unraid-api section -->

View File

@@ -259,4 +259,4 @@ _(Replaceable)_:
<?endif;?>
&nbsp;
: <connect-key-actions></connect-key-actions>
: <unraid-key-actions></unraid-key-actions>

View File

@@ -11,7 +11,7 @@
-ms-flex-align: center;
align-items: center;
}
connect-user-profile {
unraid-user-profile {
font-size: 16px;
margin-left: auto;
height: 100%;
@@ -19,12 +19,12 @@ connect-user-profile {
</style>
<?php
// Set the path for the local manifest file
$localManifestFile = '/usr/local/emhttp/plugins/dynamix.my.servers/connect-components/manifest.json';
$localManifestFile = '/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/manifest.json';
// Load the local manifest
$localManifest = json_decode(file_get_contents($localManifestFile), true);
$searchText = 'connect-components.client.mjs';
$searchText = 'unraid-components.client.mjs';
$fileValue = null;
foreach ($localManifest as $key => $value) {
@@ -35,7 +35,7 @@ foreach ($localManifest as $key => $value) {
}
if ($fileValue !== null) {
$prefixedPath = '/plugins/dynamix.my.servers/connect-components/';
$prefixedPath = '/plugins/dynamix.my.servers/unraid-components/';
echo '<script src="' . $prefixedPath . $fileValue . '"></script>';
} else {
echo '<script>console.error("%cNo matching key containing \'' . $searchText . '\' found.", "font-weight: bold; color: white; background-color: red");</script>';

View File

@@ -2,14 +2,14 @@
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once("$docroot/plugins/dynamix.my.servers/include/state.php");
// var_dump($serverState);
echo "<connect-user-profile server='" . json_encode($serverState) . "'></connect-user-profile>";
echo "<unraid-user-profile server='" . json_encode($serverState) . "'></unraid-user-profile>";
?>
<script>
/**
* So we're not needing to modify DefaultLayout with an additional include,
* we'll add the Modals web component to the bottom of the body
*/
const modalsWebComponent = 'connect-modals';
const modalsWebComponent = 'unraid-modals';
if (!document.getElementsByTagName(modalsWebComponent).length) {
const $body = document.getElementsByTagName('body')[0];
const $modals = document.createElement(modalsWebComponent);