提交 ed73f661 编写于 作者: M Maximilian Michels

[FLINK-2730] remove Apache License incompatible chart library

上级 3ade4c79
......@@ -15,29 +15,6 @@
See the License for the specific language governing permissions and
limitations under the License.
table.table(ng-if="metrics.id")
thead
tr
th CPU Usage
th Memory - Used
tbody
tr
td
livechart(data="metrics" key="cpuLoad")
td
livechart(data="metrics" key="used")
.row.text-center
span.label.legend-box#total-mem
|   
|  Total Memory  
span.label.legend-box#heap-mem
|   
|  Heap Memory  
span.label.legend-box#non-heap-mem
|   
|  Non-heap Memory  
table.table.table-properties(ng-if="metrics.id")
thead
......
......@@ -44,86 +44,6 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
JobsService.listJobs()
, flinkConfig["refresh-interval"]
Highcharts.setOptions({
global: {
useUTC: false
}
})
#
# Grid-light theme for Highcharts JS
# @author Torstein Honsi
#
# Taken from https://github.com/highslide-software/highcharts.com
#
Highcharts.createElement('link', {
href: '//fonts.googleapis.com/css?family=Dosis:400,600',
rel: 'stylesheet',
type: 'text/css'
}, null, document.getElementsByTagName('head')[0]);
Highcharts.theme = {
colors: ["#7cb5ec", "#f7a35c", "#90ee7e", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
chart: {
backgroundColor: null,
style: {
fontFamily: "Dosis, sans-serif"
}
},
title: {
style: {
fontSize: '16px',
fontWeight: 'bold',
textTransform: 'uppercase'
}
},
tooltip: {
borderWidth: 0,
backgroundColor: 'rgba(219,219,216,0.8)',
shadow: false
},
legend: {
itemStyle: {
fontWeight: 'bold',
fontSize: '13px'
}
},
xAxis: {
gridLineWidth: 1,
labels: {
style: {
fontSize: '12px'
}
}
},
yAxis: {
minorTickInterval: 'auto',
title: {
style: {
textTransform: 'uppercase'
}
},
labels: {
style: {
fontSize: '12px'
}
}
},
plotOptions: {
candlestick: {
lineColor: '#404048'
}
},
background2: '#F0F0EA'
};
Highcharts.setOptions(Highcharts.theme);
# --------------------------------------
......@@ -146,7 +66,7 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
main:
templateUrl: "partials/jobs/running-jobs.html"
controller: 'RunningJobsController'
.state "completed-jobs",
url: "/completed-jobs"
views:
......@@ -175,14 +95,14 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
views:
'node-details':
templateUrl: "partials/jobs/job.plan.node-list.overview.html"
controller: 'JobPlanOverviewController'
controller: 'JobPlanOverviewController'
.state "single-job.plan.accumulators",
url: "/accumulators"
views:
'node-details':
templateUrl: "partials/jobs/job.plan.node-list.accumulators.html"
controller: 'JobPlanAccumulatorsController'
controller: 'JobPlanAccumulatorsController'
.state "single-job.timeline",
url: "/timeline"
......@@ -265,4 +185,3 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
controller: 'JobManagerLogsController'
$urlRouterProvider.otherwise "/overview"
#
# 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.
#
angular.module('flinkApp')
.directive 'livechart', () ->
{
link: (scope, element, attrs) ->
getChartType = () ->
if attrs.key == "cpuLoad"
"spline"
else
"area"
getYAxisTitle = () ->
if attrs.key == "cpuLoad"
"CPU Usage(%)"
else
"Memory(MB)"
getKey1 = () ->
"memory.total." + attrs.key
getKey2 = () ->
"memory.heap." + attrs.key
getKey3 = () ->
"memory.non-heap." + attrs.key
getKey4 = () ->
"cpuLoad"
getChartOptions = () -> {
title: {text: ' '},
chart: {type: getChartType(), zoomType: 'x'},
xAxis: {type: 'datetime'},
yAxis: {
title: {text: getYAxisTitle() }
min: 0 if attrs.key == "cpuLoad",
max: 100 if attrs.key == "cpuLoad"
},
series: [
{name: "Memory: Total", id: getKey1(), data: [], color: "#7cb5ec"},
{name: "Memory: Heap", id: getKey2(), data: [], color: "#434348"},
{name: "Memory: Non-Heap", id: getKey3(), data: [], color: "#90ed7d"},
{name: "CPU Usage", id: getKey4(), data: [], color: "#f7a35c", showInLegend: false}
],
legend: {enabled: false},
tooltip: {shared: true},
exporting: {enabled: false},
credits: {enabled: false}
}
if !element.highcharts()?
element.highcharts(getChartOptions())
scope.$watch(attrs.data, (value) ->
updateCharts(value)
)
updateCharts = (value) ->
do(value) ->
heartbeat = value.timeSinceLastHeartbeat
chart = element.highcharts()
if attrs.key == "cpuLoad"
chart.get(getKey4()).addPoint([
heartbeat, +((value.metrics.gauges[getKey4()].value * 100).toFixed(2))
], true, false)
else
divider = 1048576
chart.get(getKey1()).addPoint([
heartbeat, +((value.metrics.gauges[getKey1()].value / divider).toFixed(2))
], true, false)
chart.get(getKey2()).addPoint([
heartbeat, +((value.metrics.gauges[getKey2()].value / divider).toFixed(2))
], true, false)
chart.get(getKey3()).addPoint([
heartbeat, +((value.metrics.gauges[getKey3()].value / divider).toFixed(2))
], true, false)
}
......@@ -23,8 +23,7 @@
"dagre-d3": "~0.4.10",
"font-awesome": "~4.3.0",
"moment-duration-format": "~1.3.0",
"qtip2": "~2.2.1",
"highcharts-release": "~4.1.8"
"qtip2": "~2.2.1"
},
"overrides": {
"dagre-d3": {
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -16,26 +16,8 @@ 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.
-->
<table ng-if="metrics.id" class="table">
<thead>
<tr>
<th>CPU Usage</th>
<th>Memory - Used</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<livechart data="metrics" key="cpuLoad"></livechart>
</td>
<td>
<livechart data="metrics" key="used"></livechart>
<div class="row text-center"><span id="total-mem" class="label legend-box">&nbsp;&nbsp;</span>&nbsp;Total Memory&nbsp;&nbsp;<span id="heap-mem" class="label legend-box">&nbsp;&nbsp;</span>&nbsp;Heap Memory&nbsp;&nbsp;<span id="non-heap-mem" class="label legend-box">&nbsp;&nbsp;</span>&nbsp;Non-heap Memory&nbsp;&nbsp;</div>
</td>
</tr>
</tbody>
</table>
<table ng-if="metrics.id" class="table table-properties">
<thead>
<tr>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册