Links to online documentation:
* Adding a help button on top of the chat, that links to the online documentation on frama.io. * Replaced github.io documentation links by frama.io documentation. * Adding links to the documentation in the diagnostic tool.
This commit is contained in:
@ -4,6 +4,7 @@ import { TestResult, newResult } from './utils'
|
||||
import { diagDebug } from './debug'
|
||||
import { diagProsody } from './prosody'
|
||||
import { diagVideo } from './video'
|
||||
import { helpUrl } from '../../../shared/lib/help'
|
||||
|
||||
export async function diag (test: string, options: RegisterServerOptions): Promise<TestResult> {
|
||||
let result: TestResult
|
||||
@ -16,6 +17,20 @@ export async function diag (test: string, options: RegisterServerOptions): Promi
|
||||
result = await diagVideo(test, options)
|
||||
} else if (test === 'prosody') {
|
||||
result = await diagProsody(test, options)
|
||||
} else if (test === 'everything-ok') {
|
||||
result = newResult(test)
|
||||
result.label = 'Everything seems fine'
|
||||
result.messages = [{
|
||||
level: 'info',
|
||||
message: 'If you still encounter issues with the plugin, check this documentation page:',
|
||||
help: {
|
||||
text: 'Plugin troubleshooting',
|
||||
url: helpUrl({
|
||||
page: 'documentation/installation/troubleshooting'
|
||||
})
|
||||
}
|
||||
}]
|
||||
result.ok = true
|
||||
} else {
|
||||
result = newResult(test)
|
||||
result.messages.push('Unknown test')
|
||||
|
@ -3,6 +3,7 @@ import { getProsodyConfig, getProsodyConfigContentForDiagnostic, getWorkingDir }
|
||||
import { checkProsody, getProsodyAbout, testProsodyCorrectlyRunning } from '../prosody/ctl'
|
||||
import { newResult, TestResult } from './utils'
|
||||
import { getAPIKey } from '../apikey'
|
||||
import { helpUrl } from '../../../shared/lib/help'
|
||||
import * as fs from 'fs'
|
||||
|
||||
const got = require('got')
|
||||
@ -190,7 +191,16 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
|
||||
if (testResult.ok === true) {
|
||||
result.messages.push('API Prosody -> Peertube is OK')
|
||||
} else {
|
||||
result.messages.push('API Prosody -> Peertube is KO. Response was: ' + JSON.stringify(testResult))
|
||||
result.messages.push({
|
||||
level: 'error',
|
||||
message: 'API Prosody -> Peertube is KO. Response was: ' + JSON.stringify(testResult),
|
||||
help: {
|
||||
text: 'Check the troubleshooting documentation.',
|
||||
url: helpUrl({
|
||||
page: 'documentation/installation/troubleshooting'
|
||||
})
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
} catch (error) {
|
||||
@ -226,5 +236,6 @@ export async function diagProsody (test: string, options: RegisterServerOptions)
|
||||
}
|
||||
|
||||
result.ok = true
|
||||
result.next = 'everything-ok'
|
||||
return result
|
||||
}
|
||||
|
@ -1,8 +1,12 @@
|
||||
type nextValue = 'backend' | 'debug' | 'webchat-video' | 'prosody'
|
||||
type nextValue = 'backend' | 'debug' | 'webchat-video' | 'prosody' | 'everything-ok'
|
||||
|
||||
interface MessageWithLevel {
|
||||
level: 'info' | 'warning' | 'error'
|
||||
message: string
|
||||
help?: {
|
||||
url: string
|
||||
text: string
|
||||
}
|
||||
}
|
||||
export interface TestResult {
|
||||
label?: string
|
||||
|
Reference in New Issue
Block a user