New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DetectX Module #916

Merged
merged 9 commits into from Dec 19, 2017

Conversation

Projects
None yet
3 participants
@WardsParadox
Contributor

WardsParadox commented Dec 14, 2017

Will pull a json file from DetectX granted the admin deploying this module places it in the cache dir.

WardsParadox added some commits Dec 14, 2017

Added Dashboard widget
Added Status to client data (Clean/Infected) which is searchable
Added better localization support for listing and widget
Tab for DetectX module uses the listing headers.
Fixed lacking localization for widget.
Added FA icon to Widget to match the style
Removed old outdated fr.json locale.
# detectx controller
#CTL="${BASEURL}index.php?/module/detectx/"
# Set preference to include this file in the preflight check

This comment has been minimized.

@bochoven

bochoven Dec 14, 2017

Contributor

Please also drop an empty json so the client does not complain about the file not found

@bochoven

This comment has been minimized.

Contributor

bochoven commented Dec 14, 2017

Thanks. Could you please fix the indenting? I have a hard time reading the code.. ;-D

@WardsParadox

This comment has been minimized.

Contributor

WardsParadox commented Dec 14, 2017

Atom must be messing with it since I turned off softwraps. I'll get it all prettified and a touch statement to add an empty json file in install.sh then commit again.

@WardsParadox

This comment has been minimized.

Contributor

WardsParadox commented Dec 14, 2017

@bochoven Is that any better?

$this->deleteWhere('serial_number=?', $this->serial_number);
// Process json into object thingy
$data = json_decode($json, true);

This comment has been minimized.

@bochoven

bochoven Dec 15, 2017

Contributor

This block needs indenting

"searchdate": "Search Date",
"status": "Status"
},
"widget": {

This comment has been minimized.

@bochoven

bochoven Dec 15, 2017

Contributor

Please also indent the JSON

@WardsParadox

This comment has been minimized.

Contributor

WardsParadox commented Dec 15, 2017

@bochoven should be fixed now.

<string>/Applications/DetectX Swift.app/Contents/MacOS/DetectX Swift</string>
<string>search</string>
<string>-aj</string>
<string>/usr/loca/munki/preflight.d/cache/detectx.json</string>

This comment has been minimized.

@bochoven

bochoven Dec 16, 2017

Contributor

Path is missing an 'l', should be /usr/local/munki/preflight.d/cache/detectx.json

//
return array(
'client_tabs' => array(
'detectx-tab' => array('view' => 'detectx_tab', 'i18n' => 'detectx.clienttitle', 'badge' => 'detectx-cnt'),

This comment has been minimized.

@bochoven

bochoven Dec 16, 2017

Contributor

detectx.clienttitle does not exist in the locale.json. You may want to change that to detectx.title (this controls the name in the dropdown in the client detail page)

'detectx-tab' => array('view' => 'detectx_tab', 'i18n' => 'detectx.clienttitle', 'badge' => 'detectx-cnt'),
),
'listings' => array(
'detectx' => array('view' => 'detectx_listing', 'i18n' => 'detectx.clienttitle'),

This comment has been minimized.

@bochoven

bochoven Dec 16, 2017

Contributor

detectx.clienttitle does not exist in the locale.json. You may want to change that to detectx.title (this controls the name in the dropdown in the listing menu)

{
parent::__construct('id', 'detectx'); //primary key, tablename
$this->rs['id'] = '';
$this->rs['serial_number'] = $serial;

This comment has been minimized.

@bochoven

bochoven Dec 16, 2017

Contributor

Please add a UNIQUE rt statement: $this->rt['serial_number'] = 'VARCHAR(255) UNIQUE';

// Add indexes
$this->idx[] = array('numberofissues');
$this->idx[] = array('status');

This comment has been minimized.

@bochoven

bochoven Dec 16, 2017

Contributor

I would add an index on search date too.

<tbody>
<tr>
<td data-i18n="listing.loading" colspan="10" class="dataTables_empty"></td>

This comment has been minimized.

@tuxudo

tuxudo Dec 18, 2017

Contributor

colspan= should be equal to the total amount of columns in the listing.

@WardsParadox

This comment has been minimized.

Contributor

WardsParadox commented Dec 18, 2017

@bochoven @tuxudo Thanks for pointing those out, should be fixed now.

@bochoven bochoven merged commit 559d6bd into munkireport:wip Dec 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment