mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-23 21:31:00 +02:00
Fixing some content and visual glitches in the device flows view.
- idle timeout - hard timeout - app name fix - CSS styles & details pane structure Change-Id: I90a04cfe679a1c8371d06aed3d972c9f0bc93f6f
This commit is contained in:
parent
2b05752370
commit
3da62124b0
@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableSet;
|
|||||||
import org.onosproject.app.ApplicationService;
|
import org.onosproject.app.ApplicationService;
|
||||||
import org.onosproject.core.Application;
|
import org.onosproject.core.Application;
|
||||||
import org.onosproject.core.ApplicationId;
|
import org.onosproject.core.ApplicationId;
|
||||||
|
import org.onosproject.core.CoreService;
|
||||||
import org.onosproject.core.DefaultApplicationId;
|
import org.onosproject.core.DefaultApplicationId;
|
||||||
import org.onosproject.net.DeviceId;
|
import org.onosproject.net.DeviceId;
|
||||||
import org.onosproject.net.flow.FlowEntry;
|
import org.onosproject.net.flow.FlowEntry;
|
||||||
@ -76,7 +77,8 @@ public class FlowViewMessageHandler extends UiMessageHandler {
|
|||||||
private static final String SELECTOR = "selector";
|
private static final String SELECTOR = "selector";
|
||||||
private static final String TREATMENT_C = "treatment_c"; // for table column
|
private static final String TREATMENT_C = "treatment_c"; // for table column
|
||||||
private static final String TREATMENT = "treatment";
|
private static final String TREATMENT = "treatment";
|
||||||
private static final String TIMEOUT = "timeout";
|
private static final String IDLE_TIMEOUT = "idleTimeout";
|
||||||
|
private static final String HARD_TIMEOUT = "hardTimeout";
|
||||||
private static final String PERMANENT = "permanent";
|
private static final String PERMANENT = "permanent";
|
||||||
private static final String STATE = "state";
|
private static final String STATE = "state";
|
||||||
private static final String PACKETS = "packets";
|
private static final String PACKETS = "packets";
|
||||||
@ -134,7 +136,7 @@ public class FlowViewMessageHandler extends UiMessageHandler {
|
|||||||
APP_NAME,
|
APP_NAME,
|
||||||
|
|
||||||
GROUP_ID,
|
GROUP_ID,
|
||||||
TIMEOUT,
|
IDLE_TIMEOUT,
|
||||||
PERMANENT,
|
PERMANENT,
|
||||||
|
|
||||||
SELECTOR_C,
|
SELECTOR_C,
|
||||||
@ -169,9 +171,13 @@ public class FlowViewMessageHandler extends UiMessageHandler {
|
|||||||
// Return an application name, based on a lookup of the internal short ID
|
// Return an application name, based on a lookup of the internal short ID
|
||||||
private String makeAppName(short id, Map<Short, ApplicationId> lookup) {
|
private String makeAppName(short id, Map<Short, ApplicationId> lookup) {
|
||||||
ApplicationId appId = lookup.get(id);
|
ApplicationId appId = lookup.get(id);
|
||||||
|
if (appId == null) {
|
||||||
|
appId = get(CoreService.class).getAppId(id);
|
||||||
if (appId == null) {
|
if (appId == null) {
|
||||||
return UNKNOWN + SPACE + ANGLE_O + id + ANGLE_C;
|
return UNKNOWN + SPACE + ANGLE_O + id + ANGLE_C;
|
||||||
}
|
}
|
||||||
|
lookup.put(id, appId);
|
||||||
|
}
|
||||||
String appName = appId.name();
|
String appName = appId.name();
|
||||||
return appName.startsWith(ONOS_PREFIX)
|
return appName.startsWith(ONOS_PREFIX)
|
||||||
? appName.replaceFirst(ONOS_PREFIX, ONOS_MARKER) : appName;
|
? appName.replaceFirst(ONOS_PREFIX, ONOS_MARKER) : appName;
|
||||||
@ -238,7 +244,7 @@ public class FlowViewMessageHandler extends UiMessageHandler {
|
|||||||
.cell(APP_NAME, makeAppName(flow.appId(), lookup))
|
.cell(APP_NAME, makeAppName(flow.appId(), lookup))
|
||||||
|
|
||||||
.cell(GROUP_ID, flow.groupId().id())
|
.cell(GROUP_ID, flow.groupId().id())
|
||||||
.cell(TIMEOUT, flow.timeout())
|
.cell(IDLE_TIMEOUT, flow.timeout())
|
||||||
.cell(PERMANENT, flow.isPermanent())
|
.cell(PERMANENT, flow.isPermanent())
|
||||||
|
|
||||||
.cell(SELECTOR_C, flow)
|
.cell(SELECTOR_C, flow)
|
||||||
@ -415,7 +421,8 @@ public class FlowViewMessageHandler extends UiMessageHandler {
|
|||||||
data.put(APP_NAME, makeAppName(flow.appId(), appShortMap()));
|
data.put(APP_NAME, makeAppName(flow.appId(), appShortMap()));
|
||||||
|
|
||||||
data.put(GROUP_ID, decorateGroupId(flow));
|
data.put(GROUP_ID, decorateGroupId(flow));
|
||||||
data.put(TIMEOUT, flow.hardTimeout());
|
data.put(IDLE_TIMEOUT, flow.timeout());
|
||||||
|
data.put(HARD_TIMEOUT, flow.hardTimeout());
|
||||||
data.put(PERMANENT, flow.isPermanent());
|
data.put(PERMANENT, flow.isPermanent());
|
||||||
|
|
||||||
data.set(SELECTOR, jsonCriteria(flow));
|
data.set(SELECTOR, jsonCriteria(flow));
|
||||||
|
@ -64,10 +64,20 @@
|
|||||||
#flow-details-panel h2 {
|
#flow-details-panel h2 {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
|
font-size: 16pt;
|
||||||
|
font-weight: lighter;
|
||||||
|
}
|
||||||
|
|
||||||
|
#flow-details-panel h3 {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 8px 0;
|
||||||
|
font-size: 11pt;
|
||||||
|
font-variant: small-caps;
|
||||||
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
#flow-details-panel .top-content table {
|
#flow-details-panel .top-content table {
|
||||||
font-size: 12pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
#flow-details-panel td.label {
|
#flow-details-panel td.label {
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
pHeight,
|
pHeight,
|
||||||
top,
|
top,
|
||||||
topTable,
|
topTable,
|
||||||
trtDiv,
|
|
||||||
selDiv,
|
|
||||||
topSelTable,
|
topSelTable,
|
||||||
topTrtTable,
|
topTrtTable,
|
||||||
iconDiv,
|
iconDiv,
|
||||||
@ -39,7 +37,7 @@
|
|||||||
|
|
||||||
// constants
|
// constants
|
||||||
var topPdg = 28,
|
var topPdg = 28,
|
||||||
wtPdg = 532,
|
wtPdg = 400,
|
||||||
|
|
||||||
pName = 'flow-details-panel',
|
pName = 'flow-details-panel',
|
||||||
detailsReq = 'flowDetailsRequest',
|
detailsReq = 'flowDetailsRequest',
|
||||||
@ -59,7 +57,8 @@
|
|||||||
'appId',
|
'appId',
|
||||||
|
|
||||||
'groupId',
|
'groupId',
|
||||||
'timeout',
|
'idleTimeout',
|
||||||
|
'hardTimeout',
|
||||||
'permanent',
|
'permanent',
|
||||||
],
|
],
|
||||||
friendlyProps = [
|
friendlyProps = [
|
||||||
@ -76,7 +75,8 @@
|
|||||||
'App ID',
|
'App ID',
|
||||||
|
|
||||||
'Group ID',
|
'Group ID',
|
||||||
'Timeout',
|
'Idle Timeout',
|
||||||
|
'Hard Timeout',
|
||||||
'Permanent',
|
'Permanent',
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -112,16 +112,12 @@
|
|||||||
.append('table');
|
.append('table');
|
||||||
top.append('hr');
|
top.append('hr');
|
||||||
|
|
||||||
selDiv = container.append('div').classed('top', true);
|
top.append('h3').text('Selector');
|
||||||
selDiv.append('h2').text('Selector');
|
topSelTable = top.append('div').classed('top-content', true).append('table');
|
||||||
topSelTable = selDiv.append('div').classed('top-content', true)
|
top.append('hr');
|
||||||
.append('table');
|
|
||||||
selDiv.append('hr');
|
|
||||||
|
|
||||||
trtDiv = container.append('div').classed('top', true);
|
top.append('h3').text('Treatment');
|
||||||
trtDiv.append('h2').text('Treatment');
|
topTrtTable = top.append('div').classed('top-content', true).append('table');
|
||||||
topTrtTable = trtDiv.append('div').classed('top-content', true)
|
|
||||||
.append('table');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addProp(tbody, label, value) {
|
function addProp(tbody, label, value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user