Skip to content

Commit

Permalink
Merge pull request #8 from ether/add_private_info
Browse files Browse the repository at this point in the history
feat: Add information if instance is public or private
  • Loading branch information
Gared authored Nov 11, 2024
2 parents 39132d8 + 50ebfd6 commit c58d6ed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/pages/instances.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useEffect, useMemo, useState} from "react";
import axios, {AxiosError, AxiosResponse} from "axios";
import {Instance, InstancesResponse, PluginData} from "@/types/InstancesResponse.ts";
import {AlertTriangle, Check, NotepadText, PlusIcon} from 'lucide-react'
import {AlertTriangle, Check, Lock, NotepadText, PlusIcon} from 'lucide-react'

import {
Dialog,
Expand Down Expand Up @@ -123,18 +123,22 @@ export const Instances = () => {
<table className="w-full break-all">
<thead>
<tr>
<td className="md:block hidden">Health</td>
<th className=" px-4 py-2">Name</th>
<th className=" px-4 py-2">Actions</th>
<th className="md:block hidden">Health</th>
<th className="px-4 py-2">Name</th>
<th className="px-4 py-2">Actions</th>
</tr>
</thead>
{filteredInstances.length > 0 ? <tbody className="">

{filteredInstances.map((instance) => {
return (
<tr key={instance.name}>
<td className="hidden md:block border px-4 py-2">{isOldVersion(instance.scan.version) ?
<AlertTriangle className="text-yellow-400"/> : <Check/>}</td>
<td className="hidden md:block border px-4 py-2">
<div className={"flex gap-2"}>
{isOldVersion(instance.scan.version) ? <AlertTriangle className="text-yellow-400"/> : <Check/>}
{instance.scan.is_public === false && <Lock className="text-red-700"/>}
</div>
</td>
<td className="border px-4 py-2 cursor-pointer" onClick={() => {
if (!instance.name.startsWith("http")) {
instance.name = "http://" + instance.name;
Expand Down Expand Up @@ -247,6 +251,10 @@ export const Instances = () => {
<AlertTriangle className="text-yellow-400 w-16 h-16"/>
<span className="text-red-700 font-bold mt-2">Your Etherpad version is really outdated. Consider upgrading to a newer version.</span>
</span>}
{instance.scan.is_public === false && <span className="flex gap-5">
<Lock className="text-red-700 w-16 h-16"/>
<span className="font-bold mt-2">Your Etherpad instance is not public. This means it can only be accessed by authenticated users.</span>
</span>}
</div>}
</DialogContent>
</DialogPortal>
Expand Down
1 change: 1 addition & 0 deletions src/types/InstancesResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type Instance = {

type ScanResult = {
api_version: string,
is_public: boolean | null,
version: string,
scan_time: string,
plugins: string[],
Expand Down

0 comments on commit c58d6ed

Please sign in to comment.