summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshoward <showard@592f7852-d20e-0410-864c-8624ca9c26a4>2008-07-28 21:27:41 +0000
committershoward <showard@592f7852-d20e-0410-864c-8624ca9c26a4>2008-07-28 21:27:41 +0000
commitc48debd07ac765d82c16e92766b79a5e28a67d7c (patch)
treeb14ddec4a44f2380b04ae300faa4f9019a9147b7
parent458348b4f903c8d761b2a57dc07654f97e185022 (diff)
-add test_view_2 with more sensible field names, for use by new TKO. this is intended to replace test_view, but I don't want to modify test_view until old TKO is phased out.
-ensure "loading" popup doesn't get closed too early, especially on initial load -extend logic for RPC serialization for new TKO git-svn-id: svn://test.kernel.org/autotest/trunk@1916 592f7852-d20e-0410-864c-8624ca9c26a4
-rw-r--r--frontend/afe/rpc_utils.py5
-rw-r--r--frontend/client/src/autotest/common/ui/NotifyManager.java16
-rw-r--r--tko/migrations/014_add_test_view_2.py38
3 files changed, 55 insertions, 4 deletions
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index e0c2a6e1..27738866 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -8,6 +8,9 @@ __author__ = 'showard@google.com (Steve Howard)'
import datetime, xmlrpclib, threading
from frontend.afe import models, model_logic
+NULL_DATETIME = datetime.datetime.max
+NULL_DATE = datetime.date.max
+
def prepare_for_serialization(objects):
"""
Prepare Python objects to be returned via RPC.
@@ -34,6 +37,8 @@ def _prepare_data(data):
isinstance(data, set)):
return [_prepare_data(item) for item in data]
elif isinstance(data, datetime.date):
+ if data is NULL_DATETIME or data is NULL_DATE:
+ return None
return str(data)
else:
return data
diff --git a/frontend/client/src/autotest/common/ui/NotifyManager.java b/frontend/client/src/autotest/common/ui/NotifyManager.java
index 3b5189d3..4285de10 100644
--- a/frontend/client/src/autotest/common/ui/NotifyManager.java
+++ b/frontend/client/src/autotest/common/ui/NotifyManager.java
@@ -70,6 +70,7 @@ public class NotifyManager {
protected NotifyBox messageNotify = new NotifyBox(true);
protected NotifyBox loadingNotify = new NotifyBox(false);
protected ErrorLog errorLog = new ErrorLog();
+ private int loadingCount = 0;
private NotifyManager() {
errorNotify.addStyle("error");
@@ -117,9 +118,16 @@ public class NotifyManager {
* Set whether the loading box is displayed or not.
*/
public void setLoading(boolean visible) {
- if (visible)
- loadingNotify.showMessage("Loading...");
- else
- loadingNotify.hide();
+ if (visible) {
+ if (loadingCount == 0) {
+ loadingNotify.showMessage("Loading...");
+ }
+ loadingCount++;
+ } else {
+ loadingCount--;
+ if (loadingCount == 0) {
+ loadingNotify.hide();
+ }
+ }
}
}
diff --git a/tko/migrations/014_add_test_view_2.py b/tko/migrations/014_add_test_view_2.py
new file mode 100644
index 00000000..e4b795a0
--- /dev/null
+++ b/tko/migrations/014_add_test_view_2.py
@@ -0,0 +1,38 @@
+UP_SQL = """
+CREATE VIEW test_view_2 AS
+SELECT tests.test_idx,
+ tests.job_idx,
+ tests.test AS test_name,
+ tests.subdir,
+ tests.kernel_idx,
+ tests.status AS status_idx,
+ tests.reason,
+ tests.machine_idx,
+ tests.started_time AS test_started_time,
+ tests.finished_time AS test_finished_time,
+ jobs.tag AS job_tag,
+ jobs.label AS job_name,
+ jobs.username AS job_owner,
+ jobs.queued_time AS job_queued_time,
+ jobs.started_time AS job_started_time,
+ jobs.finished_time AS job_finished_time,
+ machines.hostname AS hostname,
+ machines.machine_group AS platform,
+ machines.owner AS machine_owner,
+ kernels.kernel_hash,
+ kernels.base AS kernel_base,
+ kernels.printable AS kernel,
+ status.word AS status
+FROM tests
+INNER JOIN jobs ON jobs.job_idx = tests.job_idx
+INNER JOIN machines ON machines.machine_idx = jobs.machine_idx
+INNER JOIN kernels ON kernels.kernel_idx = tests.kernel_idx
+INNER JOIN status ON status.status_idx = tests.status;
+"""
+
+def migrate_up(manager):
+ manager.execute(UP_SQL)
+
+
+def migrate_down(manager):
+ manager.execute('DROP VIEW IF EXISTS test_view_2')