Skip to content

Commit 0311d24

Browse files
authored
Merge pull request #16 from Advanced-Crypto-Services/ACSOS_V0.1-Update1
Acsos v0.1 update1
2 parents 1bd1fdf + 8317a10 commit 0311d24

File tree

18 files changed

+479
-363
lines changed

18 files changed

+479
-363
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
import js from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tsparser from '@typescript-eslint/parser';
4+
import react from 'eslint-plugin-react';
5+
import reactHooks from 'eslint-plugin-react-hooks';
6+
7+
export default [
8+
js.configs.recommended,
9+
// JavaScript/JSX files
10+
{
11+
files: ['**/*.{js,jsx}'],
12+
plugins: {
13+
react,
14+
'react-hooks': reactHooks,
15+
},
16+
languageOptions: {
17+
ecmaVersion: 'latest',
18+
sourceType: 'module',
19+
parserOptions: {
20+
ecmaFeatures: {
21+
jsx: true,
22+
},
23+
},
24+
globals: {
25+
console: 'readonly',
26+
process: 'readonly',
27+
Buffer: 'readonly',
28+
__dirname: 'readonly',
29+
__filename: 'readonly',
30+
global: 'readonly',
31+
module: 'readonly',
32+
require: 'readonly',
33+
exports: 'readonly',
34+
document: 'readonly',
35+
window: 'readonly',
36+
fetch: 'readonly',
37+
setInterval: 'readonly',
38+
clearInterval: 'readonly',
39+
setTimeout: 'readonly',
40+
clearTimeout: 'readonly',
41+
confirm: 'readonly',
42+
NodeJS: 'readonly',
43+
preact: 'readonly',
44+
},
45+
},
46+
settings: {
47+
react: {
48+
pragma: 'h',
49+
fragment: 'Fragment',
50+
version: '16.0', // Preact compatibility
51+
},
52+
},
53+
rules: {
54+
// Core rules
55+
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
56+
'no-console': 'warn',
57+
'prefer-const': 'error',
58+
59+
// React/Preact specific rules
60+
'react/jsx-uses-react': 'error',
61+
'react/jsx-uses-vars': 'error',
62+
'react/jsx-no-undef': 'error',
63+
'react/jsx-no-duplicate-props': 'error',
64+
'react/no-unknown-property': ['error', { ignore: ['class'] }], // Allow 'class' for Preact
65+
'react/self-closing-comp': 'error',
66+
67+
// React Hooks rules
68+
'react-hooks/rules-of-hooks': 'error',
69+
'react-hooks/exhaustive-deps': 'warn',
70+
},
71+
},
72+
// TypeScript files
73+
{
74+
files: ['**/*.{ts,tsx}'],
75+
plugins: {
76+
'@typescript-eslint': tseslint,
77+
react,
78+
'react-hooks': reactHooks,
79+
},
80+
languageOptions: {
81+
parser: tsparser,
82+
ecmaVersion: 'latest',
83+
sourceType: 'module',
84+
parserOptions: {
85+
ecmaFeatures: {
86+
jsx: true,
87+
},
88+
project: './tsconfig.json',
89+
},
90+
globals: {
91+
console: 'readonly',
92+
process: 'readonly',
93+
Buffer: 'readonly',
94+
__dirname: 'readonly',
95+
__filename: 'readonly',
96+
global: 'readonly',
97+
module: 'readonly',
98+
require: 'readonly',
99+
exports: 'readonly',
100+
document: 'readonly',
101+
window: 'readonly',
102+
fetch: 'readonly',
103+
setInterval: 'readonly',
104+
clearInterval: 'readonly',
105+
setTimeout: 'readonly',
106+
clearTimeout: 'readonly',
107+
confirm: 'readonly',
108+
NodeJS: 'readonly',
109+
preact: 'readonly',
110+
},
111+
},
112+
settings: {
113+
react: {
114+
pragma: 'h',
115+
fragment: 'Fragment',
116+
version: '16.0', // Preact compatibility
117+
},
118+
},
119+
rules: {
120+
// Disable base rules that are covered by TypeScript equivalents
121+
'no-unused-vars': 'off',
122+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
123+
124+
// Core rules
125+
'no-console': 'warn',
126+
'prefer-const': 'error',
127+
128+
// TypeScript specific rules
129+
'@typescript-eslint/no-explicit-any': 'warn',
130+
'@typescript-eslint/explicit-function-return-type': 'off',
131+
'@typescript-eslint/explicit-module-boundary-types': 'off',
132+
133+
// React/Preact specific rules
134+
'react/jsx-uses-react': 'error',
135+
'react/jsx-uses-vars': 'error',
136+
'react/jsx-no-undef': 'error',
137+
'react/jsx-no-duplicate-props': 'error',
138+
'react/no-unknown-property': ['error', { ignore: ['class', 'stroke-linecap', 'stroke-linejoin', 'stroke-width'] }], // Allow Preact and SVG attributes
139+
'react/self-closing-comp': 'error',
140+
141+
// React Hooks rules
142+
'react-hooks/rules-of-hooks': 'error',
143+
'react-hooks/exhaustive-deps': 'warn',
144+
},
145+
},
146+
];

main/http_server/acs-os/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
<!-- Security Headers -->
1010
<meta
1111
http-equiv="Content-Security-Policy"
12-
content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' data:; img-src 'self' data: blob:; connect-src 'self'; font-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none';"
12+
content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' data:; img-src 'self' data: blob:; connect-src 'self'; font-src 'self' data:; object-src 'none'; base-uri 'self';"
1313
/>
1414
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
15-
<meta http-equiv="X-Frame-Options" content="DENY" />
1615
<meta http-equiv="X-XSS-Protection" content="1; mode=block" />
1716
<meta name="referrer" content="strict-origin-when-cross-origin" />
1817

main/http_server/acs-os/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
"tailwindcss": "^4.1.6"
1717
},
1818
"devDependencies": {
19+
"@eslint/js": "^9.28.0",
1920
"@preact/preset-vite": "^2.9.3",
2021
"@types/node": "^22.15.17",
21-
"eslint": "^8.57.1",
22-
"eslint-config-preact": "^1.5.0",
22+
"@typescript-eslint/eslint-plugin": "^8.20.0",
23+
"@typescript-eslint/parser": "^8.20.0",
24+
"eslint": "^9.28.0",
25+
"eslint-plugin-react": "^7.37.2",
26+
"eslint-plugin-react-hooks": "^5.1.0",
2327
"typescript": "^5.8.3",
2428
"vite": "^6.0.4"
25-
},
26-
"eslintConfig": {
27-
"extends": "preact"
2829
}
2930
}

main/http_server/acs-os/src/components/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function Button({
2929
...props
3030
}: ButtonProps) {
3131
// Base styles
32-
let baseStyles =
32+
const baseStyles =
3333
"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
3434

3535
// Apply variant styling

main/http_server/acs-os/src/components/Chart/RealTimeApiChart.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ const RealTimeApiChart = ({
263263
</p> */}
264264
</div>
265265
)}
266-
{!title && <div className='hidden sm:block'></div>}
266+
{!title && <div className='hidden sm:block' />}
267267
<div className='flex flex-col gap-2 order-2'>
268268
{/* Chart Duration Selector */}
269269
{chartConfigs && selectedConfigKey && onConfigChange && (
@@ -287,7 +287,7 @@ const RealTimeApiChart = ({
287287
</select>
288288
{isConfigChanging && (
289289
<div className='absolute right-2 top-1/2 transform -translate-y-1/2'>
290-
<div className='w-3 h-3 border border-blue-500 border-t-transparent rounded-full animate-spin'></div>
290+
<div className='w-3 h-3 border border-blue-500 border-t-transparent rounded-full animate-spin' />
291291
</div>
292292
)}
293293
</div>
@@ -306,7 +306,7 @@ const RealTimeApiChart = ({
306306
? "bg-green-500 animate-pulse"
307307
: "bg-gray-400"
308308
}`}
309-
></span>
309+
/>
310310
<span className='text-sm text-gray-600'>
311311
{isConfigChanging ? "Updating configuration..." : isRunning ? "Live" : "Paused"}{" "}
312312
{data.length} data points
@@ -324,7 +324,7 @@ const RealTimeApiChart = ({
324324
{isConfigChanging && (
325325
<div className='absolute inset-0 bg-white/80 backdrop-blur-sm z-10 flex items-center justify-center rounded-lg'>
326326
<div className='flex items-center gap-3 text-gray-600'>
327-
<div className='w-5 h-5 border-2 border-blue-500 border-t-transparent rounded-full animate-spin'></div>
327+
<div className='w-5 h-5 border-2 border-blue-500 border-t-transparent rounded-full animate-spin' />
328328
<span className='text-sm font-medium'>Updating chart configuration...</span>
329329
</div>
330330
</div>

main/http_server/acs-os/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export function Sidebar({ children }: SidebarProps) {
258258
)}
259259
>
260260
<div className='flex items-center gap-3'>
261-
<div className={`h-2 w-2 rounded-full ${isWifiConnected ? 'bg-emerald-500' : 'bg-red-500'}`}></div>
261+
<div className={`h-2 w-2 rounded-full ${isWifiConnected ? 'bg-emerald-500' : 'bg-red-500'}`} />
262262
{!collapsed && <span>{isWifiConnected ? 'Connected' : 'Offline'}</span>}
263263
</div>
264264
<button

main/http_server/acs-os/src/components/ThemeSelector.tsx

Lines changed: 0 additions & 92 deletions
This file was deleted.

main/http_server/acs-os/src/context/ThemeContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ const defaultThemeContext: ThemeContextType = {
3737
export const ThemeContext = createContext<ThemeContextType>(defaultThemeContext);
3838

3939
export function ThemeProvider({ children }: { children: ComponentChildren }) {
40-
// Disabled theme state - using static values
40+
// THEMES DISABLED FOR PRODUCTION - All theme functionality is intentionally disabled
41+
// to prevent API calls to /api/themes endpoints. Using static default theme only.
4142
const [themeData] = useState<ThemeData | null>({
4243
themeName: "THEME_ACS_DEFAULT",
4344
primaryColor: "#3b82f6",

main/http_server/acs-os/src/pages/Settings-Advanced/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export function SettingsAdvanced() {
174174
</div>
175175
<div className='mt-4'>
176176
<div className='flex items-center gap-3'>
177-
<div className='flex-1'></div>
177+
<div className='flex-1' />
178178
</div>
179179
</div>
180180
</div>
@@ -219,7 +219,7 @@ export function SettingsAdvanced() {
219219
</div>
220220
<div className='mt-4'>
221221
<div className='flex items-center gap-3'>
222-
<div className='flex-1'></div>
222+
<div className='flex-1' />
223223
</div>
224224
</div>
225225
</div>
@@ -252,7 +252,7 @@ export function SettingsAdvanced() {
252252
<div className='text-white text-sm font-medium'>{frequency} MHz</div>
253253
<div className='mt-4'>
254254
<div className='flex items-center gap-3'>
255-
<div className='flex-1'></div>
255+
<div className='flex-1' />
256256
</div>
257257
</div>
258258
</div>
@@ -271,7 +271,7 @@ export function SettingsAdvanced() {
271271
<div className='text-white text-sm font-medium'>{voltage} mV</div>
272272
<div className='mt-4'>
273273
<div className='flex items-center gap-3'>
274-
<div className='flex-1'></div>
274+
<div className='flex-1' />
275275
</div>
276276
</div>
277277
</div>

main/http_server/acs-os/src/pages/Settings/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export function Settings() {
138138
{/* Selected indicator */}
139139
{isSelected && (
140140
<div className='absolute top-2 right-2'>
141-
<div className='w-3 h-3 bg-blue-500 rounded-full'></div>
141+
<div className='w-3 h-3 bg-blue-500 rounded-full' />
142142
</div>
143143
)}
144144
</div>

0 commit comments

Comments
 (0)