Changeset 1062 for MDService2/trunk/MDService2/WebContent
- Timestamp:
- 01/12/11 23:43:57 (13 years ago)
- Location:
- MDService2/trunk/MDService2/WebContent/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r1059 r1062 410 410 '</span></div>'; 411 411 } 412 413 var timestr = ""; 414 if (json.time != undefined){ 415 timestr = json.time; 416 } 417 var squery = json.squerystring; 418 if (squery = "[NULL]"){ 419 squery = ""; 420 } 421 var qq = json.querystring; 422 if (qq = "[NULL]"){ 423 qq = ""; 424 } 412 425 var x = '<div class="cmds-elem-plus" ><span class="cmd cmd_load"></span><span class="detail-caller" ><a href="'+id + '_'+ i+'" >' + 413 426 json.name + '</a></span>' + … … 415 428 '<div class="detail" >' + 416 429 name + 417 '<div class="cmds-elem-prop"><span class="label">squery:</span><span class="value">' + json.squerystring+ '</span></div>' +418 '<div class="cmds-elem-prop"><span class="label">query:</span><span class="value">' + Query.simplequerystring( json.querystring) + '</span></div>' +430 '<div class="cmds-elem-prop"><span class="label">squery:</span><span class="value">' + squery + '</span></div>' + 431 '<div class="cmds-elem-prop"><span class="label">query:</span><span class="value">' + Query.simplequerystring(qq) + '</span></div>' + 419 432 '<div class="cmds-elem-prop"><span class="label">collections:</span><span class="value">' + Query.collectiontext(json) + '</span></div>' + 420 '<div class="cmds-elem-prop"><span class="label">columns:</span><span class="value">' + Query.columns + '</span></div>' + 421 '<div class="cmds-elem-prop"><span class="label">time:</span><span class="value">' + '</span></div>' + 422 '<div class="cmds-elem-prop"><span class="label">startRecord:</span><span class="value">' + Query.startRecord + '</span></div>' + 423 '<div class="cmds-elem-prop"><span class="label">maxRecord:</span><span class="value">' + Query.maximumRecords + '</span></div>' + 424 '<div class="cmds-elem-prop"><span class="label">repository:</span><span class="value">' + Query.repository + '</span></div>' + 425 '<div class="cmds-elem-prop"><span class="label">options:</span><span class="value">' + '</span></div>' + 433 '<div class="cmds-elem-prop"><span class="label">columns:</span><span class="value">' + Query.columnstext(json) + '</span></div>' + 434 '<div class="cmds-elem-prop"><span class="label">time:</span><span class="value">' + timestr + '</span></div>' + 435 //'<div class="cmds-elem-prop"><span class="label">startRecord:</span><span class="value">' + Query.startRecord + '</span></div>' + 436 //'<div class="cmds-elem-prop"><span class="label">maxRecord:</span><span class="value">' + Query.maximumRecords + '</span></div>' + 437 //'<div class="cmds-elem-prop"><span class="label">repository:</span><span class="value">' + Query.repository + '</span></div>' + 438 '<div class="cmds-elem-prop"><span class="label">bookmark:</span><span class="value">' + json.bookmark + '</span></div>' + 439 '<div class="cmds-elem-prop"><span class="label">options:</span><span class="value">' + Query.optionstext(json) + '</span></div>' + 426 440 '</div>'; 427 441 428 //var d1 = Date.parse('2010-10-18, 10:06 AM'); alert(d1.toString('dd/mm/yyyy HH:mm:ss GMT')); 429 //isNull(Query.options,"") + 442 //dt = Date.parse('2010-10-18, 10:06 AM'); dt.toString('dd/mm/yyyy HH:mm:ss GMT') 430 443 $(qs).append(x); 431 444 … … 1185 1198 json_options = queryset.getoptions(qid); 1186 1199 } 1187 1200 1188 1201 // JSON conversion 1189 1202 if (qstring.length == 0){ … … 1200 1213 jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"] = [{}]; 1201 1214 } 1202 var jsonq = {"name":"", "squerystring":squery, "querystring":qstring,"searchclauses":"null" , "collections" : json_coll, "columns" : json_cols, "options" : json_options, "bookmark" : bookmark}; 1215 var dt = new Date(); 1216 var str_time = dateFormat(dt);//dt.toString("dd/mm/yyyy HH:mm:ss"); 1217 var jsonq = {"name":"", "squerystring":squery, "querystring":qstring,"searchclauses":"null" , "collections" : json_coll, "columns" : json_cols, "options" : json_options, "bookmark" : bookmark, "time" : str_time}; 1203 1218 1204 1219 var name; … … 1311 1326 var id = $('#qts_select option').size(); 1312 1327 var dt = new Date(); 1313 var str_time = d t.toString("yyyy-MM-dd HH:mm:ss");1328 var str_time = dateFormat(dt);//dt.toString("yyyy-MM-dd HH:mm:ss"); 1314 1329 1315 1330 if (id == 0){ -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
r1059 r1062 82 82 } 83 83 84 if (json.time == undefined){ 85 this.time_created = null; 86 } else { 87 this.time_created = json.time; 88 } 84 89 }; 85 90 … … 181 186 } 182 187 return collection_text; 188 }; 189 190 Query.columnstext = function(json) { 191 var columns_text = ""; 192 if (json.columns != "null"){ 193 $.each(json.columns,function(i,item){ 194 columns_text = columns_text + "," + item; 195 }); 196 if (columns_text.length > 1) { 197 columns_text = columns_text.substring(1); 198 } 199 } 200 return columns_text; 201 }; 202 203 Query.optionstext = function(json) { 204 var options_text = ""; 205 if (json.options == undefined){ 206 return ""; 207 } 208 if (json.options != "null"){ 209 $.each(json.options,function(i,item){ 210 options_text = options_text + "," + item; 211 }); 212 if (options_text.length > 1) { 213 options_text = options_text.substring(1); 214 } 215 } 216 return options_text; 183 217 }; 184 218 … … 626 660 } 627 661 } 628 662 629 663 if (opts != null) { 630 664 json_opts = [{}]; 631 665 json_opts[0] = opts; 632 666 } 633 return opts;667 return json_opts; 634 668 }, 635 669 resubmit: function(qid){ -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_widgets.js
r1059 r1062 341 341 342 342 343 344 function dateFormat(dt){ 345 346 var str = ""; 347 var month = dt.getMonth() + 1; 348 if (month < 10){ 349 month = "0" + month 350 } 351 var day = dt.getDay(); 352 if (day < 10){ 353 day = "0" + day; 354 } 355 var hours = dt.getHours(); 356 if (hours < 10) { 357 hours = "0" + hours; 358 } 359 var minute = dt.getMinutes(); 360 if (minute < 10) { 361 minute = "0" + hours; 362 } 363 var second = dt.getSeconds(); 364 if (second < 10) { 365 second = "0" + second; 366 } 367 str = dt.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minute + ":" + second; 368 369 return str; 370 }
Note: See TracChangeset
for help on using the changeset viewer.