tangled
alpha
login
or
join now
vielle.dev
/
pdsls
forked from
pds.ls/pdsls
0
fork
atom
atproto explorer
0
fork
atom
overview
issues
pulls
pipelines
move record validation icons
handle.invalid
5 months ago
25837511
8ae7a400
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+30
-31
2 changed files
expand all
collapse all
unified
split
src
components
navbar.tsx
views
record.tsx
+1
-30
src/components/navbar.tsx
···
7
export const [pds, setPDS] = createSignal<string>();
8
export const [cid, setCID] = createSignal<string>();
9
export const [isLabeler, setIsLabeler] = createSignal(false);
10
-
export const [validRecord, setValidRecord] = createSignal<boolean | undefined>(undefined);
11
-
export const [validSchema, setValidSchema] = createSignal<boolean | undefined>(undefined);
12
13
const swapIcons: Record<string, string> = {
14
"did:plc:vwzwgnygau7ed7b7wt5ux7y2": "lucide--microchip",
···
165
<Tooltip text="Record">
166
<span class="iconify lucide--file-json text-base"></span>
167
</Tooltip>
168
-
<div class="flex gap-1">
169
-
<span>{props.params.rkey}</span>
170
-
<Show when={validRecord()}>
171
-
<Tooltip text="Valid record">
172
-
<span class="iconify lucide--lock-keyhole"></span>
173
-
</Tooltip>
174
-
</Show>
175
-
<Show when={validRecord() === false}>
176
-
<Tooltip text="Invalid record">
177
-
<span class="iconify lucide--lock-keyhole-open text-red-500 dark:text-red-400"></span>
178
-
</Tooltip>
179
-
</Show>
180
-
<Show when={validRecord() === undefined}>
181
-
<Tooltip text="Validating">
182
-
<span class="iconify lucide--loader-circle animate-spin"></span>
183
-
</Tooltip>
184
-
</Show>
185
-
<Show when={validSchema()}>
186
-
<Tooltip text="Valid schema">
187
-
<span class="iconify lucide--file-check"></span>
188
-
</Tooltip>
189
-
</Show>
190
-
<Show when={validSchema() === false}>
191
-
<Tooltip text="Invalid schema">
192
-
<span class="iconify lucide--file-x text-red-500 dark:text-red-400"></span>
193
-
</Tooltip>
194
-
</Show>
195
-
</div>
196
</div>
197
</Show>
198
</div>
···
7
export const [pds, setPDS] = createSignal<string>();
8
export const [cid, setCID] = createSignal<string>();
9
export const [isLabeler, setIsLabeler] = createSignal(false);
0
0
10
11
const swapIcons: Record<string, string> = {
12
"did:plc:vwzwgnygau7ed7b7wt5ux7y2": "lucide--microchip",
···
163
<Tooltip text="Record">
164
<span class="iconify lucide--file-json text-base"></span>
165
</Tooltip>
166
+
<span>{props.params.rkey}</span>
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
167
</div>
168
</Show>
169
</div>
+29
-1
src/views/record.tsx
···
10
import { JSONValue } from "../components/json.jsx";
11
import { agent } from "../components/login.jsx";
12
import { Modal } from "../components/modal.jsx";
13
-
import { pds, setCID, setValidRecord, setValidSchema, validRecord } from "../components/navbar.jsx";
14
import Tooltip from "../components/tooltip.jsx";
15
import { setNotif } from "../layout.jsx";
16
import { didDocCache, resolvePDS } from "../utils/api.js";
···
27
const [externalLink, setExternalLink] = createSignal<
28
{ label: string; link: string; icon?: string } | undefined
29
>();
0
0
30
const did = params.repo;
31
let rpc: Client;
32
···
146
</A>
147
</div>
148
<div class="flex gap-1">
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
149
<Show when={agent() && agent()?.sub === record()?.uri.split("/")[2]}>
150
<RecordEditor create={false} record={record()?.value} refetch={refetch} />
151
<Tooltip text="Delete">
···
10
import { JSONValue } from "../components/json.jsx";
11
import { agent } from "../components/login.jsx";
12
import { Modal } from "../components/modal.jsx";
13
+
import { pds, setCID } from "../components/navbar.jsx";
14
import Tooltip from "../components/tooltip.jsx";
15
import { setNotif } from "../layout.jsx";
16
import { didDocCache, resolvePDS } from "../utils/api.js";
···
27
const [externalLink, setExternalLink] = createSignal<
28
{ label: string; link: string; icon?: string } | undefined
29
>();
30
+
const [validRecord, setValidRecord] = createSignal<boolean | undefined>(undefined);
31
+
const [validSchema, setValidSchema] = createSignal<boolean | undefined>(undefined);
32
const did = params.repo;
33
let rpc: Client;
34
···
148
</A>
149
</div>
150
<div class="flex gap-1">
151
+
<div class="mr-1 flex gap-3">
152
+
<Tooltip
153
+
text={
154
+
validRecord() === undefined ? "Validating"
155
+
: validRecord() === false ?
156
+
"Invalid record"
157
+
: "Valid record"
158
+
}
159
+
>
160
+
<span
161
+
classList={{
162
+
"iconify lucide--lock-keyhole": validRecord() === true,
163
+
"iconify lucide--lock-keyhole-open text-red-500 dark:text-red-400":
164
+
validRecord() === false,
165
+
"iconify lucide--loader-circle animate-spin": validRecord() === undefined,
166
+
}}
167
+
></span>
168
+
</Tooltip>
169
+
<Show when={validSchema() !== undefined}>
170
+
<Tooltip text={validSchema() ? "Valid schema" : "Invalid schema"}>
171
+
<span
172
+
class={`iconify ${validSchema() ? "lucide--file-check" : "lucide--file-x text-red-500 dark:text-red-400"}`}
173
+
></span>
174
+
</Tooltip>
175
+
</Show>
176
+
</div>
177
<Show when={agent() && agent()?.sub === record()?.uri.split("/")[2]}>
178
<RecordEditor create={false} record={record()?.value} refetch={refetch} />
179
<Tooltip text="Delete">