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

Commit ecf4f94

Browse files
authored
Merge pull request #80 from sikelio/dev
Last fixes for 0.0.2-beta
2 parents 0df9c27 + 81648d4 commit ecf4f94

6 files changed

Lines changed: 126 additions & 75 deletions

File tree

src/App.jsx

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -19,67 +19,67 @@ import SingleEpisode from "./screens/SingleEpisode";
1919
const Stack = createNativeStackNavigator();
2020

2121
const App = () => {
22-
return (
23-
<NavigationContainer>
24-
<Stack.Navigator>
25-
<Stack.Screen
26-
name='Server'
27-
component={ Tabs }
28-
options={{ headerShown: false }}
29-
/>
30-
<Stack.Screen
31-
name="SingleServer"
32-
component={ SingleServer }
33-
options={({ route }) => ({ title: route.params.title })}
34-
/>
35-
<Stack.Screen
36-
name="EditServer"
37-
component={ EditServer }
38-
options={({ route }) => ({ title: `Edit ${route.params.title}` })}
39-
/>
40-
<Stack.Screen
41-
name="SingleSession"
42-
component={ SingleSession }
43-
options={({ route }) => ({ title: `Manage session - ${route.params.title}` })}
44-
/>
45-
<Stack.Screen
46-
name="SingleAccount"
47-
component={ SingleAccount }
48-
options={({ route }) => ({ title: `User : ${route.params.title}` })}
49-
/>
50-
<Stack.Screen
51-
name="ServerPreferences"
52-
component={ ServerPreferences }
53-
options={({ route }) => ({ title: `Server Preferences` })}
54-
/>
55-
<Stack.Screen
56-
name="SingleLibrary"
57-
component={ SingleLibrary }
58-
options={({ route }) => ({ title: `Library : ${route.params.title}` })}
59-
/>
60-
<Stack.Screen
61-
name="SingleMedia"
62-
component={ SingleMedia }
63-
options={({ route }) => ({ title: route.params.title })}
64-
/>
65-
<Stack.Screen
66-
name="ScheduledTasks"
67-
component={ ScheduledTasks }
68-
options={({ route }) => ({ title: 'Scheduled tasks' })}
69-
/>
70-
<Stack.Screen
71-
name="SingleSeason"
72-
component={ SingleSeason }
73-
options={({ route }) => ({ title: route.params.title })}
74-
/>
75-
<Stack.Screen
76-
name="SingleEpisode"
77-
component={ SingleEpisode }
78-
options={({ route }) => ({ title: route.params.title })}
79-
/>
80-
</Stack.Navigator>
81-
</NavigationContainer>
82-
);
22+
return (
23+
<NavigationContainer>
24+
<Stack.Navigator>
25+
<Stack.Screen
26+
name='Server'
27+
component={ Tabs }
28+
options={{ headerShown: false }}
29+
/>
30+
<Stack.Screen
31+
name="SingleServer"
32+
component={ SingleServer }
33+
options={({ route }) => ({ title: route.params.title })}
34+
/>
35+
<Stack.Screen
36+
name="EditServer"
37+
component={ EditServer }
38+
options={({ route }) => ({ title: `Edit ${route.params.title}` })}
39+
/>
40+
<Stack.Screen
41+
name="SingleSession"
42+
component={ SingleSession }
43+
options={({ route }) => ({ title: `Manage session - ${route.params.title}` })}
44+
/>
45+
<Stack.Screen
46+
name="SingleAccount"
47+
component={ SingleAccount }
48+
options={({ route }) => ({ title: `User : ${route.params.title}` })}
49+
/>
50+
<Stack.Screen
51+
name="ServerPreferences"
52+
component={ ServerPreferences }
53+
options={({ route }) => ({ title: `Server Preferences` })}
54+
/>
55+
<Stack.Screen
56+
name="SingleLibrary"
57+
component={ SingleLibrary }
58+
options={({ route }) => ({ title: `Library : ${route.params.title}` })}
59+
/>
60+
<Stack.Screen
61+
name="SingleMedia"
62+
component={ SingleMedia }
63+
options={({ route }) => ({ title: route.params.title })}
64+
/>
65+
<Stack.Screen
66+
name="ScheduledTasks"
67+
component={ ScheduledTasks }
68+
options={({ route }) => ({ title: 'Scheduled tasks' })}
69+
/>
70+
<Stack.Screen
71+
name="SingleSeason"
72+
component={ SingleSeason }
73+
options={({ route }) => ({ title: route.params.title })}
74+
/>
75+
<Stack.Screen
76+
name="SingleEpisode"
77+
component={ SingleEpisode }
78+
options={({ route }) => ({ title: route.params.title })}
79+
/>
80+
</Stack.Navigator>
81+
</NavigationContainer>
82+
);
8383
}
8484

8585
export default App;

src/components/ServerCard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const ServerCard = ({ server, index, navigation, refreshServerList, setSpinner }
3131
{ server.protocol.toUpperCase() }
3232
</Text>
3333
<Text style={ [style.textColor] }>
34-
<Text style={ [style.textLabel] }>IP :</Text>
34+
<Text style={ [style.textLabel] }>IP : </Text>
3535
{ server.ip }
3636
</Text>
3737
<Text style={ [style.textColor] }>

src/screens/EditServer.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import {
44
TextInput,
55
KeyboardAvoidingView,
66
Platform,
7-
Modal,
87
Alert,
9-
View,
10-
Pressable
8+
Linking
119
} from 'react-native';
1210
import { useForm, Controller } from 'react-hook-form';
1311
import { Button } from '@rneui/themed';
@@ -173,6 +171,13 @@ const EditServer = ({ route, navigation }) => {
173171
name="token"
174172
/>
175173

174+
<Text
175+
onPress={() => Linking.openURL('https://github.com/sikelio/plexmanager/wiki/Getting-Plex-Media-Server-Access-Token')}
176+
style={ [style.helpLink] }
177+
>
178+
How to I get my Plex Token ?
179+
</Text>
180+
176181
<Button
177182
title="Save"
178183
color="#e5a00d"

src/screens/NewServer.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
KeyboardAvoidingView,
66
Platform,
77
Alert,
8+
Linking
89
} from 'react-native';
910
import { useForm, Controller } from 'react-hook-form';
1011
import { Button } from '@rneui/themed';
@@ -162,6 +163,13 @@ const NewServer = () => {
162163
name="token"
163164
/>
164165

166+
<Text
167+
onPress={() => Linking.openURL('https://github.com/sikelio/plexmanager/wiki/Getting-Plex-Media-Server-Access-Token')}
168+
style={ [style.helpLink] }
169+
>
170+
How to I get my Plex Token ?
171+
</Text>
172+
165173
<Button
166174
title="Submit"
167175
color="#e5a00d"

src/screens/SingleServer.jsx

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React, { useState, useCallback } from "react";
33
import axios from "axios";
44
// Components
5-
import { Button, ScrollView, View, Text, RefreshControl } from "react-native";
5+
import { Button, ScrollView, View, Text, RefreshControl, Alert } from "react-native";
66
import { Card, ListItem, Avatar } from '@rneui/themed';
77
import Spinner from "react-native-loading-spinner-overlay";
88
import FastImage from "react-native-fast-image";
@@ -35,6 +35,7 @@ const SingleServer = ({ route, navigation }) => {
3535
const [ librariesList, setLibrariesList ] = useState(false);
3636
const [ identityList, setIdentityList ] = useState(false);
3737
const [ maintenanceList, setMaintenanceList ] = useState(false);
38+
const [ securityList, setSecurityList ] = useState(false);
3839
const [ scheduledTaskList, setScheduledTaskList ] = useState(false);
3940

4041
const updateData = async () => {
@@ -505,15 +506,15 @@ const SingleServer = ({ route, navigation }) => {
505506
<Card>
506507
<>
507508
<ListItem.Accordion
508-
content={
509-
<ListItem.Content>
510-
<ListItem.Title style={ [style.accordionTitle] }>Tasks</ListItem.Title>
511-
</ListItem.Content>
512-
}
513-
isExpanded={ scheduledTaskList }
514-
onPress={() => {
515-
setScheduledTaskList(!scheduledTaskList);
516-
}}
509+
content={
510+
<ListItem.Content>
511+
<ListItem.Title style={ [style.accordionTitle] }>Tasks</ListItem.Title>
512+
</ListItem.Content>
513+
}
514+
isExpanded={ scheduledTaskList }
515+
onPress={() => {
516+
setScheduledTaskList(!scheduledTaskList);
517+
}}
517518
>
518519
<ListItem
519520
bottomDivider
@@ -553,6 +554,39 @@ const SingleServer = ({ route, navigation }) => {
553554
</ListItem.Accordion>
554555
</>
555556
</Card>
557+
558+
<Card>
559+
<>
560+
<ListItem.Accordion
561+
content={
562+
<ListItem.Content>
563+
<ListItem.Title style={ [style.accordionTitle] }>Security</ListItem.Title>
564+
</ListItem.Content>
565+
}
566+
isExpanded={ securityList }
567+
onPress={() => {
568+
setSecurityList(!securityList);
569+
}}
570+
>
571+
<ListItem
572+
bottomDivider
573+
>
574+
<ListItem.Content>
575+
<View style={ [style.updateAllView] }>
576+
<Button
577+
title='Get Transient Token'
578+
color='#e5a00d'
579+
onPress={() => {
580+
Alert.alert('WIP', 'This functionality is being delayed because of Bad Request by following the documentation.');
581+
// sendRequest(`${server.protocol}://${server.ip}:${server.port}/security/token?X-Plex-Token=${server.token}`);
582+
}}
583+
/>
584+
</View>
585+
</ListItem.Content>
586+
</ListItem>
587+
</ListItem.Accordion>
588+
</>
589+
</Card>
556590
</ScrollView>
557591
</View>
558592
);

src/style/NewServerStyle.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ const style = StyleSheet.create({
7676
},
7777
sendBtn: {
7878
marginRight: 10
79+
},
80+
helpLink: {
81+
textDecorationLine: 'underline',
82+
marginBottom: 10
7983
}
8084
});
8185

0 commit comments

Comments
 (0)