mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
UNIFIAPI v0.5, css fixes
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
--color-yellow: #f39c12;
|
||||
--color-red: #dd4b39;
|
||||
--color-gray: #8c8c8c;
|
||||
--color-black: #000;
|
||||
}
|
||||
|
||||
.input-group .checkbox
|
||||
@@ -604,6 +605,20 @@ body
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.btn-outline:hover
|
||||
{
|
||||
border: 1px solid var(--color-black);
|
||||
background: transparent;
|
||||
color: var(--color-black);
|
||||
}
|
||||
|
||||
.btn-outline
|
||||
{
|
||||
border: 1px solid var(--color-gray);
|
||||
background: transparent;
|
||||
color: var(--color-gray);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
Customized Full Calendar
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
@@ -9,11 +9,10 @@ Unifi import plugin using the Site Manager API.
|
||||
|
||||
Navigate to your UniFi Site Manager _Settings -> Control Plane -> Integrations_.
|
||||
|
||||
- `api_key` : You can generate your API key under the _Your API Keys_ section.
|
||||
- `base_url` : You can find your base url in the _API Request Format_ section, e.g. `https://192.168.100.1/proxy/network/integration/`
|
||||
- `version` : You can find your version as part of the url in the _API Request Format_ section, e.g. `v1`
|
||||
- `skip_ssl` : To skip SSL with you don't have an SSL certificate
|
||||
|
||||
- `UNIFIAPI_api_key` : You can generate your API key under the _Your API Keys_ section.
|
||||
- `UNIFIAPI_base_url` : You can find your base url in the _API Request Format_ section, e.g. `https://192.168.100.1/proxy/network/integration/`
|
||||
- `UNIFIAPI_api_version` : You can find your version as part of the url in the _API Request Format_ section, e.g. `v1`
|
||||
- `UNIFIAPI_verify_ssl` : To skip SSL with you don't have an SSL certificate
|
||||
|
||||
### Usage
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
{
|
||||
"popupForm": [
|
||||
{
|
||||
"function": "name",
|
||||
"function": "UNIFIAPI_site_name",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -279,7 +279,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "base_url",
|
||||
"function": "UNIFIAPI_base_url",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -317,7 +317,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "api_version",
|
||||
"function": "UNIFIAPI_api_version",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -355,7 +355,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "api_key",
|
||||
"function": "UNIFIAPI_api_key",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -393,7 +393,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "verify_ssl",
|
||||
"function": "UNIFIAPI_verify_ssl",
|
||||
"type": {
|
||||
"dataType": "boolean",
|
||||
"elements": [
|
||||
|
||||
@@ -38,7 +38,6 @@ RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
mylog('verbose', [f'[{pluginName}] In script'])
|
||||
|
||||
@@ -46,20 +45,19 @@ def main():
|
||||
unifi_sites_configs = get_setting_value('UNIFIAPI_sites')
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] number of unifi_sites_configs: {len(unifi_sites_configs)}'])
|
||||
|
||||
|
||||
for site_config in unifi_sites_configs:
|
||||
|
||||
siteDict = decode_settings_base64(site_config)
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] siteDict: {json.dumps(siteDict)}'])
|
||||
mylog('none', [f'[{pluginName}] Connecting to: {siteDict["name"]}'])
|
||||
mylog('none', [f'[{pluginName}] Connecting to: {siteDict["UNIFIAPI_site_name"]}'])
|
||||
|
||||
api = SiteManagerAPI(
|
||||
api_key=siteDict["api_key"],
|
||||
version=siteDict["api_version"],
|
||||
base_url=siteDict["base_url"],
|
||||
verify_ssl=siteDict["verify_ssl"]
|
||||
api_key=siteDict["UNIFIAPI_api_key"],
|
||||
version=siteDict["UNIFIAPI_api_version"],
|
||||
base_url=siteDict["UNIFIAPI_base_url"],
|
||||
verify_ssl=siteDict["UNIFIAPI_verify_ssl"]
|
||||
)
|
||||
|
||||
sites_resp = api.get_sites()
|
||||
|
||||
Reference in New Issue
Block a user