Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/src/core/sso/sso-remove.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, renameSync, unlinkSync } from 'node:fs';

import { cliLogger } from '@app/core/log';
import { logger } from '@app/core/log';

export const removeSso = () => {
const path = '/usr/local/emhttp/plugins/dynamix/include/.login.php';
Expand All @@ -13,8 +13,8 @@ export const removeSso = () => {
unlinkSync(path);
}
renameSync(backupPath, path);
cliLogger.debug('SSO login file restored.');
logger.debug('SSO login file restored.');
} else {
cliLogger.debug('No SSO login file backup found.');
logger.debug('No SSO login file backup found.');
}
};
1 change: 0 additions & 1 deletion api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ try {
logger.info('SSO setup complete');
} else {
await removeSso();
logger.info('SSO removed');
}
} catch (err) {
logger.error('Failed to setup SSO with error: %o', err);
Expand Down
3 changes: 2 additions & 1 deletion api/src/unraid-api/cli/sso/add-sso-user.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export class AddSSOUserCommand extends CommandRunner {
writeConfigSync('flash');
this.logger.info(`User added ${options.username}`);
if (shouldRestart) {
this.logger.info('Restarting the Unraid API to enable to SSO button');
this.logger.info('Restarting the Unraid API in 5 seconds to enable the SSO button');
await new Promise(resolve => setTimeout(resolve, 5000));
Comment on lines +43 to +44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason behind this wait?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API wouldn't sync the config internally, and then wrote over the change.

await this.restartCommand.run([]);
}
}
Expand Down
11 changes: 11 additions & 0 deletions api/src/unraid-api/cli/start.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ export class StartCommand extends CommandRunner {

async run(_: string[], options: StartCommandOptions): Promise<void> {
this.logger.info('Starting the Unraid API');

// Update PM2 first if necessary
const { stderr: updateErr, stdout: updateOut } = await execa(PM2_PATH, ['update']);
if (updateOut) {
this.logger.log(updateOut);
}
if (updateErr) {
this.logger.error('PM2 Update Error: ' + updateErr);
process.exit(1);
}

const envLog = options['log-level'] ? `LOG_LEVEL=${options['log-level']}` : '';
const { stderr, stdout } = await execa(`${envLog} ${PM2_PATH}`.trim(), [
'start',
Expand Down
2 changes: 1 addition & 1 deletion unraid-ui/src/components/common/sheet/sheet.variants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cva } from "class-variance-authority";

export const sheetVariants = cva(
"fixed z-50 bg-background gap-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
"fixed z-50 bg-background gap-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 border-border",
{
variants: {
side: {
Expand Down
3 changes: 3 additions & 0 deletions unraid-ui/src/theme/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const unraidPreset = {
},
},
extend: {
borderColor: {
DEFAULT: "hsl(var(--border))",
},
fontFamily: {
sans: "clear-sans,ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",
},
Expand Down
3 changes: 0 additions & 3 deletions web/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ body {
@tailwind utilities;

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
Expand Down
2 changes: 1 addition & 1 deletion web/components/Notifications/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function onLoadMore() {
<div
v-if="notifications?.length > 0"
v-infinite-scroll="[onLoadMore, { canLoadMore: () => canLoadMore }]"
class="divide-y divide-gray-200 px-7 flex flex-col overflow-y-scroll flex-1 min-h-0"
class="divide-y px-7 flex flex-col overflow-y-scroll flex-1 min-h-0"
>
<NotificationsItem
v-for="notification in notifications"
Expand Down
2 changes: 1 addition & 1 deletion web/components/shadcn/sheet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export { default as SheetDescription } from './SheetDescription.vue'
export { default as SheetFooter } from './SheetFooter.vue'

export const sheetVariants = cva(
'fixed z-50 bg-muted dark:bg-background gap-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
'fixed z-50 bg-muted dark:bg-background gap-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 border-border',
{
variants: {
side: {
Expand Down
9 changes: 5 additions & 4 deletions web/store/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const defaultColors: Record<string, ThemeVariables> = {
'--popover-foreground': '0 0% 98%',
'--card': '0 0% 14.9%',
'--card-foreground': '0 0% 98%',
'--border': '0 0% 14.9%',
'--border': '0 0% 20%',
'--input': '0 0% 14.9%',
'--primary': '24 100% 50%',
'--primary-foreground': '0 0% 98%',
Expand Down Expand Up @@ -74,19 +74,20 @@ export const defaultColors: Record<string, ThemeVariables> = {
},
} as const;

export const DARK_THEMES = ['black', 'azure'] as const;

// used to swap the UPC text color when using the azure or gray theme
export const DARK_THEMES = ['black', 'gray'] as const;

export const useThemeStore = defineStore('theme', () => {
// State
const theme = ref<Theme | undefined>();

const activeColorVariables = ref<ThemeVariables>(defaultColors.light);
// Getters

const darkMode = computed<boolean>(
() => DARK_THEMES.includes(theme.value?.name as (typeof DARK_THEMES)[number]) ?? false
);
// used to swap the UPC text color when using the azure or gray theme

const bannerGradient = computed(() => {
if (!theme.value?.banner || !theme.value?.bannerGradient) {
return undefined;
Expand Down
Loading