Skip to content

Commit

Permalink
Merge branch 'main' into update-hosts-docu
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisonravazzolo authored Jan 16, 2025
2 parents 29fafd7 + c84d535 commit cd9b201
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ const InstallSoftwareModal = ({
)}
</ul>
<span className="form-field__help-text">
Selected software, if compatible with the host, will be installed
when hosts fail the chosen policy.{" "}
If compatible with the host, the selected software will be installed
when hosts fail the policy. App Store apps will not be installed if
hosts are not enrolled in MDM, or if no VPP licenses are available
for the app. If custom targets are enabled and a host with a failing
policy is <b>not</b> targeted, installation will be skipped.{" "}
<CustomLink
url="https://fleetdm.com/learn-more-about/policy-automation-install-software"
text="Learn more"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.manage-policies-page {
.install-software-modal {
.form-field__help-text {
font-size: 14px;
line-height: 21px;
}

.form-field--dropdown {
width: 276px;
.Select-placeholder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ const PolicyRunScriptModal = ({
)}
</ul>
<span className="form-field__help-text">
Selected script, if{" "}
If{" "}
<TooltipWrapper tipContent={compatibleTipContent}>
compatible
</TooltipWrapper>{" "}
with the host, will run when hosts fail the policy. Host counts will
reset when a new script is selected.{" "}
with the host, the selected script will run when hosts fail the
policy. The script will not run on hosts with scripts disabled, or
on hosts with too many pending scripts. Host counts will reset when
new scripts are selected.{" "}
<CustomLink
url="https://fleetdm.com/learn-more-about/policy-automation-run-script"
text="Learn more"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.manage-policies-page {
.policy-run-script-modal {
.form-field__help-text {
font-size: 14px;
line-height: 21px;
}

.form-field--dropdown {
width: 276px;
.Select-placeholder {
Expand Down
2 changes: 1 addition & 1 deletion handbook/company/why-this-way.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ In sentence case, we write and capitalize words as if they were in sentences:

> Ask questions about your servers, containers, and laptops running Linux, Windows, and macOS
As we use sentence case, only the first word is capitalized. But, if a word would normally be capitalized in the sentence (e.g., a proper noun, an acronym, or a stylization) it should remain capitalized. User roles (e.g., "observer" or "maintainer") and features (e.g. "automations") in the Fleet product aren't treated as proper nouns and shouldn't be capitalized. Words/phrases that follow steps numbers (e.g. "Step 1: create") in the documentation shouldn't be capitalized.
As we use sentence case, only the first word is capitalized. But, if a word would normally be capitalized in the sentence (e.g., a proper noun, an acronym, or a stylization) it should remain capitalized. User roles (e.g., "observer" or "maintainer") and features (e.g. "automations") in the Fleet product aren't treated as proper nouns and shouldn't be capitalized. However, words/phrases that follow step numbers in the documentation _should_ be capitalized (e.g. "Step 1: Create"), since the step number is merely acting as a label for the phrase that follows.

The reason for sentence case at Fleet is that everyone capitalizes differently in English, and capitalization conventions have not been taught very consistently in schools. Sentence case simplifies capitalization rules so that contributors can deliver more natural, even-looking content with a voice that feels similar no matter where you're reading it.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<array>
<dict>
<key>AssetTagInformation</key>
<string>This device is owned by Fleet</string>
<string></string>
<key>IfLostReturnToMessage</key>
<string>Fleet Device Management Inc.</string>
<string>This device is property of Fleet Device Management Inc.</string>
<key>PayloadDescription</key>
<string>Configures ownership information for a shared device</string>
<key>PayloadDisplayName</key>
Expand Down
2 changes: 1 addition & 1 deletion website/api/controllers/deliver-contact-form-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
}

await sails.helpers.http.post(sails.config.custom.slackWebhookUrlForContactForm, {
text: `New contact form message: (cc: <@U05CS07KASK>) (Remember: we have to email back; can't just reply to this thread.)`+
text: `New contact form message: (cc: <@U0801Q57JDU>, <@U05CS07KASK>) (Remember: we have to email back; can't just reply to this thread.)`+
`Name: ${firstName + ' ' + lastName}, Email: ${emailAddress}, Message: ${message ? message : 'No message.'}`
});

Expand Down
31 changes: 27 additions & 4 deletions website/api/controllers/query-generator/get-llm-generated-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ module.exports = {


fn: async function ({naturalLanguageQuestion}) {

// Generate a random room name.
let roomId = await sails.helpers.strings.random();
if(this.req.isSocket) {
// Add the requesting socket to the room.
sails.sockets.join(this.req, roomId);
}
let completeTables = sails.config.builtStaticContent.schemaTables;
let prunedTables = completeTables.map((table)=>{
let newTable = _.pick(table,['name','description','platforms', 'examples']);
Expand Down Expand Up @@ -55,7 +60,12 @@ module.exports = {
Please respond in JSON, with the same data shape as the provided context, but with the array filtered to include only relevant tables.`;
let filteredTables = await sails.helpers.ai.prompt(schemaFiltrationPrompt, 'gpt-4o', true)
.intercept((err)=>{
return new Error(`When trying to get a subset of tables to use to generate a query for an Admin user, the Open AI API returned an error. Full error: ${require('util').inspect(err, {depth: 2})}`);
if(this.req.isSocket){
// If this request was from a socket and an error occurs, broadcast an 'error' event and unsubscribe the socket from this room.
sails.sockets.broadcast(roomId, 'error', {error: err});
sails.sockets.leave(this.req, roomId);
}
return new Error(`When trying to get a subset of tables to use to generate a query for an Admin user, an error occurred. Full error: ${require('util').inspect(err, {depth: 2})}`);
});


Expand Down Expand Up @@ -95,9 +105,22 @@ module.exports = {
}`;
let sqlReport = await sails.helpers.ai.prompt(sqlPrompt, 'o1-preview', true)
.intercept((err)=>{
return new Error(`When trying to generate a query for an Admin user, the Open AI API returned an error. Full error: ${require('util').inspect(err, {depth: 2})}`);
if(this.req.isSocket){
// If this request was from a socket and an error occurs, broadcast an 'error' event and unsubscribe the socket from this room.
sails.sockets.broadcast(roomId, 'error', {error: err});
sails.sockets.leave(this.req, roomId);
}
return new Error(`When trying to generate a query for an Admin user, an error occurred. Full error: ${require('util').inspect(err, {depth: 2})}`);
});
return sqlReport;

// If this request was from a socket, we'll broadcast a 'queryGenerated' event with the sqlReport and unsubscribe the socket
if(this.req.isSocket){
sails.sockets.broadcast(roomId, 'queryGenerated', {result: sqlReport});
sails.sockets.leave(this.req, roomId);
} else {
// Otherwise, return the JSON sqlReport.
return sqlReport;
}
}


Expand Down
25 changes: 15 additions & 10 deletions website/assets/js/pages/admin/query-generator.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,22 @@ parasails.registerPage('query-generator', {
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
methods: {
handleSubmittingForm: async function() {
let argins = this.formData.naturalLanguageQuestion;
this.queryResult = await Cloud.getLlmGeneratedSql(argins)
.tolerate((err)=>{
this.cloudError = err;
this.syncing = false;
});
this.syncing = true;
io.socket.get('/api/v1/query-generator/get-llm-generated-sql', {naturalLanguageQuestion: this.formData.naturalLanguageQuestion}, ()=>{});
io.socket.on('queryGenerated', this._onQueryResultsReturned);
io.socket.on('error', this._onQueryGenerationError);
},
submittedQueryForm: function() {
if(!this.cloudError){
this.showGeneratedQuery = true;
}
_onQueryResultsReturned: function(response) {
this.queryResult = response.result;
this.syncing = false;
this.showGeneratedQuery = true;
// Disable the socket event listener after we display the results.
io.socket.off('queryGenerated', this._onQueryResultsReturned);
},
_onQueryGenerationError: function(response) {
this.cloudError = response.error;
this.syncing = false;
io.socket.off('error', this._onQueryGenerationError);
},
clickResetQueryGenerator: function() {
this.showGeneratedQuery = false;
Expand Down
2 changes: 1 addition & 1 deletion website/config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,5 +914,5 @@ module.exports.routes = {
'POST /api/v1/deliver-deal-registration-submission': { action: 'deliver-deal-registration-submission' },
'/api/v1/unsubscribe-from-marketing-emails': { action: 'unsubscribe-from-marketing-emails' },
'POST /api/v1/customers/get-stripe-checkout-session-url': { action: 'customers/get-stripe-checkout-session-url' },
'POST /api/v1/query-generator/get-llm-generated-sql': { action: 'query-generator/get-llm-generated-sql' },
'/api/v1/query-generator/get-llm-generated-sql': { action: 'query-generator/get-llm-generated-sql' },
};
4 changes: 2 additions & 2 deletions website/views/pages/admin/query-generator.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div purpose="page-container">
<div purpose="page-content">

<ajax-form :handle-submitting="handleSubmittingForm" :syncing.sync="syncing" :cloud-error.sync="cloudError" :form-errors.sync="formErrors" :form-data="formData" :form-rules="formRules" @submitted="submittedQueryForm()" v-if="!showGeneratedQuery">
<ajax-form :handle-submitting="handleSubmittingForm" :cloud-error.sync="cloudError" :form-errors.sync="formErrors" :form-data="formData" :form-rules="formRules" v-if="!showGeneratedQuery">
<h3 class="mb-4">Query generator</h3>
<div class="form-group">
<label for="email-address">Ask a question</label>
<label for="email-address">Ask a question about your devices to generate queries</label>
<textarea class="form-control" type="textarea" id="email-address" :class="[formErrors.naturalLanguageQuestion ? 'is-invalid' : '']" v-model.trim="formData.naturalLanguageQuestion"></textarea>
<div class="invalid-feedback" v-if="formErrors.naturalLanguageQuestion" focus-first>Ask your question.</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion website/views/pages/app-library.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<img alt="Custom packages" src="/images/[email protected]">
</div>
<div class="d-flex flex-column">
<h3>Custom Packages</h3>
<h3>Custom packages</h3>
<p>Upload any third-party software as a custom package to deploy all of the tools your end users need to work.</p>
</div>
</div>
Expand Down

0 comments on commit cd9b201

Please sign in to comment.