refactor: web components renamed to unraid-

This commit is contained in:
Zack Spear
2023-07-24 16:51:36 -07:00
committed by Zack Spear
parent 38f2e6a9a6
commit a73cc86c38
4 changed files with 10 additions and 10 deletions
@@ -526,7 +526,7 @@ _(Allow Remote Access)_:
<?endif?> <?endif?>
&nbsp; &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'"> <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> : <span>_(Questions? See <a href="https://docs.unraid.net/category/unraid-connect" target="_blank">the documentation</a>.)_</span>
_(Account status)_: _(Account status)_:
: <connect-auth></connect-auth> : <unraid-auth></unraid-auth>
<?if($isRegistered):?> <?if($isRegistered):?>
_(Connected to Unraid Connect Cloud)_: _(Connected to Unraid Connect Cloud)_:
@@ -703,6 +703,6 @@ _(Connected to Unraid Connect Cloud)_:
<?endif // end check for ($isRegistered) ?> <?endif // end check for ($isRegistered) ?>
_(Download unraid-api Logs)_: _(Download unraid-api Logs)_:
: <connect-download-api-logs></connect-download-api-logs> : <unraid-download-api-logs></unraid-download-api-logs>
</div> </div>
<!-- end unraid-api section --> <!-- end unraid-api section -->
@@ -259,4 +259,4 @@ _(Replaceable)_:
<?endif;?> <?endif;?>
&nbsp; &nbsp;
: <connect-key-actions></connect-key-actions> : <unraid-key-actions></unraid-key-actions>
@@ -11,7 +11,7 @@
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
} }
connect-user-profile { unraid-user-profile {
font-size: 16px; font-size: 16px;
margin-left: auto; margin-left: auto;
height: 100%; height: 100%;
@@ -19,12 +19,12 @@ connect-user-profile {
</style> </style>
<?php <?php
// Set the path for the local manifest file // 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 // Load the local manifest
$localManifest = json_decode(file_get_contents($localManifestFile), true); $localManifest = json_decode(file_get_contents($localManifestFile), true);
$searchText = 'connect-components.client.mjs'; $searchText = 'unraid-components.client.mjs';
$fileValue = null; $fileValue = null;
foreach ($localManifest as $key => $value) { foreach ($localManifest as $key => $value) {
@@ -35,7 +35,7 @@ foreach ($localManifest as $key => $value) {
} }
if ($fileValue !== null) { if ($fileValue !== null) {
$prefixedPath = '/plugins/dynamix.my.servers/connect-components/'; $prefixedPath = '/plugins/dynamix.my.servers/unraid-components/';
echo '<script src="' . $prefixedPath . $fileValue . '"></script>'; echo '<script src="' . $prefixedPath . $fileValue . '"></script>';
} else { } else {
echo '<script>console.error("%cNo matching key containing \'' . $searchText . '\' found.", "font-weight: bold; color: white; background-color: red");</script>'; echo '<script>console.error("%cNo matching key containing \'' . $searchText . '\' found.", "font-weight: bold; color: white; background-color: red");</script>';
@@ -2,14 +2,14 @@
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; $docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once("$docroot/plugins/dynamix.my.servers/include/state.php"); require_once("$docroot/plugins/dynamix.my.servers/include/state.php");
// var_dump($serverState); // 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> <script>
/** /**
* So we're not needing to modify DefaultLayout with an additional include, * 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 * 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) { if (!document.getElementsByTagName(modalsWebComponent).length) {
const $body = document.getElementsByTagName('body')[0]; const $body = document.getElementsByTagName('body')[0];
const $modals = document.createElement(modalsWebComponent); const $modals = document.createElement(modalsWebComponent);