mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-22 10:51:02 +01:00
feat: sort / description improvements on scoring page (#147)
- swap upgrade / format descriptions - default to advanced format view - persist view choice after modal closes / tab changes
This commit is contained in:
@@ -173,11 +173,6 @@ export const pushFiles = async () => {
|
|||||||
const response = await axios.post(`/api/git/push`);
|
const response = await axios.post(`/api/git/push`);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(
|
|
||||||
'Push error full structure:',
|
|
||||||
JSON.stringify(error.response?.data, null, 2)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (error.response?.data?.error) {
|
if (error.response?.data?.error) {
|
||||||
return error.response.data;
|
return error.response.data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ export const updateArrConfig = async (id, config) => {
|
|||||||
export const getArrConfigs = async () => {
|
export const getArrConfigs = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`/api/arr/config`);
|
const response = await axios.get(`/api/arr/config`);
|
||||||
console.log('Raw axios response:', response);
|
|
||||||
console.log('Response data:', response.data);
|
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching arr configs:', error);
|
console.error('Error fetching arr configs:', error);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {useState} from 'react';
|
import React, {useState, useEffect} from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import SearchBar from '@ui/DataBar/SearchBar';
|
import SearchBar from '@ui/DataBar/SearchBar';
|
||||||
import useSearch from '@hooks/useSearch';
|
import useSearch from '@hooks/useSearch';
|
||||||
@@ -7,9 +7,21 @@ import BasicView from './BasicView';
|
|||||||
import {ChevronDown, Settings, List} from 'lucide-react';
|
import {ChevronDown, Settings, List} from 'lucide-react';
|
||||||
|
|
||||||
const FormatSettings = ({formats, onScoreChange}) => {
|
const FormatSettings = ({formats, onScoreChange}) => {
|
||||||
const [isAdvancedView, setIsAdvancedView] = useState(false);
|
// Initialize state from localStorage, falling back to true if no value is stored
|
||||||
|
const [isAdvancedView, setIsAdvancedView] = useState(() => {
|
||||||
|
const stored = localStorage.getItem('formatSettingsView');
|
||||||
|
return stored === null ? true : JSON.parse(stored);
|
||||||
|
});
|
||||||
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||||
|
|
||||||
|
// Save to localStorage whenever isAdvancedView changes
|
||||||
|
useEffect(() => {
|
||||||
|
localStorage.setItem(
|
||||||
|
'formatSettingsView',
|
||||||
|
JSON.stringify(isAdvancedView)
|
||||||
|
);
|
||||||
|
}, [isAdvancedView]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
searchTerms,
|
searchTerms,
|
||||||
currentInput,
|
currentInput,
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ const ProfileScoringTab = ({
|
|||||||
Upgrade Settings
|
Upgrade Settings
|
||||||
</h2>
|
</h2>
|
||||||
<p className='text-xs text-gray-500 dark:text-gray-400'>
|
<p className='text-xs text-gray-500 dark:text-gray-400'>
|
||||||
Assign scores to different formats to control
|
Configure when upgrades should be downloaded and
|
||||||
download preferences
|
what scores are required
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col items-end space-y-1'>
|
<div className='flex flex-col items-end space-y-1'>
|
||||||
@@ -70,8 +70,9 @@ const ProfileScoringTab = ({
|
|||||||
Format Settings
|
Format Settings
|
||||||
</h2>
|
</h2>
|
||||||
<p className='text-xs text-gray-500 dark:text-gray-400'>
|
<p className='text-xs text-gray-500 dark:text-gray-400'>
|
||||||
Configure when upgrades should be downloaded and what
|
Assign scores to different formats to control download
|
||||||
scores are required
|
preferences. View formats in the traditional arr style,
|
||||||
|
or in filtered A/V grids.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import React from 'react';
|
|||||||
import {GitCommit, Code, FileText, Settings, File} from 'lucide-react';
|
import {GitCommit, Code, FileText, Settings, File} from 'lucide-react';
|
||||||
|
|
||||||
const PushRow = ({change}) => {
|
const PushRow = ({change}) => {
|
||||||
console.log('Push Row Change:', change);
|
|
||||||
|
|
||||||
const getTypeIcon = type => {
|
const getTypeIcon = type => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'Regex Pattern':
|
case 'Regex Pattern':
|
||||||
|
|||||||
Reference in New Issue
Block a user