Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 31FBC200D75 for ; Sat, 30 Dec 2017 00:32:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 30454160C3F; Fri, 29 Dec 2017 23:32:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D2134160C33 for ; Sat, 30 Dec 2017 00:32:46 +0100 (CET) Received: (qmail 9262 invoked by uid 500); 29 Dec 2017 23:32:46 -0000 Mailing-List: contact commits-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list commits@asterixdb.apache.org Received: (qmail 9253 invoked by uid 99); 29 Dec 2017 23:32:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Dec 2017 23:32:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 98AAEF1804; Fri, 29 Dec 2017 23:32:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: imaxon@apache.org To: commits@asterixdb.apache.org Date: Fri, 29 Dec 2017 23:32:43 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/21] asterixdb git commit: [ASTERIXDB-1375][UI] New Admin Dashboard archived-at: Fri, 29 Dec 2017 23:32:48 -0000 Repository: asterixdb Updated Branches: refs/heads/master 6ab9e4988 -> 1cb814b41 http://git-wip-us.apache.org/repos/asf/asterixdb/blob/1cb814b4/asterixdb/asterix-app/src/main/resources/queryui/js/json-formatter.min.js ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/main/resources/queryui/js/json-formatter.min.js b/asterixdb/asterix-app/src/main/resources/queryui/js/json-formatter.min.js deleted file mode 100644 index 77882c0..0000000 --- a/asterixdb/asterix-app/src/main/resources/queryui/js/json-formatter.min.js +++ /dev/null @@ -1 +0,0 @@ -/*! jsonformatter 0.6.0 - 2016-04-29T03:24:40.680Z | (c) 2014 Mohsen Azimi | http://www.apache.org/licenses/LICENSE-2.0 */"use strict";angular.module("jsonFormatter",["RecursionHelper"]).provider("JSONFormatterConfig",function(){var n=!1,e=100,t=5;return{get hoverPreviewEnabled(){return n},set hoverPreviewEnabled(e){n=!!e},get hoverPreviewArrayCount(){return e},set hoverPreviewArrayCount(n){e=parseInt(n,10)},get hoverPreviewFieldCount(){return t},set hoverPreviewFieldCount(n){t=parseInt(n,10)},$get:function(){return{hoverPreviewEnabled:n,hoverPreviewArrayCount:e,hoverPreviewFieldCount:t}}}}).directive("jsonFormatter",["RecursionHelper","JSONFormatterConfig",function(n,e){function t(n){return n.replace('"','"')}function r(n){if(void 0===n)return"";if(null===n)return"Object";if("object"==typeof n&&!n.constructor)return"Object";var e=/function (.{1,})\(/,t=e.exec(n.constructor.toString());return t&&t.length>1?t[1]:""}function o(n){return null===n?"null":typeof n}function s(n,e){var r=o (n);return"null"===r||"undefined"===r?r:("string"===r&&(e='"'+t(e)+'"'),"function"===r?n.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":e)}function i(n){var e="";return angular.isObject(n)?(e=r(n),angular.isArray(n)&&(e+="["+n.length+"]")):e=s(n,n),e}function a(n){n.isArray=function(){return angular.isArray(n.json)},n.isObject=function(){return angular.isObject(n.json)},n.getKeys=function(){return n.isObject()?Object.keys(n.json).map(function(n){return""===n?'""':n}):void 0},n.type=o(n.json),n.hasKey="undefined"!=typeof n.key,n.getConstructorName=function(){return r(n.json)},"string"===n.type&&("Invalid Date"!==new Date(n.json).toString()&&(n.isDate=!0),0===n.json.indexOf("http")&&(n.isUrl=!0)),n.isEmptyObject=function(){return n.getKeys()&&!n.getKeys().length&&n.isOpen&&!n.isArray()},n.isOpen=!!n.open,n.toggleOpen=function(){n.isOpen=!n.isOpen},n.childrenOpen=function(){return n.open>1?n.open-1:0},n.openLink=function(e){e&&(window.location.href=n.json)},n.parseValue= function(e){return s(n.json,e)},n.showThumbnail=function(){return!!e.hoverPreviewEnabled&&n.isObject()&&!n.isOpen},n.getThumbnail=function(){if(n.isArray())return n.json.length>e.hoverPreviewArrayCount?"Array["+n.json.length+"]":"["+n.json.map(i).join(", ")+"]";var t=n.getKeys(),r=t.slice(0,e.hoverPreviewFieldCount),o=r.map(function(e){return e+":"+i(n.json[e])}),s=t.length>=5?"…":"";return"{"+o.join(", ")+s+"}"}}return{templateUrl:"json-formatter.html",restrict:"E",replace:!0,scope:{json:"=",key:"=",open:"="},compile:function(e){return n.compile(e,a)}}}]),"object"==typeof module&&(module.exports="jsonFormatter"),angular.module("RecursionHelper",[]).factory("RecursionHelper",["$compile",function(n){return{compile:function(e,t){angular.isFunction(t)&&(t={post:t});var r,o=e.contents().remove();return{pre:t&&t.pre?t.pre:null,post:function(e,s){r||(r=n(o)),r(e,function(n){s.append(n)}),t&&t.post&&t.post.apply(null,arguments)}}}}}]),angular.module("jsonFormatter").run(["$templateCache" ,function(n){n.put("json-formatter.html",'')}]); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/asterixdb/blob/1cb814b4/asterixdb/asterix-app/src/main/resources/queryui/js/main.js ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/main/resources/queryui/js/main.js b/asterixdb/asterix-app/src/main/resources/queryui/js/main.js deleted file mode 100644 index 793c06e..0000000 --- a/asterixdb/asterix-app/src/main/resources/queryui/js/main.js +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -var SERVER_HOST = ""; -var DATAVERSE_QUERY = "for $x in dataset Metadata.Dataverse return $x;" -var DATE_TIME_REGEX = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)$/; -var DATE_REGEX = /^(\d{4}-\d{2}-\d{2})$/; - -var app = angular.module('queryui', ['jsonFormatter', 'ui.codemirror']); - -app.service('recordFunctions', function () { - this.ObjectKeys = function (obj) { - var typeStr = Object.prototype.toString.call(obj); - var res = []; - if (typeStr === "[object Object]") { - for (var key in obj) { - if (obj.hasOwnProperty(key) && !(key === "$$hashKey")) { - res.push(key) - } - } - } else { - res = [-1]; - } - return res; - } - this.isObject = function (obj) { - var typeStr = Object.prototype.toString.call(obj); - if (typeStr === "[object Object]") { - return true; - } else { - return false; - } - } - this.isArray = function (obj) { - var typeStr = Object.prototype.toString.call(obj); - if ((typeStr === "[object Array]" )) { - return true; - } else { - return false; - } - } - this.isNested = function (obj) { - return this.isObject(obj) || this.isArray(obj); - } - this.ObjectValue = function (obj, key) { - var typeStr; - var value; - if (key == -1) { - typeStr = Object.prototype.toString.call(obj); - value = obj; - } else { - typeStr = Object.prototype.toString.call(obj[key]); - value = obj[key]; - } - if (typeStr === "[object Array]") { - return "List +"; - } else if (typeStr === "[object Object]") { - return "Record +"; - } else if (typeStr == "[object Null]") { - return "NULL"; - } else if (DATE_REGEX.exec(value) != null) { - var dat = new Date(value); - return dat.getUTCFullYear() + "/" + dat.getUTCMonth() + "/" + dat.getUTCDay(); - } else if (DATE_TIME_REGEX.exec(value) != null) { - var dat = new Date(value); - return dat.getUTCFullYear() + "/" + dat.getUTCMonth() + "/" + dat.getUTCDay() - + " " + dat.getUTCHours() + ":" + dat.getUTCMinutes() + ":" + dat.getUTCSeconds(); - } else { - return value; - } - } -}); - -app.controller('queryCtrl', function ($rootScope, $scope, $http, recordFunctions) { - - $scope.recordFunctions = recordFunctions; - $scope.current_tab = 0; - $scope.current_preview_tab = 0; - $scope.current_list = 0; - $scope.maximized = false; - $scope.collapsed = false; - $scope.results = []; - $scope.history = []; - $scope.dataverses = []; - $scope.selectedItem = null; - $scope.selected_dataverse = ""; - $scope.errorText = null; - $scope.statusText = "Wait..."; - $scope.query_input = ""; - $scope.uiReady = false; - - $scope.queryCmOptions = { - lineNumbers: true, - indentWithTabs: true, - lineWrapping: false, - mode: 'aql' - } - - $scope.queryPreviewOptions = { - indentWithTabs: true, - lineWrapping: true, - mode: 'javascript', - readOnly: true - } - - $scope.init = function () { - $http.post("/").then(function (response) { - SERVER_HOST = location.protocol + "//" + location.hostname + ":" + response.data.api_port; - $scope.initDataverses(); - }, function (response) { - $scope.statusText = "Unable to get Asterix HTTP API Port"; - }); - } - - $scope.initDataverses = function () { - $http.get(SERVER_HOST + "/query?query=" + encodeURIComponent(DATAVERSE_QUERY)).then(function (response) { - for (i in response.data) { - $scope.dataverses.push(response.data[i].DataverseName); - $scope.selected_dataverse = $scope.dataverses[0]; - $scope.statusText = "Web UI Ready"; - $scope.uiReady = true; - } - }, - function (response) { - $scope.statusText = "Error Occurred Executing Query"; - $scope.errorText = response.data.summary; - $scope.maximized = false; - }); - $scope.load(); - } - - $scope.query = function () { - var timer = new Date().getTime(); - $scope.save($scope.query_input, $scope.selected_dataverse); - var uri = SERVER_HOST + "/query?query=" + - encodeURIComponent("use dataverse " + $scope.selected_dataverse + ";" + $scope.query_input) - $http.get(uri) - .then(function (response) { - $scope.results = response.data; - console.log(response); - timer = new Date().getTime() - timer; - $scope.statusText = "Query returned " + $scope.results.length + " records in " + timer + "ms"; - $scope.errorText = null; - $scope.maximized = false; - }, - function (response) { - $scope.statusText = "Error Occurred Executing Query"; - $scope.errorText = response.data.summary; - $scope.maximized = false; - $scope.results = []; - }); - } - - $scope.isNested = function (obj) { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - var typeStr = Object.prototype.toString.call(obj[key]); - if (typeStr === "[object Array]" || typeStr === "[object Object]") { - return true; - } - } - } - return false; - } - - $scope.isRecordPlus = function (obj, key) { - var value; - if (key == -1) { - value = obj; - } else { - value = obj[key]; - } - return $scope.recordFunctions.isNested(value) ? "asterix-nested" : ""; - } - - $scope.viewRecord = function (obj) { - $scope.selectedItem = obj; - $scope.current_preview_tab = 0; - $("#recordModel").modal(); - } - - $scope.previewJSON = function (obj) { - return JSON.stringify(obj, null, 4); - } - - $scope.save = function (query, database) { - var toSave = [query, database]; - if ($scope.history.length >= 1) { - var i = $scope.history.length - 1; - if (new String(query).valueOf() === new String($scope.history[i][0]).valueOf()) { - if (new String(database).valueOf() === new String($scope.history[i][1]).valueOf()) { - return; - } - } - } - if ($scope.history.push(toSave) == 11) { - $scope.history.shift(); - } - localStorage.setItem("history", JSON.stringify($scope.history)); - } - - $scope.load = function () { - var history = JSON.parse(localStorage.getItem("history")); - if (history != null) { - $scope.history = history; - } - } - - $scope.previewHistory = function (entry) { - $scope.current_tab = 0; - $scope.query_input = entry[0]; - $scope.selected_dataverse = entry[1]; - } - - $scope.leftContainerClass = function () { - if ($scope.maximized) { - return 'col-md-12'; - } else { - if ($scope.collapsed) { - return 'col-md-1'; - } else { - return 'col-md-4' - } - } - } - - $scope.rightContainerClass = function () { - if ($scope.maximized) { - return 'col-md-0'; - } else { - if ($scope.collapsed) { - return 'col-md-11'; - } else { - return 'col-md-8' - } - } - } - -}); http://git-wip-us.apache.org/repos/asf/asterixdb/blob/1cb814b4/asterixdb/asterix-app/src/main/resources/queryui/js/ui-codemirror.js ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/main/resources/queryui/js/ui-codemirror.js b/asterixdb/asterix-app/src/main/resources/queryui/js/ui-codemirror.js deleted file mode 100644 index 6eb35df..0000000 --- a/asterixdb/asterix-app/src/main/resources/queryui/js/ui-codemirror.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2012 the AngularUI Team, http://angular-ui.github.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -'use strict'; - -/** - * Binds a CodeMirror widget to a -
- -
-
-
-
-
{{query[0]}}
- -
-
-
-
-
- - - - -
-
- - -
-
- -
-
-
-
-
-
-
-
- -
-

{{statusText}}

- -
- - -
-
- - - - - - -
-

{{key == -1 ? 'value' : key}}

{{recordFunctions.ObjectValue(record,key)}} -
-
-
-
-
-
{{recordFunctions.ObjectValue(record,key)}}
-

{{key == -1 ? 'value' : key}}

-
-
-
- NESTED -
-
-
-
- -
- - - http://git-wip-us.apache.org/repos/asf/asterixdb/blob/1cb814b4/asterixdb/pom.xml ---------------------------------------------------------------------- diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml index 0308d22..ff70c39 100644 --- a/asterixdb/pom.xml +++ b/asterixdb/pom.xml @@ -422,6 +422,9 @@ org.apache.hyracks license-automation-plugin ${hyracks.version} + + -Xmx2048m + org.apache.maven.plugins