mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-21 04:36:18 +00:00
Show connected directory for websites
This commit is contained in:
@@ -44,6 +44,7 @@ h1 .app-count, h1 .worker-count, h1 .website-count{
|
||||
padding: 2px 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* ------------------------------------
|
||||
Button
|
||||
------------------------------------*/
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<!-- Footer -->
|
||||
<div style="overflow: hidden; position: absolute; bottom: 0; width: 100%;">
|
||||
<ul class="sidebar-nav">
|
||||
<li class="no-hover"><a href="https://developer.puter.com/" class="link-to-docs" target="_blank">Developer Documentation <img src="img/external-link.svg"></a></li>
|
||||
<li class="no-hover" style="margin-left:0;"><a href="https://developer.puter.com/" class="link-to-docs" target="_blank">Developer Documentation <img src="img/external-link.svg"></a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="sidebar-nav sidebar-nav-social">
|
||||
@@ -317,6 +317,7 @@
|
||||
<tr>
|
||||
<th><input type="checkbox" class="select-all-websites" style="width: 20px; height: 20px; margin-left:3px;"></th>
|
||||
<th class="sort th-name" data-column="name" style="padding-left: 10px !important;">Website<span class="sort-arrow sort-arrow-desc">▼</span><span class="sort-arrow sort-arrow-asc">▲</span></th>
|
||||
<th class="sort th-root-dir" data-column="root_dir">Connected Directory<span class="sort-arrow sort-arrow-desc">▼</span><span class="sort-arrow sort-arrow-asc">▲</span></th>
|
||||
<th class="sort th-created sorted" data-column="created_at">Created<span class="sort-arrow sort-arrow-desc" style="display:inline;">▼</span><span class="sort-arrow sort-arrow-asc">▲</span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -163,10 +163,10 @@ function sort_websites() {
|
||||
if (search_query) {
|
||||
// show websites that match search_query and hide websites that don't
|
||||
websites.forEach((website) => {
|
||||
if (website.name.toLowerCase().includes(search_query.toLowerCase())) {
|
||||
$(`.website-card[data-name="${html_encode(website.name)}"]`).show();
|
||||
if (website.subdomain.toLowerCase().includes(search_query.toLowerCase())) {
|
||||
$(`.website-card[data-name="${html_encode(website.subdomain)}"]`).show();
|
||||
} else {
|
||||
$(`.website-card[data-name="${html_encode(website.name)}"]`).hide();
|
||||
$(`.website-card[data-name="${html_encode(website.subdomain)}"]`).hide();
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -184,10 +184,11 @@ function count_websites() {
|
||||
function generate_website_card(website) {
|
||||
return `
|
||||
<tr class="website-card" data-name="${html_encode(website.subdomain)}">
|
||||
<td style="width:50px; vertical-align: middle; line-height: 1;">
|
||||
<td style="width:30px; vertical-align: middle; line-height: 1;">
|
||||
<input type="checkbox" class="website-checkbox" data-website-name="${website.subdomain}">
|
||||
</td>
|
||||
<td style="font-family: monospace; font-size: 14px; vertical-align: middle;"><a href="https://${website.subdomain}.puter.site" target="_blank">${website.subdomain}.puter.site</a></td>
|
||||
<td style="font-size: 14px; vertical-align: middle;">${website.root_dir ? website.root_dir.name : ''}</td>
|
||||
<td style="font-size: 14px; vertical-align: middle;">${website.created_at}</td>
|
||||
<td style="vertical-align: middle;"><img class="options-icon options-icon-website" data-website-name="${website.subdomain}" src="./img/options.svg"></td>
|
||||
</tr>
|
||||
@@ -208,12 +209,12 @@ $(document).on('input change keyup keypress keydown paste cut', '.search', funct
|
||||
// show apps that match search_query and hide apps that don't
|
||||
websites.forEach((website) => {
|
||||
if (
|
||||
website.name.toLowerCase().includes(search_query.toLowerCase())
|
||||
website.subdomain.toLowerCase().includes(search_query.toLowerCase())
|
||||
)
|
||||
{
|
||||
$(`.website-card[data-name="${website.name}"]`).show();
|
||||
$(`.website-card[data-name="${website.subdomain}"]`).show();
|
||||
} else {
|
||||
$(`.website-card[data-name="${website.name}"]`).hide();
|
||||
$(`.website-card[data-name="${website.subdomain}"]`).hide();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user