mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-22 13:25:11 +02:00
2012-05-22 Santiago Munín <burning1@gmail.com>
* PandroidEventviewerService.java, PandroidEventviewerActivity.java: Added group filter. * res/layout/main.xml: Enabled group spinner. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6335 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
744c5a0dcd
commit
727ecf76f7
@ -1,3 +1,8 @@
|
|||||||
|
2012-05-22 Santiago Munín <burning1@gmail.com>
|
||||||
|
|
||||||
|
* PandroidEventviewerService.java, PandroidEventviewerActivity.java: Added group filter.
|
||||||
|
* res/layout/main.xml: Enabled group spinner.
|
||||||
|
|
||||||
2012-05-21 Santiago Munín <burning1@gmail.com>
|
2012-05-21 Santiago Munín <burning1@gmail.com>
|
||||||
|
|
||||||
* EventList.java, PopupValidationEvent.java: Removed references to Core as an object.
|
* EventList.java, PopupValidationEvent.java: Removed references to Core as an object.
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
<TableRow android:visibility="gone" >
|
<TableRow>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -64,7 +64,7 @@
|
|||||||
android:id="@+id/group_combo"
|
android:id="@+id/group_combo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
/>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/loading_group"
|
android:id="@+id/loading_group"
|
||||||
|
@ -64,7 +64,7 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
|
|
||||||
// Parameters to search in the API
|
// Parameters to search in the API
|
||||||
public String agentNameStr;
|
public String agentNameStr;
|
||||||
public int id_group;
|
public int id_group = -1;
|
||||||
public long timestamp;
|
public long timestamp;
|
||||||
public int severity;
|
public int severity;
|
||||||
public int pagination;
|
public int pagination;
|
||||||
@ -248,10 +248,10 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes all params.
|
* Serializes all params.
|
||||||
*
|
* @param total True if only want the count
|
||||||
* @return All params in a string.
|
* @return All params in a string.
|
||||||
*/
|
*/
|
||||||
private String serializeParams2Api() {
|
private String serializeParams2Api(boolean total) {
|
||||||
String return_var = "";
|
String return_var = "";
|
||||||
|
|
||||||
return_var += ';'; // Separator for the csv
|
return_var += ';'; // Separator for the csv
|
||||||
@ -279,7 +279,14 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
// list events
|
// list events
|
||||||
return_var += "|";
|
return_var += "|";
|
||||||
return_var += Long.toString(this.offset); // The offset of list events
|
return_var += Long.toString(this.offset); // The offset of list events
|
||||||
|
return_var += "|";
|
||||||
|
if (total) {
|
||||||
|
return_var+="total";
|
||||||
|
} else {
|
||||||
|
return_var+="-1";
|
||||||
|
}
|
||||||
|
return_var += "|";
|
||||||
|
return_var += Integer.toString(this.id_group);
|
||||||
Log.i(TAG + " serializeParams2Api", return_var);
|
Log.i(TAG + " serializeParams2Api", return_var);
|
||||||
|
|
||||||
return return_var;
|
return return_var;
|
||||||
@ -320,7 +327,7 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
"url_encode_separator_|"));
|
"url_encode_separator_|"));
|
||||||
parameters.add(new BasicNameValuePair("return_type", "csv"));
|
parameters.add(new BasicNameValuePair("return_type", "csv"));
|
||||||
parameters.add(new BasicNameValuePair("other",
|
parameters.add(new BasicNameValuePair("other",
|
||||||
serializeParams2Api() + "|total"));
|
serializeParams2Api(true)));
|
||||||
entity = new UrlEncodedFormEntity(parameters);
|
entity = new UrlEncodedFormEntity(parameters);
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
response = httpClient.execute(httpPost);
|
response = httpClient.execute(httpPost);
|
||||||
@ -345,7 +352,7 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
"url_encode_separator_|"));
|
"url_encode_separator_|"));
|
||||||
parameters.add(new BasicNameValuePair("return_type", "csv"));
|
parameters.add(new BasicNameValuePair("return_type", "csv"));
|
||||||
parameters.add(new BasicNameValuePair("other",
|
parameters.add(new BasicNameValuePair("other",
|
||||||
serializeParams2Api()));
|
serializeParams2Api(false)));
|
||||||
entity = new UrlEncodedFormEntity(parameters);
|
entity = new UrlEncodedFormEntity(parameters);
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
response = httpClient.execute(httpPost);
|
response = httpClient.execute(httpPost);
|
||||||
|
@ -110,7 +110,7 @@ public class PandroidEventviewerService extends IntentService {
|
|||||||
|
|
||||||
httpPost = new HttpPost(this.url + "/include/api.php");
|
httpPost = new HttpPost(this.url + "/include/api.php");
|
||||||
|
|
||||||
String parametersAPI = serializeParams2Api(context);
|
String parametersAPI = serializeParams2Api(context, false);
|
||||||
|
|
||||||
// Get total count.
|
// Get total count.
|
||||||
parameters = new ArrayList<NameValuePair>();
|
parameters = new ArrayList<NameValuePair>();
|
||||||
@ -184,16 +184,14 @@ public class PandroidEventviewerService extends IntentService {
|
|||||||
* @param context
|
* @param context
|
||||||
* @return Api call.
|
* @return Api call.
|
||||||
*/
|
*/
|
||||||
public String serializeParams2Api(Context context) {
|
public String serializeParams2Api(Context context, boolean total) {
|
||||||
SharedPreferences preferences = context.getSharedPreferences(
|
SharedPreferences preferences = context.getSharedPreferences(
|
||||||
context.getString(R.string.const_string_preferences),
|
context.getString(R.string.const_string_preferences),
|
||||||
Activity.MODE_PRIVATE);
|
Activity.MODE_PRIVATE);
|
||||||
|
|
||||||
String filterAgentName = preferences.getString("filterAgentName", "");
|
String filterAgentName = preferences.getString("filterAgentName", "");
|
||||||
/*
|
|
||||||
* TODO no api parameter, waiting for it int filterIDGroup =
|
int idGroup = preferences.getInt("filterIDGroup", 0);
|
||||||
* preferences.getInt("filterIDGroup", 0);
|
|
||||||
*/
|
|
||||||
int filterSeverity = preferences.getInt("filterSeverity", -1);
|
int filterSeverity = preferences.getInt("filterSeverity", -1);
|
||||||
int filterStatus = preferences.getInt("filterStatus", 3);
|
int filterStatus = preferences.getInt("filterStatus", 3);
|
||||||
String filterEventSearch = preferences.getString("filterEventSearch",
|
String filterEventSearch = preferences.getString("filterEventSearch",
|
||||||
@ -238,13 +236,27 @@ public class PandroidEventviewerService extends IntentService {
|
|||||||
return_var += filterEventSearch; // The free search in the text event
|
return_var += filterEventSearch; // The free search in the text event
|
||||||
// description.
|
// description.
|
||||||
return_var += "|";
|
return_var += "|";
|
||||||
return_var += Integer.toString(0); // The pagination of list events
|
return_var += Integer.toString(100); // The pagination of list events
|
||||||
return_var += "|";
|
return_var += "|";
|
||||||
return_var += Long.toString(0); // The offset of list events
|
return_var += Long.toString(0); // The offset of list events
|
||||||
|
return_var += "|";
|
||||||
|
if (total) {
|
||||||
|
return_var += "total";
|
||||||
|
} else {
|
||||||
|
return_var += "-1";
|
||||||
|
}
|
||||||
|
return_var += "|";
|
||||||
|
return_var += Integer.toString(idGroup);
|
||||||
|
|
||||||
Log.i(TAG + " serializeParams2Api", return_var);
|
Log.i(TAG + " serializeParams2Api", return_var);
|
||||||
|
|
||||||
return return_var;
|
return return_var;
|
||||||
|
//;|-1|||||1337666333||3||20|0|total|-1
|
||||||
|
//;|-1|||||1337695530||3||0 |0| |12
|
||||||
|
//;|-1|||||1337695739||3||0 |0|-1 |2
|
||||||
|
//;|-1|||||1337666333||3||20|0|-1 |2
|
||||||
|
//;|-1|||||1337695739||3||0 |0|-1 |12
|
||||||
|
//;|-1|||||1337666333||3||20|0|-1|-1
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user