fix mac links: now to Grafana
This commit is contained in:
@@ -20,3 +20,4 @@ MONGO_URI = os.environ["MONGO_URI"]
|
||||
SLACK_VERIFICATION_TOKEN = os.environ["SLACK_VERIFICATION_TOKEN"] # used to verify (deprecated) incoming requests from slack
|
||||
SLACK_DOORLOG_CALLBACK = os.environ["SLACK_DOORLOG_CALLBACK"] # used for sending logs to private channel
|
||||
INVENTORY_API_KEY = os.environ["INVENTORY_API_KEY"]
|
||||
MACADDRESS_OUTLINK_BASEURL = os.environ["MACADDRESS_OUTLINK_BASEURL"]
|
||||
|
@@ -51,6 +51,8 @@ def view_inventory_view(item_id):
|
||||
can_edit = check_edit_permission(item_id)
|
||||
is_using = item_user and item_user == user["username"]
|
||||
photo_url = get_image_url(item_id)
|
||||
# pylance: disable=unused-variable
|
||||
constants = {"MACADDRESS_OUTLINK_BASEURL": const.MACADDRESS_OUTLINK_BASEURL}
|
||||
return render_template(template , **locals())
|
||||
|
||||
def get_image_url(item_id):
|
||||
|
@@ -36,8 +36,8 @@
|
||||
<tr>
|
||||
<td>MAC address</td>
|
||||
<td>
|
||||
<span class="tooltipped" data-tooltip="Show in machines view">
|
||||
<a href="/m/machine?mac={{ item.mac | quote_plus }}">
|
||||
<span class="tooltipped" data-tooltip="Show IP usage in Grafana">
|
||||
<a href="{{ constants.MACADDRESS_OUTLINK_BASEURL }}{{ item.mac }}">
|
||||
{{ item.mac }}
|
||||
</a>
|
||||
</span>
|
||||
|
Reference in New Issue
Block a user