Commit a5c451d2 authored by jonasled's avatar jonasled

Merge branch 'develop'

parents 6f75c60d 931bac04
......@@ -2,7 +2,7 @@
The free and easy to use Proxmox VE App for Android to watch and control your machines
![](https://img.shields.io/gitlab/pipeline/jonasled/proxdroid) ![](http://translate.jonasled.de/widgets/proxdroid/-/translation/svg-badge.svg)
![pipeline status](https://gitlab.com/jonasled_/proxdroid/badges/master/pipeline.svg) ![](http://translate.jonasled.de/widgets/proxdroid/-/translation/svg-badge.svg)
## Features
* See the status of your Machines
......@@ -15,7 +15,7 @@ The free and easy to use Proxmox VE App for Android to watch and control your ma
I have a website, where you can translate the App in different languages, to support as many languages as possible. The current status can be found below.
The main page can be found [here](https://translate.jonasled.de/engage/proxdroid/?utm_source=widget). If a language is missing, please open a issue here on gitlab and I'll add it as soon as possible.
![translation status](http://translate.jonasled.de/widgets/proxdroid/-/translation/svg-badge.svg")
![translation status](http://translate.jonasled.de/widgets/proxdroid/-/translation/multi-auto.svg)
## Support
* Discord: [https://discord.gg/JEuXW8h](https://discord.gg/JEuXW8h)
......
......@@ -10,7 +10,7 @@ android {
minSdkVersion 23
targetSdkVersion 29
versionCode Integer.valueOf(System.env.VERSION_CODE ?: 10)
versionName "1.11.0-${System.env.VERSION_SHA}"
versionName "1.12.0-${System.env.VERSION_SHA}"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
......
......@@ -142,7 +142,7 @@ public class NewServer extends AppCompatActivity {
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
//Nothing to do here
}
});
......@@ -150,14 +150,18 @@ public class NewServer extends AppCompatActivity {
inputURL.setOnFocusChangeListener((View v, boolean hasFocus) ->{//on leave focus of the url input, replace https with HTTPS and add / at the end if missing (to fix some problems with android URL handling)
try {
if (!inputURL.getText().toString().substring(0, 4).toLowerCase().equals("http")) {
inputURL.setText("HTTP://" + inputURL.getText().toString());
inputURL.setText("HTTPS://" + inputURL.getText().toString());
}
} catch (IndexOutOfBoundsException e) {}
inputURL.setText(inputURL.getText().toString().replace("https:", "HTTPS:"));
inputURL.setText(inputURL.getText().toString().replace("http:", "HTTP:"));
try {
if (inputURL.getText().toString().charAt(inputURL.getText().toString().length() - 1) != '/') {
inputURL.setText(inputURL.getText().toString() + "/");
if(inputURL.getText().toString().replace("HTTPS:", "").replace("HTTP:", "").contains(":")){
inputURL.setText(inputURL.getText().toString() + "/");
} else {
inputURL.setText(inputURL.getText().toString() + ":8006/");
}
}
} catch (IndexOutOfBoundsException e) {}
});
......@@ -174,7 +178,11 @@ public class NewServer extends AppCompatActivity {
inputURL.setText(inputURL.getText().toString().replace("http:", "HTTP:"));
try {
if (inputURL.getText().toString().charAt(inputURL.getText().toString().length() - 1) != '/') {
if(inputURL.getText().toString().contains(":")){
inputURL.setText(inputURL.getText().toString() + "/");
} else {
inputURL.setText(inputURL.getText().toString() + ":8006/");
}
}
} catch (IndexOutOfBoundsException e) {}
......@@ -244,7 +252,11 @@ public class NewServer extends AppCompatActivity {
inputURL.setText(inputURL.getText().toString().replace("https", "HTTPS"));
try {
if (inputURL.getText().toString().charAt(inputURL.getText().toString().length() - 1) != '/') {
inputURL.setText(inputURL.getText().toString() + "/");
if(inputURL.getText().toString().contains(":")){
inputURL.setText(inputURL.getText().toString() + "/");
} else {
inputURL.setText(inputURL.getText().toString() + ":8006/");
}
}
} catch (IndexOutOfBoundsException e) {}
//clear all errors
......
package de.jonasled.proxdroid;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.*;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
......@@ -9,11 +12,6 @@ import android.content.DialogInterface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import com.google.common.primitives.Ints;
import com.jjoe64.graphview.DefaultLabelFormatter;
......@@ -54,6 +52,7 @@ public class StorageControlActivity extends AppCompatActivity {
TextView nodeText;
TextView idText;
TextView driveText;
EditText editTextSearch;
ListView storageList;
Spinner graphSpinner;
GraphView usageGraph;
......@@ -75,6 +74,7 @@ public class StorageControlActivity extends AppCompatActivity {
driveText = findViewById(R.id.labelDrive);
graphSpinner = findViewById(R.id.spinnerTime);
usageGraph = findViewById(R.id.graphUsage);
editTextSearch = findViewById(R.id.editTextSearch);
loginMethod = getIntent().getIntExtra("loginMethod", 0);
switch (loginMethod){
......@@ -106,6 +106,48 @@ public class StorageControlActivity extends AppCompatActivity {
}
});
avgMaxSpinnerValues = ArrayAdapter.createFromResource(this, R.array.avgMaxSpinner, android.R.layout.simple_spinner_dropdown_item);
editTextSearch.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
}
public void beforeTextChanged(CharSequence arg0, int arg1,
int arg2, int arg3) {
}
public void afterTextChanged(Editable arg0) {
System.out.println(arg0.toString());
ArrayList sortedKeys = new ArrayList(storageContent.keySet());//The response from proxmox is a mess, no System or whatever, so we sort the array after the key
Collections.sort(sortedKeys);
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
ArrayList<String> currentObject = storageContent.get(key);
if(currentObject.get(0).contains(arg0.toString())) {
usage.add(-1);
label.add(currentObject.get(0));
if (currentObject.get(1).equals("backup")) icon.add(R.drawable.backup);
if (currentObject.get(1).equals("iso")) icon.add(R.drawable.iso);
if (currentObject.get(1).equals("vztmpl")) icon.add(R.drawable.lxc_offline);
if (currentObject.get(1).equals("rootdir")) icon.add(R.drawable.drive);
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, usageInt);
storageList.setAdapter(adapter);
}
}
});
}
private class getConfig extends AsyncTask<String, String, String> {
......
New Features:
* Creation of backups directly in the app
* Storage usage will be shown in cluster overview
* Added task viewer
* Added option to use API key instead of user account (no support for console)
* Add Support for SPICE Console (requires a client like Opaque)
\ No newline at end of file
* Now we use https and port 8006 as default for new server
* In the datastore control you can now search for files
\ No newline at end of file
......@@ -7,7 +7,7 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".NodeControlActivity"
tools:showIn="@layout/activity_node_control">
tools:showIn="@layout/activity_cluster">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
......
......@@ -6,9 +6,10 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".ServerActivity"
tools:showIn="@layout/activity_serverActivity">
tools:showIn="@layout/activity_server">
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView"></ListView>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/listView"></ListView>
</LinearLayout>
\ No newline at end of file
......@@ -163,6 +163,15 @@
android:layout_height="1dp"
android:background="?android:attr/listDivider" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/textView3" android:text="@string/search"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="@+id/editTextSearch"/>
<de.jonasled.proxdroid.NonScrollListView
android:id="@+id/storageList"
android:layout_width="match_parent"
......
......@@ -141,4 +141,13 @@
<string name="log">Log</string>
<string name="aptUpdate">Apt update</string>
<string name="reboot">Neustart</string>
<string name="showOpaque">Opaque herunterladen</string>
<string name="spiceClientRequired">Um dieses Feature zu verwenden wird ein externer SPICE Client, wie zum Beispiel Opaque benötigt. Wenn sie die App nicht kaufen möchten gibt es auch die Möglichkeit diese über den Link im PlayStore Eintrag selber zu kompilieren.</string>
<string name="selectConsole">Bitte eine Konsole auswählen</string>
<string name="spice">SPICE</string>
<string name="secret">Secret</string>
<string name="tokenID">Token ID</string>
<string name="apiToken">API Token (keine Konsole)</string>
<string name="account">Benutzer</string>
<string name="loginType">Login Typ</string>
</resources>
\ No newline at end of file
......@@ -140,4 +140,14 @@
<string name="tasks">Uppgifter</string>
<string name="log">Logg</string>
<string name="aptUpdate">Apt update</string>
<string name="showOpaque">Ladda ner Opaque</string>
<string name="spiceClientRequired">För att denna funktion ska fungera behövs en extern applikation som stödjer SPICE. Om du ej vill betala för applikationen, går det att kompilera den själv med GitHub-länken som finns i PlayStore-beskrivningen.</string>
<string name="selectConsole">Välj en konsoll</string>
<string name="spice">SPICE</string>
<string name="secret">Hemlighet</string>
<string name="tokenID">Token ID</string>
<string name="apiToken">API token (ingen Konsoll)</string>
<string name="loginType">Logintyp</string>
<string name="account">Användarkonto</string>
<string name="reboot">Starta om</string>
</resources>
\ No newline at end of file
......@@ -204,4 +204,5 @@
<string name="selectConsole">Select a console</string>
<string name="spiceClientRequired">For this feature to work you need a external app, which support spice like Opaque. If you don\'t want to buy the app you can compile it yourself with the GitHub link in the PlayStore description.</string>
<string name="showOpaque">Download Opaque</string>
<string name="search">Search:</string>
</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