utils

This module contains all utility functions

Source:
Author:
  • yafp

Methods

(inner) generateNewRandomServiceID(serviceType) → {string}

Generates a config-file name while adding a new service

Source:

Gets the serviceType and adds a random string. The outcome is the name for the new service config-file.

Parameters:
Name Type Description
serviceType string

The type of the service

Returns:

newServiceId - serviceType + Random string

Type
string

(inner) getAppVersion()

Gets the version string of the current build

Source:

Gets the version string of the current build

(inner) getDomain(url)

Parsing the Domain From a Url

Source:

Parsing the Domain From a Url

Parameters:
Name Type Description
url
Returns:

domain

(inner) getHostName(url)

Parsing the Hostname From a Url

Source:

Parsing the Hostname From a Url

Parameters:
Name Type Description
url

(inner) globalObjectGet(property) → {string}

Gets a value of a single property from the global object in main.js

Source:

Gets a value of a single property from the global object in main.js

Parameters:
Name Type Description
property String

Name of the property

Returns:

value - Value of the property

Type
string

(inner) globalObjectSet(property, value)

Updates the value of a single property from the global object in main.js

Source:

Updates the value of a single property from the global object in main.js

Parameters:
Name Type Description
property String

Name of the property

value String

The new value of the property

(inner) isLinux()

Checks if the operating system type is linux or not

Source:

Checks if the operating system type islinux or not

Returns:

value - Boolean: True if linux, false if not

(inner) isMac()

Checks if the operating system type is mac/darwin or not

Source:

Checks if the operating system type is mac/darwin or not

Returns:

value - Boolean: True if mac, false if not

(inner) isWindows()

Checks if the operating system type is windows or not

Source:

Checks if the operating system type is windows or not

Returns:

value - Boolean: True if windows, false if not

(inner) jsonStoragePathSet(Stringg})

Sets the path for json-storage

Source:

Sets the path for json-storage

Parameters:
Name Type Description
Stringg}

path - The path for json-storage

(inner) openURL(url)

Opens an url in browser

Source:

Opens a given url in default browser. This is pretty slow, but got no better solution so far.

Parameters:
Name Type Description
url

URL string which contains the target url

(inner) showNoty(type, message, timeout)

Shows a noty notification

Source:

Creates an in-app notification using the noty framework

Parameters:
Name Type Description
type string

Options: alert, success, warning, error, info/information

message string

notification text

timeout number

Timevalue, defines how long the message should be displayed. Use 0 for no-timeout

(inner) writeConsoleMsg(type, message, optionalObject)

Writes console output for the renderer process

Source:

Writes console output for the renderer process

Parameters:
Name Type Description
type string

String which defines the log type

message string

String which defines the log message

optionalObject string

An optional object which might contain additional informations