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
765f783c
Commit
765f783c
authored
Sep 10, 2020
by
jonasled
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
f5e6b42d
8a1c4ace
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
21 deletions
+52
-21
app/src/main/java/de/jonasled/proxdroid/ClusterActivity.java
app/src/main/java/de/jonasled/proxdroid/ClusterActivity.java
+5
-2
app/src/main/java/de/jonasled/proxdroid/HelperFunctions.java
app/src/main/java/de/jonasled/proxdroid/HelperFunctions.java
+3
-2
app/src/main/java/de/jonasled/proxdroid/NewServer.java
app/src/main/java/de/jonasled/proxdroid/NewServer.java
+5
-0
app/src/main/java/de/jonasled/proxdroid/NodeControlActivity.java
.../main/java/de/jonasled/proxdroid/NodeControlActivity.java
+12
-6
app/src/main/java/de/jonasled/proxdroid/ServerControlActivity.java
...ain/java/de/jonasled/proxdroid/ServerControlActivity.java
+18
-9
app/src/main/java/de/jonasled/proxdroid/StorageControlActivity.java
...in/java/de/jonasled/proxdroid/StorageControlActivity.java
+5
-2
app/src/main/play/release-notes/de-DE/beta.txt
app/src/main/play/release-notes/de-DE/beta.txt
+4
-0
No files found.
app/src/main/java/de/jonasled/proxdroid/ClusterActivity.java
View file @
765f783c
...
...
@@ -91,6 +91,11 @@ public class ClusterActivity extends AppCompatActivity {
totpToken
=
HelperFunctions
.
decryptMsg
(
android
.
util
.
Base64
.
decode
(
cursor
.
getString
(
7
),
android
.
util
.
Base64
.
DEFAULT
));
}
HelperFunctions
.
hostname
=
urlString
.
split
(
"//"
)[
1
].
split
(
"/"
)[
0
];
if
(
HelperFunctions
.
hostname
.
contains
(
":"
)){
HelperFunctions
.
hostname
=
HelperFunctions
.
hostname
.
split
(
":"
)[
0
];
}
postContent
=
"username="
+
username
+
"@"
+
cursor
.
getString
(
3
)
+
"&password="
+
password
;
new
loginAsync
().
execute
(
urlString
,
postContent
,
totpToken
);
//login to server
...
...
@@ -194,8 +199,6 @@ public class ClusterActivity extends AppCompatActivity {
sb
.
append
(
line
+
"\n"
);
}
System
.
out
.
println
(
"output: "
+
sb
.
toString
());
login
=
(
JSONObject
)
(
new
JSONObject
(
sb
.
toString
())).
get
(
"data"
);
//parse the JSON
ticket
=
login
.
getString
(
"ticket"
);
//get the ticket
CSRFPreventionToken
=
login
.
getString
(
"CSRFPreventionToken"
);
//get the CSRFPreventionToken
...
...
app/src/main/java/de/jonasled/proxdroid/HelperFunctions.java
View file @
765f783c
...
...
@@ -47,6 +47,7 @@ public class HelperFunctions {
public
static
SSLContext
context
;
public
static
HostnameVerifier
hostnameVerifier
;
public
static
String
lastConnectName
=
""
;
//we declare this variable here, becuase if we restart the ClusterActivity Class it will reset the variable
public
static
String
hostname
=
""
;
// used for the hostname verifier
public
static
String
humanReadableByteCountBin
(
long
bytes
)
{
//Convert a byte long to a String with suitable extension
...
...
@@ -101,8 +102,8 @@ public class HelperFunctions {
try
{
hostnameVerifier
=
new
HostnameVerifier
()
{
@Override
public
boolean
verify
(
String
hostname
,
SSLSession
session
)
{
return
true
;
//allow all hostnames
public
boolean
verify
(
String
hostname
_
,
SSLSession
session
)
{
return
hostname_
.
equals
(
hostname
);
}
};
...
...
app/src/main/java/de/jonasled/proxdroid/NewServer.java
View file @
765f783c
...
...
@@ -236,6 +236,11 @@ public class NewServer extends AppCompatActivity {
return
;
}
HelperFunctions
.
hostname
=
inputURL
.
getText
().
toString
().
split
(
"//"
)[
1
].
split
(
"/"
)[
0
];
if
(
HelperFunctions
.
hostname
.
contains
(
":"
)){
HelperFunctions
.
hostname
=
HelperFunctions
.
hostname
.
split
(
":"
)[
0
];
}
String
totpToken2
=
""
;
if
(
checkBoxRequiresTOTP
.
isChecked
())
totpToken2
=
inputTOTP
.
getText
().
toString
();
new
testLogin
().
execute
(
inputURL
.
getText
().
toString
(),
"username="
+
inputUser
.
getText
().
toString
()
+
"@"
+
inputRealm
.
getText
().
toString
()
+
"&password="
+
inputPassword
.
getText
().
toString
(),
totpToken2
);
...
...
app/src/main/java/de/jonasled/proxdroid/NodeControlActivity.java
View file @
765f783c
...
...
@@ -188,7 +188,10 @@ public class NodeControlActivity extends AppCompatActivity {
Format
formatter
=
new
SimpleDateFormat
(
"HH:mm"
);
return
formatter
.
format
(
value
);
}
else
{
return
super
.
formatLabel
(
value
,
false
)
+
" %"
;
if
(
value
<=
0
)
return
"0"
;
else
{
return
HelperFunctions
.
humanReadableByteCountBin
((
long
)
value
);
}
}
}
});
...
...
@@ -232,7 +235,10 @@ public class NodeControlActivity extends AppCompatActivity {
Format
formatter
=
new
SimpleDateFormat
(
"HH:mm"
);
return
formatter
.
format
(
value
);
}
else
{
return
super
.
formatLabel
(
value
,
false
)
+
" kB"
;
if
(
value
<=
0
)
return
"0"
;
else
{
return
HelperFunctions
.
humanReadableByteCountBin
((
long
)
value
);
}
}
}
});
...
...
@@ -503,12 +509,12 @@ public class NodeControlActivity extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
graphJson
.
length
();
i
++)
{
JSONObject
temp
=
graphJson
.
getJSONObject
(
i
);
try
{
ramGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
(
temp
.
getDouble
(
"memused"
)
/
temp
.
getDouble
(
"memtotal"
))
*
100
),
true
,
graphJson
.
length
());
cpuGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
(
temp
.
getDouble
(
"cpu"
)
)
*
100
),
true
,
graphJson
.
length
());
ramGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"memused"
)
),
true
,
graphJson
.
length
());
cpuGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"cpu"
)
*
100
),
true
,
graphJson
.
length
());
ioGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,(
temp
.
getDouble
(
"iowait"
))
*
100
),
true
,
graphJson
.
length
());
utilizatioGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"loadavg"
)),
true
,
graphJson
.
length
());
networkInGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netin"
)
/
1000
),
true
,
graphJson
.
length
());
networkOutGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netout"
)
/
1000
),
true
,
graphJson
.
length
());
networkInGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netin"
)),
true
,
graphJson
.
length
());
networkOutGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netout"
)),
true
,
graphJson
.
length
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();}
//Sometimes one entry is missing
}
...
...
app/src/main/java/de/jonasled/proxdroid/ServerControlActivity.java
View file @
765f783c
...
...
@@ -227,7 +227,10 @@ public class ServerControlActivity extends AppCompatActivity {
}
return
formatter
.
format
(
value
);
}
else
{
return
super
.
formatLabel
(
value
,
false
)
+
" %"
;
if
(
value
<=
0
)
return
"0"
;
else
{
return
HelperFunctions
.
humanReadableByteCountBin
((
long
)
value
);
}
}
}
});
...
...
@@ -259,7 +262,10 @@ public class ServerControlActivity extends AppCompatActivity {
}
return
formatter
.
format
(
value
);
}
else
{
return
super
.
formatLabel
(
value
,
false
)
+
" kB"
;
if
(
value
<=
0
)
return
"0"
;
else
{
return
HelperFunctions
.
humanReadableByteCountBin
((
long
)
value
);
}
}
}
});
...
...
@@ -275,7 +281,10 @@ public class ServerControlActivity extends AppCompatActivity {
}
return
formatter
.
format
(
value
);
}
else
{
return
super
.
formatLabel
(
value
,
false
)
+
" kB"
;
if
(
value
<=
0
)
return
"0"
;
else
{
return
HelperFunctions
.
humanReadableByteCountBin
((
long
)
value
);
}
}
}
});
...
...
@@ -558,12 +567,12 @@ public class ServerControlActivity extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
graphJson
.
length
();
i
++)
{
JSONObject
temp
=
graphJson
.
getJSONObject
(
i
);
try
{
ramGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
(
temp
.
getDouble
(
"mem"
)
/
temp
.
getDouble
(
"maxmem"
))
*
100
),
true
,
graphJson
.
length
());
cpuGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
(
temp
.
getDouble
(
"cpu"
)
)
*
100
),
true
,
graphJson
.
length
());
hddWriteGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"diskwrite"
)
/
1000
),
true
,
graphJson
.
length
());
hddReadGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"diskread"
)
/
1000
),
true
,
graphJson
.
length
());
networkInGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netin"
)
/
1000
),
true
,
graphJson
.
length
());
networkOutGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netout"
)
/
1000
),
true
,
graphJson
.
length
());
ramGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"mem"
)
),
true
,
graphJson
.
length
());
cpuGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"cpu"
)
*
100
),
true
,
graphJson
.
length
());
hddWriteGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"diskwrite"
)),
true
,
graphJson
.
length
());
hddReadGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"diskread"
)),
true
,
graphJson
.
length
());
networkInGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netin"
)),
true
,
graphJson
.
length
());
networkOutGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"netout"
)),
true
,
graphJson
.
length
());
}
catch
(
Exception
e
)
{}
//Sometimes one entry is missing
}
...
...
app/src/main/java/de/jonasled/proxdroid/StorageControlActivity.java
View file @
765f783c
...
...
@@ -122,7 +122,10 @@ public class StorageControlActivity extends AppCompatActivity {
}
return
formatter
.
format
(
value
);
}
else
{
return
super
.
formatLabel
(
value
,
false
)
+
" %"
;
if
(
value
<=
0
)
return
"0"
;
else
{
return
HelperFunctions
.
humanReadableByteCountBin
((
long
)
value
);
}
}
}
});
...
...
@@ -222,7 +225,7 @@ public class StorageControlActivity extends AppCompatActivity {
for
(
int
i
=
0
;
i
<
graphJson
.
length
();
i
++)
{
JSONObject
temp
=
graphJson
.
getJSONObject
(
i
);
try
{
usageGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
(
temp
.
getDouble
(
"used"
)
/
temp
.
getDouble
(
"total"
))
*
100
),
true
,
graphJson
.
length
());
usageGraphSeries
.
appendData
(
new
DataPoint
(
temp
.
getLong
(
"time"
)
*
1000
,
temp
.
getDouble
(
"used"
)
),
true
,
graphJson
.
length
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
app/src/main/play/release-notes/de-DE/beta.txt
View file @
765f783c
Neue Funktionen:
* Die Einheit der Graphen wird nun automatisch angepasst.
* RAM / Festplattenverwendung Diagramme zeigen reale Werte statt Prozent an.
Fehlerbehebung:
* Schwarzes Design funktioniert nun auch in der VM / Container Steuerung.
* Durchschnitt / Maximum Spinner wurde in der Speicher Ansicht entfernt, da nicht unterstützt von Proxmox
...
...
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