Compare commits
	
		
			7 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 715e4559aa | |||
| d42c245c9d | |||
| ff840299d6 | |||
| f69c93ba91 | |||
| c0f2430590 | |||
| c999a500f8 | |||
| c668bb83f5 | 
| @@ -1,20 +1,9 @@ | |||||||
| FROM oven/bun:1.0.25-slim as builder | FROM oven/bun:1.0.25-slim as builder | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
|  |  | ||||||
| # Copy package files | COPY dist dist | ||||||
| COPY package*.json ./ | COPY nginx.conf /etc/nginx/conf.d/default.conf | ||||||
| COPY bun.lockb ./ |  | ||||||
|  |  | ||||||
| # Install dependencies |  | ||||||
| RUN bun install |  | ||||||
|  |  | ||||||
| # Copy source files |  | ||||||
| COPY . . |  | ||||||
|  |  | ||||||
| # Build the application |  | ||||||
| RUN bun run build |  | ||||||
|  |  | ||||||
| # Production stage |  | ||||||
| FROM nginx:alpine | FROM nginx:alpine | ||||||
| COPY --from=builder /app/dist /usr/share/nginx/html | COPY --from=builder /app/dist /usr/share/nginx/html | ||||||
| COPY nginx.conf /etc/nginx/conf.d/default.conf | COPY nginx.conf /etc/nginx/conf.d/default.conf | ||||||
|   | |||||||
| @@ -74,6 +74,13 @@ export const SignatureCard = ({ signature, onDelete, onUpdate }: SignatureCardPr | |||||||
|               <h3 className="text-white font-medium text-lg"> |               <h3 className="text-white font-medium text-lg"> | ||||||
|                 {signature.signame || 'Unnamed Signature'} |                 {signature.signame || 'Unnamed Signature'} | ||||||
|               </h3> |               </h3> | ||||||
|  |               {signature.note && ( | ||||||
|  |                 <div className="mt-2"> | ||||||
|  |                   <Badge variant="outline" className="bg-blue-900/50 text-blue-200 border-blue-500 px-3 py-1 text-sm font-semibold"> | ||||||
|  |                     {signature.note} | ||||||
|  |                   </Badge> | ||||||
|  |                 </div> | ||||||
|  |               )} | ||||||
|             </div> |             </div> | ||||||
|              |              | ||||||
|             {/* Additional Info */} |             {/* Additional Info */} | ||||||
|   | |||||||
| @@ -30,7 +30,8 @@ export const SignatureEditModal = ({ signature, isOpen, onClose, onSave }: Signa | |||||||
| 		signame: signature.signame || "", | 		signame: signature.signame || "", | ||||||
| 		dangerous: signature.dangerous || false, | 		dangerous: signature.dangerous || false, | ||||||
| 		scanned: signature.scanned || "", | 		scanned: signature.scanned || "", | ||||||
| 		identifier: signature.identifier || "" | 		identifier: signature.identifier || "", | ||||||
|  | 		note: signature.note || "" | ||||||
| 	}); | 	}); | ||||||
| 	const [isLoading, setIsLoading] = useState(false); | 	const [isLoading, setIsLoading] = useState(false); | ||||||
|  |  | ||||||
| @@ -45,7 +46,8 @@ export const SignatureEditModal = ({ signature, isOpen, onClose, onSave }: Signa | |||||||
| 				type: formData.type === "unknown" ? undefined : formData.type, | 				type: formData.type === "unknown" ? undefined : formData.type, | ||||||
| 				signame: formData.signame || undefined, | 				signame: formData.signame || undefined, | ||||||
| 				dangerous: formData.dangerous, | 				dangerous: formData.dangerous, | ||||||
| 				scanned: formData.scanned || undefined | 				scanned: formData.scanned || undefined, | ||||||
|  | 				note: formData.note || undefined | ||||||
| 			}); | 			}); | ||||||
| 			onClose(); | 			onClose(); | ||||||
| 			toast({ | 			toast({ | ||||||
| @@ -71,7 +73,8 @@ export const SignatureEditModal = ({ signature, isOpen, onClose, onSave }: Signa | |||||||
| 			signame: signature.signame || "", | 			signame: signature.signame || "", | ||||||
| 			dangerous: signature.dangerous || false, | 			dangerous: signature.dangerous || false, | ||||||
| 			scanned: signature.scanned || "", | 			scanned: signature.scanned || "", | ||||||
| 			identifier: signature.identifier || "" | 			identifier: signature.identifier || "", | ||||||
|  | 			note: signature.note || "" | ||||||
| 		}); | 		}); | ||||||
| 		onClose(); | 		onClose(); | ||||||
| 	}; | 	}; | ||||||
| @@ -152,6 +155,18 @@ export const SignatureEditModal = ({ signature, isOpen, onClose, onSave }: Signa | |||||||
| 						/> | 						/> | ||||||
| 					</div> | 					</div> | ||||||
|  |  | ||||||
|  | 					{/* Note Field - Add before the Dangerous Flag */} | ||||||
|  | 					<div className="space-y-2"> | ||||||
|  | 						<Label htmlFor="note" className="text-slate-200">Important Note</Label> | ||||||
|  | 						<Input | ||||||
|  | 							id="note" | ||||||
|  | 							value={formData.note} | ||||||
|  | 							onChange={(e) => setFormData(prev => ({ ...prev, note: e.target.value }))} | ||||||
|  | 							placeholder="Add important information about this signature" | ||||||
|  | 							className="bg-slate-700 border-slate-600 text-slate-200" | ||||||
|  | 						/> | ||||||
|  | 					</div> | ||||||
|  |  | ||||||
| 					{/* Dangerous Flag */} | 					{/* Dangerous Flag */} | ||||||
| 					<div className="flex items-center justify-between"> | 					<div className="flex items-center justify-between"> | ||||||
| 						<Label htmlFor="dangerous" className="text-slate-200">Dangerous</Label> | 						<Label htmlFor="dangerous" className="text-slate-200">Dangerous</Label> | ||||||
|   | |||||||
| @@ -117,6 +117,11 @@ export const SignatureListItem = ({ signature, onDelete, onUpdate }: SignatureLi | |||||||
| 									</Badge> | 									</Badge> | ||||||
| 								)} | 								)} | ||||||
| 							</h3> | 							</h3> | ||||||
|  | 							{signature.note && ( | ||||||
|  | 								<Badge variant="outline" className="bg-blue-900/50 text-blue-200 border-blue-500 px-2 py-0.5 text-sm font-semibold ml-2"> | ||||||
|  | 									{signature.note} | ||||||
|  | 								</Badge> | ||||||
|  | 							)} | ||||||
| 						</div> | 						</div> | ||||||
| 					</div> | 					</div> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -107,6 +107,7 @@ export type SignatureRecord = { | |||||||
| 	id: string | 	id: string | ||||||
| 	identifier: string | 	identifier: string | ||||||
| 	name?: string | 	name?: string | ||||||
|  | 	note?: string | ||||||
| 	scanned?: string | 	scanned?: string | ||||||
| 	system: RecordIdString | 	system: RecordIdString | ||||||
| 	type?: string | 	type?: string | ||||||
| @@ -118,6 +119,7 @@ export type SigviewRecord = { | |||||||
| 	dangerous?: boolean | 	dangerous?: boolean | ||||||
| 	id: string | 	id: string | ||||||
| 	identifier: string | 	identifier: string | ||||||
|  | 	note?: string | ||||||
| 	scanned?: string | 	scanned?: string | ||||||
| 	signame?: string | 	signame?: string | ||||||
| 	sysid?: RecordIdString | 	sysid?: RecordIdString | ||||||
|   | |||||||
| @@ -22,6 +22,7 @@ export const SystemView = () => { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   const saveSignature = async (signature: Signature): Promise<void> => { |   const saveSignature = async (signature: Signature): Promise<void> => { | ||||||
|  |     console.log(signature); | ||||||
|     try { |     try { | ||||||
|       // Check if signature already exists |       // Check if signature already exists | ||||||
|       let existingRecord: SignatureRecord | null = null; |       let existingRecord: SignatureRecord | null = null; | ||||||
| @@ -34,7 +35,7 @@ export const SystemView = () => { | |||||||
|       const newScannedPercentage = parseScannedPercentage(signature.scanned); |       const newScannedPercentage = parseScannedPercentage(signature.scanned); | ||||||
|  |  | ||||||
|       if (existingRecord) { |       if (existingRecord) { | ||||||
|         const updatedSignature: Pick<SignatureRecord, 'updated' | 'type' | 'name' | 'scanned'> = { |         const updatedSignature: Pick<SignatureRecord, 'updated' | 'type' | 'name' | 'scanned' | 'note'> = { | ||||||
|           updated: new Date().toISOString() |           updated: new Date().toISOString() | ||||||
|         } |         } | ||||||
|         // Existing record has no type and our new signature has a type |         // Existing record has no type and our new signature has a type | ||||||
| @@ -47,6 +48,8 @@ export const SystemView = () => { | |||||||
|         const existingScannedPercentage = parseScannedPercentage(existingRecord.scanned); |         const existingScannedPercentage = parseScannedPercentage(existingRecord.scanned); | ||||||
|         if (newScannedPercentage >= existingScannedPercentage) |         if (newScannedPercentage >= existingScannedPercentage) | ||||||
|           updatedSignature.scanned = signature.scanned; |           updatedSignature.scanned = signature.scanned; | ||||||
|  |         if (!!!existingRecord.note && !!signature.note) | ||||||
|  |           updatedSignature.note = signature.note; | ||||||
|         await pb.collection('signature').update(existingRecord.id, updatedSignature); |         await pb.collection('signature').update(existingRecord.id, updatedSignature); | ||||||
|         console.log(`Updated signature ${signature.identifier}: ${existingScannedPercentage}% -> ${newScannedPercentage}%`); |         console.log(`Updated signature ${signature.identifier}: ${existingScannedPercentage}% -> ${newScannedPercentage}%`); | ||||||
|       } else { |       } else { | ||||||
| @@ -57,7 +60,8 @@ export const SystemView = () => { | |||||||
|           name: signature.signame, |           name: signature.signame, | ||||||
|           type: signature.type, |           type: signature.type, | ||||||
|           dangerous: signature.dangerous, |           dangerous: signature.dangerous, | ||||||
|           scanned: signature.scanned |           scanned: signature.scanned, | ||||||
|  |           note: signature.note | ||||||
|         }); |         }); | ||||||
|         console.log(`Created new signature ${signature.identifier} with ${newScannedPercentage}% scan`); |         console.log(`Created new signature ${signature.identifier} with ${newScannedPercentage}% scan`); | ||||||
|       } |       } | ||||||
| @@ -70,10 +74,10 @@ export const SystemView = () => { | |||||||
|   const deleteSignature = async (signatureId: string): Promise<void> => { |   const deleteSignature = async (signatureId: string): Promise<void> => { | ||||||
|     try { |     try { | ||||||
|       await pb.collection('signature').delete(signatureId); |       await pb.collection('signature').delete(signatureId); | ||||||
|        |  | ||||||
|       // Invalidate queries to refresh the data |       // Invalidate queries to refresh the data | ||||||
|       queryClient.invalidateQueries({ queryKey: ['signatures', system] }); |       queryClient.invalidateQueries({ queryKey: ['signatures', system] }); | ||||||
|        |  | ||||||
|       toast({ |       toast({ | ||||||
|         title: "Signature Deleted", |         title: "Signature Deleted", | ||||||
|         description: "The signature has been successfully deleted.", |         description: "The signature has been successfully deleted.", | ||||||
| @@ -93,14 +97,14 @@ export const SystemView = () => { | |||||||
|     try { |     try { | ||||||
|       // Get the system ID for the current system |       // Get the system ID for the current system | ||||||
|       const systemId = await getSystemId(system); |       const systemId = await getSystemId(system); | ||||||
|        |  | ||||||
|       console.log('Updating signature:', { |       console.log('Updating signature:', { | ||||||
|         identifier: updatedSignature.identifier, |         identifier: updatedSignature.identifier, | ||||||
|         systemId, |         systemId, | ||||||
|         system, |         system, | ||||||
|         updatedSignature |         updatedSignature | ||||||
|       }); |       }); | ||||||
|        |  | ||||||
|       // Find the signature by identifier and system |       // Find the signature by identifier and system | ||||||
|       const existingRecord = await pb.collection('signature').getFirstListItem( |       const existingRecord = await pb.collection('signature').getFirstListItem( | ||||||
|         `identifier='${updatedSignature.identifier}' && system='${systemId}'` |         `identifier='${updatedSignature.identifier}' && system='${systemId}'` | ||||||
| @@ -125,14 +129,17 @@ export const SystemView = () => { | |||||||
|       if (updatedSignature.scanned !== undefined) { |       if (updatedSignature.scanned !== undefined) { | ||||||
|         updateData.scanned = updatedSignature.scanned; |         updateData.scanned = updatedSignature.scanned; | ||||||
|       } |       } | ||||||
|  |       if (updatedSignature.note !== undefined) { | ||||||
|  |         updateData.note = updatedSignature.note; | ||||||
|  |       } | ||||||
|  |  | ||||||
|       console.log('Update data:', updateData); |       console.log('Update data:', updateData); | ||||||
|  |  | ||||||
|       await pb.collection('signature').update(existingRecord.id, updateData); |       await pb.collection('signature').update(existingRecord.id, updateData); | ||||||
|        |  | ||||||
|       // Invalidate queries to refresh the data |       // Invalidate queries to refresh the data | ||||||
|       queryClient.invalidateQueries({ queryKey: ['signatures', system] }); |       queryClient.invalidateQueries({ queryKey: ['signatures', system] }); | ||||||
|        |  | ||||||
|       toast({ |       toast({ | ||||||
|         title: "Signature Updated", |         title: "Signature Updated", | ||||||
|         description: "The signature has been successfully updated.", |         description: "The signature has been successfully updated.", | ||||||
| @@ -199,7 +206,7 @@ export const SystemView = () => { | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         // Turn off clean mode after use |         // Turn off clean mode after use | ||||||
|         setCleanMode(false); |         // setCleanMode(false); | ||||||
|       } |       } | ||||||
|  |  | ||||||
|       // Save all new/updated signatures |       // Save all new/updated signatures | ||||||
|   | |||||||
| @@ -1,5 +1,28 @@ | |||||||
| import { SigviewRecord as Signature } from "@/lib/pbtypes"; | import { SigviewRecord as Signature } from "@/lib/pbtypes"; | ||||||
|  |  | ||||||
|  | const fourOutOfTen = [ | ||||||
|  |   "Angel Cartel Occupied Mining Colony", | ||||||
|  |   "Mul-Zatah Monastery", | ||||||
|  |   "Guristas Scout Outpost", | ||||||
|  |   "Sansha's Nation Occupied Mining Colony", | ||||||
|  |   "Serpentis Phi-Outpost", | ||||||
|  |   "Drone Infested Mine", | ||||||
|  | ]; | ||||||
|  | const fiveOutOfTen = [ | ||||||
|  |   "Angel's Red Light District", | ||||||
|  |   "Blood Raider Psychotropics Depot", | ||||||
|  |   "Guristas Hallucinogen Supply Waypoint", | ||||||
|  |   "Sansha's Nation Neural Paralytic Facility", | ||||||
|  |   "Serpentis Corporation Hydroponics Site", | ||||||
|  |   "Outgrowth Rogue Drone Hive", | ||||||
|  | ]; | ||||||
|  | function isFourOutOfTen(signature: string): boolean { | ||||||
|  |   return fourOutOfTen.some((s) => signature.includes(s)); | ||||||
|  | } | ||||||
|  | function isFiveOutOfTen(signature: string): boolean { | ||||||
|  |   return fiveOutOfTen.some((s) => signature.includes(s)); | ||||||
|  | } | ||||||
|  |  | ||||||
| export const parseSignature = (text: string): Omit<Signature, 'system' | 'id' | 'sysid'> | null => { | export const parseSignature = (text: string): Omit<Signature, 'system' | 'id' | 'sysid'> | null => { | ||||||
|   const parts = text.split('\t'); |   const parts = text.split('\t'); | ||||||
|   if (parts.length < 4) return null; |   if (parts.length < 4) return null; | ||||||
| @@ -10,12 +33,23 @@ export const parseSignature = (text: string): Omit<Signature, 'system' | 'id' | | |||||||
|     return null; |     return null; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   let note = ""; | ||||||
|  |   const isFour = isFourOutOfTen(parts[3]); | ||||||
|  |   if (isFour) { | ||||||
|  |     note = "4/10"; | ||||||
|  |   } | ||||||
|  |   const isFive = isFiveOutOfTen(parts[3]); | ||||||
|  |   if (isFive) { | ||||||
|  |     note = "5/10"; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   return { |   return { | ||||||
|     identifier: parts[0], |     identifier: parts[0], | ||||||
|     type: parts[2], |     type: parts[2], | ||||||
|     signame: parts[3], |     signame: parts[3], | ||||||
|     scanned: parts.length > 4 ? parts[4] : undefined, |     scanned: parts.length > 4 ? parts[4] : undefined, | ||||||
|     dangerous: false // TODO: Implement dangerous signature detection |     dangerous: false, // TODO: Implement dangerous signature detection | ||||||
|  |     note: note, | ||||||
|   }; |   }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								release.sh
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								release.sh
									
									
									
									
									
								
							| @@ -41,17 +41,8 @@ RELEASE_ID=$(echo $RELEASE_RESPONSE | awk -F'"id":' '{print $2+0; exit}') | |||||||
| echo "Release ID: $RELEASE_ID" | echo "Release ID: $RELEASE_ID" | ||||||
|  |  | ||||||
| echo "Uploading the things..." | echo "Uploading the things..." | ||||||
| WINRELEASE="./build/windows/x64/runner/Release/" | WINRELEASE="build/bin/signalerr.exe" | ||||||
| 7z a $WINRELEASE/$ZIP $WINRELEASE/* |  | ||||||
| curl -X POST \ | curl -X POST \ | ||||||
|   -H "Authorization: token $TOKEN" \ |   -H "Authorization: token $TOKEN" \ | ||||||
|   -F "attachment=@$WINRELEASE/$ZIP" \ |   -F "attachment=@$WINRELEASE" \ | ||||||
|   "$GITEA/api/v1/repos/$REPO/releases/${RELEASE_ID}/assets?name=$ZIP" |   "$GITEA/api/v1/repos/$REPO/releases/${RELEASE_ID}/assets?name=signalerr.exe" | ||||||
| rm $WINRELEASE/$ZIP |  | ||||||
|  |  | ||||||
| ANDROIDRELEASE="./build/app/outputs/flutter-apk/" |  | ||||||
| mv $ANDROIDRELEASE/app-release.apk $ANDROIDRELEASE/$APK |  | ||||||
| curl -X POST \ |  | ||||||
|   -H "Authorization: token $TOKEN" \ |  | ||||||
|   -F "attachment=@$ANDROIDRELEASE/$APK" \ |  | ||||||
|   "$GITEA/api/v1/repos/$REPO/releases/${RELEASE_ID}/assets?name=$APK" |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user