Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
dd61e708
Commit
dd61e708
authored
May 30, 2015
by
babanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made change for details and lineage
made change for details and lineage
parent
de0371f8
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
91 additions
and
58 deletions
+91
-58
common.css
dashboard/v2/public/css/common.css
+5
-0
app.js
dashboard/v2/public/js/app.js
+4
-0
detailsController.js
dashboard/v2/public/modules/details/detailsController.js
+4
-3
details.html
dashboard/v2/public/modules/details/views/details.html
+0
-0
homeRoutes.js
dashboard/v2/public/modules/home/homeRoutes.js
+2
-2
lineageController.js
dashboard/v2/public/modules/lineage/lineageController.js
+58
-34
navigationController.js
...oard/v2/public/modules/navigation/navigationController.js
+1
-1
navigationModule.js
dashboard/v2/public/modules/navigation/navigationModule.js
+1
-2
searchController.js
dashboard/v2/public/modules/search/searchController.js
+11
-7
searchDirective.js
dashboard/v2/public/modules/search/searchDirective.js
+3
-2
searchRoutes.js
dashboard/v2/public/modules/search/searchRoutes.js
+2
-2
foot.html
dashboard/v2/public/views/includes/foot.html
+0
-5
No files found.
dashboard/v2/public/css/common.css
View file @
dd61e708
...
...
@@ -120,3 +120,7 @@ footer.navbar-bottom img {
min-height
:
0
;
padding
:
5px
5px
5px
0
;
}
#Details
{
height
:
800px
;
}
\ No newline at end of file
dashboard/v2/public/js/app.js
View file @
dd61e708
...
...
@@ -38,6 +38,10 @@ angular.module('dgc').factory('lodash', ['$window',
function
(
$window
)
{
return
$window
.
d3
;
}
]).
factory
(
'dagreD3'
,
[
'$window'
,
function
(
$window
)
{
return
$window
.
dagreD3
;
}
]).
factory
(
'Global'
,
[
'$window'
,
function
(
$window
)
{
return
{
...
...
dashboard/v2/public/modules/details/detailsController.js
View file @
dd61e708
...
...
@@ -21,11 +21,12 @@
angular
.
module
(
'dgc.details'
).
controller
(
'DetailsController'
,
[
'$scope'
,
'$stateParams'
,
'DetailsResource'
,
function
(
$scope
,
$stateParams
,
DetailsResource
)
{
var
details
=
DetailsResource
.
get
({
DetailsResource
.
get
({
id
:
$stateParams
.
id
},
function
(
data
)
{
$scope
.
details
=
data
;
$scope
.
tableName
=
data
.
values
.
name
;
});
$scope
.
details
=
details
;
$scope
.
tableName
=
details
.
name
;
$scope
.
isString
=
angular
.
isString
;
...
...
dashboard/v2/public/modules/details/views/details.html
View file @
dd61e708
dashboard/v2/public/modules/home/homeRoutes.js
View file @
dd61e708
...
...
@@ -24,8 +24,8 @@ angular.module('dgc.home.routes', []).config(['$stateProvider',
// states for my app
$stateProvider
.
state
(
'home'
,
{
url
:
'/'
,
templateUrl
:
'/modules/
home/views/home
.html'
url
:
'/
search
'
,
templateUrl
:
'/modules/
search/views/search
.html'
});
}
]);
dashboard/v2/public/modules/lineage/lineageController.js
View file @
dd61e708
...
...
@@ -18,73 +18,98 @@
'use strict'
;
angular
.
module
(
'dgc.lineage'
).
controller
(
'LineageController'
,
[
'$element'
,
'$scope'
,
'$state'
,
'$stateParams'
,
'lodash'
,
'LineageResource'
,
'd3'
,
function
(
$element
,
$scope
,
$state
,
$stateParams
,
_
,
LineageResource
,
d3
)
{
angular
.
module
(
'dgc.lineage'
).
controller
(
'LineageController'
,
[
'$element'
,
'$scope'
,
'$state'
,
'$stateParams'
,
'lodash'
,
'LineageResource'
,
'd3'
,
'dagreD3'
,
function
(
$element
,
$scope
,
$state
,
$stateParams
,
_
,
LineageResource
,
d3
,
dagreD3
)
{
$scope
.
metaData
=
[];
$scope
.
metaData
=
[];
LineageResource
.
get
({
tableName
:
$scope
.
tableName
,
type
:
"outputs"
},
function
lineageSuccess
(
response
)
{
LineageResource
.
get
({
tableName
:
$scope
.
tableName
,
type
:
"outputs"
},
function
lineageSuccess
(
response
)
{
$scope
.
metaData
=
response
.
results
;
renderGraph
(
transformData
(
response
.
results
),
d3
.
select
(
$element
[
0
]).
select
(
'svg'
));
});
tableName
=
"sales_fact_daily_mv"
;
LineageResource
.
get
({
tableName
:
$scope
.
tableName
,
type
:
"inputs"
},
function
lineageSuccess
(
response
)
{
LineageResource
.
get
({
tableName
:
$scope
.
tableName
,
type
:
"inputs"
},
function
lineageSuccess
(
response
)
{
$scope
.
metaData
=
response
.
results
;
renderGraph
(
transformData
(
response
.
results
),
d3
.
select
(
$element
[
0
]).
select
(
'svg'
));
});
function
transformData
(
metaData
){
function
transformData
(
metaData
)
{
var
nodes
=
[];
var
name
,
guid
;
var
nodeGuids
=
Object
.
keys
(
metaData
.
values
.
vertices
);
for
(
var
index
in
nodeGuids
)
{
name
=
metaData
.
values
.
vertices
[
nodeGuids
[
index
]].
values
.
name
;
guid
=
nodeGuids
[
index
];
nodes
.
push
({
guid
:
guid
,
label
:
name
,
shape
:
"rect"
});
nodes
.
push
({
guid
:
guid
,
label
:
name
,
shape
:
"rect"
});
}
var
edges
=
[];
var
parent
;
var
child
;
var
edgesParents
=
Object
.
keys
(
metaData
.
values
.
edges
);
for
(
index
in
edgesParents
)
{
for
(
index
in
edgesParents
)
{
parent
=
edgesParents
[
index
];
for
(
var
j
=
0
;
j
<
metaData
.
values
.
edges
[
parent
].
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
metaData
.
values
.
edges
[
parent
].
length
;
j
++
)
{
child
=
metaData
.
values
.
edges
[
parent
][
j
];
if
(
!
metaData
.
values
.
vertices
.
hasOwnProperty
(
child
))
{
nodes
.
push
({
guid
:
child
,
label
:
'Load Process'
,
shape
:
"circle"
});
if
(
!
metaData
.
values
.
vertices
.
hasOwnProperty
(
child
))
{
nodes
.
push
({
guid
:
child
,
label
:
'Load Process'
,
shape
:
"circle"
});
}
edges
.
push
({
parent
:
parent
,
child
:
child
});
edges
.
push
({
parent
:
parent
,
child
:
child
});
}
}
return
{
nodes
:
nodes
,
edges
:
edges
};
return
{
nodes
:
nodes
,
edges
:
edges
};
}
function
renderGraph
(
data
,
element
){
function
renderGraph
(
data
,
element
)
{
// Create a new directed graph
var
g
=
new
dagreD3
.
graphlib
.
Graph
()
.
setGraph
({
rankdir
:
"LR"
});
.
setGraph
({
rankdir
:
"LR"
});
// Automatically label each of the nodes
//g.setNode("DB (sales)", { label: "Sales DB", width: 144, height: 100 })
//states.forEach(function(state) { g.setNode(state, { label: state }); });
// Automatically label each of the nodes
//g.setNode("DB (sales)", { label: "Sales DB", width: 144, height: 100 })
//states.forEach(function(state) { g.setNode(state, { label: state }); });
_
.
forEach
(
data
.
nodes
,
function
(
node
)
{
g
.
setNode
(
node
.
guid
,
{
label
:
node
.
label
,
shape
:
node
.
shape
});
_
.
forEach
(
data
.
nodes
,
function
(
node
)
{
g
.
setNode
(
node
.
guid
,
{
label
:
node
.
label
,
shape
:
node
.
shape
});
});
_
.
forEach
(
data
.
edges
,
function
(
edge
)
{
g
.
setEdge
(
edge
.
parent
,
edge
.
child
,
{
label
:
""
});
g
.
setEdge
(
edge
.
parent
,
edge
.
child
,
{
label
:
""
});
});
// Set some general styles
// Set some general styles
g
.
nodes
().
forEach
(
function
(
v
)
{
var
node
=
g
.
node
(
v
);
node
.
rx
=
node
.
ry
=
5
;
...
...
@@ -92,21 +117,20 @@ angular.module('dgc.lineage').controller('LineageController', ['$element', '$sco
var
inner
=
element
.
select
(
"g"
);
// Create the renderer
// Create the renderer
var
render
=
new
dagreD3
.
render
();
// Run the renderer. This is what draws the final graph.
// Run the renderer. This is what draws the final graph.
render
(
inner
,
g
);
// Center the graph
// Center the graph
var
initialScale
=
0.75
;
zoom
.
translate
([(
element
.
attr
(
"width"
)
-
g
.
graph
().
width
*
initialScale
)
/
2
,
20
])
.
scale
(
initialScale
)
.
event
(
element
);
//
zoom
//
.translate([(element.attr("width") - g.graph().width * initialScale) / 2, 20])
//
.scale(initialScale)
//
.event(element);
element
.
attr
(
'height'
,
g
.
graph
().
height
*
initialScale
+
90
);
}
}
]);
dashboard/v2/public/modules/navigation/navigationController.js
View file @
dd61e708
...
...
@@ -21,7 +21,7 @@
angular
.
module
(
'dgc.navigation'
).
controller
(
'NavigationController'
,
[
'$scope'
,
'NavigationResource'
,
function
(
$scope
,
NavigationResource
)
{
$scope
.
leftnav
=
NavigationResource
.
get
();
$scope
.
leftnav
=
NavigationResource
.
get
();
$scope
.
updateVar
=
function
(
event
)
{
$scope
.
$$prevSibling
.
query
=
angular
.
element
(
event
.
target
).
text
();
...
...
dashboard/v2/public/modules/navigation/navigationModule.js
View file @
dd61e708
...
...
@@ -18,4 +18,4 @@
'use strict'
;
angular
.
module
(
'dgc.navigation'
,[]);
\ No newline at end of file
angular
.
module
(
'dgc.navigation'
,
[]);
dashboard/v2/public/modules/search/searchController.js
View file @
dd61e708
...
...
@@ -21,21 +21,25 @@
angular
.
module
(
'dgc.search'
).
controller
(
'SearchController'
,
[
'$scope'
,
'$location'
,
'$http'
,
'$state'
,
'$stateParams'
,
'SearchResource'
,
'NotificationService'
,
function
(
$scope
,
$location
,
$http
,
$state
,
$stateParams
,
SearchResource
,
NotificationService
)
{
$scope
.
types
=
[
'table'
,
'column'
,
'db'
,
'view'
,
'loadprocess'
,
'storagedesc'
];
$scope
.
types
=
[
'table'
,
'column'
,
'db'
,
'view'
,
'loadprocess'
,
'storagedesc'
];
$scope
.
results
=
[];
$scope
.
resultCount
=
0
;
$scope
.
resultCount
=
0
;
$scope
.
isCollapsed
=
true
;
$scope
.
search
=
function
(
query
)
{
$scope
.
results
=
[];
NotificationService
.
reset
();
$scope
.
limit
=
4
;
SearchResource
.
search
({
query
:
query
},
function
searchSuccess
(
response
)
{
SearchResource
.
search
({
query
:
query
},
function
searchSuccess
(
response
)
{
$scope
.
results
=
response
.
results
;
$scope
.
resultCount
=
response
.
count
;
$scope
.
resultCount
=
response
.
count
;
if
(
$scope
.
results
.
length
<
1
)
{
NotificationService
.
error
(
'No Result found'
,
false
);
}
$state
.
go
(
'search.results'
,
{
query
:
query
},
{
$state
.
go
(
'search.results'
,
{
query
:
query
},
{
location
:
'replace'
});
},
function
searchError
(
err
)
{
...
...
@@ -56,13 +60,13 @@ angular.module('dgc.search').controller('SearchController', ['$scope', '$locatio
$scope
.
filterSearchResults
=
function
(
items
)
{
var
res
=
{};
angular
.
forEach
(
items
,
function
(
value
,
key
)
{
if
((
typeof
value
!==
'object'
))
if
((
typeof
value
!==
'object'
))
res
[
key
]
=
value
;
});
return
res
;
};
$scope
.
query
=
$stateParams
.
query
;
$scope
.
query
=
$stateParams
.
query
;
if
(
$scope
.
query
)
{
$scope
.
search
(
$scope
.
query
);
}
...
...
dashboard/v2/public/modules/search/searchDirective.js
View file @
dd61e708
...
...
@@ -19,11 +19,12 @@
'use strict'
;
angular
.
module
(
'dgc.search'
).
directive
(
"myDirective"
,
function
()
{
"myDirective"
,
function
()
{
return
{
restrict
:
'EA'
,
template
:
'<a href="javascript: void(0);" button-toggle toggle="isCollapsed" class="show-more" ng-click="isCollapsed = !isCollapsed">..show more</a>'
,
link
:
function
(
$scope
){
link
:
function
(
$scope
)
{
$scope
.
isCollapsed
=
true
;
console
.
log
(
$scope
.
isCollapsed
);
},
...
...
dashboard/v2/public/modules/search/searchRoutes.js
View file @
dd61e708
...
...
@@ -26,11 +26,11 @@ angular.module('dgc.search').config(['$stateProvider',
$stateProvider
.
state
(
'search'
,
{
url
:
'/search'
,
templateUrl
:
'/modules/search/views/search.html'
,
controller
:
'SearchController'
controller
:
'SearchController'
}).
state
(
'search.results'
,
{
url
:
'/:query'
,
templateUrl
:
'/modules/search/views/searchResult.html'
,
controller
:
'SearchController'
controller
:
'SearchController'
});
}
]);
dashboard/v2/public/views/includes/foot.html
View file @
dd61e708
...
...
@@ -15,11 +15,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<script>
$
(
function
()
{
$
(
'#myTab a:last'
).
tab
(
'show'
)
})
</script>
<!-- Angular JS -->
<script
type=
"text/javascript"
src=
"/lib/angular/angular.min.js"
></script>
<script
type=
"text/javascript"
src=
"/lib/lodash/lodash.min.js"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment