123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- /*##############################################################################
- # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
- #
- # Licensed 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.
- ############################################################################## */
- define([
- "dojo/_base/declare",
- "dojo/_base/lang",
- "dojo/i18n",
- "dojo/i18n!./nls/common",
- "dojo/i18n!./nls/QuerySetSuperFilesWidget",
- "dojo/_base/array",
- "dojo/on",
- "dijit/form/Button",
- "dgrid/OnDemandGrid",
- "dgrid/Keyboard",
- "dgrid/Selection",
- "dgrid/selector",
- "dgrid/extensions/ColumnResizer",
- "dgrid/extensions/DijitRegistry",
- "hpcc/GridDetailsWidget",
- "hpcc/ESPWorkunit",
- "hpcc/ESPQuery",
- "hpcc/ESPUtil"
- ], function (declare, lang, i18n, nlsCommon, nlsSpecific, arrayUtil, on,
- Button,
- OnDemandGrid, Keyboard, Selection, selector, ColumnResizer, DijitRegistry,
- GridDetailsWidget, ESPWorkunit, ESPQuery, ESPUtil) {
- return declare("QuerySetSuperFilesWidget", [GridDetailsWidget], {
- i18n: lang.mixin(nlsCommon, nlsSpecific),
- gridTitle: nlsSpecific.title,
- idProperty: "Name",
- wu: null,
- query: null,
- init: function (params) {
- if (this.inherited(arguments))
- return;
- this._refreshActionState();
- },
- createGrid: function (domID) {
- var context = this;
- var retVal = new declare([OnDemandGrid, Keyboard, Selection, ColumnResizer, DijitRegistry, ESPUtil.GridHelper])({
- allowSelectAll: true,
- deselectOnRefresh: false,
- store: ESPQuery.CreateQueryStore(),
- columns: {
- col1: selector({ width: 27, selectorType: 'checkbox' }),
- /*Item: {
- label: "File", width: 180, sortable: true,
- formatter: function (Wuid, row) {
- var wu = row.Server === "DFUserver" ? ESPDFUWorkunit.Get(Wuid) : ESPWorkunit.Get(Wuid);
- return "<img src='" + wu.getStateImage() + "'> <a href='#' class='" + context.id + "WuidClick'>" + Wuid + "</a>";
- }
- },*/
- LogicalFiles: { label: this.i18n.LogicalFiles, width: 108, sortable: false },
- /*State: {
- label: "State", width: 180, sortable: true, formatter: function (state, row) {
- return state + (row.Duration ? " (" + row.Duration + ")" : "");
- }
- },*/
- /*Owner: { label: "Owner", width: 90, sortable: true },
- Jobname: { label: "Job Name", sortable: true }*/
- }
- }, domID);
- var context = this;
- on(document, "." + this.id + "WuidClick:click", function (evt) {
- if (context._onRowDblClick) {
- var row = retVal.row(evt).data;
- context._onRowDblClick(row);
- }
- });
- return retVal;
- },
- createDetail: function (id, row, params) {
- if (row.Server === "DFUserver") {
- return new DFUWUDetailsWidget.fixCircularDependency({
- id: id,
- title: row.ID,
- closable: true,
- hpcc: {
- params: {
- Wuid: row.ID
- }
- }
- });
- }
- return new WUDetailsWidget({
- id: id,
- title: row.Wuid,
- closable: true,
- hpcc: {
- params: {
- Wuid: row.Wuid
- }
- }
- });
- },
-
- refreshGrid: function (args) {
- var context = this;
- this.wu.getInfo({
- onGetTimers: function (timers) {
- // Required to calculate Graphs Total Time ---
- },
- onGetGraphs: function (graphs) {
- context.store.setData(graphs);
- context.grid.refresh();
- }
- });
- },
- refreshActionState: function (selection) {
- this.inherited(arguments);
- this.openSafeMode.set("disabled", !selection.length);
- }
- });
- });
|