Commit 195c9765 authored by jonasled's avatar jonasled

Merge branch 'develop'

parents ee45c797 6486b969
......@@ -73,6 +73,7 @@ public class NodeControlActivity extends AppCompatActivity {
View squareNetworkIn;
View squareNetworkOut;
Spinner graphSpinner;
Spinner avgMaxSpinner;
Timer timer;
LineGraphSeries<DataPoint> ramGraphSeries = new LineGraphSeries<>();
LineGraphSeries<DataPoint> cpuGraphSeries = new LineGraphSeries<>();
......@@ -81,6 +82,7 @@ public class NodeControlActivity extends AppCompatActivity {
LineGraphSeries<DataPoint> networkInGraphSeries = new LineGraphSeries<>();
LineGraphSeries<DataPoint> networkOutGraphSeries = new LineGraphSeries<>();
ArrayAdapter<CharSequence> graphSpinnerValues;
ArrayAdapter<CharSequence> avgMaxSpinnerValues;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -109,6 +111,7 @@ public class NodeControlActivity extends AppCompatActivity {
squareNetworkIn = findViewById(R.id.squareNetIn);
squareNetworkOut = findViewById(R.id.squareNetOut);
graphSpinner = findViewById(R.id.spinnerTime);
avgMaxSpinner = findViewById(R.id.spinnerAvgMax);
setSupportActionBar(toolbar);
......@@ -160,6 +163,20 @@ public class NodeControlActivity extends AppCompatActivity {
}
});
avgMaxSpinnerValues = ArrayAdapter.createFromResource(this, R.array.avgMaxSpinner, android.R.layout.simple_spinner_dropdown_item);
avgMaxSpinner.setAdapter(avgMaxSpinnerValues);
avgMaxSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
if(!showLoading){
new getConfig().execute();
}
}
public void onNothingSelected(AdapterView<?> adapterView) {
return;
}
});
notesButton.setOnClickListener((View v) -> new getNotes().execute());
shutdownButton.setOnClickListener((View v) -> new startStopAction().execute("shutdown"));
restartButton.setOnClickListener((View v) -> new startStopAction().execute("reboot"));
......@@ -374,6 +391,7 @@ public class NodeControlActivity extends AppCompatActivity {
private class getConfig extends AsyncTask<String, String, String> {
private ProgressDialog pd;
int spinnerID;
int spinner2ID;
@Override
protected void onPreExecute() {
......@@ -395,6 +413,7 @@ public class NodeControlActivity extends AppCompatActivity {
System.out.println("update Data");
});
spinnerID = graphSpinner.getSelectedItemPosition();
spinner2ID = avgMaxSpinner.getSelectedItemPosition();
}
......@@ -459,7 +478,17 @@ public class NodeControlActivity extends AppCompatActivity {
timeframe = "year";
break;
}
url = new URL(urlString + "api2/json/nodes/" + node + "/rrddata?timeframe=" + timeframe + "&cf=AVERAGE");
String cf = "AVERAGE";
switch (spinnerID){
case 0:
cf = "AVERAGE";
break;
case 1:
cf = "MAX";
break;
}
url = new URL(urlString + "api2/json/nodes/" + node + "/rrddata?timeframe=" + timeframe + "&cf=" + cf);
conn2 = (HttpsURLConnection) url.openConnection();
conn2.setSSLSocketFactory(HelperFunctions.context.getSocketFactory());
conn2.setHostnameVerifier(HelperFunctions.hostnameVerifier);
......
......@@ -82,6 +82,7 @@ public class ServerControlActivity extends AppCompatActivity {
View squareNetworkIn;
View squareNetworkOut;
Spinner graphSpinner;
Spinner avgMaxSpinner;
Timer timer;
LineGraphSeries<DataPoint> ramGraphSeries = new LineGraphSeries<>();
LineGraphSeries<DataPoint> cpuGraphSeries = new LineGraphSeries<>();
......@@ -90,6 +91,7 @@ public class ServerControlActivity extends AppCompatActivity {
LineGraphSeries<DataPoint> networkInGraphSeries = new LineGraphSeries<>();
LineGraphSeries<DataPoint> networkOutGraphSeries = new LineGraphSeries<>();
ArrayAdapter<CharSequence> graphSpinnerValues;
ArrayAdapter<CharSequence> avgMaxSpinnerValues;
LinearLayout graphLayout;
TableRow swapTableRow;
......@@ -138,6 +140,7 @@ public class ServerControlActivity extends AppCompatActivity {
squareNetworkIn = findViewById(R.id.squareNetIn);
squareNetworkOut = findViewById(R.id.squareNetOut);
graphSpinner = findViewById(R.id.spinnerTime);
avgMaxSpinner = findViewById(R.id.spinnerAvgMax);
graphLayout = findViewById(R.id.graphLayout);
swapTableRow = findViewById(R.id.tableRowSwap);
......@@ -175,6 +178,20 @@ public class ServerControlActivity extends AppCompatActivity {
}
});
avgMaxSpinnerValues = ArrayAdapter.createFromResource(this, R.array.avgMaxSpinner, android.R.layout.simple_spinner_dropdown_item);
avgMaxSpinner.setAdapter(avgMaxSpinnerValues);
avgMaxSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
if(!showLoading){
new getConfig().execute();
}
}
public void onNothingSelected(AdapterView<?> adapterView) {
return;
}
});
consoleButton.setOnClickListener((View v) -> {
Intent intent = new Intent(getApplicationContext(), de.jonasled.proxdroid.ConsoleView.class);
intent.putExtra("ticket", ticket);
......@@ -432,6 +449,7 @@ public class ServerControlActivity extends AppCompatActivity {
private class getConfig extends AsyncTask<String, String, String> {
private ProgressDialog pd;
int spinnerID;
int spinner2ID;
JSONObject resourcesJSON_;
@Override
......@@ -453,6 +471,7 @@ public class ServerControlActivity extends AppCompatActivity {
hddReadGraphSeries.setColor(Color.RED);
});
spinnerID = graphSpinner.getSelectedItemPosition();
spinner2ID = avgMaxSpinner.getSelectedItemPosition();
}
......@@ -513,8 +532,17 @@ public class ServerControlActivity extends AppCompatActivity {
timeframe = "year";
break;
}
String cf = "AVERAGE";
switch (spinnerID){
case 0:
cf = "AVERAGE";
break;
case 1:
cf = "MAX";
break;
}
url = new URL(urlString + "api2/json/nodes/" + node + "/" + type + "/" + id + "/rrddata?timeframe=" + timeframe + "&cf=AVERAGE");
url = new URL(urlString + "api2/json/nodes/" + node + "/" + type + "/" + id + "/rrddata?timeframe=" + timeframe + "&cf=" + cf);
conn2 = (HttpsURLConnection) url.openConnection();
conn2.setSSLSocketFactory(HelperFunctions.context.getSocketFactory());
conn2.setHostnameVerifier(HelperFunctions.hostnameVerifier);
......
......@@ -80,43 +80,44 @@ public class SettingsActivity extends AppCompatActivity {
});
findPreference("joinBeta").setOnPreferenceClickListener((Preference preference) -> {
findPreference("joinBeta").setOnPreferenceClickListener((Preference preference) -> {//call a browser with the beta testing invite link, on button press
Uri uri = Uri.parse("https://play.google.com/apps/testing/de.jonasled.proxdroid");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
return true;
});
findPreference("bugFound").setOnPreferenceClickListener((Preference preference) -> {
findPreference("bugFound").setOnPreferenceClickListener((Preference preference) -> {//open the preferred email application with already prefilled the feedback email, on button press
Uri uri = Uri.parse("mailto:" + getResources().getString(R.string.feedbackMail));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
return true;
});
findPreference("donate").setOnPreferenceClickListener((Preference preference) -> {
findPreference("donate").setOnPreferenceClickListener((Preference preference) -> {//call a browser with my paypal donate link, on button press
Uri uri = Uri.parse("https://paypal.me/jonasled");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
return true;
});
findPreference("sourcecode").setOnPreferenceClickListener((Preference preference) -> {
findPreference("sourcecode").setOnPreferenceClickListener((Preference preference) -> {//call a browser with the gitlab link, on button press
Uri uri = Uri.parse("https://gitlab.com/jonasled/proxdroid");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
return true;
});
findPreference("discord").setOnPreferenceClickListener((Preference preference) -> {
findPreference("discord").setOnPreferenceClickListener((Preference preference) -> {//call a browser with the discord invite link, on button press
Uri uri = Uri.parse("https://discord.gg/JEuXW8h");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
return true;
});
findPreference("version").setOnPreferenceClickListener((Preference preference) -> {
findPreference("version").setOnPreferenceClickListener((Preference preference) -> {//this function is used to call the debug activity, if user pressed 5 times the version in 10 secconds
if(lastClick + 10 < System.currentTimeMillis() / 1000L){
clickcount = 0;
}
lastClick = System.currentTimeMillis() / 1000L;
clickcount++;
if(clickcount >= 5){
clickcount = 0;
Intent intent = new Intent(this.getContext(), debugActivity.class);
startActivity(intent);
}
......
......@@ -54,10 +54,13 @@ public class StorageControlActivity extends AppCompatActivity {
TextView driveText;
ListView storageList;
Spinner graphSpinner;
Spinner avgMaxSpinner;
GraphView usageGraph;
LineGraphSeries<DataPoint> usageGraphSeries = new LineGraphSeries<>();
Map<String, ArrayList<String>> storageContent = new HashMap<>();
de.jonasled.proxdroid.ClusterListAdapter adapter;
ArrayAdapter<CharSequence> avgMaxSpinnerValues;
ArrayAdapter<CharSequence> graphSpinnerValues;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -70,6 +73,7 @@ public class StorageControlActivity extends AppCompatActivity {
idText = findViewById(R.id.labelID);
driveText = findViewById(R.id.labelDrive);
graphSpinner = findViewById(R.id.spinnerTime);
avgMaxSpinner = findViewById(R.id.spinnerAvgMax);
usageGraph = findViewById(R.id.graphUsage);
ticket = getIntent().getStringExtra("ticket");
......@@ -82,7 +86,7 @@ public class StorageControlActivity extends AppCompatActivity {
setSupportActionBar(toolbar);
setTitle(id);
ArrayAdapter<CharSequence> graphSpinnerValues = ArrayAdapter.createFromResource(this, R.array.spinnerGraph, android.R.layout.simple_spinner_dropdown_item);
graphSpinnerValues = ArrayAdapter.createFromResource(this, R.array.spinnerGraph, android.R.layout.simple_spinner_dropdown_item);
graphSpinner.setAdapter(graphSpinnerValues);
graphSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
......@@ -93,6 +97,17 @@ public class StorageControlActivity extends AppCompatActivity {
return;
}
});
avgMaxSpinnerValues = ArrayAdapter.createFromResource(this, R.array.avgMaxSpinner, android.R.layout.simple_spinner_dropdown_item);
avgMaxSpinner.setAdapter(avgMaxSpinnerValues);
avgMaxSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
new getConfig().execute();
}
public void onNothingSelected(AdapterView<?> adapterView) {
return;
}
});
//new getConfig().execute();
}
......@@ -101,6 +116,7 @@ public class StorageControlActivity extends AppCompatActivity {
private ProgressDialog pd;
JSONObject vmConfig;
int spinnerID;
int spinner2ID;
@Override
protected void onPreExecute() {
......@@ -125,6 +141,7 @@ public class StorageControlActivity extends AppCompatActivity {
}
});
spinnerID = graphSpinner.getSelectedItemPosition();
spinner2ID = avgMaxSpinner.getSelectedItemPosition();
}
@Override
......@@ -204,7 +221,17 @@ public class StorageControlActivity extends AppCompatActivity {
break;
}
url = new URL(urlString + "api2/json/nodes/" + node + "/storage/" + vmConfig.getString("storage") + "/rrddata?timeframe=" + timeframe + "&cf=AVERAGE");
String cf = "AVERAGE";
switch (spinnerID){
case 0:
cf = "AVERAGE";
break;
case 1:
cf = "MAX";
break;
}
url = new URL(urlString + "api2/json/nodes/" + node + "/storage/" + vmConfig.getString("storage") + "/rrddata?timeframe=" + timeframe + "&cf=" + cf);
conn2 = (HttpsURLConnection) url.openConnection();
conn2.setSSLSocketFactory(HelperFunctions.context.getSocketFactory());
conn2.setHostnameVerifier(HelperFunctions.hostnameVerifier);
......
Neue Features:
* Schwarzes Design wurde hinzugefügt
\ No newline at end of file
* Schwarzes Design wurde hinzugefügt
* Graph für verwendung von Speicher wurde hinzugefügt
* Graphen können nun umgeschaltet werden zwischen Durchschnitt und Maximum
Fehlerbehebung:
* Graph wird manchmal nicht angezeigt
* Bei Verwendung eines signierten Zertifikates in Proxmox werden keine VMs angezeigt
* Bei der Betriebszeit hat eine 0 bei werten kleiner 10 gefehlt
* Beim Scrollen von Speichern wird nun auch die übersicht mitgescrollt
\ No newline at end of file
......@@ -303,10 +303,23 @@
android:layout_width="match_parent"
android:layout_height="20dp" />
<Spinner
android:id="@+id/spinnerTime"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:orientation="horizontal">
<Spinner
android:id="@+id/spinnerTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Spinner
android:id="@+id/spinnerAvgMax"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<Space
android:layout_width="match_parent"
......
......@@ -329,10 +329,23 @@
android:layout_height="match_parent"
android:orientation="vertical">
<Spinner
android:id="@+id/spinnerTime"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:orientation="horizontal">
<Spinner
android:id="@+id/spinnerTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Spinner
android:id="@+id/spinnerAvgMax"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<Space
android:layout_width="match_parent"
......
......@@ -135,10 +135,23 @@
android:layout_height="1dp"
android:background="?android:attr/listDivider" />
<Spinner
android:id="@+id/spinnerTime"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent"
android:orientation="horizontal">
<Spinner
android:id="@+id/spinnerTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Spinner
android:id="@+id/spinnerAvgMax"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<Space
android:layout_width="match_parent"
......
......@@ -16,10 +16,6 @@
<string name="loading">laden</string>
<string name="login">Login</string>
<string name="getVM_CT">Lade VMs und Container von</string>
<string-array name="menue_server_list">
<item>Bearbeiten</item>
<item>Löschen</item>
</string-array>
<string name="console">Konsole</string>
<string name="start">Starten</string>
<string name="shutdown">Herunterfahren</string>
......@@ -49,9 +45,6 @@
<string name="load">laden</string>
<string name="requiresTOTP">Account benötigt 2 Faktor Authentifizierung</string>
<string name="totpToken">TFA-Token</string>
<string-array name="menu_settings">
<item>Einstellungen</item>
</string-array>
<string name="getNode">Lade Knoten</string>
<string name="fingerprintAuthentication">Fingerabdruck Authentifizierung</string>
<string name="fingerprintAuthenticationLong">Um die App zu nutzen, platziere bitte deine Finger auf dem Scanner</string>
......@@ -61,13 +54,6 @@
<string name="ioWait">IO delay</string>
<string name="utilization">Serverlast</string>
<string name="restart">Neustart</string>
<string-array name="spinnerGraph">
<item>Stunde</item>
<item>Tag</item>
<item>Woche</item>
<item>Monat</item>
<item>Jahr</item>
</string-array>
<string name="beta">Helfen</string>
<string name="appSettings">App Einstellungen</string>
<string name="listTextSize">Textgröße Liste</string>
......@@ -75,10 +61,6 @@
<string name="darkmode">App Design</string>
<string name="appRestartRequired">Ein neustart der App wird zum Anwenden der Änderungen benötigt.</string>
<string name="sortOrder">Sortierreihenfolge in der VM Liste</string>
<string-array name="sortOrder">
<item>ID</item>
<item>Name</item>
</string-array>
<string name="joinBeta">Den beta Tests beitreten</string>
<string name="joinBetaLong">Indem du die beta Versionen ausprobierst hilfst du mir die App zu entwickeln und bekommst neue Features vor allen anderen.</string>
<string name="bugFound">Hast du einen Fehler gefunden?</string>
......@@ -132,4 +114,14 @@
<string name="automatic">Automatisch</string>
<string name="detailedError">Detaillierter Fehler</string>
<string name="moreDetails">Mehr Details</string>
<string name="settings">Einstellungen</string>
<string name="year">Jahr</string>
<string name="month">Monat</string>
<string name="week">Woche</string>
<string name="day">Tag</string>
<string name="hour">Stunde</string>
<string name="delete">Löschen</string>
<string name="edit">Bearbeiten</string>
<string name="maximum">Maximum</string>
<string name="average">Durchschnitt</string>
</resources>
\ No newline at end of file
......@@ -18,9 +18,11 @@
<string name="getVM_CT">Getting VMs and CT for </string>
<string name="ksmSharing">KSM Sharing</string>
<string-array name="menue_server_list">
<item>Edit</item>
<item>Delete</item>
<item>@string/edit</item>
<item>@string/delete</item>
</string-array>
<string name="edit">Edit</string>
<string name="delete">Delete</string>
<string name="console">Console</string>
<string name="start">Start</string>
<string name="shutdown">Shutdown</string>
......@@ -62,20 +64,25 @@
<string name="uptime">Uptime</string>
<string name="days">days</string>
<string-array name="spinnerGraph">
<item>Hour</item>
<item>Day</item>
<item>Week</item>
<item>Month</item>
<item>Year</item>
<item>@string/hour</item>
<item>@string/day</item>
<item>@string/week</item>
<item>@string/month</item>
<item>@string/year</item>
</string-array>
<string name="hour">Hour</string>
<string name="day">Day</string>
<string name="week">Week</string>
<string name="month">Month</string>
<string name="year">Year</string>
<string-array name="menu_settings">
<item>Settings</item>
<item>@string/settings</item>
</string-array>
<string name="settings">Settings</string>
<string name="appSettings">App Settings</string>
<string name="listTextSize">Lists text size</string>
<string name="darkmode">App Theme</string>
<string name="appRestartRequired">A restart of the app is required for this setting to take effect.</string>
<string name="automatic">Automatic</string>
<string name="dark">Dark</string>
<string name="black">Black</string>
......@@ -151,4 +158,10 @@
<string name="translatorsDescription" translatable="false">German: jonasled\nSwedish: McTwist</string>
<string name="moreDetails">More details</string>
<string name="detailedError">Detailed error</string>
<string name="average">Average</string>
<string name="maximum">Maximum</string>
<string-array name="avgMaxSpinner">
<item>@string/average</item>
<item>@string/maximum</item>
</string-array>
</resources>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment