Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Proxdroid
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
jonasled
Proxdroid
Commits
13f4d7c8
Commit
13f4d7c8
authored
Sep 23, 2020
by
jonasled
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
880a6d56
6b07e7df
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
85 additions
and
16 deletions
+85
-16
app/src/main/java/de/jonasled/proxdroid/ClusterActivity.java
app/src/main/java/de/jonasled/proxdroid/ClusterActivity.java
+8
-1
app/src/main/java/de/jonasled/proxdroid/ClusterListAdapter.java
...c/main/java/de/jonasled/proxdroid/ClusterListAdapter.java
+18
-1
app/src/main/java/de/jonasled/proxdroid/ServerListAdapter.java
...rc/main/java/de/jonasled/proxdroid/ServerListAdapter.java
+13
-1
app/src/main/java/de/jonasled/proxdroid/StorageControlActivity.java
...in/java/de/jonasled/proxdroid/StorageControlActivity.java
+4
-1
app/src/main/java/de/jonasled/proxdroid/backupActivity.java
app/src/main/java/de/jonasled/proxdroid/backupActivity.java
+8
-5
app/src/main/play/release-notes/de-DE/beta.txt
app/src/main/play/release-notes/de-DE/beta.txt
+0
-2
app/src/main/play/release-notes/en-US/beta.txt
app/src/main/play/release-notes/en-US/beta.txt
+3
-0
app/src/main/res/layout/activity_listview.xml
app/src/main/res/layout/activity_listview.xml
+19
-5
app/src/main/res/values-de/strings.xml
app/src/main/res/values-de/strings.xml
+12
-0
No files found.
app/src/main/java/de/jonasled/proxdroid/ClusterActivity.java
View file @
13f4d7c8
...
...
@@ -53,6 +53,7 @@ public class ClusterActivity extends AppCompatActivity {
ArrayList
<
String
>
nodes
=
new
ArrayList
<>();
ArrayList
<
String
>
label
=
new
ArrayList
<>();
ArrayList
<
Integer
>
icon
=
new
ArrayList
<>();
ArrayList
<
Integer
>
storageUsage
=
new
ArrayList
<>();
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
adapter
;
ListView
listView
;
List
sortedKeys
;
...
...
@@ -322,6 +323,7 @@ public class ClusterActivity extends AppCompatActivity {
temp
.
add
(
resource
.
getString
(
"node"
));
//add the node name
temp
.
add
(
"storage"
);
//add the type
temp
.
add
(
resource
.
getString
(
"status"
));
//add the curent status (online, offline)
temp
.
add
(
""
+
Math
.
round
(
resource
.
getDouble
(
"disk"
)
/
resource
.
getDouble
(
"maxdisk"
)
*
100
));
vmctList
.
put
(
resource
.
getString
(
"id"
),
temp
);
//add this array to the vm dict withe the id and the node as key
}
}
...
...
@@ -503,18 +505,21 @@ public class ClusterActivity extends AppCompatActivity {
label
.
add
(
vmctList
.
get
(
key
.
toString
()).
get
(
0
)
+
" ("
+
key
+
")"
);
//add the label for the VM to the label array
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
3
)
==
"lxc"
)
{
//check if vm is qemu or LXC and if online or not
storageUsage
.
add
(-
1
);
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
4
).
equals
(
"running"
))
{
icon
.
add
(
R
.
drawable
.
lxc_running
);
//lxc normal color
}
else
{
icon
.
add
(
R
.
drawable
.
lxc_offline
);
//lxc grey and white
}
}
else
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
3
)
==
"qemu"
)
{
storageUsage
.
add
(-
1
);
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
4
).
equals
(
"running"
))
{
icon
.
add
(
R
.
drawable
.
qemu_running
);
//qemu color
}
else
{
icon
.
add
(
R
.
drawable
.
qemu_offline
);
//qemu grey and white
}
}
else
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
3
)
==
"node"
)
{
storageUsage
.
add
(-
1
);
label
.
set
(
label
.
size
()
-
1
,
vmctList
.
get
(
key
.
toString
()).
get
(
0
));
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
4
).
equals
(
"online"
))
{
icon
.
add
(
R
.
drawable
.
server_online
);
//qemu color
...
...
@@ -522,6 +527,7 @@ public class ClusterActivity extends AppCompatActivity {
icon
.
add
(
R
.
drawable
.
server_offline
);
//qemu grey and white
}
}
else
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
3
)
==
"storage"
)
{
storageUsage
.
add
((
int
)
Integer
.
parseInt
(
vmctList
.
get
(
key
.
toString
()).
get
(
5
)));
label
.
set
(
label
.
size
()
-
1
,
vmctList
.
get
(
key
.
toString
()).
get
(
0
)
+
" ("
+
vmctList
.
get
(
key
.
toString
()).
get
(
2
)
+
")"
);
if
(
vmctList
.
get
(
key
.
toString
()).
get
(
4
).
equals
(
"available"
))
{
icon
.
add
(
R
.
drawable
.
storage_online
);
//qemu color
...
...
@@ -533,8 +539,9 @@ public class ClusterActivity extends AppCompatActivity {
vmctList
=
temp
;
int
[]
iconsInt
=
Ints
.
toArray
(
icon
);
int
[]
usageInt
=
Ints
.
toArray
(
storageUsage
);
String
[]
labelArray
=
label
.
toArray
(
new
String
[
0
]);
//convert the List to array and show the listView
adapter
=
new
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
(
ClusterActivity
.
this
,
labelArray
,
iconsInt
);
adapter
=
new
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
(
ClusterActivity
.
this
,
labelArray
,
iconsInt
,
usageInt
);
listView
.
setAdapter
(
adapter
);
}
}
...
...
app/src/main/java/de/jonasled/proxdroid/ClusterListAdapter.java
View file @
13f4d7c8
...
...
@@ -10,21 +10,28 @@ import android.view.ViewGroup;
import
android.widget.BaseAdapter
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
androidx.core.content.res.TypedArrayUtils
;
import
androidx.preference.Preference
;
import
androidx.preference.PreferenceManager
;
import
javax.annotation.Nullable
;
public
class
ClusterListAdapter
extends
BaseAdapter
{
//This is used to make the list of your VMs and Container
private
String
title
[];
private
int
image
[];
private
int
usage
[];
Context
context
;
LayoutInflater
inflter
;
public
ClusterListAdapter
(
Context
applicationContext
,
String
[]
title
,
int
[]
image
)
{
public
ClusterListAdapter
(
Context
applicationContext
,
String
[]
title
,
int
[]
image
,
int
[]
usage
)
{
this
.
title
=
title
;
this
.
image
=
image
;
this
.
usage
=
usage
;
inflter
=
(
LayoutInflater
.
from
(
applicationContext
));
context
=
applicationContext
;
}
...
...
@@ -47,9 +54,19 @@ public class ClusterListAdapter extends BaseAdapter { //This is used to make the
@Override
public
View
getView
(
int
i
,
View
view
,
ViewGroup
viewGroup
)
{
int
size
=
Integer
.
parseInt
(
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getString
(
"textSize"
,
"30"
));
//get the text size
view
=
inflter
.
inflate
(
R
.
layout
.
activity_listview
,
null
);
//set the view to a new entry
TextView
titleTV
=
view
.
findViewById
(
R
.
id
.
title
);
//find the textView
ImageView
imageIV
=
view
.
findViewById
(
R
.
id
.
image
);
//find the ImageView
ProgressBar
storageUsage
=
view
.
findViewById
(
R
.
id
.
usageBar
);
System
.
out
.
println
(
usage
[
i
]);
if
(
usage
[
i
]
==
-
1
)
{
storageUsage
.
setVisibility
(
View
.
GONE
);
}
else
{
storageUsage
.
setProgress
(
usage
[
i
]);
}
titleTV
.
setText
(
title
[
i
]);
//set the title
try
{
imageIV
.
setImageResource
(
image
[
i
]);
//set the image (Proxmox or LXC logo)
...
...
app/src/main/java/de/jonasled/proxdroid/ServerListAdapter.java
View file @
13f4d7c8
...
...
@@ -6,16 +6,20 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.ImageView
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
androidx.preference.PreferenceManager
;
import
javax.annotation.Nullable
;
public
class
ServerListAdapter
extends
BaseAdapter
{
private
String
title
[];
private
int
image
;
private
LayoutInflater
layoutInflater
;
private
Context
context
;
public
ServerListAdapter
(
Context
applicationContext
,
String
[]
title
,
int
image
)
{
this
.
title
=
title
;
this
.
image
=
image
;
...
...
@@ -25,7 +29,11 @@ public class ServerListAdapter extends BaseAdapter {
@Override
public
int
getCount
()
{
return
title
.
length
;
try
{
return
title
.
length
;
}
catch
(
Exception
e
){
return
0
;
}
}
@Override
...
...
@@ -43,10 +51,14 @@ public class ServerListAdapter extends BaseAdapter {
public
View
getView
(
int
i
,
View
view
,
ViewGroup
viewGroup
)
{
int
size
=
Integer
.
parseInt
(
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getString
(
"textSize"
,
"30"
));
//get the text size
view
=
layoutInflater
.
inflate
(
R
.
layout
.
activity_listview
,
null
);
TextView
titleTV
=
view
.
findViewById
(
R
.
id
.
title
);
ImageView
imageIV
=
view
.
findViewById
(
R
.
id
.
image
);
titleTV
.
setText
(
title
[
i
]);
imageIV
.
setImageResource
(
image
);
ProgressBar
storageUsage
=
view
.
findViewById
(
R
.
id
.
usageBar
);
storageUsage
.
setVisibility
(
View
.
GONE
);
titleTV
.
setTextSize
(
size
);
//set the text size
imageIV
.
getLayoutParams
().
width
=
(
int
)
(
size
*
context
.
getResources
().
getDisplayMetrics
().
density
);
//set the image size, according to the text size
...
...
app/src/main/java/de/jonasled/proxdroid/StorageControlActivity.java
View file @
13f4d7c8
...
...
@@ -286,8 +286,10 @@ public class StorageControlActivity extends AppCompatActivity {
ArrayList
<
String
>
label
=
new
ArrayList
<>();
ArrayList
<
Integer
>
icon
=
new
ArrayList
<>();
ArrayList
<
Integer
>
usage
=
new
ArrayList
<>();
for
(
Object
key
:
sortedKeys
.
toArray
())
{
//parse the sorted key list
usage
.
add
(-
1
);
ArrayList
<
String
>
currentObject
=
storageContent
.
get
(
key
);
label
.
add
(
currentObject
.
get
(
0
));
if
(
currentObject
.
get
(
1
).
equals
(
"backup"
))
icon
.
add
(
R
.
drawable
.
backup
);
...
...
@@ -297,8 +299,9 @@ public class StorageControlActivity extends AppCompatActivity {
if
(
currentObject
.
get
(
1
).
equals
(
"images"
))
icon
.
add
(
R
.
drawable
.
lxc_running
);
int
[]
iconsInt
=
Ints
.
toArray
(
icon
);
int
[]
usageInt
=
Ints
.
toArray
(
usage
);
String
[]
labelArray
=
label
.
toArray
(
new
String
[
0
]);
//convert the List to array and show the listView
adapter
=
new
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
(
StorageControlActivity
.
this
,
labelArray
,
iconsInt
);
adapter
=
new
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
(
StorageControlActivity
.
this
,
labelArray
,
iconsInt
,
usageInt
);
storageList
.
setAdapter
(
adapter
);
}
HelperFunctions
.
formatGraph
(
usageGraph
,
usageGraphSeries
);
...
...
app/src/main/java/de/jonasled/proxdroid/backupActivity.java
View file @
13f4d7c8
...
...
@@ -154,16 +154,19 @@ public class backupActivity extends AppCompatActivity {
ArrayList
<
String
>
label
=
new
ArrayList
<>();
ArrayList
<
Integer
>
icon
=
new
ArrayList
<>();
ArrayList
<
Integer
>
usage
=
new
ArrayList
<>();
for
(
Object
key
:
sortedKeys
.
toArray
())
{
//parse the sorted key list
label
.
add
(
key
.
toString
());
icon
.
add
(
R
.
drawable
.
backup
);
int
[]
iconsInt
=
Ints
.
toArray
(
icon
);
String
[]
labelArray
=
label
.
toArray
(
new
String
[
0
]);
//convert the List to array and show the listView
adapter
=
new
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
(
backupActivity
.
this
,
labelArray
,
iconsInt
);
backupListView
.
setAdapter
(
adapter
);
usage
.
add
(-
1
);
}
int
[]
iconsInt
=
Ints
.
toArray
(
icon
);
int
[]
usageInt
=
Ints
.
toArray
(
usage
);
String
[]
labelArray
=
label
.
toArray
(
new
String
[
0
]);
//convert the List to array and show the listView
adapter
=
new
de
.
jonasled
.
proxdroid
.
ClusterListAdapter
(
backupActivity
.
this
,
labelArray
,
iconsInt
,
usageInt
);
backupListView
.
setAdapter
(
adapter
);
pd
.
dismiss
();
}
...
...
app/src/main/play/release-notes/de-DE/beta.txt
deleted
100644 → 0
View file @
880a6d56
Neue Funktionen:
* Backups können nun in der App erstellt werden
\ No newline at end of file
app/src/main/play/release-notes/en-US/beta.txt
0 → 100644
View file @
13f4d7c8
New Features:
* Creation of backups directly in the app
* Storage usage will be shown in cluster overview.
\ No newline at end of file
app/src/main/res/layout/activity_listview.xml
View file @
13f4d7c8
...
...
@@ -20,12 +20,26 @@
android:text=
" "
android:textSize=
"36sp"
/>
<TextView
android:id=
"@+id/title"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"fill_vertical"
android:text=
"TITLE"
android:textSize=
"36sp"
/>
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"fill_vertical"
android:text=
"TITLE"
android:textSize=
"36sp"
/>
<ProgressBar
android:id=
"@+id/usageBar"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:max=
"100"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/values-de/strings.xml
View file @
13f4d7c8
...
...
@@ -125,4 +125,16 @@
<string
name=
"maximum"
>
Maximum
</string>
<string
name=
"average"
>
Durchschnitt
</string>
<string
name=
"reset"
>
Zurücksetzen
</string>
<string
name=
"backupStarted"
>
Backup wurde gestartet.
</string>
<string
name=
"zstdCompression"
>
ZSTD (schnell und gut)
</string>
<string
name=
"lzoCompression"
>
LZO (schnell)
</string>
<string
name=
"gzipCompression"
>
GZIP (gut)
</string>
<string
name=
"none"
>
Keine
</string>
<string
name=
"suspend"
>
Suspend
</string>
<string
name=
"snapshot"
>
Snapshot
</string>
<string
name=
"emailTo"
>
Sende Email an
</string>
<string
name=
"compression"
>
Kompression
</string>
<string
name=
"mode"
>
Modus
</string>
<string
name=
"storage"
>
Speicher
</string>
<string
name=
"backup"
>
Backup
</string>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment