Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #80 from sikelio/dev
Browse files Browse the repository at this point in the history
Last fixes for 0.0.2-beta
  • Loading branch information
sikelio authored Jul 4, 2023
2 parents 0df9c27 + 81648d4 commit ecf4f94
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 75 deletions.
122 changes: 61 additions & 61 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,67 +19,67 @@ import SingleEpisode from "./screens/SingleEpisode";
const Stack = createNativeStackNavigator();

const App = () => {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name='Server'
component={ Tabs }
options={{ headerShown: false }}
/>
<Stack.Screen
name="SingleServer"
component={ SingleServer }
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen
name="EditServer"
component={ EditServer }
options={({ route }) => ({ title: `Edit ${route.params.title}` })}
/>
<Stack.Screen
name="SingleSession"
component={ SingleSession }
options={({ route }) => ({ title: `Manage session - ${route.params.title}` })}
/>
<Stack.Screen
name="SingleAccount"
component={ SingleAccount }
options={({ route }) => ({ title: `User : ${route.params.title}` })}
/>
<Stack.Screen
name="ServerPreferences"
component={ ServerPreferences }
options={({ route }) => ({ title: `Server Preferences` })}
/>
<Stack.Screen
name="SingleLibrary"
component={ SingleLibrary }
options={({ route }) => ({ title: `Library : ${route.params.title}` })}
/>
<Stack.Screen
name="SingleMedia"
component={ SingleMedia }
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen
name="ScheduledTasks"
component={ ScheduledTasks }
options={({ route }) => ({ title: 'Scheduled tasks' })}
/>
<Stack.Screen
name="SingleSeason"
component={ SingleSeason }
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen
name="SingleEpisode"
component={ SingleEpisode }
options={({ route }) => ({ title: route.params.title })}
/>
</Stack.Navigator>
</NavigationContainer>
);
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name='Server'
component={ Tabs }
options={{ headerShown: false }}
/>
<Stack.Screen
name="SingleServer"
component={ SingleServer }
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen
name="EditServer"
component={ EditServer }
options={({ route }) => ({ title: `Edit ${route.params.title}` })}
/>
<Stack.Screen
name="SingleSession"
component={ SingleSession }
options={({ route }) => ({ title: `Manage session - ${route.params.title}` })}
/>
<Stack.Screen
name="SingleAccount"
component={ SingleAccount }
options={({ route }) => ({ title: `User : ${route.params.title}` })}
/>
<Stack.Screen
name="ServerPreferences"
component={ ServerPreferences }
options={({ route }) => ({ title: `Server Preferences` })}
/>
<Stack.Screen
name="SingleLibrary"
component={ SingleLibrary }
options={({ route }) => ({ title: `Library : ${route.params.title}` })}
/>
<Stack.Screen
name="SingleMedia"
component={ SingleMedia }
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen
name="ScheduledTasks"
component={ ScheduledTasks }
options={({ route }) => ({ title: 'Scheduled tasks' })}
/>
<Stack.Screen
name="SingleSeason"
component={ SingleSeason }
options={({ route }) => ({ title: route.params.title })}
/>
<Stack.Screen
name="SingleEpisode"
component={ SingleEpisode }
options={({ route }) => ({ title: route.params.title })}
/>
</Stack.Navigator>
</NavigationContainer>
);
}

export default App;
2 changes: 1 addition & 1 deletion src/components/ServerCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ServerCard = ({ server, index, navigation, refreshServerList, setSpinner }
{ server.protocol.toUpperCase() }
</Text>
<Text style={ [style.textColor] }>
<Text style={ [style.textLabel] }>IP :</Text>
<Text style={ [style.textLabel] }>IP : </Text>
{ server.ip }
</Text>
<Text style={ [style.textColor] }>
Expand Down
11 changes: 8 additions & 3 deletions src/screens/EditServer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import {
TextInput,
KeyboardAvoidingView,
Platform,
Modal,
Alert,
View,
Pressable
Linking
} from 'react-native';
import { useForm, Controller } from 'react-hook-form';
import { Button } from '@rneui/themed';
Expand Down Expand Up @@ -173,6 +171,13 @@ const EditServer = ({ route, navigation }) => {
name="token"
/>

<Text
onPress={() => Linking.openURL('https://github.com/sikelio/plexmanager/wiki/Getting-Plex-Media-Server-Access-Token')}
style={ [style.helpLink] }
>
How to I get my Plex Token ?
</Text>

<Button
title="Save"
color="#e5a00d"
Expand Down
8 changes: 8 additions & 0 deletions src/screens/NewServer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
KeyboardAvoidingView,
Platform,
Alert,
Linking
} from 'react-native';
import { useForm, Controller } from 'react-hook-form';
import { Button } from '@rneui/themed';
Expand Down Expand Up @@ -162,6 +163,13 @@ const NewServer = () => {
name="token"
/>

<Text
onPress={() => Linking.openURL('https://github.com/sikelio/plexmanager/wiki/Getting-Plex-Media-Server-Access-Token')}
style={ [style.helpLink] }
>
How to I get my Plex Token ?
</Text>

<Button
title="Submit"
color="#e5a00d"
Expand Down
54 changes: 44 additions & 10 deletions src/screens/SingleServer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { useState, useCallback } from "react";
import axios from "axios";
// Components
import { Button, ScrollView, View, Text, RefreshControl } from "react-native";
import { Button, ScrollView, View, Text, RefreshControl, Alert } from "react-native";
import { Card, ListItem, Avatar } from '@rneui/themed';
import Spinner from "react-native-loading-spinner-overlay";
import FastImage from "react-native-fast-image";
Expand Down Expand Up @@ -35,6 +35,7 @@ const SingleServer = ({ route, navigation }) => {
const [ librariesList, setLibrariesList ] = useState(false);
const [ identityList, setIdentityList ] = useState(false);
const [ maintenanceList, setMaintenanceList ] = useState(false);
const [ securityList, setSecurityList ] = useState(false);
const [ scheduledTaskList, setScheduledTaskList ] = useState(false);

const updateData = async () => {
Expand Down Expand Up @@ -505,15 +506,15 @@ const SingleServer = ({ route, navigation }) => {
<Card>
<>
<ListItem.Accordion
content={
<ListItem.Content>
<ListItem.Title style={ [style.accordionTitle] }>Tasks</ListItem.Title>
</ListItem.Content>
}
isExpanded={ scheduledTaskList }
onPress={() => {
setScheduledTaskList(!scheduledTaskList);
}}
content={
<ListItem.Content>
<ListItem.Title style={ [style.accordionTitle] }>Tasks</ListItem.Title>
</ListItem.Content>
}
isExpanded={ scheduledTaskList }
onPress={() => {
setScheduledTaskList(!scheduledTaskList);
}}
>
<ListItem
bottomDivider
Expand Down Expand Up @@ -553,6 +554,39 @@ const SingleServer = ({ route, navigation }) => {
</ListItem.Accordion>
</>
</Card>

<Card>
<>
<ListItem.Accordion
content={
<ListItem.Content>
<ListItem.Title style={ [style.accordionTitle] }>Security</ListItem.Title>
</ListItem.Content>
}
isExpanded={ securityList }
onPress={() => {
setSecurityList(!securityList);
}}
>
<ListItem
bottomDivider
>
<ListItem.Content>
<View style={ [style.updateAllView] }>
<Button
title='Get Transient Token'
color='#e5a00d'
onPress={() => {
Alert.alert('WIP', 'This functionality is being delayed because of Bad Request by following the documentation.');
// sendRequest(`${server.protocol}://${server.ip}:${server.port}/security/token?X-Plex-Token=${server.token}`);
}}
/>
</View>
</ListItem.Content>
</ListItem>
</ListItem.Accordion>
</>
</Card>
</ScrollView>
</View>
);
Expand Down
4 changes: 4 additions & 0 deletions src/style/NewServerStyle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const style = StyleSheet.create({
},
sendBtn: {
marginRight: 10
},
helpLink: {
textDecorationLine: 'underline',
marginBottom: 10
}
});

Expand Down

0 comments on commit ecf4f94

Please sign in to comment.