sh1man
sh1man
SSolidJS
Created by sh1man on 8/14/2024 in #support
permission and groups
I mean api. Can you provide an example ?
3 replies
SSolidJS
Created by sh1man on 6/4/2024 in #support
Excel table component
Thank you
3 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
thank you, I'll see when I have time
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
is this example relevant?
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
I want to send information to all clients
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
i can use sse to reset cache for all users using server ?
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
in your example from the solistart server I will not be able to send data to clients. Should we wait for the official release of ws with solidstart?
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
Thanks, I'll try
17 replies
SSolidJS
Created by sh1man on 4/1/2024 in #support
websocket get peers on the server
on the server I can't get peers
import { defineWebSocket, eventHandler } from "vinxi/http";

// Array of peers
export const peers: any = [];
export default eventHandler({
handler: () => {},
websocket: defineWebSocket({
async open(peer) {
// Add peer to the list of active
peers.push(peer);
console.log("WebSocket opened");
},

async message(peer, event) {
console.log("WebSocket message", event);
peer.send("YOOO");
},

async close(peer) {
console.log("WebSocket closed 3");
// Delete peer from the list of active
const index = peers.indexOf(peer);
if (index !== -1) {
peers.splice(index, 1);
}
},
}),
});
import { defineWebSocket, eventHandler } from "vinxi/http";

// Array of peers
export const peers: any = [];
export default eventHandler({
handler: () => {},
websocket: defineWebSocket({
async open(peer) {
// Add peer to the list of active
peers.push(peer);
console.log("WebSocket opened");
},

async message(peer, event) {
console.log("WebSocket message", event);
peer.send("YOOO");
},

async close(peer) {
console.log("WebSocket closed 3");
// Delete peer from the list of active
const index = peers.indexOf(peer);
if (index !== -1) {
peers.splice(index, 1);
}
},
}),
});
17 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
Enough time has passed)
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
yes
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
I didn't work with @solid-mediakit/auth and supabase. I can't help with this
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
No description
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
no, i use prisma
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
everything works fine for me
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
i use lucia
19 replies
SSolidJS
Created by sh1man on 3/7/2024 in #support
what write so as not to constantly write a redirect in every function in case of unauthorize
no
19 replies
SSolidJS
Created by sh1man on 3/20/2024 in #support
how do you usually convert a form field from string to number on rpc servershould i use valibot to
Error emr param Invalid type: Expected number but received "444"
3 replies
SSolidJS
Created by sh1man on 3/20/2024 in #support
how do you usually convert a form field from string to number on rpc servershould i use valibot to
Schema
export const EmrErrorSchema = object({
id: optional(string()),
hostname: string([minLength(1)]),
emr: number(),
errorMessage: string([minLength(1)]),
nameErrorMessage: string([minLength(1)]),
errorCategoryId: string(),
});
export const EmrErrorSchema = object({
id: optional(string()),
hostname: string([minLength(1)]),
emr: number(),
errorMessage: string([minLength(1)]),
nameErrorMessage: string([minLength(1)]),
errorCategoryId: string(),
});
Input
<TextFieldInput
name="emr"
color="neutral"
placeholder="1"
type="number"
variant="bordered"
/>
<TextFieldInput
name="emr"
color="neutral"
placeholder="1"
type="number"
variant="bordered"
/>
RPC
export async function updateOrCreateEmrErrorServerAction(form: FormData) {
const decoded = decode(form);
const parsed = await safeParseAsync(EmrErrorSchema, decoded);
if (!parsed.success) {
return rpcParseIssueResult(parsed.issues);
}
const { id, hostname, emr, errorMessage, nameErrorMessage, errorCategoryId } = parsed.output;

if (id) {
await db_client.emrError.update({
where: { id },
data: { hostname, emr, errorMessage, nameErrorMessage, errorCategoryId }
});
return reload({revalidate:EMR_ERRORS_CACHE_KEY});
} else {
await db_client.emrError.create({
data: { hostname, emr, errorMessage, nameErrorMessage, errorCategoryId }
});
return reload({revalidate:EMR_ERRORS_CACHE_KEY});
}
}
export async function updateOrCreateEmrErrorServerAction(form: FormData) {
const decoded = decode(form);
const parsed = await safeParseAsync(EmrErrorSchema, decoded);
if (!parsed.success) {
return rpcParseIssueResult(parsed.issues);
}
const { id, hostname, emr, errorMessage, nameErrorMessage, errorCategoryId } = parsed.output;

if (id) {
await db_client.emrError.update({
where: { id },
data: { hostname, emr, errorMessage, nameErrorMessage, errorCategoryId }
});
return reload({revalidate:EMR_ERRORS_CACHE_KEY});
} else {
await db_client.emrError.create({
data: { hostname, emr, errorMessage, nameErrorMessage, errorCategoryId }
});
return reload({revalidate:EMR_ERRORS_CACHE_KEY});
}
}
3 replies