diff --git a/.github/workflows/backup-to-gitlab.yml b/.github/workflows/backup-to-gitlab.yml index c1763359..9863040f 100644 --- a/.github/workflows/backup-to-gitlab.yml +++ b/.github/workflows/backup-to-gitlab.yml @@ -8,10 +8,8 @@ concurrency: jobs: backup-to-gitlabwh: uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master - secrets: - BRIDGETOKEN: ${{ secrets.BRIDGETOKEN }} + secrets: inherit backup-to-gitee: uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master - secrets: - GITEE_SYNC_TOKEN: ${{ secrets.GITEE_SYNC_TOKEN }} + secrets: inherit diff --git a/.github/workflows/call-build-deb.yml b/.github/workflows/call-build-deb.yml deleted file mode 100644 index fd67cbec..00000000 --- a/.github/workflows/call-build-deb.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Call build-deb -on: - pull_request_target: - paths-ignore: - - ".github/workflows/**" - types: [ opened, closed, synchronize ] - -concurrency: - group: ${{ github.workflow }}-pull/${{ github.event.number }} - cancel-in-progress: true - -jobs: - check_job: - if: github.event.action != 'closed' || github.event.pull_request.merged - uses: linuxdeepin/.github/.github/workflows/build-deb.yml@master - secrets: - BridgeToken: ${{ secrets.BridgeToken }} diff --git a/.github/workflows/call-build-distribution.yml b/.github/workflows/call-build-distribution.yml index c4c277ef..a509d5f8 100644 --- a/.github/workflows/call-build-distribution.yml +++ b/.github/workflows/call-build-distribution.yml @@ -10,8 +10,4 @@ on: jobs: check_job: uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master - secrets: - BUILD_GPG_PRIVATE_KEY: ${{ secrets.BUILD_GPG_PRIVATE_KEY }} - BUILD_SSH_PRIVATE_KEY: ${{ secrets.BUILD_SSH_PRIVATE_KEY }} - WEBDAV_PASSWD: ${{ secrets.WEBDAV_PASSWD }} - WEBDAV_USER: ${{ secrets.WEBDAV_USER }} + secrets: inherit diff --git a/.github/workflows/call-chatOps.yml b/.github/workflows/call-chatOps.yml index 0eb0b7bc..18c76bc3 100644 --- a/.github/workflows/call-chatOps.yml +++ b/.github/workflows/call-chatOps.yml @@ -6,5 +6,4 @@ on: jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master - secrets: - APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} + secrets: inherit diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 6a92b546..e808a89b 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - run: export - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false diff --git a/.obs/workflows.yml b/.obs/workflows.yml new file mode 100644 index 00000000..9a3e95da --- /dev/null +++ b/.obs/workflows.yml @@ -0,0 +1,44 @@ +test_build: + steps: + - link_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:CI + + - configure_repositories: + project: deepin:CI + repositories: + - name: deepin_develop + paths: + - target_project: deepin:CI + target_repository: deepin_develop + architectures: + - x86_64 + - aarch64 + + - name: debian + paths: + - target_project: deepin:CI + target_repository: debian_sid + architectures: + - x86_64 + + filters: + event: pull_request + +tag_build: + steps: + - branch_package: + source_project: deepin:Develop:dde + source_package: %{SCM_REPOSITORY_NAME} + target_project: deepin:Unstable:dde + filters: + event: tag_push + +commit_build: + steps: + - trigger_services: + project: deepin:Develop:dde + package: %{SCM_REPOSITORY_NAME} + filters: + event: push diff --git a/.reuse/dep5 b/.reuse/dep5 index 337581cd..b31b8da2 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -4,7 +4,7 @@ Upstream-Contact: UnionTech Software Technology Co., Ltd. <> Source: https://github.com/linuxdeepin/deepin-log-viewer # ci -Files: .github/* +Files: .github/* .obs/workflows.yml Copyright: None License: CC0-1.0 diff --git a/.tx/config b/.tx/config index 32a2b172..bf3dffee 100644 --- a/.tx/config +++ b/.tx/config @@ -3,26 +3,26 @@ host = https://www.transifex.com minimum_perc = 80 mode = developer -[deepin-log-viewer.deepin-log-viewer] +[o:linuxdeepin:p:deepin-log-viewer:r:deepin-log-viewer] file_filter = translations/deepin-log-viewer_.ts source_file = translations/deepin-log-viewer.ts source_lang = en type = QT -[deepin-log-viewer.deepin-log-viewer-desktop-ts] +[o:linuxdeepin:p:deepin-log-viewer:r:deepin-log-viewer-desktop-ts] file_filter = translations/desktop/desktop_.ts source_file = translations/desktop/desktop.ts source_lang = en type = QT -[deepin-log-viewer.deepin-log-viewer-policy-auth-ts] +[o:linuxdeepin:p:deepin-log-viewer:r:deepin-log-viewer-policy-auth-ts] file_filter = translations/policy/auth/policy_.ts source_file = translations/policy/auth/policy.ts source_lang = en type = QT -[deepin-log-viewer.deepin-log-viewer-policy-truncate-ts] +[o:linuxdeepin:p:deepin-log-viewer:r:deepin-log-viewer-policy-truncate-ts] file_filter = translations/policy/truncate/policy_.ts source_file = translations/policy/truncate/policy.ts source_lang = en diff --git a/.tx/deepin.conf b/.tx/deepin.conf index 45cd054c..2d7ce170 100644 --- a/.tx/deepin.conf +++ b/.tx/deepin.conf @@ -1,2 +1,2 @@ [transifex] -branch = m20 \ No newline at end of file +branch = m23 diff --git a/3rdparty/DocxFactory/include/DocxFactory/os/OsFunc.h b/3rdparty/DocxFactory/include/DocxFactory/os/OsFunc.h index f9707c4e..79460dc8 100644 --- a/3rdparty/DocxFactory/include/DocxFactory/os/OsFunc.h +++ b/3rdparty/DocxFactory/include/DocxFactory/os/OsFunc.h @@ -51,7 +51,7 @@ namespace DocxFactory static string fileUrlToPath ( const string& p_url ); static string normalizeFileUrl ( const string& p_url ); - static byte* readFile( + static byte *readFile( const string& p_fileName, size_t& p_bufSize ); diff --git a/3rdparty/DocxFactory/include/DocxFactory/zip/UnzipFile.h b/3rdparty/DocxFactory/include/DocxFactory/zip/UnzipFile.h index af2f9d5f..5977f7e1 100644 --- a/3rdparty/DocxFactory/include/DocxFactory/zip/UnzipFile.h +++ b/3rdparty/DocxFactory/include/DocxFactory/zip/UnzipFile.h @@ -31,11 +31,11 @@ class UnzipFile // functions for extracting file entries content from the zip file - byte *extractEntryToBuf( + DocxFactory::byte *extractEntryToBuf( const string &p_path, size_t &p_bufSize) const; - byte *extractEntryToRaw( + DocxFactory::byte *extractEntryToRaw( const string &p_path, int &p_method, int &p_level, diff --git a/3rdparty/DocxFactory/src/WordProcessingMerger/word-processing-merger.cpp b/3rdparty/DocxFactory/src/WordProcessingMerger/word-processing-merger.cpp index a331f70c..671a34cd 100644 --- a/3rdparty/DocxFactory/src/WordProcessingMerger/word-processing-merger.cpp +++ b/3rdparty/DocxFactory/src/WordProcessingMerger/word-processing-merger.cpp @@ -468,7 +468,7 @@ void Merger::merge() else { size_t l_bufSize; - boost::scoped_array l_buf(OsFunc::readFile(m_dataFile, l_bufSize)); + boost::scoped_array l_buf(OsFunc::readFile(m_dataFile, l_bufSize)); l_data = string((char *) l_buf.get(), l_bufSize); } diff --git a/3rdparty/DocxFactory/src/locale/LocaleFunc.cpp b/3rdparty/DocxFactory/src/locale/LocaleFunc.cpp index 0ac77bee..b377298e 100644 --- a/3rdparty/DocxFactory/src/locale/LocaleFunc.cpp +++ b/3rdparty/DocxFactory/src/locale/LocaleFunc.cpp @@ -1018,14 +1018,14 @@ double LocaleFunc::strToNum(const string &p_str) if (!m_initialized) initialize(); - enum Part { - PREFIX = 0, - INTEGER, - FRACTION, - SUFFIX + enum _Part { + _PREFIX = 0, + _INTEGER, + _FRACTION, + _SUFFIX }; - Part l_part = PREFIX; + _Part l_part = _PREFIX; double l_val = 0; double l_dec = 1; char l_neg = 0; @@ -1041,8 +1041,8 @@ double LocaleFunc::strToNum(const string &p_str) if (l_neg != 0) break; - if (l_part == INTEGER || l_part == FRACTION) - l_part = SUFFIX; + if (l_part == _INTEGER || l_part == _FRACTION) + l_part = _SUFFIX; l_neg = l_ch; } @@ -1050,24 +1050,24 @@ double LocaleFunc::strToNum(const string &p_str) else if (l_ch == ' ' // if thousand separator is also space then treated as space only in prefix and suffix. - && (m_numThSep != ' ' || l_part == PREFIX || l_part == SUFFIX)) { - if (l_part == INTEGER || l_part == FRACTION) - l_part = SUFFIX; + && (m_numThSep != ' ' || l_part == _PREFIX || l_part == _SUFFIX)) { + if (l_part == _INTEGER || l_part == _FRACTION) + l_part = _SUFFIX; - if (l_part == SUFFIX && l_neg != 0) + if (l_part == _SUFFIX && l_neg != 0) break; } else if (IS_DIGIT(l_ch)) { - if (l_part == PREFIX) - l_part = INTEGER; + if (l_part == _PREFIX) + l_part = _INTEGER; switch (l_part) { - case INTEGER: + case _INTEGER: l_val = l_val * 10 + (l_ch - 48); break; - case FRACTION: + case _FRACTION: l_dec = l_dec * 10; l_val = l_val + (l_ch - 48) / l_dec; break; @@ -1075,20 +1075,20 @@ double LocaleFunc::strToNum(const string &p_str) break; } - if (l_part == SUFFIX) + if (l_part == _SUFFIX) break; } else if (l_ch == m_numFracSep) { - if (l_part == PREFIX || l_part == INTEGER) - l_part = FRACTION; + if (l_part == _PREFIX || l_part == _INTEGER) + l_part = _FRACTION; else break; } else if (l_ch == m_numThSep) { - if (l_part != INTEGER && l_part != FRACTION) + if (l_part != _INTEGER && l_part != _FRACTION) break; } diff --git a/3rdparty/DocxFactory/src/os/OsFunc.cpp b/3rdparty/DocxFactory/src/os/OsFunc.cpp index 9d128f19..dcafb687 100644 --- a/3rdparty/DocxFactory/src/os/OsFunc.cpp +++ b/3rdparty/DocxFactory/src/os/OsFunc.cpp @@ -284,12 +284,12 @@ string OsFunc::normalizeFileUrl( const string& p_url ) -byte* OsFunc::readFile( +DocxFactory::byte* OsFunc::readFile( const string& p_fileName, size_t& p_bufSize ) { ifstream l_fileStream; - byte* l_buf = NULL; + DocxFactory::byte* l_buf = NULL; try { @@ -299,7 +299,7 @@ byte* OsFunc::readFile( throw FileNotFoundException( p_fileName, __FILE__, __LINE__ ); p_bufSize = ( size_t ) l_fileStream.tellg(); - l_buf = new byte[ p_bufSize ]; + l_buf = new DocxFactory::byte[ p_bufSize ]; l_fileStream.seekg( 0, ios::beg ); l_fileStream.read( ( char* ) l_buf, p_bufSize ); @@ -322,7 +322,7 @@ byte* OsFunc::readFile( void OsFunc::writeFile( const string& p_fileName, - const byte* p_buf, + const DocxFactory::byte* p_buf, size_t p_bufSize, bool p_append ) { diff --git a/3rdparty/DocxFactory/src/xml/XmlFunc.cpp b/3rdparty/DocxFactory/src/xml/XmlFunc.cpp index 8e6b0b24..0a81837e 100644 --- a/3rdparty/DocxFactory/src/xml/XmlFunc.cpp +++ b/3rdparty/DocxFactory/src/xml/XmlFunc.cpp @@ -113,9 +113,9 @@ void XmlFunc::saveDocToFile( const xercesc::DOMDocument* p_doc, const string& p_ } } // saveDocToFile -byte* XmlFunc::saveDocToBuf( const xercesc::DOMDocument* p_doc, size_t& p_bufSize ) +DocxFactory::byte* XmlFunc::saveDocToBuf( const xercesc::DOMDocument* p_doc, size_t& p_bufSize ) { - byte* l_buf = NULL; + DocxFactory::byte* l_buf = NULL; xercesc::DOMImplementationLS* l_impl = NULL; xercesc::DOMLSSerializer* l_serializer = NULL; xercesc::DOMLSOutput* l_outputStream = NULL; diff --git a/3rdparty/DocxFactory/src/zip/UnzipFile.cpp b/3rdparty/DocxFactory/src/zip/UnzipFile.cpp index 84a92a79..00b3d1ca 100644 --- a/3rdparty/DocxFactory/src/zip/UnzipFile.cpp +++ b/3rdparty/DocxFactory/src/zip/UnzipFile.cpp @@ -73,7 +73,7 @@ void UnzipFile::close() -byte *UnzipFile::extractEntryToBuf( +DocxFactory::byte *UnzipFile::extractEntryToBuf( const string &p_path, size_t &p_bufSize) const { @@ -124,14 +124,14 @@ byte *UnzipFile::extractEntryToBuf( return l_buf; } // extract -byte *UnzipFile::extractEntryToRaw( +DocxFactory::byte *UnzipFile::extractEntryToRaw( const string &p_path, int &p_method, int &p_level, FileInfo *&p_fileInfo, size_t &p_bufSize) const { - byte *l_buf = NULL; + DocxFactory::byte *l_buf = NULL; int l_err; if (!m_fileOpen) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d37a091..48b95a69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,9 @@ add_subdirectory(logViewerTruncate) add_subdirectory(logViewerService) -add_subdirectory(tests) +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_subdirectory(tests) +endif() + add_subdirectory(liblogviewerplugin) option(PERF_ON "open the info of benchmark" ON) diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index 85803c58..3cbca313 100755 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -16,6 +16,7 @@ set(LINK_LIBS Qt5::Xml Qt5::DBus Qt5::Concurrent + Qt5::Network #${DtkWidget_LDFLAGS} #${DtkGui_LDFLAGS} #${DtkCore_LDFLAGS} @@ -29,7 +30,7 @@ configure_file(config.h.in config.h @ONLY) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -112,15 +113,14 @@ find_package(Qt5Widgets REQUIRED) find_package(Qt5Gui REQUIRED) find_package(Qt5Core REQUIRED) find_package(Qt5Xml REQUIRED) +find_package(Qt5Network REQUIRED) find_package(Qt5Concurrent REQUIRED) find_package(Qt5DBus REQUIRED) find_package(DtkWidget REQUIRED) find_package(DtkGui REQUIRED) find_package(DtkCore REQUIRED) find_package(Qt5LinguistTools REQUIRED) -find_package(DFrameworkdbus REQUIRED) find_package(RapidJSON) -pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) find_package(Boost) find_package(XercesC) find_package(ZLIB) @@ -160,6 +160,7 @@ list(APPEND LXW_PRIVATE_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) set (APP_CPP_FILES main.cpp + cliapplicationhelper.cpp filtercontent.cpp displaycontent.cpp logcollectormain.cpp @@ -196,6 +197,11 @@ set (APP_CPP_FILES # viewsortfilter.cpp logallexportthread.cpp eventlogutils.cpp + logbackend.cpp + logsegementexportthread.cpp + parsethread/parsethreadbase.cpp + parsethread/parsethreadkern.cpp + parsethread/parsethreadkwin.cpp ) set (APP_QRC_FILES assets/resources.qrc @@ -203,8 +209,9 @@ assets/resources.qrc set (APP_HEADERS_FILES - logcollectormain.h - displaycontent.h + cliapplicationhelper.h + logcollectormain.h + displaycontent.h logfileparser.h filtercontent.h structdef.h @@ -231,6 +238,12 @@ set (APP_HEADERS_FILES # viewsortfilter.h logallexportthread.h eventlogutils.h + logbackend.h + accessible.h + logsegementexportthread.h + parsethread/parsethreadbase.h + parsethread/parsethreadkern.h + parsethread/parsethreadkwin.h ) # 5. 头文件 @@ -315,7 +328,6 @@ include_directories(${DtkCore_INCLUDE_DIRS}) include_directories(${DtkGui_INCLUDE_DIRS}) include_directories( ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) include_directories( ${Qt5Widgets_PRIVATE_INCLUDE_DIRS}) -include_directories( ${DFrameworkDBus_INCLUDE_DIRS}) include_directories( ${Boost_INCLUDE_DIRS}) include_directories( ${ZLIB_INCLUDE_DIRS}) message("ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}") @@ -323,7 +335,7 @@ include_directories( ${RapidJSON_INCLUDE_DIRS}) #include_directories(${ImageMagick_INCLUDE_DIRS}) include_directories(${XercesC_INCLUDE_DIRS}) -target_link_libraries(${EXE_NAME} ${LINK_LIBS} ${Other_LIBRARIES} ${DFrameworkDBus_LIBRARIES} -lsystemd -licui18n -licuuc -ldl -fPIC) +target_link_libraries(${EXE_NAME} ${LINK_LIBS} ${Other_LIBRARIES} -lsystemd -licui18n -licuuc -ldl -fPIC) target_link_libraries(${EXE_NAME} ${DtkWidget_LIBRARIES}) target_link_libraries(${EXE_NAME} ${DtkCore_LIBRARIES}) target_link_libraries(${EXE_NAME} ${DtkGUI_LIBRARIES}) @@ -371,23 +383,34 @@ install(FILES assets/images/deepin-log-viewer.svg install(FILES assets/com.deepin.pkexec.logViewerAuth.policy DESTINATION ${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions) install(FILES assets/com.deepin.pkexec.logViewerTruncate.policy DESTINATION ${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions) -install(FILES gschema/com.deepin.log-viewer.gschema.xml +install(FILES gschema/com.deepin.log.viewer.gschema.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas) # Install files install(TARGETS ${EXE_NAME} DESTINATION bin) install(DIRECTORY assets/deepin-log-viewer - DESTINATION /usr/share/deepin-manual/manual-assets/application/) - -#FILES - deployed files. -#BASE - used to get subpath, if it's empty, only copy files, and ignore it's subpath structure. -#APPID - working for the app. -#COMMONID - working for common. -#Only DConfig is supported by DTK, use DConfig -set(APPID org.deepin.deepin-log-viewer) -set(configFile configs/org.deepin.deepin-log-viewer.json) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/) + +# Install aduit rule config file. +install(FILES assets/auditRule.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-log-viewer) + +# Install cli script deepin-logger +install(FILES assets/deepin-logger DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + +# Install log json config file. +install(FILES configs/logconfig/deepin-log-viewer.json DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-log-viewer/deepin-log.conf.d/) + +# Install debugmode json config file. +install(FILES configs/debugconfig/org.deepin.log.viewer.json DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-debug-config/deepin-debug-config.d/) + +# Install coredump report service&timer +install(FILES ./configs/coredump-reporter.timer ./configs/coredump-reporter.service DESTINATION lib/systemd/user/) + +#安装DConfig配置 +set(APPID org.deepin.log.viewer) +set(configFile configs/dconfig/org.deepin.log.viewer.json) if (DEFINED DSG_DATA_DIR) - dconfig_meta_files(APPID ${APPID} BASE configs FILES ${configFile}) + dconfig_meta_files(APPID ${APPID} FILES ${configFile}) message("-- DConfig is supported by DTK") else() install(FILES ${configFile} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dsg/configs/${APPID}/) diff --git a/application/DebugTimeManager.cpp b/application/DebugTimeManager.cpp index 0fbc23cf..a711029c 100644 --- a/application/DebugTimeManager.cpp +++ b/application/DebugTimeManager.cpp @@ -1,14 +1,21 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "DebugTimeManager.h" #include #include +#include #include #include +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logDebugTime, "org.deepin.log.viewer.debug.timemanager") +#else +Q_LOGGING_CATEGORY(logDebugTime, "org.deepin.log.viewer.debug.timemanager", QtInfoMsg) +#endif + DebugTimeManager::DebugTimeManager() { @@ -43,7 +50,7 @@ void DebugTimeManager::endPointLinux(const QString &point, const QString &status return; } timespec diffTime = diff(m_MapLinuxPoint[point].time, endTime); - qInfo() << QString("[GRABPOINT] %1 %2 %3 time=%4ms").arg(point).arg(m_MapLinuxPoint[point].desc).arg(status).arg(diffTime.tv_sec * 1000 + (diffTime.tv_nsec) / 1000000); + qCInfo(logDebugTime) << QString("[GRABPOINT] %1 %2 %3 time=%4s").arg(point).arg(m_MapLinuxPoint[point].desc).arg(status).arg(QString::number((diffTime.tv_sec * 1000 + (diffTime.tv_nsec) / 1000000) / 1000.0, 'g', 4)); m_MapLinuxPoint.remove(point); } } diff --git a/application/accessible.h b/application/accessible.h new file mode 100644 index 00000000..f6339d69 --- /dev/null +++ b/application/accessible.h @@ -0,0 +1,270 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef ACCESSIBLE_H +#define ACCESSIBLE_H + +// 为了方便使用,把相关定义独立出来,如有需要,直接包含这个头文件,然后使用SET_*的宏去设置,USE_*宏开启即可 +/* 宏参数说明 +* classname:类名,例如DLineEdit +* accessiblename:accessible唯一标识,需保证唯一性[getAccessibleName函数处理],优先使用QObject::setAccessibleName值 +* accessibletype:即QAccessible::Role,表示标识控件的类型 +* classobj:QObject指针 +* accessdescription:accessible描述内容,考虑到暂时用不到,目前都默认为空,有需要可自行设计接口 +* +* 部分创建宏说明 +* FUNC_CREATE:创建构造函数 +* FUNC_PRESS:创建Press接口 +* FUNC_SHOWMENU:创建右键菜单接口 +* FUNC_PRESS_SHOWMENU:上两者的综合 +* FUNC_RECT:实现rect接口 +* FUNC_TEXT:实现text接口 +* USE_ACCESSIBLE:对传入的类型设置其accessible功能 +* USE_ACCESSIBLE_BY_OBJECTNAME:同上,[指定objectname]---适用同一个类,但objectname不同的情况 +* +* 设置为指定类型的Accessible控件宏 +* SET_BUTTON_ACCESSIBLE_PRESS_SHOWMENU:button类型,添加press和showmenu功能 +* SET_BUTTON_ACCESSIBLE_SHOWMENU:button类型,添加showmenu功能 +* SET_BUTTON_ACCESSIBLE:button类型,添加press功能 +* SET_LABEL_ACCESSIBLE:label类型,用于标签控件 +* SET_FORM_ACCESSIBLE:form类型,用于widget控件 +* SET_SLIDER_ACCESSIBLE:slider类型,用于滑块控件 +* SET_SEPARATOR_ACCESSIBLE:separator类型,用于分隔符控件 +*/ + +#include +#include +#include +#include +#include +#include + +inline constexpr char kSeparator[] { "_" }; + +inline QString getObjPrefix(QAccessible::Role r) +{ + // 按照类型添加固定前缀 + QMetaEnum metaEnum = QMetaEnum::fromType(); + QByteArray prefix = metaEnum.valueToKeys(r); + switch (r) { + case QAccessible::Button: prefix = "Btn"; break; + case QAccessible::StaticText: prefix = "Label"; break; + default: break; + } + return QString::fromLatin1(prefix); +} + +inline QString getIntelAccessibleName(QWidget *w, QAccessible::Role r, QString fallback) +{ + // 避免重复生成 + static QMap< QObject *, QString > objnameMap; + if (!objnameMap[w].isEmpty()) + return objnameMap[w]; + + static QMap< QAccessible::Role, QList< QString > > accessibleMap; + QString oldAccessName = w->accessibleName(); + oldAccessName.replace(kSeparator, ""); + + // 再加上标识 + QString accessibleName = "";//getObjPrefix(r) + kSeparator; + accessibleName += oldAccessName.isEmpty() ? fallback : oldAccessName; + // 检查名称是否唯一 + if (accessibleMap[r].contains(accessibleName)) { + if (objnameMap.key(accessibleName)) { + objnameMap.remove(objnameMap.key(accessibleName)); + objnameMap.insert(w, accessibleName); + return accessibleName; + } + // 获取编号,然后+1 + int pos = accessibleName.indexOf(kSeparator); + int id = accessibleName.mid(pos + 1).toInt(); + + QString newAccessibleName; + do { + // 一直找到一个不重复的名字 + newAccessibleName = accessibleName + kSeparator + QString::number(++id); + } while (accessibleMap[r].contains(newAccessibleName)); + + accessibleMap[r].append(newAccessibleName); + objnameMap.insert(w, newAccessibleName); + + return newAccessibleName; + } else { + accessibleMap[r].append(accessibleName); + objnameMap.insert(w, accessibleName); + + return accessibleName; + } +} + +inline QString getAccessibleName(QWidget *w, QAccessible::Role r, QString fallback) +{ + QString accessibleName = getIntelAccessibleName(w, r, fallback); + if(accessibleName.isEmpty()) + { + return getObjPrefix(r) + kSeparator; + } + + return accessibleName; +} + +#define FUNC_CREATE(classname,accessibletype,accessdescription) Accessible##classname(classname *w) \ + : QAccessibleWidget(w,accessibletype,#classname)\ + , m_w(w)\ + , m_description(accessdescription)\ +{}\ + private:\ + classname *m_w;\ + QString m_description;\ + +#define FUNC_PRESS(classobj) QStringList actionNames() const override{\ + if(!classobj->isEnabled())\ + return QStringList();\ + return QStringList() << pressAction();}\ + void doAction(const QString &actionName) override{\ + if(actionName == pressAction())\ +{\ + QPointF localPos = classobj->geometry().center();\ + QMouseEvent event(QEvent::MouseButtonPress,localPos,Qt::LeftButton,Qt::LeftButton,Qt::NoModifier);\ + QMouseEvent event2(QEvent::MouseButtonRelease,localPos,Qt::LeftButton,Qt::LeftButton,Qt::NoModifier);\ + qApp->sendEvent(classobj,&event);\ + qApp->sendEvent(classobj,&event2);\ + }\ + }\ + +#define FUNC_SHOWMENU(classobj) QStringList actionNames() const override{\ + if(!classobj->isEnabled())\ + return QStringList();\ + return QStringList() << showMenuAction();}\ + void doAction(const QString &actionName) override{\ + if(actionName == showMenuAction())\ +{\ + QPointF localPos = classobj->geometry().center();\ + QMouseEvent event(QEvent::MouseButtonPress,localPos,Qt::RightButton,Qt::RightButton,Qt::NoModifier);\ + QMouseEvent event2(QEvent::MouseButtonRelease,localPos,Qt::RightButton,Qt::RightButton,Qt::NoModifier);\ + qApp->sendEvent(classobj,&event);\ + qApp->sendEvent(classobj,&event2);\ + }\ + }\ + +#define FUNC_PRESS_SHOWMENU(classobj) QStringList actionNames() const override{\ + if(!classobj->isEnabled())\ + return QStringList();\ + return QStringList() << pressAction() << showMenuAction();}\ + void doAction(const QString &actionName) override{\ + if(actionName == pressAction())\ +{\ + QPointF localPos = classobj->geometry().center();\ + QMouseEvent event(QEvent::MouseButtonPress,localPos,Qt::LeftButton,Qt::LeftButton,Qt::NoModifier);\ + QMouseEvent event2(QEvent::MouseButtonRelease,localPos,Qt::LeftButton,Qt::LeftButton,Qt::NoModifier);\ + qApp->sendEvent(classobj,&event);\ + qApp->sendEvent(classobj,&event2);\ + }\ + else if(actionName == showMenuAction())\ +{\ + QPointF localPos = classobj->geometry().center();\ + QMouseEvent event(QEvent::MouseButtonPress,localPos,Qt::RightButton,Qt::RightButton,Qt::NoModifier);\ + QMouseEvent event2(QEvent::MouseButtonRelease,localPos,Qt::RightButton,Qt::RightButton,Qt::NoModifier);\ + qApp->sendEvent(classobj,&event);\ + qApp->sendEvent(classobj,&event2);\ + }\ + }\ + +#define FUNC_RECT(classobj) QRect rect() const override{\ + if (!classobj->isVisible())\ + return QRect();\ + return classobj->geometry();\ + }\ + +#define FUNC_TEXT(classname,accessiblename) QString Accessible##classname::text(QAccessible::Text t) const{\ + switch (t) {\ + case QAccessible::Name:\ + return getAccessibleName(m_w, this->role(), accessiblename);\ + case QAccessible::Description:\ + return m_description;\ + default:\ + return QString();\ + }\ + }\ + +#define USE_ACCESSIBLE(classnamestring,classname) if (classnamestring == QLatin1String(#classname) && object && object->isWidgetType())\ +{\ + interface = new Accessible##classname(static_cast(object));\ + }\ + +// [指定objectname]---适用同一个类,但objectname不同的情况 +#define USE_ACCESSIBLE_BY_OBJECTNAME(classnamestring,classname,objectname) if (classnamestring == QLatin1String(#classname) && object && (object->objectName() == objectname) && object->isWidgetType())\ +{\ + interface = new Accessible##classname(static_cast(object));\ + }\ + +#define SET_BUTTON_ACCESSIBLE_PRESS_DESCRIPTION(classname,accessiblename,accessdescription) class Accessible##classname : public QAccessibleWidget\ +{\ + public:\ + FUNC_CREATE(classname,QAccessible::Button,accessdescription)\ + QString text(QAccessible::Text t) const override;\ + FUNC_PRESS(m_w)\ + };\ + +#define SET_BUTTON_ACCESSIBLE_SHOWMENU_DESCRIPTION(classname,accessiblename,accessdescription) class Accessible##classname : public QAccessibleWidget\ +{\ + public:\ + FUNC_CREATE(classname,QAccessible::Button,accessdescription)\ + QString text(QAccessible::Text t) const override;\ + FUNC_SHOWMENU(m_w)\ + };\ + +#define SET_BUTTON_ACCESSIBLE_PRESS_SHOEMENU_DESCRIPTION(classname,accessiblename,accessdescription) class Accessible##classname : public QAccessibleWidget\ +{\ + public:\ + FUNC_CREATE(classname,QAccessible::Button,accessdescription)\ + QString text(QAccessible::Text t) const override;\ + FUNC_PRESS_SHOWMENU(m_w)\ + };\ + +#define SET_LABEL_ACCESSIBLE_WITH_DESCRIPTION(classname,aaccessibletype,accessiblename,accessdescription) class Accessible##classname : public QAccessibleWidget\ +{\ + public:\ + FUNC_CREATE(classname,aaccessibletype,accessdescription)\ + QString text(QAccessible::Text t) const override;\ + FUNC_RECT(m_w)\ + };\ + +// /*******************************************简化使用*******************************************/ +#define SET_BUTTON_ACCESSIBLE_PRESS_SHOWMENU(classname,accessiblename) SET_BUTTON_ACCESSIBLE_PRESS_SHOEMENU_DESCRIPTION(classname,accessiblename,"")\ + FUNC_TEXT(classname,accessiblename) + +#define SET_BUTTON_ACCESSIBLE_SHOWMENU(classname,accessiblename) SET_BUTTON_ACCESSIBLE_SHOWMENU_DESCRIPTION(classname,accessiblename,"")\ + FUNC_TEXT(classname,accessiblename) + +#define SET_BUTTON_ACCESSIBLE(classname,accessiblename) SET_BUTTON_ACCESSIBLE_PRESS_DESCRIPTION(classname,accessiblename,"")\ + FUNC_TEXT(classname,accessiblename) + +#define SET_LABEL_ACCESSIBLE(classname,accessiblename) SET_LABEL_ACCESSIBLE_WITH_DESCRIPTION(classname,QAccessible::StaticText,accessiblename,"")\ + FUNC_TEXT(classname,accessiblename) + +#define SET_FORM_ACCESSIBLE(classname,accessiblename) SET_LABEL_ACCESSIBLE_WITH_DESCRIPTION(classname,QAccessible::Form,accessiblename,"");\ + FUNC_TEXT(classname,accessiblename) + +#define SET_SLIDER_ACCESSIBLE(classname,accessiblename) SET_LABEL_ACCESSIBLE_WITH_DESCRIPTION(classname,QAccessible::Slider,accessiblename,"")\ + FUNC_TEXT(classname,accessiblename) + +#define SET_SEPARATOR_ACCESSIBLE(classname,accessiblename) SET_LABEL_ACCESSIBLE_WITH_DESCRIPTION(classname,QAccessible::Separator,accessiblename,"")\ + FUNC_TEXT(classname,accessiblename) +/************************************************************************************************/ + + +/********************** 添加accessible ***********************/ +SET_FORM_ACCESSIBLE(QWidget,m_w->objectName()) + +QAccessibleInterface *accessibleFactory(const QString &classname, QObject *object) +{ + QAccessibleInterface *interface = nullptr; + USE_ACCESSIBLE(classname, QWidget); + + return interface; +} +/*************************************************************/ + +#endif // ACCESSIBLE_H diff --git a/application/assets/auditRule.conf b/application/assets/auditRule.conf new file mode 100644 index 00000000..ac8b3817 --- /dev/null +++ b/application/assets/auditRule.conf @@ -0,0 +1,5 @@ +[General] +IdentAuth=LOGIN@USER_AUTH +DAC=deepin_dac_new_file@deepin_dac_access_control_modify@DAC_CHECK@ANOM_MAX_DAC +MAC=AVC@SELINUX_ERR@AVC_PATH@MAC_POLICY_LOAD@MAC_STATUS@MAC_CONFIG_CHANGE@MAC_UNLBL_ALLOW@MAC_CIPSOV4_ADD@MAC_CIPSOV4_DEL@MAC_CHECK@MAC_MAP_ADD@MAC_MAP_DEL@MAC_IPSEC_ADDSA@MAC_IPSEC_DELSA@MAC_IPSEC_ADDSPD@MAC_IPSEC_DELSPD@MAC_IPSEC_EVENT@MAC_UNLBL_STCADD@MAC_UNLBL_STCDEL@USER_AVC@USER_MAC_POLICY_LOAD@USER_MAC_CONFIG_CHANGE@USER_ROLE_CHANGE@USER_SELINUX_ERR@USER_LABELED_EXPORT@RESP_SEBOOL@ROLE_ASSIGN@ROLE_MODIFY@ROLE_REMOVE@ANOM_MAX_MAC@ANOM_RBAC_FAIL@ANOM_RBAC_INTEGRITY_FAIL +DocAudit=file_wa_audit diff --git a/application/assets/com.deepin.pkexec.logViewerAuth.policy b/application/assets/com.deepin.pkexec.logViewerAuth.policy index 4a8034fd..faa22b81 100644 --- a/application/assets/com.deepin.pkexec.logViewerAuth.policy +++ b/application/assets/com.deepin.pkexec.logViewerAuth.policy @@ -15,68 +15,144 @@ /usr/bin/logViewerAuth true + autenticació + Cal autenticació per veure el registre. + ovjera + Potrebna je ovjera za pregled zapisa + Authentifizierung + Zur Ansicht des Protokolls ist eine Authentifizierung erforderlich + 认证 + 查看此日志需要授权 + pengesahihan + Pengesahihan diperlukan untuk melihat log autenticación Se requiere autenticación para ver el registro + autentifikation + overitev + Ogled dnevnika zahteva overitev + mirëfilltësim + Për parjen e regjistrit është i domosdoshëm mirëfilltësimi + autenticação + A autenticação é necessária para visualizar os logs + دەلىللەش + بۇ خاتىرىنى كۆرۈش دەلىللەشنى تەلەپ قىلىدۇ + 認證 + 查看日誌需要認證 + kimlik doğrulaması + Jurnala baxmaq üçün kimlik doğrulaması tələb olunur + autenticación authenticatie Voer je wachtwoord in om het logboek te bekijken - Authentifizierung - Zur Ansicht des Protokolls ist eine Authentifizierung erforderlich - autenticació - Cal autenticació per veure el registre. + authentification + L'authentification est requise pour voir les journaux + Anaouadur + An anaouadur a zo rekis evit gellout gwelet ar renabloù uwierzytelnienie - Do przeglądania dziennika konieczne jest uwierzytelnienie + Wymagane jest uwierzytelnienie, aby przeglądać dziennik + authentication + Authentication is required to view the log + 認證 + 查看此日誌需要認證 todennus Tapahtumalokin katsomiseen tarvitaan todennus + 인증 + 로그를 보려면 인증이 필요합니다 + المصادقة + المصادقة مطلوبة لعرض السجل + Hitelesítés + Hitelesítés szükséges a napló megtekintéséhez + प्रमाणीकरण + लॉग फ़ाइल देखने हेतु प्रमाणीकरण आवश्यक है + идентификација + Идентификација је неопходана за преглед записника + དཔང་དཔྱད། + ཉིན་ཐོ་འདི་ལྟ་བཤེར་བྱེད་པར་དཔང་དཔྱད་བྱ་དགོས། + autenticação + É necessária autenticação para visualizar o registo kimlik doğrulama Günlüğü görüntülemek için kimlik doğrulaması gerekli - 認證 - 查看此日誌需要認證 + Розпізнавання + Для перегляду журналу слід пройти розпізнавання + Аутентификация + Для просмотра журнала необходима аутентификация autenticazione Autenticazione richiesta per visualizzare il log + ověření se + Pro zobrazení událostí je vyžadováno ověření se + + + authentication + Authentication is required to view the log + + + no + no + auth_self_keep + + autenticació + Cal autenticació per veure el registre. + ovjera + Potrebna je ovjera za pregled zapisa + Authentifizierung + Zur Ansicht des Protokolls ist eine Authentifizierung erforderlich 认证 - 查看此日志需要认证 + 查看此日志需要授权 pengesahihan Pengesahihan diperlukan untuk melihat log - دەلىللەش - بۇ خاتىرىنى كۆرۈش دەلىللەشنى تەلەپ قىلىدۇ + autenticación + Se requiere autenticación para ver el registro + autentifikation overitev Ogled dnevnika zahteva overitev - 인증 - 로그를 보려면 인증이 필요합니다 - autenticação - É necessária autenticação para visualizar o registo - प्रमाणीकरण - लॉग फ़ाइल देखने हेतु प्रमाणीकरण आवश्यक है mirëfilltësim Për parjen e regjistrit është i domosdoshëm mirëfilltësimi - Розпізнавання - Для перегляду журналу слід пройти розпізнавання - authentication - Authentication is required to view the log + autenticação + A autenticação é necessária para visualizar os logs + دەلىللەش + بۇ خاتىرىنى كۆرۈش دەلىللەشنى تەلەپ قىلىدۇ 認證 查看日誌需要認證 - идентификација - Идентификација је неопходана за преглед записника + kimlik doğrulaması + Jurnala baxmaq üçün kimlik doğrulaması tələb olunur + autenticación + authenticatie + Voer je wachtwoord in om het logboek te bekijken authentification L'authentification est requise pour voir les journaux - Аутентификация - Аутентификация необходима для просмотра журнала Anaouadur An anaouadur a zo rekis evit gellout gwelet ar renabloù - kimlik doğrulaması - Jurnala baxmaq üçün kimlik doğrulaması tələb olunur - དཔང་དཔྱད། - ཉིན་ཐོ་འདི་ལྟ་བཤེར་བྱེད་པར་དཔང་དཔྱད་བྱ་དགོས། - ověření se - Pro zobrazení událostí je vyžadováno ověření se - autenticação - A autenticação é necessária para visualizar os logs - ovjera - Potrebna je ovjera za pregled zapisa + uwierzytelnienie + Wymagane jest uwierzytelnienie, aby przeglądać dziennik + authentication + Authentication is required to view the log + 認證 + 查看此日誌需要認證 + todennus + Tapahtumalokin katsomiseen tarvitaan todennus + 인증 + 로그를 보려면 인증이 필요합니다 المصادقة المصادقة مطلوبة لعرض السجل Hitelesítés Hitelesítés szükséges a napló megtekintéséhez + प्रमाणीकरण + लॉग फ़ाइल देखने हेतु प्रमाणीकरण आवश्यक है + идентификација + Идентификација је неопходана за преглед записника + དཔང་དཔྱད། + ཉིན་ཐོ་འདི་ལྟ་བཤེར་བྱེད་པར་དཔང་དཔྱད་བྱ་དགོས། + autenticação + É necessária autenticação para visualizar o registo + kimlik doğrulama + Günlüğü görüntülemek için kimlik doğrulaması gerekli + Розпізнавання + Для перегляду журналу слід пройти розпізнавання + Аутентификация + Для просмотра журнала необходима аутентификация + autenticazione + Autenticazione richiesta per visualizzare il log + ověření se + Pro zobrazení událostí je vyžadováno ověření se authentication @@ -87,11 +163,123 @@ no auth_admin + autenticació + Cal autenticació per exportar registres. + ovjera + Authentifizierung + Zum Exportieren von Protokollen ist eine Authentifizierung erforderlich + 认证 + 导出日志需要授权 + pengesahihan + Pengesahihan diperlukan untuk mengeksport log + autenticación + Se requiere autenticación para exportar registros + autentifikation + overitev + mirëfilltësim + Që të eksportohen regjistra, lypset mirëfilltësim + autenticação + دەلىللەش + خاتىرىنى چىقىرىش دەلىللەشنى تەلەپ قىلىدۇ + 認證 + 導出日誌需要授權 + kimlik doğrulaması + Jurnalların ixrac edilməsi üçün kimlik doğrulaması tələb olunur + autenticación + authenticatie + Voer je wachtwoord in om logboeken te kunnen exporteren + authentification + L'authentification est requise pour exporter les journaux + Anaouadur + uwierzytelnienie + Wymagane jest uwierzytelnienie do eksportu dziennika + authentication 認證 導出日誌需要授權 + todennus + Lokien viemiseksi vaaditaan todennus + 인증 + المصادقة + Hitelesítés + Hitelesítés szükséges a naplók exportálásához + प्रमाणीकरण + идентификација + དཔང་དཔྱད། + ཉིན་ཐོ་འདྲེན་པ་ལ་དབང་སྐུར་དགོས། + autenticação + É necessária autenticação para exportar registos + kimlik doğrulama + Günlükleri dışa aktarmak için kimlik doğrulaması gerekli + Розпізнавання + Для експортування журналу слід пройти розпізнавання + Аутентификация + Для экспорта журналов необходима аутентификация + autenticazione + Autenticazione richiesta per esportare i log + ověření se + + + authentication + Authentication is required to export logs + + + no + no + auth_self + + autenticació + Cal autenticació per exportar registres. + ovjera + Authentifizierung + Zum Exportieren von Protokollen ist eine Authentifizierung erforderlich 认证 导出日志需要授权 + pengesahihan + Pengesahihan diperlukan untuk mengeksport log + autenticación + Se requiere autenticación para exportar registros + autentifikation + overitev + mirëfilltësim + Që të eksportohen regjistra, lypset mirëfilltësim + autenticação + دەلىللەش + خاتىرىنى چىقىرىش دەلىللەشنى تەلەپ قىلىدۇ 認證 導出日誌需要授權 + kimlik doğrulaması + Jurnalların ixrac edilməsi üçün kimlik doğrulaması tələb olunur + autenticación + authenticatie + Voer je wachtwoord in om logboeken te kunnen exporteren + authentification + L'authentification est requise pour exporter les journaux + Anaouadur + uwierzytelnienie + Wymagane jest uwierzytelnienie do eksportu dziennika + authentication + 認證 + 導出日誌需要授權 + todennus + Lokien viemiseksi vaaditaan todennus + 인증 + المصادقة + Hitelesítés + Hitelesítés szükséges a naplók exportálásához + प्रमाणीकरण + идентификација + དཔང་དཔྱད། + ཉིན་ཐོ་འདྲེན་པ་ལ་དབང་སྐུར་དགོས། + autenticação + É necessária autenticação para exportar registos + kimlik doğrulama + Günlükleri dışa aktarmak için kimlik doğrulaması gerekli + Розпізнавання + Для експортування журналу слід пройти розпізнавання + Аутентификация + Для экспорта журналов необходима аутентификация + autenticazione + Autenticazione richiesta per esportare i log + ověření se diff --git a/application/assets/com.deepin.pkexec.logViewerAuth.policy.tmp b/application/assets/com.deepin.pkexec.logViewerAuth.policy.tmp index 77947996..99502fad 100644 --- a/application/assets/com.deepin.pkexec.logViewerAuth.policy.tmp +++ b/application/assets/com.deepin.pkexec.logViewerAuth.policy.tmp @@ -20,4 +20,43 @@ true + + authentication + Authentication is required to view the log + + + no + no + auth_self_keep + + 认证 + 查看此日志需要授权 + + + + authentication + 认证 + Authentication is required to export logs + 导出日志需要授权 + + + no + no + auth_admin + + + + + authentication + 认证 + Authentication is required to export logs + 导出日志需要授权 + + + no + no + auth_self + + + diff --git a/application/assets/com.deepin.pkexec.logViewerTruncate.policy b/application/assets/com.deepin.pkexec.logViewerTruncate.policy index 6e19c592..aaf143e1 100644 --- a/application/assets/com.deepin.pkexec.logViewerTruncate.policy +++ b/application/assets/com.deepin.pkexec.logViewerTruncate.policy @@ -15,63 +15,67 @@ /usr/bin/logViewerTruncate true - kimlik doğrulama - Günlüğü temizlemek için kimlik doğrulaması gerekli - autenticación - A autenticación é necesaria para limpar o rexistro - kimlik doğrulaması - Jurnalı təmizləmək üçün kimlik doğrulaması tələb olunur - 認證 - 清除此日誌需要認證 + autenticació + Cal autenticació per netejar el registre. + ovjera + Potrebna je ovjera za čišćenje zapisa + Authentifizierung + Zum Löschen des Protokolls ist eine Authentifizierung erforderlich 认证 清除此日志需要授权 + pengesahihan + Pengesahihan diperlukan untuk mengosongkan log + autenticación + La autenticación es necesaria para borrar el registro + autentifikation overitev Čiščenje dnevnika zahteva overitev + mirëfilltësim + Për spastrimin e regjistrit lypset mirëfilltësim + autenticação + A autenticação é necessária para limpar os logs + دەلىللەش + بۇ خاتىرىنى تازىلاش دەلىللەشنى تەلەپ قىلىدۇ + 認證 + 清除此日誌需要認證 + kimlik doğrulaması + Jurnalı təmizləmək üçün kimlik doğrulaması tələb olunur + autenticación + A autenticación é necesaria para limpar o rexistro + authenticatie + Voer je wachtwoord in om het logboek te wissen + authentification + L'authentification est requise pour effacer le journal + Anaouadur + uwierzytelnienie + Wymagane jest uwierzytelnienie do wyczyszczenia dziennika + authentication + 認證 + 清除此日誌需要認證 + todennus + Tapahtumalokin tyhjentäminen edellyttää todennusta + 인증 + 로그를 지우려면 인증이 필요합니다 + المصادقة Hitelesítés Hitelesítés szükséges a napló törléséhez - autenticación - La autenticación es necesaria para borrar el registro - Розпізнавання - Для спорожнення журналу слід пройти розпізнавання प्रमाणीकरण लॉग फ़ाइल रिक्त करने हेतु प्रमाणीकरण आवश्यक है - uwierzytelnienie - Do wyczyszczenia dziennika wymagane jest uwierzytelnienie идентификација Идентификација је неопходана да обришете записник + དཔང་དཔྱད། + ཉིན་ཐོ་འདི་ལྟ་བཤེར་བྱེད་པར་དཔང་དཔྱད་བྱ་དགོས། autenticação É necessária a autenticação para limpar o registo - pengesahihan - Pengesahihan diperlukan untuk mengosongkan log - authentification - L'authentification est requise pour effacer le journal + kimlik doğrulama + Günlüğü temizlemek için kimlik doğrulaması gerekli + Розпізнавання + Для спорожнення журналу слід пройти розпізнавання Аутентификация Для очистки журнала необходимо авторизоваться - autenticação - A autenticação é necessária para limpar os logs - mirëfilltësim - Për spastrimin e regjistrit lypset mirëfilltësim - authenticatie - Voer je wachtwoord in om het logboek te wissen - 認證 - 清除此日誌需要認證 - autenticació - Cal autenticació per netejar el registre. - دەلىللەش - بۇ خاتىرىنى تازىلاش دەلىللەشنى تەلەپ قىلىدۇ - དཔང་དཔྱད། - ཉིན་ཐོ་འདི་ལྟ་བཤེར་བྱེད་པར་དཔང་དཔྱད་བྱ་དགོས། - 인증 - 로그를 지우려면 인증이 필요합니다 autenticazione Autenticazione richiesta per ripulire il Log ověření se Pro vyčištění záznamu událostí je vyžadováno ověření se - todennus - Tapahtumalokin tyhjentäminen edellyttää todennusta - Authentifizierung - Zum Löschen des Protokolls ist eine Authentifizierung erforderlich - ovjera - Potrebna je ovjera za čišćenje zapisa diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/applog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/applog.png old mode 100644 new mode 100755 index 9028622e..e316a375 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/applog.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/applog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/bootlog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/bootlog.png old mode 100644 new mode 100755 index 1a4c9a81..40d44bfd Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/bootlog.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/bootlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/displayinfm.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/displayinfm.png old mode 100644 new mode 100755 index cbe93a5c..eb795cc4 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/displayinfm.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/displayinfm.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/dpkglog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/dpkglog.png old mode 100644 new mode 100755 index 8d42dc18..ab34c7c6 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/dpkglog.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/dpkglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_applog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_applog.png deleted file mode 100644 index 56cab331..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_applog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_bootlog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_bootlog.png deleted file mode 100644 index d0ac27d9..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_bootlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_displayinfm.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_displayinfm.png deleted file mode 100644 index 3d725f5a..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_displayinfm.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_dnflog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_dnflog.png deleted file mode 100644 index 753bc934..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_dnflog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_homepage.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_homepage.png deleted file mode 100644 index 398ff4f8..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_homepage.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_kernlog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_kernlog.png deleted file mode 100644 index 59af1fbd..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_kernlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_powerevent.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_powerevent.png deleted file mode 100644 index 64e1cd0a..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_powerevent.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_rsyslog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_rsyslog.png deleted file mode 100644 index 398ff4f8..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_rsyslog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_search.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_search.png deleted file mode 100644 index 7817ff81..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_xorglog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_xorglog.png deleted file mode 100644 index 722e3cb5..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/eu_xorglog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/export.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/export.png deleted file mode 100644 index 29a216d4..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/export.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/homepage.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/homepage.png deleted file mode 100644 index bd233ecd..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/homepage.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/kernlog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/kernlog.png old mode 100644 new mode 100755 index 4731a1fa..066cffa9 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/kernlog.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/kernlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/otherslog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/otherslog.png new file mode 100644 index 00000000..b166501b Binary files /dev/null and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/otherslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/powerevent.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/powerevent.png old mode 100644 new mode 100755 index 10d25b2f..e3562ed6 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/powerevent.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/powerevent.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rightclick.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rightclick.png deleted file mode 100644 index a1b55132..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rightclick.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rsyslog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rsyslog.png old mode 100644 new mode 100755 index 89bc2126..377efe92 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rsyslog.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/rsyslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/search.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/search.png deleted file mode 100644 index 5d0070d3..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/xorglog.png b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/xorglog.png old mode 100644 new mode 100755 index 5c9dd643..4b476ab2 Binary files a/application/assets/deepin-log-viewer/log-viewer/en_US/fig/xorglog.png and b/application/assets/deepin-log-viewer/log-viewer/en_US/fig/xorglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/en_US/log-viewer.md b/application/assets/deepin-log-viewer/log-viewer/en_US/log-viewer.md index 6c55e73e..436a8d43 100644 --- a/application/assets/deepin-log-viewer/log-viewer/en_US/log-viewer.md +++ b/application/assets/deepin-log-viewer/log-viewer/en_US/log-viewer.md @@ -148,6 +148,40 @@ You can run, close or create a shortcut for Log Viewer. 3. Click a log, you can see its particular info below the list, including user, time, event type, username and info. ![0|powerevent](fig/powerevent.png) +#### Other Logs + +1. On the main interface, click **Other Logs**. +2. Other logs display the file name and modification date of the log file in a file list format. Display similar log files in folder format. +3. After selecting a file, you can view its detailed content. Drag and drop the file list and detailed content boundary to synchronize and adjust the size of the two regions. + +![otherslog](fig/otherslog.png) + + +### Custom logs + +The custom log function is to add log files to the log collection tool for viewing and exporting. Custom logging compatible with Gsettings and Dconfig configurations. + +**Gsettings configuration** + +1. Execute the Gsettings configuration setting command on the terminal, fill in the log file path in "[]", for example: ['a. log ',' b. log ',' c. log ']. + +```shell +gsettings set com.deepin.log.viewer customlogfiles [] +``` + +2. On the main interface, click **Custom Log** to discover the existing configuration. + +**Dconfig configuration** + +1. Execute the Dconfig configuration setting command on the terminal, fill in the log file path in "[]", for example: ["a.log", "b. log", "c.log"] + +```shell +dde-dconfig --set -a org.deepin.log.viewer -r org.deepin.log.viewer -k customLogFiles -v '["a.log","b.log","c.log"]' +``` + +2. On the main interface, click **Custom Log** to discover the existing configuration. + + ### Export Logs You can export logs to local computer so as to help you analyze, locate and solve problems. diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/applog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/applog.png old mode 100644 new mode 100755 index c92ae5b5..e2142409 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/applog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/applog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/bootlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/bootlog.png old mode 100644 new mode 100755 index b591b455..0e15d4f3 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/bootlog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/bootlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/dpkglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/dpkglog.png old mode 100644 new mode 100755 index 35261c46..7c4dda1a Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/dpkglog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/dpkglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_applog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_applog.png deleted file mode 100755 index 3b543954..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_applog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_bootlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_bootlog.png deleted file mode 100755 index c13d46c3..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_bootlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_dnflog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_dnflog.png deleted file mode 100755 index 5fe2926f..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_dnflog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_kernlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_kernlog.png deleted file mode 100755 index 8521f493..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_kernlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_powerevent.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_powerevent.png deleted file mode 100755 index ebad0d1c..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_powerevent.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_rightclick.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_rightclick.png deleted file mode 100755 index ded756d7..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_rightclick.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_search.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_search.png deleted file mode 100755 index a9af85ed..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_syslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_syslog.png deleted file mode 100755 index fdec3787..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_syslog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_xorglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_xorglog.png deleted file mode 100755 index b6ff53a6..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/e_xorglog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/export.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/export.png deleted file mode 100755 index 59bb2930..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/export.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/kernlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/kernlog.png old mode 100644 new mode 100755 index c53dbdce..1a1e8139 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/kernlog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/kernlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/otherslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/otherslog.png new file mode 100644 index 00000000..b166501b Binary files /dev/null and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/otherslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/power_event.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/power_event.png old mode 100644 new mode 100755 index 916d0dfc..f0bcc79b Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/power_event.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/power_event.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/refresh.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/refresh.png deleted file mode 100755 index 9ec54dfa..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/refresh.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/rightclick.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/rightclick.png old mode 100644 new mode 100755 index 0eb5deb1..c36f84ce Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/rightclick.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/rightclick.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/search.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/search.png deleted file mode 100644 index 0ca63e17..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/syslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/syslog.png old mode 100644 new mode 100755 index 7b9407f1..5c0d8929 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/syslog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/syslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/xorglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/xorglog.png old mode 100644 new mode 100755 index ae14b5a6..8e010aac Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/xorglog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_CN/fig/xorglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_CN/log-viewer.md b/application/assets/deepin-log-viewer/log-viewer/zh_CN/log-viewer.md index 1f626d04..76bbe0b6 100755 --- a/application/assets/deepin-log-viewer/log-viewer/zh_CN/log-viewer.md +++ b/application/assets/deepin-log-viewer/log-viewer/zh_CN/log-viewer.md @@ -142,6 +142,39 @@ ![power_event](fig/power_event.png) +#### 查看其它日志 + +1. 在日志收集工具界面,单击 **其它日志**。 +2. 其它日志以文件列表方式展示日志文件的文件名称、修改日期。同类日志文件以文件夹方式展示。 +3. 选中某个文件后,可查看该文件的详细内容。拖拽文件列表和详细内容分界线,可以同步调整两区域大小。 + +![otherslog](fig/otherslog.png) + + + +### 自定义日志 + +自定义日志功能是将日志文件添加至日志收集工具进行查看、导出。自定义日志兼容Gsettings配置和Dconfig配置。 + +**Gsettings配置** + +1. 在终端执行Gsettings配置设置命令,“[]”中填写日志文件路径,比如:['a.log','b.log','c.log']。 + +```shell +gsettings set com.deepin.log.viewer customlogfiles [] +``` + +2. 在日志收集工具界面,单击**自定义日志**,即可发现已有配置。 + +**Dconfig配置** + +1. 在终端执行Dconfig配置设置命令,"[]"中填写日志文件路径,比如:["a.log","b.log","c.log"] + +```shell +dde-dconfig --set -a org.deepin.log.viewer -r org.deepin.log.viewer -k customLogFiles -v '["a.log","b.log","c.log"]' +``` + +2. 在日志收集工具界面,单击**自定义日志**,即可发现已有配置。 ### 导出日志 diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/applog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/applog.png old mode 100644 new mode 100755 index c75a1dcf..49346036 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/applog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/applog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/bootlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/bootlog.png old mode 100644 new mode 100755 index e1c4287a..497e3bd9 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/bootlog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/bootlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/dpkglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/dpkglog.png old mode 100644 new mode 100755 index 759ed6e5..057d55d5 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/dpkglog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/dpkglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_applog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_applog.png deleted file mode 100755 index 25464a65..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_applog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_bootlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_bootlog.png deleted file mode 100755 index 48c8e26c..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_bootlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_dnflog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_dnflog.png deleted file mode 100755 index c8282b78..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_dnflog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_kernlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_kernlog.png deleted file mode 100755 index 5ad69187..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_kernlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_power_event.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_power_event.png deleted file mode 100755 index c5bbe5d8..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_power_event.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_right_click.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_right_click.png deleted file mode 100755 index 425a098b..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_right_click.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_search.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_search.png deleted file mode 100755 index f24ff218..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_syslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_syslog.png deleted file mode 100755 index 1e229d5e..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_syslog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_xorglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_xorglog.png deleted file mode 100755 index 09ed96c4..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/eu_xorglog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/homepage.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/homepage.png deleted file mode 100755 index cae564bf..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/homepage.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/kernlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/kernlog.png old mode 100644 new mode 100755 index 8eb609ea..72c51689 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/kernlog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/kernlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/otherslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/otherslog.png new file mode 100644 index 00000000..c9650236 Binary files /dev/null and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/otherslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/powerevent.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/powerevent.png deleted file mode 100644 index 722fb255..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/powerevent.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/rightclick.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/rightclick.png deleted file mode 100644 index 93929594..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/rightclick.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/search.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/search.png deleted file mode 100644 index 0fdf82f7..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/syslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/syslog.png old mode 100644 new mode 100755 index d76f2b4c..eb33a8ba Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/syslog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/syslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/xorglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/xorglog.png old mode 100644 new mode 100755 index b704c597..39d9f8ea Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/xorglog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_HK/fig/xorglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_HK/log-viewer.md b/application/assets/deepin-log-viewer/log-viewer/zh_HK/log-viewer.md index 6985ab2e..84be222d 100755 --- a/application/assets/deepin-log-viewer/log-viewer/zh_HK/log-viewer.md +++ b/application/assets/deepin-log-viewer/log-viewer/zh_HK/log-viewer.md @@ -1,47 +1,47 @@ -# 日誌查看器|deepin-log-viewer| +# 日誌收集工具|deepin-log-viewer| ## 概述 -日誌查看器是負責收集程序運行時所產生日誌的小工具,如操作系統和應用程序在啟動、運行等過程中的相關訊息。您可以通過分析詳細日誌訊息,快速的找到故障原因並解決問題。 +日誌收集工具是負責收集程序運行時所產生日誌的小工具,如操作系統和應用程序在啟動、運行等過程中的相關信息。您可以通過分析詳細日誌信息,快速地找到故障原因並解決問題。 ## 使用入門 -您可以通過以下方式運行或關閉日誌查看器,或者創建快捷方式。 +您可以通過以下方式運行或關閉日誌收集工具,或者創建快捷方式。 -### 運行日誌查看器 +### 運行日誌收集工具 1. 單擊任務欄上的啟動器圖標 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器界面。 -2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到日誌查看器圖標 ![deepin_log_viewer](../common/deepin_log_viewer.svg),單擊運行。 +2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到日誌收集工具圖標 ![deepin_log_viewer](../common/deepin_log_viewer.svg),單擊運行。 3. 右鍵單擊 ![deepin_log_viewer](../common/deepin_log_viewer.svg),您可以: - - 單擊 **傳送到桌面**,在桌面創建快捷方式。 - - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。 - - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用程序。 + - 單擊 **發送到桌面**,在桌面創建快捷方式。 + - 單擊 **發送到任務欄**,將應用程序固定到任務欄。 + - 單擊 **開機自動啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用程序。 -### 關閉日誌查看器 +### 關閉日誌收集工具 -- 在日誌查看器界面,單擊 ![close_icon](../common/close_icon.svg),退出日誌查看器。 -- 在任務欄上右鍵單擊 ![deepin_log_viewer](../common/deepin_log_viewer.svg),選擇 **關閉所有**,退出日誌查看器。 -- 在日誌查看器界面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,退出日誌查看器。 +- 在日誌收集工具界面,單擊 ![close_icon](../common/close_icon.svg),退出日誌收集工具。 +- 在任務欄上右鍵單擊 ![deepin_log_viewer](../common/deepin_log_viewer.svg) ,選擇 **關閉所有**,退出日誌收集工具。 +- 在日誌收集工具界面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,退出日誌收集工具。 ## 操作介紹 -### 搜索日志 +### 搜索日誌 -1. 在日誌查看器搜索框中,單擊 ![search](../common/search.svg)。 +1. 在日誌收集工具搜索框中,單擊 ![search](../common/search.svg)。 2. 輸入關鍵字,實時顯示搜索結果。 -2. 單擊 ![close_icon](../common/close_icon.svg) ,則清空搜索內容。 +3. 單擊 ![close_icon](../common/close_icon.svg) ,則清空搜索內容。 -### 篩選日志 +### 篩選日誌 您可以通過 **週期**、**級別**、**狀態**、**應用列表** 或 **事件類型** 來篩選日誌。 - + @@ -56,7 +56,7 @@ @@ -82,66 +82,99 @@
類型說明 説明
按週期篩選按級別篩選 按照事件的級別高低進行篩選。
    -
  • 選項包括:全部、緊急、嚴重警告、嚴重、錯誤、警告、注意、訊息、調試,默認選項為訊息。
  • +
  • 選項包括:全部、緊急、嚴重警告、嚴重、錯誤、警告、注意、信息、調試,默認選項為信息。
  • 適用類型:系統日誌、應用日誌。
-### 查看日志 +### 查看日誌 #### 查看系統日誌 -1. 在日誌查看器界面,單擊 **系統日誌**。 -2. 查看系統日誌的級別、進程、時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括日誌進程、主機名、進程號、級別、時間和詳細訊息。 +1. 在日誌收集工具界面,單擊 **系統日誌**。 +2. 查看系統日誌的級別、進程、時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括進程、時間、主機名、進程號、級別和詳細信息。 ![rsylog](fig/syslog.png) #### 查看內核日誌 -1. 在日誌查看器界面,單擊 **內核日誌**。 -2. 彈出「密碼認證」窗口,輸入用戶登錄密碼後單擊 **確定**。 -3. 查看內核日誌的時間、主機名、進程和訊息。 -4. 選中某條日誌後,可查看該日誌的詳細訊息,包括進程、時間、主機名和詳細訊息。 +1. 在日誌收集工具界面,單擊 **內核日誌**。 +2. 彈出“密碼認證”窗口,輸入用户登錄密碼後單擊 **確定**。 +3. 查看內核日誌的時間、主機名、進程和信息。 +4. 選中某條日誌後,可查看該日誌的詳細信息,包括進程、時間、主機名和詳細信息。 ![kernlog](fig/kernlog.png) #### 查看啟動日誌 -1. 在日誌查看器界面,單擊 **啟動日誌**。 -2. 彈出「密碼認證」窗口,輸入用戶登錄密碼後單擊 **確定**。 -3. 查看啟動日誌的狀態和訊息。 -4. 選中某條日誌後,可查看該日誌的詳細訊息,包括主機名、狀態和詳細訊息。 +1. 在日誌收集工具界面,單擊 **啟動日誌**。 +2. 彈出“密碼認證”窗口,輸入用户登錄密碼後單擊 **確定**。 +3. 查看啟動日誌的狀態和信息。 +4. 選中某條日誌後,可查看該日誌的詳細信息,包括主機名、狀態和詳細信息。 ![bootlog](fig/bootlog.png) #### 查看dpkg日誌 -1. 在日誌查看器界面,單擊 **dpkg日誌**。 -2. 查看dpkg日誌的時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括主機名、動作、時間和詳細訊息。 +1. 在日誌收集工具界面,單擊 **dpkg日誌**。 +2. 查看dpkg日誌的時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括時間、主機名、動作和詳細信息。 ![dpkglog](fig/dpkglog.png) #### 查看Xorg日誌 -1. 在日誌查看器界面,單擊 **Xorg日誌**。 -2. 查看Xorg日誌的時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括主機名、時間和詳細訊息。 +1. 在日誌收集工具界面,單擊 **Xorg日誌**。 +2. 查看Xorg日誌的時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括時間、主機名和詳細信息。 ![xorglog](fig/xorglog.png) #### 查看應用日誌 -1. 在日誌查看器界面,單擊 **應用日誌**。 -2. 查看應用日誌的級別、時間、來源和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括來源、主機名、時間、級別和詳細訊息。 +1. 在日誌收集工具界面,單擊 **應用日誌**。 +2. 查看應用日誌的級別、時間、來源和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括來源、時間 、主機名、級別和詳細信息。 ![applog](fig/applog.png) #### 查看開關機事件 -1. 在日誌查看器界面,單擊 **開關機事件**。 -2. 查看開關機事件的事件類型、用戶名、時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括時間、主機名、事件類型、用戶名和詳細訊息。 +1. 在日誌收集工具界面,單擊 **開關機事件**。 +2. 查看開關機事件的事件類型、用户名、時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括時間、主機名、事件類型、用户名和詳細信息。 -![powerevent](fig/powerevent.png) +![power_event](fig/power_event.png) +#### 查看其它日誌 + +1. 在日誌收集工具界面,單擊 **其它日誌**。 +2. 其它日誌以文件列表方式展示日誌文件的文件名稱、修改日期。同類日誌文件以文件夾方式展示。 +3. 選中某個文件後,可查看該文件的詳細內容。拖拽文件列表和詳細內容分界線,可以同步調整兩區域大小。 + +![otherslog](fig/otherslog.png) + + + +### 自定義日誌 + +自定義日誌功能是將日誌文件添加至日誌收集工具進行查看、導出。自定義日誌兼容Gsettings配置和Dconfig配置。 + +**Gsettings配置** + +1. 在終端執行Gsettings配置設置命令,“[]”中填寫日誌文件路徑,比如:['a.log','b.log','c.log']。 + +```shell +gsettings set com.deepin.log.viewer customlogfiles [] +``` + +2. 在日誌收集工具界面,單擊**自定義日誌**,即可發現已有配置。 + +**Dconfig配置** + +1. 在終端執行Dconfig配置設置命令,"[]"中填寫日誌文件路徑,比如:["a.log","b.log","c.log"] + +```shell +dde-dconfig --set -a org.deepin.log.viewer -r org.deepin.log.viewer -k customLogFiles -v '["a.log","b.log","c.log"]' +``` + +2. 在日誌收集工具界面,單擊**自定義日誌**,即可發現已有配置。 ### 導出日誌 @@ -149,10 +182,10 @@ 1. 選擇某一日誌類型,單擊界面右上角 **導出** 按鈕。 -2. 如果彈出密碼認證窗口,輸入用戶登錄密碼後單擊 **確定**。 +2. 如果彈出密碼認證窗口,輸入用户登錄密碼後單擊 **確定**。 3. 在彈出的窗口中,選擇存儲位置,單擊 **保存**。 ->![icon](../common/notes.svg) 說明:您也可以單擊標題欄上的全部導出按鈕 ![icon](../common/export.svg),將系統日誌、內核日誌、啟動日誌、dpkg日誌、Xorg日誌、應用日誌和開關機事件的日誌全部導出。 +>![icon](../common/notes.svg) 説明:您也可以單擊標題欄上的全部導出按鈕 ![icon](../common/export.svg),將系統日誌、內核日誌、啟動日誌、dpkg日誌、Xorg日誌、應用日誌和開關機事件的日誌全部導出。 ### 刷新日誌 @@ -165,16 +198,16 @@ #### 自動刷新日誌 1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg) > **刷新頻率**。 -2. 選擇自動刷新的頻率: **每10秒**、**每1分鐘** 或 **每5分鐘**, 刷新日誌。 +2. 選擇自動刷新的頻率:**每10秒**、**每1分鐘** 或 **每5分鐘**, 刷新日誌。 如果選擇 **不刷新**,表示停止自動刷新日誌。 -### 在檔案管理員中顯示 +### 在文件管理器中顯示 -在日誌收集工具中僅內核日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支持 **在檔案管理員中顯示** 的功能。 +在日誌收集工具中僅內核日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支持 **在文件管理器中顯示** 的功能。 1. 在日誌收集工具左側導航欄中,右鍵單擊某一日誌類型。 -2. 選擇 **在檔案管理員中顯示**,定位到當前日誌的存儲位置。 +2. 選擇 **在文件管理器中顯示**,定位到當前日誌的存儲位置。 ![right](fig/rightclick.png) @@ -185,8 +218,8 @@ 在日誌收集工具中僅內核日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支持 **清除日誌** 的功能。 1. 在日誌收集工具左側導航欄中,右鍵單擊某一日誌類型。 2. 選擇 **清除日誌**。 -3. 彈出「確定清除日誌」提示框,單擊 **確定**。 -4. 如果彈出密碼認證窗口,輸入用戶登錄密碼後單擊 **確定**。 +3. 彈出“確定清除日誌”提示框,單擊 **確定**。 +4. 如果彈出密碼認證窗口,輸入用户登錄密碼後單擊 **確定**。 ## 主菜單 @@ -197,27 +230,27 @@ 窗口主題包含淺色主題、深色主題和系統主題。 -1. 在日誌查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 2. 選擇 **主題**,選擇一個主題顏色。 ### 幫助 -查看幫助手冊,進一步了解和使用日誌查看器。 +查看幫助手冊,進一步瞭解和使用日誌收集工具。 -1. 在日誌查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 2. 選擇 **幫助**。 -3. 查看日誌查看器的幫助手冊。 +3. 查看日誌收集工具的幫助手冊。 ### 關於 -1. 在日誌查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 2. 選擇 **關於**。 -3. 查看日誌查看器的版本和介紹。 +3. 查看日誌收集工具的版本和介紹。 ### 退出 -1. 在日誌查看器界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 2. 選擇 **退出**。 diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/applog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/applog.png old mode 100644 new mode 100755 index 5a9385da..b35036a9 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/applog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/applog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/bootlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/bootlog.png old mode 100644 new mode 100755 index 26a0a122..45587c00 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/bootlog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/bootlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/dpkglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/dpkglog.png old mode 100644 new mode 100755 index e701305c..ea64c082 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/dpkglog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/dpkglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_applog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_applog.png deleted file mode 100644 index 8f20c610..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_applog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_applog1.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_applog1.png deleted file mode 100644 index d54d1368..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_applog1.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_bootlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_bootlog.png deleted file mode 100644 index 3c71ab1a..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_bootlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_dnflog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_dnflog.png deleted file mode 100644 index a5eec6ff..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_dnflog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_homepage.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_homepage.png deleted file mode 100644 index 09d172fd..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_homepage.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_kernlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_kernlog.png deleted file mode 100644 index 08f7167c..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_kernlog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_powerevent.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_powerevent.png deleted file mode 100644 index df21db18..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_powerevent.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_rightclick.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_rightclick.png deleted file mode 100644 index 42930572..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_rightclick.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_search.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_search.png deleted file mode 100644 index 01c66159..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_xorglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_xorglog.png deleted file mode 100644 index 24fbc64c..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/eu_xorglog.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/homepage.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/homepage.png deleted file mode 100644 index 7bf392fa..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/homepage.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/kernlog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/kernlog.png old mode 100644 new mode 100755 index 8de722c6..a45fbe88 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/kernlog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/kernlog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/otherslog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/otherslog.png new file mode 100644 index 00000000..855263d6 Binary files /dev/null and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/otherslog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/powerevent.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/powerevent.png deleted file mode 100644 index 96cf9275..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/powerevent.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/rightclick.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/rightclick.png old mode 100644 new mode 100755 index 3974339f..87f0737d Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/rightclick.png and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/rightclick.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/search.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/search.png deleted file mode 100644 index d3025846..00000000 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/search.png and /dev/null differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/xorglog.png b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/xorglog.png old mode 100644 new mode 100755 index 6a7e1256..5ccb2783 Binary files a/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/xorglog.png and b/application/assets/deepin-log-viewer/log-viewer/zh_TW/fig/xorglog.png differ diff --git a/application/assets/deepin-log-viewer/log-viewer/zh_TW/log-viewer.md b/application/assets/deepin-log-viewer/log-viewer/zh_TW/log-viewer.md index 9359ec7d..264a5a58 100644 --- a/application/assets/deepin-log-viewer/log-viewer/zh_TW/log-viewer.md +++ b/application/assets/deepin-log-viewer/log-viewer/zh_TW/log-viewer.md @@ -2,53 +2,53 @@ ## 概述 -日誌收集工具是負責收集程式執行時所產生日誌的小工具,如作業系統和應用程式在啟動、執行等過程中的相關訊息。您可以透過分析詳細日誌訊息,快速的找到故障原因並解決問題。 +日誌收集工具是負責收集程序運行時所產生日誌的小工具,如操作系統和應用程序在啟動、運行等過程中的相關信息。您可以通過分析詳細日誌信息,快速地找到故障原因並解決問題。 ## 使用入門 -您可以透過以下方式執行或關閉日誌收集工具,或者建立捷徑。 +您可以通過以下方式運行或關閉日誌收集工具,或者創建快捷方式。 -### 執行日誌收集工具 +### 運行日誌收集工具 -1. 單擊任務欄上的啟動器圖示 ![deepin_launcher](../common/deepin_launcher.svg) 進入啟動器介面。 -2. 上下滾動滑鼠滾輪瀏覽或透過搜尋,找到日誌收集工具圖示 ![deepin_log_viewer](../common/deepin_log_viewer.svg),單擊執行。 +1. 單擊任務欄上的啟動器圖標 ![deepin_launcher](../common/deepin_launcher.svg),進入啟動器界面。 +2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到日誌收集工具圖標 ![deepin_log_viewer](../common/deepin_log_viewer.svg),單擊運行。 3. 右鍵單擊 ![deepin_log_viewer](../common/deepin_log_viewer.svg),您可以: - - 單擊 **建立桌面捷徑**,在桌面建立捷徑。 - - 單擊 **釘選到Dock**,將應用程式固定到Dock。 - - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動執行該應用程式。 + - 單擊 **發送到桌面**,在桌面創建快捷方式。 + - 單擊 **發送到任務欄**,將應用程序固定到任務欄。 + - 單擊 **開機自動啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用程序。 ### 關閉日誌收集工具 -- 在日誌收集工具介面,單擊 ![close_icon](../common/close_icon.svg),關閉日誌收集工具。 -- 右鍵單擊任務欄上的 ![deepin_log_viewer](../common/deepin_log_viewer.svg) 圖示,選擇 **全部關閉** 來關閉日誌收集工具。 -- 在日誌收集工具介面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出** 來關閉日誌收集工具。 +- 在日誌收集工具界面,單擊 ![close_icon](../common/close_icon.svg),退出日誌收集工具。 +- 在任務欄上右鍵單擊 ![deepin_log_viewer](../common/deepin_log_viewer.svg) ,選擇 **關閉所有**,退出日誌收集工具。 +- 在日誌收集工具界面單擊 ![icon_menu](../common/icon_menu.svg),選擇 **退出**,退出日誌收集工具。 ## 操作介紹 -### 搜尋日誌 +### 搜索日誌 -1. 在日誌收集工具搜尋框中,單擊 ![search](../common/search.svg)。 -2. 輸入關鍵字,即時顯示搜尋結果。 -3. 單擊 ![close_icon](../common/close_icon.svg) ,則清空搜尋內容。 +1. 在日誌收集工具搜索框中,單擊 ![search](../common/search.svg)。 +2. 輸入關鍵字,實時顯示搜索結果。 +3. 單擊 ![close_icon](../common/close_icon.svg) ,則清空搜索內容。 ### 篩選日誌 -您可以透過 **週期**、**級別**、**狀態**、**應用列表** 或 **事件類型** 來篩選日誌。 +您可以通過 **週期**、**級別**、**狀態**、**應用列表** 或 **事件類型** 來篩選日誌。 - + @@ -56,25 +56,25 @@ + 適用類型:僅適用於應用日誌,對應用程序的log文件進行篩選,默認選項為第一個應用程序。 @@ -82,141 +82,175 @@
篩選類型類型 說明
按週期篩選 按日誌生成的時間順序進行篩選。
    -
  • 選項包括:全部、今天、近三天、近一週、近一個月、近三個月,預設選項為全部。
  • -
  • 適用類型:除了啟動日誌沒有顯示時間外,其他類型的日誌都支援按週期篩選。
  • +
  • 選項包括:全部、今天、近三天、近一週、近一個月、近三個月,默認選項為全部。
  • +
  • 適用類型:除了啟動日誌沒有顯示時間外,其他類型的日誌都支持按週期篩選。
按級別篩選 按照事件的級別高低進行篩選。
    -
  • 選項包括:全部、緊急、嚴重警告、嚴重、錯誤、警告、注意、訊息、除錯,預設選項為訊息。
  • +
  • 選項包括:全部、緊急、嚴重警告、嚴重、錯誤、警告、注意、信息、調試,默認選項為信息。
  • 適用類型:系統日誌、應用日誌。
按狀態篩選
    -
  • 選項包括:全部、OK、Failed,預設選項為全部。
  • +
  • 選項包括:全部、OK、Failed,默認選項為全部。
  • 適用類型:僅適用於啟動日誌。
按應用列表篩選 - 適用類型:僅適用於應用日誌,對應用程式的log文件進行篩選,預設選項為第一個應用程式。
按事件類型篩選
    -
  • 選項包括:全部、登入、開機、關機,預設選項為全部。
  • +
  • 選項包括:全部、登錄、開機、關機,默認選項為全部。
  • 適用類型:僅適用於開關機事件。
- - ### 查看日誌 #### 查看系統日誌 -1. 在日誌收集工具介面,單擊 **系統日誌**。 -2. 查看系統日誌的級別、行程、時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括行程、時間、主機名稱、行程號、級別和詳細訊息。 +1. 在日誌收集工具界面,單擊 **系統日誌**。 +2. 查看系統日誌的級別、進程、時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括進程、時間、主機名、進程號、級別和詳細信息。 -![0|rsylog](fig/homepage.png) +![rsylog](fig/syslog.png) -#### 查看核心日誌 +#### 查看內核日誌 -1. 在日誌收集工具介面,單擊 **核心日誌**。 -2. 在彈出的授權對話框中,輸入使用者登入密碼完成授權。 -3. 查看核心日誌的時間、主機名稱、行程和訊息。 -4. 選中某條日誌後,可查看該日誌的詳細訊息,包括行程、時間、主機名稱和詳細訊息。 +1. 在日誌收集工具界面,單擊 **內核日誌**。 +2. 彈出“密碼認證”窗口,輸入用戶登錄密碼後單擊 **確定**。 +3. 查看內核日誌的時間、主機名、進程和信息。 +4. 選中某條日誌後,可查看該日誌的詳細信息,包括進程、時間、主機名和詳細信息。 -![0|kernlog](fig/kernlog.png) +![kernlog](fig/kernlog.png) #### 查看啟動日誌 -1. 在日誌收集工具介面,單擊 **啟動日誌**。 -2. 在彈出的授權對話框中,輸入使用者登入密碼完成授權。 -3. 查看啟動日誌的狀態和訊息。 -4. 選中某條日誌後,可查看該日誌的詳細訊息,包括主機名稱、狀態和詳細訊息。 +1. 在日誌收集工具界面,單擊 **啟動日誌**。 +2. 彈出“密碼認證”窗口,輸入用戶登錄密碼後單擊 **確定**。 +3. 查看啟動日誌的狀態和信息。 +4. 選中某條日誌後,可查看該日誌的詳細信息,包括主機名、狀態和詳細信息。 -![0|bootlog](fig/bootlog.png) +![bootlog](fig/bootlog.png) #### 查看dpkg日誌 -1. 在日誌收集工具介面,單擊 **dpkg日誌**。 -2. 查看dpkg日誌的時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括時間、主機名稱、動作和詳細訊息。 +1. 在日誌收集工具界面,單擊 **dpkg日誌**。 +2. 查看dpkg日誌的時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括時間、主機名、動作和詳細信息。 -![0|dpkglog](fig/dpkglog.png) +![dpkglog](fig/dpkglog.png) #### 查看Xorg日誌 -1. 在日誌收集工具介面,單擊 **Xorg日誌**。 -2. 查看Xorg日誌的時間和訊息。 -3. 選中某條日誌後,列表下方會顯示該日誌的詳細訊息,包括時間、主機名稱和詳細訊息。 +1. 在日誌收集工具界面,單擊 **Xorg日誌**。 +2. 查看Xorg日誌的時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括時間、主機名和詳細信息。 -![0|xorglog](fig/xorglog.png) +![xorglog](fig/xorglog.png) -#### 查看應用程式日誌 +#### 查看應用日誌 -1. 在日誌收集工具介面,單擊**應用程式日誌**。 -2. 查看應用日誌的級別、時間、來源和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括來源、時間 、主機名稱、級別和詳細訊息。 +1. 在日誌收集工具界面,單擊 **應用日誌**。 +2. 查看應用日誌的級別、時間、來源和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括來源、時間 、主機名、級別和詳細信息。 -![0|applog](fig/applog.png) +![applog](fig/applog.png) #### 查看開關機事件 -1. 在日誌收集工具介面,單擊 **開關機事件**。 -2. 查看開關機事件的事件類型、使用者名稱、時間和訊息。 -3. 選中某條日誌後,可查看該日誌的詳細訊息,包括時間、主機名稱、事件類型、使用者名稱和詳細訊息。 +1. 在日誌收集工具界面,單擊 **開關機事件**。 +2. 查看開關機事件的事件類型、用戶名、時間和信息。 +3. 選中某條日誌後,可查看該日誌的詳細信息,包括時間、主機名、事件類型、用戶名和詳細信息。 + +![power_event](fig/power_event.png) + +#### 查看其它日誌 + +1. 在日誌收集工具界面,單擊 **其它日誌**。 +2. 其它日誌以文件列表方式展示日誌文件的文件名稱、修改日期。同類日誌文件以文件夾方式展示。 +3. 選中某個文件後,可查看該文件的詳細內容。拖拽文件列表和詳細內容分界線,可以同步調整兩區域大小。 + +![otherslog](fig/otherslog.png) + + + +### 自定義日誌 -![0|power event](fig/powerevent.png) +自定義日誌功能是將日誌文件添加至日誌收集工具進行查看、導出。自定義日誌兼容Gsettings配置和Dconfig配置。 +**Gsettings配置** +1. 在終端執行Gsettings配置設置命令,“[]”中填寫日誌文件路徑,比如:['a.log','b.log','c.log']。 -### 匯出日誌 +```shell +gsettings set com.deepin.log.viewer customlogfiles [] +``` -匯出日誌功能是將日誌查詢結果匯出到本機,幫助您分析、定位和解決問題。 +2. 在日誌收集工具界面,單擊**自定義日誌**,即可發現已有配置。 +**Dconfig配置** -1. 選擇某一日誌類型,單擊介面右上角 **匯出** 按鈕。 -2. 如果彈出密碼認證視窗,輸入使用者登入密碼後單擊 **確定**。 -3. 在彈出的視窗中,選擇儲存位置,單擊 **儲存**。 +1. 在終端執行Dconfig配置設置命令,"[]"中填寫日誌文件路徑,比如:["a.log","b.log","c.log"] ->![icon](../common/notes.svg) 說明:您也可以單擊標題欄上的全部匯出按鈕 ![icon](../common/export.svg),將系統日誌、核心日誌、啟動日誌、dpkg日誌、Xorg日誌、應用程式日誌和開關機事件的日誌全部匯出。 +```shell +dde-dconfig --set -a org.deepin.log.viewer -r org.deepin.log.viewer -k customLogFiles -v '["a.log","b.log","c.log"]' +``` -### 重新整理日誌 +2. 在日誌收集工具界面,單擊**自定義日誌**,即可發現已有配置。 -重新整理日誌分為手動重新整理和自動重新整理,如果是自動重新整理日誌,還可以設定自動重新整理的頻率。 +### 導出日誌 -#### 手動重新整理日誌 +導出日誌功能是將日誌查詢結果導出到本地,幫助您分析、定位和解決問題。 -單擊標題欄上的立即重新整理按鈕 ![icon](../common/refresh.svg);或右鍵單擊某一日誌類型,選擇 **重新整理**,重新整理日誌。 -#### 自動重新整理日誌 +1. 選擇某一日誌類型,單擊界面右上角 **導出** 按鈕。 +2. 如果彈出密碼認證窗口,輸入用戶登錄密碼後單擊 **確定**。 +3. 在彈出的窗口中,選擇存儲位置,單擊 **保存**。 -1. 在日誌收集工具介面,單擊 ![icon_menu](../common/icon_menu.svg) > **重新整理頻率**。 -2. 選擇自動重新整理的頻率: **每10秒**、**每1分鐘** 或 **每5分鐘**, 重新整理日誌。如果選擇 **不重新整理**,表示停止自動重新整理日誌。 +>![icon](../common/notes.svg) 說明:您也可以單擊標題欄上的全部導出按鈕 ![icon](../common/export.svg),將系統日誌、內核日誌、啟動日誌、dpkg日誌、Xorg日誌、應用日誌和開關機事件的日誌全部導出。 -### 在檔案管理器中顯示 +### 刷新日誌 -在日誌收集工具中僅核心日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支援 **在檔案管理器中顯示** 的功能。 +刷新日誌分為手動刷新和自動刷新,如果是自動刷新日誌,還可以設置自動刷新的頻率。 + +#### 手動刷新日誌 + +單擊標題欄上的立即刷新按鈕 ![icon](../common/refresh.svg);或右鍵單擊某一日誌類型,選擇 **刷新**,刷新日誌。 + +#### 自動刷新日誌 + +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg) > **刷新頻率**。 +2. 選擇自動刷新的頻率:**每10秒**、**每1分鐘** 或 **每5分鐘**, 刷新日誌。 + + 如果選擇 **不刷新**,表示停止自動刷新日誌。 + +### 在文件管理器中顯示 + +在日誌收集工具中僅內核日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支持 **在文件管理器中顯示** 的功能。 1. 在日誌收集工具左側導航欄中,右鍵單擊某一日誌類型。 -2. 選擇 **在檔案管理器中顯示**,定位到目前日誌的儲存位置。 +2. 選擇 **在文件管理器中顯示**,定位到當前日誌的存儲位置。 + + +![right](fig/rightclick.png) -![0|power event](fig/rightclick.png) ### 清除日誌 -在日誌收集工具中僅核心日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支援 **清除日誌** 的功能。 +在日誌收集工具中僅內核日誌、啟動日誌、dpkg日誌、Xorg日誌和應用日誌支持 **清除日誌** 的功能。 1. 在日誌收集工具左側導航欄中,右鍵單擊某一日誌類型。 2. 選擇 **清除日誌**。 -3. 在彈出的對話框中單擊 **確定**。 -4. 如果彈出密碼授權視窗,請輸入密碼完成操作。 +3. 彈出“確定清除日誌”提示框,單擊 **確定**。 +4. 如果彈出密碼認證窗口,輸入用戶登錄密碼後單擊 **確定**。 -## 主選單 +## 主菜單 -在主選單中,您可以[設定重新整理頻率](#自動重新整理日誌)、切換視窗主題、查看說明手冊等。 +在主菜單中,您可以 [設置刷新頻率](#自動刷新日誌)、切換窗口主題,查看幫助手冊等。 ### 主題 -視窗主題包含亮色主題、暗色主題和系統主題。 +窗口主題包含淺色主題、深色主題和系統主題。 -1. 在日誌收集工具介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **主題**,選擇一個主題顏色。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **主題**,選擇一個主題顏色。 -### 說明 +### 幫助 -查看說明手冊,進一步了解和使用日誌收集工具。 +查看幫助手冊,進一步瞭解和使用日誌收集工具。 -1. 在日誌收集工具介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **說明**。 -3. 查看日誌收集工具的說明手冊。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **幫助**。 +3. 查看日誌收集工具的幫助手冊。 ### 關於 -1. 在日誌收集工具介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **關於**。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **關於**。 3. 查看日誌收集工具的版本和介紹。 ### 退出 -1. 在日誌收集工具介面,單擊 ![icon_menu](../common/icon_menu.svg)。 -2. 單擊 **退出**。 +1. 在日誌收集工具界面,單擊 ![icon_menu](../common/icon_menu.svg)。 +2. 選擇 **退出**。 diff --git a/application/assets/deepin-logger b/application/assets/deepin-logger new file mode 100644 index 00000000..df40bd00 --- /dev/null +++ b/application/assets/deepin-logger @@ -0,0 +1,11 @@ +#!/bin/bash +# this is deepin-log-viewer-cli adapter. + +para=$* +CMDPATTERN="^-" + +if [[ "$para" =~ $CMDPATTERN ]]; then + deepin-log-viewer ${para} +else + deepin-log-viewer -h +fi \ No newline at end of file diff --git a/application/cliapplicationhelper.cpp b/application/cliapplicationhelper.cpp new file mode 100644 index 00000000..0b05d775 --- /dev/null +++ b/application/cliapplicationhelper.cpp @@ -0,0 +1,203 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "cliapplicationhelper.h" + +#include + +#include +#include +#include +#include +#include +#include + +using HelperCreator = CliApplicationHelper::HelperCreator; + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(dgAppHelper, "org.deepin.logger") +#else +Q_LOGGING_CATEGORY(dgAppHelper, "org.deepin.logger", QtInfoMsg) +#endif + +Q_GLOBAL_STATIC(QLocalServer, _d_singleServer) + +/*! + @brief cli程序单实例类 + @private + */ +class _CliApplicationHelper +{ +public: +#define INVALID_HELPER reinterpret_cast(1) + inline CliApplicationHelper *helper() + { + // 临时存储一个无效的指针值, 用于此处条件变量的竞争 + if (m_helper.testAndSetRelaxed(nullptr, INVALID_HELPER)) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + m_helper.storeRelaxed(creator()); + } + return m_helper.loadRelaxed(); +#else + m_helper.store(creator()); + } + return m_helper.load(); +#endif + } + + inline void clear() + { + if (m_helper != INVALID_HELPER) + delete m_helper.fetchAndStoreRelaxed(nullptr); + } + + static CliApplicationHelper *defaultCreator() + { + return new CliApplicationHelper(); + } + + QAtomicPointer m_helper; + static HelperCreator creator; +}; + +HelperCreator _CliApplicationHelper::creator = _CliApplicationHelper::defaultCreator; +static quint8 _d_singleServerVersion = 1; +Q_GLOBAL_STATIC(_CliApplicationHelper, _globalHelper) +int CliApplicationHelper::waitTime = 3000; + + +bool CliApplicationHelper::setSingleInstance(const QString &key, CliApplicationHelper::SingleScope singleScope) +{ + bool new_server = !_d_singleServer.exists(); + + if (_d_singleServer->isListening()) { + _d_singleServer->close(); + } + + QString socket_key = "_d_deepin_logger_single_instance_"; + + switch (singleScope) { + case GroupScope: + _d_singleServer->setSocketOptions(QLocalServer::GroupAccessOption); +#ifdef Q_OS_LINUX + socket_key += QString("%1_").arg(getgid()); +#endif + break; + case WorldScope: + _d_singleServer->setSocketOptions(QLocalServer::WorldAccessOption); + break; + default: + _d_singleServer->setSocketOptions(QLocalServer::UserAccessOption); +#ifdef Q_OS_LINUX + socket_key += QString("%1_").arg(getuid()); +#endif + break; + } + + socket_key += key; + QString lockfile = socket_key; + if (!lockfile.startsWith(QLatin1Char('/'))) { + lockfile = QDir::cleanPath(QDir::tempPath()); + lockfile += QLatin1Char('/') + socket_key; + } + lockfile += QStringLiteral(".lock"); + static QScopedPointer lock(new QLockFile(lockfile)); + // 同一个进程多次调用本接口使用最后一次设置的 key + // FIX dcc 使用不同的 key 两次调用 setSingleInstance 后无法启动的问题 + qint64 tpid = -1; + QString hostname, appname; + if (lock->isLocked() && lock->getLockInfo(&tpid, &hostname, &appname) && tpid == getpid()) { + qCWarning(dgAppHelper) << "call setSingleInstance again within the same process"; + lock->unlock(); + lock.reset(new QLockFile(lockfile)); + } + + if (!lock->tryLock()) { + qCDebug(dgAppHelper) << "===> new client <===" << getpid(); + // 通知别的实例 + QLocalSocket socket; + socket.connectToServer(socket_key); + + // 等待到有效数据时认为server实例有效 + if (socket.waitForConnected(CliApplicationHelper::waitTime) && + socket.waitForReadyRead(CliApplicationHelper::waitTime)) { + // 读取数据 + qint8 version; + qint64 pid; + QStringList arguments; + + QDataStream ds(&socket); + ds >> version >> pid >> arguments; + qCInfo(dgAppHelper) << "Process is started: pid=" << pid << "arguments=" << arguments; + + // 把自己的信息告诉第一个实例 + ds << _d_singleServerVersion << qApp->applicationPid() << qApp->arguments(); + socket.flush(); + } + + return false; + } + + if (!_d_singleServer->listen(socket_key)) { + qCWarning(dgAppHelper) << "listen failed:" << _d_singleServer->errorString(); + return false; + } + + if (new_server) { + QObject::connect(_d_singleServer, &QLocalServer::newConnection, qApp, [] { + QLocalSocket *instance = _d_singleServer->nextPendingConnection(); + // 先发送数据告诉新的实例自己收到了它的请求 + QDataStream ds(instance); + ds << _d_singleServerVersion // 协议版本 + << qApp->applicationPid() // 进程id + << qApp->arguments(); // 启动时的参数 + + QObject::connect(instance, &QLocalSocket::readyRead, qApp, [instance] { + // 读取数据 + QDataStream ds(instance); + + qint8 version; + qint64 pid; + QStringList arguments; + + ds >> version >> pid >> arguments; + instance->close(); + + qCInfo(dgAppHelper) << "New instance: pid=" << pid << "arguments=" << arguments; + + // 通知新进程的信息 + if (_globalHelper.exists() && _globalHelper->helper()) + Q_EMIT _globalHelper->helper()->newProcessInstance(pid, arguments); + }); + + instance->flush(); //发送数据给新的实例 + }); + } + + return true; +} + +CliApplicationHelper::CliApplicationHelper() + : QObject(nullptr) +{ + // 跟随application销毁 + qAddPostRoutine(staticCleanApplication); +} + +CliApplicationHelper::~CliApplicationHelper() +{ + _globalHelper->m_helper = nullptr; +} + + +void CliApplicationHelper::staticCleanApplication() +{ + if (_globalHelper.exists()) + _globalHelper->clear(); +} + +CliApplicationHelper *CliApplicationHelper::instance() +{ + return _globalHelper->helper(); +} diff --git a/application/cliapplicationhelper.h b/application/cliapplicationhelper.h new file mode 100644 index 00000000..cd6381f1 --- /dev/null +++ b/application/cliapplicationhelper.h @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef CLIAPPLICATION_H +#define CLIAPPLICATION_H + +#include +#include + +// cli程序单实例类 +class CliApplicationHelper : public QObject +{ + Q_OBJECT +public: + enum SingleScope { + UserScope, + GroupScope, + WorldScope + }; + + typedef CliApplicationHelper *(*HelperCreator)(); + + static void staticCleanApplication(); + static CliApplicationHelper *instance(); + + explicit CliApplicationHelper(); + ~CliApplicationHelper(); + + static bool setSingleInstance(const QString &key, SingleScope singleScope = UserScope); + + // 获取QLocalSever消息的等待时间 + static int waitTime; + +Q_SIGNALS: + void newProcessInstance(qint64 pid, const QStringList &arguments); +}; + +#endif // CLIAPPLICATION_H diff --git a/application/configs/coredump-reporter.service b/application/configs/coredump-reporter.service new file mode 100644 index 00000000..cb456f34 --- /dev/null +++ b/application/configs/coredump-reporter.service @@ -0,0 +1,11 @@ +[Unit] +Description=deepin-log-viewer coredump report activities + +[Service] + +ExecStart=/usr/bin/deepin-log-viewer --reportcoredump +CapabilityBoundingSet=~ +MemoryLimit=8G + +[Install] +WantedBy=multi-user.target diff --git a/application/configs/coredump-reporter.timer b/application/configs/coredump-reporter.timer new file mode 100644 index 00000000..b5d04dbb --- /dev/null +++ b/application/configs/coredump-reporter.timer @@ -0,0 +1,10 @@ +[Unit] +Description=deepin-log-viewer coredump report timer + +[Timer] +Unit=coredump-reporter.service +OnUnitActiveSec=15m +OnBootSec=5m + +[Install] +WantedBy=timers.target diff --git a/application/configs/dconfig/org.deepin.log.viewer.json b/application/configs/dconfig/org.deepin.log.viewer.json new file mode 100644 index 00000000..7801ad31 --- /dev/null +++ b/application/configs/dconfig/org.deepin.log.viewer.json @@ -0,0 +1,57 @@ +{ + "magic": "dsg.config.meta", + "version": "1.0", + "contents": { + "customLogFiles": { + "value": [], + "serial": 0, + "flags": ["global"], + "name": "Show extra logs", + "name[zh_CN]": "显示额外日志", + "description": "此配置项默认为空。如需在日志收集工具显示额外日志,请配置对应日志文件的绝对路径。需保证操作者具备读取权限。例如:[\"a.log\",\"b.log\",\"c.log\"]。", + "permissions": "readwrite", + "visibility": "private" + }, + "coredumpReportTime": { + "value": "", + "serial": 0, + "flags": ["global"], + "name": "Coredump report time", + "name[zh_CN]": "最近一次上报成功的崩溃信息时间点", + "description": "The time point of the last successful crash report", + "permissions": "readwrite", + "visibility": "private" + }, + "coredumpReportMax": { + "value": 50, + "serial": 0, + "flags": ["global"], + "name": "Coredump report max", + "name[zh_CN]": "一次上报的崩溃信息最大条数", + "description": "The maximum number of crash messages reported at once", + "permissions": "readwrite", + "visibility": "private" + }, + "specialComType": { + "value": -1, + "serial": 0, + "flags": ["global"], + "name": "Special Computer Type", + "name[zh_CN]": "特殊机器类型", + "description": "Is it a special computer type? like huawei", + "permissions": "readwrite", + "visibility": "private" + }, + "log_rules": { + "value": "*.debug=false;*.info=false;*log.viewer*.warning=true", + "serial": 0, + "flags": ["global"], + "name": "log rules", + "name[zh_CN]": "日志规则", + "description": "log rules", + "description[zh_CN]": "日志规则", + "permissions": "readwrite", + "visibility": "public" + } + } +} diff --git a/application/configs/debugconfig/org.deepin.log.viewer.json b/application/configs/debugconfig/org.deepin.log.viewer.json new file mode 100644 index 00000000..b4b9a818 --- /dev/null +++ b/application/configs/debugconfig/org.deepin.log.viewer.json @@ -0,0 +1,12 @@ +{ + "name": "deepin-log-viewer", + "group": "", + "submodules": [ + { + "name": "deepin-log-viewer", + "exec": "deepin-log-viewer_debug.sh" + } + ], + "reboot": 0, + "version": "V1.0" +} diff --git a/application/configs/logconfig/deepin-log-viewer.json b/application/configs/logconfig/deepin-log-viewer.json new file mode 100644 index 00000000..65b5f2ee --- /dev/null +++ b/application/configs/logconfig/deepin-log-viewer.json @@ -0,0 +1,22 @@ +{ + "name": "deepin-log-viewer", + "group": "", + "submodules": [ + { + "name": "deepin-log-viewer", + "filter": "", + "exec": "/usr/bin/deepin-log-viewer", + "logType": "journal", + "logPath": "" + }, + { + "name": "log-view-service-file", + "filter": "", + "exec": "/usr/lib/deepin-daemon/log-view-service", + "logType": "file", + "logPath": "/var/log/deepin/deepin-log-viewer-service/deepin-log-viewer-service.log" + } + ], + "visible": true, + "version": "V2.0" +} diff --git a/application/configs/org.deepin.deepin-log-viewer.json b/application/configs/org.deepin.deepin-log-viewer.json deleted file mode 100644 index 5b7dbfdd..00000000 --- a/application/configs/org.deepin.deepin-log-viewer.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "magic": "dsg.config.meta", - "version": "1.0", - "contents": { - "customLogFiles": { - "value": [], - "serial": 0, - "flags": ["global"], - "name": "Show extra logs", - "name[zh_CN]": "显示额外日志", - "description": "此配置项默认为空。如需在日志收集工具显示额外日志,请配置对应日志文件的绝对路径。需保证操作者具备读取权限。例如:[\"a.log\",\"b.log\",\"c.log\"]。", - "permissions": "readwrite", - "visibility": "private" - } - } -} diff --git a/application/dbusmanager.cpp b/application/dbusmanager.cpp index 89dc7dab..8b5bd7e3 100644 --- a/application/dbusmanager.cpp +++ b/application/dbusmanager.cpp @@ -1,14 +1,24 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dbusmanager.h" +#include "utils.h" +#include +#include #include +#include #include +#include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logDBusManager, "org.deepin.log.viewer.dbus.manager") +#else +Q_LOGGING_CATEGORY(logDBusManager, "org.deepin.log.viewer.dbus.manager", QtInfoMsg) +#endif -bool DBusManager::isGetedKlu = false; -QString DBusManager::isklusystemName = ""; /** * @brief DBusManager::DBusManager * dbus接口获取工具类 @@ -19,18 +29,58 @@ DBusManager::DBusManager(QObject *parent) : QObject(parent) } -/** - * @brief DBusManager::getSystemInfo - * 通过dBus接口获取系统是否为klu/pangu/panguV - * @return 返回klu/pangu/panguV或者空,如果没有此dbus接口也返回空,返回空表示不是klu/pangu/panguV - */ -QString DBusManager::getSystemInfo() +bool DBusManager::isSEOpen() +{ + bool bIsSEOpen = false; + QDBusInterface interfaceSE("com.deepin.daemon.SecurityEnhance", "/com/deepin/daemon/SecurityEnhance", "com.deepin.daemon.SecurityEnhance", QDBusConnection::systemBus()); + if (interfaceSE.isValid()) { + QDBusReply reply = interfaceSE.call(QStringLiteral("Status")); + if (!reply.error().message().isEmpty()) + qCWarning(logDBusManager) << qPrintable(QString("com.deepin.daemon.SecurityEnhance.Status DBus error: %1").arg(reply.error().message())); + + if (reply.value() == "close") + bIsSEOpen = false; + else + bIsSEOpen = true; + } else { + qCWarning(logDBusManager) << qPrintable(QString("isSEOpen failed! interface error: %1").arg(interfaceSE.lastError().message())); + } + + return bIsSEOpen; +} + +bool DBusManager::isAuditAdmin() { - if (!isGetedKlu) { - isklusystemName = QDBusInterface("com.deepin.system.SystemInfo", "/com/deepin/system/SystemInfo", "com.deepin.system.SystemInfo", QDBusConnection::systemBus()) - .property("ProductName") - .toString(); - isGetedKlu = true; + bool bIsAuditAdmin = false; + + // 获取当前系统用户名 + struct passwd* pwd = getpwuid(getuid()); + QString currentUserName = pwd->pw_name; + + // 根据用户名判断用户身份,查看是否为审计管理员 + QDBusInterface interfaceSE("com.deepin.daemon.SecurityEnhance", "/com/deepin/daemon/SecurityEnhance", "com.deepin.daemon.SecurityEnhance", QDBusConnection::systemBus()); + if (interfaceSE.isValid()) { + QDBusReply reply = interfaceSE.call(QStringLiteral("GetSEUserByName"), currentUserName); + if (!reply.error().message().isEmpty()) + qCWarning(logDBusManager) << qPrintable(QString("com.deepin.daemon.SecurityEnhance.GetSEUserByName DBus error: %1").arg(reply.error().message())); + + if (reply.value() == "audadm_u" || reply.value() == "auditadm_u") + bIsAuditAdmin = true; + } else { + qCWarning(logDBusManager) << qPrintable(QString("isAuditAdmin failed! interface error: %1").arg(interfaceSE.lastError().message())); } - return isklusystemName; + + return bIsAuditAdmin; +} + +QString DBusManager::getHomePathByFreeDesktop() +{ + QString homePath; + QDBusInterface interface("org.freedesktop.login1", "/org/freedesktop/login1/user/self", "org.freedesktop.login1.User", QDBusConnection::systemBus()); + QString userName = qvariant_cast(interface.property("Name")); + + if (!userName.isEmpty()) + homePath = "/home/" + userName; + + return homePath; } diff --git a/application/dbusmanager.h b/application/dbusmanager.h index 39a34ede..aae3fe24 100644 --- a/application/dbusmanager.h +++ b/application/dbusmanager.h @@ -15,10 +15,12 @@ class DBusManager : public QObject Q_OBJECT public: explicit DBusManager(QObject *parent = nullptr); - static QString getSystemInfo(); - static bool isGetedKlu ; - static QString isklusystemName ; - + // 是否开启等保四 + static bool isSEOpen(); + // 开启等保四情况下,判断是否为审计管理员身份 + static bool isAuditAdmin(); + // 利用freedeskop获取当前用户家目录路径 + static QString getHomePathByFreeDesktop(); signals: public slots: diff --git a/application/dbusproxy/dldbushandler.cpp b/application/dbusproxy/dldbushandler.cpp index 0e1deebe..dffb5cc0 100644 --- a/application/dbusproxy/dldbushandler.cpp +++ b/application/dbusproxy/dldbushandler.cpp @@ -1,10 +1,17 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "dldbushandler.h" #include #include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logDBusHandler, "org.deepin.log.viewer.dbus.handler") +#else +Q_LOGGING_CATEGORY(logDBusHandler, "org.deepin.log.viewer.dbus.handler", QtInfoMsg) +#endif DLDBusHandler *DLDBusHandler::m_statichandeler = nullptr; @@ -30,9 +37,9 @@ DLDBusHandler::DLDBusHandler(QObject *parent) this); //Note: when dealing with remote objects, it is not always possible to determine if it exists when creating a QDBusInterface. if (!m_dbus->isValid() && !m_dbus->lastError().message().isEmpty()) { - qDebug() << "m_dbus isValid false error:" << m_dbus->lastError() << m_dbus->lastError().message(); + qCCritical(logDBusHandler) << "dbus com.deepin.logviewer isValid false error:" << m_dbus->lastError() << m_dbus->lastError().message(); } - qDebug() << "m_dbus isValid true"; + qCDebug(logDBusHandler) << "dbus com.deepin.logviewer isValid true"; } /*! @@ -45,6 +52,18 @@ QString DLDBusHandler::readLog(const QString &filePath) return m_dbus->readLog(filePath); } +/*! + * \~chinese \brief DLDBusHandler::readLogLinesInRange 获取指定行数范围的日志内容,默认读取500条数据 + * \~chinese \param filePath 文件路径 + * \~chinese \param startLine 起始行 + * \~chinese \param lineCount 获取行数 + * \~chinese \return 读取的日志 + */ +QStringList DLDBusHandler::readLogLinesInRange(const QString &filePath, qint64 startLine, qint64 lineCount, bool bReverse) +{ + return m_dbus->readLogLinesInRange(filePath, startLine, lineCount, bReverse); +} + QString DLDBusHandler::openLogStream(const QString &filePath) { return m_dbus->openLogStream(filePath); @@ -55,6 +74,11 @@ QString DLDBusHandler::readLogInStream(const QString &token) return m_dbus->readLogInStream(token); } +QStringList DLDBusHandler::whiteListOutPaths() +{ + return m_dbus->whiteListOutPaths(); +} + /*! * \~chinese \brief DLDBusHandler::exitCode 返回进程状态 * \~chinese \return 进程返回值 @@ -77,7 +101,7 @@ QStringList DLDBusHandler::getFileInfo(const QString &flag, bool unzip) QDBusPendingReply reply = m_dbus->getFileInfo(flag, unzip); reply.waitForFinished(); if (reply.isError()) { - qDebug() << reply.error().message(); + qCWarning(logDBusHandler) << "call dbus iterface 'getFileInfo()' failed. error info:" << reply.error().message(); } else { filePath = reply.value(); } @@ -90,7 +114,7 @@ QStringList DLDBusHandler::getOtherFileInfo(const QString &flag, bool unzip) reply.waitForFinished(); QStringList filePathList; if (reply.isError()) { - qDebug() << reply.error().message(); + qCWarning(logDBusHandler) << "call dbus iterface 'getOtherFileInfo()' failed. error info:" << reply.error().message(); } else { filePathList = reply.value(); } @@ -102,3 +126,23 @@ bool DLDBusHandler::exportLog(const QString &outDir, const QString &in, bool isF { return m_dbus->exportLog(outDir, in, isFile); } + +bool DLDBusHandler::isFileExist(const QString &filePath) +{ + return m_dbus->isFileExist(filePath); +} + +quint64 DLDBusHandler::getFileSize(const QString &filePath) +{ + return m_dbus->getFileSize(filePath); +} + +qint64 DLDBusHandler::getLineCount(const QString &filePath) +{ + return m_dbus->getLineCount(filePath); +} + +QString DLDBusHandler::executeCmd(const QString &cmd) +{ + return m_dbus->executeCmd(cmd); +} diff --git a/application/dbusproxy/dldbushandler.h b/application/dbusproxy/dldbushandler.h index 5c49e36f..62f9052f 100644 --- a/application/dbusproxy/dldbushandler.h +++ b/application/dbusproxy/dldbushandler.h @@ -15,13 +15,19 @@ class DLDBusHandler : public QObject static DLDBusHandler *instance(QObject *parent = nullptr); ~DLDBusHandler(); QString readLog(const QString &filePath); + QStringList readLogLinesInRange(const QString &filePath, qint64 startLine = 0, qint64 lineCount = 500, bool bReverse = true); QStringList getFileInfo(const QString &flag, bool unzip = true); QStringList getOtherFileInfo(const QString &flag, bool unzip = true); int exitCode(); void quit(); bool exportLog(const QString &outDir, const QString &in, bool isFile); + bool isFileExist(const QString &filePath); + quint64 getFileSize(const QString &filePath); + qint64 getLineCount(const QString &filePath); + QString executeCmd(const QString &cmd); QString openLogStream(const QString &filePath); QString readLogInStream(const QString &token); + QStringList whiteListOutPaths(); private: explicit DLDBusHandler(QObject *parent = nullptr); diff --git a/application/dbusproxy/dldbusinterface.h b/application/dbusproxy/dldbusinterface.h index 22b27057..2e29a4d8 100644 --- a/application/dbusproxy/dldbusinterface.h +++ b/application/dbusproxy/dldbusinterface.h @@ -78,6 +78,13 @@ public Q_SLOTS: // METHODS return asyncCallWithArgumentList(QStringLiteral("readLog"), argumentList); } + inline QDBusPendingReply readLogLinesInRange(const QString &filePath, qint64 startLine, qint64 lineCount, bool bReverse) + { + QList argumentList; + argumentList << QVariant::fromValue(filePath) << QVariant::fromValue(startLine) << QVariant::fromValue(lineCount) << QVariant::fromValue(bReverse); + return asyncCallWithArgumentList(QStringLiteral("readLogLinesInRange"), argumentList); + } + inline QDBusPendingReply openLogStream(const QString &filePath) { QList argumentList; @@ -92,6 +99,39 @@ public Q_SLOTS: // METHODS return asyncCallWithArgumentList(QStringLiteral("readLogInStream"), argumentList); } + inline QDBusPendingReply isFileExist(const QString &filePath) + { + QList argumentList; + argumentList << QVariant::fromValue(filePath); + return asyncCallWithArgumentList(QStringLiteral("isFileExist"), argumentList); + } + + inline QDBusPendingReply getFileSize(const QString &filePath) + { + QList argumentList; + argumentList << QVariant::fromValue(filePath); + return asyncCallWithArgumentList(QStringLiteral("getFileSize"), argumentList); + } + + inline QDBusPendingReply getLineCount(const QString &filePath) + { + QList argumentList; + argumentList << QVariant::fromValue(filePath); + return asyncCallWithArgumentList(QStringLiteral("getLineCount"), argumentList); + } + + inline QDBusPendingReply executeCmd(const QString &cmd) + { + QList argumentList; + argumentList << QVariant::fromValue(cmd); + return asyncCallWithArgumentList(QStringLiteral("executeCmd"), argumentList); + } + + inline QDBusPendingReply whiteListOutPaths() + { + QList argumentList; + return asyncCallWithArgumentList(QStringLiteral("whiteListOutPaths"), argumentList); + } Q_SIGNALS: // SIGNALS }; diff --git a/application/displaycontent.cpp b/application/displaycontent.cpp old mode 100644 new mode 100755 index 3e98b157..5058e5d7 --- a/application/displaycontent.cpp +++ b/application/displaycontent.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,8 +7,10 @@ #include "logexportthread.h" #include "logfileparser.h" #include "exportprogressdlg.h" +#include "logbackend.h" #include "utils.h" #include "DebugTimeManager.h" +#include "parsethread/parsethreadbase.h" #include #include @@ -37,11 +39,18 @@ #include #include #include +#include #include #include "malloc.h" DWIDGET_USE_NAMESPACE +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logDisplaycontent, "org.deepin.log.viewer.display.content") +#else +Q_LOGGING_CATEGORY(logDisplaycontent, "org.deepin.log.viewer.display.content", QtInfoMsg) +#endif + #define SINGLE_LOAD 300 #define NAME_WIDTH 470 @@ -49,6 +58,7 @@ DWIDGET_USE_NAMESPACE #define STATUS_WIDTH 90 #define DATETIME_WIDTH 175 #define DEAMON_WIDTH 100 +#define TREE_NORMAL_COUNT 50 //大致填满表格区域的行数 /** * @brief DisplayContent::DisplayContent 初始化界面\等级数据和实际显示文字转换的数据结构\信号槽连接 * @param parent @@ -57,6 +67,8 @@ DisplayContent::DisplayContent(QWidget *parent) : DWidget(parent) { + m_pLogBackend = LogBackend::instance(this); + initUI(); initMap(); initConnections(); @@ -97,19 +109,42 @@ void DisplayContent::initUI() DFontSizeManager::instance()->bind(noResultLabel, DFontSizeManager::T4); noResultLabel->setAlignment(Qt::AlignCenter); + //notAuditLabel + notAuditLabel = new DLabel(this); + DApplicationHelper::instance()->setPalette(notAuditLabel, pa); + notAuditLabel->setText(DApplication::translate("Warning", "Security level for the current system: high\n audit only administrators can view the audit log")); + DFontSizeManager::instance()->bind(notAuditLabel, DFontSizeManager::T4); + notAuditLabel->setAlignment(Qt::AlignCenter); + + noCoredumpctlLabel = new DLabel(this); + DApplicationHelper::instance()->setPalette(noCoredumpctlLabel, pa); + noCoredumpctlLabel->setText(DApplication::translate("Waring", "Unable to obtain crash information, please install systemd-coredump.")); + DFontSizeManager::instance()->bind(noCoredumpctlLabel, DFontSizeManager::T4); + noCoredumpctlLabel->setAlignment(Qt::AlignCenter); + + noPermissionLabel = new DLabel(this); + DApplicationHelper::instance()->setPalette(noPermissionLabel, pa); + noPermissionLabel->setText(DApplication::translate("Warning", "You do not have permission to view it")); + DFontSizeManager::instance()->bind(noPermissionLabel, DFontSizeManager::T4); + noPermissionLabel->setAlignment(Qt::AlignCenter); + //m_spinnerWgt,m_spinnerWgt_K m_spinnerWgt = new LogSpinnerWidget(this); + m_spinnerWgt->setAccessibleName("spinnerWidget"); m_spinnerWgt->setMinimumHeight(300); m_spinnerWgt_K = new LogSpinnerWidget(this); + m_spinnerWgt_K->setAccessibleName("spinnerWidget_K"); m_spinnerWgt_K->setMinimumHeight(300); //m_detailWgt m_detailWgt = new logDetailInfoWidget(this); + m_detailWgt->setAccessibleName("detailInfoWidget"); m_detailWgt->setMinimumHeight(70); m_detailWgt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); //m_splitter m_splitter = new Dtk::Widget::DSplitter( this); + m_splitter->setAccessibleName("splitterFrame"); m_splitter->setOrientation(Qt::Vertical); m_splitter->setChildrenCollapsible(false); m_splitter->addWidget(m_treeView); @@ -132,8 +167,15 @@ void DisplayContent::initUI() //m_exportDlg m_exportDlg = new ExportProgressDlg(this); + m_exportDlg->setAccessibleName("ExportProgressDlg"); m_exportDlg->hide(); + + m_menu = new QMenu(m_treeView); + m_menu->setAccessibleName("table_menu"); + m_act_openForder = m_menu->addAction(/*tr("在文件管理器中显示")*/ DApplication::translate("Action", "Display in file manager")); + m_act_refresh = m_menu->addAction(/*tr("刷新")*/ DApplication::translate("Action", "Refresh")); + //setLoadState setLoadState(DATA_COMPLETE); } @@ -179,6 +221,7 @@ void DisplayContent::initTableView() { m_treeView = new LogTreeView(this); m_treeView->setObjectName("mainLogTable"); + m_treeView->setAccessibleName("mainLogTable"); m_pModel = new QStandardItemModel(this); m_treeView->setModel(m_pModel); m_treeView->setContextMenuPolicy(Qt::CustomContextMenu); @@ -192,65 +235,181 @@ void DisplayContent::initConnections() connect(m_treeView, SIGNAL(pressed(const QModelIndex &)), this, SLOT(slot_tableItemClicked(const QModelIndex &))); - connect(this, SIGNAL(sigDetailInfo(const QModelIndex &, QStandardItemModel *, QString)), - m_detailWgt, SLOT(slot_DetailInfo(const QModelIndex &, QStandardItemModel *, QString))); - connect(&m_logFileParse, &LogFileParser::dpkgFinished, this, &DisplayContent::slot_dpkgFinished, + connect(this, &DisplayContent::sigDetailInfo, m_detailWgt, &logDetailInfoWidget::slot_DetailInfo); + connect(m_pLogBackend, &LogBackend::parseFinished, this, &DisplayContent::slot_parseFinished, + Qt::QueuedConnection); + connect(m_pLogBackend, &LogBackend::logData, this, &DisplayContent::slot_logData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::dpkgData, this, &DisplayContent::slot_dpkgData, + connect(m_pLogBackend, &LogBackend::dpkgFinished, this, &DisplayContent::slot_dpkgFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::xlogFinished, this, &DisplayContent::slot_XorgFinished, + connect(m_pLogBackend, &LogBackend::dpkgData, this, &DisplayContent::slot_dpkgData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::xlogData, this, &DisplayContent::slot_xorgData, + connect(m_pLogBackend, &LogBackend::xlogFinished, this, &DisplayContent::slot_XorgFinished, + Qt::QueuedConnection); + connect(m_pLogBackend, &LogBackend::xlogData, this, &DisplayContent::slot_xorgData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::bootFinished, this, &DisplayContent::slot_bootFinished, + connect(m_pLogBackend, &LogBackend::bootFinished, this, &DisplayContent::slot_bootFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::bootData, this, &DisplayContent::slot_bootData, + connect(m_pLogBackend, &LogBackend::bootData, this, &DisplayContent::slot_bootData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::kernFinished, this, &DisplayContent::slot_kernFinished, + connect(m_pLogBackend, &LogBackend::kernFinished, this, &DisplayContent::slot_kernFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::kernData, this, &DisplayContent::slot_kernData, + connect(m_pLogBackend, &LogBackend::kernData, this, &DisplayContent::slot_kernData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::journalFinished, this, &DisplayContent::slot_journalFinished, + connect(m_pLogBackend, &LogBackend::journalFinished, this, &DisplayContent::slot_journalFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::journalData, this, &DisplayContent::slot_journalData, + connect(m_pLogBackend, &LogBackend::journalData, this, &DisplayContent::slot_journalData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::journaBootlData, this, &DisplayContent::slot_journalBootData, + connect(m_pLogBackend, &LogBackend::journaBootlData, this, &DisplayContent::slot_journalBootData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::appFinished, this, + connect(m_pLogBackend, &LogBackend::appFinished, this, &DisplayContent::slot_applicationFinished); - connect(&m_logFileParse, &LogFileParser::appData, this, + connect(m_pLogBackend, &LogBackend::appData, this, &DisplayContent::slot_applicationData); - connect(&m_logFileParse, &LogFileParser::kwinFinished, this, &DisplayContent::slot_kwinFinished, + connect(m_pLogBackend, &LogBackend::kwinFinished, this, &DisplayContent::slot_kwinFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::kwinData, this, &DisplayContent::slot_kwinData, + connect(m_pLogBackend, &LogBackend::kwinData, this, &DisplayContent::slot_kwinData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::normalData, this, &DisplayContent::slot_normalData, + connect(m_pLogBackend, &LogBackend::normalData, this, &DisplayContent::slot_normalData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::normalFinished, this, &DisplayContent::slot_normalFinished, + connect(m_pLogBackend, &LogBackend::normalFinished, this, &DisplayContent::slot_normalFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::journalBootFinished, this, &DisplayContent::slot_journalBootFinished); + connect(m_pLogBackend, &LogBackend::journalBootFinished, this, &DisplayContent::slot_journalBootFinished); connect(m_treeView->verticalScrollBar(), &QScrollBar::valueChanged, this, &DisplayContent::slot_vScrollValueChanged); - connect(&m_logFileParse, &LogFileParser::proccessError, this, &DisplayContent::slot_logLoadFailed, + connect(m_pLogBackend, &LogBackend::proccessError, this, &DisplayContent::slot_logLoadFailed, + Qt::QueuedConnection); + connect(m_pLogBackend, SIGNAL(dnfFinished(QList)), this, SLOT(slot_dnfFinished(QList))); + connect(m_pLogBackend, &LogBackend::dmesgFinished, this, &DisplayContent::slot_dmesgFinished, Qt::QueuedConnection); - connect(&m_logFileParse, SIGNAL(dnfFinished(QList)), this, SLOT(slot_dnfFinished(QList))); - connect(&m_logFileParse, &LogFileParser::dmesgFinished, this, &DisplayContent::slot_dmesgFinished, + connect(m_pLogBackend, &LogBackend::OOCData, this, &DisplayContent::slot_OOCData, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::OOCData, this, &DisplayContent::slot_OOCData, + connect(m_pLogBackend, &LogBackend::OOCFinished, this, &DisplayContent::slot_OOCFinished, Qt::QueuedConnection); - connect(&m_logFileParse, &LogFileParser::OOCFinished, this, &DisplayContent::slot_OOCFinished, + + connect(m_pLogBackend, &LogBackend::auditData, this, &DisplayContent::slot_auditData, + Qt::QueuedConnection); + connect(m_pLogBackend, &LogBackend::auditFinished, this, &DisplayContent::slot_auditFinished, + Qt::QueuedConnection); + + connect(m_pLogBackend, &LogBackend::coredumpData, this, &DisplayContent::slot_coredumpData, Qt::QueuedConnection); + connect(m_pLogBackend, &LogBackend::coredumpFinished, this, &DisplayContent::slot_coredumpFinished, + Qt::QueuedConnection); + + connect(m_pLogBackend, &LogBackend::clearTable, this, &DisplayContent::slot_clearTable); + + connect(m_pLogBackend, &LogBackend::sigResult, this, &DisplayContent::onExportResult); + connect(m_pLogBackend, &LogBackend::sigProgress, this, &DisplayContent::onExportProgress); + connect(m_pLogBackend, &LogBackend::sigProcessFull, this, &DisplayContent::onExportFakeCloseDlg); + + // 取消导出 + connect(m_exportDlg, &ExportProgressDlg::sigCloseBtnClicked, m_pLogBackend, &LogBackend::stopExportFromUI); + connect(m_exportDlg, &ExportProgressDlg::buttonClicked, m_pLogBackend, &LogBackend::stopExportFromUI); connect(m_treeView, &LogTreeView::customContextMenuRequested, this, &DisplayContent::slot_requestShowRightMenu); connect(LogApplicationHelper::instance(), &LogApplicationHelper::sigValueChanged, this, &DisplayContent::slot_valueChanged_dConfig_or_gSetting); } +void DisplayContent::createLogTable(const QList &list, LOG_FLAG type) +{ + m_limitTag = 0; + + setLoadState(DATA_COMPLETE); + int end = list.count() > SINGLE_LOAD ? SINGLE_LOAD : list.count(); + insertLogTable(list, 0, end, type); + QItemSelectionModel *p = m_treeView->selectionModel(); + if (p) + p->select(m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); + slot_tableItemClicked(m_pModel->index(0, 0)); +} + +void DisplayContent::insertLogTable(const QList &list, int start, int end, LOG_FLAG type) +{ + QList midList = list; + if (end > start) { + midList = midList.mid(start, end - start); + } + + parseListToModel(midList, m_pModel, type); +} + +void DisplayContent::parseListToModel(const QList &list, QStandardItemModel *oPModel, LOG_FLAG type) +{ + if (!oPModel) { + qCWarning(logDisplaycontent) << QString("log parse model is empty, type:%1").arg(type); + return; + } + + if (list.isEmpty()) { + qCWarning(logDisplaycontent) << QString("log parse model data is empty, type:%1").arg(type); + return; + } + + DStandardItem *item = nullptr; + QList items; + int listCount = list.size(); + for (int i = 0; i < listCount; i++) { + items.clear(); + if (type == KERN) { + LOG_MSG_BASE data; + data.fromJson(list[i]); + item = new DStandardItem(data.dateTime); + item->setData(KERN_TABLE_DATA); + items << item; + item = new DStandardItem(data.hostName); + item->setData(KERN_TABLE_DATA); + items << item; + item = new DStandardItem(data.daemonName); + item->setData(KERN_TABLE_DATA); + items << item; + item = new DStandardItem(data.msg); + item->setData(KERN_TABLE_DATA); + items << item; + } else if (type == Kwin) { + LOG_MSG_BASE data; + data.fromJson(list[i]); + item = new DStandardItem(data.msg); + item->setData(KWIN_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(0)); + items << item; + } + oPModel->insertRow(oPModel->rowCount(), items); + } +} + +int DisplayContent::loadSegementPage(bool bNext/* = true*/, bool bReset/* = true*/) +{ + int nSegementIndex = m_pLogBackend->getNextSegementIndex(m_flag, bNext); + qDebug() << "loadSegementPage index:" << nSegementIndex; + if(nSegementIndex == -1) + return -1; + + if (bReset) + clearAllDatas(); + + setLoadState(DATA_LOADING, !bReset); + + // 1.正常分段加载翻页,重置表格 + // 2.搜索结果超过分段单位大小后,需要重置表格,显示下一页内容 + if (bReset || (!bReset &&m_pLogBackend->m_type2LogData[m_flag].size() > SEGEMENT_SIZE)) { + if (m_flag == KERN) + createKernTableForm(); + else if (m_flag == Kwin) + createKwinTableForm(); + } + + m_pLogBackend->loadSegementPage(nSegementIndex, bReset); + + return nSegementIndex; +} + /** * @brief DisplayContent::generateJournalFile 获取系统日志 * @param id 时间筛选id 对应BUTTONID枚举,0表示全部,1是今天,2是3天内,3是筛选1周内数据,4是筛选一个月内的,5是三个月 @@ -270,7 +429,7 @@ void DisplayContent::generateJournalFile(int id, int lId, const QString &iSearch Q_UNUSED(iSearchStr) //系统日志上次获取的时间,和筛选条件一起判断,防止获取过于频繁 if (m_lastJournalGetTime.msecsTo(QDateTime::currentDateTime()) < 500 && m_journalFilter.timeFilter == id && m_journalFilter.eventTypeFilter == lId) { - qDebug() << "repeat refrsh journal too fast!"; + qCWarning(logDisplaycontent) << "load journal log: repeat refrsh journal too fast!"; QItemSelectionModel *p = m_treeView->selectionModel(); if (p) p->select(m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); @@ -281,11 +440,9 @@ void DisplayContent::generateJournalFile(int id, int lId, const QString &iSearch m_journalFilter.timeFilter = id; m_journalFilter.eventTypeFilter = lId; m_firstLoadPageData = true; - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); m_isDataLoadComplete = false; - jList.clear(); - jListOrigin.clear(); createJournalTableForm(); setLoadState(DATA_LOADING); QDateTime dt = QDateTime::currentDateTime(); @@ -298,47 +455,50 @@ void DisplayContent::generateJournalFile(int id, int lId, const QString &iSearch arg.append("all"); } switch (id) { - case ALL: { - m_journalCurrentIndex = m_logFileParse.parseByJournal(arg); - } break; + case ALL: + break; case ONE_DAY: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); arg << QString::number(dtStart.toMSecsSinceEpoch() * 1000) << QString::number(dtEnd.toMSecsSinceEpoch() * 1000); - m_journalCurrentIndex = m_logFileParse.parseByJournal(arg); - } break; + } + break; case THREE_DAYS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); arg << QString::number(dtStart.addDays(-2).toMSecsSinceEpoch() * 1000) << QString::number(dtEnd.toMSecsSinceEpoch() * 1000); - m_journalCurrentIndex = m_logFileParse.parseByJournal(arg); - } break; + } + break; case ONE_WEEK: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); arg << QString::number(dtStart.addDays(-6).toMSecsSinceEpoch() * 1000) << QString::number(dtEnd.toMSecsSinceEpoch() * 1000); - m_journalCurrentIndex = m_logFileParse.parseByJournal(arg); - } break; + } + break; case ONE_MONTH: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); arg << QString::number(dtStart.addMonths(-1).toMSecsSinceEpoch() * 1000) << QString::number(dtEnd.toMSecsSinceEpoch() * 1000); - m_journalCurrentIndex = m_logFileParse.parseByJournal(arg); - } break; + } + break; case THREE_MONTHS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); arg << QString::number(dtStart.addMonths(-3).toMSecsSinceEpoch() * 1000) << QString::number(dtEnd.toMSecsSinceEpoch() * 1000); - m_journalCurrentIndex = m_logFileParse.parseByJournal(arg); - } break; + } + break; default: break; } + + if (id >= ALL && id <= THREE_MONTHS) + m_pLogBackend->parseByJournal(arg); + m_treeView->setColumnWidth(JOURNAL_SPACE::journalLevelColumn, LEVEL_WIDTH); m_treeView->setColumnWidth(JOURNAL_SPACE::journalDaemonNameColumn, DEAMON_WIDTH); m_treeView->setColumnWidth(JOURNAL_SPACE::journalDateTimeColumn, DATETIME_WIDTH); @@ -347,7 +507,7 @@ void DisplayContent::generateJournalFile(int id, int lId, const QString &iSearch * @brief DisplayContent::createJournalTableStart 获取系统日志完成时第一次加载数据的第一页到treeview中 * @param list 获得的系统日志数据list */ -void DisplayContent::createJournalTableStart(QList &list) +void DisplayContent::createJournalTableStart(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -368,11 +528,11 @@ void DisplayContent::createJournalTableForm() m_pModel->setHorizontalHeaderLabels( QStringList() << DApplication::translate("Table", "Level") - << DApplication::translate("Table", "Process") // modified by Airy - << DApplication::translate("Table", "Date and Time") - << DApplication::translate("Table", "Info") - << DApplication::translate("Table", "User") - << DApplication::translate("Table", "PID")); + << DApplication::translate("Table", "Process") // modified by Airy + << DApplication::translate("Table", "Date and Time") + << DApplication::translate("Table", "Info") + << DApplication::translate("Table", "User") + << DApplication::translate("Table", "PID")); m_treeView->setColumnWidth(0, LEVEL_WIDTH); m_treeView->setColumnWidth(1, DEAMON_WIDTH); m_treeView->setColumnWidth(2, DATETIME_WIDTH); @@ -386,10 +546,8 @@ void DisplayContent::createJournalTableForm() void DisplayContent::generateDpkgFile(int id, const QString &iSearchStr) { Q_UNUSED(iSearchStr) - dList.clear(); - dListOrigin.clear(); - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); setLoadState(DATA_LOADING); createDpkgTableForm(); m_firstLoadPageData = true; @@ -400,7 +558,6 @@ void DisplayContent::generateDpkgFile(int id, const QString &iSearchStr) switch (id) { case ALL: - m_dpkgCurrentIndex = m_logFileParse.parseByDpkg(dpkgFilter); break; case ONE_DAY: { QDateTime dtStart = dt; @@ -408,50 +565,54 @@ void DisplayContent::generateDpkgFile(int id, const QString &iSearchStr) dtEnd.setTime(QTime(23, 59, 59, 999)); dpkgFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); dpkgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_dpkgCurrentIndex = m_logFileParse.parseByDpkg(dpkgFilter); - } break; + } + break; case THREE_DAYS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); dpkgFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); dpkgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_dpkgCurrentIndex = m_logFileParse.parseByDpkg(dpkgFilter); - } break; + } + break; case ONE_WEEK: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); dpkgFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); dpkgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_dpkgCurrentIndex = m_logFileParse.parseByDpkg(dpkgFilter); - } break; + } + break; case ONE_MONTH: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); dpkgFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); dpkgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_dpkgCurrentIndex = m_logFileParse.parseByDpkg(dpkgFilter); - } break; + } + break; case THREE_MONTHS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); dpkgFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); dpkgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_dpkgCurrentIndex = m_logFileParse.parseByDpkg(dpkgFilter); - } break; + } + break; default: break; } + + if (id >= ALL && id <= THREE_MONTHS) { + m_pLogBackend->parseByDpkg(dpkgFilter); + } } /** * @brief DisplayContent::createDpkgTable 获取系统日志完成时第一次加载数据的第一页到treeview中 * @param list 获得的DPKG日志数据list */ -void DisplayContent::createDpkgTableStart(QList &list) +void DisplayContent::createDpkgTableStart(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -483,20 +644,18 @@ void DisplayContent::createDpkgTableForm() void DisplayContent::generateKernFile(int id, const QString &iSearchStr) { Q_UNUSED(iSearchStr) - kList.clear(); - kListOrigin.clear(); - clearAllFilter(); - clearAllDatalist(); - m_firstLoadPageData = true; - m_isDataLoadComplete = false; - setLoadState(DATA_LOADING); - createKernTableForm(); + m_pLogBackend->clearAllFilter(); + + // 填充筛选条件 QDateTime dt = QDateTime::currentDateTime(); dt.setTime(QTime()); // get zero time - KERN_FILTERS kernFilter; + LOG_FILTER_BASE kernFilter; + kernFilter.type = KERN; + kernFilter.filePath = "kern"; + kernFilter.segementIndex = -1; + switch (id) { case ALL: - m_kernCurrentIndex = m_logFileParse.parseByKern(kernFilter); break; case ONE_DAY: { QDateTime dtStart = dt; @@ -504,43 +663,48 @@ void DisplayContent::generateKernFile(int id, const QString &iSearchStr) dtEnd.setTime(QTime(23, 59, 59, 999)); kernFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); kernFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_kernCurrentIndex = m_logFileParse.parseByKern(kernFilter); - } break; + } + break; case THREE_DAYS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); kernFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); kernFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_kernCurrentIndex = m_logFileParse.parseByKern(kernFilter); - } break; + } + break; case ONE_WEEK: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); kernFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); kernFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_kernCurrentIndex = m_logFileParse.parseByKern(kernFilter); - } break; + } + break; case ONE_MONTH: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); kernFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); kernFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_kernCurrentIndex = m_logFileParse.parseByKern(kernFilter); - } break; + } + break; case THREE_MONTHS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); kernFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); kernFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_kernCurrentIndex = m_logFileParse.parseByKern(kernFilter); - } break; + } + break; default: break; } + + if (id >= ALL && id <= THREE_MONTHS) { + m_pLogBackend->m_type2Filter[KERN] = kernFilter; + loadSegementPage(); + } } /** @@ -564,7 +728,7 @@ void DisplayContent::createKernTableForm() * @param list 获得的内核日志数据list */ // modified by Airy for bug 12263 -void DisplayContent::createKernTable(QList &list) +void DisplayContent::createKernTable(const QList &list) { setLoadState(DATA_COMPLETE); @@ -583,7 +747,7 @@ void DisplayContent::createKernTable(QList &list) * @param start 分页开始的数组下标 * @param end 分页结束的数组下标 */ -void DisplayContent::insertKernTable(QList list, int start, int end) +void DisplayContent::insertKernTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -598,7 +762,7 @@ void DisplayContent::insertKernTable(QList list, int start, int * @param start 分页开始的数组下标 * @param end 分页结束的数组下标 */ -void DisplayContent::insertDpkgTable(QList list, int start, int end) +void DisplayContent::insertDpkgTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -607,7 +771,7 @@ void DisplayContent::insertDpkgTable(QList list, int start, int en parseListToModel(midList, m_pModel); } -void DisplayContent::insertXorgTable(QList list, int start, int end) +void DisplayContent::insertXorgTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -616,7 +780,7 @@ void DisplayContent::insertXorgTable(QList list, int start, int en parseListToModel(midList, m_pModel); } -void DisplayContent::insertBootTable(QList list, int start, int end) +void DisplayContent::insertBootTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -625,7 +789,7 @@ void DisplayContent::insertBootTable(QList list, int start, int en parseListToModel(midList, m_pModel); } -void DisplayContent::insertKwinTable(QList list, int start, int end) +void DisplayContent::insertKwinTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -634,7 +798,7 @@ void DisplayContent::insertKwinTable(QList list, int start, int en parseListToModel(midList, m_pModel); } -void DisplayContent::insertNormalTable(QList list, int start, int end) +void DisplayContent::insertNormalTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -643,32 +807,58 @@ void DisplayContent::insertNormalTable(QList list, int start, in parseListToModel(midList, m_pModel); } +void DisplayContent::insertOOCTable(const QList &list, int start, int end) +{ + QList midList = list; + if (end >= start) { + midList = midList.mid(start, end - start); + } + parseListToModel(midList, m_pModel); +} + +void DisplayContent::insertAuditTable(const QList &list, int start, int end) +{ + QList midList = list; + if (end >= start) { + midList = midList.mid(start, end - start); + } + parseListToModel(midList, m_pModel); +} + +void DisplayContent::insertCoredumpTable(const QList &list, int start, int end) +{ + QList midList = list; + if (end >= start) { + midList = midList.mid(start, end - start); + } + parseListToModel(midList, m_pModel); +} + /** * @brief DisplayContent::generateAppFile 触发获取应用日志数据线程 - * @param path 要获取的某一个应用的日志的日志文件路径 + * @param app 要获取的某一个应用的项目名称 * @param id 时间筛选id 对应BUTTONID枚举,0表示全部,1是今天,2是3天内,3是筛选1周内数据,4是筛选一个月内的,5是三个月 * @param lId 等级筛选id,对应PRIORITY枚举,直接传入获取系统接口,-1表示全部等级不筛选, * @param iSearchStr 搜索关键字,现阶段不用,保留参数 */ -void DisplayContent::generateAppFile(QString path, int id, int lId, const QString &iSearchStr) +void DisplayContent::generateAppFile(const QString &app, int id, int lId, const QString &iSearchStr) { Q_UNUSED(iSearchStr) - appList.clear(); - appListOrigin.clear(); - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); setLoadState(DATA_LOADING); m_firstLoadPageData = true; m_isDataLoadComplete = false; QDateTime dt = QDateTime::currentDateTime(); dt.setTime(QTime()); // get zero time createAppTableForm(); + APP_FILTERS appFilter; - appFilter.path = path; + appFilter.app = app; appFilter.lvlFilter = lId; + appFilter.submodule = m_pLogBackend->m_appFilter.submodule; switch (id) { case ALL: - m_appCurrentIndex = m_logFileParse.parseByApp(appFilter); break; case ONE_DAY: { QDateTime dtStart = dt; @@ -676,44 +866,46 @@ void DisplayContent::generateAppFile(QString path, int id, int lId, const QStrin dtEnd.setTime(QTime(23, 59, 59, 999)); appFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); appFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_appCurrentIndex = m_logFileParse.parseByApp(appFilter); - } break; + } + break; case THREE_DAYS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); appFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); appFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_appCurrentIndex = m_logFileParse.parseByApp(appFilter); - - } break; + } + break; case ONE_WEEK: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); appFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); appFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_appCurrentIndex = m_logFileParse.parseByApp(appFilter); - } break; + } + break; case ONE_MONTH: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); appFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); appFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_appCurrentIndex = m_logFileParse.parseByApp(appFilter); - } break; + } + break; case THREE_MONTHS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); appFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); - appFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_appCurrentIndex = m_logFileParse.parseByApp(appFilter); - } break; + } + break; default: break; } + + m_pLogBackend->m_appFilter = appFilter; + if (id >= ALL && id <= THREE_MONTHS) + m_pLogBackend->parseByApp(appFilter); } /** @@ -728,15 +920,15 @@ void DisplayContent::createAppTableForm() << DApplication::translate("Table", "Source") << DApplication::translate("Table", "Info")); m_treeView->setColumnWidth(0, LEVEL_WIDTH); - m_treeView->setColumnWidth(1, DATETIME_WIDTH + 20); - m_treeView->setColumnWidth(2, DEAMON_WIDTH); + m_treeView->setColumnWidth(1, DATETIME_WIDTH); + m_treeView->setColumnWidth(2, DEAMON_WIDTH + 28); } /** * @brief DisplayContent::createAppTable 获取应用日志完成时第一次加载数据的第一页到treeview中 * @param list 获得的应用日志数据list */ -void DisplayContent::createAppTable(QList &list) +void DisplayContent::createAppTable(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -752,7 +944,7 @@ void DisplayContent::createAppTable(QList &list) * @brief DisplayContent::createBootTable 获取启动日志完成时加载所有数据到treeview中 * @param list 获得的启动日志数据list */ -void DisplayContent::createBootTable(QList &list) +void DisplayContent::createBootTable(const QList &list) { m_limitTag = 0; @@ -767,15 +959,13 @@ void DisplayContent::createBootTable(QList &list) void DisplayContent::generateBootFile() { - bList.clear(); - currentBootList.clear(); setLoadState(DATA_LOADING); - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); m_firstLoadPageData = true; m_isDataLoadComplete = false; createBootTableForm(); - m_bootCurrentIndex = m_logFileParse.parseByBoot(); + m_pLogBackend->parseByBoot(); } void DisplayContent::createXorgTableForm() @@ -783,7 +973,7 @@ void DisplayContent::createXorgTableForm() m_pModel->clear(); m_pModel->setColumnCount(2); m_pModel->setHorizontalHeaderLabels(QStringList() - << DApplication::translate("Table", "Date and Time") + << DApplication::translate("Table", "Offset") << DApplication::translate("Table", "Info")); m_treeView->setColumnWidth(0, DATETIME_WIDTH + 20); } @@ -792,7 +982,7 @@ void DisplayContent::createXorgTableForm() * @brief DisplayContent::createXorgTable 获取Xorg日志完成时加载所有数据到treeview中 * @param list 获得的Xorg日志数据list */ -void DisplayContent::createXorgTable(QList &list) +void DisplayContent::createXorgTable(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -810,10 +1000,8 @@ void DisplayContent::createXorgTable(QList &list) */ void DisplayContent::generateXorgFile(int id) { - clearAllFilter(); - xList.clear(); - clearAllDatalist(); - xListOrigin.clear(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); setLoadState(DATA_LOADING); QDateTime dt = QDateTime::currentDateTime(); m_firstLoadPageData = true; @@ -823,7 +1011,6 @@ void DisplayContent::generateXorgFile(int id) XORG_FILTERS xorgFilter; switch (id) { case ALL: - m_xorgCurrentIndex = m_logFileParse.parseByXlog(xorgFilter); break; case ONE_DAY: { QDateTime dtStart = dt; @@ -831,43 +1018,46 @@ void DisplayContent::generateXorgFile(int id) dtEnd.setTime(QTime(23, 59, 59, 999)); xorgFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); xorgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_xorgCurrentIndex = m_logFileParse.parseByXlog(xorgFilter); - } break; + } + break; case THREE_DAYS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); xorgFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); xorgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_xorgCurrentIndex = m_logFileParse.parseByXlog(xorgFilter); - } break; + } + break; case ONE_WEEK: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); xorgFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); xorgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_xorgCurrentIndex = m_logFileParse.parseByXlog(xorgFilter); - } break; + } + break; case ONE_MONTH: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); xorgFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); xorgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_xorgCurrentIndex = m_logFileParse.parseByXlog(xorgFilter); - } break; + } + break; case THREE_MONTHS: { QDateTime dtStart = dt; QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); xorgFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); xorgFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_xorgCurrentIndex = m_logFileParse.parseByXlog(xorgFilter); - } break; + } + break; default: break; } + + if (id >= ALL && id <= THREE_MONTHS) + m_pLogBackend->parseByXlog(xorgFilter); } void DisplayContent::createKwinTableForm() @@ -882,7 +1072,7 @@ void DisplayContent::createKwinTableForm() * @brief DisplayContent::creatKwinTable 获取kwin日志完成时加载所有数据到treeview中 * @param list 获得的kwin日志数据list */ -void DisplayContent::creatKwinTable(QList &list) +void DisplayContent::creatKwinTable(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -896,19 +1086,17 @@ void DisplayContent::creatKwinTable(QList &list) /** * @brief DisplayContent::generateKwinFile 触发获取Kwin日志数据线程 - * @param iFilters 获取线程筛选条件结构体 */ -void DisplayContent::generateKwinFile(KWIN_FILTERS iFilters) +void DisplayContent::generateKwinFile(const KWIN_FILTERS &iFilters) { - clearAllFilter(); - clearAllDatalist(); - m_kwinList.clear(); - m_currentKwinList.clear(); - m_firstLoadPageData = true; - m_isDataLoadComplete = false; - setLoadState(DATA_LOADING); - createKwinTableForm(); - m_kwinCurrentIndex = m_logFileParse.parseByKwin(iFilters); + Q_UNUSED(iFilters) + m_pLogBackend->clearAllFilter(); + + LOG_FILTER_BASE filter; + filter.type = Kwin; + filter.segementIndex = -1; + m_pLogBackend->m_type2Filter[Kwin] = filter; + loadSegementPage(); } void DisplayContent::createNormalTableForm() @@ -930,7 +1118,7 @@ void DisplayContent::createNormalTableForm() * @brief DisplayContent::createNormalTable 开关机日志表头项目创建和重置 * @param list */ -void DisplayContent::createNormalTable(QList &list) +void DisplayContent::createNormalTable(const QList &list) { setLoadState(DATA_COMPLETE); @@ -950,10 +1138,8 @@ void DisplayContent::createNormalTable(QList &list) // add by Airy void DisplayContent::generateNormalFile(int id) { - clearAllFilter(); - clearAllDatalist(); - norList.clear(); - nortempList.clear(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); setLoadState(DATA_LOADING); m_firstLoadPageData = true; m_isDataLoadComplete = false; @@ -964,41 +1150,47 @@ void DisplayContent::generateNormalFile(int id) QDateTime dtEnd = dt; dtEnd.setTime(QTime(23, 59, 59, 999)); + NORMAL_FILTERS normalFilter; + normalFilter.eventTypeFilter = m_curNormalEventType; switch (id) { case ALL: - m_normalFilter.timeFilterEnd = -1; - m_normalFilter.timeFilterBegin = -1; - m_normalCurrentIndex = m_logFileParse.parseByNormal(m_normalFilter); + normalFilter.timeFilterEnd = -1; + normalFilter.timeFilterBegin = -1; break; case ONE_DAY: { - m_normalFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); - m_normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_normalCurrentIndex = m_logFileParse.parseByNormal(m_normalFilter); - } break; + normalFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); + normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; case THREE_DAYS: { - m_normalFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); - m_normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_normalCurrentIndex = m_logFileParse.parseByNormal(m_normalFilter); - } break; + normalFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); + normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; case ONE_WEEK: { - m_normalFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); - m_normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_normalCurrentIndex = m_logFileParse.parseByNormal(m_normalFilter); - } break; + normalFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); + normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; case ONE_MONTH: { - m_normalFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); - m_normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_normalCurrentIndex = m_logFileParse.parseByNormal(m_normalFilter); - } break; + normalFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); + normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; case THREE_MONTHS: { - m_normalFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); - m_normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); - m_normalCurrentIndex = m_logFileParse.parseByNormal(m_normalFilter); - } break; + normalFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); + normalFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; default: break; } - nortempList = norList; + + m_pLogBackend->m_normalFilter = normalFilter; + if (id >= ALL && id <= THREE_MONTHS) + m_pLogBackend->parseByNormal(normalFilter); + + m_pLogBackend->nortempList = m_pLogBackend->norList; } /** @@ -1055,24 +1247,13 @@ void DisplayContent::insertJournalTable(QList logList, int star * @param filePath 当前选择的应用的日志路径 * @return 对应的日志名称 */ -QString DisplayContent::getAppName(QString filePath) +QString DisplayContent::getAppName(const QString &filePath) { - QString ret; - if (filePath.isEmpty()) - return ret; - QStringList strList = filePath.split("/"); - if (strList.count() < 2) { - if (filePath.contains(".")) - ret = filePath.section(".", 0, 0); - else { - ret = filePath; - } - return LogApplicationHelper::instance()->transName(ret); - } + QString ret = Utils::appName(filePath); + if (ret.isEmpty()) + return ret; - QString desStr = filePath.section("/", -1); - ret = desStr.mid(0, desStr.lastIndexOf(".")); return LogApplicationHelper::instance()->transName(ret); } @@ -1105,8 +1286,8 @@ void DisplayContent::generateJournalBootFile(int lId, const QString &iSearchStr) { Q_UNUSED(iSearchStr) m_firstLoadPageData = true; - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); m_isDataLoadComplete = false; createJournalBootTableForm(); setLoadState(DATA_LOADING); @@ -1119,7 +1300,7 @@ void DisplayContent::generateJournalBootFile(int lId, const QString &iSearchStr) } else { arg.append("all"); } - m_journalBootCurrentIndex = m_logFileParse.parseByJournalBoot(arg); + m_pLogBackend->parseByJournalBoot(arg); // default first row select m_treeView->setColumnWidth(JOURNAL_SPACE::journalLevelColumn, LEVEL_WIDTH); m_treeView->setColumnWidth(JOURNAL_SPACE::journalDaemonNameColumn, DEAMON_WIDTH); @@ -1130,7 +1311,7 @@ void DisplayContent::generateJournalBootFile(int lId, const QString &iSearchStr) * @brief DisplayContent::createJournalBootTableStart 获取klu下启动日志完成时第一次加载数据的第一页到treeview中 * @param list klu下启动日志数据list */ -void DisplayContent::createJournalBootTableStart(QList &list) +void DisplayContent::createJournalBootTableStart(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -1211,8 +1392,8 @@ void DisplayContent::insertJournalBootTable(QList logList, int void DisplayContent::generateDnfFile(BUTTONID iDate, DNFPRIORITY iLevel) { - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); setLoadState(DATA_LOADING); createDnfForm(); QDateTime dt = QDateTime::currentDateTime(); @@ -1225,26 +1406,33 @@ void DisplayContent::generateDnfFile(BUTTONID iDate, DNFPRIORITY iLevel) break; case ONE_DAY: { dnffilter.timeFilter = dt.toMSecsSinceEpoch(); - } break; + } + break; case THREE_DAYS: { dnffilter.timeFilter = dt.addDays(-2).toMSecsSinceEpoch(); - } break; + } + break; case ONE_WEEK: { dnffilter.timeFilter = dt.addDays(-6).toMSecsSinceEpoch(); - } break; + } + break; case ONE_MONTH: { dnffilter.timeFilter = dt.addDays(-29).toMSecsSinceEpoch(); - } break; + } + break; case THREE_MONTHS: { dnffilter.timeFilter = dt.addDays(-89).toMSecsSinceEpoch(); - } break; + } + break; default: break; } - m_logFileParse.parseByDnf(dnffilter); + + if (iDate >= ALL && iDate <= THREE_MONTHS) + m_pLogBackend->parseByDnf(dnffilter); } -void DisplayContent::createDnfTable(QList &list) +void DisplayContent::createDnfTable(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -1258,8 +1446,8 @@ void DisplayContent::createDnfTable(QList &list) void DisplayContent::generateDmesgFile(BUTTONID iDate, PRIORITY iLevel) { - clearAllFilter(); - clearAllDatalist(); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); setLoadState(DATA_LOADING); createDmesgForm(); QDateTime dt = QDateTime::currentDateTime(); @@ -1272,26 +1460,33 @@ void DisplayContent::generateDmesgFile(BUTTONID iDate, PRIORITY iLevel) break; case ONE_DAY: { dmesgfilter.timeFilter = dt.toMSecsSinceEpoch(); - } break; + } + break; case THREE_DAYS: { dmesgfilter.timeFilter = dt.addDays(-2).toMSecsSinceEpoch(); - } break; + } + break; case ONE_WEEK: { dmesgfilter.timeFilter = dt.addDays(-6).toMSecsSinceEpoch(); - } break; + } + break; case ONE_MONTH: { dmesgfilter.timeFilter = dt.addDays(-29).toMSecsSinceEpoch(); - } break; + } + break; case THREE_MONTHS: { dmesgfilter.timeFilter = dt.addDays(-89).toMSecsSinceEpoch(); - } break; + } + break; default: break; } - m_logFileParse.parseByDmesg(dmesgfilter); + + if (iDate >= ALL && iDate <= THREE_MONTHS) + m_pLogBackend->parseByDmesg(dmesgfilter); } -void DisplayContent::createDmesgTable(QList &list) +void DisplayContent::createDmesgTable(const QList &list) { m_limitTag = 0; setLoadState(DATA_COMPLETE); @@ -1327,7 +1522,7 @@ void DisplayContent::createDmesgForm() m_treeView->hideColumn(3); } -void DisplayContent::insertDmesgTable(QList list, int start, int end) +void DisplayContent::insertDmesgTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -1336,7 +1531,7 @@ void DisplayContent::insertDmesgTable(QList list, int start, int parseListToModel(midList, m_pModel); } -void DisplayContent::insertDnfTable(QList list, int start, int end) +void DisplayContent::insertDnfTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -1362,10 +1557,11 @@ void DisplayContent::slot_tableItemClicked(const QModelIndex &index) m_curTreeIndex = index; if (m_flag == OtherLog || m_flag == CustomLog) { - QString path = m_pModel->item(index.row(),0)->data(Qt::UserRole + 2).toString(); + QString path = m_pModel->item(index.row(), 0)->data(Qt::UserRole + 2).toString(); + m_pLogBackend->setFlag(m_flag); generateOOCFile(path); } else { - emit sigDetailInfo(index, m_pModel, getAppName(m_curAppLog)); + emit sigDetailInfo(index, m_pModel, getAppName(m_curApp)); } } @@ -1377,14 +1573,6 @@ void DisplayContent::slot_tableItemClicked(const QModelIndex &index) */ void DisplayContent::slot_BtnSelected(int btnId, int lId, QModelIndex idx) { - qDebug() << QString("Button %1 clicked\n combobox: level is %2, cbxIdx is %3 tree %4 node!!") - .arg(btnId) - .arg(lId) - .arg(lId + 1) - .arg(idx.data(ITEM_DATE_ROLE).toString()); - - m_detailWgt->cleanText(); - m_curLevel = lId; // m_curLevel equal combobox index-1; m_curBtnId = btnId; @@ -1392,6 +1580,11 @@ void DisplayContent::slot_BtnSelected(int btnId, int lId, QModelIndex idx) if (treeData.isEmpty()) return; + if (treeData.contains(OTHER_TREE_DATA, Qt::CaseInsensitive) || treeData.contains(CUSTOM_TREE_DATA, Qt::CaseInsensitive)) { + return; + } + + m_detailWgt->cleanText(); if (treeData.contains(JOUR_TREE_DATA, Qt::CaseInsensitive)) { generateJournalFile(btnId, m_curLevel); } else if (treeData.contains(BOOT_KLU_TREE_DATA, Qt::CaseInsensitive)) { @@ -1403,8 +1596,8 @@ void DisplayContent::slot_BtnSelected(int btnId, int lId, QModelIndex idx) } else if (treeData.contains(".cache")) { // generateAppFile(treeData, btnId, lId); } else if (treeData.contains(APP_TREE_DATA, Qt::CaseInsensitive)) { - if (!m_curAppLog.isEmpty()) { - generateAppFile(m_curAppLog, btnId, m_curLevel); + if (!m_curApp.isEmpty()) { + generateAppFile(m_curApp, btnId, m_curLevel); } } else if (treeData.contains(XORG_TREE_DATA, Qt::CaseInsensitive)) { // add by Airy generateXorgFile(btnId); @@ -1414,19 +1607,28 @@ void DisplayContent::slot_BtnSelected(int btnId, int lId, QModelIndex idx) generateDnfFile(BUTTONID(m_curBtnId), m_curDnfLevel); } else if (treeData.contains(DMESG_TREE_DATA, Qt::CaseInsensitive)) { generateDmesgFile(BUTTONID(m_curBtnId), PRIORITY(m_curLevel)); + } else if (treeData.contains(KWIN_TREE_DATA, Qt::CaseInsensitive)) { + KWIN_FILTERS filter; + generateKwinFile(filter); + } else if (treeData.contains(AUDIT_TREE_DATA, Qt::CaseInsensitive)) { + generateAuditFile(BUTTONID(m_curBtnId), AUDITTYPE(m_curAuditType)); + } else if(treeData.contains(COREDUMP_TREE_DATA, Qt::CaseInsensitive)) { + generateCoredumpFile(btnId); } } /** * @brief DisplayContent::slot_appLogs 根据应用日志应用类型变化触发应用日志获取线程 - * @param path 应用日志的路径 + * @param btnId 周期Id + * @param app 应用项目名称 */ -void DisplayContent::slot_appLogs(int btnId, QString path) +void DisplayContent::slot_appLogs(int btnId, const QString &app) { - appList.clear(); - m_curAppLog = path; + m_curApp = app; m_curBtnId = btnId; - generateAppFile(path, m_curBtnId, m_curLevel); + m_pLogBackend->m_appFilter.clear(); + m_pLogBackend->m_appFilter.submodule = ""; + generateAppFile(app, m_curBtnId, m_curLevel); } /** @@ -1440,63 +1642,93 @@ void DisplayContent::slot_logCatelogueClicked(const QModelIndex &index) } if (m_curListIdx == index && (m_flag != KERN && m_flag != BOOT)) { - qDebug() << "repeat click" << m_flag; return; } - m_currentKwinFilter = {""}; + m_curListIdx = index; - clearAllDatalist(); + clearAllDatas(); QString itemData = index.data(ITEM_DATE_ROLE).toString(); if (itemData.isEmpty()) return; - m_splitter->handle(3)->setDisabled(true); - m_detailWgt->setFixedHeight(230); + //界面参数变化 + int height = this->height(); + int handleW = m_splitter->handleWidth(); + if (itemData.contains(CUSTOM_TREE_DATA, Qt::CaseInsensitive) || itemData.contains(OTHER_TREE_DATA, Qt::CaseInsensitive)) { + m_splitter->handle(3)->setDisabled(false); + m_detailWgt->setFixedHeight(QWIDGETSIZE_MAX); + m_detailWgt->setMinimumHeight(70); + + const int heightLogTree = 164; + QMargins margins = this->parentWidget()->layout()->layout()->contentsMargins(); + height = this->parentWidget()->height() - margins.top() - margins.bottom(); + int heightDetailWgt = height - heightLogTree - handleW; + m_splitter->setSizes(QList() << heightLogTree << heightDetailWgt << heightDetailWgt << heightDetailWgt); + } else { + height -= handleW; + m_splitter->handle(3)->setDisabled(true); + m_detailWgt->setFixedHeight(230); + m_splitter->setSizes(QList() << height * 5 / 8 << 0 << 0 << height * 3 / 8); + } + if (itemData.contains(JOUR_TREE_DATA, Qt::CaseInsensitive)) { // default level is info so PRIORITY=6 m_flag = JOURNAL; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(DPKG_TREE_DATA, Qt::CaseInsensitive)) { m_flag = DPKG; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(XORG_TREE_DATA, Qt::CaseInsensitive)) { - xList.clear(); + m_pLogBackend->xList.clear(); m_flag = XORG; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(BOOT_TREE_DATA, Qt::CaseInsensitive)) { m_flag = BOOT; + m_pLogBackend->setFlag(m_flag); generateBootFile(); } else if (itemData.contains(KERN_TREE_DATA, Qt::CaseInsensitive)) { m_flag = KERN; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(".cache")) { } else if (itemData.contains(APP_TREE_DATA, Qt::CaseInsensitive)) { m_pModel->clear(); // clicked parent node application, clear table contents m_flag = APP; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(LAST_TREE_DATA, Qt::CaseInsensitive)) { - norList.clear(); + m_pLogBackend->norList.clear(); m_flag = Normal; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(KWIN_TREE_DATA, Qt::CaseInsensitive)) { m_flag = Kwin; + m_pLogBackend->setFlag(m_flag); KWIN_FILTERS filter; filter.msg = ""; } else if (itemData.contains(BOOT_KLU_TREE_DATA, Qt::CaseInsensitive)) { m_flag = BOOT_KLU; + m_pLogBackend->setFlag(m_flag); generateJournalBootFile(m_curLevel); } else if (itemData.contains(DNF_TREE_DATA, Qt::CaseInsensitive)) { m_flag = Dnf; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(DMESG_TREE_DATA, Qt::CaseInsensitive)) { m_flag = Dmesg; + m_pLogBackend->setFlag(m_flag); } else if (itemData.contains(OTHER_TREE_DATA, Qt::CaseInsensitive)) { m_flag = OtherLog; - m_splitter->handle(3)->setDisabled(false); - m_detailWgt->setFixedHeight(QWIDGETSIZE_MAX); - createOOCTableForm(); - createOOCTable(LogApplicationHelper::instance()->getOtherLogList()); + m_pLogBackend->setFlag(m_flag); + generateOOCLogs(OOC_OTHER); } else if (itemData.contains(CUSTOM_TREE_DATA, Qt::CaseInsensitive)) { m_flag = CustomLog; - m_splitter->handle(3)->setDisabled(false); - m_detailWgt->setFixedHeight(QWIDGETSIZE_MAX); - createOOCTableForm(); - createOOCTable(LogApplicationHelper::instance()->getCustomLogList()); + m_pLogBackend->setFlag(m_flag); + generateOOCLogs(OOC_CUSTOM); + } else if (itemData.contains(AUDIT_TREE_DATA, Qt::CaseInsensitive)) { + m_flag = Audit; + m_pLogBackend->setFlag(m_flag); + } else if (itemData.contains(COREDUMP_TREE_DATA, Qt::CaseInsensitive)) { + m_flag = COREDUMP; + m_pLogBackend->setFlag(m_flag); } } @@ -1505,13 +1737,6 @@ void DisplayContent::slot_logCatelogueClicked(const QModelIndex &index) */ void DisplayContent::slot_exportClicked() { - LogExportThread *exportThread = new LogExportThread(m_isDataLoadComplete, this); - connect(m_exportDlg, &ExportProgressDlg::sigCloseBtnClicked, exportThread, &LogExportThread::stopImmediately); - connect(m_exportDlg, &ExportProgressDlg::buttonClicked, exportThread, &LogExportThread::stopImmediately); - connect(exportThread, &LogExportThread::sigResult, this, &DisplayContent::onExportResult); - connect(exportThread, &LogExportThread::sigProgress, this, &DisplayContent::onExportProgress); - connect(exportThread, &LogExportThread::sigProcessFull, this, &DisplayContent::onExportFakeCloseDlg); - QString logName; if (m_curListIdx.isValid()) logName = QString("/%1").arg(m_curListIdx.data().toString()); @@ -1519,280 +1744,157 @@ void DisplayContent::slot_exportClicked() logName = QString("/%1").arg(("New File")); } - QString path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + logName + ".txt"; - QString fileName = DFileDialog::getSaveFileName( - this, DApplication::translate("File", "Export File"), - path, - tr("TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html)"), &selectFilter); + QString path, fileName; + if (m_flag != COREDUMP) { + path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + logName + ".txt"; + fileName = DFileDialog::getSaveFileName( + this, DApplication::translate("File", "Export File"), + path, + tr("TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html)"), &selectFilter); + } else { + path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + logName + ".zip"; + fileName = DFileDialog::getSaveFileName( + this, DApplication::translate("File", "Export File"), + path, + tr("zip(*.zip)"), &selectFilter); + } + + if (fileName.isEmpty()) { + DApplication::setActiveWindow(this); + return; + } //限制当导出文件为空和导出doc和xls时用户改动后缀名导致导出问题,提示导出失败 QFileInfo exportFile(fileName); QString exportSuffix = exportFile.suffix(); QString selectSuffix = selectFilter.mid(selectFilter.lastIndexOf(".") + 1, selectFilter.size() - selectFilter.lastIndexOf(".") - 2); - if (fileName.isEmpty()) + if (fileName.isEmpty()) { + onExportResult(false); return; + } //用户修改后缀名后添加默认的后缀 if (selectSuffix != exportSuffix) { fileName.append(".").append(selectSuffix); } - m_exportDlg->show(); + + // 获取表头内容 QStringList labels; for (int col = 0; col < m_pModel->columnCount(); ++col) { labels.append(m_pModel->horizontalHeaderItem(col)->text()); } - //根据导出格式判断执行逻辑 - if (selectFilter.contains("(*.txt)")) { - switch (m_flag) { - //根据导出日志类型执行正确的导出逻辑 - case JOURNAL: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(jList.count())); - exportThread->exportToTxtPublic(fileName, jList, labels, m_flag); - break; - case BOOT_KLU: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(jBootList.count())); - exportThread->exportToTxtPublic(fileName, jBootList, labels, JOURNAL); - break; - case APP: { - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(appList.count())); - QString appName = getAppName(m_curAppLog); - exportThread->exportToTxtPublic(fileName, appList, labels, appName); - break; - } - case DPKG: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dList.count())); - exportThread->exportToTxtPublic(fileName, dList, labels); - break; - case BOOT: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(currentBootList.count())); - exportThread->exportToTxtPublic(fileName, currentBootList, labels); - break; - case XORG: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(xList.count())); - exportThread->exportToTxtPublic(fileName, xList, labels); - break; - case Normal: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(nortempList.count())); - exportThread->exportToTxtPublic(fileName, nortempList, labels); - break; - case KERN: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(kList.count())); - exportThread->exportToTxtPublic(fileName, kList, labels, m_flag); - break; - case Kwin: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(m_currentKwinList.count())); - exportThread->exportToTxtPublic(fileName, m_currentKwinList, labels); - break; - case Dmesg: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); - exportThread->exportToTxtPublic(fileName, dmesgList, labels); - break; - case Dnf: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); - exportThread->exportToTxtPublic(fileName, dnfList, labels); - break; - default: - break; - } - QThreadPool::globalInstance()->start(exportThread); - } else if (selectFilter.contains("(*.html)")) { - switch (m_flag) { - case JOURNAL: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(jList.count())); - exportThread->exportToHtmlPublic(fileName, jList, labels, m_flag); - break; - case BOOT_KLU: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(jBootList.count())); - exportThread->exportToHtmlPublic(fileName, jBootList, labels, JOURNAL); - break; - case APP: { - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(appList.count())); - QString appName = getAppName(m_curAppLog); - exportThread->exportToHtmlPublic(fileName, appList, labels, appName); - break; - } - case DPKG: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(dList.count())); - exportThread->exportToHtmlPublic(fileName, dList, labels); - break; - case BOOT: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(currentBootList.count())); - exportThread->exportToHtmlPublic(fileName, currentBootList, labels); - break; - case XORG: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(xList.count())); - exportThread->exportToHtmlPublic(fileName, xList, labels); - break; - case Normal: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(nortempList.count())); - exportThread->exportToHtmlPublic(fileName, nortempList, labels); - break; - case KERN: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(kList.count())); - exportThread->exportToHtmlPublic(fileName, kList, labels, m_flag); - break; - case Kwin: - PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(m_currentKwinList.count())); - exportThread->exportToHtmlPublic(fileName, m_currentKwinList, labels); - break; - case Dmesg: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); - exportThread->exportToHtmlPublic(fileName, dmesgList, labels); - break; - case Dnf: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); - exportThread->exportToHtmlPublic(fileName, dnfList, labels); - break; - default: - break; - } - QThreadPool::globalInstance()->start(exportThread); - } else if (selectFilter.contains("(*.doc)")) { - switch (m_flag) { - case JOURNAL: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(jList.count())); - exportThread->exportToDocPublic(fileName, jList, labels, m_flag); - break; - case BOOT_KLU: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(jBootList.count())); - exportThread->exportToDocPublic(fileName, jBootList, labels, JOURNAL); - break; - case APP: { - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(appList.count())); - QString appName = getAppName(m_curAppLog); - exportThread->exportToDocPublic(fileName, appList, labels, appName); - break; - } - case DPKG: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(dList.count())); - exportThread->exportToDocPublic(fileName, dList, labels); - break; - case BOOT: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(currentBootList.count())); - exportThread->exportToDocPublic(fileName, currentBootList, labels); - break; - case XORG: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(xList.count())); - exportThread->exportToDocPublic(fileName, xList, labels); - break; - case Normal: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(nortempList.count())); - exportThread->exportToDocPublic(fileName, nortempList, labels); - break; - case KERN: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(kList.count())); - exportThread->exportToDocPublic(fileName, kList, labels, m_flag); - break; - case Kwin: - PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(m_currentKwinList.count())); - exportThread->exportToDocPublic(fileName, m_currentKwinList, labels); - break; - case Dmesg: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); - exportThread->exportToDocPublic(fileName, dmesgList, labels); - break; - case Dnf: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); - exportThread->exportToDocPublic(fileName, dnfList, labels); - break; - default: - break; - } - QThreadPool::globalInstance()->start(exportThread); - } else if (selectFilter.contains("(*.xls)")) { - switch (m_flag) { - case JOURNAL: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(jList.count())); - exportThread->exportToXlsPublic(fileName, jList, labels, m_flag); - break; - case BOOT_KLU: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(jBootList.count())); - exportThread->exportToXlsPublic(fileName, jBootList, labels, JOURNAL); - break; - case APP: { - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(appList.count())); - QString appName = getAppName(m_curAppLog); - exportThread->exportToXlsPublic(fileName, appList, labels, appName); - break; - } - case DPKG: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(dList.count())); - exportThread->exportToXlsPublic(fileName, dList, labels); - break; - case BOOT: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(currentBootList.count())); - exportThread->exportToXlsPublic(fileName, currentBootList, labels); - break; - case XORG: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(xList.count())); - exportThread->exportToXlsPublic(fileName, xList, labels); - break; - case Normal: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(nortempList.count())); - exportThread->exportToXlsPublic(fileName, nortempList, labels); - break; - case KERN: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(kList.count())); - exportThread->exportToXlsPublic(fileName, kList, labels, m_flag); - break; - case Kwin: - PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(m_currentKwinList.count())); - exportThread->exportToXlsPublic(fileName, m_currentKwinList, labels); - break; - case Dmesg: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); - exportThread->exportToXlsPublic(fileName, dmesgList, labels); - break; - case Dnf: - PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); - exportThread->exportToXlsPublic(fileName, dnfList, labels); - break; - default: - break; - } - QThreadPool::globalInstance()->start(exportThread); - } + + // 后端导出当前页日志数据 + m_pLogBackend->exportLogData(fileName, labels); + + // 若有分段数据,开启分段导出 + m_pLogBackend->segementExport(); } /** * @brief DisplayContent::slot_statusChagned 启动日志的状态combox选项改变槽函数,筛选当前启动日志内容 * @param status 筛选的状态,有all ok failed */ -void DisplayContent::slot_statusChagned(QString status) +void DisplayContent::slot_statusChagned(const QString &status) { - m_bootFilter.statusFilter = status; - currentBootList = filterBoot(m_bootFilter, bList); + m_pLogBackend->m_bootFilter.statusFilter = status; + m_pLogBackend->currentBootList = LogBackend::filterBoot(m_pLogBackend->m_bootFilter, m_pLogBackend->bList); createBootTableForm(); - createBootTable(currentBootList); + createBootTable(m_pLogBackend->currentBootList); +} + +void DisplayContent::slot_parseFinished(LOG_FLAG type, int status) +{ + if (m_flag != type) + return; + + qCDebug(logDisplaycontent) << QString("parse finished m_type2LogData[%1] dataCount: %2 segement index: %3").arg(type).arg(m_pLogBackend->m_type2LogData[type].count()).arg(m_pLogBackend->m_type2Filter[type].segementIndex); + + int nSegementIndex = -1; + // 取消鉴权时,若导出进度条存在,则隐藏 + if (status == ParseThreadBase::CancelAuth) { + if (m_exportDlg && !m_exportDlg->isHidden()) { + m_exportDlg->hide(); + DApplication::setActiveWindow(this); + } + } else { + // 分段加载逻辑处理 + if (m_treeView->verticalScrollBar()->maximum() == 0 || m_pModel->rowCount() < TREE_NORMAL_COUNT) { + // 数据未填满表格显示区域,分段加载下一段数据 + nSegementIndex = loadSegementPage(true, false); + } + } + + // 已加载到文件末尾,依然没有数据,则创建空表显示,若有关键词搜索,则显示无搜索结果 + if (nSegementIndex == -1) { + if (m_pLogBackend->m_type2LogData[type].isEmpty()) { + if (!m_pLogBackend->m_currentSearchStr.isEmpty()) { + setLoadState(DATA_NO_SEARCH_RESULT); + } else { + setLoadState(DATA_COMPLETE); + createLogTable(m_pLogBackend->m_type2LogData[type], type); + } + m_detailWgt->cleanText(); + m_detailWgt->hideLine(true); + } else { + setLoadState(DATA_COMPLETE); + m_detailWgt->hideLine(false); + } + + qCDebug(logDisplaycontent) << QString("parse/search end... type:[%1]").arg(type); + } +} + +void DisplayContent::slot_logData(const QList &list, LOG_FLAG type) +{ + if (m_flag != type) + return; + + if (!list.isEmpty()) { + int rowCount = m_pModel->rowCount(); + if (rowCount == 0) + createLogTable(list, type); + else if (rowCount < SINGLE_READ_CNT) { + int loadCount = SINGLE_READ_CNT - rowCount; + insertLogTable(list, 0, loadCount, type); + } + } +} + +void DisplayContent::slot_clearTable() +{ + m_pModel->clear(); + if (m_flag == KERN) + createKernTableForm(); + else if (m_flag == Kwin) + createKwinTableForm(); } /** * @brief DisplayContent::slot_dpkgFinished 获取dpkg日志数据线程结果的槽函数,把获取到的数据加入treeview的model中以显示 */ -void DisplayContent::slot_dpkgFinished(int index) +void DisplayContent::slot_dpkgFinished() { - if (m_flag != DPKG || index != m_dpkgCurrentIndex) + if (m_flag != DPKG) return; m_isDataLoadComplete = true; - if (dList.isEmpty()) { + if (m_pLogBackend->dList.isEmpty()) { setLoadState(DATA_COMPLETE); - createDpkgTableStart(dList); + createDpkgTableStart(m_pLogBackend->dList); } } -void DisplayContent::slot_dpkgData(int index, QList list) +void DisplayContent::slot_dpkgData(const QList &list) { - if (m_flag != DPKG || index != m_dpkgCurrentIndex) + if (m_flag != DPKG) return; - dListOrigin.append(list); - dList.append(filterDpkg(m_currentSearchStr, list)); //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createDpkgTableStart(dList); + if (m_firstLoadPageData && !list.isEmpty()) { + createDpkgTableStart(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=dpkg"); } @@ -1801,26 +1903,25 @@ void DisplayContent::slot_dpkgData(int index, QList list) /** * @brief DisplayContent::slot_XorgFinished 获取xorg日志数据线程获取结束 */ -void DisplayContent::slot_XorgFinished(int index) +void DisplayContent::slot_XorgFinished() { - if (m_flag != XORG || index != m_xorgCurrentIndex) + if (m_flag != XORG) return; m_isDataLoadComplete = true; - if (xList.isEmpty()) { + if (m_pLogBackend->xList.isEmpty()) { setLoadState(DATA_COMPLETE); - createXorgTable(xList); + createXorgTable(m_pLogBackend->xList); } } -void DisplayContent::slot_xorgData(int index, QList list) +void DisplayContent::slot_xorgData(const QList &list) { - if (m_flag != XORG || index != m_xorgCurrentIndex) + if (m_flag != XORG) return; - xListOrigin.append(list); - xList.append(filterXorg(m_currentSearchStr, list)); + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createXorgTable(xList); + if (m_firstLoadPageData && !list.isEmpty()) { + createXorgTable(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=xorg"); } @@ -1829,28 +1930,25 @@ void DisplayContent::slot_xorgData(int index, QList list) /** * @brief DisplayContent::slot_bootFinished 获取启动日志数据线程结果的槽函数,把获取到的数据加入treeview的model中以显示 */ -void DisplayContent::slot_bootFinished(int index) +void DisplayContent::slot_bootFinished() { - if (m_flag != BOOT || index != m_bootCurrentIndex) + if (m_flag != BOOT) return; m_isDataLoadComplete = true; - if (currentBootList.isEmpty()) { + if (m_pLogBackend->currentBootList.isEmpty()) { setLoadState(DATA_COMPLETE); - createBootTable(currentBootList); + createBootTable(m_pLogBackend->currentBootList); } } -void DisplayContent::slot_bootData(int index, QList list) +void DisplayContent::slot_bootData(const QList &list) { - if (m_flag != BOOT || index != m_bootCurrentIndex) + if (m_flag != BOOT) return; - bList.append(list); - - currentBootList.append(filterBoot(m_bootFilter, list)); //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createBootTable(currentBootList); + if (m_firstLoadPageData && !list.isEmpty()) { + createBootTable(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=boot"); } @@ -1860,27 +1958,25 @@ void DisplayContent::slot_bootData(int index, QList list) * @brief DisplayContent::slot_kernFinished 获取内核日志数据线程结果的槽函数,把获取到的数据加入treeview的model中以显示 * @param list 启动日志数据线程list */ -void DisplayContent::slot_kernFinished(int index) +void DisplayContent::slot_kernFinished() { - if (m_flag != KERN || index != m_kernCurrentIndex) + if (m_flag != KERN) return; m_isDataLoadComplete = true; - if (kList.isEmpty()) { + if (m_pLogBackend->kList.isEmpty()) { setLoadState(DATA_COMPLETE); - createKernTable(kList); + createKernTable(m_pLogBackend->kList); } } -void DisplayContent::slot_kernData(int index, QList list) +void DisplayContent::slot_kernData(const QList &list) { - if (m_flag != KERN || index != m_kernCurrentIndex) + if (m_flag != KERN) return; - kListOrigin.append(list); - kList.append(filterKern(m_currentSearchStr, list)); //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createKernTable(kList); + if (m_firstLoadPageData && !list.isEmpty()) { + createKernTable(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=kern"); } @@ -1890,58 +1986,55 @@ void DisplayContent::slot_kernData(int index, QList list) * @brief DisplayContent::slot_kwinFinished 获取kwin日志数据线程结果的槽函数,把获取到的数据加入treeview的model中以显示 * @param list kwin日志数据线程list */ -void DisplayContent::slot_kwinFinished(int index) +void DisplayContent::slot_kwinFinished() { - if (m_flag != Kwin || index != m_kwinCurrentIndex) + if (m_flag != Kwin) return; m_isDataLoadComplete = true; - if (m_currentKwinList.isEmpty()) { + if (m_pLogBackend->m_currentKwinList.isEmpty()) { setLoadState(DATA_COMPLETE); - creatKwinTable(m_currentKwinList); + creatKwinTable(m_pLogBackend->m_currentKwinList); } } -void DisplayContent::slot_kwinData(int index, QList list) +void DisplayContent::slot_kwinData(const QList &list) { - if (m_flag != Kwin || index != m_kwinCurrentIndex) + if (m_flag != Kwin) return; - m_kwinList.append(list); - m_currentKwinList.append(filterKwin(m_currentSearchStr, list)); - if (m_firstLoadPageData) { - creatKwinTable(m_currentKwinList); + + if (m_firstLoadPageData && !list.isEmpty()) { + creatKwinTable(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=kwin"); } } -void DisplayContent::slot_journalFinished(int index) +void DisplayContent::slot_journalFinished() { - if (m_flag != JOURNAL || index != m_journalCurrentIndex) + if (m_flag != JOURNAL) return; m_isDataLoadComplete = true; - if (jList.isEmpty()) { + if (m_pLogBackend->jList.isEmpty()) { setLoadState(DATA_COMPLETE); - createJournalTableStart(jList); + createJournalTableStart(m_pLogBackend->jList); } } -void DisplayContent::slot_dnfFinished(QList list) +void DisplayContent::slot_dnfFinished(const QList &list) { if (m_flag != Dnf) return; - dnfList = list; - dnfListOrigin = list; - createDnfTable(dnfList); + + createDnfTable(list); PERF_PRINT_END("POINT-03", "type=dnf"); } -void DisplayContent::slot_dmesgFinished(QList list) +void DisplayContent::slot_dmesgFinished(const QList &list) { if (m_flag != Dmesg) return; - dmesgList = list; - dmesgListOrigin = list; - createDmesgTable(dmesgList); + + createDmesgTable(list); PERF_PRINT_END("POINT-03", "type=dmesg"); } @@ -1950,30 +2043,29 @@ void DisplayContent::slot_dmesgFinished(QList list) * @param index 槽函数发出线程的标记量序号 * @param list 本次获取的500个或以下的数据 */ -void DisplayContent::slot_journalData(int index, QList list) +void DisplayContent::slot_journalData(const QList &list) { //判断最近一次获取数据线程的标记量,和信号曹发来的sender的标记量作对比,如果相同才可以刷新,因为会出现上次的获取线程就算停下信号也发出来了 - if (m_flag != JOURNAL || index != m_journalCurrentIndex) + if (m_flag != JOURNAL) return; - jListOrigin.append(list); - jList.append(filterJournal(m_currentSearchStr, list)); + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createJournalTableStart(jList); + if (m_firstLoadPageData && !list.isEmpty()) { + createJournalTableStart(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-01", ""); PERF_PRINT_END("POINT-03", "type=system"); } } -void DisplayContent::slot_journalBootFinished(int index) +void DisplayContent::slot_journalBootFinished() { - if (m_flag != BOOT_KLU || index != m_journalBootCurrentIndex) + if (m_flag != BOOT_KLU) return; m_isDataLoadComplete = true; - if (jBootList.isEmpty()) { + if (m_pLogBackend->jBootList.isEmpty()) { setLoadState(DATA_COMPLETE); - createJournalBootTableStart(jBootList); + createJournalBootTableStart(m_pLogBackend->jBootList); } } @@ -1982,15 +2074,14 @@ void DisplayContent::slot_journalBootFinished(int index) * @param index 槽函数发出线程的标记量序号 * @param list 本次获取的500个或以下的数据 */ -void DisplayContent::slot_journalBootData(int index, QList list) +void DisplayContent::slot_journalBootData(const QList &list) { - if (m_flag != BOOT_KLU || index != m_journalBootCurrentIndex) + if (m_flag != BOOT_KLU) return; - jBootListOrigin.append(list); - jBootList.append(filterJournalBoot(m_currentSearchStr, list)); + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createJournalBootTableStart(jBootList); + if (m_firstLoadPageData && !list.isEmpty()) { + createJournalBootTableStart(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=boot_klu"); } @@ -1999,86 +2090,155 @@ void DisplayContent::slot_journalBootData(int index, QList list /** * @brief DisplayContent::slot_applicationFinished 获取应用日志数据线程结果的槽函数,把获取到的数据加入treeview的model中以显示 */ -void DisplayContent::slot_applicationFinished(int index) +void DisplayContent::slot_applicationFinished() { - if (m_flag != APP || index != m_appCurrentIndex) + if (m_flag != APP) return; m_isDataLoadComplete = true; - if (appList.isEmpty()) { + if (m_pLogBackend->appList.isEmpty()) { setLoadState(DATA_COMPLETE); - createAppTable(appList); + createAppTable(m_pLogBackend->appList); } } -void DisplayContent::slot_applicationData(int index, QList list) +void DisplayContent::slot_applicationData(const QList &list) { - if (m_flag != APP || index != m_appCurrentIndex) + if (m_flag != APP) return; - appListOrigin.append(list); - appList.append(filterApp(m_currentSearchStr, list)); + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createAppTable(appList); + if (m_firstLoadPageData && !list.isEmpty()) { + createAppTable(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=application"); } } -void DisplayContent::slot_normalFinished(int index) +void DisplayContent::slot_normalFinished() { - if (m_flag != Normal || index != m_normalCurrentIndex) + if (m_flag != Normal) return; m_isDataLoadComplete = true; - if (nortempList.isEmpty()) { + if (m_pLogBackend->nortempList.isEmpty()) { setLoadState(DATA_COMPLETE); - createNormalTable(nortempList); + createNormalTable(m_pLogBackend->nortempList); } } -void DisplayContent::slot_normalData(int index, QList list) +void DisplayContent::slot_normalData(const QList &list) { - if (m_flag != Normal || index != m_normalCurrentIndex) + if (m_flag != Normal) return; - norList.append(list); - nortempList.append(filterNomal(m_normalFilter, list)); + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 - if (m_firstLoadPageData) { - createNormalTable(nortempList); + if (m_firstLoadPageData && !list.isEmpty()) { + createNormalTable(list); m_firstLoadPageData = false; PERF_PRINT_END("POINT-03", "type=on_off"); } } -void DisplayContent::slot_OOCData(int index, const QString & data) +void DisplayContent::slot_OOCData(const QString &data) { - if ((m_flag != OtherLog && m_flag != CustomLog) || index != m_OOCCurrentIndex) + if ((m_flag != OtherLog && m_flag != CustomLog)) return; - emit sigDetailInfo(m_treeView->selectionModel()->selectedRows().first(), m_pModel, data); + if (!m_treeView->selectionModel()->selectedRows().isEmpty()) + emit sigDetailInfo(m_treeView->selectionModel()->selectedRows().first(), m_pModel, data); } -void DisplayContent::slot_OOCFinished(int index, int error) +void DisplayContent::slot_auditFinished(bool bShowTip/* = false*/) { - if ((m_flag != OtherLog && m_flag != CustomLog) || index != m_OOCCurrentIndex) + if (m_flag != Audit) return; m_isDataLoadComplete = true; - setLoadState(DATA_COMPLETE); - - //未通过鉴权在日志区域显示文案:无权限查看 - if (error == 1) { - emit sigDetailInfo(m_treeView->selectionModel()->selectedRows().first(), m_pModel, DApplication::translate("Warning", "You do not have permission to view it")); + if (m_pLogBackend->aList.isEmpty()) { + if (bShowTip) { + createAuditTable(m_pLogBackend->aList); + QTimer::singleShot(50, this, [=]{ + setLoadState(DATA_NOT_AUDIT_ADMIN); + }); + m_detailWgt->cleanText(); + m_detailWgt->hideLine(true); + } else { + setLoadState(DATA_COMPLETE); + createAuditTable(m_pLogBackend->aList); + } } } -/** - * @brief DisplayContent::slot_logLoadFailed 数据获取失败槽函数,显示错误提示框 - * @param iError 错误信息 - */ -void DisplayContent::slot_logLoadFailed(const QString &iError) +void DisplayContent::slot_auditData(const QList &list) { - QString titleIcon = ICONPREFIX; - DMessageManager::instance()->sendMessage(this->window(), QIcon(titleIcon + "warning_info.svg"), iError); -} + if (m_flag != Audit) + return; + + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 + if (m_firstLoadPageData && !list.isEmpty()) { + createAuditTable(list); + m_firstLoadPageData = false; + PERF_PRINT_END("POINT-03", "type=audit"); + } +} + +void DisplayContent::slot_coredumpFinished() +{ + if (m_flag != COREDUMP) + return; + + m_isDataLoadComplete = true; + if (m_pLogBackend->m_currentCoredumpList.isEmpty()) { + setLoadState(DATA_COMPLETE); + emit setExportEnable(false); + createCoredumpTable(m_pLogBackend->m_currentCoredumpList); + } +} +void DisplayContent::slot_coredumpData(const QList &list, bool newData) +{ + if (m_flag != COREDUMP) + return; + + //分页已到底部,来新数据时需要刷新到下一页 + int value = m_treeView->verticalScrollBar()->value(); + int maximum = m_treeView->verticalScrollBar()->maximum(); + if (value == maximum && value > 0 && newData) { + int rateValue = (m_treeViewLastScrollValue + 25) / SINGLE_LOAD; + int leftCnt = list.count() - SINGLE_LOAD * rateValue; + int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; + m_limitTag = rateValue; + insertCoredumpTable(list, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + } + + //因为此槽会在同一次加载数据完成前触发数次,所以第一次收到数据需要更新界面状态,后面的话往model里塞数据就行 + if (m_firstLoadPageData && !list.isEmpty()) { + createCoredumpTable(list); + m_firstLoadPageData = false; + PERF_PRINT_END("POINT-03", "type=coredump"); + } +} + +void DisplayContent::slot_OOCFinished(int error) +{ + if ((m_flag != OtherLog && m_flag != CustomLog)) + return; + m_isDataLoadComplete = true; + setLoadState(DATA_COMPLETE); + + //未通过鉴权在日志区域显示文案:无权限查看 + if (error == 1) { + clearAllDatas(); + setLoadState(DATA_NO_PERMISSION); + } +} + +/** + * @brief DisplayContent::slot_logLoadFailed 数据获取失败槽函数,显示错误提示框 + * @param iError 错误信息 + */ +void DisplayContent::slot_logLoadFailed(const QString &iError) +{ + QString titleIcon = ICONPREFIX; + DMessageManager::instance()->sendMessage(this->window(), QIcon(titleIcon + "warning_info.svg"), iError); +} /** * @brief DisplayContent::slot_vScrollValueChanged 滚动条滚动实现分页加载数据槽函数 @@ -2100,6 +2260,19 @@ void DisplayContent::slot_vScrollValueChanged(int valuePixel) m_treeViewLastScrollValue = value; //算出现在滚动了多少页 int rateValue = (value + 25) / SINGLE_LOAD; + + // 滚动到顶部,启动向上分段加载 + if (m_treeView->verticalScrollBar()->minimum() == m_treeView->verticalScrollBar()->value() && 0 == rateValue) { + loadSegementPage(false); + return; + } + + // 滚动到底部,启动向下分段加载 + if (m_treeView->verticalScrollBar()->maximum() == m_treeView->verticalScrollBar()->value()) { + loadSegementPage(); + return; + } + switch (m_flag) { case JOURNAL: { //如果快滚到页底了就加载下一页数据到表格中 @@ -2107,134 +2280,199 @@ void DisplayContent::slot_vScrollValueChanged(int valuePixel) if (m_limitTag >= rateValue) return; - int leftCnt = jList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->jList.count() - SINGLE_LOAD * rateValue; //如果在页尾部则只加载最后一页的数量,否则加载单页全部数量 int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - qDebug() << "rate" << rateValue; //把数据加入model中 - insertJournalTable(jList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertJournalTable(m_pLogBackend->jList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } update(); - } break; + } + break; case BOOT_KLU: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = jBootList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->jBootList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - qDebug() << "rate" << rateValue; - insertJournalBootTable(jBootList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertJournalBootTable(m_pLogBackend->jBootList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case APP: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = appList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->appList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertApplicationTable(appList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertApplicationTable(m_pLogBackend->appList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case KERN: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = kList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->m_type2LogData[m_flag].count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertKernTable(kList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertLogTable(m_pLogBackend->m_type2LogData[m_flag], SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end, m_flag); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case DPKG: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = dList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->dList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertDpkgTable(dList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertDpkgTable(m_pLogBackend->dList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case XORG: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = xList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->xList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertXorgTable(xList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertXorgTable(m_pLogBackend->xList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case BOOT: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = currentBootList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->currentBootList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertBootTable(currentBootList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertBootTable(m_pLogBackend->currentBootList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case Kwin: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = m_currentKwinList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->m_type2LogData[m_flag].count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertKwinTable(m_currentKwinList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertLogTable(m_pLogBackend->m_type2LogData[m_flag], SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end, m_flag); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case Normal: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = nortempList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->nortempList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertNormalTable(nortempList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertNormalTable(m_pLogBackend->nortempList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(valuePixel); } - } break; + } + break; case Dnf: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = dnfList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->dnfList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertDnfTable(dnfList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertDnfTable(m_pLogBackend->dnfList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(value); } - } break; + } + break; case Dmesg: { if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { if (m_limitTag >= rateValue) return; - int leftCnt = dmesgList.count() - SINGLE_LOAD * rateValue; + int leftCnt = m_pLogBackend->dmesgList.count() - SINGLE_LOAD * rateValue; int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; - insertDmesgTable(dmesgList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + insertDmesgTable(m_pLogBackend->dmesgList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); m_limitTag = rateValue; m_treeView->verticalScrollBar()->setValue(value); } - } break; + } + break; + case OtherLog: { + if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { + if (m_limitTag >= rateValue) + return; + + int leftCnt = m_pLogBackend->oList.count() - SINGLE_LOAD * rateValue; + int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; + + insertOOCTable(m_pLogBackend->oList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + m_limitTag = rateValue; + m_treeView->verticalScrollBar()->setValue(valuePixel); + } + } + break; + case CustomLog: { + if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { + if (m_limitTag >= rateValue) + return; + + int leftCnt = m_pLogBackend->cList.count() - SINGLE_LOAD * rateValue; + int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; + + insertOOCTable(m_pLogBackend->cList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + m_limitTag = rateValue; + m_treeView->verticalScrollBar()->setValue(valuePixel); + } + } + break; + case Audit: { + if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { + if (m_limitTag >= rateValue) + return; + + int leftCnt = m_pLogBackend->aList.count() - SINGLE_LOAD * rateValue; + int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; + + insertAuditTable(m_pLogBackend->aList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + m_limitTag = rateValue; + m_treeView->verticalScrollBar()->setValue(valuePixel); + } + } + break; + case COREDUMP: { + if (value < SINGLE_LOAD * rateValue - 20 || value < SINGLE_LOAD * rateValue) { + if (m_limitTag >= rateValue) + return; + + int leftCnt = m_pLogBackend->m_currentCoredumpList.count() - SINGLE_LOAD * rateValue; + int end = leftCnt > SINGLE_LOAD ? SINGLE_LOAD : leftCnt; + + insertCoredumpTable(m_pLogBackend->m_currentCoredumpList, SINGLE_LOAD * rateValue, SINGLE_LOAD * rateValue + end); + m_limitTag = rateValue; + m_treeView->verticalScrollBar()->setValue(valuePixel); + } + } + break; default: break; } @@ -2244,113 +2482,173 @@ void DisplayContent::slot_vScrollValueChanged(int valuePixel) * @brief DisplayContent::slot_searchResult 搜索框执行搜索槽函数 * @param str 要搜索的关键字 */ -void DisplayContent::slot_searchResult(QString str) +void DisplayContent::slot_searchResult(const QString &str) { - qDebug() << QString("search: %1 treeIndex: %2") - .arg(str) - .arg(m_curListIdx.data(ITEM_DATE_ROLE).toString()); - m_currentSearchStr = str; + m_pLogBackend->m_currentSearchStr = str; if (m_flag == NONE) return; - if (str.isEmpty()) - return; + bool bHasNext = false; switch (m_flag) { case JOURNAL: { - jList = jListOrigin; - jList.clear(); - jList = filterJournal(m_currentSearchStr, jListOrigin); + m_pLogBackend->jList = m_pLogBackend->jListOrigin; + m_pLogBackend->jList.clear(); + m_pLogBackend->jList = LogBackend::filterJournal(m_pLogBackend->m_currentSearchStr, m_pLogBackend->jListOrigin); //清空model和分页重新加载 createJournalTableForm(); - createJournalTableStart(jList); - } break; + createJournalTableStart(m_pLogBackend->jList); + } + break; case BOOT_KLU: { - jBootList.clear(); - jBootList = filterJournalBoot(m_currentSearchStr, jBootListOrigin); + m_pLogBackend->jBootList.clear(); + m_pLogBackend->jBootList = LogBackend::filterJournalBoot(m_pLogBackend->m_currentSearchStr, m_pLogBackend->jBootListOrigin); createJournalBootTableForm(); - createJournalBootTableStart(jBootList); - } break; + createJournalBootTableStart(m_pLogBackend->jBootList); + } + break; + case Kwin: case KERN: { - kList = filterKern(m_currentSearchStr, kListOrigin); - createKernTableForm(); - createKernTable(kList); - } break; + qCDebug(logDisplaycontent) << QString("search start... keyword:%1").arg(str); + if (m_pLogBackend->m_type2Filter[m_flag].segementIndex == 0) { + // 刚好在分段首页,直接搜索,同老逻辑一样 + m_pLogBackend->m_type2LogData[m_flag] = LogBackend::filterLog(m_pLogBackend->m_currentSearchStr, m_pLogBackend->m_type2LogDataOrigin[m_flag]); + if (m_flag == KERN) + createKernTableForm(); + else if (m_flag == Kwin) + createKwinTableForm(); + createLogTable(m_pLogBackend->m_type2LogData[m_flag], m_flag); + } else if (m_pLogBackend->m_type2Filter[m_flag].segementIndex > 0) { + // 未在分段首页,重置索引,从头开始搜 + m_pLogBackend->m_type2Filter[m_flag].segementIndex = -1; + } + + // 显示转圈标记,加载中... + setLoadState(DATA_LOADING, true); + + // 开启分段加载和搜索数据 + // 若从头开始搜索,需要重置数据,相当于重新加载 + int segementIndex = loadSegementPage(true, m_pLogBackend->m_type2Filter[m_flag].segementIndex == -1); + bHasNext = segementIndex != -1; + } + break; case BOOT: { - m_bootFilter.searchstr = m_currentSearchStr; - currentBootList = filterBoot(m_bootFilter, bList); + m_pLogBackend->m_bootFilter.searchstr = m_pLogBackend->m_currentSearchStr; + m_pLogBackend->currentBootList = LogBackend::filterBoot(m_pLogBackend->m_bootFilter, m_pLogBackend->bList); createBootTableForm(); - createBootTable(currentBootList); - } break; + createBootTable(m_pLogBackend->currentBootList); + } + break; case XORG: { - xList.clear(); - xList = filterXorg(m_currentSearchStr, xListOrigin); + m_pLogBackend->xList.clear(); + m_pLogBackend->xList = LogBackend::filterXorg(m_pLogBackend->m_currentSearchStr, m_pLogBackend->xListOrigin); createXorgTableForm(); - createXorgTable(xList); - } break; + createXorgTable(m_pLogBackend->xList); + } + break; case DPKG: { - dList.clear(); - dList = filterDpkg(m_currentSearchStr, dListOrigin); + m_pLogBackend->dList.clear(); + m_pLogBackend->dList = LogBackend::filterDpkg(m_pLogBackend->m_currentSearchStr, m_pLogBackend->dListOrigin); createDpkgTableForm(); - createDpkgTableStart(dList); - } break; + createDpkgTableStart(m_pLogBackend->dList); + } + break; case APP: { - appList.clear(); - appList = filterApp(m_currentSearchStr, appListOrigin); + m_pLogBackend->appList.clear(); + m_pLogBackend->m_appFilter.searchstr = m_pLogBackend->m_currentSearchStr; + m_pLogBackend->appList = LogBackend::filterApp(m_pLogBackend->m_appFilter, m_pLogBackend->appListOrigin); createAppTableForm(); - createAppTable(appList); - } break; + createAppTable(m_pLogBackend->appList); + } + break; case Normal: { - m_normalFilter.searchstr = m_currentSearchStr; - nortempList = filterNomal(m_normalFilter, norList); + m_pLogBackend->m_normalFilter.searchstr = m_pLogBackend->m_currentSearchStr; + m_pLogBackend->nortempList = LogBackend::filterNomal(m_pLogBackend->m_normalFilter, m_pLogBackend->norList); createNormalTableForm(); - createNormalTable(nortempList); - } break; // add by Airy - case Kwin: { - m_currentKwinList.clear(); - m_currentKwinList = filterKwin(m_currentSearchStr, m_kwinList); - createKwinTableForm(); - creatKwinTable(m_currentKwinList); - } break; + createNormalTable(m_pLogBackend->nortempList); + } + break; // add by Airy case Dnf: { - dnfList = dnfListOrigin; - int cnt = dnfList.count(); - for (int i = cnt - 1; i >= 0; --i) { - LOG_MSG_DNF msg = dnfList.at(i); - if (msg.dateTime.contains(m_currentSearchStr, Qt::CaseInsensitive) || msg.msg.contains(m_currentSearchStr, Qt::CaseInsensitive) || msg.level.contains(m_currentSearchStr, Qt::CaseInsensitive)) - continue; - dnfList.removeAt(i); - } + m_pLogBackend->dnfList.clear(); + m_pLogBackend->dnfList = LogBackend::filterDnf(m_pLogBackend->m_currentSearchStr, m_pLogBackend->dnfListOrigin); createDnfForm(); - createDnfTable(dnfList); - } break; + createDnfTable(m_pLogBackend->dnfList); + } + break; case Dmesg: { - dmesgList = dmesgListOrigin; - int cnt = dmesgList.count(); - for (int i = cnt - 1; i >= 0; --i) { - LOG_MSG_DMESG msg = dmesgList.at(i); - if (msg.dateTime.contains(m_currentSearchStr, Qt::CaseInsensitive) || msg.msg.contains(m_currentSearchStr, Qt::CaseInsensitive)) - continue; - dmesgList.removeAt(i); - } + m_pLogBackend->dmesgList.clear(); + m_pLogBackend->dmesgList = LogBackend::filterDmesg(m_pLogBackend->m_currentSearchStr, m_pLogBackend->dmesgListOrigin); createDmesgForm(); - createDmesgTable(dmesgList); - } break; + createDmesgTable(m_pLogBackend->dmesgList); + } + break; + case OtherLog: { + m_pLogBackend->oList.clear(); + m_pLogBackend->oList = LogBackend::filterOOC(m_pLogBackend->m_currentSearchStr, m_pLogBackend->oListOrigin); + createOOCTableForm(); + createOOCTable(m_pLogBackend->oList); + } + break; + case CustomLog: { + m_pLogBackend->cList.clear(); + m_pLogBackend->cList = LogBackend::filterOOC(m_pLogBackend->m_currentSearchStr, m_pLogBackend->cListOrigin); + createOOCTableForm(); + createOOCTable(m_pLogBackend->cList); + } + break; + case Audit: { + m_pLogBackend->aList.clear(); + m_pLogBackend->m_auditFilter.searchstr = m_pLogBackend->m_currentSearchStr; + m_pLogBackend->aList = LogBackend::filterAudit(m_pLogBackend->m_auditFilter, m_pLogBackend->aListOrigin); + createAuditTableForm(); + createAuditTable(m_pLogBackend->aList); + } + break; + case COREDUMP: { + m_pLogBackend->m_currentCoredumpList.clear(); + m_pLogBackend->m_currentCoredumpList = LogBackend::filterCoredump(m_pLogBackend->m_currentSearchStr, m_pLogBackend->m_coredumpList); + createCoredumpTableForm(); + createCoredumpTable(m_pLogBackend->m_currentCoredumpList); + } + break; default: break; } //如果搜索结果为空要显示无搜索结果提示 if (0 == m_pModel->rowCount()) { - if (m_currentSearchStr.isEmpty()) { - setLoadState(DATA_COMPLETE); + if (m_pLogBackend->m_currentSearchStr.isEmpty()) { + if (m_flag != KERN && m_flag != Kwin) + setLoadState(DATA_COMPLETE); } else { - setLoadState(DATA_NO_SEARCH_RESULT); + if ((m_flag != KERN && m_flag != Kwin) || !bHasNext) + setLoadState(DATA_NO_SEARCH_RESULT); } m_detailWgt->cleanText(); m_detailWgt->hideLine(true); } else { - setLoadState(DATA_COMPLETE); - m_detailWgt->hideLine(false); + if ((m_flag != KERN && m_flag != Kwin) || !bHasNext) { + setLoadState(DATA_COMPLETE); + m_detailWgt->hideLine(false); + } + } +} + +/** + * @brief DisplayContent::slot_getSubmodule 应用日志筛选子模块型的选择槽函数,根据所选子模块显示对应应用日志内容 + * @param tcbx 子模块的索引 0全部, > 0 显示指定子模块内容 + */ +void DisplayContent::slot_getSubmodule(int tcbx) +{ + if (tcbx == 0) + m_pLogBackend->m_appFilter.submodule = ""; + else { + AppLogConfig logConfig = LogApplicationHelper::instance()->appLogConfig(m_pLogBackend->m_appFilter.app); + int nSubModuleIndex = tcbx - 1; + if (logConfig.subModules.size() > 0 && nSubModuleIndex < logConfig.subModules.size()) + m_pLogBackend->m_appFilter.submodule = logConfig.subModules[nSubModuleIndex].name; } + m_pLogBackend->appList = LogBackend::filterApp(m_pLogBackend->m_appFilter, m_pLogBackend->appListOrigin); + createAppTableForm(); + createAppTable(m_pLogBackend->appList); } /** @@ -2359,10 +2657,20 @@ void DisplayContent::slot_searchResult(QString str) */ void DisplayContent::slot_getLogtype(int tcbx) { - m_normalFilter.eventTypeFilter = tcbx; - nortempList = filterNomal(m_normalFilter, norList); + m_curNormalEventType = tcbx; + m_pLogBackend->m_normalFilter.eventTypeFilter = tcbx; + m_pLogBackend->nortempList = LogBackend::filterNomal(m_pLogBackend->m_normalFilter, m_pLogBackend->norList); createNormalTableForm(); - createNormalTable(nortempList); + createNormalTable(m_pLogBackend->nortempList); +} + +void DisplayContent::slot_getAuditType(int tcbx) +{ + m_curAuditType = tcbx; + m_pLogBackend->m_auditFilter.auditTypeFilter = tcbx; + m_pLogBackend->aList = LogBackend::filterAudit(m_pLogBackend->m_auditFilter, m_pLogBackend->aListOrigin); + createAuditTableForm(); + createAuditTable(m_pLogBackend->aList); } /** @@ -2370,14 +2678,14 @@ void DisplayContent::slot_getLogtype(int tcbx) * @param iList 要加入model中的原始数据 * @param oPModel 要增加数据的model指针 */ -void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) +void DisplayContent::parseListToModel(const QList &iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "dpkg parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "dpkg parse model data is empty"; return; } QList list = iList; @@ -2407,15 +2715,15 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemMo * @param iList 要加入model中的原始数据 * @param oPModel 要增加数据的model指针 */ -void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) +void DisplayContent::parseListToModel(const QList &iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "boot parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "boot parse model data is empty"; return; } QList list = iList; @@ -2443,12 +2751,12 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemMo void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "app log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "app log parse model data is empty"; return; } QList items; @@ -2471,7 +2779,11 @@ void DisplayContent::parseListToModel(QList iList, QStandar item->setData(APP_TABLE_DATA); item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(1)); items << item; - item = new DStandardItem(getAppName(m_curAppLog)); + //item = new DStandardItem(getAppName(m_curApp)); + item = new DStandardItem(iList[i].subModule); + // 若取不到子模块名称,则显示为应用名称 + if (iList[i].subModule.isEmpty()) + item->setText(getAppName(m_curApp)); item->setData(APP_TABLE_DATA); item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(2)); items << item; @@ -2492,12 +2804,12 @@ void DisplayContent::parseListToModel(QList iList, QStandar void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "xorg log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "xorg log parse model data is empty"; return; } DStandardItem *item = nullptr; @@ -2505,7 +2817,7 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemMo int listCount = iList.size(); for (int i = 0; i < listCount; i++) { items.clear(); - item = new DStandardItem(iList[i].dateTime); + item = new DStandardItem(iList[i].offset); item->setData(XORG_TABLE_DATA); item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(0)); items << item; @@ -2525,12 +2837,12 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemMo void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "boot-shutdown-event log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "boot-shutdown-event log parse model data is empty"; return; } DStandardItem *item = nullptr; @@ -2566,12 +2878,12 @@ void DisplayContent::parseListToModel(QList iList, QStandardItem void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "kwin log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "kwin log parse model data is empty"; return; } DStandardItem *item = nullptr; @@ -2590,12 +2902,12 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemMo void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "dnf log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "dnf log parse model data is empty"; return; } QList items; @@ -2626,12 +2938,12 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemMod void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "dmesg log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "dmesg log parse model data is empty"; return; } QList items; @@ -2661,12 +2973,12 @@ void DisplayContent::parseListToModel(QList iList, QStandardItemM void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "other log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "other log parse model data is empty"; return; } QList items; @@ -2685,11 +2997,98 @@ void DisplayContent::parseListToModel(QList iList, QStan } } +void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) +{ + if (!oPModel) { + qCWarning(logDisplaycontent) << "audit log parse model is empty"; + return; + } + + if (iList.isEmpty()) { + qCWarning(logDisplaycontent) << "audit log parse model data is empty"; + return; + } + QList items; + DStandardItem *item = nullptr; + int listCount = iList.size(); + for (int i = 0; i < listCount; i++) { + items.clear(); + item = new DStandardItem(iList[i].eventType); + item->setData(AUDIT_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(0)); + items << item; + item = new DStandardItem(iList[i].dateTime); + item->setData(AUDIT_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(1)); + items << item; + item = new DStandardItem(iList[i].processName); + item->setData(AUDIT_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(2)); + items << item; + item = new DStandardItem(iList[i].status); + item->setData(AUDIT_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(3)); + items << item; + item = new DStandardItem(iList[i].msg); + item->setData(AUDIT_TABLE_DATA); + item->setData(iList[i].origin, AUDIT_ORIGIN_DATAROLE); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(4)); + items << item; + oPModel->insertRow(oPModel->rowCount(), items); + } +} + +void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) +{ + if (!oPModel) { + qCWarning(logDisplaycontent) << "coredump log parse model is empty"; + return; + } + + if (iList.isEmpty()) { + qCWarning(logDisplaycontent) << "coredump log parse model data is empty"; + return; + } + QList items; + DStandardItem *item = nullptr; + int listCount = iList.size(); + for (int i = 0; i < listCount; i++) { + items.clear(); + + item = new DStandardItem(iList[i].sig); + item->setData(COREDUMP_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(0)); + items << item; + + item = new DStandardItem(iList[i].dateTime); + item->setData(COREDUMP_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(1)); + items << item; + + item = new DStandardItem(iList[i].coreFile); + item->setData(COREDUMP_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(2)); + items << item; + + item = new DStandardItem(iList[i].userName); + item->setData(COREDUMP_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(3)); + items << item; + + item = new DStandardItem(iList[i].exe); + item->setData(iList[i].storagePath, Qt::UserRole + 2); + item->setData(COREDUMP_TABLE_DATA); + item->setAccessibleText(QString("treeview_context_%1_%2").arg(i).arg(4)); + items << item; + oPModel->insertRow(oPModel->rowCount(), items); + } +} + /** * @brief DisplayContent::setLoadState 设置当前的显示状态 * @param iState 显示状态 */ -void DisplayContent::setLoadState(DisplayContent::LOAD_STATE iState) +void DisplayContent::setLoadState(DisplayContent::LOAD_STATE iState, bool bSearching/* = false*/) { if (!m_spinnerWgt->isHidden()) { m_spinnerWgt->spinnerStop(); @@ -2702,9 +3101,19 @@ void DisplayContent::setLoadState(DisplayContent::LOAD_STATE iState) if (!noResultLabel->isHidden()) { noResultLabel->hide(); } - if (!m_treeView->isHidden()) { - m_treeView->hide(); + if (!notAuditLabel->isHidden()) { + notAuditLabel->hide(); + } + if (!noCoredumpctlLabel->isHidden()) { + noCoredumpctlLabel->hide(); + } + if (!noPermissionLabel->isHidden()) { + noPermissionLabel->hide(); } + +// if (!m_treeView->isHidden()) { +// m_treeView->hide(); +// } switch (iState) { case DATA_LOADING: { //如果为正在加载,则不显示主表\搜索为空的提示lable,只显示加载的转圈动画控件,并且禁止导出,导出按钮置灰 @@ -2716,7 +3125,8 @@ void DisplayContent::setLoadState(DisplayContent::LOAD_STATE iState) m_treeView->show(); } else { m_detailWgt->show(); - m_treeView->hide(); + if (!bSearching || m_pModel->rowCount() == 0) + m_treeView->hide(); } break; } @@ -2725,6 +3135,7 @@ void DisplayContent::setLoadState(DisplayContent::LOAD_STATE iState) m_treeView->show(); m_detailWgt->show(); emit setExportEnable(true); + break; } case DATA_LOADING_K: { @@ -2737,9 +3148,38 @@ void DisplayContent::setLoadState(DisplayContent::LOAD_STATE iState) case DATA_NO_SEARCH_RESULT: { //如果为无搜索结果状态,则只显示无搜索结果的提示label m_treeView->show(); - noResultLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); - noResultLabel->show(); - emit setExportEnable(true); + QTimer::singleShot(50, this, [=]{ + noResultLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); + noResultLabel->show(); + noResultLabel->raise(); + }); + //搜索结果为空,导出按钮置灰 + emit setExportEnable(false); + break; + } + case DATA_NOT_AUDIT_ADMIN: { + // 开启等保四时,若当前用户不是审计管理员,给出提示 + m_treeView->show(); + notAuditLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); + notAuditLabel->show(); + notAuditLabel->raise(); + emit setExportEnable(false); + break; + } + case COREDUMPCTL_NOT_INSTALLED: { + m_treeView->show(); + noCoredumpctlLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); + noCoredumpctlLabel->show(); + noCoredumpctlLabel->raise(); + emit setExportEnable(false); + break; + } + case DATA_NO_PERMISSION: { + m_treeView->show(); + noPermissionLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); + noPermissionLabel->show(); + noPermissionLabel->raise(); + emit setExportEnable(false); break; } } @@ -2754,6 +3194,7 @@ void DisplayContent::onExportResult(bool isSuccess) { QString titleIcon = ICONPREFIX; if (m_exportDlg && !m_exportDlg->isHidden()) { + m_exportDlg->updateProgressBarValue(0); m_exportDlg->hide(); } @@ -2778,209 +3219,15 @@ void DisplayContent::onExportFakeCloseDlg() } } -/** - * @brief DisplayContent::clearAllFilter 清空当前所有的筛选条件成员变量(只限在本类中筛选的条件) - */ -void DisplayContent::clearAllFilter() -{ - m_bootFilter = {"", ""}; - m_currentSearchStr.clear(); - m_currentKwinFilter = {""}; - m_normalFilter.searchstr = ""; -} - /** * @brief DisplayContent::clearAllDatalist 清空所有获取的数据list */ -void DisplayContent::clearAllDatalist() +void DisplayContent::clearAllDatas() { m_detailWgt->cleanText(); m_pModel->clear(); - jList.clear(); - jListOrigin.clear(); - dList.clear(); - dListOrigin.clear(); - xList.clear(); - xListOrigin.clear(); - bList.clear(); - currentBootList.clear(); - kList.clear(); - kListOrigin.clear(); - appList.clear(); - appListOrigin.clear(); - norList.clear(); - nortempList.clear(); - m_currentKwinList.clear(); - m_kwinList.clear(); - jBootList.clear(); - jBootListOrigin.clear(); - dnfList.clear(); - dnfListOrigin.clear(); - malloc_trim(0); -} - -QList DisplayContent::filterBoot(BOOT_FILTERS ibootFilter, QList &iList) -{ - QList rsList; - bool isStatusFilterEmpty = ibootFilter.statusFilter.isEmpty(); - if (isStatusFilterEmpty && ibootFilter.searchstr.isEmpty()) { - return iList; - } else { - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_BOOT msg = iList.at(i); - QString _statusStr = msg.status; - qDebug() << "xxx" << msg.msg.contains(ibootFilter.searchstr, Qt::CaseInsensitive) << "--" << msg.msg; - if ((_statusStr.compare(ibootFilter.statusFilter, Qt::CaseInsensitive) != 0) && !isStatusFilterEmpty) - continue; - if ((msg.status.contains(ibootFilter.searchstr, Qt::CaseInsensitive)) || (msg.msg.contains(ibootFilter.searchstr, Qt::CaseInsensitive))) { - rsList.append(iList[i]); - } - } - } - return rsList; -} -QList DisplayContent::filterNomal(NORMAL_FILTERS inormalFilter, QList &iList) -{ - QList rsList; - if (inormalFilter.searchstr.isEmpty() && inormalFilter.eventTypeFilter < 0) { - return iList; - } - int tcbx = inormalFilter.eventTypeFilter; - if (0 == tcbx) { - for (auto i = 0; i < iList.size(); i++) { - LOG_MSG_NORMAL msg = iList.at(i); - if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { - rsList.append(msg); - } - } - } else if (1 == tcbx) { - for (auto i = 0; i < iList.size(); i++) { - LOG_MSG_NORMAL msg = iList.at(i); - if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { - if (msg.eventType.compare("Boot", Qt::CaseInsensitive) != 0 && msg.eventType.compare("shutdown", Qt::CaseInsensitive) != 0 && msg.eventType.compare("runlevel", Qt::CaseInsensitive) != 0) - rsList.append(msg); - } - } - } else if (2 == tcbx) { - for (auto i = 0; i < iList.size(); i++) { - LOG_MSG_NORMAL msg = iList.at(i); - if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { - if (iList[i].eventType.compare("Boot", Qt::CaseInsensitive) == 0) - rsList.append(iList[i]); - } - } - } else if (3 == tcbx) { - for (auto i = 0; i < iList.size(); i++) { - LOG_MSG_NORMAL msg = iList.at(i); - if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { - if (iList[i].eventType.compare("shutdown", Qt::CaseInsensitive) == 0) - rsList.append(iList[i]); - } - } - } - return rsList; -} - -QList DisplayContent::filterDpkg(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_DPKG msg = iList.at(i); - if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) { - rsList.append(msg); - } - } - return rsList; -} - -QList DisplayContent::filterKern(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_JOURNAL msg = iList.at(i); - if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.hostName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonName.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) { - rsList.append(msg); - } - } - return rsList; -} - -QList DisplayContent::filterXorg(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_XORG msg = iList.at(i); - if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) - rsList.append(msg); - } - return rsList; -} - -QList DisplayContent::filterKwin(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_KWIN msg = iList.at(i); - if (msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) - rsList.append(msg); - } - return rsList; -} - -QList DisplayContent::filterApp(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_APPLICATOIN msg = iList.at(i); - if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.level.contains(iSearchStr, Qt::CaseInsensitive) || msg.src.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) - rsList.append(msg); - } - return rsList; -} - -QList DisplayContent::filterJournal(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_JOURNAL msg = iList.at(i); - if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.hostName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonId.contains(iSearchStr, Qt::CaseInsensitive) || msg.level.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) - rsList.append(msg); - } - return rsList; -} - -QList DisplayContent::filterJournalBoot(const QString &iSearchStr, QList &iList) -{ - QList rsList; - if (iSearchStr.isEmpty()) { - return iList; - } - for (int i = 0; i < iList.size(); i++) { - LOG_MSG_JOURNAL msg = iList.at(i); - if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.hostName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonId.contains(iSearchStr, Qt::CaseInsensitive) || msg.level.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) - rsList.append(msg); - } - return rsList; + m_pLogBackend->clearAllDatalist(); } /** @@ -2990,18 +3237,15 @@ QList DisplayContent::filterJournalBoot(const QString &iSearchS */ void DisplayContent::onExportProgress(int nCur, int nTotal) { - LogExportThread *exportThread = nullptr; - if (sender()) { - exportThread = qobject_cast(sender()); - } - //如果导出线程不再运行则不处理此信号 - if (!m_exportDlg || !exportThread || !exportThread->isProcessing()) { + if (!m_exportDlg) { return; } + //弹窗 if (m_exportDlg->isHidden()) { m_exportDlg->show(); } + m_exportDlg->setProgressBarRange(0, nTotal); m_exportDlg->updateProgressBarValue(nCur); } @@ -3014,12 +3258,12 @@ void DisplayContent::onExportProgress(int nCur, int nTotal) void DisplayContent::parseListToModel(QList iList, QStandardItemModel *oPModel) { if (!oPModel) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "system log parse model is empty"; return; } if (iList.isEmpty()) { - qWarning() << "parse model is Empty" << __LINE__; + qCWarning(logDisplaycontent) << "system log parse model data is empty"; return; } DStandardItem *item = nullptr; @@ -3051,6 +3295,7 @@ void DisplayContent::resizeEvent(QResizeEvent *event) { Q_UNUSED(event) noResultLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); + notAuditLabel->resize(m_treeView->viewport()->width(), m_treeView->viewport()->height()); } /** @@ -3058,7 +3303,7 @@ void DisplayContent::resizeEvent(QResizeEvent *event) * @param str 日志等级字符串 * @return 日志等级图标文件名 */ -QString DisplayContent::getIconByname(QString str) +QString DisplayContent::getIconByname(const QString &str) { return m_icon_name_map.value(str); } @@ -3068,7 +3313,7 @@ void DisplayContent::createBootTableForm() m_pModel->clear(); m_pModel->setColumnCount(2); m_pModel->setHorizontalHeaderLabels(QStringList() << DApplication::translate("Table", "Status") - << DApplication::translate("Table", "Info")); + << DApplication::translate("Table", "Info")); m_treeView->setColumnWidth(0, STATUS_WIDTH); } @@ -3078,7 +3323,7 @@ void DisplayContent::createBootTableForm() * @param start 分页开始的数组下标 * @param end 分页结束的数组下标 */ -void DisplayContent::insertApplicationTable(QList list, int start, int end) +void DisplayContent::insertApplicationTable(const QList &list, int start, int end) { QList midList = list; if (end >= start) { @@ -3107,50 +3352,66 @@ void DisplayContent::slot_refreshClicked(const QModelIndex &index) if (itemData.contains(JOUR_TREE_DATA, Qt::CaseInsensitive)) { // default level is info so PRIORITY=6 m_flag = JOURNAL; + m_pLogBackend->setFlag(m_flag); generateJournalFile(m_curBtnId, m_curLevel); } else if (itemData.contains(DPKG_TREE_DATA, Qt::CaseInsensitive)) { m_flag = DPKG; + m_pLogBackend->setFlag(m_flag); generateDpkgFile(m_curBtnId); } else if (itemData.contains(XORG_TREE_DATA, Qt::CaseInsensitive)) { - xList.clear(); m_flag = XORG; + m_pLogBackend->setFlag(m_flag); generateXorgFile(m_curBtnId); } else if (itemData.contains(BOOT_TREE_DATA, Qt::CaseInsensitive)) { m_flag = BOOT; + m_pLogBackend->setFlag(m_flag); generateBootFile(); } else if (itemData.contains(KERN_TREE_DATA, Qt::CaseInsensitive)) { m_flag = KERN; + m_pLogBackend->setFlag(m_flag); generateKernFile(m_curBtnId); } else if (itemData.contains(".cache")) { - clearAllDatalist(); + clearAllDatas(); } else if (itemData.contains(APP_TREE_DATA, Qt::CaseInsensitive)) { - clearAllDatalist(); + clearAllDatas(); } else if (itemData.contains(LAST_TREE_DATA, Qt::CaseInsensitive)) { - norList.clear(); m_flag = Normal; + m_pLogBackend->setFlag(m_flag); generateNormalFile(m_curBtnId); } else if (itemData.contains(KWIN_TREE_DATA, Qt::CaseInsensitive)) { m_flag = Kwin; + m_pLogBackend->setFlag(m_flag); KWIN_FILTERS filter; filter.msg = ""; generateKwinFile(filter); } else if (itemData.contains(BOOT_KLU_TREE_DATA, Qt::CaseInsensitive)) { m_flag = BOOT_KLU; + m_pLogBackend->setFlag(m_flag); generateJournalBootFile(m_curLevel); } else if (itemData.contains(DNF_TREE_DATA, Qt::CaseInsensitive)) { m_flag = Dnf; + m_pLogBackend->setFlag(m_flag); generateDnfFile(BUTTONID(m_curBtnId), m_curDnfLevel); } else if (itemData.contains(DMESG_TREE_DATA, Qt::CaseInsensitive)) { m_flag = Dmesg; + m_pLogBackend->setFlag(m_flag); generateDmesgFile(BUTTONID(m_curBtnId), PRIORITY(m_curLevel)); } else if (itemData.contains(OTHER_TREE_DATA, Qt::CaseInsensitive)) { m_flag = OtherLog; - createOOCTableForm(); - createOOCTable(LogApplicationHelper::instance()->getOtherLogList()); + m_pLogBackend->setFlag(m_flag); + generateOOCLogs(OOC_OTHER); } else if (itemData.contains(CUSTOM_TREE_DATA, Qt::CaseInsensitive)) { m_flag = CustomLog; - createOOCTableForm(); - createOOCTable(LogApplicationHelper::instance()->getCustomLogList()); + m_pLogBackend->setFlag(m_flag); + generateOOCLogs(OOC_CUSTOM); + } else if (itemData.contains(AUDIT_TREE_DATA, Qt::CaseInsensitive)) { + m_flag = Audit; + m_pLogBackend->setFlag(m_flag); + generateAuditFile(m_curBtnId, m_curAuditType); + } else if (itemData.contains(COREDUMP_TREE_DATA, Qt::CaseInsensitive)) { + m_flag = COREDUMP; + m_pLogBackend->setFlag(m_flag); + generateCoredumpFile(m_curBtnId); } if (!itemData.contains(JOUR_TREE_DATA, Qt::CaseInsensitive) || !itemData.contains(KERN_TREE_DATA, Qt::CaseInsensitive)) { // modified by Airy @@ -3163,12 +3424,46 @@ void DisplayContent::slot_dnfLevel(DNFPRIORITY iLevel) generateDnfFile(BUTTONID(m_curBtnId), m_curDnfLevel); } -void DisplayContent::generateOOCFile(QString path) +void DisplayContent::generateOOCFile(const QString &path) { setLoadState(DATA_LOADING); m_detailWgt->cleanText(); m_isDataLoadComplete = false; - m_OOCCurrentIndex = m_logFileParse.parseByOOC(path); + m_pLogBackend->parseByOOC(path); +} + +void DisplayContent::generateOOCLogs(const OOC_TYPE &type, const QString &iSearchStr/* = ""*/) +{ + m_pLogBackend->clearAllFilter(); + clearAllDatas(); + + QList files; + QList* pListOrigin = nullptr; + QList* pList = nullptr; + + if (type == OOC_OTHER) { + files = LogApplicationHelper::instance()->getOtherLogList(); + pListOrigin = &(m_pLogBackend->oListOrigin); + pList = &(m_pLogBackend->oList); + } + else { + files = LogApplicationHelper::instance()->getCustomLogList(); + pListOrigin = &(m_pLogBackend->cListOrigin); + pList = &(m_pLogBackend->cList); + } + + for (QStringList iter : files) { + LOG_FILE_OTHERORCUSTOM logFileInfo; + logFileInfo.name = iter.value(0); + logFileInfo.path = iter.value(1); + logFileInfo.dateTimeModify = QFileInfo(iter.value(1)).lastModified().toLocalTime().toString("yyyy-MM-dd hh:mm:ss"); + pListOrigin->append(logFileInfo); + } + + *pList = LogBackend::filterOOC(iSearchStr, *pListOrigin); + + createOOCTableForm(); + createOOCTable(*pList); } void DisplayContent::createOOCTableForm() @@ -3181,59 +3476,264 @@ void DisplayContent::createOOCTableForm() m_treeView->setColumnWidth(1, DATETIME_WIDTH + 120); } -void DisplayContent::createOOCTable(const QList & list) +void DisplayContent::createOOCTable(const QList &list) { - m_limitTag = 0; setLoadState(DATA_COMPLETE); - QList listLogFile; - for (QStringList iter : list) { - LOG_FILE_OTHERORCUSTOM logFileInfo; - logFileInfo.name = iter.value(0); - logFileInfo.path = iter.value(1); - logFileInfo.dateTimeModify = QFileInfo(iter.value(1)).lastModified().toLocalTime().toString("yyyy-MM-dd hh:mm:ss"); - listLogFile.append(logFileInfo); + m_limitTag = 0; + int end = list.count() > SINGLE_LOAD ? SINGLE_LOAD : list.count(); + insertOOCTable(list, 0, end); + QItemSelectionModel *p = m_treeView->selectionModel(); + if (p) + p->select(m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); + + m_curTreeIndex = QModelIndex();//重置一下 + slot_tableItemClicked(m_pModel->index(0, 0)); +} + +void DisplayContent::generateAuditFile(int id, int lId, const QString &iSearchStr) +{ + Q_UNUSED(iSearchStr); + m_pLogBackend->clearAllFilter(); + clearAllDatas(); + m_firstLoadPageData = true; + m_isDataLoadComplete = false; + setLoadState(DATA_LOADING); + createAuditTableForm(); + QDateTime dt = QDateTime::currentDateTime(); + dt.setTime(QTime()); // get zero time + AUDIT_FILTERS auditFilter; + auditFilter.auditTypeFilter = lId; + + switch (id) { + case ALL: { + } + break; + case ONE_DAY: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + auditFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); + auditFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case THREE_DAYS: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + auditFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); + auditFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case ONE_WEEK: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + auditFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); + auditFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case ONE_MONTH: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + auditFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); + auditFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case THREE_MONTHS: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + auditFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); + auditFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + default: + break; } - parseListToModel(listLogFile, m_pModel); + m_pLogBackend->m_auditFilter = auditFilter; + + if (id >= ALL && id <= THREE_MONTHS) + m_pLogBackend->parseByAudit(auditFilter); +} + +void DisplayContent::createAuditTableForm() +{ + m_pModel->clear(); + m_pModel->setHorizontalHeaderLabels(QStringList() + << DApplication::translate("Table", "Event Type") + << DApplication::translate("Table", "Date and Time") + << DApplication::translate("Table", "Process") + << DApplication::translate("Table", "Status") + << DApplication::translate("Table", "Info")); +#ifndef SHOW_DETAIL + m_treeView->setColumnWidth(AUDIT_SPACE::auditEventTypeColumn, 125); + m_treeView->setColumnWidth(AUDIT_SPACE::auditDateTimeColumn, 140); + m_treeView->setColumnWidth(AUDIT_SPACE::auditProcessNameColumn, 100); + m_treeView->setColumnWidth(AUDIT_SPACE::auditStatusColumn, 55); + m_treeView->setColumnWidth(AUDIT_SPACE::auditMsgColumn, DATETIME_WIDTH); +#else + m_treeView->setColumnWidth(AUDIT_SPACE::auditEventTypeColumn, DATETIME_WIDTH + 20); + m_treeView->setColumnWidth(AUDIT_SPACE::auditDateTimeColumn, DATETIME_WIDTH); + m_treeView->setColumnWidth(AUDIT_SPACE::auditProcessNameColumn, DATETIME_WIDTH); + m_treeView->setColumnWidth(AUDIT_SPACE::auditStatusColumn, STATUS_WIDTH); + m_treeView->setColumnWidth(AUDIT_SPACE::auditMsgColumn, DATETIME_WIDTH); + m_treeView->hideColumn(AUDIT_SPACE::auditMsgColumn); +#endif +} + +void DisplayContent::createAuditTable(const QList &list) +{ + setLoadState(DATA_COMPLETE); + m_limitTag = 0; + int end = list.count() > SINGLE_LOAD ? SINGLE_LOAD : list.count(); + insertAuditTable(list, 0, end); QItemSelectionModel *p = m_treeView->selectionModel(); if (p) p->select(m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); - slot_tableItemClicked(m_pModel->index(0, 0)); } +void DisplayContent::generateCoredumpFile(int id, const QString &iSearchStr) +{ + Q_UNUSED(iSearchStr) + + if (!Utils::isCoredumpctlExist()) { + setLoadState(COREDUMPCTL_NOT_INSTALLED); + return; + } + + m_pLogBackend->clearAllFilter(); + clearAllDatas(); + m_firstLoadPageData = true; + m_isDataLoadComplete = false; + setLoadState(DATA_LOADING); + createCoredumpTableForm(); + QDateTime dt = QDateTime::currentDateTime(); + dt.setTime(QTime()); // get zero time + COREDUMP_FILTERS coreFilter; + + switch (id) { + case ALL: + break; + case ONE_DAY: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + coreFilter.timeFilterBegin = dtStart.toMSecsSinceEpoch(); + coreFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case THREE_DAYS: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + coreFilter.timeFilterBegin = dtStart.addDays(-2).toMSecsSinceEpoch(); + coreFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case ONE_WEEK: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + coreFilter.timeFilterBegin = dtStart.addDays(-6).toMSecsSinceEpoch(); + coreFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case ONE_MONTH: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + coreFilter.timeFilterBegin = dtStart.addMonths(-1).toMSecsSinceEpoch(); + coreFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + case THREE_MONTHS: { + QDateTime dtStart = dt; + QDateTime dtEnd = dt; + dtEnd.setTime(QTime(23, 59, 59, 999)); + coreFilter.timeFilterBegin = dtStart.addMonths(-3).toMSecsSinceEpoch(); + coreFilter.timeFilterEnd = dtEnd.toMSecsSinceEpoch(); + } + break; + default: + break; + } + + if (id >= ALL && id <= THREE_MONTHS) + m_pLogBackend->parseByCoredump(coreFilter); +} +void DisplayContent::createCoredumpTableForm() +{ + m_pModel->clear(); + m_pModel->setHorizontalHeaderLabels(QStringList() + << DApplication::translate("Table", "SIG") + << DApplication::translate("Table", "Date and Time") + << DApplication::translate("Table", "Core File") + << DApplication::translate("Table", "User Name ") + << DApplication::translate("Table", "EXE")); + + m_treeView->setColumnWidth(COREDUMP_SPACE::COREDUMP_SIG_COLUMN, 110); + m_treeView->setColumnWidth(COREDUMP_SPACE::COREDUMP_TIME_COLUMN, 150); + m_treeView->setColumnWidth(COREDUMP_SPACE::COREDUMP_COREFILE_COLUMN, 100); + m_treeView->setColumnWidth(COREDUMP_SPACE::COREDUMP_UNAME_COLUMN, 100); + m_treeView->setColumnWidth(COREDUMP_SPACE::COREDUMP_EXE_COLUMN, 135); +} +void DisplayContent::createCoredumpTable(const QList &list) +{ + setLoadState(DATA_COMPLETE); + + m_limitTag = 0; + int end = list.count() > SINGLE_LOAD ? SINGLE_LOAD : list.count(); + insertCoredumpTable(list, 0, end); + QItemSelectionModel *p = m_treeView->selectionModel(); + if (p) + p->select(m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); + slot_tableItemClicked(m_pModel->index(0, 0)); +} void DisplayContent::slot_requestShowRightMenu(const QPoint &pos) { - if (m_flag != OtherLog && m_flag != CustomLog) { + if (m_flag != OtherLog && m_flag != CustomLog && m_flag != COREDUMP) { return; } if (m_treeView->indexAt(pos).isValid()) { QModelIndex index = m_treeView->currentIndex(); if (!m_treeView->selectionModel()->selectedIndexes().empty()) { - QMenu * menu = new QMenu(m_treeView); - QAction *act_openForder = new QAction(/*tr("在文件管理器中显示")*/ DApplication::translate("Action", "Display in file manager"), this); - QAction *act_refresh = new QAction(/*tr("刷新")*/ DApplication::translate("Action", "Refresh"), this); - menu->addAction(act_openForder); - menu->addAction(act_refresh); - - QString path = m_pModel->item(index.row(),0)->data(Qt::UserRole + 2).toString(); + QString path; + if (m_flag == COREDUMP) { + if (index.siblingAtColumn(2).data().toString() == "missing") { + // 文件状态为missing,不能在文管中打开 + m_act_openForder->setEnabled(false); + } else { + m_act_openForder->setEnabled(true); + } + //coredump文件不需要刷新 + m_act_refresh->setEnabled(false); + + path = m_pModel->item(index.row(), 4)->data(Qt::UserRole + 2).toString(); + } else { + path = m_pModel->item(index.row(), 0)->data(Qt::UserRole + 2).toString(); + } //显示当前日志目录 - connect(act_openForder, &QAction::triggered, this, [=] { + m_act_openForder->disconnect(); + connect(m_act_openForder, &QAction::triggered, this, [ = ] { DDesktopServices::showFileItem(path); }); //刷新逻辑 - connect(act_refresh, &QAction::triggered, this, [=]() { + m_act_refresh->disconnect(); + connect(m_act_refresh, &QAction::triggered, this, [ = ]() { generateOOCFile(path); }); m_treeView->setContextMenuPolicy(Qt::CustomContextMenu); - menu->exec(QCursor::pos()); + m_menu->exec(QCursor::pos()); } } } @@ -3241,7 +3741,6 @@ void DisplayContent::slot_requestShowRightMenu(const QPoint &pos) void DisplayContent::slot_valueChanged_dConfig_or_gSetting(const QString &key) { if ((key == "customLogFiles" || key == "customlogfiles") && m_flag == CustomLog) { - createOOCTableForm(); - createOOCTable(LogApplicationHelper::instance()->getCustomLogList()); + generateOOCLogs(OOC_CUSTOM); } } diff --git a/application/displaycontent.h b/application/displaycontent.h index 4d413624..f1dda764 100644 --- a/application/displaycontent.h +++ b/application/displaycontent.h @@ -24,6 +24,7 @@ #include class ExportProgressDlg; +class LogBackend; /** * @brief The DisplayContent class 主显示数据区域控件,包括数据表格和详情页 */ @@ -38,6 +39,14 @@ class DisplayContent : public Dtk::Widget::DWidget DATA_COMPLETE, //加载完成 DATA_LOADING_K, //内核日志正在加载 DATA_NO_SEARCH_RESULT, //搜索无记录 + DATA_NOT_AUDIT_ADMIN, // 提示不是审计管理员 + COREDUMPCTL_NOT_INSTALLED, //未安装coredumpctl工具 + DATA_NO_PERMISSION //没有权限查看 + }; + + enum OOC_TYPE { + OOC_OTHER = 0, // 其他日志 + OOC_CUSTOM // 自定义日志 }; public: @@ -52,69 +61,90 @@ class DisplayContent : public Dtk::Widget::DWidget void setTableViewData(); void initConnections(); + // 基于Json数据的建表接口 + void createLogTable(const QList& list, LOG_FLAG type); + void insertLogTable(const QList& list, int start, int end, LOG_FLAG type); + void parseListToModel(const QList& list, QStandardItemModel *oPModel, LOG_FLAG type); + + int loadSegementPage(bool bNext = true, bool bReset = true); + void generateJournalFile(int id, int lId, const QString &iSearchStr = ""); - void createJournalTableStart(QList &list); + void createJournalTableStart(const QList &list); void createJournalTableForm(); void generateDpkgFile(int id, const QString &iSearchStr = ""); - void createDpkgTableStart(QList &list); + void createDpkgTableStart(const QList &list); void createDpkgTableForm(); void generateKernFile(int id, const QString &iSearchStr = ""); void createKernTableForm(); - void createKernTable(QList &list); + void createKernTable(const QList &list); - void generateAppFile(QString path, int id, int lId, const QString &iSearchStr = ""); + void generateAppFile(const QString &app, int id, int lId, const QString &iSearchStr = ""); void createAppTableForm(); - void createAppTable(QList &list); + void createAppTable(const QList &list); void createBootTableForm(); - void createBootTable(QList &list); + void createBootTable(const QList &list); void generateBootFile(); void createXorgTableForm(); - void createXorgTable(QList &list); + void createXorgTable(const QList &list); void generateXorgFile(int id); // add by Airy for peroid void createKwinTableForm(); - void creatKwinTable(QList &list); - void generateKwinFile(KWIN_FILTERS iFilters); + void creatKwinTable(const QList &list); + void generateKwinFile(const KWIN_FILTERS &iFilters); void createNormalTableForm(); - void createNormalTable(QList &list); // add by Airy + void createNormalTable(const QList &list); // add by Airy void generateNormalFile(int id); // add by Airy for peroid //其他日志或者自定义日志 - void generateOOCFile(QString path); + void generateOOCFile(const QString &path); + void generateOOCLogs(const OOC_TYPE &type, const QString &iSearchStr = ""); void createOOCTableForm(); - void createOOCTable(const QList & list); + void createOOCTable(const QList &list); + + // 审计日志 + void generateAuditFile(int id, int lId, const QString &iSearchStr = ""); + void createAuditTableForm(); + void createAuditTable(const QList &list); + + //coredump log + void generateCoredumpFile(int id, const QString &iSearchStr = ""); + void createCoredumpTableForm(); + void createCoredumpTable(const QList &list); void insertJournalTable(QList logList, int start, int end); - void insertApplicationTable(QList list, int start, int end); - void insertKernTable(QList list, int start, + void insertApplicationTable(const QList &list, int start, int end); + void insertKernTable(const QList &list, int start, int end); // add by Airy for bug 12263 - void insertDpkgTable(QList list, int start, int end); - void insertXorgTable(QList list, int start, int end); - void insertBootTable(QList list, int start, int end); - void insertKwinTable(QList list, int start, int end); - void insertNormalTable(QList list, int start, int end); - QString getAppName(QString filePath); + void insertDpkgTable(const QList &list, int start, int end); + void insertXorgTable(const QList &list, int start, int end); + void insertBootTable(const QList &list, int start, int end); + void insertKwinTable(const QList &list, int start, int end); + void insertNormalTable(const QList &list, int start, int end); + void insertOOCTable(const QList &list, int start, int end); + void insertAuditTable(const QList &list, int start, int end); + void insertCoredumpTable(const QList &list, int start, int end); + QString getAppName(const QString &filePath); bool isAuthProcessAlive(); void generateJournalBootFile(int lId, const QString &iSearchStr = ""); - void createJournalBootTableStart(QList &list); + void createJournalBootTableStart(const QList &list); void createJournalBootTableForm(); void insertJournalBootTable(QList logList, int start, int end); void generateDnfFile(BUTTONID iDate, DNFPRIORITY iLevel); - void createDnfTable(QList &list); + void createDnfTable(const QList &list); void generateDmesgFile(BUTTONID iDate, PRIORITY iLevel); - void createDmesgTable(QList &list); + void createDmesgTable(const QList &list); void createDnfForm(); void createDmesgForm(); - void insertDmesgTable(QList list, int start, int end); - void insertDnfTable(QList list, int start, int end); + void insertDmesgTable(const QList &list, int start, int end); + void insertDnfTable(const QList &list, int start, int end); signals: void loadMoreInfo(); @@ -124,58 +154,71 @@ class DisplayContent : public Dtk::Widget::DWidget * @param pModel 当前的model指针 * @param name 当前应用日志选择的日志名称 */ - void sigDetailInfo(QModelIndex index, QStandardItemModel *pModel, QString name); + void sigDetailInfo(QModelIndex index, QStandardItemModel *pModel, QString name, const int error = 0); /** * @brief setExportEnable 是否允许导出信号 * @param iEnable 是否允许导出 */ void setExportEnable(bool iEnable); + void sigCoredumpDetailInfo(QList cList); + public slots: void slot_valueChanged_dConfig_or_gSetting(const QString &key); void slot_requestShowRightMenu(const QPoint &pos); void slot_tableItemClicked(const QModelIndex &index); void slot_BtnSelected(int btnId, int lId, QModelIndex idx); - void slot_appLogs(int btnId, QString path); + void slot_appLogs(int btnId, const QString &app); void slot_logCatelogueClicked(const QModelIndex &index); void slot_exportClicked(); - void slot_statusChagned(QString status); - - void slot_dpkgFinished(int index); - void slot_dpkgData(int index, QList list); - void slot_XorgFinished(int index); - void slot_xorgData(int index, QList list); - void slot_bootFinished(int index); - void slot_bootData(int index, QList list); - void slot_kernFinished(int index); - void slot_kernData(int index, QList list); - void slot_kwinFinished(int index); - void slot_kwinData(int index, QList list); - void slot_dnfFinished(QList list); - void slot_dmesgFinished(QList list); - void slot_journalFinished(int index); - void slot_journalBootFinished(int index); - void slot_journalBootData(int index, QList list); - void slot_journalData(int index, QList list); - void slot_applicationFinished(int index); - void slot_applicationData(int index, QList list); - void slot_normalFinished(int index); - void slot_normalData(int index, QList list); - void slot_OOCFinished(int index, int error = 0); - void slot_OOCData(int index, const QString & data); + void slot_statusChagned(const QString &status); + + // Json格式的日志数据处理接口 + void slot_parseFinished(LOG_FLAG type, int status); + void slot_logData(const QList &list, LOG_FLAG type); + void slot_clearTable(); + void slot_dpkgFinished(); + void slot_dpkgData(const QList &list); + void slot_XorgFinished(); + void slot_xorgData(const QList &list); + void slot_bootFinished(); + void slot_bootData(const QList &list); + void slot_kernFinished(); + void slot_kernData(const QList &list); + void slot_kwinFinished(); + void slot_kwinData(const QList &list); + void slot_dnfFinished(const QList &list); + void slot_dmesgFinished(const QList &list); + void slot_journalFinished(); + void slot_journalBootFinished(); + void slot_journalBootData(const QList &list); + void slot_journalData(const QList &list); + void slot_applicationFinished(); + void slot_applicationData(const QList &list); + void slot_normalFinished(); + void slot_normalData(const QList &list); + void slot_OOCFinished(int error = 0); + void slot_OOCData(const QString &data); + void slot_auditFinished(bool bShowTip = false); + void slot_auditData(const QList &list); + void slot_coredumpFinished(); + void slot_coredumpData(const QList &list, bool newData); void slot_logLoadFailed(const QString &iError); void slot_vScrollValueChanged(int valuePixel); - void slot_searchResult(QString str); + void slot_searchResult(const QString &str); + void slot_getSubmodule(int tcbx); void slot_getLogtype(int tcbx); // add by Airy + void slot_getAuditType(int tcbx); void slot_refreshClicked(const QModelIndex &index); //add by Airy for adding refresh void slot_dnfLevel(DNFPRIORITY iLevel); + //导出前把当前要导出的当前信息的Qlist转换成QStandardItemModel便于导出 - void parseListToModel(QList iList, QStandardItemModel *oPModel); - void parseListToModel(QList iList, QStandardItemModel *oPModel); + void parseListToModel(const QList &iList, QStandardItemModel *oPModel); + void parseListToModel(const QList &iList, QStandardItemModel *oPModel); void parseListToModel(QList iList, QStandardItemModel *oPModel); void parseListToModel(QList iList, QStandardItemModel *oPModel); void parseListToModel(QList iList, QStandardItemModel *oPModel); @@ -184,23 +227,14 @@ public slots: void parseListToModel(QList iList, QStandardItemModel *oPModel); void parseListToModel(QList iList, QStandardItemModel *oPModel); void parseListToModel(QList iList, QStandardItemModel *oPModel); - QString getIconByname(QString str); - void setLoadState(LOAD_STATE iState); + void parseListToModel(QList iList, QStandardItemModel *oPModel); + void parseListToModel(QList iList, QStandardItemModel *oPModel); + QString getIconByname(const QString &str); + void setLoadState(LOAD_STATE iState, bool bSearching = false); void onExportProgress(int nCur, int nTotal); void onExportResult(bool isSuccess); void onExportFakeCloseDlg(); - void clearAllFilter(); - void clearAllDatalist(); - - QList filterBoot(BOOT_FILTERS ibootFilter, QList &iList); - QList filterNomal(NORMAL_FILTERS inormalFilter, QList &iList); - QList filterDpkg(const QString &iSearchStr, QList &iList); - QList filterKern(const QString &iSearchStr, QList &iList); - QList filterXorg(const QString &iSearchStr, QList &iList); - QList filterKwin(const QString &iSearchStr, QList &iList); - QList filterApp(const QString &iSearchStr, QList &iList); - QList filterJournal(const QString &iSearchStr, QList &iList); - QList filterJournalBoot(const QString &iSearchStr, QList &iList); + void clearAllDatas(); private: void resizeEvent(QResizeEvent *event); @@ -222,6 +256,10 @@ public slots: logDetailInfoWidget *m_detailWgt {nullptr}; //搜索无结果时显示无搜索结果提示的label Dtk::Widget::DLabel *noResultLabel {nullptr}; + // 不是审计管理员提示的label + Dtk::Widget::DLabel *notAuditLabel {nullptr}; + Dtk::Widget::DLabel *noCoredumpctlLabel {nullptr}; + Dtk::Widget::DLabel *noPermissionLabel {nullptr}; //当前选中的日志类型的index QModelIndex m_curListIdx; //当前选中的treeview的index @@ -238,91 +276,32 @@ public slots: * @brief m_spinnerWgt_K 加载内核日志数据时转轮控件 */ LogSpinnerWidget *m_spinnerWgt_K; // add by Airy + + // 列表右键菜单 + QMenu *m_menu{ nullptr }; + QAction *m_act_openForder{ nullptr }; + QAction *m_act_refresh{ nullptr }; + /** - * @brief m_curAppLog 当前选中的应用的日志文件路径 + * @brief m_curAppLog 当前选中的应用的项目名称 */ - QString m_curAppLog; - - QString m_currentStatus; + QString m_curApp; - //当前选中的时间筛选选项 + // 当前选中的时间筛选选项 int m_curBtnId {ALL}; - //当前选中的等级筛选选项 + // 当前选中的等级筛选选项 int m_curLevel {INF}; + // 当前选中的审计类型选项 + int m_curAuditType {0}; + // 当前选中的开关机事件类型选项 + int m_curNormalEventType{0}; //当前加载的日志类型 LOG_FLAG m_flag {NONE}; - /** - * @brief m_logFileParse 获取日志工具类对象 - */ - LogFileParser m_logFileParse; - /** - * @brief jBootList 经过筛选完成的启动日志列表 - */ - /** - * @brief jBootListOrigin 未经过筛选的启动日志数据 journalctl --boot cmd. - */ - QList jBootList, jBootListOrigin; + // 日志后端 解析、接收和转发日志数据 + LogBackend* m_pLogBackend; - /** - * @brief jList 经过筛选完成的系统日志数据 - */ - /** - * @brief jListOrigin 未经过筛选的系统日志数据 journalctl cmd. - */ - QList jList, jListOrigin; - /** - * @brief dList 经过筛选完成的dpkg日志数据 - */ - /** - * @brief dListOrigin 未经过筛选的dpkg日志数据 dpkg.log - */ - QList dList, dListOrigin; - /** - * @brief xList 经过筛选完成的xorg日志数据 - */ - /** - * @brief xListOrigin 未经过筛选的xorg日志数据 Xorg.0.log - */ - QList xList, xListOrigin; - /** - * @brief currentBootList 经过筛选完成的启动日志数据 - */ - /** - * @brief bList 未经过筛选的启动日志数据 boot.log - */ - QList bList, currentBootList; - /** - * @brief kList 经过筛选完成的内核日志数据 - */ - /** - * @brief kListOrigin 未经过筛选的内核日志数据 kern.log - */ - QList kList, kListOrigin; - /** - * @brief appList 经过筛选完成的内核日志数据 - */ - /** - * @brief appListOrigin 未经过筛选的内核日志数据 ~/.cache/deepin/xxx.log(.xxx) - */ - QList appList, appListOrigin; - /** - * @brief norList add 未经过筛选完成的开关机日志数据 by Airy - */ - QList norList; - /** - * @brief nortempList 经过筛选的开关机日志数据 add by Airy - */ - QList nortempList; - /** - * @brief m_currentKwinList add 经过筛选完成的kwin日志数据 by Airy /$HOME/.kwin.log - */ - QList m_currentKwinList; - /** - * @brief m_kwinList 未经过筛选的开关机日志数据 - */ - QList m_kwinList; /** * @brief m_iconPrefix 图标资源文件路径前缀 */ @@ -332,22 +311,11 @@ public slots: */ QMap m_icon_name_map; - //当前搜索关键字 - QString m_currentSearchStr {""}; - /** - * @brief m_currentKwinFilter kwin日志当前筛选条件 - */ - KWIN_FILTERS m_currentKwinFilter; //导出进度条弹框 ExportProgressDlg *m_exportDlg {nullptr}; //是否为第一次加载完成后收到数据,journalctl获取方式专用 bool m_firstLoadPageData = false; - //启动日志当前筛选条件 - BOOT_FILTERS m_bootFilter = {"", ""}; - /** - * @brief m_normalFilter 开关机日志当前筛选条件 - */ - NORMAL_FILTERS m_normalFilter; + //上次treeview滚筒条的值 int m_treeViewLastScrollValue = -1; //当前的显示加载状态 @@ -358,23 +326,9 @@ public slots: * @brief m_journalFilter 当前系统日志筛选条件 */ JOURNAL_FILTERS m_journalFilter; - QList dnfList, dnfListOrigin; //dnf.log - QList dmesgList, dmesgListOrigin; //dmesg cmd + QMap m_dnfIconNameMap; DNFPRIORITY m_curDnfLevel {INFO}; - //当前系统日志获取进程标记量 - int m_journalCurrentIndex {-1}; - //当前klu启动日志获取进程标记量 - int m_journalBootCurrentIndex {-1}; - //当前启动日志获取进程标记量 - int m_bootCurrentIndex {-1}; - int m_dpkgCurrentIndex {-1}; - int m_kernCurrentIndex {-1}; - int m_normalCurrentIndex {-1}; - int m_xorgCurrentIndex {-1}; - int m_kwinCurrentIndex {-1}; - int m_appCurrentIndex {-1}; - int m_OOCCurrentIndex {-1}; bool m_isDataLoadComplete {false}; //筛选条件 QString selectFilter; diff --git a/application/eventlogutils.cpp b/application/eventlogutils.cpp index 6249ebf1..e784e159 100644 --- a/application/eventlogutils.cpp +++ b/application/eventlogutils.cpp @@ -7,6 +7,7 @@ #include #include #include +#include Eventlogutils *Eventlogutils::m_pInstance = nullptr; Eventlogutils *Eventlogutils::GetInstance() diff --git a/application/eventlogutils.h b/application/eventlogutils.h index 27c55fe2..2735af7a 100644 --- a/application/eventlogutils.h +++ b/application/eventlogutils.h @@ -15,6 +15,7 @@ class Eventlogutils CloseTime = 1000000001, StartUp = 1000000003, Quit = 1000000004, + ReportCoredump = 1001100000 }; static Eventlogutils *GetInstance(); diff --git a/application/exportprogressdlg.cpp b/application/exportprogressdlg.cpp index 576ec596..f80324a4 100644 --- a/application/exportprogressdlg.cpp +++ b/application/exportprogressdlg.cpp @@ -21,7 +21,6 @@ ExportProgressDlg::ExportProgressDlg(DWidget *parent) : DDialog(parent) { - QString titleIcon = ICONPREFIX; setIcon(QIcon::fromTheme("deepin-log-viewer")); DWidget *pWidget = new DWidget(this); diff --git a/application/filtercontent.cpp b/application/filtercontent.cpp index cbc68931..e499f22b 100644 --- a/application/filtercontent.cpp +++ b/application/filtercontent.cpp @@ -35,6 +35,7 @@ #define BUTTON_EXPORT_WIDTH_MIN 142 #define FONT_20_MIN_WIDTH 821 #define FONT_18_MIN_WIDTH 100 +#define LEVEL_COMBO_WIDTH 120 DWIDGET_USE_NAMESPACE /** @@ -93,21 +94,17 @@ void FilterContent::initUI() hLayout_period->addWidget(m_lastMonthBtn); hLayout_period->addWidget(m_threeMonthBtn); hLayout_period->addStretch(1); - - DSuggestButton *cmdLinkBtn = new DSuggestButton(("Reset"), this); - cmdLinkBtn->setFlat(true); - cmdLinkBtn->hide(); - m_btnGroup->addButton(cmdLinkBtn, 6); - hLayout_period->addWidget(cmdLinkBtn); hLayout_period->setSpacing(10); // set level info hLayout_all = new QHBoxLayout; QHBoxLayout *hLayout_lvl = new QHBoxLayout; lvTxt = new DLabel(DApplication::translate("Label", "Level: "), this); + lvTxt->setAccessibleName(DApplication::translate("Label", "Level: ")); lvTxt->setAlignment(Qt::AlignRight | Qt::AlignVCenter); cbx_lv = new LogCombox(this); - cbx_lv->setMinimumSize(QSize(198, BUTTON_HEIGHT_MIN)); + cbx_lv->view()->setAccessibleName("combobox_level_view"); + cbx_lv->setMinimumSize(QSize(LEVEL_COMBO_WIDTH, BUTTON_HEIGHT_MIN)); cbx_lv->addItems(QStringList() << DApplication::translate("ComboBox", "All") << DApplication::translate("ComboBox", "Emergency") << DApplication::translate("ComboBox", "Alert") @@ -124,8 +121,10 @@ void FilterContent::initUI() hLayout_all->addLayout(hLayout_lvl); QHBoxLayout *hLayout_dnf_lvl = new QHBoxLayout; dnflvTxt = new DLabel(DApplication::translate("Label", "Level: "), this); + dnflvTxt->setAccessibleName("dnf" + DApplication::translate("Label", "Level: ")); dnflvTxt->setAlignment(Qt::AlignRight | Qt::AlignVCenter); cbx_dnf_lv = new LogCombox(this); + cbx_dnf_lv->view()->setAccessibleName("combobox_dnflevel_view"); cbx_dnf_lv->setMinimumSize(QSize(198, BUTTON_HEIGHT_MIN)); cbx_dnf_lv->addItem(DApplication::translate("ComboBox", "All"), DNFLVALL); cbx_dnf_lv->addItem(DApplication::translate("ComboBox", "Super critical"), SUPERCRITICAL); @@ -141,19 +140,34 @@ void FilterContent::initUI() hLayout_all->addLayout(hLayout_dnf_lvl); // set all files under ~/.cache/deepin QHBoxLayout *hLayout_app = new QHBoxLayout; - appTxt = new DLabel(DApplication::translate("Label", "Application list:"), this); + appTxt = new DLabel(DApplication::translate("Label", "Application:"), this); cbx_app = new LogCombox(this); + cbx_app->view()->setAccessibleName("combobox_app_view"); - cbx_app->setMinimumSize(QSize(180, BUTTON_HEIGHT_MIN)); + cbx_app->setMinimumSize(QSize(160, BUTTON_HEIGHT_MIN)); hLayout_app->addWidget(appTxt); hLayout_app->addWidget(cbx_app, 1); hLayout_app->setSpacing(6); hLayout_all->addLayout(hLayout_app); + // app submodules + QHBoxLayout *hLayout_submodule = new QHBoxLayout; + submoduleTxt = new DLabel(DApplication::translate("Label", "Submodule:"), this); + cbx_submodule = new LogCombox(this); + cbx_submodule->view()->setAccessibleName("combobox_submodule_view"); + + cbx_submodule->setMinimumSize(QSize(143, BUTTON_HEIGHT_MIN)); + hLayout_submodule->addWidget(submoduleTxt); + hLayout_submodule->addWidget(cbx_submodule, 1); + hLayout_submodule->setSpacing(6); + hLayout_all->addLayout(hLayout_submodule); + + // add status item QHBoxLayout *hLayout_status = new QHBoxLayout; statusTxt = new DLabel(DApplication::translate("Label", "Status:"), this); cbx_status = new LogCombox(this); + cbx_status->view()->setAccessibleName("combobox_status_view"); cbx_status->setMinimumWidth(120); cbx_status->setMinimumSize(QSize(120, BUTTON_HEIGHT_MIN)); cbx_status->addItems(QStringList() << DApplication::translate("ComboBox", "All") << "OK" @@ -167,6 +181,7 @@ void FilterContent::initUI() QHBoxLayout *hLayout_type = new QHBoxLayout; typeTxt = new DLabel(DApplication::translate("Label", "Event Type:"), this); typeCbx = new LogCombox(this); + typeCbx->view()->setAccessibleName("combobox_eventtype_view"); typeCbx->setMinimumWidth(120); typeCbx->setMinimumSize(QSize(120, BUTTON_HEIGHT_MIN)); typeCbx->addItems(QStringList() << DApplication::translate("ComboBox", "All") @@ -177,6 +192,25 @@ void FilterContent::initUI() hLayout_status->addWidget(typeCbx, 1); hLayout_status->setSpacing(6); hLayout_all->addLayout(hLayout_type); // end add + + // 审计日志审计类型筛选下拉框 + QHBoxLayout *hLayout_auditType = new QHBoxLayout; + auditTypeTxt = new DLabel(DApplication::translate("Label", "Audit Type:"), this); + auditTypeCbx = new LogCombox(this); + auditTypeCbx->setMinimumWidth(120); + auditTypeCbx->setMinimumSize(QSize(120, BUTTON_HEIGHT_MIN)); + auditTypeCbx->addItems(QStringList() << DApplication::translate("ComboBox", "All") + << DApplication::translate("ComboBox", "Identity authentication") + << DApplication::translate("ComboBox", "Discretionary Access Control") + << DApplication::translate("ComboBox", "Mandatory access control") + << DApplication::translate("ComboBox", "Remote") + << DApplication::translate("ComboBox", "Document audit") + << DApplication::translate("ComboBox", "Other")); + hLayout_status->addWidget(auditTypeTxt); + hLayout_status->addWidget(auditTypeCbx, 1); + hLayout_status->setSpacing(6); + hLayout_all->addLayout(hLayout_auditType); // end add + hLayout_all->addStretch(1); exportBtn = new LogNormalButton(DApplication::translate("Button", "Export", "button"), this); exportBtn->setContentsMargins(0, 0, 18, 18); @@ -215,6 +249,7 @@ void FilterContent::initConnections() connect(cbx_status, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_cbxStatusChanged(int))); connect(typeCbx, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_cbxLogTypeChanged(int))); // add by Airy + connect(auditTypeCbx, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_cbxAuditTypeChanged(int))); } /** @@ -242,19 +277,47 @@ void FilterContent::setAppComboBoxItem() cbx_app->clear(); //获取应用列表 auto *appHelper = LogApplicationHelper::instance(); - QMap _map = appHelper->getMap(); - QMap::const_iterator iter = _map.constBegin(); + AppLogConfigList appConfigs = appHelper->getAppLogConfigs(); //添加数据进combox - while (iter != _map.constEnd()) { - cbx_app->addItem(iter.key()); - //应用日志的路径为Qt::UserRole + 1 - cbx_app->setItemData(cbx_app->count() - 1, iter.value(), Qt::UserRole + 1); - ++iter; + for (auto appConfig : appConfigs) { + // 没有子模块,不在应用列表显示 + if (appConfig.subModules.size() == 0 || !appConfig.visible) + continue; + + if (!appConfig.transName.isEmpty()) + cbx_app->addItem(appConfig.transName); + else + cbx_app->addItem(appConfig.name); + // 应用日志的项目名称为Qt::UserRole + 1 + cbx_app->setItemData(cbx_app->count() - 1, appConfig.name, Qt::UserRole + 1); } + connect(cbx_app, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_cbxAppIdxChanged(int)), Qt::UniqueConnection); } +void FilterContent::setSubmodulesComboBoxItem(const QString &app) +{ + AppLogConfig logConfig = LogApplicationHelper::instance()->appLogConfig(app); + + // 子模块只有一个,则不显示子模块下拉框 + if (logConfig.subModules.size() < 2) { + submoduleTxt->setVisible(false); + cbx_submodule->setVisible(false); + } else { + submoduleTxt->setVisible(true); + cbx_submodule->setVisible(true); + disconnect(cbx_submodule, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_cbxSubmoduleChanged(int))); + cbx_submodule->clear(); + cbx_submodule->addItem(DApplication::translate("ComboBox", "All")); + for (auto submodule : logConfig.subModules) { + cbx_submodule->addItem(submodule.name); + } + cbx_submodule->setCurrentText(DApplication::translate("ComboBox", "All")); + connect(cbx_submodule, SIGNAL(currentIndexChanged(int)), this, SLOT(slot_cbxSubmoduleChanged(int))); + } +} + /** * @brief FilterContent::setSelectorVisible 设置筛选控件显示或不显示以适应各种日志类型的筛选情况 * @param lvCbx 等级筛选下拉框是否显示 @@ -263,9 +326,10 @@ void FilterContent::setAppComboBoxItem() * @param period 时间筛选按钮是否显示 * @param needMove 如果筛选器只有单排布局,则需要移动导出按钮到上排布局,这个参数表示是否把导出按钮移动到上排的布局 * @param typecbx 开关机日志日志种类筛选下拉框是否显示 + * @param auditcbx 审计日志审计类型筛选下拉框是否显示 */ void FilterContent::setSelectorVisible(bool lvCbx, bool appListCbx, bool statusCbx, bool period, - bool needMove, bool typecbx, bool dnfCbx) + bool needMove, bool typecbx, bool dnfCbx, bool auditCbx) { //先不立马更新界面,等全部更新好控件状态后再更新界面,否则会导致界面跳动 setUpdatesEnabled(false); @@ -276,12 +340,18 @@ void FilterContent::setSelectorVisible(bool lvCbx, bool appListCbx, bool statusC appTxt->setVisible(appListCbx); cbx_app->setVisible(appListCbx); + submoduleTxt->setVisible(false); + cbx_submodule->setVisible(false); + dnflvTxt->setVisible(dnfCbx); cbx_dnf_lv->setVisible(dnfCbx); typeTxt->setVisible(typecbx); // add by Airy typeCbx->setVisible(typecbx); // add by Airy + auditTypeTxt->setVisible(auditCbx); + auditTypeCbx->setVisible(auditCbx); + periodLabel->setVisible(period); //button的setVisible false会触发taborder到下一个可视控件,比如cbx_status,所以先设置button,再设置cbx_status可防止点击后时间筛选button后再切启动日志导致cbx_status自动进入tabfocus状态,但是这样会引起本窗口焦点重置,所以设置完后需要对loglist setfoucs for (int i = 0; i < 6; i++) { @@ -319,14 +389,14 @@ void FilterContent::setSelection(FILTER_CONFIG iConifg) if (cbx_lv->isVisible()) cbx_lv->setCurrentIndex(iConifg.levelCbx); if (cbx_app->isVisible()) { - QString path = iConifg.appListCbx; + QString app = iConifg.appListCbx; int appCount = cbx_app->count(); int rsIndex = 0; - if (!path.isEmpty()) { + if (!app.isEmpty()) { //找原来选的选项的index,如果这个应用日志没了,就选第一个 for (int i = 0; i < appCount; ++i) { - if (cbx_app->itemData(i, Qt::UserRole + 1).toString() == path) { + if (cbx_app->itemData(i, Qt::UserRole + 1).toString() == app) { rsIndex = i; break; } @@ -338,12 +408,27 @@ void FilterContent::setSelection(FILTER_CONFIG iConifg) } else { cbx_app->setCurrentIndex(rsIndex); } + + if (cbx_submodule->isVisible()) { + + int nSubIndex = 0; + //找原来选的选项的index,如果这个子模块没了,就选择所有 + for (int i = 0; i < cbx_submodule->count(); ++i) { + if (cbx_submodule->itemText(i) == iConifg.app2Submodule[app]) { + nSubIndex = i; + break; + } + } + cbx_submodule->setCurrentIndex(nSubIndex); + } } if (cbx_status->isVisible()) Q_EMIT cbx_status->currentIndexChanged(iConifg.statusCbx); if (typeCbx->isVisible()) typeCbx->setCurrentIndex(iConifg.typeCbx); + if (auditTypeCbx->isVisible()) + auditTypeCbx->setCurrentIndex(iConifg.auditCbx); if (cbx_dnf_lv->isVisible()) { cbx_dnf_lv->setCurrentIndex(iConifg.dnfCbx); } @@ -614,7 +699,7 @@ void FilterContent::slot_logCatelogueClicked(const QModelIndex &index) this->setSelectorVisible(false, false, false, true, true); } else if (itemData.contains(XORG_TREE_DATA, Qt::CaseInsensitive)) { m_currentType = XORG_TREE_DATA; - this->setSelectorVisible(false, false, false, true, + this->setSelectorVisible(false, false, false, false, true); // modified by Airy for showing peroid } else if (itemData.contains(LAST_TREE_DATA, Qt::CaseInsensitive)) { // add by Airy m_currentType = LAST_TREE_DATA; @@ -641,6 +726,12 @@ void FilterContent::slot_logCatelogueClicked(const QModelIndex &index) m_currentType = CUSTOM_TREE_DATA; //this->setSelectorVisible(false, false, false, true, false, false, true); this->setVisible(false); + } else if (itemData.contains(AUDIT_TREE_DATA)) { + m_currentType = AUDIT_TABLE_DATA; + this->setSelectorVisible(false, false, false, true, false, false, false, true); + } else if (itemData.contains(COREDUMP_TREE_DATA)) { + m_currentType = COREDUMP_TREE_DATA; + this->setSelectorVisible(false, false, false, true, true, false, false, false); } updateDataState(); //必须需要,因为会丢失当前焦点顺序 @@ -758,14 +849,25 @@ void FilterContent::slot_cbxLvIdxChanged(int idx) void FilterContent::slot_cbxAppIdxChanged(int idx) { setChangedcomboxstate(!getLeftButtonState()); - QString path = cbx_app->itemData(idx, Qt::UserRole + 1).toString(); + QString app = cbx_app->itemData(idx, Qt::UserRole + 1).toString(); FILTER_CONFIG curConfig = m_config.value(m_currentType); - qDebug() << "apppath" << path; - curConfig.appListCbx = path; + curConfig.appListCbx = app; //变化时改变记录选择选项的数据结构,以便下次还原 setCurrentConfig(curConfig); //发出信号以供数据显示控件刷新数据 - emit sigCbxAppIdxChanged(curConfig.dateBtn, path); + emit sigCbxAppIdxChanged(curConfig.dateBtn, app); + + // 初始化子模块列表 + setSubmodulesComboBoxItem(app); +} + +void FilterContent::slot_cbxSubmoduleChanged(int idx) +{ + setChangedcomboxstate(true); + FILTER_CONFIG curConfig = m_config.value(m_currentType); + curConfig.app2Submodule[curConfig.appListCbx] = cbx_submodule->currentText(); + setCurrentConfig(curConfig); + emit sigCbxSubModuleChanged(idx); } /** @@ -799,7 +901,15 @@ void FilterContent::slot_cbxLogTypeChanged(int idx) curConfig.typeCbx = idx; setCurrentConfig(curConfig); emit sigLogtypeChanged(idx); - qDebug() << "emit signal " + QString::number(idx); +} + +void FilterContent::slot_cbxAuditTypeChanged(int idx) +{ + setChangedcomboxstate(true); + FILTER_CONFIG curConfig = m_config.value(m_currentType); + curConfig.auditCbx = idx; + setCurrentConfig(curConfig); + emit sigAuditTypeChanged(idx); } /** diff --git a/application/filtercontent.h b/application/filtercontent.h index c712ec44..38f0c48e 100644 --- a/application/filtercontent.h +++ b/application/filtercontent.h @@ -65,9 +65,10 @@ class FilterContent : public Dtk::Widget::DFrame private: void setAppComboBoxItem(); + void setSubmodulesComboBoxItem(const QString &app); void setSelectorVisible(bool lvCbx, bool appListCbx, bool statusCbx, bool period, bool needMove, - bool typecbx = false, bool dnfCbx = false); // modified by Airy + bool typecbx = false, bool dnfCbx = false, bool auditCbx = false); // modified by Airy void setSelection(FILTER_CONFIG iConifg); void setUeButtonSytle(); @@ -88,9 +89,14 @@ class FilterContent : public Dtk::Widget::DFrame void sigButtonClicked(int tId, int lId, QModelIndex idx); /** * @brief sigCbxAppIdxChanged 应用日志中应用选择下拉框触发信号 - * @param path 当前选择的应用日志文件路径 + * @param app 当前选择的应用项目名称 */ - void sigCbxAppIdxChanged(int btnId, QString path); + void sigCbxAppIdxChanged(int btnId, QString app); + /** + * @brief sigCbxSubModuleChanged 应用日志中子模塊选择下拉框触发信号 + * @param tId 下拉框当前index + */ + void sigCbxSubModuleChanged(int tId); /** * @brief sigExportInfo 导出按钮触发信号 */ @@ -105,6 +111,11 @@ class FilterContent : public Dtk::Widget::DFrame * @param tId 下拉框当前index */ void sigLogtypeChanged(int tId); // add by Airy + /** + * @brief sigAuditTypeChanged 审计日志审计类型下拉框触发筛选信号 + * @param tId 下拉框当前index + */ + void sigAuditTypeChanged(int tId); /** * @brief sigResizeWidth 当前控件应有宽度信号 * @param iWidth 计算宽度 @@ -118,8 +129,10 @@ public slots: void slot_exportButtonClicked(); void slot_cbxLvIdxChanged(int idx); void slot_cbxAppIdxChanged(int idx); + void slot_cbxSubmoduleChanged(int idx); void slot_cbxStatusChanged(int idx); void slot_cbxLogTypeChanged(int idx); // add by Airy + void slot_cbxAuditTypeChanged(int idx); void setExportButtonEnable(bool iEnable); void slot_cbxDnfLvIdxChanged(int idx); @@ -156,6 +169,14 @@ public slots: * @brief cbx_app 应用日志应用筛选下拉框 */ LogCombox *cbx_app; + /** + * @brief submoduleTxt 应用日志子模块筛选下拉框提示文字 + */ + Dtk::Widget::DLabel *submoduleTxt; + /** + * @brief cbx_submodule 应用日志子模块筛选下拉框 + */ + LogCombox *cbx_submodule; /** * @brief statusTxt 启动日志状态筛选下拉框前面的提示文字 */ @@ -172,6 +193,14 @@ public slots: * @brief typeCbx 开关机日志日志种类筛选下拉框 */ LogCombox *typeCbx; // add by Airy + /** + * @brief typeTxt 审计日志审计类型筛选下拉框前面的提示文字 + */ + Dtk::Widget::DLabel *auditTypeTxt; + /** + * @brief typeCbx 审计日志审计类型筛选下拉框 + */ + LogCombox *auditTypeCbx; /** * @brief m_curTreeIndex 日志种类选择listview传进来的当前选择的日志种类信息 */ diff --git a/application/gschema/com.deepin.log-viewer.gschema.xml b/application/gschema/com.deepin.log-viewer.gschema.xml deleted file mode 100644 index 1662ca83..00000000 --- a/application/gschema/com.deepin.log-viewer.gschema.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - [] - - Show extra logs - It is null by default. To display extra logs in Log Viewer, please configure the absolute path of the corresponding log file. And make sure the operator has permission to read it.For example: ['a.log', 'b.log', 'c.log'] - - - diff --git a/application/gschema/com.deepin.log.viewer.gschema.xml b/application/gschema/com.deepin.log.viewer.gschema.xml new file mode 100644 index 00000000..d58e44d6 --- /dev/null +++ b/application/gschema/com.deepin.log.viewer.gschema.xml @@ -0,0 +1,23 @@ + + + + + [] + + Show extra logs + It is null by default. To display extra logs in Log Viewer, please configure the absolute path of the corresponding log file. And make sure the operator has permission to read it.For example: ['a.log', 'b.log', 'c.log'] + + + '' + + Coredump report time + It is null by default. Record the time point of the last successful crash report, used to achieve incremental escalation + + + + 50 + Coredump report max + It is 50 by default.The maximum number of crash messages reported at once + + + diff --git a/application/journalbootwork.cpp b/application/journalbootwork.cpp index b02c0cff..cffa18ad 100644 --- a/application/journalbootwork.cpp +++ b/application/journalbootwork.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -13,6 +13,13 @@ #include #include #include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logJournalboot, "org.deepin.log.viewer.parse.boot.journal.work") +#else +Q_LOGGING_CATEGORY(logJournalboot, "org.deepin.log.viewer.parse.boot.journal.work", QtInfoMsg) +#endif DWIDGET_USE_NAMESPACE @@ -73,7 +80,7 @@ JournalBootWork::~JournalBootWork() void JournalBootWork::stopWork() { m_canRun = false; - qDebug() << "stopWorkb"; + qCDebug(logJournalboot) << "stopWork"; } /** @@ -110,7 +117,7 @@ void JournalBootWork::setArg(QStringList arg) */ void JournalBootWork::run() { - qDebug() << "JournalBootWork::run----threadrun"; + qCDebug(logJournalboot) << "threadrun"; doWork(); } @@ -131,7 +138,7 @@ void JournalBootWork::doWork() mutex.unlock(); return; } -#if 1 + int r; sd_journal *j ; if ((!m_canRun)) { @@ -148,7 +155,7 @@ void JournalBootWork::doWork() //r为系统借口返回值,小于0则表示失败,直接返回 if (r < 0) { QString errostr = QString("Failed to open journal: %1").arg(r); - qDebug() << errostr; + qCWarning(logJournalboot) << errostr; emit journalBootError(errostr); return; } @@ -157,7 +164,7 @@ void JournalBootWork::doWork() if (r < 0) { QString errostr = QString("Failed to seek tail journal: %1").arg(r); - qDebug() << errostr; + qCWarning(logJournalboot) << errostr; emit journalBootError(errostr); return; } @@ -174,7 +181,7 @@ void JournalBootWork::doWork() r = sd_journal_add_match(j, m_arg.at(0).toStdString().c_str(), 0); if (r < 0) { QString errostr = QString("Failed to add match journal: %1").arg(r); - qDebug() << errostr; + qCWarning(logJournalboot) << errostr; emit journalBootError(errostr); return; } @@ -201,12 +208,12 @@ void JournalBootWork::doWork() sd_journal_close(j); return; } - qDebug() << "match" << match; + qCDebug(logJournalboot) << "journal match condition:" << match; //增加筛选条件 r = sd_journal_add_match(j, match, sizeof(match) - 1); if (r < 0) { QString errostr = QString("Failed to add match journal: %1").arg(r); - qDebug() << errostr; + qCWarning(logJournalboot) << errostr; emit journalBootError(errostr); return; } @@ -214,7 +221,7 @@ void JournalBootWork::doWork() r = sd_journal_add_conjunction(j); if (r < 0) { QString errostr = QString("Failed to add conjunction journal: %1").arg(r); - qDebug() << errostr; + qCWarning(logJournalboot) << errostr; emit journalBootError(errostr); return; } @@ -276,7 +283,7 @@ void JournalBootWork::doWork() r = sd_journal_get_data(j, "_COMM", reinterpret_cast(&d), &l); if (r < 0) { logMsg.daemonName = "unknown"; - qDebug() << logMsg.daemonId << "error code" << r; + qCWarning(logJournalboot) << logMsg.daemonId << "error code" << r; } else { QStringList strList = getReplaceColorStr(d).split("="); strList.removeFirst(); @@ -325,54 +332,6 @@ void JournalBootWork::doWork() emit journalBootFinished(m_threadIndex); //第一次加载时这个之后的代码都不执行?故放到最后 sd_journal_close(j); - -#else - proc = new QProcess; - //! by time: --since="xxxx-xx-xx" --until="xxxx-xx-xx" exclude U - //! by priority: journalctl PRIORITY=x - proc->start("journalctl", m_arg); - proc->waitForFinished(-1); - - QByteArray output = proc->readAllStandardOutput(); - proc->close(); - - // reverse by time - QList arrayList = output.split('\n'); - for (auto i = arrayList.count() - 1; i >= 0; i--) { - QByteArray data = arrayList.at(i); - // for (QByteArray data : output.split('\n')) { - if (data.isEmpty()) - continue; - - LOG_MSG_JOURNAL logMsg; - - cnt++; - - QJsonParseError erro; - QJsonDocument jsonDoc(QJsonDocument::fromJson(data, &erro)); - - if (erro.error != QJsonParseError::NoError) { - qDebug() << "erro" << erro.error << erro.errorString(); - continue; - } - QJsonObject jsonObj = jsonDoc.object(); - // fill field - QString dt = jsonObj.value("_SOURCE_REALTIME_TIMESTAMP").toString(); - if (dt.isEmpty()) - dt = jsonObj.value("__REALTIME_TIMESTAMP").toString(); - logMsg.dateTime = getDateTimeFromStamp(dt); - logMsg.hostName = jsonObj.value("_HOSTNAME").toString(); - logMsg.daemonName = jsonObj.value("_COMM").toString(); - logMsg.daemonId = jsonObj.value("_PID").toString(); - logMsg.msg = jsonObj.value("MESSAGE").toString(); - logMsg.level = i2str(jsonObj.value("PRIORITY").toString().toInt()); - logList.append(logMsg); - if (cnt == 500) - break; - } - - emit journalFinished(logList); -#endif } /** @@ -396,10 +355,9 @@ QString JournalBootWork::getReplaceColorStr(const char *d) * @param str 接口获取的原始时间字符 * @return 格式化的时间显示文本 */ -QString JournalBootWork::getDateTimeFromStamp(QString str) +QString JournalBootWork::getDateTimeFromStamp(const QString &str) { QString ret = ""; - QString ums = str.right(6); QString dtstr = str.left(str.length() - 6); QDateTime dt = QDateTime::fromTime_t(dtstr.toUInt()); ret = dt.toString("yyyy-MM-dd hh:mm:ss"); // + QString(".%1").arg(ums); diff --git a/application/journalbootwork.h b/application/journalbootwork.h index a3395b7a..3f6df966 100644 --- a/application/journalbootwork.h +++ b/application/journalbootwork.h @@ -80,7 +80,7 @@ public slots: */ static int thread_index ; private: - QString getDateTimeFromStamp(QString str); + QString getDateTimeFromStamp(const QString &str); void initMap(); QString i2str(int prio); /** @@ -97,7 +97,7 @@ public slots: /** * @brief m_canRun 是否允许标记量,用于停止该线程 */ - bool m_canRun = false; + std::atomic_bool m_canRun = false; /** * @brief m_threadIndex 当前线程标号 */ diff --git a/application/journalwork.cpp b/application/journalwork.cpp index 88f7162f..fa7f5902 100644 --- a/application/journalwork.cpp +++ b/application/journalwork.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -13,6 +13,13 @@ #include #include #include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logJournal, "org.deepin.log.viewer.parse.system.journal.work") +#else +Q_LOGGING_CATEGORY(logJournal, "org.deepin.log.viewer.parse.system.journal.work", QtInfoMsg) +#endif DWIDGET_USE_NAMESPACE @@ -75,7 +82,7 @@ journalWork::~journalWork() */ void journalWork::stopWork() { - qDebug() << "stopWork"; + qCDebug(logJournal) << "stopWork"; m_canRun = false; } @@ -114,7 +121,7 @@ void journalWork::setArg(QStringList arg) */ void journalWork::run() { - qDebug() << "journalWork::run--------threadrun"; + qCDebug(logJournal) << "threadrun"; doWork(); } @@ -133,7 +140,7 @@ void journalWork::doWork() mutex.unlock(); return; } -#if 1 + int r; sd_journal *j ; @@ -174,7 +181,6 @@ void journalWork::doWork() return; } int cnt = 0; - qDebug() << "m_arg" << m_arg; //调用宏开始迭代 SD_JOURNAL_FOREACH_BACKWARDS(j) { if ((!m_canRun)) { @@ -223,12 +229,25 @@ void journalWork::doWork() logMsg.daemonId = strList.join("="); } //获取进程名 - r = sd_journal_get_data(j, "_COMM", reinterpret_cast(&d), &l); + r = sd_journal_get_data(j, "SYSLOG_IDENTIFIER", reinterpret_cast(&d), &l); if (r < 0) { - logMsg.daemonName = "unknown"; - qDebug() << logMsg.daemonId << "error code" << r; + r = sd_journal_get_data(j, "_EXE", reinterpret_cast(&d), &l); + if (r >= 0) { + QStringList strList = getReplaceColorStr(d).split("="); + strList.removeFirst(); + QFileInfo fi(strList.first()); + if (fi.exists()) + logMsg.daemonName = fi.fileName(); + else { + qCWarning(logJournal) << "unknown progressname, exe path: " << strList.first(); + logMsg.daemonName = "unknown"; + } + } else { + qCWarning(logJournal) << logMsg.daemonId << "error code" << r; + logMsg.daemonName = "unknown"; + } } else { - QStringList strList = getReplaceColorStr(d).split("="); + QStringList strList = getReplaceColorStr(d).split("="); strList.removeFirst(); logMsg.daemonName = strList.join("="); } @@ -275,54 +294,6 @@ void journalWork::doWork() emit journalFinished(m_threadIndex); //第一次加载时这个之后的代码都不执行?故放到最后 sd_journal_close(j); - -#else - proc = new QProcess; - //! by time: --since="xxxx-xx-xx" --until="xxxx-xx-xx" exclude U - //! by priority: journalctl PRIORITY=x - proc->start("journalctl", m_arg); - proc->waitForFinished(-1); - - QByteArray output = proc->readAllStandardOutput(); - proc->close(); - - // reverse by time - QList arrayList = output.split('\n'); - for (auto i = arrayList.count() - 1; i >= 0; i--) { - QByteArray data = arrayList.at(i); - // for (QByteArray data : output.split('\n')) { - if (data.isEmpty()) - continue; - - LOG_MSG_JOURNAL logMsg; - - cnt++; - - QJsonParseError erro; - QJsonDocument jsonDoc(QJsonDocument::fromJson(data, &erro)); - - if (erro.error != QJsonParseError::NoError) { - qDebug() << "erro" << erro.error << erro.errorString(); - continue; - } - QJsonObject jsonObj = jsonDoc.object(); - // fill field - QString dt = jsonObj.value("_SOURCE_REALTIME_TIMESTAMP").toString(); - if (dt.isEmpty()) - dt = jsonObj.value("__REALTIME_TIMESTAMP").toString(); - logMsg.dateTime = getDateTimeFromStamp(dt); - logMsg.hostName = jsonObj.value("_HOSTNAME").toString(); - logMsg.daemonName = jsonObj.value("_COMM").toString(); - logMsg.daemonId = jsonObj.value("_PID").toString(); - logMsg.msg = jsonObj.value("MESSAGE").toString(); - logMsg.level = i2str(jsonObj.value("PRIORITY").toString().toInt()); - logList.append(logMsg); - if (cnt == 500) - break; - } - - emit journalFinished(logList); -#endif } /** @@ -346,10 +317,9 @@ QString journalWork::getReplaceColorStr(const char *d) * @param str 接口获取的原始时间字符 * @return 格式化的时间显示文本 */ -QString journalWork::getDateTimeFromStamp(QString str) +QString journalWork::getDateTimeFromStamp(const QString &str) { QString ret = ""; - QString ums = str.right(6); QString dtstr = str.left(str.length() - 6); QDateTime dt = QDateTime::fromTime_t(dtstr.toUInt()); ret = dt.toString("yyyy-MM-dd hh:mm:ss"); // + QString(".%1").arg(ums); diff --git a/application/journalwork.h b/application/journalwork.h index cd80e6f0..e012610b 100644 --- a/application/journalwork.h +++ b/application/journalwork.h @@ -77,7 +77,7 @@ public slots: */ static int thread_index ; private: - QString getDateTimeFromStamp(QString str); + QString getDateTimeFromStamp(const QString &str); void initMap(); QString i2str(int prio); /** @@ -96,7 +96,7 @@ public slots: /** * @brief m_canRun 是否允许标记量,用于停止该线程 */ - bool m_canRun = false; + std::atomic_bool m_canRun = false; /** * @brief m_threadIndex 当前线程标号 */ diff --git a/application/logallexportthread.cpp b/application/logallexportthread.cpp index 4a547aa7..0b51dc33 100644 --- a/application/logallexportthread.cpp +++ b/application/logallexportthread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,6 +6,14 @@ #include "dbusproxy/dldbushandler.h" #include "logapplicationhelper.h" #include "utils.h" + +#include +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logExportAll, "org.deepin.log.viewer.exportall.work") +#else +Q_LOGGING_CATEGORY(logExportAll, "org.deepin.log.viewer.exportall.work", QtInfoMsg) +#endif + LogAllExportThread::LogAllExportThread(const QStringList &types, const QString &outfile, QObject *parent) : QObject(parent) , m_types(types) @@ -16,66 +24,120 @@ LogAllExportThread::LogAllExportThread(const QStringList &types, const QString & void LogAllExportThread::run() { //判断权限 + qCInfo(logExportAll) << "outFile: " << m_outfile; QFileInfo info(m_outfile); if (!QFileInfo(info.path()).isWritable()) { + qCCritical(logExportAll) << QString("outdir:%1 it not writable or is not exist.").arg(info.absolutePath()); emit exportFinsh(false); return; } - QStringList files; - QStringList commands; - - if (files.isEmpty() && commands.isEmpty()) { - //获取所有文件 - for (auto &it : m_types) { - if (it.contains(JOUR_TREE_DATA, Qt::CaseInsensitive)) { - commands.push_back("journalctl_system"); - } else if (it.contains(BOOT_KLU_TREE_DATA, Qt::CaseInsensitive)) { - commands.push_back("journalctl_boot"); - } else if (it.contains(DMESG_TREE_DATA, Qt::CaseInsensitive)) { - commands.push_back("dmesg"); - } else if (it.contains(LAST_TREE_DATA, Qt::CaseInsensitive)) { - commands.push_back("last"); - } else if (it.contains(DPKG_TREE_DATA, Qt::CaseInsensitive)) { - files.append(DLDBusHandler::instance(nullptr)->getFileInfo("dpkg", false)); - } else if (it.contains(KERN_TREE_DATA, Qt::CaseInsensitive)) { - files.append(DLDBusHandler::instance(nullptr)->getFileInfo("kern", false)); - } else if (it.contains(XORG_TREE_DATA, Qt::CaseInsensitive)) { - files.append(DLDBusHandler::instance(nullptr)->getFileInfo("Xorg", false)); - } else if (it.contains(DNF_TREE_DATA, Qt::CaseInsensitive)) { - files.append(DLDBusHandler::instance(nullptr)->getFileInfo("dnf", false)); - } else if (it.contains(BOOT_TREE_DATA, Qt::CaseInsensitive)) { - files.append(DLDBusHandler::instance(nullptr)->getFileInfo("boot", false)); - } else if (it.contains(KWIN_TREE_DATA, Qt::CaseInsensitive)) { - files.append(KWIN_TREE_DATA); - } else if (it.contains(APP_TREE_DATA, Qt::CaseInsensitive)) { - QMap appData = LogApplicationHelper::instance()->getMap(); - for (auto &it : appData.toStdMap()) { - files.append(it.second); - } - } else if (it.contains(OTHER_TREE_DATA, Qt::CaseInsensitive)) { - QList list = LogApplicationHelper::instance()->getOtherLogList(); - for (QStringList it : list) { - files.append(it.at(1)); - } - } else if (it.contains(CUSTOM_TREE_DATA, Qt::CaseInsensitive)) { - QList list = LogApplicationHelper::instance()->getCustomLogList(); - for (QStringList it : list) { - files.append(it.at(1)); + QList eList; + + int nCount = 0; + //获取所有文件 + for (auto &it : m_types) { + EXPORTALL_DATA data; + if (it.contains(JOUR_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "system"; + data.commands.push_back("journalctl_system"); + } else if (it.contains(BOOT_KLU_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "boot"; + data.commands.push_back("journalctl_boot"); + } else if (it.contains(DMESG_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "kernel"; + data.commands.push_back("dmesg"); + } else if (it.contains(LAST_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "boot-shutdown-event"; + data.commands.push_back("last"); + } else if (it.contains(DPKG_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "dpkg"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("dpkg", false)); + } else if (it.contains(KERN_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "kernel"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("kern", false)); + } else if (it.contains(XORG_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "xorg"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("Xorg", false)); + } else if (it.contains(DNF_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "dnf"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("dnf", false)); + } else if (it.contains(BOOT_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "boot"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("boot", false)); + } else if (it.contains(KWIN_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "kwin"; + data.files.append(KWIN_TREE_DATA); + } else if (it.contains(APP_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "apps"; + AppLogConfigList appConfigs = LogApplicationHelper::instance()->getAppLogConfigs(); + for (auto appLogConfig : appConfigs) { + QString appName = appLogConfig.name; + if(appName.isEmpty() || !appLogConfig.visible) + continue; + + for (int i = 0; i < appLogConfig.subModules.size(); i++) { + SubModuleConfig& submodule = appLogConfig.subModules[i]; + QString dir = appLogConfig.name; + QString subDir = QString("%1/%2").arg(dir).arg(submodule.name); + if (appLogConfig.subModules.size() == 1 && submodule.name == appLogConfig.name) + subDir = dir; + if (submodule.logType == "file") { + QStringList logPaths = DLDBusHandler::instance(nullptr)->getFileInfo(submodule.logPath); + logPaths.removeDuplicates(); + if (logPaths.size() > 0) { + data.dir2Files[subDir] = logPaths; + } else { + qCWarning(logExportAll) << QString("app:%1 submodule:%2, logPath:%3 not found log files.").arg(appName).arg(submodule.name).arg(submodule.logPath); + } + } else if (submodule.logType == "journal") { + if (submodule.filter.endsWith("*")) + qCWarning(logExportAll) << QString("app:%1 submodule:%2, Export journal logs with wildcard not supported.").arg(appName).arg(submodule.name); + else { + QJsonObject obj = submodule.toJson(); + data.dir2Cmds[subDir] = QStringList() << QJsonDocument(obj).toJson(QJsonDocument::Compact); + } + } } } - - //取消导出直接返回 - if (m_cancel) { - files.clear(); - commands.clear(); - emit exportFinsh(false); - return; + } else if (it.contains(COREDUMP_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "coredump"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("coredump", false)); + } else if (it.contains(OTHER_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "others"; + auto otherLogListPair = LogApplicationHelper::instance()->getOtherLogList(); + for (auto &it2 : otherLogListPair) { + QStringList paths = DLDBusHandler::instance(nullptr)->getOtherFileInfo(it2.at(1)); + paths.removeDuplicates(); + if (paths.size() > 1) + data.dir2Files[it2.at(0)] = paths; + else if (paths.size() == 1) + data.files.append(paths); + } + } else if (it.contains(CUSTOM_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "customized"; + auto customLogListPair = LogApplicationHelper::instance()->getCustomLogList(); + for (auto &it2 : customLogListPair) { + data.files.append(it2.at(1)); } + } else if (it.contains(AUDIT_TREE_DATA, Qt::CaseInsensitive)) { + data.logCategory = "audit"; + data.files.append(DLDBusHandler::instance(nullptr)->getFileInfo("audit", false)); + } + + eList.push_back(data); + data.files.removeDuplicates(); + data.commands.removeDuplicates(); + nCount += data.files.size() + data.commands.size() + data.dir2FilesCount() + data.dir2CmdsCount(); + + //取消导出直接返回 + if (m_cancel) { + emit exportFinsh(false); + return; } } - if (files.isEmpty() && commands.isEmpty()) { + if (eList.isEmpty()) { emit exportFinsh(false); return; } @@ -86,43 +148,98 @@ void LogAllExportThread::run() return; } - int tolProcess = files.size() + commands.size() + 10; + int tolProcess = nCount + 10; int currentProcess = 1; emit updateTolProcess(tolProcess); - QString tmpPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tmp/"; + QString tmpPath = Utils::getAppDataPath() + "/tmp/"; QDir dir(tmpPath); //删除临时目录 dir.removeRecursively(); //创建临时目录 Utils::mkMutiDir(tmpPath); - //复制文件 - for (auto &it : files) { - DLDBusHandler::instance(this)->exportLog(tmpPath, it, true); - emit updatecurrentProcess(currentProcess++); - if (m_cancel) { - break; - } - } - if (false == m_cancel) { - for (auto &it : commands) { - DLDBusHandler::instance(this)->exportLog(tmpPath, it, false); + for (auto &it : eList) { + //复制文件到一级目录 + QString tmpCategoryPath = QString("%1%2/").arg(tmpPath).arg(it.logCategory); + Utils::mkMutiDir(tmpCategoryPath); + for (auto &file : it.files) { + DLDBusHandler::instance(this)->exportLog(tmpCategoryPath, file, true); emit updatecurrentProcess(currentProcess++); if (m_cancel) { break; } } + + // 复制文件到二级目录 + if (!m_cancel) { + QMapIterator itMap(it.dir2Files); + while (itMap.hasNext()) { + itMap.next(); + if (m_cancel) + break; + + if (itMap.value().size() > 0) { + QString tmpSubCategoryPath = QString("%1%2/").arg(tmpCategoryPath).arg(itMap.key()); + Utils::mkMutiDir(tmpSubCategoryPath); + for (auto &path : itMap.value()) { + DLDBusHandler::instance(this)->exportLog(tmpSubCategoryPath, path, true); + emit updatecurrentProcess(currentProcess++); + if (m_cancel) { + break; + } + } + } + } + } else + break; + + // 导出命令查询内容到二级目录 + if (!m_cancel) { + QMapIterator itMap(it.dir2Cmds); + while (itMap.hasNext()) { + itMap.next(); + if (m_cancel) + break; + + if (itMap.value().size() > 0) { + QString tmpSubCategoryPath = QString("%1%2/").arg(tmpCategoryPath).arg(itMap.key()); + Utils::mkMutiDir(tmpSubCategoryPath); + for (auto &cmd : itMap.value()) { + DLDBusHandler::instance(this)->exportLog(tmpSubCategoryPath, cmd, false); + emit updatecurrentProcess(currentProcess++); + if (m_cancel) { + break; + } + } + } + } + } else + break; + + // 执行获取日志命令 + if (!m_cancel) { + for (auto &command : it.commands) { + DLDBusHandler::instance(this)->exportLog(tmpCategoryPath, command, false); + emit updatecurrentProcess(currentProcess++); + if (m_cancel) { + break; + } + } + } else + break; } - if (false == m_cancel) { + + if (!m_cancel) { //打包日志文件 QProcess procss; procss.setWorkingDirectory(tmpPath); QStringList arg = {"-c"}; - arg.append(QString("zip tmp.zip *.*;mv tmp.zip '%1'").arg(m_outfile)); + arg.append(QString("chmod -R 777 '%1';zip -r tmp.zip ./*;mv tmp.zip '%2';chmod 777 '%3'").arg(Utils::getAppDataPath()).arg(m_outfile).arg(m_outfile)); procss.start("/bin/bash", arg); procss.waitForFinished(-1); currentProcess += 9; emit updatecurrentProcess(currentProcess); } + //删除临时目录 dir.removeRecursively(); //取消导出删除输出文件 diff --git a/application/logapplicationhelper.cpp b/application/logapplicationhelper.cpp index 7168addd..5ad23064 100644 --- a/application/logapplicationhelper.cpp +++ b/application/logapplicationhelper.cpp @@ -1,27 +1,49 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "logapplicationhelper.h" +#include "utils.h" #include #include #include #include +#include +#include +#include +#include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logAppHelper, "org.deepin.log.viewer.application.helper") +#else +Q_LOGGING_CATEGORY(logAppHelper, "org.deepin.log.viewer.application.helper", QtInfoMsg) +#endif std::atomic LogApplicationHelper::m_instance; std::mutex LogApplicationHelper::m_mutex; +// 自研应用日志json配置文件目录 +const QString APP_LOG_CONFIG_PATH = "/usr/share/deepin-log-viewer/deepin-log.conf.d"; + +const QString COREDUMP_REPORT_TIME = "coredumpReportTime"; +const QString COREDUMP_REPORT_TIME_GSETTING = "coredumpreporttime"; +const QString COREDUMP_REPORT_MAX = "coredumpReportMax"; +const QString COREDUMP_REPORT_MAX_GSETTING = "coredumpreportmax"; +const QString DCONFIG_APPID = "org.deepin.log.viewer"; +const QString GSETTING_APPID = "com.deepin.log.viewer"; + +// 默认崩溃上报最大条数 +#define MAX_COREDUMP_REPORT 50 + /** * @brief LogApplicationHelper::LogApplicationHelper 构造函数,获取日志文件路径和应用名称 * @param parent 父对象 */ LogApplicationHelper::LogApplicationHelper(QObject *parent) : QObject(parent) - , m_DbusLauncher(new DBbusLauncher(DBbusLauncher::staticInterfaceName(), "/com/deepin/dde/daemon/Launcher", QDBusConnection::sessionBus(), this)) { - registerLauncherItemInfoMetaType(); - registerLauncherItemInfoListMetaType(); init(); } @@ -30,26 +52,25 @@ LogApplicationHelper::LogApplicationHelper(QObject *parent) */ void LogApplicationHelper::init() { - initAppLog(); + getAppLogConfigs(); initOtherLog(); initCustomLog(); } void LogApplicationHelper::initAppLog() { - m_desktop_files.clear(); - m_log_files.clear(); - - m_en_log_map.clear(); - m_en_trans_map.clear(); - m_trans_log_map.clear(); - // get current system language shortname m_current_system_language = QLocale::system().name(); - // get desktop & log files + // get desktop & trasnames createDesktopFiles(); + + // load json config + loadAppLogConfigsByJson(); + createLogFiles(); + + createTransLogFiles(); } void LogApplicationHelper::initOtherLog() @@ -57,68 +78,80 @@ void LogApplicationHelper::initOtherLog() //配置其他日志文件(可以是目录) m_other_log_list.clear(); - m_other_log_list.append(QStringList()<<"alternatives.log"<<"/var/log/alternatives.log"); - m_other_log_list.append(QStringList()<<"history.log"<<"/var/log/apt/history.log"); - m_other_log_list.append(QStringList()<<"term.log"<<"/var/log/apt/term.log"); - m_other_log_list.append(QStringList()<<"auth.log"<<"/var/log/auth.log"); - - m_other_log_list.append(QStringList()<<"access_log"<<"/var/log/cups/access_log"); - m_other_log_list.append(QStringList()<<"error_log"<<"/var/log/cups/error_log"); - m_other_log_list.append(QStringList()<<"daemon.log"<<"/var/log/daemon.log"); - - m_other_log_list.append(QStringList()<<"debug"<<"/var/log/debug"); - m_other_log_list.append(QStringList()<<"dde-dconfig-daemon"<<"/var/log/deepin/dde-dconfig-daemon"); - m_other_log_list.append(QStringList()<<"dde-file-manager-daemon"<<"/var/log/deepin/dde-file-manager-daemon"); - m_other_log_list.append(QStringList()<<"deepin-boot-maker-service.log"<<"/var/log/deepin/deepin-boot-maker-service.log"); - - m_other_log_list.append(QStringList()<<"debug"<<"/var/log/debug"); - m_other_log_list.append(QStringList()<<"dde-dconfig-daemon"<<"/var/log/deepin/dde-dconfig-daemon"); - m_other_log_list.append(QStringList()<<"dde-file-manager-daemon"<<"/var/log/deepin/dde-file-manager-daemon"); - m_other_log_list.append(QStringList()<<"deepin-boot-maker-service.log"<<"/var/log/deepin/deepin-boot-maker-service.log"); - - m_other_log_list.append(QStringList()<<"deepin-diskmanager-service"<<"/var/log/deepin/deepin-diskmanager-service/Log"); - m_other_log_list.append(QStringList()<<"deepin-home-appstore-daemon"<<"/var/log/deepin/deepin-home-appstore-daemon"); - m_other_log_list.append(QStringList()<<"deepin-log-viewer-service"<<"/var/log/deepin/deepin-log-viewer-service/Log"); - m_other_log_list.append(QStringList()<<"deepin-sync-helper_ERROR.log"<<"/var/log/deepin-deepinid-daemon/deepin-sync-helper_ERROR.log"); - - m_other_log_list.append(QStringList()<<"deepin-sync-helper.log"<<"/var/log/deepin-deepinid-daemon/deepin-sync-helper.log"); - m_other_log_list.append(QStringList()<<"deepin-defender-system-daemon.log"<<"/var/log/deepin-defender-system-daemon.log"); - m_other_log_list.append(QStringList()<<"deepin-face.log"<<"/var/log/deepin-face.log"); - m_other_log_list.append(QStringList()<<"deepin-installer-first-boot.log"<<"/var/log/deepin-installer-first-boot.log"); - - m_other_log_list.append(QStringList()<<"deepin-installer-init.log"<<"/var/log/deepin-installer-init.log"); - m_other_log_list.append(QStringList()<<"deepin-installer.log"<<"/var/log/deepin-installer.log"); - m_other_log_list.append(QStringList()<<"deepin-monitornetflow.log"<<"/var/log/deepin-monitornetflow.log"); - m_other_log_list.append(QStringList()<<"faillog"<<"/var/log/faillog"); - - m_other_log_list.append(QStringList()<<"lastlog"<<"/var/log/lastlog"); - m_other_log_list.append(QStringList()<<"lightdm.log"<<"/var/log/lightdm/lightdm.log"); - m_other_log_list.append(QStringList()<<"seat0-greeter.log"<<"/var/log/lightdm/seat0-greeter.log"); - m_other_log_list.append(QStringList()<<"x-0.log"<<"/var/log/lightdm/x-0.log"); - - m_other_log_list.append(QStringList()<<"x-1.log"<<"/var/log/lightdm/x-1.log"); - m_other_log_list.append(QStringList()<<"messages"<<"/var/log/messages"); - m_other_log_list.append(QStringList()<<"udcpg.log"<<"/var/log/udcpg/udcpg.log"); - m_other_log_list.append(QStringList()<<"uos-applicense-agent.log"<<"/var/log/uos/uos-applicense-agent/uos-applicense-agent.log"); - - m_other_log_list.append(QStringList()<<"uos-license-agent"<<"/var/log/uos/uos-license-agent"); - m_other_log_list.append(QStringList()<<"uos-license-upgrade"<<"/var/log/uos/uos-license-upgrade"); - m_other_log_list.append(QStringList()<<"user.log"<<"/var/log/user.log"); - m_other_log_list.append(QStringList()<<"vnetlib"<<"/var/log/vnetlib"); - - m_other_log_list.append(QStringList()<<"wtmp"<<"/var/log/wtmp"); - m_other_log_list.append(QStringList()<<"dcp_log"<<"/var/log/cups/dcp_log"); - m_other_log_list.append(QStringList()<<"deepin-graphics-driver-manager-server.log"<<"/var/log/deepin-graphics-driver-manager-server.log"); - m_other_log_list.append(QStringList()<<"uos-activator-kms.log"<<"/var/log/uos/uos-activator-kms/uos-activator-kms.log"); - - m_other_log_list.append(QStringList()<<"deepin-recovery-gui.log"<<"/recovery/deepin-recovery-gui.log"); - m_other_log_list.append(QStringList()<<"oem-custom-tool"<<"/var/local/oem-custom-tool"); - m_other_log_list.append(QStringList()<<"iso-customizer-agent.log"<<"/root/.cache/isocustomizer-agent/iso-customizer-agent/iso-customizer-agent.log"); - m_other_log_list.append(QStringList()<<"downloader"<<"~/.config/uos/downloader/Log"); - - m_other_log_list.append(QStringList()<<".kwin.log"<<"~/.kwin.log"); - m_other_log_list.append(QStringList()<<"audit.log"<<"/var/log/audit/audit.log"); - m_other_log_list.append(QStringList()<<"udcp-client"<<"/var/log/udcp-client"); + QList m_other_log_list_temp; + m_other_log_list_temp.append(QStringList() << "alternatives.log" << "/var/log/alternatives.log"); + m_other_log_list_temp.append(QStringList() << "history.log" << "/var/log/apt/history.log"); + m_other_log_list_temp.append(QStringList() << "term.log" << "/var/log/apt/term.log"); + m_other_log_list_temp.append(QStringList() << "auth.log" << "/var/log/auth.log"); + + m_other_log_list_temp.append(QStringList() << "access_log" << "/var/log/cups/access_log"); + m_other_log_list_temp.append(QStringList() << "error_log" << "/var/log/cups/error_log"); + m_other_log_list_temp.append(QStringList() << "daemon.log" << "/var/log/daemon.log"); + + m_other_log_list_temp.append(QStringList() << "debug" << "/var/log/debug"); + m_other_log_list_temp.append(QStringList() << "dde-dconfig-daemon" << "/var/log/deepin/dde-dconfig-daemon"); + m_other_log_list_temp.append(QStringList() << "dde-file-manager-daemon" << "/var/log/deepin/dde-file-manager-daemon"); + m_other_log_list_temp.append(QStringList() << "deepin-boot-maker-service.log" << "/var/log/deepin/deepin-boot-maker-service.log"); + + m_other_log_list_temp.append(QStringList() << "deepin-diskmanager-service" << "/var/log/deepin/deepin-diskmanager-service/Log"); + m_other_log_list_temp.append(QStringList() << "deepin-home-appstore-daemon" << "/var/log/deepin/deepin-home-appstore-daemon"); + m_other_log_list_temp.append(QStringList() << "deepin-log-viewer-service" << "/var/log/deepin/deepin-log-viewer-service/Log"); + m_other_log_list_temp.append(QStringList() << "deepin-sync-helper_ERROR.log" << "/var/log/deepin-deepinid-daemon/deepin-sync-helper_ERROR.log"); + + m_other_log_list_temp.append(QStringList() << "deepin-sync-helper.log" << "/var/log/deepin-deepinid-daemon/deepin-sync-helper.log"); + m_other_log_list_temp.append(QStringList() << "deepin-defender-system-daemon.log" << "/var/log/deepin-defender-system-daemon.log"); + m_other_log_list_temp.append(QStringList() << "deepin-face.log" << "/var/log/deepin-face.log"); + m_other_log_list_temp.append(QStringList() << "deepin-installer-first-boot.log" << "/var/log/deepin-installer-first-boot.log"); + + m_other_log_list_temp.append(QStringList() << "deepin-installer-init.log" << "/var/log/deepin-installer-init.log"); + m_other_log_list_temp.append(QStringList() << "deepin-installer.log" << "/var/log/deepin-installer.log"); + m_other_log_list_temp.append(QStringList() << "deepin-monitornetflow.log" << "/var/log/deepin-monitornetflow.log"); + m_other_log_list_temp.append(QStringList() << "faillog" << "/var/log/faillog"); + m_other_log_list_temp.append(QStringList() << "fontconfig.log" << "/var/log/fontconfig.log"); + + m_other_log_list_temp.append(QStringList() << "lastlog" << "/var/log/lastlog"); + m_other_log_list_temp.append(QStringList() << "lightdm.log" << "/var/log/lightdm/lightdm.log"); + m_other_log_list_temp.append(QStringList() << "seat0-greeter.log" << "/var/log/lightdm/seat0-greeter.log"); + m_other_log_list_temp.append(QStringList() << "x-0.log" << "/var/log/lightdm/x-0.log"); + + m_other_log_list_temp.append(QStringList() << "x-1.log" << "/var/log/lightdm/x-1.log"); + m_other_log_list_temp.append(QStringList() << "messages" << "/var/log/messages"); + m_other_log_list_temp.append(QStringList() << "udcpg.log" << "/var/log/udcpg/udcpg.log"); + m_other_log_list_temp.append(QStringList() << "uos-applicense-agent.log" << "/var/log/uos/uos-applicense-agent/uos-applicense-agent.log"); + + m_other_log_list_temp.append(QStringList() << "uos-deviceh-cmd.log" << "/var/log/uos/uos-license-agent/uos-deviceh-cmd.log"); + m_other_log_list_temp.append(QStringList() << "uos-license-agent" << "/var/log/uos/uos-license-agent"); + m_other_log_list_temp.append(QStringList() << "uos-license-upgrade" << "/var/log/uos/uos-license-upgrade"); + m_other_log_list_temp.append(QStringList() << "user.log" << "/var/log/user.log"); + m_other_log_list_temp.append(QStringList() << "vnetlib" << "/var/log/vnetlib"); + + m_other_log_list_temp.append(QStringList() << "wtmp" << "/var/log/wtmp"); + m_other_log_list_temp.append(QStringList() << "dcp_log" << "/var/log/cups/dcp_log"); + m_other_log_list_temp.append(QStringList() << "deepin-graphics-driver-manager-server.log" << "/var/log/deepin-graphics-driver-manager-server.log"); + m_other_log_list_temp.append(QStringList() << "uos-activator-kms.log" << "/var/log/uos/uos-activator-kms/uos-activator-kms.log"); + + m_other_log_list_temp.append(QStringList() << "deepin-recovery-gui.log" << "/recovery/deepin-recovery-gui.log"); + m_other_log_list_temp.append(QStringList() << "oem-custom-tool" << "/var/local/oem-custom-tool"); + m_other_log_list_temp.append(QStringList() << "iso-customizer-agent.log" << "/root/.cache/isocustomizer-agent/iso-customizer-agent/iso-customizer-agent.log"); + m_other_log_list_temp.append(QStringList() << "downloader" << "~/.config/uos/downloader/Log"); + + m_other_log_list_temp.append(QStringList() << ".kwin.log" << "~/.kwin.log"); + m_other_log_list_temp.append(QStringList() << "audit.log" << "/var/log/audit/audit.log"); + m_other_log_list_temp.append(QStringList() << "udcp-client" << "/var/log/udcp-client"); + + //窗管日志和配置文件监视 + m_other_log_list_temp.append(QStringList() << ".kwin_x11.log" << "~/.kwin_x11.log"); + m_other_log_list_temp.append(QStringList() << "kwinrc" << "~/.config/kwinrc"); + m_other_log_list_temp.append(QStringList() << "kglobalshortcutsrc" << "~/.config/kglobalshortcutsrc"); + m_other_log_list_temp.append(QStringList() << "kwinrulesrc" << "~/.config/kwinrulesrc"); + + + for (QStringList iter : m_other_log_list_temp) { + QString path = iter.at(1); + if (path.startsWith("~/")) + path.replace(0, 1, Utils::homePath); + m_other_log_list.append(QStringList() << iter.at(0) << path); + } } //初始化自定义日志列表 @@ -129,17 +162,17 @@ void LogApplicationHelper::initCustomLog() #ifdef DTKCORE_CLASS_DConfigFile //初始化DConfig配置 if (!m_pDConfig) { - m_pDConfig = Dtk::Core::DConfig::create("org.deepin.deepin-log-viewer", "org.deepin.deepin-log-viewer", "", this); + m_pDConfig = Dtk::Core::DConfig::create(DCONFIG_APPID, DCONFIG_APPID, "", this); // 判断配置是否有效 if (!m_pDConfig->isValid()) { - qWarning() << QString("DConfig is invalide, name:[%1], subpath[%2].").arg(m_pDConfig->name(), m_pDConfig->subpath()); + qCWarning(logAppHelper) << QString("DConfig is invalide, name:[%1], subpath[%2].").arg(m_pDConfig->name(), m_pDConfig->subpath()); m_pDConfig->deleteLater(); m_pDConfig = nullptr; return; } - connect(m_pDConfig, &Dtk::Core::DConfig::valueChanged, this, [this](const QString &key){ + connect(m_pDConfig, &Dtk::Core::DConfig::valueChanged, this, [this](const QString & key) { initCustomLog(); emit this->sigValueChanged(key); }); @@ -148,28 +181,51 @@ void LogApplicationHelper::initCustomLog() //读取DConfig配置 QStringList sList = m_pDConfig->value("customLogFiles").toStringList(); for (QString iter : sList) { - m_custom_log_list.append(QStringList()<keyList().contains("specialComType")) + Utils::specialComType = m_pDConfig->value("specialComType").toInt(); #endif //初始化gsetting配置 if (!m_pGSettings) { - if (QGSettings::isSchemaInstalled("com.deepin.log-viewer")) { - m_pGSettings = new QGSettings("com.deepin.log-viewer", "/com/deepin/log-viewer/"); - - //监听key的value是否发生了变化 - connect(m_pGSettings, &QGSettings::changed, this, [=] (const QString &key) { - initCustomLog(); - emit this->sigValueChanged(key); - }); + if (QGSettings::isSchemaInstalled(GSETTING_APPID.toUtf8())) { + m_pGSettings = new QGSettings(GSETTING_APPID.toUtf8(), "/com/deepin/log/viewer/"); + + //监听key的value是否发生了变化 + connect(m_pGSettings, &QGSettings::changed, this, [ = ](const QString & key) { + initCustomLog(); + emit this->sigValueChanged(key); + }); + + //读取gsetting配置 + QStringList sList2 = m_pGSettings->get("customlogfiles").toStringList(); + for (QString iter : sList2) { + QString path = iter; + if (path.startsWith("~/")) + path.replace(0, 1, Utils::homePath); + //忽略非文本文件和不存在的文件 + if (!QFile::exists(path) || !Utils::isTextFileType(path)) { + continue; + } + m_custom_log_list.append(QStringList() << QFileInfo(iter).fileName() << path); + } + } else { + qCWarning(logAppHelper) << "cannot find gsettings config file"; } } - - //读取gsetting配置 - QStringList sList2 = m_pGSettings->get("customlogfiles").toStringList(); - for (QString iter : sList2) { - m_custom_log_list.append(QStringList()<::const_iterator iter = m_en_log_map.constBegin(); + while (iter != m_en_log_map.constEnd()) { + QString displayName = m_en_trans_map.value(iter.key()); + QString logPath = getLogFile(iter.value()); + + // 针对journal日志,使用logPath存储项目名称,便于后续解析流程处理 + if (iter.key() == iter.value()) + logPath = iter.key(); + + //排除其他日志 + bool bFind = false; + for (QStringList iterOther : getOtherLogList()) { + if (iterOther.at(1) == logPath) { + bFind = true; + break; + } + } + + if (!bFind) { + m_trans_log_map.insert(displayName, logPath); + } + ++iter; + } +} + /** * @brief LogApplicationHelper::parseField 从desktop文件中提取正确的显示文本 * @param path desktop文件路径 @@ -320,7 +393,7 @@ void LogApplicationHelper::createLogFiles() * @param isGeneric 是否有GenericName字段 * @param isName 是否有Name字段 */ -void LogApplicationHelper::parseField(QString path, QString name, bool isDeepin, bool isGeneric, +void LogApplicationHelper::generateTransName(const QString &path, const QString &name, bool isDeepin, bool isGeneric, bool isName) { Q_UNUSED(isName) @@ -378,7 +451,7 @@ void LogApplicationHelper::parseField(QString path, QString name, bool isDeepin, * @param path 通过日志文件目录 * @return 日志文件路经 */ -QString LogApplicationHelper::getLogFile(QString path) +QString LogApplicationHelper::getLogFile(const QString &path) { QString ret; QDir subdir(path); @@ -397,31 +470,234 @@ QString LogApplicationHelper::getLogFile(QString path) return ret; } +void LogApplicationHelper::loadAppLogConfigsByJson() +{ + m_JsonAppLogConfigs.clear(); + + QDir dir(APP_LOG_CONFIG_PATH); + if (!dir.exists()) { + qCWarning(logAppHelper) << QString("%1 does not exist.").arg(APP_LOG_CONFIG_PATH); + return; + } + + dir.setFilter(QDir::Files); + dir.setNameFilters(QStringList() << "*.json"); + QFileInfoList fiList = dir.entryInfoList(); + foreach (QFileInfo fi, fiList) { + QFile file(fi.absoluteFilePath()); + if (!file.open(QIODevice::ReadOnly)) + continue; + + QByteArray data = file.readAll(); + file.close(); + + QJsonParseError parseError; + QJsonDocument document = QJsonDocument::fromJson(data, &parseError); + if (parseError.error == QJsonParseError::NoError) { + if (document.isObject()) { + QJsonObject object = document.object(); + + AppLogConfig logConfig; + logConfig.name = object.value("name").toString(); + logConfig.transName = m_en_trans_map.value(logConfig.name); + logConfig.group = object.value("group").toString(); + logConfig.version = object.value("version").toString(); + // 支持解析任意格式的visible字段值 + if (object.contains("visible")) { + QJsonValue value = object.value("visible"); + if (value.isString()) { + if (value == "true") + logConfig.visible = true; + else if (value == "false") + logConfig.visible = false; + else + logConfig.visible = object.value("visible").toString().toInt(); + } + else if (value.isBool()) + logConfig.visible = object.value("visible").toBool(); + else + logConfig.visible = object.value("visible").toInt(); + } + + // json配置文件兼容性保障 + // 解析初版json,将json中关键字段值放到新版应用配置submodule结构体中 + if (object.contains("logType") || object.contains("logPath") || object.contains("exec")) { + SubModuleConfig submodule; + submodule.name = logConfig.name; + submodule.filter = ""; + submodule.execPath = object.value("exec").toString(); + submodule.logType = object.value("logType").toString(); + submodule.logPath = object.value("logPath").toString(); + if (submodule.logType == "file") { + // 对应用日志的logPath做有效性判断,若无效,则填入默认日志路径~/.cache/deepin + validityJsonLogPath(submodule); + } + logConfig.subModules.append(submodule); + } + + // 解析新版json中的submodule字段 + if (object.contains("submodules")) { + if (object.value("submodules").isArray()) { + QJsonArray arr = object.value("submodules").toArray(); + logConfig.subModules.clear(); + for (int i = 0; i < arr.size(); ++i) { + QJsonObject obj = arr[i].toObject(); + SubModuleConfig submodule; + if (obj.contains("name") && obj.value("name").isString()) + submodule.name = obj.value("name").toString(); + if (obj.contains("filter") && obj.value("filter").isString()) + submodule.filter = obj.value("filter").toString(); + if (obj.contains("exec") && obj.value("exec").isString()) + submodule.execPath = obj.value("exec").toString(); + if (obj.contains("logType") && obj.value("logType").isString()) + submodule.logType = obj.value("logType").toString(); + if (obj.contains("logPath") && obj.value("logPath").isString()) + submodule.logPath = obj.value("logPath").toString(); + + if (submodule.logType == "file") { + // 对应用日志的logPath做有效性判断,若无效,则填入默认日志路径~/.cache/deepin + validityJsonLogPath(submodule); + } + logConfig.subModules.append(submodule); + } + } + } + + m_JsonAppLogConfigs.push_back(logConfig); + } + } + } +} + +AppLogConfig LogApplicationHelper::jsonAppLogConfig(const QString &app) +{ + if (app.isEmpty()) + return AppLogConfig(); + + if (m_JsonAppLogConfigs.isEmpty()) { + loadAppLogConfigsByJson(); + } + + foreach (AppLogConfig config, m_JsonAppLogConfigs) { + if (config.contains(app)) { + return config; + } + } + + return AppLogConfig(); +} + +bool LogApplicationHelper::isJsonAppLogConfigExist(const QString &app) +{ + foreach (AppLogConfig config, m_JsonAppLogConfigs) { + if (config.contains(app)) { + return true; + } + } + + return false; +} + +// 对应用日志的logPath做有效性判断 +void LogApplicationHelper::validityJsonLogPath(SubModuleConfig &submodule) +{ + if (submodule.logType != "file") + return; + + QString homePath = Utils::homePath; + QString path = homePath + "/.cache/deepin/"; + QStringList defaultLogFolders; + QDir logDir(path); + if (logDir.exists()) { + defaultLogFolders = logDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); + } + + QString defaultLogPath; + if (defaultLogFolders.contains(submodule.name)) { + defaultLogPath = getLogFile(path + submodule.name); + } + + // 若logPath无效,则填入默认日志路径~/.cache/deepin + if (!submodule.logPath.isEmpty()) { + // 转为绝对路径 + if (submodule.logPath.front() == '~') + submodule.logPath.replace(0, 1, homePath); + + QFileInfo fi(submodule.logPath); + if (!fi.exists()) { + if (!defaultLogPath.isEmpty()) + submodule.logPath = defaultLogPath; + } + } else if(submodule.logPath.isEmpty()) { + submodule.logPath = defaultLogPath; + } +} + //刷新并返回所有显示文本对应的应用日志路径 QMap LogApplicationHelper::getMap() { initAppLog(); - QMap::const_iterator iter = m_en_log_map.constBegin(); - while (iter != m_en_log_map.constEnd()) { - QString displayName = m_en_trans_map.value(iter.key()); - QString logPath = getLogFile(iter.value()); + return m_trans_log_map; +} - //排除其他日志 - bool bFind = false; - for (QStringList iterOther : getOtherLogList()) { - if (iterOther.at(1) == logPath) { - bFind = true; +// 刷新并返回最新的应用配置信息 +AppLogConfigList LogApplicationHelper::getAppLogConfigs() +{ + initAppLog(); + + m_appLogConfigs.clear(); + + // 根据m_trans_log_map的顺序转换未做json配置的应用信息到appConfig中 + QMap::const_iterator iter = m_trans_log_map.constBegin(); + while (iter != m_trans_log_map.constEnd()) { + QString transName = iter.key(); + if (transName.isEmpty()) { + ++iter; + continue; + } + + // 根据翻译名称获取应用项目名称 + QString appName = ""; + QMap::const_iterator iterApp = m_en_trans_map.constBegin(); + while (iterApp != m_en_trans_map.constEnd()) { + if (iterApp.value() == transName) { + appName = iterApp.key(); break; } + ++iterApp; } - if (!bFind) { - m_trans_log_map.insert(displayName, logPath); + if (isJsonAppLogConfigExist(appName)) { + // 若该应用已被json配置过,则直接将json配置添加应用配置列表中 + m_appLogConfigs.push_back(jsonAppLogConfig(appName)); + } else { + // 该应用未被json配置过,则转为json方式存储到应用配置列表中 + AppLogConfig appConfig; + appConfig.name = appName; + appConfig.transName = transName; + appConfig.visible = true; + + SubModuleConfig subModule; + subModule.name = appName; + subModule.logType = "file"; + subModule.logPath = getLogFile(m_en_log_map[appName]); + + appConfig.subModules.append(subModule); + + m_appLogConfigs.push_back(appConfig); } + ++iter; } - return m_trans_log_map; + + // 将新增的json配置应用更新到应用配置列表中 + for (auto appConfig : m_JsonAppLogConfigs) { + if (!isAppLogConfigExist(appConfig.name)) + m_appLogConfigs.push_back(appConfig); + } + + return m_appLogConfigs; } //获取所有其他日志文件列表 @@ -436,6 +712,90 @@ QList LogApplicationHelper::getCustomLogList() return m_custom_log_list; } +AppLogConfig LogApplicationHelper::appLogConfig(const QString &app) +{ + if (app.isEmpty()) + return AppLogConfig(); + + if (m_appLogConfigs.isEmpty()) { + getAppLogConfigs(); + } + + foreach (AppLogConfig config, m_appLogConfigs) { + if (config.contains(app)) { + return config; + } + } + + return AppLogConfig(); +} + +bool LogApplicationHelper::isAppLogConfigExist(const QString &app) +{ + foreach (AppLogConfig config, m_appLogConfigs) { + if (config.contains(app)) { + return true; + } + } + + return false; +} + +bool LogApplicationHelper::isValidAppName(const QString &appName) +{ + if (m_en_log_map.find(appName) != m_en_log_map.end()) + return true; + + return false; +} + +QDateTime LogApplicationHelper::getLastReportTime() +{ + QVariant time; + +#ifdef DTKCORE_CLASS_DConfigFile + time = m_pDConfig->value(COREDUMP_REPORT_TIME); +#else + if (m_pGSettings) { + time = m_pGSettings->get(COREDUMP_REPORT_TIME_GSETTING); + } +#endif + + if (time.isValid()) { + return QDateTime::fromString(time.toString(), "yyyy-MM-dd hh:mm:ss"); + } + + return QDateTime(); +} + +void LogApplicationHelper::saveLastRerportTime(const QDateTime &date) +{ + QString str = date.toString("yyyy-MM-dd hh:mm:ss"); + +#ifdef DTKCORE_CLASS_DConfigFile + m_pDConfig->setValue(COREDUMP_REPORT_TIME, str); +#else + if (m_pGSettings) + m_pGSettings->set(COREDUMP_REPORT_TIME_GSETTING, str); +#endif +} + +int LogApplicationHelper::getMaxReportCoredump() +{ + QVariant value(MAX_COREDUMP_REPORT); + +#ifdef DTKCORE_CLASS_DConfigFile + value = m_pDConfig->value(COREDUMP_REPORT_MAX); +#else + if (m_pGSettings) { + value = m_pGSettings->get(COREDUMP_REPORT_MAX_GSETTING); + } +#endif + + qCWarning(logAppHelper) << "coredump report max:" << value.toInt(); + return value.toInt(); +} + //从应用包名转换为应用显示文本 QString LogApplicationHelper::transName(const QString &str) { @@ -446,4 +806,3 @@ QString LogApplicationHelper::getPathByAppId(const QString &str) { return m_en_log_map.value(str); } - diff --git a/application/logapplicationhelper.h b/application/logapplicationhelper.h index 437226cb..b80365a5 100644 --- a/application/logapplicationhelper.h +++ b/application/logapplicationhelper.h @@ -5,8 +5,7 @@ #ifndef LOGAPPLICATIONHELPER_H #define LOGAPPLICATIONHELPER_H -#include "com_deepin_dde_daemon_launcherd.h" - +#include "structdef.h" #include "dtkcore_config.h" #ifdef DTKCORE_CLASS_DConfigFile #include @@ -17,7 +16,7 @@ #include #include -using DBbusLauncher = com::deepin::dde::daemon::Launcher; + /** * @brief The LogApplicationHelper class 获取应用日志文件路径信息工具类 */ @@ -45,6 +44,8 @@ class LogApplicationHelper : public QObject } QMap getMap(); + // 刷新并返回最新的应用配置信息 + AppLogConfigList getAppLogConfigs(); //根据包名获得显示名称 QString transName(const QString &str); @@ -58,6 +59,17 @@ class LogApplicationHelper : public QObject //获取所有自定义日志文件列表(名称-路径) QList getCustomLogList(); + AppLogConfig appLogConfig(const QString& app); + bool isAppLogConfigExist(const QString& app); + + // 验证是否为有效的应用名 + bool isValidAppName(const QString& appName); + + QDateTime getLastReportTime(); + void saveLastRerportTime(const QDateTime& date); + // 获取崩溃上报最大条数,默认为50 + int getMaxReportCoredump(); + private: explicit LogApplicationHelper(QObject *parent = nullptr); @@ -68,10 +80,18 @@ class LogApplicationHelper : public QObject void createDesktopFiles(); void createLogFiles(); + void createTransLogFiles(); + + void generateTransName(const QString &path, const QString &name, bool isDeepin, bool isGeneric, bool isName); + + QString getLogFile(const QString &path); + + void loadAppLogConfigsByJson(); - void parseField(QString path, QString name, bool isDeepin, bool isGeneric, bool isName); + AppLogConfig jsonAppLogConfig(const QString& app); + bool isJsonAppLogConfigExist(const QString& app); - QString getLogFile(QString path); + void validityJsonLogPath(SubModuleConfig& submodule); signals: void sigValueChanged(const QString &key); @@ -111,6 +131,15 @@ public slots: * @brief m_current_system_language 系统语言 */ QString m_current_system_language; + + /** + * @brief m_appLogConfigs 应用日志json配置信息 + */ + AppLogConfigList m_JsonAppLogConfigs; + /** + * @brief m_appLogConfigs 应用日志配置信息(包含json配置信息) + */ + AppLogConfigList m_appLogConfigs; /** * @brief m_instance 单例用的本类指针的原子性封装 */ @@ -119,17 +148,13 @@ public slots: * @brief m_mutex 单例用的锁 */ static std::mutex m_mutex; - /** - * @brief m_DbusLauncher 获取所有应用信息的dbus接口 - */ - DBbusLauncher *m_DbusLauncher; #ifdef DTKCORE_CLASS_DConfigFile //dconfig,自定义日志配置 - Dtk::Core::DConfig * m_pDConfig = nullptr; + Dtk::Core::DConfig *m_pDConfig = nullptr; #endif //gsettings,自定义日志配置 - QGSettings * m_pGSettings = nullptr; + QGSettings *m_pGSettings = nullptr; }; #endif // LOGAPPLICATIONHELPER_H diff --git a/application/logapplicationparsethread.cpp b/application/logapplicationparsethread.cpp index 1ce24e00..20cc0299 100644 --- a/application/logapplicationparsethread.cpp +++ b/application/logapplicationparsethread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,11 +7,22 @@ #include "dbusproxy/dldbushandler.h" #include +#include + +#include #include #include #include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logApp, "org.deepin.log.viewer.parse.app.work") +#else +Q_LOGGING_CATEGORY(logApp, "org.deepin.log.viewer.parse.app.work", QtInfoMsg) +#endif + DWIDGET_USE_NAMESPACE //std::atomic LogApplicationParseThread::m_instance; @@ -27,6 +38,8 @@ LogApplicationParseThread::LogApplicationParseThread(QObject *parent) qRegisterMetaType >("QList"); initMap(); + //初始化等级数字对应显示文本的map + initJournalMap(); //静态计数变量加一并赋值给本对象的成员变量,以供外部判断是否为最新线程发出的数据信号 thread_count++; m_threadCount = thread_count; @@ -37,6 +50,10 @@ LogApplicationParseThread::LogApplicationParseThread(QObject *parent) */ LogApplicationParseThread::~LogApplicationParseThread() { + m_appList.clear(); + m_levelDict.clear(); + m_journalMap.clear(); + if (m_process) { m_process->kill(); m_process->close(); @@ -45,13 +62,9 @@ LogApplicationParseThread::~LogApplicationParseThread() } } -/** - * @brief LogApplicationParseThread::setParam 设置获取的筛选条件 - * @param iFilter 筛选条件结构体 - */ -void LogApplicationParseThread::setParam(APP_FILTERS &iFilter) +void LogApplicationParseThread::setFilters(const APP_FILTERSList &iFilters) { - m_AppFiler = iFilter; + m_AppFilers = iFilters; } /** @@ -59,6 +72,7 @@ void LogApplicationParseThread::setParam(APP_FILTERS &iFilter) */ void LogApplicationParseThread::stopProccess() { + qCDebug(logApp) << "stopWork"; m_canRun = false; if (m_process && m_process->isOpen()) { m_process->kill(); @@ -77,7 +91,33 @@ void LogApplicationParseThread::doWork() { //此线程刚开始把可以继续变量置true,不然下面没法跑 m_canRun = true; + mutex.lock(); m_appList.clear(); + mutex.unlock(); + + // 遍历每个子模块对应的日志过滤配置项 + for (auto appFilter : m_AppFilers) { + if (appFilter.logType == "file") { + if (!parseByFile(appFilter)) + return; + } else if (appFilter.logType == "journal") { + if (!parseByJournal(appFilter)) + return; + } + } + + //最后可能有余下不足500的数据 + if (m_appList.count() >= 0) { + emit appData(m_threadCount, m_appList); + } + + emit appFinished(m_threadCount); +} + +bool LogApplicationParseThread::parseByFile(const APP_FILTERS &app_filter) +{ + m_AppFiler = app_filter; + initProccess(); //connect(m_process, SIGNAL(finished(int)), m_process, SLOT(deleteLater())); //因为筛选信息中含有日志文件路径,所以不能为空,否则无法获取 @@ -87,7 +127,8 @@ void LogApplicationParseThread::doWork() QStringList filePath = DLDBusHandler::instance(this)->getFileInfo(m_AppFiler.path); for (int i = 0; i < filePath.count(); i++) { if (!m_canRun) { - return; + mutex.unlock(); + return false; } //按行解析 QByteArray outByte = DLDBusHandler::instance(this)->readLog(filePath[i]).toUtf8(); @@ -98,15 +139,15 @@ void LogApplicationParseThread::doWork() for (int j = strList.size() - 1; j >= 0; --j) { if (!m_canRun) { - return; + mutex.unlock(); + return false; } LOG_MSG_APPLICATOIN msg; - QString str =strList[j]; + QString str = strList[j]; QRegularExpressionMatch match = re.match(str); bool matchRes = match.hasMatch(); if(!matchRes){ - qWarning()<<"not match ,Format problem"; continue; } @@ -118,6 +159,7 @@ void LogApplicationParseThread::doWork() continue; } + msg.subModule = m_AppFiler.submodule; msg.dateTime = dateTime; msg.level = match.captured(3); //筛选日志等级 @@ -133,76 +175,221 @@ void LogApplicationParseThread::doWork() if (msg.detailInfo.size() > 500) { msg.msg = msg.detailInfo.mid(0, 500); } + mutex.lock(); m_appList.append(msg); + mutex.unlock(); //每获得500个数据就发出信号给控件加载 if (m_appList.count() % SINGLE_READ_CNT == 0) { + mutex.lock(); emit appData(m_threadCount, m_appList); m_appList.clear(); + mutex.unlock(); } } if (!m_canRun) { - return; + mutex.unlock(); + return false; } } - //最后可能有余下不足500的数据 - if (m_appList.count() >= 0) { - emit appData(m_threadCount, m_appList); - } - - emit appFinished(m_threadCount); } - + return true; } -void LogApplicationParseThread::onProcFinished(int ret) +bool LogApplicationParseThread::parseByJournal(const APP_FILTERS &app_filter) { - Q_UNUSED(ret) -#if 0 - QProcess *proc = dynamic_cast(sender()); - QString output = proc->readAllStandardOutput(); - proc->deleteLater(); + m_AppFiler = app_filter; + + if ((!m_canRun)) { + mutex.unlock(); + return false; + } + + int r; + + sd_journal *j ; + if ((!m_canRun)) { + mutex.unlock(); + return false; + } + //打开日志文件 + r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); + if ((!m_canRun)) { + mutex.unlock(); + sd_journal_close(j); + return false; + } + //r为系统借口返回值,小于0则表示失败,直接返回 + if (r < 0) { + fprintf(stderr, "Failed to open journal: %s\n", strerror(-r)); + return false; + } + //从尾部开始读,这样出来数据是倒叙,符合需求 + sd_journal_seek_tail(j); + if ((!m_canRun)) { + mutex.unlock(); + sd_journal_close(j); + return false; + } + + // 增加日志等级筛选 + if (m_AppFiler.lvlFilter != LVALL) { + QString prio = QString("PRIORITY=%1").arg(m_AppFiler.lvlFilter); + sd_journal_add_match(j, prio.toStdString().c_str(), 0); + } + + // 查看是否开启通配符匹配 + bool bWildcardMatch = m_AppFiler.filter.endsWith("*"); + QString wildcard_CodeCategory = ""; + if (bWildcardMatch) + wildcard_CodeCategory = m_AppFiler.filter.split("*").first(); + + // 通配符匹配规则为空,不开启通配符匹配 + if (wildcard_CodeCategory.isEmpty()) + bWildcardMatch = false; + + bool bCanMatch = false; + // 增加日志exec筛选 + if (!m_AppFiler.execPath.isEmpty()) { + sd_journal_add_match(j, QString("_EXE=%1").arg(m_AppFiler.execPath).toStdString().c_str(), 0); + bCanMatch = true; + } + + // 增加code_category筛选,filter字段内容必须为完整的code_category种类名称 + if (!m_AppFiler.filter.isEmpty() && m_AppFiler.filter != "*" && !bWildcardMatch) { + sd_journal_add_match(j, QString("CODE_CATEGORY=%1").arg(m_AppFiler.filter).toStdString().c_str(), 0); + bCanMatch = true; + } + + // exec和filter都未配置,只能按进程名称进行筛选 + if (!bCanMatch && !m_AppFiler.app.isEmpty()) { + sd_journal_add_match(j, QString("SYSLOG_IDENTIFIER=%1").arg(m_AppFiler.app).toStdString().c_str(), 0); + bCanMatch = true; + } - for (QString str : output.split('\n')) { - LOG_MSG_APPLICATOIN msg; + if ((!m_canRun)) { + mutex.unlock(); + sd_journal_close(j); + return false; + } - str.replace(QRegExp("\\s{2,}"), ""); + // journal不具备匹配条件,放弃journal应用日志解析 + if (!bCanMatch) + return true; - QStringList list = str.split("]", QString::SkipEmptyParts); - if (list.count() < 3) - continue; + uint64_t beginTime = 0; + uint64_t endTime = 0; + if (m_AppFiler.timeFilterBegin != -1) { + beginTime = static_cast(m_AppFiler.timeFilterBegin * 1000); + endTime = static_cast(m_AppFiler.timeFilterEnd * 1000); + } - QString dateTime = list[0].split("[", QString::SkipEmptyParts)[0].trimmed(); - if (dateTime.contains(",")) { - dateTime.replace(",", ""); + int cnt = 0; + //调用宏开始迭代 + SD_JOURNAL_FOREACH_BACKWARDS(j) { + if ((!m_canRun)) { + mutex.unlock(); + sd_journal_close(j); + return false; } - // if (dateTime.split(".").count() == 2) { - // dateTime = dateTime.split(".")[0]; - // } - qint64 dt = QDateTime::fromString(dateTime, "yyyy-MM-dd hh:mm:ss.zzz").toMSecsSinceEpoch(); - if (dt < m_periorTime) - continue; - msg.dateTime = dateTime; - msg.level = list[0].split("[", QString::SkipEmptyParts)[1]; - - if (m_level != LVALL) { - if (m_levelDict.value(msg.level) != m_level) + const char *d; + size_t l; + + LOG_MSG_APPLICATOIN logMsg; + //获取时间 + r = sd_journal_get_data(j, "_SOURCE_REALTIME_TIMESTAMP", reinterpret_cast(&d), &l); + if (r < 0) { + r = sd_journal_get_data(j, "__REALTIME_TIMESTAMP", reinterpret_cast(&d), &l); + if (r < 0) { continue; + } } - msg.src = list[1].split("[", QString::SkipEmptyParts)[1]; + logMsg.subModule = m_AppFiler.submodule; + + uint64_t t; + sd_journal_get_realtime_usec(j, &t); + //解锁返回字符串长度上限,默认是64k,写0为无限 + // sd_journal_set_data_threshold(j, 0); + QString dt = Utils::getReplaceColorStr(d).split("=").value(1); + if (m_AppFiler.timeFilterBegin != -1) { + if (t < beginTime || t > endTime) + continue; + } + logMsg.dateTime = getDateTimeFromStamp(dt); + + // 根据filter进行通配符匹配查找 + if (bWildcardMatch) { + r = sd_journal_get_data(j, "CODE_CATEGORY", reinterpret_cast(&d), &l); + QString code_category; + if (r >= 0) { + QStringList strList = Utils::getReplaceColorStr(d).split("="); + strList.removeFirst(); + code_category = strList.join("="); + if (!code_category.startsWith(wildcard_CodeCategory)) + continue; + } + } - if (list.count() >= 4) { - msg.msg = list.mid(2).join("]"); + //获取信息体 + r = sd_journal_get_data(j, "MESSAGE", reinterpret_cast(&d), &l); + if (r < 0) { + logMsg.msg = ""; } else { - msg.msg = list[2]; + //出来的数据格式为 字段名= 信息体,但是因为信息体中也可能有=号,所以要把第一个去掉,后面的用=号拼起来 + QStringList strList = Utils::getReplaceColorStr(d).split("="); + strList.removeFirst(); + logMsg.msg = strList.join("="); + } + logMsg.detailInfo = logMsg.msg; + + //如果日志太长就显示一部分 + if (logMsg.detailInfo.size() > 500) { + logMsg.msg = logMsg.detailInfo.mid(0, 500); } - m_appList.insert(0, msg); + //获取等级 + r = sd_journal_get_data(j, "PRIORITY", reinterpret_cast(&d), &l); + if (r < 0) { + //有些时候的确会产生没有等级的日志,按照需求此时一律按调试处理,和journalctl 的筛选行为一致 + logMsg.level = i2str(7); + } else { + //获取等级为字段名= 数字 ,数字为0-7 ,对应紧急到调试,需要转换 + logMsg.level = i2str(Utils::getReplaceColorStr(d).split("=").value(1).toInt()); + } + cnt++; + mutex.lock(); + m_appList.append(logMsg); + mutex.unlock(); + + //每获得500个数据就发出信号给控件加载 + if (cnt % SINGLE_READ_CNT == 0) { + mutex.lock(); + emit appData(m_threadCount, m_appList); + m_appList.clear(); + //sleep(100); + mutex.unlock(); + } } - emit appCmdFinished(m_appList); -#endif + //第一次加载时这个之后的代码都不执行?故放到最后 + sd_journal_close(j); + + return true; +} + +void LogApplicationParseThread::onProcFinished(int ret) +{ + Q_UNUSED(ret) +} + +QString LogApplicationParseThread::getDateTimeFromStamp(const QString &str) +{ + QString ret = ""; + QString dtstr = str.left(str.length() - 3); + QDateTime dt = QDateTime::fromMSecsSinceEpoch(dtstr.toLongLong()); + ret = dt.toString("yyyy-MM-dd hh:mm:ss.zzz"); // + QString(".%1").arg(ums); + return ret; } /** @@ -216,6 +403,32 @@ void LogApplicationParseThread::initMap() m_levelDict.insert("Error", ERR); } +/** + * @brief LogApplicationParseThread::initMap 初始化等级数字和等级显示文本的map + */ +void LogApplicationParseThread::initJournalMap() +{ + m_journalMap.clear(); + m_journalMap.insert(0, DApplication::translate("Level", "Emergency")); + m_journalMap.insert(1, DApplication::translate("Level", "Alert")); + m_journalMap.insert(2, DApplication::translate("Level", "Critical")); + m_journalMap.insert(3, DApplication::translate("Level", "Error")); + m_journalMap.insert(4, DApplication::translate("Level", "Warning")); + m_journalMap.insert(5, DApplication::translate("Level", "Notice")); + m_journalMap.insert(6, DApplication::translate("Level", "Info")); + m_journalMap.insert(7, DApplication::translate("Level", "Debug")); +} + +/** + * @brief journalAppWork::i2str 日志等级到等级显示文本的转换 + * @param prio 日志等级数字 + * @return 等级显示文 + */ +QString LogApplicationParseThread::i2str(int prio) +{ + return m_journalMap.value(prio); +} + /** * @brief LogApplicationParseThread::initProccess 构造 QProcess成员指针 */ @@ -231,6 +444,6 @@ void LogApplicationParseThread::initProccess() */ void LogApplicationParseThread::run() { - qDebug() << "LogApplicationParseThread::run()---threadrun"; + qCDebug(logApp) << "threadrun"; doWork(); } diff --git a/application/logapplicationparsethread.h b/application/logapplicationparsethread.h index c867e2d8..570f5e1f 100755 --- a/application/logapplicationparsethread.h +++ b/application/logapplicationparsethread.h @@ -9,7 +9,7 @@ #include #include #include - +#include #include class QProcess; @@ -22,7 +22,7 @@ class LogApplicationParseThread : public QThread public: explicit LogApplicationParseThread(QObject *parent = nullptr); ~LogApplicationParseThread() override; - void setParam(APP_FILTERS &iFilter); + void setFilters(const APP_FILTERSList &iFilters); static int thread_count; signals: /** @@ -36,8 +36,15 @@ public slots: void onProcFinished(int ret); void stopProccess(); int getIndex(); + +private: + bool parseByFile(const APP_FILTERS& app_filter); + bool parseByJournal(const APP_FILTERS& app_filter); protected: + QString getDateTimeFromStamp(const QString &str); void initMap(); + void initJournalMap(); + QString i2str(int prio); void initProccess(); void run() override; @@ -46,16 +53,22 @@ public slots: * @brief m_AppFiler 筛选条件结构体 */ APP_FILTERS m_AppFiler; + APP_FILTERSList m_AppFilers; //获取数据用的cat命令的process QProcess *m_process = nullptr; /** * @brief m_levelDict example:warning=>4 等级字符串到等级数字的键值对 */ QMap m_levelDict; + /** + * @brief m_journalMap journal等级数字对应字符串 + */ + QMap m_journalMap; /** * @brief m_appList 获取的数据结果 */ QList m_appList; + QMutex mutex; /** * @brief m_canRun 是否可以继续运行的标记量,用于停止运行线程 */ diff --git a/application/logauththread.cpp b/application/logauththread.cpp old mode 100644 new mode 100755 index 2247181e..eee57ec2 --- a/application/logauththread.cpp +++ b/application/logauththread.cpp @@ -8,6 +8,7 @@ #include "sys/utsname.h" #include "wtmpparse.h" #include "dbusproxy/dldbushandler.h" +#include "dbusmanager.h" #include #include @@ -18,12 +19,30 @@ #include #include #include +#include +#include +#include +#include +#include +using namespace std; + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logAuthWork, "org.deepin.log.viewer.auth.work") +#else +Q_LOGGING_CATEGORY(logAuthWork, "org.deepin.log.viewer.auth.work", QtInfoMsg) +#endif DGUI_USE_NAMESPACE -std::atomic LogAuthThread::m_instance; -std::mutex LogAuthThread::m_mutex; int LogAuthThread::thread_count = 0; +// 崩溃信号列表对应字符值 +const QStringList sigList = { "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", + "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP", + "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO", "SIGPWR", "SIGSYS"}; + +// DBUS传输文件大小阈值 100MB +#define DBUS_THRESHOLD_MAX 100 + /** * @brief LogAuthThread::LogAuthThread 构造函数 * @param parent 父对象 @@ -97,15 +116,17 @@ void LogAuthThread::stopProccess() m_isStopProccess = true; //停止获取线程执行,标记量置false m_canRun = false; - //共享内存数据结构,用于和获取进程共享内存,数据为是否可执行进程,用于控制数据获取进程停止,因为这里会出现需要提权执行的进程,主进程没有权限停止提权进程,所以使用共享内存变量标记量控制提权进程停止 - ShareMemoryInfo shareInfo ; - //设置进程为不可执行 - shareInfo.isStart = false; - //把数据付给共享内存中对应的变量 - SharedMemoryManager::instance()->setRunnableTag(shareInfo); + if (!Utils::runInCmd) { + //共享内存数据结构,用于和获取进程共享内存,数据为是否可执行进程,用于控制数据获取进程停止,因为这里会出现需要提权执行的进程,主进程没有权限停止提权进程,所以使用共享内存变量标记量控制提权进程停止 + ShareMemoryInfo shareInfo ; + //设置进程为不可执行 + shareInfo.isStart = false; + //把数据付给共享内存中对应的变量 + SharedMemoryManager::instance()->setRunnableTag(shareInfo); + } if (m_process) { m_process->kill(); - } + } } void LogAuthThread::setFilePath(const QStringList &filePath) @@ -129,7 +150,6 @@ QString LogAuthThread::startTime() startFile.close(); } - qDebug() << "startStr" << startFile; startStr = startStr.split(" ").value(0, ""); if (startStr.isEmpty()) { return ""; @@ -170,6 +190,12 @@ void LogAuthThread::run() case Dmesg: handleDmesg(); break; + case Audit: + handleAudit(); + break; + case COREDUMP: + handleCoredump(); + break; default: break; } @@ -195,26 +221,29 @@ void LogAuthThread::handleBoot() if (!m_canRun) { return; } - initProccess(); - m_process->setProcessChannelMode(QProcess::MergedChannels); - //共享内存对应变量置true,允许进程内部逻辑运行 - ShareMemoryInfo shareInfo; - shareInfo.isStart = true; - SharedMemoryManager::instance()->setRunnableTag(shareInfo); - //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 - m_process->start("pkexec", QStringList() << "logViewerAuth" - << m_FilePath.at(i) << SharedMemoryManager::instance()->getRunnableKey()); - m_process->waitForFinished(-1); - if (m_process->exitCode() != 0) { - emit bootFinished(m_threadCount); - return; + + if (!Utils::runInCmd) { + initProccess(); + m_process->setProcessChannelMode(QProcess::MergedChannels); + //共享内存对应变量置true,允许进程内部逻辑运行 + ShareMemoryInfo shareInfo; + shareInfo.isStart = true; + SharedMemoryManager::instance()->setRunnableTag(shareInfo); + //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 + m_process->start("pkexec", QStringList() << "logViewerAuth" + << m_FilePath.at(i) << SharedMemoryManager::instance()->getRunnableKey()); + m_process->waitForFinished(-1); + if (m_process->exitCode() != 0) { + emit bootFinished(m_threadCount); + return; + } } + QString byte = DLDBusHandler::instance(this)->readLog(m_FilePath.at(i)); byte.replace('\u0000', "").replace("\x01", ""); QStringList strList = byte.split('\n', QString::SkipEmptyParts); //按换行分割 - // qInfo()<= 0; --j) { QString lineStr = strList.at(j); if (lineStr.startsWith("/dev") || lineStr.isEmpty()) @@ -274,27 +303,31 @@ void LogAuthThread::handleKern() if (!m_canRun) { return; } - initProccess(); - if (!m_canRun) { - return; - } - m_process->setProcessChannelMode(QProcess::MergedChannels); - if (!m_canRun) { - return; - } - //共享内存对应变量置true,允许进程内部逻辑运行 - ShareMemoryInfo shareInfo; - shareInfo.isStart = true; - SharedMemoryManager::instance()->setRunnableTag(shareInfo); - //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 - m_process->start("pkexec", QStringList() << "logViewerAuth" - << m_FilePath.at(i) << SharedMemoryManager::instance()->getRunnableKey()); - m_process->waitForFinished(-1); - //有错则传出空数据 - if (m_process->exitCode() != 0) { - emit kernFinished(m_threadCount); - return; + + if (!Utils::runInCmd) { + initProccess(); + if (!m_canRun) { + return; + } + m_process->setProcessChannelMode(QProcess::MergedChannels); + if (!m_canRun) { + return; + } + //共享内存对应变量置true,允许进程内部逻辑运行 + ShareMemoryInfo shareInfo; + shareInfo.isStart = true; + SharedMemoryManager::instance()->setRunnableTag(shareInfo); + //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 + m_process->start("pkexec", QStringList() << "logViewerAuth" + << m_FilePath.at(i) << SharedMemoryManager::instance()->getRunnableKey()); + m_process->waitForFinished(-1); + //有错则传出空数据 + if (m_process->exitCode() != 0) { + emit kernFinished(m_threadCount); + return; + } } + if (!m_canRun) { return; } @@ -479,20 +512,11 @@ void LogAuthThread::handleKwin() */ void LogAuthThread::handleXorg() { - qint64 curDtSecond = 0; - //xorg.0.log文件以当前boot的时间加上时间偏移量 - QFile startFile("/proc/uptime"); - QString startStr = ""; - if (startFile.open(QFile::ReadOnly)) { - startStr = QString(startFile.readLine()); - startFile.close(); - } - startStr = startStr.split(" ").value(0, ""); QList xList; for (int i = 0; i < m_FilePath.count(); i++) { if (!m_FilePath.at(i).contains("txt")) { QFile file(m_FilePath.at(i)); // add by Airy - if (!file.exists() || !startFile.exists()) { + if (!file.exists()) { emit proccessError(tr("Log file is empty")); emit xorgFinished(m_threadCount); return; @@ -506,15 +530,6 @@ void LogAuthThread::handleXorg() if (!m_canRun) { return; } - //多文件的情况下除了xorg.0.log文件其他文件的时间以文件创建的时间加上时间偏移量 - QFileInfo fileInfo(m_FilePath.at(i)); - if (i == 0) { - QDateTime curDt = QDateTime::currentDateTime(); - curDtSecond = curDt.toMSecsSinceEpoch() - static_cast(startStr.toDouble() * 1000); - } else { - QDateTime creatTime = fileInfo.birthTime(); - curDtSecond = creatTime.toMSecsSinceEpoch(); - } if (!m_canRun) { return; } @@ -529,19 +544,11 @@ void LogAuthThread::handleXorg() if (list.count() < 2) continue; QString timeStr = list[0]; - QString msgInfo = list.mid(1, list.length() - 1).join("]"); - // 把文件生成时间加上日志记录的毫秒数则为日志记录的时间 + QString msgInfo = list.mid(1, list.length() - 1).join("]").trimmed(); + // 仅显示时间偏移量(单位:秒 QString tStr = timeStr.split("[", QString::SkipEmptyParts)[0].trimmed(); - qint64 tStrMesc = qint64(tStr.toDouble() * 1000); - qint64 realT = 0; - realT = curDtSecond + tStrMesc; - QDateTime realDt = QDateTime::fromMSecsSinceEpoch(realT); - if (m_xorgFilters.timeFilterBegin > 0 && m_xorgFilters.timeFilterEnd > 0) { - if (realDt.toMSecsSinceEpoch() < m_xorgFilters.timeFilterBegin || realDt.toMSecsSinceEpoch() > m_xorgFilters.timeFilterEnd) - continue; - } LOG_MSG_XORG msg; - msg.dateTime = realDt.toString("yyyy-MM-dd hh:mm:ss.zzz"); + msg.offset = tStr; msg.msg = msgInfo + tempStr; tempStr.clear(); xList.append(msg); @@ -638,7 +645,6 @@ void LogAuthThread::handleDkpg() void LogAuthThread::handleNormal() { - qDebug() << "logAuthThread::handleNormal()"; if (!m_canRun) { emit normalFinished(m_threadCount); return; @@ -686,7 +692,6 @@ void LogAuthThread::handleNormal() Nmsg.eventType = "Login"; } - QString end_str; QString strFormat = "ddd MMM dd hh:mm"; //修改时间格式转换方法,采用QDateTime 转换 @@ -698,7 +703,7 @@ void LogAuthThread::handleNormal() count1++; } } else { - Nmsg.msg = start_str + " - " + end_str; + Nmsg.msg = start_str + " - "; } QString n_time = QDateTime::fromTime_t(static_cast(utbufp->ut_time)).toString("yyyy-MM-dd hh:mm:ss"); @@ -736,14 +741,14 @@ void LogAuthThread::NormalInfoTime() shareInfo.isStart = true; SharedMemoryManager::instance()->setRunnableTag(shareInfo); m_process->setProcessChannelMode(QProcess::MergedChannels); - m_process->start("last -f /var/log/wtmp"); + m_process->start("last", {"-f", "/var/log/wtmp"}); m_process->waitForFinished(-1); QByteArray outByte = m_process->readAllStandardOutput(); QByteArray byte = Utils::replaceEmptyByteArray(outByte); QTextStream stream(&byte); QByteArray encode; stream.setCodec(encode); - QString output = stream.readAll(); + stream.readAll(); QStringList l = QString(byte).split('\n'); m_process->close(); TimeList.clear(); @@ -775,7 +780,6 @@ void LogAuthThread::NormalInfoTime() std::reverse(TimeList.begin(), TimeList.end()); } - void LogAuthThread::handleDnf() { QList dList; @@ -797,11 +801,11 @@ void LogAuthThread::handleDnf() QString multiLine; //开启贪婪匹配,解析dnf全部字段:日期+事件+等级+主要内容 QRegularExpression re("^(\\d{4}-[0-2]\\d-[0-3]\\d)\\D*([0-2]\\d:[0-5]\\d:[0-5]\\d)\\S*\\s*(\\w*)\\s*(.*)$"); - for (int i = allLog.size() - 1; i >= 0; --i) { + for (int j = allLog.size() - 1; j >= 0; --j) { if (!m_canRun) { return; } - QString str = allLog.value(i); + QString str = allLog.value(j); QRegularExpressionMatch match = re.match(str); bool matchRes = match.hasMatch(); if (matchRes) { @@ -881,7 +885,7 @@ void LogAuthThread::handleDmesg() QTextStream stream(&byte); QByteArray encode; stream.setCodec(encode); - QString output = stream.readAll(); + stream.readAll(); QStringList l = QString(byte).split('\n'); m_process->close(); if (!m_canRun) { @@ -930,6 +934,376 @@ void LogAuthThread::handleDmesg() emit dmesgFinished(dmesgList); } +void LogAuthThread::handleAudit() +{ + QList aList; + for (int i = 0; i < m_FilePath.count(); i++) { + if (!m_FilePath.at(i).contains("txt")) { + if (!DLDBusHandler::instance(this)->isFileExist(m_FilePath.at(i))) { + emit auditFinished(m_threadCount); + return; + } + } + if (!m_canRun) { + return; + } + + if (!Utils::runInCmd) { + initProccess(); + if (!m_canRun) { + return; + } + m_process->setProcessChannelMode(QProcess::MergedChannels); + if (!m_canRun) { + return; + } + + if (DBusManager::isSEOpen()) { + if (DBusManager::isAuditAdmin()) { + // 是审计管理员,需要鉴权,有错则传出空数据 + if (!Utils::checkAuthorization("com.deepin.pkexec.logViewerAuth.self", QCoreApplication::instance()->applicationPid())) { + emit auditFinished(m_threadCount); + return; + } + } else { + // 不是审计管理员,给出提示 + emit auditFinished(m_threadCount, true); + return; + } + } else { + // 未开启等保四,鉴权逻辑同内核日志 + ShareMemoryInfo shareInfo; + shareInfo.isStart = true; + SharedMemoryManager::instance()->setRunnableTag(shareInfo); + //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 + m_process->start("pkexec", QStringList() << "logViewerAuth" + << m_FilePath.at(i) << SharedMemoryManager::instance()->getRunnableKey()); + m_process->waitForFinished(-1); + if (m_process->exitCode() != 0) { + emit auditFinished(m_threadCount); + return; + } + } + } + + if (!m_canRun) { + return; + } + + QString byte; + if (Utils::convertToMB(DLDBusHandler::instance(this)->getFileSize(m_FilePath.at(i))) > DBUS_THRESHOLD_MAX) { + // 日志文件超过100MB,使用文本流读取日志数据,避免DBUS接口被数据流量撑爆 + auto token = DLDBusHandler::instance(this)->openLogStream(m_FilePath.at(i)); + while(1) { + auto temp = DLDBusHandler::instance(this)->readLogInStream(token); + + if(temp.isEmpty()) { + break; + } + + byte += temp; + } + } else { + byte = DLDBusHandler::instance(this)->readLog(m_FilePath.at(i)); + } + + byte.replace('\u0000', "").replace("\x01", ""); + QStringList strList = byte.split('\n', QString::SkipEmptyParts); + + QRegularExpression re; + QRegularExpressionMatch match; + for (int j = strList.size() - 1; j >= 0; --j) { + if (!m_canRun) { + return; + } + QString str = strList.at(j); + if (str.isEmpty() || str.indexOf("type=") == -1) + continue; + + LOG_MSG_AUDIT msg; + //删除颜色格式字符 + str.replace(QRegExp("\\#033\\[\\d+(;\\d+){0,2}m"), ""); + // remove Useless characters + str.replace(QRegExp("\\x1B\\[\\d+(;\\d+){0,2}m"), ""); + QStringList list = str.split(" ", QString::SkipEmptyParts); + if (list.size() < 2) + continue; + + // 事件类型 + QString eventType = list[0].split("=").last(); + msg.eventType = eventType; + + // 审计类型 + QString auditType = ""; + // 根据事件类型识别审计类型 + if (auditType.isEmpty()) + auditType = Utils::auditType(msg.eventType); + + // 根据事件类型未识别出审计类型 + if (auditType.isEmpty()) { + // 判断是否为远程连接审计日志 + re.setPattern("(?<=addr=)([^= \"]+|(\"(\\\\\"|[^\"])*\"))"); + match = re.match(str); + if (match.hasMatch()) { + QString addr = match.captured(0); + if (QRegExp("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b").exactMatch(addr)) + auditType = Audit_Remote; + } + + if (auditType.isEmpty()) { + // 获取key值,识别出一些特殊的审计类型(主要为自定义的审计类型) + re.setPattern("(?<=key=)([^= \"]+|(\"(\\\\\"|[^\"])*\"))"); + match = re.match(str); + if (match.hasMatch()) { + QString key = match.captured(0); + key.replace("\"",""); + if (!key.isEmpty()) + auditType = Utils::auditType(key); + } + } + } + + // 审计类型依然为空,归为其他类型 + if (auditType.isEmpty()) + auditType = Audit_Other; + + msg.auditType = auditType; + + // 时间"(?<=msg=audit\()[^\.]*(?=\.)" + re.setPattern("(?<=msg=audit\\()[^\\.]*(?=\\.)"); + match = re.match(str); + if (match.hasMatch()) { + QDateTime dateTime = QDateTime::fromTime_t(match.captured(0).toUInt()); + qint64 iTime = dateTime.toMSecsSinceEpoch(); + //对时间筛选 + if (m_auditFilters.timeFilterBegin > 0 && m_auditFilters.timeFilterEnd > 0) { + if (iTime < m_auditFilters.timeFilterBegin || iTime > m_auditFilters.timeFilterEnd) + continue; + } + msg.dateTime = dateTime.toString("yyyy-MM-dd hh:mm:ss"); + } + + // 进程名 + QString processName = ""; + re.setPattern("(?<=comm=\\\")([^= \"]+|(\"(\\\\\"|[^\"])*\"))"); + match = re.match(str); + if (match.hasMatch()) { + processName = match.captured(0); + processName.replace("\"",""); + } + + if (processName.isEmpty()) { + re.setPattern("(?<=exe=\\\")([^= \"]+|(\"(\\\\\"|[^\"])*\"))"); + match = re.match(str); + if (match.hasMatch()) { + processName = match.captured(0); + processName.replace("\"",""); + processName = processName.split("/").last(); + } + } + + if (processName.isEmpty()) + processName = "N/A"; + msg.processName = processName; + + // 状态 + QString status = ""; + re.setPattern("(?<=success=)([^= \"]+|(\"(\\\\\"|[^\"])*\"))"); + match = re.match(str); + if (match.hasMatch()) { + status = match.captured(0); + if (status == "yes") + status = "OK"; + else + status = "Failed"; + } + + if (status.isEmpty()) { + re.setPattern("(?<=res=)([^= ']+|('(\\\\'|[^'])*'))"); + match = re.match(str); + if (match.hasMatch()) { + status = match.captured(0); + if (status == "success") + status = "OK"; + else + status = "Failed"; + } + + if (status.isEmpty()) + status = "OK"; + } + + msg.status = status; + + // 信息,将“msg=audit(1688526389.214:61):”之后的内容作为详细信息 + msg.msg = str.right(str.length() - str.indexOf("):") - 3); + + // 原文 + msg.origin = str; + + aList.append(msg); + if (!m_canRun) { + return; + } + //每获得500个数据就发出信号给控件加载 + if (aList.count() % SINGLE_READ_CNT == 0) { + emit auditData(m_threadCount, aList); + aList.clear(); + } + if (!m_canRun) { + return; + } + } + } + //最后可能有余下不足500的数据 + if (aList.count() >= 0) { + emit auditData(m_threadCount, aList); + } + emit auditFinished(m_threadCount); +} + +void LogAuthThread::handleCoredump() +{ + if (!m_canRun) { + return; + } + QList coredumpList; + + QString byte; + initProccess(); + if (Utils::runInCmd) { + byte = DLDBusHandler::instance()->readLog("coredump"); + byte = byte.replace('\u0000', "").replace("\x01", ""); + } else { + m_process->start("pkexec", QStringList() << "logViewerAuth" << + QStringList() << "coredumpctl-list" << SharedMemoryManager::instance()->getRunnableKey()); + m_process->waitForFinished(-1); + QByteArray outByte = m_process->readAllStandardOutput(); + byte = Utils::replaceEmptyByteArray(outByte); + } + + QStringList strList = QString(byte).split('\n', QString::SkipEmptyParts); + + QRegExp re("(Storage: )\\S+"); + for (int i = strList.size() - 1; i >= 0 ; --i) { + QString str = strList.at(i); + if (!m_canRun) { + return; + } + if (str.trimmed().isEmpty()) { + continue; + } + QStringList tmpList = str.split(" ", QString::SkipEmptyParts); + if (tmpList.count() < 10) + continue; + + LOG_MSG_COREDUMP coredumpMsg; + coredumpMsg.dateTime = tmpList[1] + " " + tmpList[2]; + QDateTime dt = QDateTime::fromString(coredumpMsg.dateTime, "yyyy-MM-dd hh:mm:ss"); + if (m_coredumpFilters.timeFilterBegin > 0 && m_coredumpFilters.timeFilterEnd > 0) { + if (dt.toMSecsSinceEpoch() < m_coredumpFilters.timeFilterBegin + || dt.toMSecsSinceEpoch() > m_coredumpFilters.timeFilterEnd) + continue; + } + + // 获取信号名称 + int sigId = tmpList[7].toInt(); + if ( sigId <= sigList.size()) { + coredumpMsg.sig = sigList[sigId - 1]; + } else { + coredumpMsg.sig = tmpList[7]; + } + //获取用户名 + coredumpMsg.uid = tmpList[5]; + coredumpMsg.userName = Utils::getUserNamebyUID(tmpList[5].toUInt()); + coredumpMsg.coreFile = tmpList[8]; + QString exePath = tmpList[9]; + coredumpMsg.exe = exePath; + coredumpMsg.pid = tmpList[4]; + + // 解析coredump文件保存位置 + if (coredumpMsg.coreFile != "missing") { + // 若coreFile状态为missing,表示文件已丢失,不继续解析文件位置 + QString outInfoByte; + outInfoByte = DLDBusHandler::instance()->readLog(QString("coredumpctl info %1").arg(coredumpMsg.pid)); + + // 解析第一条堆栈信息 + QStringList strList = outInfoByte.split("Stack trace of thread"); + if (strList.size() > 1) { + coredumpMsg.stackInfo = "Stack trace of thread" + strList[1]; + } + re.indexIn(outInfoByte); + coredumpMsg.storagePath = re.cap(0).replace("Storage: ", ""); + } else { + coredumpMsg.storagePath = QString("coredump file is missing"); + } + + coredumpList.append(coredumpMsg); + //每获得600个数据就发出信号给控件加载 + if (coredumpList.count() % SINGLE_READ_CNT_COREDUMP == 0) { + emit coredumpData(m_threadCount, coredumpList); + coredumpList.clear(); + } + } + + if (!m_canRun) { + return; + } + + //最后可能有余下不足600的数据 + if (coredumpList.count() >= 0) { + emit coredumpData(m_threadCount, coredumpList); + } + emit coredumpFinished(m_threadCount); +} + +QString LogAuthThread::readAppLogFromLastLines(const QString& filePath, const int& count) +{ + if (!QFile::exists(filePath)) { + qCWarning(logAuthWork) << QString("log not existed. path:%1").arg(filePath); + return ""; + } + + QStringList lines; + string line; + + ifstream f(filePath.toStdString().c_str(), ios::ate); + if (f.is_open()) { + char c; + streampos size = f.tellg(); + for (int var = 1; var <= size; var++) { + f.seekg(-var, ios::end); + f.get(c); + + if (lines.size() >= count) + break; + + if (c == 0) { + continue; + } + + if (c == '\n') { + if (line.size() > 0) { + lines.prepend(line.c_str()); + } + line = ""; + } else { + line = c + line; + } + + c = 0; + } + + if (line.size() > 0 && lines.size() < count) { + lines.prepend(line.c_str()); + } + + f.close(); + } + + return lines.join('\n'); +} + /** * @brief LogAuthThread::initProccess 初始化QProcess指针 */ diff --git a/application/logauththread.h b/application/logauththread.h index 376f0246..b10e5c69 100644 --- a/application/logauththread.h +++ b/application/logauththread.h @@ -10,7 +10,6 @@ #include #include -#include /** * @brief The LogAuthThread class 启动日志 内核日志 kwin日志 xorg日志 dpkg日志获取线程 */ @@ -21,31 +20,19 @@ class LogAuthThread : public QObject, public QRunnable explicit LogAuthThread(QObject *parent = nullptr); ~LogAuthThread() override; - static LogAuthThread *instance() - { - LogAuthThread *sin = m_instance.load(); - if (!sin) { - std::lock_guard lock(m_mutex); - sin = m_instance.load(); - if (!sin) { - sin = new LogAuthThread(); - m_instance.store(sin); - } - } - return sin; - } void initDnfLevelMap(); void initLevelMap(); - QString getStandardOutput(); - QString getStandardError(); void setType(LOG_FLAG flag) { m_type = flag; } - void setFileterParam(KWIN_FILTERS iFIlters) { m_kwinFilters = iFIlters; } - void setFileterParam(XORG_FILTERS iFIlters) { m_xorgFilters = iFIlters; } - void setFileterParam(DKPG_FILTERS iFIlters) { m_dkpgFilters = iFIlters; } - void setFileterParam(KERN_FILTERS iFIlters) { m_kernFilters = iFIlters; } - void setFileterParam(NORMAL_FILTERS iFIlters) { m_normalFilters = iFIlters; } - void setFileterParam(DNF_FILTERS iFIlters) { m_dnfFilters = iFIlters; } - void setFileterParam(DMESG_FILTERS iFIlters) { m_dmesgFilters = iFIlters; } + void setParseMap(bool parseMap) { m_parseMap = parseMap; } + void setFileterParam(const KWIN_FILTERS &iFIlters) { m_kwinFilters = iFIlters; } + void setFileterParam(const XORG_FILTERS &iFIlters) { m_xorgFilters = iFIlters; } + void setFileterParam(const DKPG_FILTERS &iFIlters) { m_dkpgFilters = iFIlters; } + void setFileterParam(const KERN_FILTERS &iFIlters) { m_kernFilters = iFIlters; } + void setFileterParam(const NORMAL_FILTERS &iFIlters) { m_normalFilters = iFIlters; } + void setFileterParam(const DNF_FILTERS &iFIlters) { m_dnfFilters = iFIlters; } + void setFileterParam(const DMESG_FILTERS &iFIlters) { m_dmesgFilters = iFIlters; } + void setFileterParam(const AUDIT_FILTERS &iFIlters) { m_auditFilters = iFIlters; } + void setFileterParam(const COREDUMP_FILTERS &iFIlters) { m_coredumpFilters = iFIlters; } void stopProccess(); void setFilePath(const QStringList &filePath); int getIndex(); @@ -69,6 +56,8 @@ class LogAuthThread : public QObject, public QRunnable void NormalInfoTime(); void handleDnf(); void handleDmesg(); + void handleAudit(); + void handleCoredump(); void initProccess(); qint64 formatDateTime(QString m, QString d, QString t); qint64 formatDateTime(QString y, QString t); @@ -98,15 +87,19 @@ class LogAuthThread : public QObject, public QRunnable void normalData(int index, QList iDataList); void dnfFinished(QList iKwinList); void dmesgFinished(QList iKwinList); + void auditFinished(int index, bool bShowTip = false); + void auditData(int index, QList iDataList); + void coredumpFinished(int index); + void coredumpData(int index, QList iDataList); void proccessError(const QString &iError); public slots: // void onFinished(int exitCode); // void kernDataRecived(); +private: + QString readAppLogFromLastLines(const QString& filePath, const int& count); + private: - QStringList m_list; - QString m_output; - QString m_error; /** * @brief m_type 当前线程获取日志数据的类型,用来指定不同的获取逻辑和返回结果 */ @@ -133,17 +126,22 @@ public slots: NORMAL_FILTERS m_normalFilters; DNF_FILTERS m_dnfFilters; DMESG_FILTERS m_dmesgFilters; - static std::atomic m_instance; - static std::mutex m_mutex; + /** + * @brief m_normalFilters 开关机日志筛选条件 + */ + AUDIT_FILTERS m_auditFilters; + + COREDUMP_FILTERS m_coredumpFilters; //获取数据用的cat命令的process QScopedPointer m_process; /** * @brief m_canRun 是否可以继续运行的标记量,用于停止运行线程 */ - bool m_canRun = false; + std::atomic_bool m_canRun = false; /** * @brief m_threadIndex 当前线程标号 */ + bool m_parseMap = false; // 崩溃信息是否要解析map信息,即stackinfo int m_threadCount; //正在执行停止进程的变量,防止重复执行停止逻辑 bool m_isStopProccess = false; diff --git a/application/logbackend.cpp b/application/logbackend.cpp new file mode 100644 index 00000000..a3554d6e --- /dev/null +++ b/application/logbackend.cpp @@ -0,0 +1,2829 @@ +// SPDX-FileCopyrightText: 2023 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "logbackend.h" +#include "logallexportthread.h" +#include "logfileparser.h" +#include "logexportthread.h" +#include "logsettings.h" +#include "utils.h" +#include "dbusmanager.h" +#include "dbusproxy/dldbushandler.h" +#include "logapplicationhelper.h" +#include "DebugTimeManager.h" +#include "eventlogutils.h" +#include "logsegementexportthread.h" +#include "parsethread/parsethreadbase.h" + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logBackend, "org.deepin.log.viewer.backend") +#else +Q_LOGGING_CATEGORY(logBackend, "org.deepin.log.viewer.backend", QtInfoMsg) +#endif + +// 获取窗管崩溃时,其日志最后100行 +#define KWIN_LASTLINE_NUM 100 +// 窗管二进制可执行文件所在路径 +const QString KWAYLAND_EXE_PATH = "/usr/bin/kwin_wayland"; +const QString XWAYLAND_EXE_PATH = "/usr/bin/Xwayland"; + +LogBackend *LogBackend::m_staticbackend = nullptr; + +LogBackend *LogBackend::instance(QObject *parent) +{ + if (parent != nullptr && m_staticbackend == nullptr) { + m_staticbackend = new LogBackend(parent); + } + + return m_staticbackend; +} + +LogBackend::~LogBackend() +{ + +} + +LogBackend::LogBackend(QObject *parent) : QObject(parent) +{ + getLogTypes(); + + m_cmdWorkDir = QDir::currentPath(); + Utils::m_mapAuditType2EventType = LogSettings::instance()->loadAuditMap(); + + initConnections(); +} + +void LogBackend::initConnections() +{ + connect(&m_logFileParser, &LogFileParser::parseFinished, this, &LogBackend::slot_parseFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::logData, this, &LogBackend::slot_logData, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::dpkgFinished, this, &LogBackend::slot_dpkgFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::dpkgData, this, &LogBackend::slot_dpkgData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::xlogFinished, this, &LogBackend::slot_XorgFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::xlogData, this, &LogBackend::slot_xorgData, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::bootFinished, this, &LogBackend::slot_bootFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::bootData, this, &LogBackend::slot_bootData, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::kernFinished, this, &LogBackend::slot_kernFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::kernData, this, &LogBackend::slot_kernData, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::journalFinished, this, &LogBackend::slot_journalFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::journalData, this, &LogBackend::slot_journalData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::journaBootlData, this, &LogBackend::slot_journalBootData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::appFinished, this, + &LogBackend::slot_applicationFinished); + connect(&m_logFileParser, &LogFileParser::appData, this, + &LogBackend::slot_applicationData); + + connect(&m_logFileParser, &LogFileParser::kwinFinished, this, &LogBackend::slot_kwinFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::kwinData, this, &LogBackend::slot_kwinData, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::normalData, this, &LogBackend::slot_normalData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::normalFinished, this, &LogBackend::slot_normalFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::journalBootFinished, this, &LogBackend::slot_journalBootFinished, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::proccessError, this, &LogBackend::slot_logLoadFailed, + Qt::QueuedConnection); + connect(&m_logFileParser, SIGNAL(dnfFinished(QList)), this, SLOT(slot_dnfFinished(QList))); + connect(&m_logFileParser, &LogFileParser::dmesgFinished, this, &LogBackend::slot_dmesgFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::OOCData, this, &LogBackend::slot_OOCData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::OOCFinished, this, &LogBackend::slot_OOCFinished, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::auditData, this, &LogBackend::slot_auditData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::auditFinished, this, &LogBackend::slot_auditFinished, + Qt::QueuedConnection); + + connect(&m_logFileParser, &LogFileParser::coredumpData, this, &LogBackend::slot_coredumpData, + Qt::QueuedConnection); + connect(&m_logFileParser, &LogFileParser::coredumpFinished, this, &LogBackend::slot_coredumpFinished, + Qt::QueuedConnection); +} + +void LogBackend::setCmdWorkDir(const QString &dirPath) +{ + QDir dir(dirPath); + if (dir.exists()) + m_cmdWorkDir = dirPath; +} + +int LogBackend::exportAllLogs(const QString &outDir) +{ + if(!getOutDirPath(outDir)) + return -1; + + PERF_PRINT_BEGIN("POINT-05", "export all logs"); + qCInfo(logBackend) << "exporting all logs begin."; + + // 时间 + QString dateTime = QDateTime::currentDateTime().toString("yyyyMMddHHmmss"); + + // 主机名 + utsname _utsname; + uname(&_utsname); + QString hostname = QString(_utsname.nodename); + QString fileFullPath = m_outPath + "/" + QString("%1_%2_all_logs.zip").arg(dateTime).arg(hostname); + + // 添加文件后缀 + if (!fileFullPath.endsWith(".zip")) { + fileFullPath += ".zip"; + } + + LogAllExportThread *thread = new LogAllExportThread(m_logTypes, fileFullPath); + thread->setAutoDelete(true); + connect(thread, &LogAllExportThread::exportFinsh, this, [ = ](bool ret) { + if (ret) { + qCInfo(logBackend) << "exporting all logs done."; + PERF_PRINT_END("POINT-05", "cost"); + qApp->quit(); + } else { + qCWarning(logBackend) << "exporting all logs stoped."; + // 导出失败,若为用户指定的新目录,应清除 + if (m_newDir) { + QDir odir(m_outPath); + odir.removeRecursively(); + } + PERF_PRINT_END("POINT-05", "cost"); + qApp->exit(-1); + } + }); + QThreadPool::globalInstance()->start(thread); + + return 0; +} + +int LogBackend::exportTypeLogs(const QString &outDir, const QString &type) +{ + // 输出目录有效性验证 + if(!getOutDirPath(outDir)) + return -1; + + // 日志种类有效性验证 + QString error; + m_flag = type2Flag(type, error); + if (NONE == m_flag) { + qCWarning(logBackend) << error; + return -1; + } + + QString dateTime = QDateTime::currentDateTime().toString("yyyyMMddHHmmss"); + QString categoryOutPath = QString("%1/%2-%3/").arg(m_outPath).arg(type).arg(dateTime); + + qCInfo(logBackend) << "exporting ... type:" << type; + bool bSuccess = true; + switch (m_flag) { + case JOURNAL: { + resetCategoryOutputPath(categoryOutPath); + + DLDBusHandler::instance()->exportLog(categoryOutPath, "journalctl_system", false); + } + break; + case Dmesg: { + resetCategoryOutputPath(categoryOutPath); + + DLDBusHandler::instance()->exportLog(categoryOutPath, "dmesg", false); + } + break; + case KERN: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("kern", false); + if (logPaths.size() > 0) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else if (logPaths.size() == 0) { + qCWarning(logBackend) << "/var/log has not kern.log"; + bSuccess = false; + } + } + break; + case BOOT_KLU: { + resetCategoryOutputPath(categoryOutPath); + + DLDBusHandler::instance()->exportLog(categoryOutPath, "journalctl_boot", false); + } + break; + case BOOT: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("boot", false); + if (!logPaths.isEmpty()) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else { + qCWarning(logBackend) << "/var/log has not boot.log"; + bSuccess = false; + } + } + break; + case DPKG: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("dpkg", false); + if (!logPaths.isEmpty()) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else { + qCWarning(logBackend) << "/var/log has not dpkg.log"; + bSuccess = false; + } + } + break; + case Dnf: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("dnf", false); + if (!logPaths.isEmpty()) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else { + qCWarning(logBackend) << "/var/log has not dnf.log"; + bSuccess = false; + } + } + break; + case Kwin: { + resetCategoryOutputPath(categoryOutPath); + + DLDBusHandler::instance()->exportLog(categoryOutPath, KWIN_TREE_DATA, true); + } + break; + case XORG: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("Xorg", false); + if (!logPaths.isEmpty()) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else { + qCWarning(logBackend) << "/var/log has not Xorg.log"; + bSuccess = false; + } + } + break; + case APP: { + categoryOutPath = QString("%1/%2").arg(m_outPath).arg("apps"); + resetCategoryOutputPath(categoryOutPath); + + bSuccess = false; + AppLogConfigList appConfigs = LogApplicationHelper::instance()->getAppLogConfigs(); + for (auto appConfig : appConfigs) { + QString appName = appConfig.name; + // 隐藏的应用不导出日志 + if (appName.isEmpty() || !appConfig.visible) + continue; + + // 逐个导出应用日志 + if (exportAppLogs(categoryOutPath, appName) != -1) + bSuccess = true; + } + } + break; + case COREDUMP: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("coredump", false); + if (!logPaths.isEmpty()) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else { + qCWarning(logBackend) << "/var/log has no coredump logs"; + bSuccess = false; + } + } + break; + case Normal: { + QFile file("/var/log/wtmp"); + if (!file.exists()) { + qCWarning(logBackend) << "/var/log has no boot shutdown event log"; + bSuccess = false; + } + + resetCategoryOutputPath(categoryOutPath); + + DLDBusHandler::instance()->exportLog(categoryOutPath, "last", false); + } + break; + case OtherLog: { + categoryOutPath = QString("%1/%2/").arg(m_outPath).arg("others"); + resetCategoryOutputPath(categoryOutPath); + + auto otherLogListPair = LogApplicationHelper::instance()->getOtherLogList(); + for (auto &it2 : otherLogListPair) { + QStringList logPaths = DLDBusHandler::instance(nullptr)->getOtherFileInfo(it2.at(1)); + logPaths.removeDuplicates(); + if (logPaths.size() > 1) { + QString tmpSubCategoryOutPath = QString("%1/%2/").arg(categoryOutPath).arg(it2.at(0)); + Utils::mkMutiDir(tmpSubCategoryOutPath); + for (auto &file : logPaths) { + DLDBusHandler::instance()->exportLog(tmpSubCategoryOutPath, file, true); + } + } + else if (logPaths.size() == 1) + DLDBusHandler::instance()->exportLog(categoryOutPath, logPaths[0], true); + } + } + break; + case CustomLog: { + auto customLogListPair = LogApplicationHelper::instance()->getCustomLogList(); + QStringList logPaths; + for (auto &it2 : customLogListPair) { + logPaths.append(it2.at(1)); + } + + if (logPaths.size() > 0) { + categoryOutPath = QString("%1/%2/").arg(m_outPath).arg("customized"); + resetCategoryOutputPath(categoryOutPath); + + for (auto &file : logPaths) { + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } + } else { + qCWarning(logBackend) << "no custom logs"; + bSuccess = false; + } + } + break; + case Audit: { + QStringList logPaths = DLDBusHandler::instance()->getFileInfo("audit", false); + if (!logPaths.isEmpty()) { + resetCategoryOutputPath(categoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(categoryOutPath, file, true); + } else { + qCWarning(logBackend) << "/var/log has no audit logs"; + bSuccess = false; + } + } + break; + default: + break; + } + + Utils::resetToNormalAuth(categoryOutPath); + + if (bSuccess) + qCInfo(logBackend) << QString("export success."); + else + qCInfo(logBackend) << QString("export failed."); + + return bSuccess ? 0 : -1; +} + +bool LogBackend::LogBackend::exportTypeLogsByCondition(const QString &outDir, const QString &type, const QString &period, const QString &condition, const QString &keyword) +{ + if (!getOutDirPath(outDir)) + return false; + + // 日志种类有效性验证 + QString error; + m_flag = type2Flag(type, error); + if (NONE == m_flag) { + qCWarning(logBackend) << error; + return false; + } + + qCInfo(logBackend) << "exporting ... type:" << type; + + m_currentSearchStr = keyword; + + m_sessionType = Export; + + // 解析数据 + if (!parseData(m_flag, period, condition)) { + qCWarning(logBackend) << QString("parse data failed."); + return false; + } + + m_sessionType = Export; + return true; +} + +int LogBackend::exportAppLogs(const QString &outDir, const QString &appName) +{ + if(!getOutDirPath(outDir)) + return -1; + + if (appName.isEmpty()) + return -1; + + // 先查找是否有该应用相关日志配置 + if (!LogApplicationHelper::instance()->isAppLogConfigExist(appName)) { + qCWarning(logBackend) << QString("unknown app:%1 is invalid.").arg(appName); + return -1; + } + + qCInfo(logBackend) << QString("exporting %1 logs...").arg(appName); + + QString categoryOutPath = QString("%1/%2").arg(m_outPath).arg(appName); + + bool bSuccess = false; + AppLogConfig appLogConfig = LogApplicationHelper::instance()->appLogConfig(appName); + for (int i = 0; i < appLogConfig.subModules.size(); i++) { + SubModuleConfig& submodule = appLogConfig.subModules[i]; + QString subCategoryOutPath = QString("/%1/%2/").arg(categoryOutPath).arg(submodule.name); + if (appLogConfig.subModules.size() == 1 && submodule.name == appLogConfig.name) + subCategoryOutPath = categoryOutPath; + if (submodule.logType == "file") { + QStringList logPaths = DLDBusHandler::instance(nullptr)->getFileInfo(submodule.logPath); + logPaths.removeDuplicates(); + if (logPaths.size() > 0) { + resetCategoryOutputPath(subCategoryOutPath); + + for (auto &file: logPaths) + DLDBusHandler::instance()->exportLog(subCategoryOutPath, file, true); + bSuccess = true; + } else { + qCWarning(logBackend) << QString("app:%1 submodule:%2, logPath:%3 not found log files.").arg(appName).arg(submodule.name).arg(submodule.logPath); + } + } else if (submodule.logType == "journal") { + if (submodule.filter.endsWith("*")) + qCWarning(logBackend) << QString("app:%1 submodule:%2, Export journal logs with wildcard not supported.").arg(appName).arg(submodule.name); + else { + QJsonObject obj = submodule.toJson(); + resetCategoryOutputPath(subCategoryOutPath); + DLDBusHandler::instance()->exportLog(subCategoryOutPath, QJsonDocument(obj).toJson(QJsonDocument::Compact), false); + bSuccess = true; + } + } + } + + Utils::resetToNormalAuth(categoryOutPath); + + if (bSuccess) + qCInfo(logBackend) << QString("export %1 logs success.").arg(appName) << "\n"; + else + qCInfo(logBackend) << QString("export %1 logs failed.").arg(appName) << "\n"; + + return bSuccess ? 0 : -1; +} + +bool LogBackend::exportAppLogsByCondition(const QString &outDir, const QString &appName, const QString &period, const QString &level, const QString &submodule, const QString &keyword) +{ + if(!getOutDirPath(outDir)) + return false; + + if (appName.isEmpty()) + return false; + + // 周期类型有效性验证 + BUTTONID periodId = ALL; + if (!period.isEmpty()) { + periodId = period2Enum(period); + if (INVALID == periodId) { + qCWarning(logBackend) << "invalid 'period' parameter: " << period << "\nUSEAGE: all(export all), today(export today), 3d(export past 3 days), 1w(export past week), 1m(export past month), 3m(export past 3 months)"; + return false; + } + } + + // 级别有效性判断 + if (!level.isEmpty() && level2Id(level) == -2) { + qCWarning(logBackend) << "invalid 'level' parameter: " << level << "\nUSEAGE: all(all), 0(emerg), 1(alert), 2(crit), 3(error), 4(warning), 5(notice), 6(info), 7(debug)"; + return false; + } + + qCInfo(logBackend) << "appName:" << appName << "period:" << period << "level:" << level << "submodule" << submodule << "keyword:" << keyword; + + TIME_RANGE timeRange = getTimeRange(periodId); + + // 先查找是否有该应用相关日志配置 + if (!LogApplicationHelper::instance()->isAppLogConfigExist(appName)) { + qCWarning(logBackend) << QString("unknown app:%1 is invalid.").arg(appName); + return false; + } + + m_flag = APP; + m_curApp = appName; + m_sessionType = Export; + m_currentSearchStr = keyword; + + m_appFilter.clear(); + m_appFilter.app = appName; + m_appFilter.submodule = submodule; + m_appFilter.lvlFilter = level2Id(level); + m_appFilter.timeFilterBegin = timeRange.begin; + m_appFilter.timeFilterEnd = timeRange.end; + m_appFilter.searchstr = m_currentSearchStr; + + m_appCurrentIndex = m_logFileParser.parseByApp(m_appFilter); + + return true; +} + +QStringList LogBackend::getLogTypes() +{ + Dtk::Core::DSysInfo::UosEdition edition = Dtk::Core::DSysInfo::uosEditionType(); + //等于服务器行业版或欧拉版(centos) + bool isCentos = Dtk::Core::DSysInfo::UosEuler == edition || Dtk::Core::DSysInfo::UosEnterpriseC == edition || Dtk::Core::DSysInfo::UosMilitaryS == edition; + if (QFile::exists("/var/log/journal") || isCentos) { + m_logTypes.push_back(JOUR_TREE_DATA); + } + + if (isCentos) { + m_logTypes.push_back(DMESG_TREE_DATA); + } else { + if (QFile::exists("/var/log/kern.log")) { + m_logTypes.push_back(KERN_TREE_DATA); + } + } + if (Utils::isWayland()) { + m_logTypes.push_back(BOOT_KLU_TREE_DATA); + } else { + m_logTypes.push_back(BOOT_TREE_DATA); + } + if (isCentos) { + m_logTypes.push_back(DNF_TREE_DATA); + } else { + if (QFile::exists("/var/log/dpkg.log")) { + m_logTypes.push_back(DPKG_TREE_DATA); + } + } + //wayland环境才有kwin日志 + if (Utils::isWayland()) { + m_logTypes.push_back(KWIN_TREE_DATA); + } else { + m_logTypes.push_back(XORG_TREE_DATA); + } + auto *appHelper = LogApplicationHelper::instance(); + QMap appMap = appHelper->getMap(); + if (!appMap.isEmpty()) { + m_logTypes.push_back(APP_TREE_DATA); + } + + m_logTypes.push_back(COREDUMP_TREE_DATA); + + // add by Airy + if (QFile::exists("/var/log/wtmp")) { + m_logTypes.push_back(LAST_TREE_DATA); + } + + //other + m_logTypes.push_back(OTHER_TREE_DATA); + + //custom + if (LogApplicationHelper::instance()->getCustomLogList().size()) { + m_logTypes.push_back(CUSTOM_TREE_DATA); + } + + // 审计日志文件存在,才加载和显示审计日志模块(审计日志文件需要root权限访问,因此在service服务中判断审计日志文件是否存在) + if (DLDBusHandler::instance(qApp)->isFileExist(AUDIT_TREE_DATA)) { + m_logTypes.push_back(AUDIT_TREE_DATA); + } + + return m_logTypes; +} + +void LogBackend::slot_parseFinished(int index, LOG_FLAG type, int status) +{ + if (m_flag != type || index != m_type2ThreadIndex[type]) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit parseFinished(type, status); + + if (status != ParseThreadBase::Normal) + return; + } else if (Export == m_sessionType) { + // 导出当前解析到的数据 + executeCLIExport(m_exportFilePath); + + // 异常情况,不再进行分段导出 + if (status != ParseThreadBase::Normal) { + // 还原任务状态 + if (View == m_lastSessionType) { + m_sessionType = View; + m_bSegementExporting = false; + Utils::checkAndDeleteDir(m_exportFilePath); + // 通知前端,处理进度条隐藏问题 + emit parseFinished(type, status); + } + return; + } + + // 若有分段数据,开启分段导出 + segementExport(); + } +} + +void LogBackend::slot_logData(int index, const QList &list, LOG_FLAG type) +{ + if (m_flag != type || index != m_type2ThreadIndex[type]) + return; + + m_type2LogDataOrigin[type].append(list); + QList filterData = filterLog(m_currentSearchStr, list); + m_type2LogData[type].append(filterData); + + if (View == m_sessionType) { + // 只中转新增数据到界面 + emit logData(filterData, type); + } +} + +void LogBackend::slot_dpkgFinished(int index) +{ + if (m_flag != DPKG || index != m_dpkgCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit dpkgFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_dpkgData(int index, QList list) +{ + if (m_flag != DPKG || index != m_dpkgCurrentIndex) + return; + + dListOrigin.append(list); + dList.append(filterDpkg(m_currentSearchStr, list)); + + if (View == m_sessionType) { + emit dpkgData(dList); + } +} + +void LogBackend::slot_XorgFinished(int index) +{ + if (m_flag != XORG || index != m_xorgCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit xlogFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_xorgData(int index, QList list) +{ + if (m_flag != XORG || index != m_xorgCurrentIndex) + return; + + xListOrigin.append(list); + xList.append(filterXorg(m_currentSearchStr, list)); + + if (View == m_sessionType) { + emit xlogData(xList); + } +} + +void LogBackend::slot_bootFinished(int index) +{ + if (m_flag != BOOT || index != m_bootCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit bootFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_bootData(int index, QList list) +{ + if (m_flag != BOOT || index != m_bootCurrentIndex) + return; + + bList.append(list); + currentBootList.append(filterBoot(m_bootFilter, list)); + + if (View == m_sessionType) { + emit bootData(currentBootList); + } +} + +void LogBackend::slot_kernFinished(int index) +{ + if (m_flag != KERN || index != m_kernCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit kernFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_kernData(int index, QList list) +{ + if (m_flag != KERN || index != m_kernCurrentIndex) + return; + + kListOrigin.append(list); + kList.append(filterKern(m_currentSearchStr, list)); + + if (View == m_sessionType) { + emit kernData(kList); + } +} + +void LogBackend::slot_kwinFinished(int index) +{ + if (m_flag != Kwin || index != m_kwinCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit kwinFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_kwinData(int index, QList list) +{ + if (m_flag != Kwin || index != m_kwinCurrentIndex) + return; + m_kwinList.append(list); + m_currentKwinList.append(filterKwin(m_currentSearchStr, list)); + + if (View == m_sessionType) { + emit kwinData(m_currentKwinList); + } +} + +void LogBackend::slot_dnfFinished(const QList &list) +{ + if (m_flag != Dnf) + return; + dnfList = filterDnf(m_currentSearchStr, list); + dnfListOrigin = list; + + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit dnfFinished(dnfListOrigin); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_dmesgFinished(const QList &list) +{ + if (m_flag != Dmesg) + return; + + dmesgList = filterDmesg(m_currentSearchStr,list); + dmesgListOrigin = list; + + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit dmesgFinished(dmesgListOrigin); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_journalFinished(int index) +{ + if (m_flag != JOURNAL || index != m_journalCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit journalFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_journalBootFinished(int index) +{ + if (m_flag != BOOT_KLU || index != m_journalBootCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit journalBootFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_journalBootData(int index, QList list) +{ + if (m_flag != BOOT_KLU || index != m_journalBootCurrentIndex) + return; + + jBootListOrigin.append(list); + jBootList.append(filterJournalBoot(m_currentSearchStr, list)); + + if (View == m_sessionType) { + emit journaBootlData(jBootList); + } +} + +void LogBackend::slot_journalData(int index, QList list) +{ + //判断最近一次获取数据线程的标记量,和信号曹发来的sender的标记量作对比,如果相同才可以刷新,因为会出现上次的获取线程就算停下信号也发出来了 + if (m_flag != JOURNAL || index != m_journalCurrentIndex) + return; + + jListOrigin.append(list); + jList.append(filterJournal(m_currentSearchStr, list)); + + if (View == m_sessionType) { + emit journalData(jList); + } +} + +void LogBackend::slot_applicationFinished(int index) +{ + if (m_flag != APP || index != m_appCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit appFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_applicationData(int index, QList list) +{ + if (m_flag != APP || index != m_appCurrentIndex) + return; + + appListOrigin.append(list); + appList.append(filterApp(m_appFilter, list)); + + if (View == m_sessionType) { + emit appData(appList); + } +} + +void LogBackend::slot_normalFinished(int index) +{ + if (m_flag != Normal || index != m_normalCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit normalFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_normalData(int index, QList list) +{ + if (m_flag != Normal || index != m_normalCurrentIndex) + return; + norList.append(list); + nortempList.append(filterNomal(m_normalFilter, list)); + + if (View == m_sessionType) { + emit normalData(nortempList); + } +} + +void LogBackend::slot_OOCFinished(int index, int error) +{ + if ((m_flag != OtherLog && m_flag != CustomLog) || index != m_OOCCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) + emit OOCFinished(error); +} + +void LogBackend::slot_OOCData(int index, const QString &data) +{ + if ((m_flag != OtherLog && m_flag != CustomLog) || index != m_OOCCurrentIndex) + return; + + if (View == m_sessionType) + emit OOCData(data); +} + +void LogBackend::slot_auditFinished(int index, bool bShowTip) +{ + Q_UNUSED(bShowTip); + + if (m_flag != Audit || index != m_auditCurrentIndex) + return; + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit auditFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } +} + +void LogBackend::slot_auditData(int index, QList list) +{ + if (m_flag != Audit || index != m_auditCurrentIndex) + return; + + aListOrigin.append(list); + aList.append(filterAudit(m_auditFilter, list)); + + if (View == m_sessionType) + emit auditData(aList); +} + +void LogBackend::slot_coredumpFinished(int index) +{ + if (m_flag != COREDUMP || index != m_coredumpCurrentIndex) + return; + + m_isDataLoadComplete = true; + + if (View == m_sessionType) { + emit coredumpFinished(); + } else if (Export == m_sessionType) { + executeCLIExport(); + } else if (Report == m_sessionType) { + int nCount = m_currentCoredumpList.size(); + QDateTime lastTime = LogApplicationHelper::instance()->getLastReportTime(); + QDateTime curTime = QDateTime::currentDateTime(); + if (nCount == 0) { + qCWarning(logBackend) << QString("Report coredump info failed, timeRange: '%1 ---- %2', no matching data.") + .arg(lastTime.toString("yyyy-MM-dd hh:mm:ss")) + .arg(curTime.toString("yyyy-MM-dd hh:mm:ss")); + // 此处退出码不能为-1,否则systemctl --failed服务会将其判为失败的systemd服务 + qApp->exit(0); + } else { + // 统计所有崩溃重复次数 + QJsonObject repeatObj; + QList repeatInfos = Utils::countRepeatCoredumps(); + for (auto i : repeatInfos) { + repeatObj.insert(i.exePath, i.times); + } + + // 更新高频崩溃应用exe路径名单(更新范围为上次上报到当前时间新产生的崩溃信息),并同步到配置文件中 + QList repeatInfoInTimeRange = Utils::countRepeatCoredumps(lastTime.toMSecsSinceEpoch(), curTime.toMSecsSinceEpoch()); + Utils::updateRepeatCoredumpExePaths(repeatInfoInTimeRange); + QStringList repeatCoredumpExePaths = Utils::getRepeatCoredumpExePaths(); + + // 获取最大上报条数 + const int nMaxCoredumpReport = LogApplicationHelper::instance()->getMaxReportCoredump(); + + // 数据清洗,去重 + QList afterCleanData; + for (const auto &data : m_currentCoredumpList) { + if (repeatCoredumpExePaths.indexOf(data.exe) != -1) { + auto it = std::find_if(afterCleanData.begin(), afterCleanData.end(),[&](const LOG_MSG_COREDUMP &item) { + return item.exe == data.exe; + }); + + // 清洗时,只保留最近的一条重复数据 + if (it != afterCleanData.end()) + continue; + } + + afterCleanData.push_back(data); + + // 限制要上报的崩溃数据条数,默认最多上报50条。若nMaxCoredumpReport <= 0,则取消最大上报条数限制 + if (afterCleanData.size() > nMaxCoredumpReport && nMaxCoredumpReport > 0) + break; + } + + // 仅清洗后的数据,才解析崩溃详情数据 + parseCoredumpDetailInfo(afterCleanData); + + // 崩溃数据转json数据 + QJsonArray objList; + QDateTime latestCoredumpTime; + for (auto &data : afterCleanData) { + QDateTime coredumpTime = QDateTime::fromString(data.dateTime, "yyyy-MM-dd hh:mm:ss"); + if (coredumpTime > latestCoredumpTime) + latestCoredumpTime = coredumpTime; + objList.append(data.toJson()); + } + + // 以最近的崩溃时间的下一秒作为下次上报的筛选起始时间 + latestCoredumpTime = latestCoredumpTime.addSecs(1); + + // 先初始化埋点接口,延迟2秒后调用埋点接口,以便能正常写入埋点数据 + Eventlogutils::GetInstance(); + + QTimer::singleShot(2000, this, [=]{ + // 埋点记录崩溃数据 + QJsonObject objCoredumpEvent{ + {"tid", Eventlogutils::ReportCoredump}, + {"version", QCoreApplication::applicationVersion()}, + {"event", "log"}, + {"target", "coredump"}, + {"coredumpListCount", DLDBusHandler::instance()->executeCmd("coredumpctl-list-count").toInt()}, + {"repeatCoredumps", repeatObj}, + {"message", objList} + }; + + Eventlogutils::GetInstance()->writeLogs(objCoredumpEvent); + LogApplicationHelper::instance()->saveLastRerportTime(latestCoredumpTime); + qCInfo(logBackend) << QString("Successfully reported %1 crash messages in total.").arg(afterCleanData.size()); + qApp->exit(0); + }); + } + } +} + +void LogBackend::slot_coredumpData(int index, QList list) +{ + if (m_flag != COREDUMP || index != m_coredumpCurrentIndex) + return; + + m_coredumpList.append(list); + QList filterList = filterCoredump(m_currentSearchStr, list); + m_currentCoredumpList.append(filterList); + + if (View == m_sessionType) + emit coredumpData(m_currentCoredumpList, !filterList.isEmpty()); +} + +void LogBackend::slot_logLoadFailed(const QString &iError) +{ + qCWarning(logBackend) << "parse data failed. error: " << iError; + + if (View == m_sessionType) + emit proccessError(iError); + else if (Export == m_sessionType || Report == m_sessionType) + qApp->exit(-1); +} + +void LogBackend::onExportProgress(int nCur, int nTotal) +{ + if (View == m_sessionType || View == m_lastSessionType) { + bool bExportThreadRunning = false; + + // 获取导出线程对象 + LogExportThread *exportThread = qobject_cast(sender()); + LogSegementExportThread* segementExportThread = qobject_cast(sender()); + if (exportThread) + bExportThreadRunning = exportThread->isProcessing(); + else if (segementExportThread) { + bExportThreadRunning = segementExportThread->isProcessing(); + } + + //如果导出线程不再运行则不处理此信号 + if (!bExportThreadRunning) { + return; + } + + emit sigProgress(nCur, nTotal); + } +} + +void LogBackend::onExportResult(bool isSuccess) +{ + if (View == m_sessionType) { + emit sigResult(isSuccess); + } else if (Export == m_sessionType || Report == m_sessionType) { + if (Export == m_sessionType) + Utils::resetToNormalAuth(m_exportFilePath); + + PERF_PRINT_END("POINT-04", ""); + if (isSuccess) { + qCInfo(logBackend) << "export success."; + qApp->quit(); + } else { + qCWarning(logBackend) << "export failed."; + qApp->exit(-1); + } + } +} + +void LogBackend::onExportFakeCloseDlg() +{ + if (View == m_sessionType) { + emit sigProcessFull(); + } +} + +QList LogBackend::filterBoot(BOOT_FILTERS ibootFilter, const QList &iList) +{ + QList rsList; + bool isStatusFilterEmpty = ibootFilter.statusFilter.isEmpty(); + if (isStatusFilterEmpty && ibootFilter.searchstr.isEmpty()) { + return iList; + } else { + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_BOOT msg = iList.at(i); + QString _statusStr = msg.status; + if ((_statusStr.compare(ibootFilter.statusFilter, Qt::CaseInsensitive) != 0) && !isStatusFilterEmpty) + continue; + if ((msg.status.contains(ibootFilter.searchstr, Qt::CaseInsensitive)) || (msg.msg.contains(ibootFilter.searchstr, Qt::CaseInsensitive))) { + rsList.append(iList[i]); + } + } + } + return rsList; +} + +QList LogBackend::filterNomal(NORMAL_FILTERS inormalFilter, const QList &iList) +{ + QList rsList; + if (inormalFilter.searchstr.isEmpty() && inormalFilter.eventTypeFilter < 0) { + return iList; + } + int tcbx = inormalFilter.eventTypeFilter; + if (0 == tcbx) { + for (auto i = 0; i < iList.size(); i++) { + LOG_MSG_NORMAL msg = iList.at(i); + if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { + rsList.append(msg); + } + } + } else if (1 == tcbx) { + for (auto i = 0; i < iList.size(); i++) { + LOG_MSG_NORMAL msg = iList.at(i); + if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { + if (msg.eventType.compare("Boot", Qt::CaseInsensitive) != 0 && msg.eventType.compare("shutdown", Qt::CaseInsensitive) != 0 && msg.eventType.compare("runlevel", Qt::CaseInsensitive) != 0) + rsList.append(msg); + } + } + } else if (2 == tcbx) { + for (auto i = 0; i < iList.size(); i++) { + LOG_MSG_NORMAL msg = iList.at(i); + if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { + if (iList[i].eventType.compare("Boot", Qt::CaseInsensitive) == 0) + rsList.append(iList[i]); + } + } + } else if (3 == tcbx) { + for (auto i = 0; i < iList.size(); i++) { + LOG_MSG_NORMAL msg = iList.at(i); + if (msg.eventType.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.userName.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.dateTime.contains(inormalFilter.searchstr, Qt::CaseInsensitive) || msg.msg.contains(inormalFilter.searchstr, Qt::CaseInsensitive)) { + if (iList[i].eventType.compare("shutdown", Qt::CaseInsensitive) == 0) + rsList.append(iList[i]); + } + } + } + return rsList; +} + +QList LogBackend::filterDpkg(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_DPKG msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) { + rsList.append(msg); + } + } + return rsList; +} + +QList LogBackend::filterKern(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_JOURNAL msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.hostName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonName.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) { + rsList.append(msg); + } + } + return rsList; +} + +QList LogBackend::filterXorg(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_XORG msg = iList.at(i); + if (msg.offset.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterKwin(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_KWIN msg = iList.at(i); + if (msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterApp(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_APPLICATOIN msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.level.contains(iSearchStr, Qt::CaseInsensitive) || msg.src.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterApp(APP_FILTERS appFilter, const QList &iList) +{ + QList rsList; + if (appFilter.searchstr.isEmpty() && appFilter.submodule.isEmpty()) { + return iList; + } + + if (appFilter.submodule.isEmpty()) { + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_APPLICATOIN msg = iList.at(i); + if (msg.dateTime.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.level.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.src.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.msg.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.subModule.contains(appFilter.searchstr, Qt::CaseInsensitive)) { + rsList.append(msg); + } + } + } else { + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_APPLICATOIN msg = iList.at(i); + if (msg.dateTime.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.level.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.src.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.msg.contains(appFilter.searchstr, Qt::CaseInsensitive) + || msg.subModule.contains(appFilter.searchstr, Qt::CaseInsensitive)) { + if (msg.subModule.compare(appFilter.submodule, Qt::CaseInsensitive) == 0) { + rsList.append(msg); + } + } + } + } + return rsList; +} + +QList LogBackend::filterDnf(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_DNF msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) + || msg.msg.contains(iSearchStr, Qt::CaseInsensitive) + || msg.level.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterDmesg(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_DMESG msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + + return rsList; +} + +QList LogBackend::filterJournal(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_JOURNAL msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.hostName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonId.contains(iSearchStr, Qt::CaseInsensitive) || msg.level.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterJournalBoot(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_JOURNAL msg = iList.at(i); + if (msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) || msg.hostName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonName.contains(iSearchStr, Qt::CaseInsensitive) || msg.daemonId.contains(iSearchStr, Qt::CaseInsensitive) || msg.level.contains(iSearchStr, Qt::CaseInsensitive) || msg.msg.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterOOC(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_FILE_OTHERORCUSTOM msg = iList.at(i); + if (msg.name.contains(iSearchStr, Qt::CaseInsensitive) || msg.path.contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(msg); + } + return rsList; +} + +QList LogBackend::filterAudit(AUDIT_FILTERS auditFilter, const QList &iList) +{ + QList rsList; + if (auditFilter.searchstr.isEmpty() && auditFilter.auditTypeFilter < -1) { + return iList; + } + int nAuditType = auditFilter.auditTypeFilter - 1; + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_AUDIT msg = iList.at(i); + if (msg.contains(auditFilter.searchstr) && (nAuditType == -1 || msg.filterAuditType(nAuditType))) { + rsList.append(msg); + } + } + + return rsList; +} +QList LogBackend::filterCoredump(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) { + return iList; + } + for (int i = 0; i < iList.size(); i++) { + LOG_MSG_COREDUMP msg = iList.at(i); + if (msg.sig.contains(iSearchStr, Qt::CaseInsensitive) + || msg.dateTime.contains(iSearchStr, Qt::CaseInsensitive) + || msg.coreFile.contains(iSearchStr, Qt::CaseInsensitive) + || msg.userName.contains(iSearchStr, Qt::CaseInsensitive) + || msg.exe.contains(iSearchStr, Qt::CaseInsensitive)) { + rsList.append(msg); + } + } + + return rsList; +} + +bool LogBackend::parseData(const LOG_FLAG &flag, const QString &period, const QString &condition) +{ + // 周期类型有效性验证 + BUTTONID periodId = ALL; + if (!period.isEmpty()) { + periodId = period2Enum(period); + if (INVALID == periodId) { + qCWarning(logBackend) << "invalid 'period' parameter: " << period << "\nUSEAGE: all(export all), today(export today), 3d(export past 3 days), 1w(export past week), 1m(export past month), 3m(export past 3 months)"; + return false; + } + } + + // 常规级别有效性判断 + int lId = -1; + if (flag == JOURNAL || flag == Dmesg || flag == BOOT_KLU || flag == APP) { + if (!condition.isEmpty()) { + lId = level2Id(condition); + if (-2 == lId) { + qCWarning(logBackend) << "invalid 'level' parameter: " << condition << "\nUSEAGE: 0(emerg), 1(alert), 2(crit), 3(error), 4(warning), 5(notice), 6(info), 7(debug)"; + return false; + } + } + + } + + // dnf级别有效性判断 + DNFPRIORITY dnfLevel = DNFLVALL; + if (flag == Dnf) { + if (!condition.isEmpty()) { + dnfLevel = dnfLevel2Id(condition); + if (DNFINVALID == dnfLevel) { + qCWarning(logBackend) << "invalid 'level' parameter: " << condition << "\nUSEAGE: 0(supercrit), 1(crit), 2(error), 3(warning), 4(info), 5(debug), 6(trace)"; + return false; + } + } + } + + // boot status有效性判断 + QString statusFilter = ""; + if (flag == BOOT) { + if (!condition.isEmpty()) { + if (condition == "0") + statusFilter = ""; + else if (condition == "ok" || condition == "1") + statusFilter = "OK"; + else if (condition == "failed" || condition == "2") + statusFilter = "Failed"; + else { + qCWarning(logBackend) << "invalid 'status' parameter: " << condition << "\nUSEAGE: 0(export all), 1(export ok), 2(export failed)"; + return false; + } + } + } + + // boot-shutdown-event event类型有效性判断 + int normalEventType = -1; + if (flag == Normal) { + if (!condition.isEmpty()) { + normalEventType = normal2eventType(condition); + if (-1 == normalEventType) { + qCWarning(logBackend) << "invalid 'event' parameter: " << condition << "\nUSEAGE: 0(export all), 1(export login), 2(export boot), 3(shutdown)"; + return false; + } + } + } + + // audit event有效性判断 + int auditType = 0; + if (flag == Audit) { + if (!condition.isEmpty()) { + auditType = audit2eventType(condition); + if (-1 == auditType) { + qCWarning(logBackend) << "invalid 'event' parameter: " << condition << "\nUSEAGE: 0(all), 1(ident auth), 2(discretionary access Contro), 3(mandatory access control), 4(remote), 5(doc audit), 6(other)"; + return false; + } + } + } + + qCInfo(logBackend) << "parsing ..." << "period:" << period << "condition:" << condition << "keyword:" << m_currentSearchStr; + + TIME_RANGE timeRange = getTimeRange(periodId); + + // 设置筛选条件,解析数据 + switch (flag) { + case JOURNAL: { + QStringList arg; + if (lId != LVALL) { + QString prio = QString("PRIORITY=%1").arg(lId); + arg.append(prio); + } else { + arg.append("all"); + } + + if (timeRange.begin != -1 && timeRange.end != -1) { + arg << QString::number(timeRange.begin * 1000) << QString::number(timeRange.end *1000); + } + + m_journalCurrentIndex = m_logFileParser.parseByJournal(arg); + } + break; + case Dmesg: { + DMESG_FILTERS dmesgfilter; + dmesgfilter.levelFilter = static_cast(lId); + dmesgfilter.timeFilter = timeRange.begin; + if (periodId == ALL) + dmesgfilter.timeFilter = 0; + + m_logFileParser.parseByDmesg(dmesgfilter); + } + break; + case KERN: { + LOG_FILTER_BASE filter; + filter.type = flag; + filter.filePath = "kern"; + filter.timeFilterBegin = timeRange.begin; + filter.timeFilterEnd = timeRange.end; + filter.segementIndex = 0; + m_type2Filter[flag] = filter; + + m_type2ThreadIndex[flag] = m_logFileParser.parse(filter); + } + break; + case BOOT_KLU: { + QStringList arg; + if (lId != LVALL) { + QString prio = QString("PRIORITY=%1").arg(lId); + arg.append(prio); + } else { + arg.append("all"); + } + + m_journalBootCurrentIndex = m_logFileParser.parseByJournalBoot(arg); + } + break; + case BOOT: { + m_bootFilter.searchstr = m_currentSearchStr; + m_bootFilter.statusFilter = statusFilter; + + m_bootCurrentIndex = m_logFileParser.parseByBoot(); + } + break; + case DPKG: { + DKPG_FILTERS dpkgFilter; + dpkgFilter.timeFilterBegin = timeRange.begin; + dpkgFilter.timeFilterEnd = timeRange.end; + m_dpkgCurrentIndex = m_logFileParser.parseByDpkg(dpkgFilter); + } + break; + case Dnf: { + DNF_FILTERS dnffilter; + dnffilter.levelfilter = dnfLevel; + dnffilter.timeFilter = timeRange.begin; + if (periodId == ALL) + dnffilter.timeFilter = 0; + + m_logFileParser.parseByDnf(dnffilter); + } + break; + case Kwin: { + LOG_FILTER_BASE filter; + filter.type = flag; + filter.segementIndex = 0; + m_type2Filter[flag] = filter; + + m_type2ThreadIndex[flag] = m_logFileParser.parse(filter); + } + break; + case XORG: { + XORG_FILTERS xorgFilter; + m_xorgCurrentIndex = m_logFileParser.parseByXlog(xorgFilter); + } + break; + case APP: { + // TODO 待实现 + } + break; + case COREDUMP: { + COREDUMP_FILTERS coreFilter; + coreFilter.timeFilterBegin = timeRange.begin; + coreFilter.timeFilterEnd = timeRange.end; + m_coredumpCurrentIndex = m_logFileParser.parseByCoredump(coreFilter); + } + break; + case Normal: { + m_normalFilter.searchstr = m_currentSearchStr; + m_normalFilter.timeFilterBegin = timeRange.begin; + m_normalFilter.timeFilterEnd = timeRange.end; + m_normalFilter.eventTypeFilter = normalEventType; + m_normalCurrentIndex = m_logFileParser.parseByNormal(m_normalFilter); + } + break; + case Audit: { + m_auditFilter.searchstr = m_currentSearchStr; + m_auditFilter.timeFilterBegin = timeRange.begin; + m_auditFilter.timeFilterEnd = timeRange.end; + m_auditFilter.auditTypeFilter = auditType; + m_auditCurrentIndex = m_logFileParser.parseByAudit(m_auditFilter); + } + break; + default: + break; + } + + return true; +} + +void LogBackend::executeCLIExport(const QString &originFilePath) +{ + if (!m_isDataLoadComplete) + return; + + QString filePath = originFilePath; + if (originFilePath.isEmpty()) { + QString outPath = m_outPath; + switch (m_flag) { + case JOURNAL: { + filePath = outPath + "/system.txt"; + } + break; + case Dmesg: { + filePath = outPath + "/dmesg.txt"; + } + break; + case KERN: { + filePath = outPath + "/kernel.txt"; + } + break; + case BOOT_KLU: { + filePath = outPath + "/boot_klu.txt"; + } + break; + case BOOT: { + filePath = outPath + "/boot.txt"; + } + break; + case DPKG: { + filePath = outPath + "/dpkg.txt"; + } + break; + case Dnf: { + filePath = outPath + "/dnf.txt"; + } + break; + case Kwin: { + filePath = outPath + "/kwin.txt"; + } + break; + case XORG: { + filePath = outPath + "/xorg.txt"; + } + break; + case APP: { + filePath = outPath + QString("/%1.txt").arg(m_appFilter.app); + } + break; + case COREDUMP: { + filePath = outPath + "/coredump.zip"; + } + break; + case Normal: { + filePath = outPath + "/boot-shutdown-event.txt"; + } + break; + case Audit: { + filePath = outPath + "/audit.txt"; + } + break; + default: + break; + } + } + + exportLogData(filePath); +} + +void LogBackend::resetCategoryOutputPath(const QString &path) +{ + // 先清空原有路径中的kernel日志文件 + QDir dir(path); + dir.removeRecursively(); + + // 创建目录 + Utils::mkMutiDir(path); +} + +QString LogBackend::getOutDirPath() const +{ + return m_outPath; +} + +bool LogBackend::getOutDirPath(const QString &path) +{ + if (path == m_outPath) + return true; + + QString tmpPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + if (!path.isEmpty()) + tmpPath = QDir::isRelativePath(path) ? (m_cmdWorkDir + "/" + path) : path; + + // 若指定目录不存在,先创建目录 + QDir dir(tmpPath); + if (!dir.exists()) { + dir.mkpath(dir.absolutePath()); + m_newDir = dir.exists(); + if (m_newDir) + tmpPath = dir.absolutePath(); + } else { + tmpPath = dir.absolutePath(); + } + + if (dir.exists()) { + QFileInfo fi(tmpPath); + if (!fi.isWritable()) { + qCWarning(logBackend) << QString("outPath: %1 is not writable.").arg(tmpPath); + return false; + } + + // 导出路径白名单检查 + QStringList availablePaths = DLDBusHandler::instance()->whiteListOutPaths(); + bool bAvailable = false; + for (auto path : availablePaths) { + if (tmpPath.startsWith(path)) { + bAvailable = true; + break; + } + } + if (!bAvailable) { + qCWarning(logBackend) << qApp->translate("ExportMessage", "The export directory is not available. Please choose another directory for the export operation."); + qCWarning(logBackend) << "outPath: " << tmpPath; + return false; + } + + m_outPath = tmpPath; + qCInfo(logBackend) << "outPath:" << m_outPath; + return true; + } else { + m_outPath = ""; + qCWarning(logBackend) << QString("outpath:%1 is not exist.").arg(path); + } + + return false; +} + +LOG_FLAG LogBackend::type2Flag(const QString &type, QString& error) +{ + Dtk::Core::DSysInfo::UosEdition edition = Dtk::Core::DSysInfo::uosEditionType(); + bool isCentos = Dtk::Core::DSysInfo::UosEuler == edition || Dtk::Core::DSysInfo::UosEnterpriseC == edition || Dtk::Core::DSysInfo::UosMilitaryS == edition; + + LOG_FLAG flag = NONE; + if (type == TYPE_SYSTEM) + flag = JOURNAL; + else if (type == TYPE_KERNEL) { + if (isCentos) + flag = Dmesg; + else + flag = KERN; + } else if (type == TYPE_BOOT) { + if (Utils::isWayland()) + flag = BOOT_KLU; + else + flag = BOOT; + } else if (type == TYPE_DPKG) { + if (!isCentos) + flag = DPKG; + else + error = "Server industry edition has no dpkg.log"; + } else if (type == TYPE_DNF) { + if (isCentos) + flag = Dnf; + else + error = "Only server industry edition has dnf.log"; + } else if (type == TYPE_KWIN) { + if (Utils::isWayland()) + flag = Kwin; + else + error = "Only wayland platform has kwin.log"; + } else if (type == TYPE_XORG) { + if (!Utils::isWayland()) + flag = XORG; + else + error = "Wayland platform has no Xorg.log"; + } else if (type == TYPE_APP) { + flag = APP; + } else if (type == TYPE_COREDUMP) { + flag = COREDUMP; + } else if (type == TYPE_BSE) { + flag = Normal; + } else if (type == TYPE_OTHER) { + flag = OtherLog; + } else if (type == TYPE_CUSTOM) { + flag = CustomLog; + } else if (type == TYPE_AUDIT) { + flag = Audit; + } else { + flag = NONE; + error = QString("Unknown type: %1.").arg(type) + "USEAGE: system(journal log), kernel(kernel log), boot(boot log), dpkg(dpkg log), dnf(dnf log), kwin(Kwin log), xorg(Xorg log), app(deepin app log), coredump(coredump log)、boot-shutdown-event(boot shutdown event log)、other(other log)、custom(custom log)、audit(audit log)"; + } + + return flag; +} + +bool LogBackend::reportCoredumpInfo() +{ + qCDebug(logBackend) << "ready report coredump."; + + m_flag = COREDUMP; + m_currentSearchStr = ""; + m_sessionType = Report; + + // 增量上报,每次上报,仅上报新增的崩溃信息,根据时间范围筛选出目标数据 + COREDUMP_FILTERS coreFilter; + QDateTime lastTime = LogApplicationHelper::instance()->getLastReportTime(); + QDateTime curTime = QDateTime::currentDateTime(); + + // 异常的上次上报时间纠错 + if (lastTime > curTime) { + qCWarning(logBackend) << QString("last report time:[%1] is invalid, reset to %2").arg(lastTime.toString("yyyy-MM-dd hh:mm:ss")).arg(curTime.toString("yyyy-MM-dd hh:mm:ss")); + lastTime = curTime; + LogApplicationHelper::instance()->saveLastRerportTime(curTime); + } + + if (!lastTime.isValid()) { + TIME_RANGE timeRange = getTimeRange(ALL); + coreFilter.timeFilterBegin = timeRange.begin; + coreFilter.timeFilterEnd = timeRange.end; + } else { + coreFilter.timeFilterBegin = lastTime.toMSecsSinceEpoch(); + coreFilter.timeFilterEnd = QDateTime::currentDateTime().toMSecsSinceEpoch(); + } + + m_coredumpCurrentIndex = m_logFileParser.parseByCoredump(coreFilter, true); + + return true; +} + +void LogBackend::setFlag(const LOG_FLAG &flag) +{ + m_flag = flag; +} + +/** + * @brief DisplayContent::clearAllFilter 清空当前所有的筛选条件成员变量(只限在本类中筛选的条件) + */ +void LogBackend::clearAllFilter() +{ + m_type2Filter.clear(); + + m_bootFilter = {"", ""}; + m_currentSearchStr.clear(); + m_bootFilter.searchstr = ""; + m_normalFilter.clear(); + m_appFilter.clear(); + m_auditFilter.clear(); +} + +/** + * @brief DisplayContent::clearAllDatalist 清空所有获取的数据list + */ +void LogBackend::clearAllDatalist() +{ + m_type2LogData.clear(); + m_type2LogDataOrigin.clear(); + + jList.clear(); + jListOrigin.clear(); + dList.clear(); + dListOrigin.clear(); + xList.clear(); + xListOrigin.clear(); + bList.clear(); + currentBootList.clear(); + kList.clear(); + kListOrigin.clear(); + appList.clear(); + appListOrigin.clear(); + norList.clear(); + nortempList.clear(); + m_currentKwinList.clear(); + m_kwinList.clear(); + jBootList.clear(); + jBootListOrigin.clear(); + dnfList.clear(); + dnfListOrigin.clear(); + oList.clear(); + oListOrigin.clear(); + cList.clear(); + cListOrigin.clear(); + aList.clear(); + aListOrigin.clear(); + m_coredumpList.clear(); + m_currentCoredumpList.clear(); + malloc_trim(0); +} + +void LogBackend::parse(LOG_FILTER_BASE &filter) +{ + m_type2ThreadIndex[filter.type] = m_logFileParser.parse(filter); + m_type2Filter[filter.type] = filter; +} + +void LogBackend::parseByJournal(const QStringList &arg) +{ + m_journalCurrentIndex = m_logFileParser.parseByJournal(arg); +} + +void LogBackend::parseByJournalBoot(const QStringList &arg) +{ + m_journalBootCurrentIndex = m_logFileParser.parseByJournalBoot(arg); +} + +void LogBackend::parseByDpkg(const DKPG_FILTERS &iDpkgFilter) +{ + m_dpkgCurrentIndex = m_logFileParser.parseByDpkg(iDpkgFilter); +} + +void LogBackend::parseByXlog(const XORG_FILTERS &iXorgFilter) +{ + m_xorgCurrentIndex = m_logFileParser.parseByXlog(iXorgFilter); +} + +void LogBackend::parseByBoot() +{ + m_bootCurrentIndex = m_logFileParser.parseByBoot(); +} + +void LogBackend::parseByKern(const KERN_FILTERS &iKernFilter) +{ + m_kernCurrentIndex = m_logFileParser.parseByKern(iKernFilter); +} + +void LogBackend::parseByApp(const APP_FILTERS &iAPPFilter) +{ + m_appCurrentIndex = m_logFileParser.parseByApp(iAPPFilter); +} + +void LogBackend::parseByDnf(DNF_FILTERS iDnfFilter) +{ + m_logFileParser.parseByDnf(iDnfFilter); +} + +void LogBackend::parseByDmesg(DMESG_FILTERS iDmesgFilter) +{ + m_logFileParser.parseByDmesg(iDmesgFilter); +} + +void LogBackend::parseByNormal(const NORMAL_FILTERS &iNormalFiler) +{ + m_normalCurrentIndex = m_logFileParser.parseByNormal(iNormalFiler); +} + +void LogBackend::parseByKwin(const KWIN_FILTERS &iKwinfilter) +{ + m_kwinCurrentIndex = m_logFileParser.parseByKwin(iKwinfilter); +} + +void LogBackend::parseByOOC(const QString &path) +{ + m_OOCCurrentIndex = m_logFileParser.parseByOOC(path); +} + +void LogBackend::parseByAudit(const AUDIT_FILTERS &iAuditFilter) +{ + m_auditCurrentIndex = m_logFileParser.parseByAudit(iAuditFilter); +} + +void LogBackend::parseByCoredump(const COREDUMP_FILTERS &iCoredumpFilter, bool parseMap) +{ + m_coredumpCurrentIndex = m_logFileParser.parseByCoredump(iCoredumpFilter, parseMap); +} + +int LogBackend::loadSegementPage(int nSegementIndex, bool bReset/* = true*/) +{ + if(nSegementIndex == -1) + return -1; + + if (bReset) { + clearAllDatalist(); + } else { + // 搜索结果存在各分段数据只有几条的情况,因此进行分段搜索加载时,不能清空历史数据 + if (m_type2LogDataOrigin[m_flag].size() > SEGEMENT_SIZE) + m_type2LogDataOrigin[m_flag].clear(); + if (m_type2LogData[m_flag].size() > SEGEMENT_SIZE) + m_type2LogData[m_flag].clear(); + } + + m_type2Filter[m_flag].segementIndex = nSegementIndex; + parse(m_type2Filter[m_flag]); + + qCDebug(logBackend) << QString("load seagement index: %1").arg(nSegementIndex); + return nSegementIndex; +} + +int LogBackend::getNextSegementIndex(LOG_FLAG type, bool bNext/* = true*/) +{ + qint64 totalLineCount = 0; + int nSegementIndex = -1; + if (type == KERN) { + QStringList filePaths = DLDBusHandler::instance(this)->getFileInfo("kern"); + for (auto file: filePaths) { + totalLineCount += DLDBusHandler::instance(this)->getLineCount(file); + } + } else if (type == Kwin) { + totalLineCount = DLDBusHandler::instance(this)->getLineCount(KWIN_TREE_DATA); + } + + // 计算分段段数 + m_segementCount = static_cast(totalLineCount / SEGEMENT_SIZE) + 1; + + qint64 currentLineCount = (m_type2Filter[type].segementIndex + (bNext ? 1 : 0)) * SEGEMENT_SIZE; + + if (totalLineCount > currentLineCount) { + if (bNext) + nSegementIndex = ++m_type2Filter[type].segementIndex; + else if (currentLineCount > 0){ + nSegementIndex = --m_type2Filter[type].segementIndex; + } + } + + return nSegementIndex; +} + +void LogBackend::exportLogData(const QString &filePath, const QStringList &strLabels) +{ + // 不是追加导出,则先清除原文件 + if (!m_bSegementExporting && QFile::exists(filePath)) { + QFile::remove(filePath); + } + + QFileInfo fi(filePath.left(filePath.lastIndexOf("/"))); + if (!fi.exists() || filePath.isEmpty()) { + qWarning(logBackend) << QString("outdir:%1 is not exists.").arg(fi.absoluteFilePath()); + onExportResult(false); + return; + } + if (!fi.isWritable()) { + onExportResult(false); + qCCritical(logBackend) << QString("outdir:%1 is not writable.").arg(fi.absoluteFilePath()); + return; + } + + if (View != m_sessionType) { + if (!hasMatchedData(m_flag)) { + if (m_bSegementExporting) { + // 分段导出时,某段未匹配到数据,也是正常的 + return; + } else { + qCWarning(logBackend) << "No matching data.."; + qApp->exit(-1); + return; + } + } + } + + QStringList labels = strLabels; + if (labels.isEmpty()) + labels = getLabels(m_flag); + + if ((m_flag == KERN || m_flag == Kwin)) { + // 初始化分段导出线程 + if (!m_pSegementExportThread) { + m_pSegementExportThread = new LogSegementExportThread(this); + m_pSegementExportThread->enableAppendWrite(); + // 导出到doc,最后一步写入文件耗时较长,总进度条需要额外+1 + if (filePath.endsWith(".doc")) + m_pSegementExportThread->setTotalProcess(m_segementCount + 1); + else + m_pSegementExportThread->setTotalProcess(m_segementCount); + connect(m_pSegementExportThread, &LogSegementExportThread::sigResult, this, &LogBackend::onExportResult); + connect(m_pSegementExportThread, &LogSegementExportThread::sigProgress, this, &LogBackend::onExportProgress); + connect(m_pSegementExportThread, &LogSegementExportThread::sigProcessFull, this, &LogBackend::onExportFakeCloseDlg); + connect(this, &LogBackend::stopExport, m_pSegementExportThread, &LogSegementExportThread::stopImmediately); + QThreadPool::globalInstance()->start(m_pSegementExportThread); + } + + m_pSegementExportThread->setParameter(filePath, m_type2LogData[m_flag], labels, m_flag); + } else { + LogExportThread *exportThread = new LogExportThread(this); + connect(exportThread, &LogExportThread::sigResult, this, &LogBackend::onExportResult); + connect(exportThread, &LogExportThread::sigProgress, this, &LogBackend::onExportProgress); + connect(exportThread, &LogExportThread::sigProcessFull, this, &LogBackend::onExportFakeCloseDlg); + connect(this, &LogBackend::stopExport, exportThread, &LogExportThread::stopImmediately); + + // 分段导出需要激活追加导出标记 + exportThread->enableAppendExport(m_bSegementExporting); + + if (filePath.endsWith(".txt")) { + switch (m_flag) { + //根据导出日志类型执行正确的导出逻辑 + case JOURNAL: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(jList.count())); + exportThread->exportToTxtPublic(filePath, jList, labels, m_flag); + break; + case BOOT_KLU: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(jBootList.count())); + exportThread->exportToTxtPublic(filePath, jBootList, labels, JOURNAL); + break; + case APP: { + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(appList.count())); + QString transAppName = LogApplicationHelper::instance()->transName(m_appFilter.app); + exportThread->exportToTxtPublic(filePath, appList, labels, transAppName); + break; + } + case DPKG: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dList.count())); + exportThread->exportToTxtPublic(filePath, dList, labels); + break; + case BOOT: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(currentBootList.count())); + exportThread->exportToTxtPublic(filePath, currentBootList, labels); + break; + case XORG: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(xList.count())); + exportThread->exportToTxtPublic(filePath, xList, labels); + break; + case Normal: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(nortempList.count())); + exportThread->exportToTxtPublic(filePath, nortempList, labels); + break; + case KERN: + case Kwin: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(m_type2LogData[m_flag].count())); + exportThread->exportToTxtPublic(filePath, m_type2LogData[m_flag], labels, m_flag); + break; + case Dmesg: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); + exportThread->exportToTxtPublic(filePath, dmesgList, labels); + break; + case Dnf: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); + exportThread->exportToTxtPublic(filePath, dnfList, labels); + break; + case Audit: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(aList.count())); + exportThread->exportToTxtPublic(filePath, aList, labels); + break; + default: + break; + } + QThreadPool::globalInstance()->start(exportThread); + } else if (filePath.endsWith(".html")) { + switch (m_flag) { + case JOURNAL: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(jList.count())); + exportThread->exportToHtmlPublic(filePath, jList, labels, m_flag); + break; + case BOOT_KLU: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(jBootList.count())); + exportThread->exportToHtmlPublic(filePath, jBootList, labels, JOURNAL); + break; + case APP: { + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(appList.count())); + QString transAppName = LogApplicationHelper::instance()->transName(m_appFilter.app); + exportThread->exportToHtmlPublic(filePath, appList, labels, transAppName); + break; + } + case DPKG: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(dList.count())); + exportThread->exportToHtmlPublic(filePath, dList, labels); + break; + case BOOT: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(currentBootList.count())); + exportThread->exportToHtmlPublic(filePath, currentBootList, labels); + break; + case XORG: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(xList.count())); + exportThread->exportToHtmlPublic(filePath, xList, labels); + break; + case Normal: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(nortempList.count())); + exportThread->exportToHtmlPublic(filePath, nortempList, labels); + break; + case KERN: + case Kwin: + PERF_PRINT_BEGIN("POINT-04", QString("format=html count=%1").arg(m_type2LogData[m_flag].count())); + exportThread->exportToHtmlPublic(filePath, m_type2LogData[m_flag], labels, m_flag); + break; + case Dmesg: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); + exportThread->exportToHtmlPublic(filePath, dmesgList, labels); + break; + case Dnf: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); + exportThread->exportToHtmlPublic(filePath, dnfList, labels); + break; + case Audit: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(aList.count())); + exportThread->exportToHtmlPublic(filePath, aList, labels); + break; + default: + break; + } + QThreadPool::globalInstance()->start(exportThread); + } else if (filePath.endsWith(".doc")) { + switch (m_flag) { + case JOURNAL: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(jList.count())); + exportThread->exportToDocPublic(filePath, jList, labels, m_flag); + break; + case BOOT_KLU: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(jBootList.count())); + exportThread->exportToDocPublic(filePath, jBootList, labels, JOURNAL); + break; + case APP: { + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(appList.count())); + QString transAppName = LogApplicationHelper::instance()->transName(m_appFilter.app); + exportThread->exportToDocPublic(filePath, appList, labels, transAppName); + break; + } + case DPKG: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(dList.count())); + exportThread->exportToDocPublic(filePath, dList, labels); + break; + case BOOT: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(currentBootList.count())); + exportThread->exportToDocPublic(filePath, currentBootList, labels); + break; + case XORG: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(xList.count())); + exportThread->exportToDocPublic(filePath, xList, labels); + break; + case Normal: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(nortempList.count())); + exportThread->exportToDocPublic(filePath, nortempList, labels); + break; + case KERN: + case Kwin: + PERF_PRINT_BEGIN("POINT-04", QString("format=doc count=%1").arg(m_type2LogData[m_flag].count())); + exportThread->exportToDocPublic(filePath, m_type2LogData[m_flag], labels, m_flag); + break; + case Dmesg: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); + exportThread->exportToDocPublic(filePath, dmesgList, labels); + break; + case Dnf: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); + exportThread->exportToDocPublic(filePath, dnfList, labels); + break; + case Audit: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(aList.count())); + exportThread->exportToDocPublic(filePath, aList, labels); + break; + default: + break; + } + QThreadPool::globalInstance()->start(exportThread); + } else if (filePath.endsWith(".xls")) { + switch (m_flag) { + case JOURNAL: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(jList.count())); + exportThread->exportToXlsPublic(filePath, jList, labels, m_flag); + break; + case BOOT_KLU: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(jBootList.count())); + exportThread->exportToXlsPublic(filePath, jBootList, labels, JOURNAL); + break; + case APP: { + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(appList.count())); + QString transAppName = LogApplicationHelper::instance()->transName(m_appFilter.app); + exportThread->exportToXlsPublic(filePath, appList, labels, transAppName); + break; + } + case DPKG: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(dList.count())); + exportThread->exportToXlsPublic(filePath, dList, labels); + break; + case BOOT: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(currentBootList.count())); + exportThread->exportToXlsPublic(filePath, currentBootList, labels); + break; + case XORG: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(xList.count())); + exportThread->exportToXlsPublic(filePath, xList, labels); + break; + case Normal: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(nortempList.count())); + exportThread->exportToXlsPublic(filePath, nortempList, labels); + break; + case KERN: + case Kwin: + PERF_PRINT_BEGIN("POINT-04", QString("format=xls count=%1").arg(m_type2LogData[m_flag].count())); + exportThread->exportToXlsPublic(filePath, m_type2LogData[m_flag], labels, m_flag); + break; + case Dmesg: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dmesgList.count())); + exportThread->exportToXlsPublic(filePath, dmesgList, labels); + break; + case Dnf: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(dnfList.count())); + exportThread->exportToXlsPublic(filePath, dnfList, labels); + break; + case Audit: + PERF_PRINT_BEGIN("POINT-04", QString("format=txt count=%1").arg(aList.count())); + exportThread->exportToXlsPublic(filePath, aList, labels); + break; + default: + break; + } + QThreadPool::globalInstance()->start(exportThread); + } else if (filePath.endsWith(".zip") && m_flag == COREDUMP) { + PERF_PRINT_BEGIN("POINT-04", QString("format=zip count=%1").arg(m_currentCoredumpList.count())); + exportThread->exportToZipPublic(filePath, m_currentCoredumpList, labels); + QThreadPool::globalInstance()->start(exportThread); + } + } + + m_exportFilePath = filePath; + + qCInfo(logBackend) << "exporting ..."; +} + +void LogBackend::segementExport() +{ + if (m_flag != KERN && m_flag != Kwin) + return; + + // 判断是否需要分段导出 + int nSegementIndex = getNextSegementIndex(m_flag); + m_bSegementExporting = nSegementIndex != -1; + + // 解析下一段数据 + if (nSegementIndex != -1) { + // 记录任务状态 + if (View == m_sessionType) { + m_lastSessionType = m_sessionType; + m_sessionType = Export; + } + loadSegementPage(nSegementIndex); + } else { + if (m_pSegementExportThread) { + // 结束分段导出线程,保存数据到文件 + m_pSegementExportThread->stop(); + m_pSegementExportThread = nullptr; + } + + // 分段导出完成,还原任务状态 + if (View == m_lastSessionType || View == m_sessionType) { + m_sessionType = View; + // 还原查看界面数据内容到导第一分段页 + emit clearTable(); + loadSegementPage(0); + } + } +} + +void LogBackend::stopExportFromUI() +{ + emit stopExport(); + + //若界面正在分段导出,则停止导出 + // TODO: 分段导出情况下,ExportThread::stopImmediately槽函数不能正常触发,暂时先这样修改 + if (Export == m_sessionType) { + if (View == m_lastSessionType) { + m_sessionType = View; + // 线程在收到emit stopExport时,即调用stopImmediately接口停止运行,并自行析构 + // 因此只需对其置空, 不用delete + if (m_pSegementExportThread) { + m_pSegementExportThread = nullptr; + } + + // 重置进度条 + emit sigProgress(0, 0); + + m_bSegementExporting = false; + Utils::checkAndDeleteDir(m_exportFilePath); + + // 重置回第一分段页 + emit clearTable(); + loadSegementPage(0); + } + } +} + +QList LogBackend::filterLog(const QString &iSearchStr, const QList &iList) +{ + QList rsList; + if (iSearchStr.isEmpty()) + return iList; + + QJsonParseError parseError; + for (auto data : iList) { + QJsonDocument document = QJsonDocument::fromJson(data.toUtf8(), &parseError); + if (parseError.error == QJsonParseError::NoError) { + if (document.isObject()) { + QJsonObject object = document.object(); + for (auto it = object.constBegin(); it != object.end(); ++it) { + if (it.value().toString().contains(iSearchStr, Qt::CaseInsensitive)) + rsList.append(data); + } + } + } + } + + return rsList; +} + +BUTTONID LogBackend::period2Enum(const QString &period) +{ + BUTTONID id = INVALID; + if (period == "all") + id = ALL; + else if (period == "today") + id = ONE_DAY; + else if (period == "3d") + id = THREE_DAYS; + else if (period == "1w") + id = ONE_WEEK; + else if (period == "1m") + id = ONE_MONTH; + else if (period == "3m") + id = THREE_MONTHS; + + return id; +} + +int LogBackend::level2Id(const QString &level) +{ + int lId = -2; + if (level == "debug" || level == "7") + lId = 7; + if (level == "info" || level == "6") + lId = 6; + else if (level == "notice" || level == "5") + lId = 5; + else if (level == "warning" || level == "4") + lId = 4; + else if (level == "err" || level == "error" || level == "3") + lId = 3; + else if (level == "critical" || level == "crit" || level == "2") + lId = 2; + else if (level == "alert" || level == "1") + lId = 1; + else if (level == "emerg" || level == "0") + lId = 0; + else if (level == "all") + lId = -1; + else if (level.isEmpty()) + lId = -1; + + return lId; +} + +DNFPRIORITY LogBackend::dnfLevel2Id(const QString &level) +{ + DNFPRIORITY eId = DNFINVALID; + if (level == "trace" || level == "6") + eId = TRACE; + else if (level == "debug" || level == "5") + eId = DEBUG; + else if (level == "info" || level == "4") + eId = INFO; + else if (level == "warning" || level == "3") + eId = WARNING; + else if (level == "error" || level == "err" || level == "2") + eId = ERROR; + else if (level == "critical" || level == "crit" || level == "1") + eId = CRITICAL; + else if (level == "supercritical" || level == "supercrit" || level == "0") + eId = SUPERCRITICAL; + else if (level == "all") + eId = DNFLVALL; + else if (level.isEmpty()) + eId = DNFLVALL; + + return eId; +} + +int LogBackend::normal2eventType(const QString &eventType) +{ + int type = -1; + if (eventType == "all" || eventType == "0") + type = 0; + else if (eventType == "login" || eventType == "1") + type = 1; + else if (eventType == "boot" || eventType == "2") + type = 2; + else if (eventType == "shutdown" || eventType == "3") + type = 3; + + return type; +} + +int LogBackend::audit2eventType(const QString &eventType) +{ + int type = -1; + if (eventType == "all" || eventType == "0") + type = 0; + else if (eventType == "identauth" || eventType == "1") + type = 1; + else if (eventType == "dac" || eventType == "2") + type = 2; + else if (eventType == "mac" || eventType == "3") + type = 3; + else if (eventType == "remote" || eventType == "4") + type = 4; + else if (eventType == "docaudit" || eventType == "5") + type = 5; + else if (eventType == "other" || eventType == "6") + type = 6; + + return type; +} + +TIME_RANGE LogBackend::getTimeRange(const BUTTONID &periodId) +{ + TIME_RANGE tr; + + QDateTime dtStart = QDateTime::currentDateTime(); + QDateTime dtEnd = dtStart; + dtStart.setTime(QTime()); + dtEnd.setTime(QTime(23, 59, 59, 999)); + tr.end = dtEnd.toMSecsSinceEpoch(); + + switch (periodId) { + case ALL: { + tr.begin = -1; + tr.end = -1; + } + break; + case ONE_DAY: { + tr.begin = dtStart.toMSecsSinceEpoch(); + } + break; + case THREE_DAYS: { + tr.begin = dtStart.addDays(-2).toMSecsSinceEpoch(); + } + break; + case ONE_WEEK: { + tr.begin = dtStart.addDays(-6).toMSecsSinceEpoch(); + } + break; + case ONE_MONTH: { + tr.begin = dtStart.addMonths(-1).toMSecsSinceEpoch(); + if (m_flag == Dmesg || m_flag == Dnf) { + tr.begin = dtStart.addDays(-29).toMSecsSinceEpoch(); + } + } + break; + case THREE_MONTHS: { + tr.begin = dtStart.addMonths(-3).toMSecsSinceEpoch(); + if (m_flag == Dmesg || m_flag == Dnf) { + tr.begin = dtStart.addDays(-89).toMSecsSinceEpoch(); + } + } + break; + default: { + tr.begin = -1; + tr.end = -1; + } + break; + } + + return tr; +} + +QString LogBackend::getApplogPath(const QString &appName) +{ + QString logPath; + QMap appData = LogApplicationHelper::instance()->getMap(); + for (auto &it2 : appData.toStdMap()) { + if (it2.second.contains(appName)) { + logPath = it2.second; + break; + } + } + + if (logPath.isEmpty()) + logPath = LogApplicationHelper::instance()->getPathByAppId(appName); + + return logPath; +} + +QStringList LogBackend::getLabels(const LOG_FLAG &flag) +{ + QStringList labels = QStringList(); + switch (flag) { + case JOURNAL: { + labels << QCoreApplication::translate("Table", "Level") + << QCoreApplication::translate("Table", "Process") // modified by Airy + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Info") + << QCoreApplication::translate("Table", "User") + << QCoreApplication::translate("Table", "PID"); + } + break; + case Dmesg: { + labels << QCoreApplication::translate("Table", "Level") + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Info"); + } + break; + case KERN: { + labels << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "User") + << QCoreApplication::translate("Table", "Process") + << QCoreApplication::translate("Table", "Info"); + } + break; + case BOOT_KLU: { + labels << QCoreApplication::translate("Table", "Level") + << QCoreApplication::translate("Table", "Process") + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Info") + << QCoreApplication::translate("Table", "User") + << QCoreApplication::translate("Table", "PID"); + } + break; + case BOOT: { + labels << QCoreApplication::translate("Table", "Status") + << QCoreApplication::translate("Table", "Info"); + } + break; + case DPKG: { + labels << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Info") + << QCoreApplication::translate("Table", "Action"); + } + break; + case Dnf: { + labels << QCoreApplication::translate("Table", "Level") + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Info"); + } + break; + case Kwin: { + labels << QCoreApplication::translate("Table", "Info"); + } + break; + case XORG: { + labels << QCoreApplication::translate("Table", "Offset") + << QCoreApplication::translate("Table", "Info"); + } + break; + case APP: { + labels << QCoreApplication::translate("Table", "Level") + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Source") + << QCoreApplication::translate("Table", "Info"); + } + break; + case COREDUMP: { + labels << QCoreApplication::translate("Table", "SIG") + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Core File") + << QCoreApplication::translate("Table", "User Name ") + << QCoreApplication::translate("Table", "EXE"); + } + break; + case Normal: { + labels << QCoreApplication::translate("Table", "Event Type") + << QCoreApplication::translate("Table", "Username") + << QCoreApplication::translate("Tbble", "Date and Time") + << QCoreApplication::translate("Table", "Info"); + } + break; + case Audit: { + labels << QCoreApplication::translate("Table", "Event Type") + << QCoreApplication::translate("Table", "Date and Time") + << QCoreApplication::translate("Table", "Process") + << QCoreApplication::translate("Table", "Status") + << QCoreApplication::translate("Table", "Info"); + } + break; + default: + break; + } + + return labels; +} + +bool LogBackend::hasMatchedData(const LOG_FLAG &flag) +{ + bool bMatchedData = false; + switch (flag) { + case JOURNAL: { + if (!jList.isEmpty()) { + bMatchedData = true; + } + } + break; + case Dmesg: { + if (!dmesgList.isEmpty()) { + bMatchedData = true; + } + } + break; + case Kwin: + case KERN: { + if (!m_type2LogData[flag].isEmpty()) { + bMatchedData = true; + } + } + break; + case BOOT_KLU: { + if (!jBootList.isEmpty()) { + bMatchedData = true; + } + } + break; + case BOOT: { + if (!currentBootList.isEmpty()) { + bMatchedData = true; + } + } + break; + case DPKG: { + if (!dList.isEmpty()) { + bMatchedData = true; + } + } + break; + case Dnf: { + if (!dnfList.isEmpty()) { + bMatchedData = true; + } + } + break; + case XORG: { + if (!xList.isEmpty()) { + bMatchedData = true; + } + } + break; + case APP: { + if (!appList.isEmpty()) { + bMatchedData = true; + } + } + break; + case COREDUMP: { + if (!m_currentCoredumpList.isEmpty()) { + bMatchedData = true; + } + } + break; + case Normal: { + if (!nortempList.isEmpty()) { + bMatchedData = true; + } + } + break; + case Audit: { + if (!aList.isEmpty()) { + bMatchedData = true; + } + } + break; + default: + break; + } + + return bMatchedData; +} + +void LogBackend::parseCoredumpDetailInfo(QList &list) +{ + QProcess process; + for (auto &data : list) { + QDateTime coredumpTime = QDateTime::fromString(data.dateTime, "yyyy-MM-dd hh:mm:ss"); + // 解析coredump文件保存位置 + if (data.coreFile != "missing") { + QString outInfoByte; + // get maps info + const QString &corePath = QDir::tempPath() + QString("/%1.dump").arg(QFileInfo(data.storagePath).fileName()); + DLDBusHandler::instance()->readLog(QString("coredumpctl dump %1 -o %2").arg(data.pid).arg(corePath)); + outInfoByte = DLDBusHandler::instance()->readLog(QString("readelf -n %1").arg(corePath)); + + data.maps = outInfoByte; + + // 获取二进制文件信息 + process.start("/bin/bash", QStringList() << "-c" << QString("file %1").arg(data.exe)); + process.waitForFinished(-1); + outInfoByte = process.readAllStandardOutput(); + if (!outInfoByte.isEmpty()) + data.binaryInfo = outInfoByte; + + // 获取包名 + process.start("/bin/bash", QStringList() << "-c" << QString("dpkg -S %1").arg(data.exe)); + process.waitForFinished(-1); + outInfoByte = process.readAllStandardOutput(); + // 获取版本号 + if (!outInfoByte.isEmpty()) { + QString str = outInfoByte; + process.start("/bin/bash", QStringList() << "-c" << QString("dpkg-query --show %1").arg(str.split(":").first())); + process.waitForFinished(-1); + outInfoByte = process.readAllStandardOutput(); + if (!outInfoByte.isEmpty()) { + data.packgeVersion = QString(outInfoByte).simplified(); + } + } + } + + // 若为窗管崩溃,提取窗管最后100行日志到coredump信息中 + if (data.exe == KWAYLAND_EXE_PATH || data.exe == XWAYLAND_EXE_PATH) { + // 窗管日志存放在用户家目录下,因此根据崩溃信息所属用户id获取用户家目录 + uint userId = data.uid.toUInt(); + QString userHomePath = Utils::getUserHomePathByUID(userId); + if (!userHomePath.isEmpty()) { + if (data.exe == KWAYLAND_EXE_PATH) { + data.appLog = DLDBusHandler::instance()->readLogLinesInRange(QString("%1/.kwin-old.log").arg(userHomePath), 0, KWIN_LASTLINE_NUM).join('\n'); + if (!data.appLog.isEmpty()) + qCInfo(logBackend) << QString("kwin crash log:%1").arg(data.appLog); + } else if (data.exe == XWAYLAND_EXE_PATH) { + data.appLog = DLDBusHandler::instance()->readLogLinesInRange(QString("%1/.xwayland.log.old").arg(userHomePath), KWIN_LASTLINE_NUM).join('\n'); + } + } else { + qCWarning(logBackend) << QString("uid:%1 homepath is empty.").arg(userId); + } + } + } +} diff --git a/application/logbackend.h b/application/logbackend.h new file mode 100644 index 00000000..36802b7b --- /dev/null +++ b/application/logbackend.h @@ -0,0 +1,415 @@ +// SPDX-FileCopyrightText: 2023 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef LOGBACKEND_H +#define LOGBACKEND_H + +#include "structdef.h" +#include "logfileparser.h" + +#include + +class LogFileParser; +class LogExportThread; +class LogSegementExportThread; +class LogBackend : public QObject +{ + Q_OBJECT + +public: + enum SessionType + { + Unknown = -1, + View, + Export, + Report + }; + + static LogBackend *instance(QObject *parent = nullptr); + ~LogBackend(); + explicit LogBackend(QObject *parent = nullptr); + + // 设置命令行当前工作目录 + void setCmdWorkDir(const QString &dirPath); + + // 导出全部日志到指定目录 + int exportAllLogs(const QString &outDir = ""); + + // 按类型导出日志 + int exportTypeLogs(const QString &outDir, const QString &type = ""); + + // 按条件导出日志 + // condition 可能为级别、事件类型、状态、审计类型等条件 + bool exportTypeLogsByCondition(const QString &outDir, const QString &type, const QString &period, const QString &condition = "", const QString &keyword = ""); + + // 按应用导出日志 + int exportAppLogs(const QString &outDir, const QString &appName = ""); + + // 按条件导出应用日志 + bool exportAppLogsByCondition(const QString &outDir, const QString& appName, const QString &period, const QString &level = "", const QString &submodule = "", const QString &keyword = ""); + + // 获取当前系统支持的日志种类 + QStringList getLogTypes(); + + QString getOutDirPath() const; + + static LOG_FLAG type2Flag(const QString &type, QString &error); + + bool reportCoredumpInfo(); + + + // Gui日志数据展示功能相关接口 + // 设置日志类型 + void setFlag(const LOG_FLAG& flag); + + // 清理日志筛选条件 + void clearAllFilter(); + + // 清理日志数据缓存 + void clearAllDatalist(); + + // 解析日志通用新接口,便于后续扩展和维护 + void parse(LOG_FILTER_BASE& filter); + + // 解析日志相关接口 + void parseByJournal(const QStringList &arg = QStringList()); + void parseByJournalBoot(const QStringList &arg = QStringList()); + + void parseByDpkg(const DKPG_FILTERS &iDpkgFilter); + + void parseByXlog(const XORG_FILTERS &iXorgFilter); + void parseByBoot(); + void parseByKern(const KERN_FILTERS &iKernFilter); + void parseByApp(const APP_FILTERS &iAPPFilter); + void parseByDnf(DNF_FILTERS iDnfFilter); + void parseByDmesg(DMESG_FILTERS iDmesgFilter); + void parseByNormal(const NORMAL_FILTERS &iNormalFiler); + + void parseByKwin(const KWIN_FILTERS &iKwinfilter); + void parseByOOC(const QString &path); + + void parseByAudit(const AUDIT_FILTERS &iAuditFilter); + + void parseByCoredump(const COREDUMP_FILTERS &iCoredumpFilter, bool parseMap = false); + + int loadSegementPage(int nSegementIndex, bool bReset = true); + // 分段加载,向上/向下滚动,计算分段索引 bNext为true,计算向下滚动后的分段索引 + int getNextSegementIndex(LOG_FLAG type, bool bNext = true); + + void exportLogData(const QString &filePath, const QStringList &strLabels = QStringList()); + void segementExport(); + void stopExportFromUI(); + + // 日志过滤相关接口 + static QList filterLog(const QString &iSearchStr, const QList &iList); + static QList filterBoot(BOOT_FILTERS ibootFilter, const QList &iList); + static QList filterNomal(NORMAL_FILTERS inormalFilter, const QList &iList); + static QList filterDpkg(const QString &iSearchStr, const QList &iList); + static QList filterKern(const QString &iSearchStr, const QList &iList); + static QList filterXorg(const QString &iSearchStr, const QList &iList); + static QList filterKwin(const QString &iSearchStr, const QList &iList); + static QList filterApp(const QString &iSearchStr, const QList &iList); + static QList filterApp(APP_FILTERS appFilter, const QList &iList); + static QList filterDnf(const QString &iSearchStr, const QList &iList); + static QList filterDmesg(const QString &iSearchStr, const QList &iList); + static QList filterJournal(const QString &iSearchStr, const QList &iList); + static QList filterJournalBoot(const QString &iSearchStr, const QList &iList); + static QList filterOOC(const QString &iSearchStr, const QList &iList); + static QList filterAudit(AUDIT_FILTERS auditFilter, const QList &iList); + static QList filterCoredump(const QString &iSearchStr, const QList &iList); + + +private: + static LogBackend *m_staticbackend; + +signals: + + // Json格式的日志数据处理接口 + void parseFinished(LOG_FLAG type, int status = 0); + void logData(const QList& list, LOG_FLAG type); + void stopExport(); + void clearTable(); + // 解析器路由信号 + void dpkgFinished(); + void dpkgData(const QList&); + void xlogFinished(); + void xlogData(const QList&); + void bootFinished(); + void bootData(const QList&); + void kernFinished(); + void kernData(const QList&); + void dnfFinished(const QList&); + void dmesgFinished(const QList&); + void journalFinished(); + void journalBootFinished(); + void journalData(const QList&); + void journaBootlData(const QList&); + + //void normalFinished(); // add by Airy + + void normalFinished(); + void normalData(const QList&); + void kwinFinished(); + void kwinData(const QList &iKwinList); + /** + * @brief appFinished 获取数据结束信号 + */ + void appFinished(); + void appData(const QList &iDataList); + void OOCFinished(int error = 0); + void OOCData(const QString &data); + + void auditFinished(bool bShowTip = false); + void auditData(const QList&); + + void coredumpFinished(); + void coredumpData(const QList &iDataList, bool newData = true); + + /** + * @brief proccessError 获取日志文件失败错误信息传递信号,传递到主界面显示 DMessage tooltip + * @param iError 错误字符 + */ + void proccessError(const QString &iError); + + + // 导出线程路由信号 + /** + * @brief sigProgress 导出进度信号 + * @param nCur 当前运行到的进度 + * @param nTotal 要运行的总数 + */ + void sigProgress(int nCur, int nTotal); + /** + * @brief sigResult 导出完成信号 + * @param isSuccess 是否成功 + */ + void sigResult(bool isSuccess); + void sigProcessFull(); +private slots: + void slot_parseFinished(int index, LOG_FLAG type, int status); + void slot_logData(int index, const QList &list, LOG_FLAG type); + void slot_dpkgFinished(int index); + void slot_dpkgData(int index, QList list); + void slot_XorgFinished(int index); + void slot_xorgData(int index, QList list); + void slot_bootFinished(int index); + void slot_bootData(int index, QList list); + void slot_kernFinished(int index); + void slot_kernData(int index, QList list); + void slot_kwinFinished(int index); + void slot_kwinData(int index, QList list); + void slot_dnfFinished(const QList &list); + void slot_dmesgFinished(const QList &list); + void slot_journalFinished(int index); + void slot_journalBootFinished(int index); + void slot_journalBootData(int index, QList list); + void slot_journalData(int index, QList list); + void slot_applicationFinished(int index); + void slot_applicationData(int index, QList list); + void slot_normalFinished(int index); + void slot_normalData(int index, QList list); + void slot_OOCFinished(int index, int error = 0); + void slot_OOCData(int index, const QString & data); + void slot_auditFinished(int index, bool bShowTip = false); + void slot_auditData(int index, QList list); + void slot_coredumpFinished(int index); + void slot_coredumpData(int index, QList list); + + void slot_logLoadFailed(const QString &iError); + + void onExportProgress(int nCur, int nTotal); + void onExportResult(bool isSuccess); + void onExportFakeCloseDlg(); + +private: + void initConnections(); + + // cli导出功能相关接口 + bool parseData(const LOG_FLAG &flag, const QString &period, const QString &condition); + + void executeCLIExport(const QString &originFilePath = ""); + + void resetCategoryOutputPath(const QString & path); + bool getOutDirPath(const QString &path); + BUTTONID period2Enum(const QString &period); + int level2Id(const QString &level); + DNFPRIORITY dnfLevel2Id(const QString &level); + int normal2eventType(const QString &eventType); + int audit2eventType(const QString &eventType); + TIME_RANGE getTimeRange(const BUTTONID& periodId); + QString getApplogPath(const QString &appName); + QStringList getLabels(const LOG_FLAG &flag); + bool hasMatchedData(const LOG_FLAG &flag); + void parseCoredumpDetailInfo(QList& list); + +private: + QStringList m_logTypes; + bool m_newDir {false}; + QString m_outPath {""}; + QString m_cmdWorkDir {""}; + + QString m_exportFilePath {""}; + +public: + + // 日志种类-----解析线程index 键值对 + QMap m_type2ThreadIndex; + + // 日志种类-----原始日志数据键值对 --为了统一日志数据存储方式,日志数据按json字串存储 + QMap> m_type2LogDataOrigin; + + // 日志种类-----筛选后日志数据键值对 --为了统一日志数据存储方式,日志数据按json字串存储 + QMap> m_type2LogData; + + // 日志种类-----筛选条件 + QMap m_type2Filter; + + // 筛选条件 + /** + * @brief m_journalFilter 当前系统日志筛选条件 + */ + JOURNAL_FILTERS m_journalFilter; + /** + * @brief m_normalFilter 开关机日志当前筛选条件 + */ + NORMAL_FILTERS m_normalFilter; + //启动日志当前筛选条件 + BOOT_FILTERS m_bootFilter = {"", ""}; + // 应用日志当前筛选条件 + APP_FILTERS m_appFilter; + /** + * @brief m_auditFilter 当前审计日志筛选条件 + */ + AUDIT_FILTERS m_auditFilter; + + //当前搜索关键字 + QString m_currentSearchStr {""}; + + + + // 日志缓存数据 + /** + * @brief jBootList 经过筛选完成的启动日志列表 + */ + /** + * @brief jBootListOrigin 未经过筛选的启动日志数据 journalctl --boot cmd. + */ + QList jBootList, jBootListOrigin; + + // System log data + QList jList, jListOrigin; + // Dmesg log data + QList dmesgList, dmesgListOrigin; + + QList dnfList, dnfListOrigin; //dnf.log + /** + * @brief dList 经过筛选完成的dpkg日志数据 + */ + /** + * @brief dListOrigin 未经过筛选的dpkg日志数据 dpkg.log + */ + QList dList, dListOrigin; + /** + * @brief xList 经过筛选完成的xorg日志数据 + */ + /** + * @brief xListOrigin 未经过筛选的xorg日志数据 Xorg.0.log + */ + QList xList, xListOrigin; + /** + * @brief currentBootList 经过筛选完成的启动日志数据 + */ + /** + * @brief bList 未经过筛选的启动日志数据 boot.log + */ + QList bList, currentBootList; + /** + * @brief kList 经过筛选完成的内核日志数据 + */ + /** + * @brief kListOrigin 未经过筛选的内核日志数据 kern.log + */ + QList kList, kListOrigin; + + /** + * @brief oList未经过筛选的其他日志数据 other + */ + QList oList, oListOrigin; + + /** + * @brief cList未经过筛选的自定义日志数据 custom + */ + QList cList, cListOrigin; + + /** + * @brief aListOrigin 未经过筛选的审计日志数据 audit/audit.log + */ + QList aList, aListOrigin; + + /** + * @brief appListOrigin 未经过筛选的内核日志数据 ~/.cache/deepin/xxx.log(.xxx) + */ + QList appList, appListOrigin; + /** + * @brief norList add 未经过筛选完成的开关机日志数据 by Airy + */ + QList norList; + /** + * @brief nortempList 经过筛选的开关机日志数据 add by Airy + */ + QList nortempList; + /** + * @brief m_currentKwinList add 经过筛选完成的kwin日志数据 by Airy /$HOME/.kwin.log + */ + QList m_currentKwinList; + /** + * @brief m_kwinList 未经过筛选的开关机日志数据 + */ + QList m_kwinList; + + + QList m_coredumpList; + QList m_currentCoredumpList; + +private: + + /** + * @brief m_curAppLog 当前选中的应用项目名称 + */ + QString m_curApp {""}; + + SessionType m_sessionType { View }; + SessionType m_lastSessionType { Unknown }; + int m_lastSegementIndex { -1 }; + bool m_bSegementExporting {false}; + int m_segementCount { 0 }; + + //当前解析的日志类型 + LOG_FLAG m_flag {NONE}; + + // 分段导出线程,用来导出doc、xls格式的日志 + LogSegementExportThread *m_pSegementExportThread { nullptr }; + // 日志解析器 + LogFileParser m_logFileParser; + + //当前系统日志获取进程标记量 + int m_journalCurrentIndex {-1}; + //当前klu启动日志获取进程标记量 + int m_journalBootCurrentIndex {-1}; + //当前启动日志获取进程标记量 + int m_bootCurrentIndex {-1}; + int m_dpkgCurrentIndex {-1}; + int m_kernCurrentIndex {-1}; + int m_normalCurrentIndex {-1}; + int m_xorgCurrentIndex {-1}; + int m_kwinCurrentIndex {-1}; + int m_appCurrentIndex {-1}; + int m_OOCCurrentIndex {-1}; + int m_auditCurrentIndex {-1}; + int m_coredumpCurrentIndex {-1}; + + bool m_isDataLoadComplete {false}; +}; + +#endif // LOGBACKEND_H diff --git a/application/logcollectormain.cpp b/application/logcollectormain.cpp index b4a49592..c42d4f08 100644 --- a/application/logcollectormain.cpp +++ b/application/logcollectormain.cpp @@ -9,10 +9,15 @@ #include "logallexportthread.h" #include "exportprogressdlg.h" +#include "dbusmanager.h" + +#include + #include #include #include #include +#include #include #include @@ -51,6 +56,7 @@ LogCollectorMain::LogCollectorMain(QWidget *parent) setMinimumSize(MAINWINDOW_WIDTH, MAINWINDOW_HEIGHT); //恢复上次关闭时记录的窗口大小 resize(LogSettings::instance()->getConfigWinSize()); + Utils::m_mapAuditType2EventType = LogSettings::instance()->loadAuditMap(); } /** @@ -133,16 +139,18 @@ void LogCollectorMain::initUI() this->setCentralWidget(new DWidget()); - m_hLayout = new QHBoxLayout(this); + m_hLayout = new QHBoxLayout(); /** left frame */ m_logCatelogue = new LogListView(); m_logCatelogue->setObjectName("logTypeSelectList"); + m_logCatelogue->setAccessibleName("left_side_bar"); m_hLayout->addWidget(m_logCatelogue, 1); m_logCatelogue->setFixedWidth(160); m_vLayout = new QVBoxLayout; /** topRight frame */ m_topRightWgt = new FilterContent(); + m_topRightWgt->setAccessibleName("filterWidget"); m_vLayout->addWidget(m_topRightWgt); /** midRight frame */ m_midRightWgt = new DisplayContent(); @@ -155,6 +163,7 @@ void LogCollectorMain::initUI() m_hLayout->setContentsMargins(0, 0, 10, 0); m_hLayout->setSpacing(10); + this->centralWidget()->setAccessibleName("centralWidget"); this->centralWidget()->setLayout(m_hLayout); m_searchEdt->setObjectName("searchEdt"); m_searchEdt->lineEdit()->setObjectName("searchChildEdt"); @@ -172,6 +181,7 @@ void LogCollectorMain::initTitlebarExtensions() { DMenu *refreshMenu = new DMenu(this); DMenu *menu = new DMenu(DApplication::translate("titlebar", "Refresh interval"), refreshMenu); + menu->setAccessibleName("refresh_interval_menu"); m_refreshActions.push_back(menu->addAction(qApp->translate("titlebar", "10 sec"))); m_refreshActions.push_back(menu->addAction(qApp->translate("titlebar", "1 min"))); m_refreshActions.push_back(menu->addAction(qApp->translate("titlebar", "5 min"))); @@ -203,11 +213,13 @@ void LogCollectorMain::initTitlebarExtensions() m_exportAllBtn->setIcon(QIcon::fromTheme("export")); m_exportAllBtn->setIconSize(QSize(36, 36)); m_exportAllBtn->setToolTip(qApp->translate("titlebar", "Export All")); + m_exportAllBtn->setAccessibleName(qApp->translate("titlebar", "Export All")); m_refreshBtn = new DIconButton(widget); m_refreshBtn->setIcon(QIcon::fromTheme("refresh")); m_refreshBtn->setFixedSize(QSize(36, 36)); m_refreshBtn->setIconSize(QSize(36, 36)); m_refreshBtn->setToolTip(qApp->translate("titlebar", "Refresh Now")); + m_refreshBtn->setAccessibleName(qApp->translate("titlebar", "Refresh Now")); layout->addSpacing(115); layout->addWidget(m_exportAllBtn); layout->addSpacing(2); @@ -271,7 +283,7 @@ void LogCollectorMain::initSettings() if (!dir.exists()) { Utils::mkMutiDir(configpath); }; - m_backend = new QSettingBackend(dir.filePath("config.conf"), m_settings); + m_backend = new QSettingBackend(dir.filePath("config.conf")); m_settings->setBackend(m_backend); } @@ -279,17 +291,52 @@ void LogCollectorMain::exportAllLogs() { static bool authorization = false; if (false == authorization) { - if (!Utils::checkAuthorization("com.deepin.pkexec.logViewerAuth.exportLogs", qApp->applicationPid())) { + QString policyActionId = ""; + // 开启等保四,若当前用户是审计管理员,使用单用户审计管理员鉴权 + if (DBusManager::isSEOpen() && DBusManager::isAuditAdmin()) + policyActionId = "com.deepin.pkexec.logViewerAuth.exportLogsSelf"; + else + // 其他情况,默认为多用户鉴权 + policyActionId = "com.deepin.pkexec.logViewerAuth.exportLogs"; + + if (!Utils::checkAuthorization(policyActionId, qApp->applicationPid())) { return; } authorization = true; } + + // 时间 + QString dateTime = QDateTime::currentDateTime().toString("yyyyMMddHHmmss"); + // 主机名 + utsname _utsname; + uname(&_utsname); + QString hostname = QString(_utsname.nodename); + static QString defaultDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); - static QString fileFullPath = defaultDir + "/" + qApp->translate("titlebar", "System Logs") + ".zip"; + QString fileFullPath = defaultDir + "/" + QString("%1_%2_all_logs.zip").arg(dateTime).arg(hostname); QString newPath = DFileDialog::getSaveFileName(this, "", fileFullPath, "*.zip"); if (newPath.isEmpty()) { return; } + + // 导出路径白名单检查 + QFileInfo info(newPath); + QString outPath = info.path(); + QStringList availablePaths = DLDBusHandler::instance(this)->whiteListOutPaths(); + + bool bAvailable = false; + for (auto path : availablePaths) { + if (outPath.startsWith(path)) { + bAvailable = true; + break; + } + } + if (!bAvailable) { + QString titleIcon = ICONPREFIX; + DMessageManager::instance()->sendMessage(this->window(), QIcon(titleIcon + "warning_info.svg"), DApplication::translate("ExportMessage", "The export directory is not available. Please choose another directory for the export operation.")); + return; + } + //添加文件后缀 if (!newPath.endsWith(".zip")) { newPath += ".zip"; @@ -336,6 +383,8 @@ void LogCollectorMain::initConnection() &DisplayContent::slot_dnfLevel); connect(m_topRightWgt, &FilterContent::sigCbxAppIdxChanged, m_midRightWgt, &DisplayContent::slot_appLogs); + connect(m_topRightWgt, &FilterContent::sigCbxSubModuleChanged, m_midRightWgt, + &DisplayContent::slot_getSubmodule); // add by Airy connect(m_topRightWgt, &FilterContent::sigExportInfo, m_midRightWgt, &DisplayContent::slot_exportClicked); @@ -346,6 +395,9 @@ void LogCollectorMain::initConnection() connect(m_topRightWgt, &FilterContent::sigLogtypeChanged, m_midRightWgt, &DisplayContent::slot_getLogtype); // add by Airy + connect(m_topRightWgt, &FilterContent::sigAuditTypeChanged, m_midRightWgt, + &DisplayContent::slot_getAuditType); + connect(m_topRightWgt, &FilterContent::sigCbxAppIdxChanged, m_logCatelogue, &LogListView::slot_getAppPath); // add by Airy for getting app path connect(m_midRightWgt, &DisplayContent::setExportEnable, m_topRightWgt, diff --git a/application/logcombox.cpp b/application/logcombox.cpp index 10b5173b..77c2c859 100644 --- a/application/logcombox.cpp +++ b/application/logcombox.cpp @@ -85,7 +85,6 @@ void LogCombox::keyPressEvent(QKeyEvent *event) void LogCombox::focusInEvent(QFocusEvent *event) { if (event->reason() != Qt::PopupFocusReason) { - qDebug() << __FUNCTION__ << event->reason(); m_reson = event->reason(); } DComboBox::focusInEvent(event); diff --git a/application/logdetailinfowidget.cpp b/application/logdetailinfowidget.cpp index edac5462..be609393 100644 --- a/application/logdetailinfowidget.cpp +++ b/application/logdetailinfowidget.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -69,6 +69,8 @@ void logDetailInfoWidget::cleanText() m_nameLabel->hide(); m_event->hide(); m_eventLabel->hide(); + + m_errorLabel->hide(); } /** @@ -161,6 +163,14 @@ void logDetailInfoWidget::initUI() m_nameLabel = new DLabel(DApplication::translate("Label", "Username:"), this); // add by Airy DFontSizeManager::instance()->bind(m_nameLabel, DFontSizeManager::T7); + m_errorLabel = new DLabel("", this); + m_errorLabel->setMinimumWidth(70); + m_errorLabel->setMinimumHeight(20); + DFontSizeManager::instance()->bind(m_userLabel, DFontSizeManager::T7); + pa = DApplicationHelper::instance()->palette(m_errorLabel); + // pa.setBrush(DPalette::WindowText, QColor(85,85,85,0.40)); + pa.setBrush(DPalette::WindowText, pa.color(DPalette::PlaceholderText)); + DApplicationHelper::instance()->setPalette(m_errorLabel, pa); m_hline = new DHorizontalLine; @@ -175,39 +185,39 @@ void logDetailInfoWidget::initUI() cleanText(); - QVBoxLayout *v = new QVBoxLayout(this); + m_bottomLayer = new QVBoxLayout(this); - QHBoxLayout *h1 = new QHBoxLayout(this); + QHBoxLayout *h1 = new QHBoxLayout(); h1->addWidget(m_daemonName); h1->addStretch(1); h1->addWidget(m_dateTime); - QHBoxLayout *h2 = new QHBoxLayout(this); + QHBoxLayout *h2 = new QHBoxLayout(); - QHBoxLayout *h21 = new QHBoxLayout(this); + QHBoxLayout *h21 = new QHBoxLayout(); h21->addWidget(m_userLabel); h21->addWidget(m_userName, 1); h21->setSpacing(0); - QHBoxLayout *h22 = new QHBoxLayout(this); + QHBoxLayout *h22 = new QHBoxLayout(); h22->addWidget(m_pidLabel); h22->addWidget(m_pid, 1); h22->setSpacing(0); - QHBoxLayout *h23 = new QHBoxLayout(this); + QHBoxLayout *h23 = new QHBoxLayout(); h23->addWidget(m_statusLabel); h23->addWidget(m_status, 1); h23->setSpacing(0); - QHBoxLayout *h24 = new QHBoxLayout(this); + QHBoxLayout *h24 = new QHBoxLayout(); h24->addWidget(m_actionLabel); h24->addWidget(m_action, 1); h24->setSpacing(0); // add by Airy - QHBoxLayout *h25 = new QHBoxLayout(this); + QHBoxLayout *h25 = new QHBoxLayout(); h25->addWidget(m_eventLabel); h25->addWidget(m_event, 1); h25->setSpacing(8); - QHBoxLayout *h26 = new QHBoxLayout(this); + QHBoxLayout *h26 = new QHBoxLayout(); h26->addWidget(m_nameLabel); h26->addWidget(m_name, 1); h26->setSpacing(8); @@ -224,15 +234,16 @@ void logDetailInfoWidget::initUI() h2->addWidget(m_level); h2->setSpacing(20); - v->addLayout(h1); - v->addLayout(h2); - v->addWidget(m_hline); - v->addWidget(m_textBrowser, 3); + m_bottomLayer->addLayout(h1); + m_bottomLayer->addLayout(h2); + m_bottomLayer->addWidget(m_hline); + m_bottomLayer->addWidget(m_textBrowser, 3); + m_bottomLayer->addWidget(m_errorLabel, 0, Qt::AlignCenter); - v->setContentsMargins(20, 10, 20, 0); - v->setSpacing(4); + m_bottomLayer->setContentsMargins(20, 10, 20, 0); + m_bottomLayer->setSpacing(4); - this->setLayout(v); + this->setLayout(m_bottomLayer); } void logDetailInfoWidget::setTextCustomSize(QWidget *w) @@ -297,6 +308,7 @@ void logDetailInfoWidget::fillDetailInfo(QString deamonName, QString usrName, QS QString event) { m_hline->show(); + m_errorLabel->hide(); if (deamonName.isEmpty()) { m_daemonName->hide(); } else { @@ -318,7 +330,7 @@ void logDetailInfoWidget::fillDetailInfo(QString deamonName, QString usrName, QS } else { m_dateTime->show(); QStringList dtlist = dateTime.split("."); - if (dtlist.count() == 2) + if (dtlist.count() == 2 && deamonName != "Xorg") m_dateTime->setText(dtlist[0]); else m_dateTime->setText(dateTime); @@ -379,10 +391,12 @@ void logDetailInfoWidget::fillDetailInfo(QString deamonName, QString usrName, QS } // end + m_bottomLayer->setContentsMargins(20, 10, 20, 0); m_textBrowser->setText(msg); + m_textBrowser->show(); } -void logDetailInfoWidget::fillOOCDetailInfo(const QString & data) +void logDetailInfoWidget::fillOOCDetailInfo(const QString &data, const int error) { m_daemonName->hide(); m_dateTime->hide(); @@ -402,7 +416,16 @@ void logDetailInfoWidget::fillOOCDetailInfo(const QString & data) m_nameLabel->hide(); m_eventLabel->hide(); - m_textBrowser->setText(data); + m_bottomLayer->setContentsMargins(20, 10, 0, 0); + if (error == 0) { + m_textBrowser->setText(data); + m_textBrowser->show(); + m_errorLabel->hide(); + } else { + m_textBrowser->hide(); + m_errorLabel->show(); + m_errorLabel->setText(data); + } } /** @@ -412,7 +435,7 @@ void logDetailInfoWidget::fillOOCDetailInfo(const QString & data) * @param name 应用日志的应用名称 */ void logDetailInfoWidget::slot_DetailInfo(const QModelIndex &index, QStandardItemModel *pModel, - QString data) + const QString &data, const int error) { cleanText(); @@ -494,6 +517,20 @@ void logDetailInfoWidget::slot_DetailInfo(const QModelIndex &index, QStandardIte fillDetailInfo("kernel", hostname, "", index.siblingAtColumn(1).data().toString(), index, index.siblingAtColumn(2).data().toString()); } else if (dataStr.contains(OOC_TABLE_DATA)) { - fillOOCDetailInfo(data); + fillOOCDetailInfo(data, error); + } else if (dataStr.contains(AUDIT_TABLE_DATA)) { + fillDetailInfo("audit", hostname, "", index.siblingAtColumn(1).data().toString(), QModelIndex(), + index.siblingAtColumn(4).data().toString(), + index.siblingAtColumn(3).data().toString(), + "", + "", + index.siblingAtColumn(0).data().toString()); + } else if (dataStr.contains(COREDUMP_TABLE_DATA)) { + fillDetailInfo(index.siblingAtColumn(3).data().toString(), hostname, "", index.siblingAtColumn(1).data().toString(), QModelIndex(), + index.siblingAtColumn(4).data(Qt::UserRole + 2).toString(), + index.siblingAtColumn(2).data().toString(), + "", + "", + ""); } } diff --git a/application/logdetailinfowidget.h b/application/logdetailinfowidget.h index 6b65afc3..430cfef7 100644 --- a/application/logdetailinfowidget.h +++ b/application/logdetailinfowidget.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,6 +6,7 @@ #define LOGDETAILINFOWIDGET_H #include "logiconbutton.h" #include "logdetailedit.h" +#include "structdef.h" #include #include @@ -17,6 +18,7 @@ DWIDGET_USE_NAMESPACE class QStandardItemModel; +class QVBoxLayout; /** * @brief The logDetailInfoWidget class 详情页控件 */ @@ -38,12 +40,12 @@ class logDetailInfoWidget : public Dtk::Widget::DWidget QModelIndex level, QString msg, QString status = "", QString action = "", QString uname = "", QString event = ""); // modified by Airy //其他日志或者自定义日志数据显示 - void fillOOCDetailInfo(const QString & data); + void fillOOCDetailInfo(const QString &data, const int error = 0); protected: void paintEvent(QPaintEvent *event) override; public slots: - void slot_DetailInfo(const QModelIndex &index, QStandardItemModel *pModel, QString data); + void slot_DetailInfo(const QModelIndex &index, QStandardItemModel *pModel, const QString &data, const int error); private: //m_daemonName:进程名显示控件 m_dateTime:时间显示控件 m_userName:用户名显示控件 m_pid:进程号显示控件 m_action:动作显示控件 m_status:状态显示控件 m_name:开关机日志用户名显示控件 m_event: 开关机日志时间类型显示 @@ -54,7 +56,7 @@ public slots: */ LogIconButton *m_level; Dtk::Widget::DLabel *m_userLabel, *m_pidLabel, *m_statusLabel, *m_actionLabel, *m_nameLabel, - *m_eventLabel; // modified by Airy + *m_eventLabel, *m_errorLabel; // modified by Airy /** * @brief m_textBrowser 日志信息显示控件 */ @@ -67,6 +69,10 @@ public slots: * @brief m_pModel 当前主表的model */ QStandardItemModel *m_pModel; + /** + * @brief m_bottomLayer 底部框 + */ + QVBoxLayout *m_bottomLayer; }; #endif // LOGDETAILINFOWIDGET_H diff --git a/application/logexportthread.cpp b/application/logexportthread.cpp index 79962b8c..969dbd62 100644 --- a/application/logexportthread.cpp +++ b/application/logexportthread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -7,6 +7,7 @@ #include "xlsxwriter.h" #include "WordProcessingMerger.h" #include "WordProcessingCompiler.h" +#include "dbusproxy/dldbushandler.h" #include @@ -17,18 +18,27 @@ #include #include #include +#include +#include +#include #include DWIDGET_USE_NAMESPACE +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logExport, "org.deepin.log.viewer.export.work") +#else +Q_LOGGING_CATEGORY(logExport, "org.deepin.log.viewer.export.work", QtInfoMsg) +#endif + /** * @brief LogExportThread::LogExportThread 导出日志线程类构造函数 * @param parent 父对象 */ -LogExportThread::LogExportThread(bool &isDataComplete, QObject *parent) +LogExportThread::LogExportThread(QObject *parent) : QObject(parent), QRunnable(), - m_allLoadComplete(isDataComplete) + m_appendExport(false) { setAutoDelete(true); initMap(); @@ -42,13 +52,21 @@ LogExportThread::~LogExportThread() malloc_trim(0); } +/** + * @brief LogExportThread::enableAppendExport 是否追加导出 + */ +void LogExportThread::enableAppendExport(bool bEnable/* = true*/) +{ + m_appendExport = bEnable; +} + /** * @brief LogExportThread::exportToTxtPublic 导出到日志txt格式配置函数对QStandardItemModel数据类型的重载 * @param fileName 导出文件路径全称 * @param pModel 要导出的数据源,为QStandardItemModel * @param flag 导出的日志类型 */ -void LogExportThread::exportToTxtPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag) +void LogExportThread::exportToTxtPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag) { m_fileName = fileName; m_pModel = pModel; @@ -57,6 +75,23 @@ void LogExportThread::exportToTxtPublic(QString fileName, QStandardItemModel *pM m_canRunning = true; } +/** + * @brief LogExportThread::exportToTxtPublic 导出到日志txt格式配置函数,对Json数据类型的重载(内核日志、窗管日志等) + * @param fileName 导出文件路径全称 + * @param jList 要导出的数据源 数据类型为QString + * @param labels 表头字符串 + * @param flag 导出的日志类型 + */ +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) +{ + m_fileName = fileName; + m_logDataList = jList; + m_runMode = TxtJOURNAL; + m_labels = labels; + m_flag = flag; + m_canRunning = true; +} + /** * @brief LogExportThread::exportToTxtPublic 导出到日志txt格式配置函数,对LOG_MSG_JOURNAL数据类型的重载(指系统日志和内核日志) * @param fileName 导出文件路径全称 @@ -64,7 +99,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QStandardItemModel *pM * @param labels 表头字符串 * @param flag 导出的日志类型 */ -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG flag) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) { m_fileName = fileName; m_jList = jList; @@ -82,7 +117,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList * @param labels 表头字符串 * @param iAppName 导出的应用日志的应用名称 */ -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels, QString &iAppName) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName) { m_fileName = fileName; m_appList = jList; @@ -98,7 +133,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dpkgList = jList; @@ -113,7 +148,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_BOOT * @param labels 表头字符串 */ -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_bootList = jList; @@ -128,7 +163,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_XORG * @param labels 表头字符串 */ -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_xorgList = jList; @@ -144,7 +179,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_NORMAL * @param labels 表头字符串 */ -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_normalList = jList; @@ -159,7 +194,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList * @param jList 要导出的数据源 LOG_MSG_KWIN * @param labels 表头字符串 */ -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_kwinList = jList; @@ -168,7 +203,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList jL m_canRunning = true; } -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dnfList = jList; @@ -177,7 +212,7 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList jLi m_canRunning = true; } -void LogExportThread::exportToTxtPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dmesgList = jList; @@ -186,13 +221,22 @@ void LogExportThread::exportToTxtPublic(QString fileName, QList j m_canRunning = true; } +void LogExportThread::exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels) +{ + m_fileName = fileName; + m_alist = jList; + m_labels = labels; + m_runMode = TxtAUDIT; + m_canRunning = true; +} + /** * @brief LogExportThread::exportToHtmlPublic 导出到日志html格式配置函数对QStandardItemModel数据类型的重载 * @param fileName 导出文件路径全称 * @param pModel 要导出的数据源,为QStandardItemModel * @param flag 导出的日志类型 */ -void LogExportThread::exportToHtmlPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag) +void LogExportThread::exportToHtmlPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag) { m_fileName = fileName; m_pModel = pModel; @@ -202,6 +246,16 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QStandardItemModel *p } +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) +{ + m_fileName = fileName; + m_logDataList = jList; + m_runMode = HtmlJOURNAL; + m_labels = labels; + m_flag = flag; + m_canRunning = true; +} + /** * @brief LogExportThread::exportToHtmlPublic 导出到日志html格式配置函数,对LOG_MSG_JOURNAL数据类型的重载(指系统日志和内核日志) * @param fileName 导出文件路径全称 @@ -209,7 +263,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QStandardItemModel *p * @param labels 表头字符串 * @param flag 导出的日志类型 */ -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG flag) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) { m_fileName = fileName; m_jList = jList; @@ -227,7 +281,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels, QString &iAppName) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName) { m_fileName = fileName; m_appList = jList; @@ -243,7 +297,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dpkgList = jList; @@ -258,7 +312,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList j * @param jList 要导出的数据源 LOG_MSG_BOOT * @param labels 表头字符串 */ -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_bootList = jList; @@ -273,7 +327,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList j * @param jList 要导出的数据源 LOG_MSG_XORG * @param labels 表头字符串 */ -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_xorgList = jList; @@ -288,7 +342,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList j * @param jList 要导出的数据源 LOG_MSG_NORMAL * @param labels 表头字符串 */ -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_normalList = jList; @@ -303,7 +357,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList * @param jList 要导出的数据源 LOG_MSG_KWIN * @param labels 表头字符串 */ -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_kwinList = jList; @@ -311,7 +365,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList j m_runMode = HtmlKWIN; m_canRunning = true; } -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dnfList = jList; @@ -320,7 +374,7 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList jL m_canRunning = true; } -void LogExportThread::exportToHtmlPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dmesgList = jList; @@ -329,13 +383,22 @@ void LogExportThread::exportToHtmlPublic(QString fileName, QList m_canRunning = true; } +void LogExportThread::exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels) +{ + m_fileName = fileName; + m_alist = jList; + m_labels = labels; + m_runMode = HtmlAUDIT; + m_canRunning = true; +} + /** * @brief LogExportThread::exportToDocPublic导出到日志doc格式配置函数对QStandardItemModel数据类型的重载 * @param fileName 导出文件路径全称 * @param pModel 要导出的数据源,为QStandardItemModel * @param flag 导出的日志类型 */ -void LogExportThread::exportToDocPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag) +void LogExportThread::exportToDocPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag) { m_fileName = fileName; m_pModel = pModel; @@ -345,6 +408,16 @@ void LogExportThread::exportToDocPublic(QString fileName, QStandardItemModel *pM } +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag) +{ + m_fileName = fileName; + m_logDataList = jList; + m_flag = iFlag; + m_labels = labels; + m_runMode = DocJOURNAL; + m_canRunning = true; +} + /** * @brief LogExportThread::exportToDocPublic导出到日志doc格式配置函数,对LOG_MSG_JOURNAL数据类型的重载(指系统日志和内核日志) * @param fileName 导出文件路径全称 @@ -352,7 +425,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QStandardItemModel *pM * @param labels 表头字符串 * @param flag 导出的日志类型 */ -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG iFlag) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag) { m_fileName = fileName; m_jList = jList; @@ -370,7 +443,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList * @param labels 表头字符串 * @param iAppName 导出的应用日志的应用名称 */ -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels, QString &iAppName) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName) { m_fileName = fileName; m_appList = jList; @@ -386,7 +459,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dpkgList = jList; @@ -401,7 +474,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_BOOT * @param labels 表头字符串 */ -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_bootList = jList; @@ -416,7 +489,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_XORG * @param labels 表头字符串 */ -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_xorgList = jList; @@ -431,7 +504,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_NORMAL * @param labels 表头字符串 */ -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_normalList = jList; @@ -446,7 +519,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList * @param jList 要导出的数据源 LOG_MSG_KWIN * @param labels 表头字符串 */ -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_kwinList = jList; @@ -454,7 +527,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList jL m_runMode = DocKWIN; m_canRunning = true; } -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dnfList = jList; @@ -463,7 +536,7 @@ void LogExportThread::exportToDocPublic(QString fileName, QList jLi m_canRunning = true; } -void LogExportThread::exportToDocPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dmesgList = jList; @@ -471,13 +544,22 @@ void LogExportThread::exportToDocPublic(QString fileName, QList j m_runMode = DocDMESG; m_canRunning = true; } + +void LogExportThread::exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels) +{ + m_fileName = fileName; + m_alist = jList; + m_labels = labels; + m_runMode = DocAUDIT; + m_canRunning = true; +} /** * @brief LogExportThread::exportToXlsPublic 导出到日志xlsx格式配置函数对QStandardItemModel数据类型的重载 * @param fileName 导出文件路径全称 * @param pModel 要导出的数据源,为QStandardItemModel * @param flag 导出的日志类型 */ -void LogExportThread::exportToXlsPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag) +void LogExportThread::exportToXlsPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag) { m_fileName = fileName; m_pModel = pModel; @@ -486,6 +568,16 @@ void LogExportThread::exportToXlsPublic(QString fileName, QStandardItemModel *pM m_canRunning = true; } +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag) +{ + m_fileName = fileName; + m_logDataList = jList; + m_flag = iFlag; + m_labels = labels; + m_runMode = XlsJOURNAL; + m_canRunning = true; +} + /** * @brief LogExportThread::exportToXlsPublic 导出到日志xlsx格式配置函数,对LOG_MSG_JOURNAL数据类型的重载(指系统日志和内核日志) * @param fileName 导出文件路径全称 @@ -493,7 +585,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QStandardItemModel *pM * @param labels 表头字符串 * @param flag 导出的日志类型 */ -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG iFlag) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag) { m_fileName = fileName; m_jList = jList; @@ -510,7 +602,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList * @param labels 表头字符串 * @param iAppName 导出的应用日志的应用名称 */ -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels, QString &iAppName) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName) { m_fileName = fileName; m_appList = jList; @@ -526,7 +618,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dpkgList = jList; @@ -541,7 +633,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_DPKG * @param labels 表头字符串 */ -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_bootList = jList; @@ -556,7 +648,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_XORG * @param labels 表头字符串 */ -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_xorgList = jList; @@ -571,7 +663,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList jL * @param jList 要导出的数据源 LOG_MSG_NORMAL * @param labels 表头字符串 */ -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_normalList = jList; @@ -586,7 +678,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList * @param jList 要导出的数据源 LOG_MSG_KWIN * @param labels 表头字符串 */ -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_kwinList = jList; @@ -594,7 +686,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList jL m_runMode = XlsKWIN; m_canRunning = true; } -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dnfList = jList; @@ -603,7 +695,7 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList jLi m_canRunning = true; } -void LogExportThread::exportToXlsPublic(QString fileName, QList jList, QStringList labels) +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) { m_fileName = fileName; m_dmesgList = jList; @@ -611,6 +703,25 @@ void LogExportThread::exportToXlsPublic(QString fileName, QList j m_runMode = XlsDMESG; m_canRunning = true; } + +void LogExportThread::exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels) +{ + m_fileName = fileName; + m_alist = jList; + m_labels = labels; + m_runMode = XlsAUDIT; + m_canRunning = true; +} + +void LogExportThread::exportToZipPublic(const QString &fileName, const QList &jList, const QStringList &labels) +{ + m_fileName = fileName; + m_coredumplist = jList; + m_labels = labels; + m_runMode = ZipCoredump; + m_canRunning = true; +} + /** * @brief LogExportThread::isProcessing 返回当前线程获取数据逻辑启动停止控制的变量 * @return 当前线程获取数据逻辑启动停止控制的变量 @@ -635,7 +746,7 @@ void LogExportThread::stopImmediately() * @param flag 导出的日志类型 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag) +bool LogExportThread::exportToTxt(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag) { QFile fi(fileName); //判断文件路径是否存在,不存在就返回错误 @@ -687,7 +798,7 @@ bool LogExportThread::exportToTxt(QString fileName, QStandardItemModel *pModel, } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -698,7 +809,106 @@ bool LogExportThread::exportToTxt(QString fileName, QStandardItemModel *pModel, fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; +} + +/** + * @brief LogExportThread::exportToTxt 导出到日志txt格式配置函数,对Json数据类型的重载(内核日志、窗管日志等) + * @param fileName 导出文件路径全称 + * @param jList 要导出的数据源 数据类型为QString + * @param labels 表头字符串 + * @param flag 导出的日志类型 + * @return 是否导出成功 + */ +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) +{ + //判断文件路径是否存在,不存在就返回错误 + QFile fi(fileName); + if (!fi.open(m_appendExport ? (QIODevice::Append | QIODevice::WriteOnly) : QIODevice::WriteOnly)) { + emit sigResult(false); + emit sigError(openErroStr); + return false; + } + try { + + QTextStream out(&fi); + //导出日志为系统日志时 + if (flag == JOURNAL) { + for (int i = 0; i < jList.count(); i++) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_BASE jMsg; + jMsg.fromJson(jList[i]); + //导出各字段的描述和对应内容拼成目标字符串 + out << QString(DApplication::translate("Table", "Level:")) << jMsg.level << " "; + out << QString(DApplication::translate("Table", "Process:")) << jMsg.daemonName << " "; + out << QString(DApplication::translate("Table", "Date and Time:")) << jMsg.dateTime << " "; + if (jMsg.msg.isEmpty()) { + out << QString(DApplication::translate("Table", "Info:")) + << QString(DApplication::translate("Table", "Null")) << " "; // modify for bug + } else { + out << QString(DApplication::translate("Table", "Info:")) << jMsg.msg << " "; + } + out << QString(DApplication::translate("Table", "User:")) << jMsg.hostName << " "; + out << QString(DApplication::translate("Table", "PID:")) << jMsg.daemonId << " "; + out << "\n"; + //导出进度信号 + sigProgress(i + 1, jList.count()); + } + } else if (flag == KERN) { + //导出日志为内核日志时 + for (int i = 0; i < jList.count(); i++) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + int col = 0; + LOG_MSG_BASE jMsg; + jMsg.fromJson(jList.at(i)); + //导出各字段的描述和对应内容拼成目标字符串 + out << labels.value(col++, "") << ":" << jMsg.dateTime << " "; + out << labels.value(col++, "") << ":" << jMsg.hostName << " "; + out << labels.value(col++, "") << ":" << jMsg.daemonName << " "; + out << labels.value(col++, "") << ":" << jMsg.msg << " "; + out << "\n"; + //导出进度信号 + sigProgress(i + 1, jList.count()); + } + } else if (flag == Kwin) { + for (int i = 0; i < jList.count(); i++) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + //导出各字段的描述和对应内容拼成目标字符串 + LOG_MSG_BASE jMsg; + jMsg.fromJson(jList.at(i)); + int col = 0; + out << labels.value(col++, "") << ":" << jMsg.msg << " "; + out << "\n"; + //导出进度信号 + sigProgress(i + 1, jList.count()); + } + } + //设置文件编码为utf8 + out.setCodec(QTextCodec::codecForName("utf-8")); + + } catch (const QString &ErrorStr) { + //捕获到异常,导出失败,发出失败信号 + qCWarning(logExport) << "Export Stop" << ErrorStr; + fi.close(); + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + fi.close(); + //导出成功,如果此时被停止,则发出导出失败信号 + emit sigResult(m_canRunning); + return m_canRunning; } /** @@ -709,7 +919,7 @@ bool LogExportThread::exportToTxt(QString fileName, QStandardItemModel *pModel, * @param flag 导出的日志类型 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels, LOG_FLAG flag) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -776,7 +986,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -787,7 +997,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -798,7 +1008,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList * @param iAppName 导出的应用日志的应用名称 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels, QString &iAppName) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -820,7 +1030,10 @@ bool LogExportThread::exportToTxt(QString fileName, QList j LOG_MSG_APPLICATOIN jMsg = jList.at(i); out << labels.value(col++, "") << ":" << strTranslate(jMsg.level) << " "; out << labels.value(col++, "") << ":" << jMsg.dateTime << " "; - out << labels.value(col++, "") << ":" << iAppName << " "; + if (!jMsg.subModule.isEmpty()) + out << labels.value(col++, "") << ":" << iAppName + "_" + jMsg.subModule << " "; + else + out << labels.value(col++, "") << ":" << iAppName << " "; out << labels.value(col++, "") << ":" << jMsg.msg << " "; out << "\n"; //导出进度信号 @@ -828,7 +1041,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList j } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -839,7 +1052,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList j fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -849,7 +1062,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList j * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -878,7 +1091,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -889,7 +1102,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -899,7 +1112,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -927,7 +1140,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -938,7 +1151,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -948,7 +1161,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -968,7 +1181,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q //导出各字段的描述和对应内容拼成目标字符串 LOG_MSG_XORG jMsg = jList.at(i); int col = 0; - out << labels.value(col++, "") << ":" << jMsg.dateTime << " "; + out << labels.value(col++, "") << ":" << jMsg.offset << " "; out << labels.value(col++, "") << ":" << jMsg.msg << " "; out << "\n"; //导出进度信号 @@ -976,7 +1189,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -987,7 +1200,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -997,7 +1210,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -1027,7 +1240,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -1038,7 +1251,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** * @brief LogExportThread::exportToTxt导出到日志txt格式函数,对LOG_MSG_KWIN数据类型的重载(指klu上的kwin日志) @@ -1047,7 +1260,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -1074,7 +1287,7 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q } } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -1085,10 +1298,10 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, Q fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -1116,9 +1329,9 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, QS //导出进度信号 sigProgress(i + 1, jList.count()); } - } catch (const QString ErrorStr) { + } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -1129,10 +1342,10 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, QS fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToTxt(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile fi(fileName); @@ -1160,9 +1373,54 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, //导出进度信号 sigProgress(i + 1, jList.count()); } - } catch (const QString ErrorStr) { + } catch (const QString &ErrorStr) { + //捕获到异常,导出失败,发出失败信号 + qCWarning(logExport) << "Export Stop" << ErrorStr; + fi.close(); + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + fi.close(); + //导出成功,如果此时被停止,则发出导出失败信号 + emit sigResult(m_canRunning); + return m_canRunning; +} + +bool LogExportThread::exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels) +{ + //判断文件路径是否存在,不存在就返回错误 + QFile fi(fileName); + if (!fi.open(QIODevice::WriteOnly)) { + emit sigResult(false); + emit sigError(openErroStr); + return false; + } + try { + QTextStream out(&fi); + out.setCodec(QTextCodec::codecForName("utf-8")); + for (int i = 0; i < jList.count(); i++) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + //导出各字段的描述和对应内容拼成目标字符串 + LOG_MSG_AUDIT jMsg = jList.at(i); + int col = 0; + out << labels.value(col++, "") << ":" << jMsg.eventType << " "; + out << labels.value(col++, "") << ":" << jMsg.dateTime << " "; + out << labels.value(col++, "") << ":" << jMsg.processName << " "; + out << labels.value(col++, "") << ":" << jMsg.status << " "; + out << labels.value(col++, "") << ":" << jMsg.msg << " "; + out << "\n"; + //导出进度信号 + sigProgress(i + 1, jList.count()); + } + } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; fi.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -1173,7 +1431,100 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, fi.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; +} + +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag) +{ + try { + QString tempdir ; + if (iFlag == JOURNAL) { + tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/6column.dfw"; + } else if (iFlag == KERN) { + tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/4column.dfw"; + } else if (iFlag == Kwin) { + tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/1column.dfw"; + } else { + qCWarning(logExport) << "exportToDoc type is Wrong!"; + return false; + } + if (!QFile(tempdir).exists()) { + qCWarning(logExport) << "export docx template is not exisits"; + return false; + } + + DocxFactory:: WordProcessingMerger &l_merger = DocxFactory:: WordProcessingMerger::getInstance(); + + + l_merger.load(tempdir.toStdString()); + //往表头中添加表头描述,表头为第一行,数据则在下面 + for (int col = 0; col < labels.count(); ++col) { + l_merger.setClipboardValue("tableRow", QString("column%1").arg(col + 1).toStdString(), labels.at(col).toStdString()); + + } + l_merger.paste("tableRow"); + //计算导出进度条最后一段的长度,因为最后写入文件那一段没有进度,所以预先留出一段进度 + int end = static_cast(jList.count() * 0.1 > 5 ? jList.count() * 0.1 : 5); + for (int row = 0; row < jList.count(); ++row) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_BASE message; + message.fromJson(jList.at(row)); + //把数据填入表格单元格中 + if (iFlag == JOURNAL) { + l_merger.setClipboardValue("tableRow", QString("column1").toStdString(), message.level.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column2").toStdString(), message.daemonName.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column3").toStdString(), message.dateTime.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column4").toStdString(), message.msg.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column5").toStdString(), message.hostName.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column6").toStdString(), message.daemonId.toStdString()); + } else if (iFlag == KERN) { + l_merger.setClipboardValue("tableRow", QString("column1").toStdString(), message.dateTime.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column2").toStdString(), message.hostName.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column3").toStdString(), message.daemonName.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column4").toStdString(), message.msg.toStdString()); + } else if (iFlag == Kwin) { + l_merger.setClipboardValue("tableRow", QString("column1").toStdString(), message.msg.toStdString()); + } + l_merger.paste("tableRow"); + //导出进度信号 + sigProgress(row + 1, jList.count() + end); + } + //保存,把拼好的xml写入文件中 + QString fileNamex = fileName + "x"; + + QFile rsNameFile(fileName) ; + if (rsNameFile.exists()) { + rsNameFile.remove(); + } + l_merger.save(fileNamex.toStdString()); + QFile(fileNamex).rename(fileName); + } catch (const QString &ErrorStr) { + //捕获到异常,导出失败,发出失败信号 + qCWarning(logExport) << "Export Stop" << ErrorStr; + if (!m_canRunning) { + Utils::checkAndDeleteDir(m_fileName); + } + + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + //如果取消导出,则删除文件 + if (!m_canRunning) { + Utils::checkAndDeleteDir(m_fileName); + } + //100%进度 + sigProgress(100, 100); + //延时200ms再发送导出成功信号,关闭导出进度框,让100%的进度有时间显示 + Utils::sleep(200); + //导出成功,如果此时被停止,则发出导出失败信号 + emit sigResult(m_canRunning); + return m_canRunning; } /** @@ -1184,8 +1535,8 @@ bool LogExportThread::exportToTxt(QString fileName, QList jList, * @param flag 导出的日志类型 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, - QStringList labels, LOG_FLAG iFlag) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, + const QStringList &labels, LOG_FLAG iFlag) { try { QString tempdir ; @@ -1194,11 +1545,11 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList } else if (iFlag == KERN) { tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/4column.dfw"; } else { - qDebug() << "exportToDoc type is Wrong!"; + qCWarning(logExport) << "exportToDoc type is Wrong!"; return false; } if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1249,7 +1600,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList QFile(fileNamex).rename(fileName); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1270,13 +1621,13 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList Utils::sleep(200); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** * @brief LogExportThread::exportToDoc导出到日志doc格式配置函数,对LOG_MSG_APPLICATOIN数据类型的重载(指应用日志) * @param fileName 导出文件路径全称 if (!QFile(fileName).exists()) { - qWarning() << "export file dir is not exisits"; + qCWarning(logExport) << "export file dir is not exisits"; return false; } * @param jList 要导出的数据源 数据类型为LOG_MSG_APPLICATOIN @@ -1284,12 +1635,12 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList * @param iAppName 导出的应用日志的应用名称 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels, QString &iAppName) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels, QString &iAppName) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/4column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1330,7 +1681,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList j } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1352,7 +1703,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList j //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -1362,12 +1713,12 @@ bool LogExportThread::exportToDoc(QString fileName, QList j * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/3column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1407,7 +1758,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1429,7 +1780,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -1439,12 +1790,12 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/2column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1481,7 +1832,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q QFile(fileNamex).rename(fileName); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1502,7 +1853,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q Utils::sleep(200); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -1512,12 +1863,12 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/2column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1537,7 +1888,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q throw QString(stopStr); } LOG_MSG_XORG message = jList.at(row); - l_merger.setClipboardValue("tableRow", QString("column1").toStdString(), message.dateTime.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column1").toStdString(), message.offset.toStdString()); l_merger.setClipboardValue("tableRow", QString("column2").toStdString(), message.msg.toStdString()); l_merger.paste("tableRow"); //导出进度信号 @@ -1555,7 +1906,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1577,7 +1928,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -1587,13 +1938,13 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/4column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1633,7 +1984,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1655,7 +2006,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -1665,13 +2016,13 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/1column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1708,7 +2059,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1730,15 +2081,15 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, Q //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/1column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1774,7 +2125,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, QS } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1796,15 +2147,15 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, QS //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToDoc(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) { try { QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/1column.dfw"; if (!QFile(tempdir).exists()) { - qWarning() << "export docx template is not exisits"; + qCWarning(logExport) << "export docx template is not exisits"; return false; } @@ -1840,7 +2191,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; if (!m_canRunning) { Utils::checkAndDeleteDir(m_fileName); } @@ -1862,7 +2213,78 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; +} + +bool LogExportThread::exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels) +{ + try { + QString tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/5column.dfw"; + if (!QFile(tempdir).exists()) { + qCWarning(logExport) << "export docx template is not exisits"; + return false; + } + + DocxFactory:: WordProcessingMerger &l_merger = DocxFactory:: WordProcessingMerger::getInstance(); + l_merger.load(tempdir.toStdString()); + //往表头中添加表头描述,表头为第一行,数据则在下面 + for (int col = 0; col < labels.count(); ++col) { + l_merger.setClipboardValue("tableRow", QString("column%1").arg(col + 1).toStdString(), labels.at(col).toStdString()); + + } + l_merger.paste("tableRow"); + //计算导出进度条最后一段的长度,因为最后写入文件那一段没有进度,所以预先留出一段进度 + int end = static_cast(jList.count() * 0.1 > 5 ? jList.count() * 0.1 : 5); + for (int row = 0; row < jList.count(); ++row) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_AUDIT message = jList.at(row); + l_merger.setClipboardValue("tableRow", QString("column1").toStdString(), message.eventType.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column2").toStdString(), message.dateTime.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column3").toStdString(), message.processName.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column4").toStdString(), message.status.toStdString()); + l_merger.setClipboardValue("tableRow", QString("column5").toStdString(), message.msg.toStdString()); + l_merger.paste("tableRow"); + //导出进度信号 + sigProgress(row + 1, jList.count() + end); + } + //保存,把拼好的xml写入文件中 + QString fileNamex = fileName + "x"; + + QFile rsNameFile(fileName) ; + if (rsNameFile.exists()) { + rsNameFile.remove(); + } + l_merger.save(fileNamex.toStdString()); + QFile(fileNamex).rename(fileName); + + } catch (const QString &ErrorStr) { + //捕获到异常,导出失败,发出失败信号 + qCWarning(logExport) << "Export Stop" << ErrorStr; + if (!m_canRunning) { + Utils::checkAndDeleteDir(m_fileName); + } + + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + //如果取消导出,则删除文件 + if (!m_canRunning) { + Utils::checkAndDeleteDir(m_fileName); + } + //100%进度 + sigProgress(100, 100); + //延时200ms再发送导出成功信号,关闭导出进度框,让100%的进度有时间显示 + Utils::sleep(200); + //导出成功,如果此时被停止,则发出导出失败信号 + emit sigResult(m_canRunning); + + return m_canRunning; } /** @@ -1872,7 +2294,7 @@ bool LogExportThread::exportToDoc(QString fileName, QList jList, * @param flag 导出的日志类型 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag) +bool LogExportThread::exportToHtml(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag) { QFile html(fileName); //判断文件路径是否存在,不存在就返回错误 @@ -1907,47 +2329,173 @@ bool LogExportThread::exportToHtml(QString fileName, QStandardItemModel *pModel, if (!m_canRunning) { throw QString(stopStr); } - //根据字段拼出每行的网页内容 + //根据字段拼出每行的网页内容 + html.write(""); + + QString info = + QString("%1").arg(pModel->item(row, 0)->data(Qt::UserRole + 6).toString()); + html.write(info.toUtf8().data()); + + for (int col = 1; col < pModel->columnCount(); ++col) { + QString m_info = QString("%1").arg(pModel->item(row, col)->text()); + htmlEscapeCovert(m_info); + html.write(m_info.toUtf8().data()); + } + html.write(""); + //导出进度信号 + sigProgress(row + 1, pModel->rowCount()); + } + } else { + //日志类型为其他所有日志时 + for (int row = 0; row < pModel->rowCount(); ++row) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + //根据字段拼出每行的网页内容 + html.write(""); + for (int col = 0; col < pModel->columnCount(); ++col) { + QString info = QString("%1").arg(pModel->item(row, col)->text()); + htmlEscapeCovert(info); + html.write(info.toUtf8().data()); + } + html.write(""); + //导出进度信号 + sigProgress(row + 1, pModel->rowCount()); + } + } + html.write("\n"); + html.write("\n"); + html.write("\n"); + } catch (const QString &ErrorStr) { + //捕获到异常,导出失败,发出失败信号 + qCWarning(logExport) << "Export Stop" << ErrorStr; + html.close(); + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + html.close(); + //导出成功,如果此时被停止,则发出导出失败信号 + emit sigResult(m_canRunning); + return m_canRunning; +} + +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) +{ + QFile html(fileName); + //判断文件路径是否存在,不存在就返回错误 + if (!html.open(m_appendExport ? (QIODevice::Append | QIODevice::WriteOnly) : QIODevice::WriteOnly)) { + emit sigResult(false); + emit sigError(openErroStr); + return false; + } + try { + //写网页头 + html.write("\n"); + html.write("\n"); + html.write("\n"); + //写入表格标签 + html.write("\n"); + // 写入内容 + //日志类型为系统日志时 + if (flag == JOURNAL) { + // 写入表头 + QString title = QString(""); + html.write(title.toUtf8().data()); + // 写入内容 + for (int i = 0; i < jList.count(); i++) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_BASE jMsg; + jMsg.fromJson(jList.at(i)); + htmlEscapeCovert(jMsg.msg); + //根据字段拼出每行的网页内容 + QString info = + QString("") + .arg(jMsg.level) + .arg(jMsg.daemonName) + .arg(jMsg.dateTime) + .arg(jMsg.msg) + .arg(jMsg.hostName) + .arg(jMsg.daemonId); + html.write(info.toUtf8().data()); + //导出进度信号 + sigProgress(i + 1, jList.count()); + + } + } else if (flag == KERN) { + // 写入表头 + html.write(""); + for (int i = 0; i < labels.count(); ++i) { + QString labelInfo = QString("").arg(labels.value(i)); + html.write(labelInfo.toUtf8().data()); + } + //根据字段拼出每行的网页内容 + html.write(""); + for (int row = 0; row < jList.count(); ++row) { + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_BASE jMsg; + jMsg.fromJson(jList.at(row)); html.write(""); - - QString info = - QString("").arg(pModel->item(row, 0)->data(Qt::UserRole + 6).toString()); + QString info = QString("").arg(jMsg.dateTime); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.hostName); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.daemonName); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.msg); html.write(info.toUtf8().data()); - - for (int col = 1; col < pModel->columnCount(); ++col) { - QString m_info = QString("").arg(pModel->item(row, col)->text()); - htmlEscapeCovert(m_info); - html.write(m_info.toUtf8().data()); - } html.write(""); - //导出进度信号 - sigProgress(row + 1, pModel->rowCount()); + sigProgress(row + 1, jList.count()); } - } else { - //日志类型为其他所有日志时 - for (int row = 0; row < pModel->rowCount(); ++row) { + + } else if (flag == Kwin) { + // 写入表头 + html.write(""); + for (int i = 0; i < labels.count(); ++i) { + QString labelInfo = QString("").arg(labels.value(i)); + html.write(labelInfo.toUtf8().data()); + } + html.write(""); + // 写入内容 + for (int row = 0; row < jList.count(); ++row) { //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 if (!m_canRunning) { throw QString(stopStr); } //根据字段拼出每行的网页内容 + LOG_MSG_BASE jMsg; + jMsg.fromJson(jList.at(row)); + htmlEscapeCovert(jMsg.msg); html.write(""); - for (int col = 0; col < pModel->columnCount(); ++col) { - QString info = QString("").arg(pModel->item(row, col)->text()); - htmlEscapeCovert(info); - html.write(info.toUtf8().data()); - } + QString info = QString("").arg(jMsg.msg); + html.write(info.toUtf8().data()); html.write(""); //导出进度信号 - sigProgress(row + 1, pModel->rowCount()); + sigProgress(row + 1, jList.count()); } } + html.write("
") + QString(DApplication::translate("Table", "Level")) + + QString("") + QString(DApplication::translate("Table", "Process")) + + QString("") + + QString(DApplication::translate("Table", "Date and Time")) + + QString("") + QString(DApplication::translate("Table", "Info")) + + QString("") + QString(DApplication::translate("Table", "User")) + + QString("") + QString(DApplication::translate("Table", "PID")) + + QString("
%1%2%3%4%5%6
%1
%1%1%1%1%1%1
%1
%1%1
\n"); html.write("\n"); html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -1958,7 +2506,7 @@ bool LogExportThread::exportToHtml(QString fileName, QStandardItemModel *pModel, html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -1969,7 +2517,7 @@ bool LogExportThread::exportToHtml(QString fileName, QStandardItemModel *pModel, * @param flag 导出的日志类型 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels, LOG_FLAG flag) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag) { QFile html(fileName); //判断文件路径是否存在,不存在就返回错误 @@ -2055,7 +2603,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jLis html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2066,7 +2614,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jLis html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2077,7 +2625,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jLis * @param iAppName 导出的应用日志的应用名称 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels, QString &iAppName) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels, QString &iAppName) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2128,7 +2676,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2139,7 +2687,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2149,7 +2697,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2198,7 +2746,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2209,7 +2757,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2219,7 +2767,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2266,7 +2814,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2277,7 +2825,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2287,7 +2835,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2320,7 +2868,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, LOG_MSG_XORG jMsg = jList.at(row); htmlEscapeCovert(jMsg.msg); html.write(""); - QString info = QString("%1").arg(jMsg.dateTime); + QString info = QString("%1").arg(jMsg.offset); html.write(info.toUtf8().data()); info = QString("%1").arg(jMsg.msg); html.write(info.toUtf8().data()); @@ -2334,7 +2882,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2345,7 +2893,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2355,7 +2903,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2406,7 +2954,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2417,7 +2965,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2427,7 +2975,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2472,7 +3020,7 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.write("\n"); } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2483,10 +3031,10 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2534,9 +3082,9 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, Q html.write("\n"); html.write("\n"); html.write("\n"); - } catch (const QString ErrorStr) { + } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2547,10 +3095,10 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, Q html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToHtml(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) { //判断文件路径是否存在,不存在就返回错误 QFile html(fileName); @@ -2598,9 +3146,76 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.write("\n"); html.write("\n"); html.write("\n"); - } catch (const QString ErrorStr) { + } catch (const QString &ErrorStr) { + //捕获到异常,导出失败,发出失败信号 + qCWarning(logExport) << "Export Stop" << ErrorStr; + html.close(); + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + html.close(); + //导出成功,如果此时被停止,则发出导出失败信号 + emit sigResult(m_canRunning); + return m_canRunning; +} + +bool LogExportThread::exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels) +{ + //判断文件路径是否存在,不存在就返回错误 + QFile html(fileName); + if (!html.open(QIODevice::WriteOnly)) { + emit sigResult(false); + emit sigError(openErroStr); + return false; + } + try { + //写网页头 + html.write("\n"); + html.write("\n"); + html.write("\n"); + //写入表格标签 + html.write("\n"); + // 写入表头 + html.write(""); + for (int i = 0; i < labels.count(); ++i) { + QString labelInfo = QString("").arg(labels.value(i)); + html.write(labelInfo.toUtf8().data()); + } + html.write(""); + // 写入内容 + for (int row = 0; row < jList.count(); ++row) { + //导出逻辑启动停止控制,外部把m_canRunning置false时停止运行,抛出异常处理 + if (!m_canRunning) { + throw QString(stopStr); + } + //根据字段拼出每行的网页内容 + LOG_MSG_AUDIT jMsg = jList.at(row); + htmlEscapeCovert(jMsg.msg); + html.write(""); + QString info = QString("").arg(jMsg.eventType); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.dateTime); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.processName); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.status); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.msg); + html.write(info.toUtf8().data()); + html.write(""); + //导出进度信号 + sigProgress(row + 1, jList.count()); + } + + html.write("
%1
%1%1%1%1%1
\n"); + html.write("\n"); + html.write("\n"); + } catch (const QString &ErrorStr) { //捕获到异常,导出失败,发出失败信号 - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; html.close(); emit sigResult(false); if (ErrorStr != stopStr) { @@ -2611,7 +3226,66 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, html.close(); //导出成功,如果此时被停止,则发出导出失败信号 emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; +} + +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag) +{ + try { + auto currentXlsRow = 0; + lxw_workbook *workbook = workbook_new(fileName.toStdString().c_str()); + lxw_worksheet *worksheet = workbook_add_worksheet(workbook, nullptr); + lxw_format *format = workbook_add_format(workbook); + format_set_bold(format); + for (int col = 0; col < labels.count(); ++col) { + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col), labels.at(col).toStdString().c_str(), format); + } + ++currentXlsRow; + int end = static_cast(jList.count() * 0.1 > 5 ? jList.count() * 0.1 : 5); + + for (int row = 0; row < jList.count() ; ++row) { + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_BASE message; + message.fromJson(jList.at(row)); + int col = 0; + + if (iFlag == JOURNAL) { + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.level.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.daemonName.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.dateTime.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.hostName.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.daemonId.toStdString().c_str(), nullptr); + } else if (iFlag == KERN) { + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.dateTime.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.hostName.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.daemonName.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); + } else if (iFlag == Kwin) { + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); + } + + ++currentXlsRow; + sigProgress(row + 1, jList.count() + end); + } + + + workbook_close(workbook); + malloc_trim(0); + sigProgress(100, 100); + } catch (const QString &ErrorStr) { + qCWarning(logExport) << "Export Stop" << ErrorStr; + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + emit sigResult(m_canRunning); + return m_canRunning; + } /** @@ -2622,8 +3296,8 @@ bool LogExportThread::exportToHtml(QString fileName, QList jList, * @param flag 导出的日志类型 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, - QStringList labels, LOG_FLAG iFlag) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, + const QStringList &labels, LOG_FLAG iFlag) { try { auto currentXlsRow = 0; @@ -2666,9 +3340,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2676,7 +3349,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } @@ -2688,7 +3361,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList * @param iAppName 导出的应用日志的应用名称 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels, QString &iAppName) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels, QString &iAppName) { try { auto currentXlsRow = 0; @@ -2720,9 +3393,8 @@ bool LogExportThread::exportToXls(QString fileName, QList j workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2730,7 +3402,7 @@ bool LogExportThread::exportToXls(QString fileName, QList j return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } @@ -2741,7 +3413,7 @@ bool LogExportThread::exportToXls(QString fileName, QList j * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -2772,9 +3444,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2782,7 +3453,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2792,7 +3463,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -2822,9 +3493,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2832,7 +3502,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2842,7 +3512,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -2862,7 +3532,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q } LOG_MSG_XORG message = jList.at(row); int col = 0; - worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.dateTime.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.offset.toStdString().c_str(), nullptr); worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); ++currentXlsRow; sigProgress(row + 1, jList.count() + end); @@ -2872,9 +3542,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2882,7 +3551,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2892,7 +3561,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -2924,9 +3593,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2934,7 +3602,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } /** @@ -2944,7 +3612,7 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, * @param labels 表头字符串 * @return 是否导出成功 */ -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -2973,9 +3641,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -2983,10 +3650,10 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, Q return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -3016,9 +3683,8 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, QS workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -3026,10 +3692,10 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, QS return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; } -bool LogExportThread::exportToXls(QString fileName, QList jList, QStringList labels) +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) { try { auto currentXlsRow = 0; @@ -3059,9 +3725,52 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, workbook_close(workbook); malloc_trim(0); sigProgress(100, 100); - qDebug() << "export xlsx new"; } catch (const QString &ErrorStr) { - qDebug() << "Export Stop" << ErrorStr; + qCWarning(logExport) << "Export Stop" << ErrorStr; + emit sigResult(false); + if (ErrorStr != stopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + return false; + } + emit sigResult(m_canRunning); + return m_canRunning; +} + +bool LogExportThread::exportToXls(const QString &fileName, const QList &jList, const QStringList &labels) +{ + try { + auto currentXlsRow = 0; + lxw_workbook *workbook = workbook_new(fileName.toStdString().c_str()); + lxw_worksheet *worksheet = workbook_add_worksheet(workbook, nullptr); + lxw_format *format = workbook_add_format(workbook); + format_set_bold(format); + for (int col = 0; col < labels.count(); ++col) { + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col), labels.at(col).toStdString().c_str(), format); + } + ++currentXlsRow; + int end = static_cast(jList.count() * 0.1 > 5 ? jList.count() * 0.1 : 5); + + for (int row = 0; row < jList.count() ; ++row) { + if (!m_canRunning) { + throw QString(stopStr); + } + LOG_MSG_AUDIT message = jList.at(row); + int col = 0; + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.eventType.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.dateTime.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.processName.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.status.toStdString().c_str(), nullptr); + worksheet_write_string(worksheet, static_cast(currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); + ++currentXlsRow; + sigProgress(row + 1, jList.count() + end); + } + + workbook_close(workbook); + malloc_trim(0); + sigProgress(100, 100); + } catch (const QString &ErrorStr) { + qCWarning(logExport) << "Export Stop" << ErrorStr; emit sigResult(false); if (ErrorStr != stopStr) { emit sigError(QString("export error: %1").arg(ErrorStr)); @@ -3069,7 +3778,72 @@ bool LogExportThread::exportToXls(QString fileName, QList jList, return false; } emit sigResult(m_canRunning); - return true && m_canRunning; + return m_canRunning; +} + +bool LogExportThread::exportToZip(const QString &fileName, const QList &jList) +{ + QString tmpPath = Utils::getAppDataPath() + "/tmp/"; + QDir dir(tmpPath); + //删除临时目录 + dir.removeRecursively(); + //创建临时目录 + Utils::mkMutiDir(tmpPath); + + //复制文件 + int nCoreDumpCount = 0; + for (auto &it : jList) { + DLDBusHandler::instance(this)->exportLog(tmpPath, it.storagePath, true); + if (it.coreFile == "present") + nCoreDumpCount++; + if (!m_canRunning) { + break; + } + } + + if (!m_canRunning) { + return false; + } + //打包日志文件 + QProcess procss; + procss.setWorkingDirectory(tmpPath); + QStringList arg = {"-c"}; + // 使用7z进行压缩,方便获取进度 + arg.append(QString("7z a -l -bsp1 tmp.zip ./*;mv tmp.zip '%1'").arg(fileName)); + + // refresh progress + bool ret = false; + // 有coredump文件,才读取压缩进度 + if (nCoreDumpCount > 0) { + connect(&procss, &QProcess::readyReadStandardOutput, this, [&](){ + if (!m_canRunning) { + procss.kill(); + ret = false; + return; + } + + QByteArray dd = procss.readAllStandardOutput(); + QList lines = QString(dd).split('\n', QString::SkipEmptyParts); + for (const QString &line : qAsConst(lines)) { + int pos = line.indexOf(QLatin1Char('%')); + if (pos > 1) { + int percentage = line.midRef(pos - 3, 3).toInt(); + sigProgress(percentage, 100); + } + } + ret = true; + }); + } else { + ret = true; + } + + procss.start("/bin/bash", arg); + procss.waitForFinished(-1); + + emit sigResult(ret); + + dir.removeRecursively(); + return m_canRunning; } /** @@ -3093,7 +3867,7 @@ void LogExportThread::initMap() * @param iLevelStr 等级字符 * @return 显示字符 */ -QString LogExportThread::strTranslate(QString &iLevelStr) +QString LogExportThread::strTranslate(const QString &iLevelStr) { return m_levelStrMap.value(iLevelStr, iLevelStr); } @@ -3113,7 +3887,7 @@ void LogExportThread::htmlEscapeCovert(QString &htmlMsg) */ void LogExportThread::run() { - qInfo() << " LogExportThread::run()threadrun"; + qCDebug(logExport) << "threadrun"; sigProgress(0, 100); switch (m_runMode) { case TxtModel: { @@ -3121,7 +3895,10 @@ void LogExportThread::run() break; } case TxtJOURNAL: { - exportToTxt(m_fileName, m_jList, m_labels, m_flag); + if (m_flag == JOURNAL) + exportToTxt(m_fileName, m_jList, m_labels, m_flag); + else if (m_flag == KERN || m_flag == Kwin) + exportToTxt(m_fileName, m_logDataList, m_labels, m_flag); break; } case TxtAPP: { @@ -3156,12 +3933,19 @@ void LogExportThread::run() exportToTxt(m_fileName, m_kwinList, m_labels); break; } + case TxtAUDIT: { + exportToTxt(m_fileName, m_alist, m_labels); + } + break; case HtmlModel: { exportToHtml(m_fileName, m_pModel, m_flag); break; } case HtmlJOURNAL: { - exportToHtml(m_fileName, m_jList, m_labels, m_flag); + if (m_flag == JOURNAL) + exportToHtml(m_fileName, m_jList, m_labels, m_flag); + else if (m_flag == KERN || m_flag == Kwin) + exportToHtml(m_fileName, m_logDataList, m_labels, m_flag); break; } case HtmlAPP: { @@ -3196,8 +3980,15 @@ void LogExportThread::run() exportToHtml(m_fileName, m_dmesgList, m_labels); break; } + case HtmlAUDIT: { + exportToHtml(m_fileName, m_alist, m_labels); + } + break; case DocJOURNAL: { - exportToDoc(m_fileName, m_jList, m_labels, m_flag); + if (m_flag == JOURNAL) + exportToDoc(m_fileName, m_jList, m_labels, m_flag); + else if (m_flag == KERN || m_flag == Kwin) + exportToDoc(m_fileName, m_logDataList, m_labels, m_flag); break; } case DocAPP: { @@ -3232,8 +4023,15 @@ void LogExportThread::run() exportToDoc(m_fileName, m_dmesgList, m_labels); break; } + case DocAUDIT: { + exportToDoc(m_fileName, m_alist, m_labels); + } + break; case XlsJOURNAL: { - exportToXls(m_fileName, m_jList, m_labels, m_flag); + if (m_flag == JOURNAL) + exportToXls(m_fileName, m_jList, m_labels, m_flag); + else if (m_flag == KERN || m_flag == Kwin) + exportToXls(m_fileName, m_logDataList, m_labels, m_flag); break; } case XlsAPP: { @@ -3268,6 +4066,14 @@ void LogExportThread::run() exportToXls(m_fileName, m_dmesgList, m_labels); break; } + case XlsAUDIT: { + exportToXls(m_fileName, m_alist, m_labels); + break; + } + case ZipCoredump: { + exportToZip(m_fileName, m_coredumplist); + break; + } default: break; } diff --git a/application/logexportthread.h b/application/logexportthread.h index f012a4f2..8f29fcd6 100644 --- a/application/logexportthread.h +++ b/application/logexportthread.h @@ -17,7 +17,7 @@ class LogExportThread : public QObject, public QRunnable { Q_OBJECT public: - LogExportThread(bool &isDataComplete, QObject *parent = nullptr); + explicit LogExportThread(QObject *parent = nullptr); ~LogExportThread(); /** * @brief The RUN_MODE enum 导出类型,用于执行时判断要执行的逻辑 @@ -33,6 +33,7 @@ class LogExportThread : public QObject, public QRunnable HtmlKWIN, //数据来源是kwin日志数据结构体的list,导出格式为Html HtmlDNF, HtmlDMESG, + HtmlAUDIT, //数据来源是audit日志数据结构体的list,导出格式为html TxtModel, //数据来源是model,导出格式为txt TxtJOURNAL, //数据来源是系统日志数据结构体的list,导出格式为txt TxtAPP, //数据来源是应用日志数据结构体的list,导出格式为txt @@ -43,6 +44,7 @@ class LogExportThread : public QObject, public QRunnable TxtKWIN, //数据来源是kwin日志数据结构体的list,导出格式为txt TxtDNF, TxtDMESG, + TxtAUDIT, //数据来源是audit日志数据结构体的list,导出格式为txt DocModel, //数据来源是model,导出格式为doc DocJOURNAL, //数据来源是系统日志数据结构体的list,导出格式为doc DocAPP, //数据来源是应用日志数据结构体的list,导出格式为doc @@ -53,6 +55,7 @@ class LogExportThread : public QObject, public QRunnable DocKWIN, //数据来源是kwin日志数据结构体的list,导出格式为doc DocDNF, DocDMESG, + DocAUDIT, //数据来源是audit日志数据结构体的list,导出格式为doc XlsModel, //数据来源是model,导出格式为xlxs XlsJOURNAL, //数据来源是系统日志数据结构体的list,导出格式为xlxs XlsAPP, //数据来源是应用日志数据结构体的list,导出格式为xlxs @@ -63,52 +66,66 @@ class LogExportThread : public QObject, public QRunnable XlsKWIN, //数据来源是kwin日志数据结构体的list,导出格式为xlxs XlsDNF, XlsDMESG, + XlsAUDIT, //数据来源是audit日志数据结构体的list,导出格式为xlxs + ZipCoredump, NoneExportType = 9999 //任何行为 }; - void exportToTxtPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG flag); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels, QString &iAppName); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - void exportToTxtPublic(QString fileName, QList jList, QStringList labels); - - void exportToHtmlPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG flag); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels, QString &iAppName); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - void exportToHtmlPublic(QString fileName, QList jList, QStringList labels); - - void exportToDocPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag); - void exportToDocPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG iFlag); - void exportToDocPublic(QString fileName, QList jList, QStringList labels, QString &iAppName); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - void exportToDocPublic(QString fileName, QList jList, QStringList labels); - - void exportToXlsPublic(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels, LOG_FLAG iFlag); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels, QString &iAppName); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); - void exportToXlsPublic(QString fileName, QList jList, QStringList labels); + void enableAppendExport(bool bEnable = true); + + void exportToTxtPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToTxtPublic(const QString &fileName, const QList &jList, const QStringList &labels); + + void exportToHtmlPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToHtmlPublic(const QString &fileName, const QList &jList, const QStringList &labels); + + void exportToDocPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToDocPublic(const QString &fileName, const QList &jList, const QStringList &labels); + + void exportToXlsPublic(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + void exportToXlsPublic(const QString &fileName, const QList &jList, const QStringList &labels); + + void exportToZipPublic(const QString &fileName, const QList &jList, const QStringList &labels); bool isProcessing(); public slots: @@ -138,50 +155,60 @@ public slots: */ void sigError(QString iError); private: - bool exportToTxt(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag); - bool exportToTxt(QString fileName, QList jList, QStringList labels, LOG_FLAG flag); - bool exportToTxt(QString fileName, QList jList, QStringList labels, QString &iAppName); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - bool exportToTxt(QString fileName, QList jList, QStringList labels); - - bool exportToDoc(QString fileName, QList jList, QStringList labels, LOG_FLAG iFlag); - bool exportToDoc(QString fileName, QList jList, QStringList labels, QString &iAppName); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - bool exportToDoc(QString fileName, QList jList, QStringList labels); - - bool exportToHtml(QString fileName, QStandardItemModel *pModel, LOG_FLAG flag); - bool exportToHtml(QString fileName, QList jList, QStringList labels, LOG_FLAG flag); - bool exportToHtml(QString fileName, QList jList, QStringList labels, QString &iAppName); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - bool exportToHtml(QString fileName, QList jList, QStringList labels); - - bool exportToXls(QString fileName, QList jList, QStringList labels, LOG_FLAG iFlag); - bool exportToXls(QString fileName, QList jList, QStringList labels, QString &iAppName); - bool exportToXls(QString fileName, QList jList, QStringList labels); - bool exportToXls(QString fileName, QList jList, QStringList labels); - bool exportToXls(QString fileName, QList jList, QStringList labels); - bool exportToXls(QString fileName, QList jList, QStringList labels); - bool exportToXls(QString fileName, QList jList, QStringList labels); - bool exportToXls(QString fileName, QList jList, QStringList labels); - bool exportToXls(QString fileName, QList jList, QStringList labels); + bool exportToTxt(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels, const QString &iAppName); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToTxt(const QString &fileName, const QList &jList, const QStringList &labels); + + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels, QString &iAppName); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToDoc(const QString &fileName, const QList &jList, const QStringList &labels); + + bool exportToHtml(const QString &fileName, QStandardItemModel *pModel, LOG_FLAG flag); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG flag); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels, QString &iAppName); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToHtml(const QString &fileName, const QList &jList, const QStringList &labels); + + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels, LOG_FLAG iFlag); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels, QString &iAppName); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + bool exportToXls(const QString &fileName, const QList &jList, const QStringList &labels); + + bool exportToZip(const QString &fileName, const QList &jList); void initMap(); - QString strTranslate(QString &iLevelStr); + QString strTranslate(const QString &iLevelStr); /** * @brief htmlEscapeCovert html转义字符转换 @@ -198,6 +225,9 @@ public slots: LOG_FLAG m_flag = NONE; //如果导出项文本标题 QStringList m_labels; + // 通用json格式日志数据 + QList m_logDataList; + //系统日志数据源 QList m_jList; //应用日志数据源 @@ -214,6 +244,8 @@ public slots: QList m_kwinList; QList m_dnfList; QList m_dmesgList; + QList m_alist; + QList m_coredumplist; //当前线程执行的逻辑种类 RUN_MODE m_runMode = NoneExportType; //打开文件错误描述 @@ -224,7 +256,7 @@ public slots: QString m_appName = ""; //日志等级-显示文本键值对 QMap m_levelStrMap; - bool m_allLoadComplete; + bool m_appendExport {false}; }; #endif // LOGEXPORTTHREAD_H diff --git a/application/logfileparser.cpp b/application/logfileparser.cpp index df5d5656..8922422f 100644 --- a/application/logfileparser.cpp +++ b/application/logfileparser.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -10,6 +10,10 @@ #include "sharedmemorymanager.h" #include "utils.h"// add by Airy #include "wtmpparse.h" +#include "logapplicationhelper.h" + +#include "parsethread/parsethreadkern.h" +#include "parsethread/parsethreadkwin.h" #include @@ -23,11 +27,18 @@ #include #include #include +#include #include #include #include +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logFileParser, "org.deepin.log.viewer.parser") +#else +Q_LOGGING_CATEGORY(logFileParser, "org.deepin.log.viewer.parser", QtInfoMsg) +#endif + int journalWork::thread_index = 0; int JournalBootWork::thread_index = 0; DWIDGET_USE_NAMESPACE @@ -35,23 +46,6 @@ DWIDGET_USE_NAMESPACE LogFileParser::LogFileParser(QWidget *parent) : QObject(parent) { - m_dateDict.clear(); - m_dateDict.insert("Jan", "1月"); - m_dateDict.insert("Feb", "2月"); - m_dateDict.insert("Mar", "3月"); - m_dateDict.insert("Apr", "4月"); - m_dateDict.insert("May", "5月"); - m_dateDict.insert("Jun", "6月"); - m_dateDict.insert("Jul", "7月"); - m_dateDict.insert("Aug", "8月"); - m_dateDict.insert("Sep", "9月"); - m_dateDict.insert("Oct", "10月"); - m_dateDict.insert("Nov", "11月"); - m_dateDict.insert("Dec", "12月"); - - // TODO:: - m_levelDict.insert("Warning", WARN); - m_levelDict.insert("Debug", DEB); qRegisterMetaType > ("QList"); qRegisterMetaType > ("QList"); qRegisterMetaType > ("QList"); @@ -59,6 +53,9 @@ LogFileParser::LogFileParser(QWidget *parent) qRegisterMetaType > ("QList"); qRegisterMetaType>("QList"); qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); + qRegisterMetaType>("QList"); qRegisterMetaType ("LOG_FLAG"); } @@ -66,41 +63,16 @@ LogFileParser::LogFileParser(QWidget *parent) LogFileParser::~LogFileParser() { stopAllLoad(); - //释放共享内存 - SharedMemoryManager::instance()->releaseMemory(); + if (SharedMemoryManager::getInstance()) { + //释放共享内存 + SharedMemoryManager::instance()->releaseMemory(); + } } -int LogFileParser::parseByJournal(QStringList arg) +int LogFileParser::parseByJournal(const QStringList &arg) { stopAllLoad(); - m_isJournalLoading = true; - -#if 0 - m_currentJournalWork = journalWork::instance(); - - m_currentJournalWork->stopWork(); -// journalWork *work = new journalWork(); -// m_currentJournalWork = work; - disconnect(m_currentJournalWork, SIGNAL(journalFinished()), this, SLOT(slot_journalFinished())); - disconnect(m_currentJournalWork, &journalWork::journalData, this, &LogFileParser::journalData); - m_currentJournalWork->setArg(arg); - connect(m_currentJournalWork, SIGNAL(journalFinished()), this, SLOT(slot_journalFinished()), - Qt::QueuedConnection); - connect(m_currentJournalWork, &journalWork::journalData, this, &LogFileParser::slot_journalData, - Qt::QueuedConnection); - connect(this, &LogFileParser::stopJournal, this, [ = ] { - if (m_currentJournalWork) - { - disconnect(m_currentJournalWork, SIGNAL(journalFinished()), this, SLOT(slot_journalFinished())); - disconnect(m_currentJournalWork, &journalWork::journalData, this, &LogFileParser::slot_journalData); - } - }); - m_currentJournalWork->start(); - //QtConcurrent::run(work, &journalWork::doWork); - // QThreadPool::globalInstance()->start(work); -#endif -#if 1 emit stopJournal(); journalWork *work = new journalWork(this); @@ -115,10 +87,9 @@ int LogFileParser::parseByJournal(QStringList arg) int index = work->getIndex(); QThreadPool::globalInstance()->start(work); return index; -#endif } -int LogFileParser::parseByJournalBoot(QStringList arg) +int LogFileParser::parseByJournalBoot(const QStringList &arg) { stopAllLoad(); JournalBootWork *work = new JournalBootWork(this); @@ -136,7 +107,7 @@ int LogFileParser::parseByJournalBoot(QStringList arg) return index; } -int LogFileParser::parseByDpkg(DKPG_FILTERS &iDpkgFilter) +int LogFileParser::parseByDpkg(const DKPG_FILTERS &iDpkgFilter) { stopAllLoad(); @@ -158,7 +129,7 @@ int LogFileParser::parseByDpkg(DKPG_FILTERS &iDpkgFilter) return index; } -int LogFileParser::parseByXlog(XORG_FILTERS &iXorgFilter) // modifed by Airy +int LogFileParser::parseByXlog(const XORG_FILTERS &iXorgFilter) // modifed by Airy { stopAllLoad(); LogAuthThread *authThread = new LogAuthThread(this); @@ -178,7 +149,7 @@ int LogFileParser::parseByXlog(XORG_FILTERS &iXorgFilter) // modifed by Airy return index; } -int LogFileParser::parseByNormal(NORMAL_FILTERS &iNormalFiler) +int LogFileParser::parseByNormal(const NORMAL_FILTERS &iNormalFiler) { stopAllLoad(); LogAuthThread *authThread = new LogAuthThread(this); @@ -196,7 +167,7 @@ int LogFileParser::parseByNormal(NORMAL_FILTERS &iNormalFiler) return index; } -int LogFileParser::parseByKwin(KWIN_FILTERS iKwinfilter) +int LogFileParser::parseByKwin(const KWIN_FILTERS &iKwinfilter) { stopAllLoad(); LogAuthThread *authThread = new LogAuthThread(this); @@ -212,39 +183,10 @@ int LogFileParser::parseByKwin(KWIN_FILTERS iKwinfilter) QThreadPool::globalInstance()->start(authThread); return index; } -#if 0 -void LogFileParser::parseByXlog(QStringList &xList) -{ - QProcess proc; - proc.start("cat /var/log/Xorg.0.log"); // file path is fixed. so write cmd direct - proc.waitForFinished(-1); - - if (isErroCommand(QString(proc.readAllStandardError()))) - return; - - QString output = proc.readAllStandardOutput(); - proc.close(); - - for (QString str : output.split('\n')) { - if (str.startsWith("[")) { - // xList.append(str); - xList.insert(0, str); - } else { - str += " "; - // xList[xList.size() - 1] += str; - xList[0] += str; - } - } - createFile(output, xList.count()); - - emit xlogFinished(); -} -#endif int LogFileParser::parseByBoot() { stopAllLoad(); - m_isBootLoading = true; LogAuthThread *authThread = new LogAuthThread(this); authThread->setType(BOOT); @@ -261,10 +203,28 @@ int LogFileParser::parseByBoot() return index; } -int LogFileParser::parseByKern(KERN_FILTERS &iKernFilter) +int LogFileParser::parse(LOG_FILTER_BASE &filter) +{ + stopAllLoad(); + + ParseThreadBase *parseWork = nullptr; + if (filter.type == KERN) + parseWork = new ParseThreadKern(this); + else if (filter.type == Kwin) + parseWork = new ParseThreadKwin(this); + if (parseWork) { + parseWork->setFilter(filter); + int index = parseWork->getIndex(); + QThreadPool::globalInstance()->start(parseWork); + return index; + } + + return -1; +} + +int LogFileParser::parseByKern(const KERN_FILTERS &iKernFilter) { stopAllLoad(); - m_isKernLoading = true; LogAuthThread *authThread = new LogAuthThread(this); authThread->setType(KERN); QStringList filePath = DLDBusHandler::instance(this)->getFileInfo("kern", false); @@ -281,32 +241,65 @@ int LogFileParser::parseByKern(KERN_FILTERS &iKernFilter) return index; } -int LogFileParser::parseByApp(APP_FILTERS &iAPPFilter) +int LogFileParser::parseByApp(const APP_FILTERS &iAPPFilter) { - stopAllLoad(); - m_isAppLoading = true; - - m_appThread = new LogApplicationParseThread(this); - quitLogAuththread(m_appThread); - - disconnect(m_appThread, &LogApplicationParseThread::appFinished, this, - &LogFileParser::appFinished); - disconnect(m_appThread, &LogApplicationParseThread::appData, this, - &LogFileParser::appData); - disconnect(this, &LogFileParser::stopApp, m_appThread, - &LogApplicationParseThread::stopProccess); - m_appThread->setParam(iAPPFilter); - connect(m_appThread, &LogApplicationParseThread::appFinished, this, - &LogFileParser::appFinished); - connect(m_appThread, &LogApplicationParseThread::appData, this, - &LogFileParser::appData); - connect(this, &LogFileParser::stopApp, m_appThread, - &LogApplicationParseThread::stopProccess); - connect(m_appThread, &LogApplicationParseThread::finished, m_appThread, - &QObject::deleteLater); - int index = m_appThread->getIndex(); - m_appThread->start(); - return index; + // 根据应用名获取应用日志配置信息 + QString appName = iAPPFilter.app; + AppLogConfig appLogConfig = LogApplicationHelper::instance()->appLogConfig(appName); + + APP_FILTERSList appFilterList; + if (appLogConfig.subModules.size() == 1) { + APP_FILTERS appFilter = iAPPFilter; + // 子模块名称与应用名称显示一致,并且仅有一个子模块, + // 则认为该应用与子模块同名称,来源列表显示为应用名称 + if (appLogConfig.subModules[0].name == appLogConfig.name) + appFilter.submodule = ""; + else + appFilter.submodule = appLogConfig.subModules[0].name; + appFilter.logType = appLogConfig.subModules[0].logType; + appFilter.filter = appLogConfig.subModules[0].filter; + appFilter.path = appLogConfig.subModules[0].logPath; + appFilter.execPath = appLogConfig.subModules[0].execPath; + appFilterList.push_back(appFilter); + } else if (appLogConfig.subModules.size() > 1) { + for (auto submodule : appLogConfig.subModules) { + APP_FILTERS appFilter = iAPPFilter; + appFilter.submodule = submodule.name; + appFilter.logType = submodule.logType; + appFilter.filter = submodule.filter; + appFilter.path = submodule.logPath; + appFilter.execPath = submodule.execPath; + appFilterList.push_back(appFilter); + } + } + + if (appFilterList.size() > 0) { + stopAllLoad(); + + m_appThread = new LogApplicationParseThread(this); + quitLogAuththread(m_appThread); + + disconnect(m_appThread, &LogApplicationParseThread::appFinished, this, + &LogFileParser::appFinished); + disconnect(m_appThread, &LogApplicationParseThread::appData, this, + &LogFileParser::appData); + disconnect(this, &LogFileParser::stopApp, m_appThread, + &LogApplicationParseThread::stopProccess); + m_appThread->setFilters(appFilterList); + connect(m_appThread, &LogApplicationParseThread::appFinished, this, + &LogFileParser::appFinished); + connect(m_appThread, &LogApplicationParseThread::appData, this, + &LogFileParser::appData); + connect(this, &LogFileParser::stopApp, m_appThread, + &LogApplicationParseThread::stopProccess); + connect(m_appThread, &LogApplicationParseThread::finished, m_appThread, + &QObject::deleteLater); + int index = m_appThread->getIndex(); + m_appThread->start(); + return index; + } + + return -1; } void LogFileParser::parseByDnf(DNF_FILTERS iDnfFilter) @@ -343,19 +336,18 @@ void LogFileParser::parseByDmesg(DMESG_FILTERS iDmesgFilter) QThreadPool::globalInstance()->start(authThread); } -int LogFileParser::parseByOOC(QString & path) +int LogFileParser::parseByOOC(const QString &path) { stopAllLoad(); - m_isOOCLoading = true; m_OOCThread = new LogOOCFileParseThread(this); m_OOCThread->setParam(path); connect(m_OOCThread, &LogOOCFileParseThread::sigFinished, this, - &LogFileParser::OOCFinished); + &LogFileParser::OOCFinished); connect(m_OOCThread, &LogOOCFileParseThread::sigData, this, - &LogFileParser::OOCData); + &LogFileParser::OOCData); connect(this, &LogFileParser::stopOOC, m_OOCThread, - &LogOOCFileParseThread::stopProccess); + &LogOOCFileParseThread::stopProccess); connect(m_OOCThread, &LogOOCFileParseThread::finished, m_OOCThread, &QObject::deleteLater); int index = m_OOCThread->getIndex(); @@ -363,24 +355,46 @@ int LogFileParser::parseByOOC(QString & path) return index; } -void LogFileParser::createFile(QString output, int count) +int LogFileParser::parseByAudit(const AUDIT_FILTERS &iAuditFilter) { -#if 1 - Q_UNUSED(output) - Q_UNUSED(count) -#else - // this is for test parser. - QFile fi("tempFile"); - if (!fi.open(QIODevice::ReadWrite | QIODevice::Truncate)) - return; - fi.write(output.toLatin1()); - fi.write(QString::number(count).toLatin1()); - fi.close(); -#endif + stopAllLoad(); + LogAuthThread *authThread = new LogAuthThread(this); + authThread->setType(Audit); + QStringList filePath = DLDBusHandler::instance(this)->getFileInfo("audit", false); + authThread->setFileterParam(iAuditFilter); + authThread->setFilePath(filePath); + connect(authThread, &LogAuthThread::auditFinished, this, + &LogFileParser::auditFinished); + connect(authThread, &LogAuthThread::auditData, this, + &LogFileParser::auditData); + connect(this, &LogFileParser::stopKern, authThread, + &LogAuthThread::stopProccess); + int index = authThread->getIndex(); + QThreadPool::globalInstance()->start(authThread); + return index; +} + +int LogFileParser::parseByCoredump(const COREDUMP_FILTERS &iCoredumpFilter, bool parseMap) +{ + stopAllLoad(); + //qRegisterMetaType>("QList"); + LogAuthThread *authThread = new LogAuthThread(this); + authThread->setType(COREDUMP); + authThread->setParseMap(parseMap); + authThread->setFileterParam(iCoredumpFilter); + connect(authThread, &LogAuthThread::coredumpFinished, this, + &LogFileParser::coredumpFinished); + connect(authThread, &LogAuthThread::coredumpData, this, + &LogFileParser::coredumpData); + connect(this, &LogFileParser::stopCoredump, authThread, &LogAuthThread::stopProccess); + int index = authThread->getIndex(); + QThreadPool::globalInstance()->start(authThread); + return index; } void LogFileParser::stopAllLoad() { + emit stop(); emit stopKern(); emit stopBoot(); emit stopDpkg(); @@ -393,15 +407,13 @@ void LogFileParser::stopAllLoad() emit stopDnf(); emit stopDmesg(); emit stopOOC(); + emit stopCoredump(); return; } - - void LogFileParser::quitLogAuththread(QThread *iThread) { if (iThread && iThread->isRunning()) { - qDebug() << __FUNCTION__; iThread->quit(); iThread->wait(); } diff --git a/application/logfileparser.h b/application/logfileparser.h index b5dd20ab..bd483443 100644 --- a/application/logfileparser.h +++ b/application/logfileparser.h @@ -15,6 +15,7 @@ #include #include +#include class LogFileParser : public QObject { @@ -24,27 +25,35 @@ class LogFileParser : public QObject ~LogFileParser(); - int parseByJournal(QStringList arg = QStringList()); - int parseByJournalBoot(QStringList arg = QStringList()); + int parseByJournal(const QStringList &arg = QStringList()); + int parseByJournalBoot(const QStringList &arg = QStringList()); - int parseByDpkg(DKPG_FILTERS &iDpkgFilter); -#if 0 - void parseByXlog(QStringList &xList); - void parseByXlog(QList &xList, qint64 ms = 0); // modifed by Airy for show period -#endif - int parseByXlog(XORG_FILTERS &iXorgFilter); + int parseByDpkg(const DKPG_FILTERS &iDpkgFilter); + + int parseByXlog(const XORG_FILTERS &iXorgFilter); int parseByBoot(); - int parseByKern(KERN_FILTERS &iKernFilter); - int parseByApp(APP_FILTERS &iAPPFilter); + // 通用解析入口,传入筛选参数,解析线程根据筛选参数吐出日志数据 + int parse(LOG_FILTER_BASE &filter); + int parseByKern(const KERN_FILTERS &iKernFilter); + int parseByApp(const APP_FILTERS &iAPPFilter); void parseByDnf(DNF_FILTERS iDnfFilter); void parseByDmesg(DMESG_FILTERS iDmesgFilter); - int parseByNormal(NORMAL_FILTERS &iNormalFiler); // add by Airy - int parseByKwin(KWIN_FILTERS iKwinfilter); - int parseByOOC(QString & path); - void createFile(QString output, int count); + int parseByNormal(const NORMAL_FILTERS &iNormalFiler); // add by Airy + + int parseByKwin(const KWIN_FILTERS &iKwinfilter); + int parseByOOC(const QString &path); + + int parseByAudit(const AUDIT_FILTERS &iAuditFilter); + + int parseByCoredump(const COREDUMP_FILTERS &iCoredumpFilter, bool parseMap = false); + void stopAllLoad(); signals: + void parseFinished(int index, LOG_FLAG type, int status); + void logData(int index, const QList &dataList, LOG_FLAG type); + void stop(); + void dpkgFinished(int index); void dpkgData(int index, QList); void xlogFinished(int index); @@ -74,6 +83,12 @@ class LogFileParser : public QObject void OOCFinished(int index, int error = 0); void OOCData(int index, const QString &data); + void auditFinished(int index, bool bShowTip = false); + void auditData(int index, QList); + + void coredumpFinished(int index); + void coredumpData(int index, QList iDataList); + void stopKern(); void stopBoot(); void stopDpkg(); @@ -86,6 +101,7 @@ class LogFileParser : public QObject void stopDnf(); void stopDmesg(); void stopOOC(); + void stopCoredump(); /** * @brief proccessError 获取日志文件失败错误信息传递信号,传递到主界面显示 DMessage tooltip * @param iError 错误字符 @@ -99,29 +115,8 @@ class LogFileParser : public QObject public slots: void slog_proccessError(const QString &iError); private: - QString m_rootPasswd; - - QMap m_dateDict; - QMap m_levelDict; // example:warning=>4 - LogOOCFileParseThread *m_OOCThread {nullptr}; LogApplicationParseThread *m_appThread {nullptr}; - journalWork *work {nullptr}; - JournalBootWork *m_bootJournalWork{nullptr}; - QProcess *m_pDkpgDataLoader{nullptr}; - QProcess *m_pXlogDataLoader{nullptr}; - QProcess *m_KwinDataLoader{nullptr}; - bool m_isProcess = false; - qint64 m_selectTime {0}; - bool m_isJournalLoading = false; - bool m_isDpkgLoading = false; - bool m_isXlogLoading = false; - bool m_isKwinLoading = false; - bool m_isBootLoading = false; - bool m_isKernLoading = false; - bool m_isAppLoading = false; - bool m_isNormalLoading = false; - bool m_isOOCLoading = false; }; #endif // LOGFILEPARSER_H diff --git a/application/logiconbutton.cpp b/application/logiconbutton.cpp index 8fe7d767..a4bc4181 100644 --- a/application/logiconbutton.cpp +++ b/application/logiconbutton.cpp @@ -17,7 +17,7 @@ LogIconButton::LogIconButton(QWidget *parent) this->setIconSize(QSize(32, 32)); } -LogIconButton::LogIconButton(QString text, QWidget *parent) +LogIconButton::LogIconButton(const QString &text, QWidget *parent) : QPushButton(text, parent) { this->setFlat(true); diff --git a/application/logiconbutton.h b/application/logiconbutton.h index 87f9d645..fb8042b8 100644 --- a/application/logiconbutton.h +++ b/application/logiconbutton.h @@ -13,7 +13,7 @@ class LogIconButton : public QPushButton { public: explicit LogIconButton(QWidget *parent = nullptr); - explicit LogIconButton(QString text, QWidget *parent = nullptr); + explicit LogIconButton(const QString &text, QWidget *parent = nullptr); protected: QSize sizeHint() const override; void resizeEvent(QResizeEvent *e)override; diff --git a/application/loglistview.cpp b/application/loglistview.cpp index 584e05d4..5194f652 100644 --- a/application/loglistview.cpp +++ b/application/loglistview.cpp @@ -7,6 +7,8 @@ #include "dbusmanager.h" #include "DebugTimeManager.h" #include "logapplicationhelper.h" +#include "dbusproxy/dldbushandler.h" +#include "utils.h" #include #include @@ -148,11 +150,9 @@ void LogListView::initUI() this->setViewportMargins(10, 10, 10, 0); Dtk::Core::DSysInfo::UosEdition edition = Dtk::Core::DSysInfo::uosEditionType(); //等于服务器行业版或欧拉版(centos) - bool isCentos = Dtk::Core::DSysInfo::UosEuler == edition || Dtk::Core::DSysInfo::UosEnterpriseC == edition; + bool isCentos = Dtk::Core::DSysInfo::UosEuler == edition || Dtk::Core::DSysInfo::UosEnterpriseC == edition || Dtk::Core::DSysInfo::UosMilitaryS == edition; m_pModel = new QStandardItemModel(this); QStandardItem *item = nullptr; - QString systemName = DBusManager::getSystemInfo(); - qDebug() << "systemName" << systemName; if (isFileExist("/var/log/journal") || isCentos) { item = new QStandardItem(QIcon::fromTheme("dp_system"), DApplication::translate("Tree", "System Log")); setIconSize(QSize(ICON_SIZE, ICON_SIZE)); @@ -160,7 +160,6 @@ void LogListView::initUI() item->setData(JOUR_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("System Log"); m_pModel->appendRow(item); m_logTypes.push_back(JOUR_TREE_DATA); } @@ -172,7 +171,6 @@ void LogListView::initUI() item->setData(DMESG_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("dmesg Log"); m_pModel->appendRow(item); m_logTypes.push_back(DMESG_TREE_DATA); } else { @@ -183,19 +181,17 @@ void LogListView::initUI() item->setData(KERN_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Kernel Log"); m_pModel->appendRow(item); m_logTypes.push_back(KERN_TREE_DATA); } } - if (systemName == "klu" || systemName == "panguV" || systemName == "W515 PGUV-WBY0" || systemName.toUpper().contains("PGUV") || systemName.toUpper().contains("PANGUV") || systemName.toUpper().contains("KLU")) { + if (Utils::isWayland()) { item = new QStandardItem(QIcon::fromTheme("dp_start"), DApplication::translate("Tree", "Boot Log")); setIconSize(QSize(ICON_SIZE, ICON_SIZE)); item->setToolTip(DApplication::translate("Tree", "Boot Log")); // add by Airy for bug 16245 item->setData(BOOT_KLU_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Boot Klu Log"); m_pModel->appendRow(item); m_logTypes.push_back(BOOT_KLU_TREE_DATA); } else { @@ -205,7 +201,6 @@ void LogListView::initUI() item->setData(BOOT_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Boot Log"); m_pModel->appendRow(item); m_logTypes.push_back(BOOT_TREE_DATA); } @@ -216,7 +211,6 @@ void LogListView::initUI() item->setData(DNF_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("dnf Log"); m_pModel->appendRow(item); m_logTypes.push_back(DNF_TREE_DATA); } else { @@ -227,20 +221,18 @@ void LogListView::initUI() item->setData(DPKG_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("dpkg Log"); m_pModel->appendRow(item); m_logTypes.push_back(DPKG_TREE_DATA); } } - //w515是新版本内核的panguv返回值 panguV是老版本 - if (systemName == "klu" || systemName == "panguV" || systemName == "W515 PGUV-WBY0" || systemName == "pangu" || systemName.toUpper().contains("PGUV") || systemName.toUpper().contains("PANGUV") || systemName.toUpper().contains("KLU") || systemName.toUpper().contains("PANGU")) { + //wayland环境才有kwin日志 + if (Utils::isWayland()) { item = new QStandardItem(QIcon::fromTheme("dp_kwin"), DApplication::translate("Tree", "Kwin Log")); setIconSize(QSize(ICON_SIZE, ICON_SIZE)); item->setToolTip(DApplication::translate("Tree", "Kwin Log")); item->setData(KWIN_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("dpkg Log"); m_pModel->appendRow(item); m_logTypes.push_back(KWIN_TREE_DATA); } else { @@ -250,7 +242,6 @@ void LogListView::initUI() item->setData(XORG_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Xorg Log"); m_pModel->appendRow(item); m_logTypes.push_back(XORG_TREE_DATA); } @@ -264,12 +255,22 @@ void LogListView::initUI() item->setData(APP_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Application Log"); m_pModel->appendRow(item); this->setModel(m_pModel); m_logTypes.push_back(APP_TREE_DATA); } + // coredump log + item = new QStandardItem(QIcon::fromTheme("dp_customlog"), DApplication::translate("Tree", "Coredump Log")); + setIconSize(QSize(ICON_SIZE, ICON_SIZE)); + item->setToolTip(DApplication::translate("Tree", "Coredump Log")); + item->setData(COREDUMP_TREE_DATA, ITEM_DATE_ROLE); + item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); + item->setData(VListViewItemMargin, Dtk::MarginsRole); + m_pModel->appendRow(item); + m_logTypes.push_back(COREDUMP_TREE_DATA); + + // add by Airy if (isFileExist("/var/log/wtmp")) { item = new QStandardItem(QIcon::fromTheme("dp_onoff"), DApplication::translate("Tree", "Boot-Shutdown Event")); @@ -279,7 +280,6 @@ void LogListView::initUI() DApplication::translate("Tree", "Boot-Shutdown Event")); // add by Airy for bug 16245 item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Boot-Shutdown Event"); m_pModel->appendRow(item); this->setModel(m_pModel); m_logTypes.push_back(LAST_TREE_DATA); @@ -292,16 +292,27 @@ void LogListView::initUI() item->setData(OTHER_TREE_DATA, ITEM_DATE_ROLE); item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); item->setData(VListViewItemMargin, Dtk::MarginsRole); - item->setAccessibleText("Other Log"); m_pModel->appendRow(item); m_logTypes.push_back(OTHER_TREE_DATA); //custom - m_logTypes.push_back(CUSTOM_TREE_DATA); if (LogApplicationHelper::instance()->getCustomLogList().size()) { + m_logTypes.push_back(CUSTOM_TREE_DATA); initCustomLogItem(); } + // 审计日志文件存在,才加载和显示审计日志模块(审计日志文件需要root权限访问,因此在service服务中判断审计日志文件是否存在) + if (DLDBusHandler::instance(this)->isFileExist(AUDIT_TREE_DATA)) { + item = new QStandardItem(QIcon::fromTheme("dp_customlog"), DApplication::translate("Tree", "Audit Log")); + setIconSize(QSize(ICON_SIZE, ICON_SIZE)); + item->setToolTip(DApplication::translate("Tree", "Audit Log")); + item->setData(AUDIT_TREE_DATA, ITEM_DATE_ROLE); + item->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); + item->setData(VListViewItemMargin, Dtk::MarginsRole); + m_pModel->appendRow(item); + m_logTypes.push_back(AUDIT_TREE_DATA); + } + // set first item is select when app start if (m_pModel->rowCount() > 0) { this->setCurrentIndex(m_pModel->index(0, 0)); @@ -319,7 +330,6 @@ void LogListView::initCustomLogItem() m_customLogItem->setData(CUSTOM_TREE_DATA, ITEM_DATE_ROLE); m_customLogItem->setSizeHint(QSize(ITEM_WIDTH, ITEM_HEIGHT)); m_customLogItem->setData(VListViewItemMargin, Dtk::MarginsRole); - m_customLogItem->setAccessibleText("Custom Log"); m_pModel->appendRow(m_customLogItem); } @@ -401,12 +411,28 @@ void LogListView::truncateFile(QString path_) /** * @author Airy * @brief LogListView::slot_getAppPath 清空应用日志时,当前显示应用日志的目录由外部提供并赋予成员变量 - * @param path 要设置的当前应用路径 + * @param app 要设置的当前应用项目名称 */ -void LogListView::slot_getAppPath(int id, QString path) +void LogListView::slot_getAppPath(int id, const QString &app) { Q_UNUSED(id); - g_path = path; + + AppLogConfig appConfig = LogApplicationHelper::instance()->appLogConfig(app); + if (!appConfig.isValid()) + g_path = ""; + else { + std::vector vSubmodules = appConfig.subModules.toVector().toStdVector(); + auto it = std::find_if(vSubmodules.begin(), vSubmodules.end(), [=](SubModuleConfig submodule) { + return submodule.logType == "file" && submodule.name == appConfig.name; + }); + + if (it != vSubmodules.end()) { + g_path = it->logPath; + return; + } + + g_path = ""; + } } Qt::FocusReason LogListView::focusReson() @@ -416,7 +442,6 @@ Qt::FocusReason LogListView::focusReson() void LogListView::showRightMenu(const QPoint &pos, bool isUsePoint) { - qDebug() << __FUNCTION__; QModelIndex idx = this->currentIndex(); QString pathData = idx.data(ITEM_DATE_ROLE).toString(); if (!this->selectionModel()->selectedIndexes().empty()) { @@ -429,7 +454,9 @@ void LogListView::showRightMenu(const QPoint &pos, bool isUsePoint) g_context->addAction(g_clear); g_context->addAction(g_refresh); - if (pathData == JOUR_TREE_DATA || pathData == LAST_TREE_DATA || pathData == BOOT_KLU_TREE_DATA || pathData == OTHER_TREE_DATA || pathData == CUSTOM_TREE_DATA) { + if (pathData == JOUR_TREE_DATA || pathData == LAST_TREE_DATA || pathData == BOOT_KLU_TREE_DATA + || pathData == OTHER_TREE_DATA || pathData == CUSTOM_TREE_DATA || pathData == AUDIT_TREE_DATA + || pathData == COREDUMP_TREE_DATA) { g_clear->setEnabled(false); g_openForder->setEnabled(false); } @@ -437,7 +464,8 @@ void LogListView::showRightMenu(const QPoint &pos, bool isUsePoint) g_clear->setEnabled(false); g_openForder->setEnabled(false); } - QString dirPath = QDir::homePath(); + + QString dirPath = Utils::homePath; QString _path_ = g_path; //get app path QString path = ""; @@ -445,10 +473,17 @@ void LogListView::showRightMenu(const QPoint &pos, bool isUsePoint) path = pathData; } else if (pathData == APP_TREE_DATA) { path = _path_; + g_clear->setEnabled(!path.isEmpty()); + g_openForder->setEnabled(!path.isEmpty()); } + //显示当前日志目录 connect(g_openForder, &QAction::triggered, this, [=] { - DDesktopServices::showFileItem(path); + if (pathData != COREDUMP_TREE_DATA) { + DDesktopServices::showFileItem(path); + } else { + DDesktopServices::showFolder(path); + } }); QModelIndex index = idx; diff --git a/application/loglistview.h b/application/loglistview.h index 07a130e5..12261961 100644 --- a/application/loglistview.h +++ b/application/loglistview.h @@ -41,7 +41,7 @@ class LogListView : public Dtk::Widget::DListView bool isFileExist(const QString &iFile); void initCustomLogItem(); public slots: - void slot_getAppPath(int id, QString path); // add by Airy + void slot_getAppPath(int id, const QString &app); // add by Airy Qt::FocusReason focusReson(); void showRightMenu(const QPoint &pos, bool isUsePoint); void requestshowRightMenu(const QPoint &pos); diff --git a/application/logoocfileparsethread.cpp b/application/logoocfileparsethread.cpp index b2fdec61..9768fcba 100644 --- a/application/logoocfileparsethread.cpp +++ b/application/logoocfileparsethread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -12,9 +12,16 @@ #include #include #include +#include DWIDGET_USE_NAMESPACE +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logOOCParse, "org.deepin.log.viewer.parse.ooc.work") +#else +Q_LOGGING_CATEGORY(logOOCParse, "org.deepin.log.viewer.parse.ooc.work", QtInfoMsg) +#endif + int LogOOCFileParseThread::thread_count = 0; /** * @brief LogOOCFileParseThread::LogOOCFileParseThread 构造函数 @@ -36,7 +43,7 @@ LogOOCFileParseThread::~LogOOCFileParseThread() stopProccess(); } -void LogOOCFileParseThread::setParam(QString &path) +void LogOOCFileParseThread::setParam(const QString &path) { m_path = path; } @@ -54,22 +61,29 @@ void LogOOCFileParseThread::doWork() //此线程刚开始把可以继续变量置true,不然下面没法跑 m_canRun = true; + if (m_path.isEmpty()) { + emit sigFinished(m_threadCount); + return; + } + if (!checkAuthentication(m_path)) { + emit sigFinished(m_threadCount, 1); return; } QStringList filePath = DLDBusHandler::instance(this)->getOtherFileInfo(m_path); for (int i = 0; i < filePath.count(); i++) { if (!m_canRun) { + emit sigFinished(m_threadCount); return; } //鉴权 if (!checkAuthentication(filePath.at(i))) { + emit sigFinished(m_threadCount, 1); return; } - //m_fileData += DLDBusHandler::instance(this)->readLog(filePath.at(i)) + "\n"; m_fileData += DLDBusHandler::instance(this)->readLog(filePath.at(i)); emit sigData(m_threadCount, m_fileData); } @@ -78,7 +92,7 @@ void LogOOCFileParseThread::doWork() } //鉴权 -bool LogOOCFileParseThread::checkAuthentication(const QString & path) +bool LogOOCFileParseThread::checkAuthentication(const QString &path) { //判断当前用户对文件是否可读 QFlags power = QFile::permissions(path); @@ -91,11 +105,10 @@ bool LogOOCFileParseThread::checkAuthentication(const QString & path) //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 initProccess(); m_process->start("pkexec", QStringList() << "logViewerAuth" - << path << SharedMemoryManager::instance()->getRunnableKey()); + << path << SharedMemoryManager::instance()->getRunnableKey()); m_process->waitForFinished(-1); //有错则传出空数据 if (m_process->exitCode() != 0) { - emit sigFinished(m_threadCount, 1); return false; } } @@ -139,7 +152,7 @@ bool LogOOCFileParseThread::checkAuthentication(const QString & path) */ void LogOOCFileParseThread::run() { - qDebug() << "LogApplicationParseThread::run()---threadrun"; + qCDebug(logOOCParse) << "threadrun"; doWork(); } @@ -163,7 +176,7 @@ void LogOOCFileParseThread::stopProccess() SharedMemoryManager::instance()->setRunnableTag(shareInfo); if (m_process) { m_process->kill(); - } + } } void LogOOCFileParseThread::initProccess() diff --git a/application/logoocfileparsethread.h b/application/logoocfileparsethread.h index d4aedb70..6e9a7007 100755 --- a/application/logoocfileparsethread.h +++ b/application/logoocfileparsethread.h @@ -22,20 +22,20 @@ class LogOOCFileParseThread : public QThread public: explicit LogOOCFileParseThread(QObject *parent = nullptr); ~LogOOCFileParseThread() override; - void setParam(QString &path); + void setParam(const QString &path); static int thread_count; void initProccess(); - const QScopedPointer & getProcess() const {return m_process;} - const QString & getPath() const {return m_path;} - const QString & getFileData() const {return m_fileData;} + const QScopedPointer &getProcess() const {return m_process;} + const QString &getPath() const {return m_path;} + const QString &getFileData() const {return m_fileData;} signals: /** * @brief sigFinished 获取数据结束信号 */ void sigFinished(int index, int error = 0); - void sigData(int index, const QString & data); + void sigData(int index, const QString &data); public slots: void doWork(); void stopProccess(); @@ -44,7 +44,7 @@ public slots: protected: void run() override; //鉴权 - bool checkAuthentication(const QString & path); + bool checkAuthentication(const QString &path); private: /** diff --git a/application/logperiodbutton.cpp b/application/logperiodbutton.cpp index 8868aca3..6b9a31b8 100644 --- a/application/logperiodbutton.cpp +++ b/application/logperiodbutton.cpp @@ -19,7 +19,7 @@ DWIDGET_USE_NAMESPACE -LogPeriodButton::LogPeriodButton(const QString text, QWidget *parent) +LogPeriodButton::LogPeriodButton(const QString &text, QWidget *parent) : DPushButton(text, parent) { this->setFocusPolicy(Qt::StrongFocus); diff --git a/application/logperiodbutton.h b/application/logperiodbutton.h index cf325b8c..4a331a04 100644 --- a/application/logperiodbutton.h +++ b/application/logperiodbutton.h @@ -10,7 +10,7 @@ class LogPeriodButton : public Dtk::Widget::DPushButton { public: - LogPeriodButton(const QString text, QWidget *parent = nullptr); + explicit LogPeriodButton(const QString &text, QWidget *parent = nullptr); void setStandardSize(int iStahndardWidth); Qt::FocusReason getFocusReason(); protected: diff --git a/application/logsegementexportthread.cpp b/application/logsegementexportthread.cpp new file mode 100644 index 00000000..88453245 --- /dev/null +++ b/application/logsegementexportthread.cpp @@ -0,0 +1,410 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "logsegementexportthread.h" +#include "utils.h" +#include "xlsxwriter.h" +#include "WordProcessingMerger.h" +#include "WordProcessingCompiler.h" +#include "dbusproxy/dldbushandler.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +DWIDGET_USE_NAMESPACE + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logSegementExport, "org.deepin.log.viewer.segement.export.work") +#else +Q_LOGGING_CATEGORY(logSegementExport, "org.deepin.log.viewer.segement.export.work", QtInfoMsg) +#endif + +/** + * @brief LogSegementExportThread::LogSegementExportThread 导出日志线程类构造函数 + * @param parent 父对象 + */ +LogSegementExportThread::LogSegementExportThread(QObject *parent) + : QObject(parent), + QRunnable() +{ + setAutoDelete(true); +} +/** + * @brief LogSegementExportThread::~LogSegementExportThread 析构函数 + */ +LogSegementExportThread::~LogSegementExportThread() +{ + qCDebug(logSegementExport) << "LogSegementExportThread destoryed."; + //释放空闲内存 + malloc_trim(0); +} + +void LogSegementExportThread::setParameter(const QString &fileName, const QList &jList, const QStringList &lables, LOG_FLAG flag) +{ + QMutexLocker locker(&mutex); + m_fileName = fileName; + m_logDataList = jList; + m_flag = flag; + m_labels = lables; + m_bForceStop = false; + if (m_fileName.endsWith(".txt")) { + m_runMode = Txt; + } else if (fileName.endsWith(".html")) { + m_runMode = Html; + } else if (fileName.endsWith(".doc")) { + m_runMode = Doc; + if (!m_pDocMerger) + initDoc(); + } else if (fileName.endsWith(".xls")) { + m_runMode = Xls; + if (!m_pWorkbook) + initXls(); + } + condition.wakeOne(); +} + +void LogSegementExportThread::initDoc() +{ + QString tempdir = getDocTemplatePath(); + if (tempdir.isEmpty()) + return; + + m_pDocMerger = &DocxFactory:: WordProcessingMerger::getInstance(); + m_pDocMerger->load(tempdir.toStdString()); + //往表头中添加表头描述,表头为第一行,数据则在下面 + for (int col = 0; col < m_labels.count(); ++col) { + m_pDocMerger->setClipboardValue("tableRow", QString("column%1").arg(col + 1).toStdString(), m_labels.at(col).toStdString()); + } + m_pDocMerger->paste("tableRow"); +} + +void LogSegementExportThread::initXls() +{ + m_currentXlsRow = 0; + m_pWorkbook = workbook_new(m_fileName.toStdString().c_str()); + m_pWorksheet = workbook_add_worksheet(m_pWorkbook, nullptr); + lxw_format *format = workbook_add_format(m_pWorkbook); + format_set_bold(format); + for (int col = 0; col < m_labels.count(); ++col) { + worksheet_write_string(m_pWorksheet, static_cast(m_currentXlsRow), static_cast(col), m_labels.at(col).toStdString().c_str(), format); + } + ++m_currentXlsRow; +} + +QString LogSegementExportThread::getDocTemplatePath() +{ + QString tempdir(""); + if (m_flag == KERN) { + tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/4column.dfw"; + } else if (m_flag == Kwin) { + tempdir = "/usr/share/deepin-log-viewer/DocxTemplate/1column.dfw"; + } else { + qCWarning(logSegementExport) << "exportToDoc type is Wrong!"; + return ""; + } + if (!QFile(tempdir).exists()) { + qCWarning(logSegementExport) << "export docx template is not exisits"; + return ""; + } + + return tempdir; +} + +/** + * @brief LogSegementExportThread::isProcessing 返回当前线程获取数据逻辑启动停止控制的变量 + * @return 当前线程获取数据逻辑启动停止控制的变量 + */ +bool LogSegementExportThread::isProcessing() +{ + return !m_bForceStop; +} + +/** + * @brief LogSegementExportThread::stopImmediately 强制停止前线程获取数据逻辑 + */ +void LogSegementExportThread::stopImmediately() +{ + QMutexLocker locker(&mutex); + m_bForceStop = true; + condition.wakeOne(); +} + +/** + * @brief LogSegementExportThread::stop 停止前线程获取数据逻辑 + */ +void LogSegementExportThread::stop() +{ + QMutexLocker locker(&mutex); + m_bStop = true; + condition.wakeOne(); +} + +/** + * @brief LogSegementExportThread::run 线程的run函数,通过配置类型执行相应的导出逻辑 + */ +void LogSegementExportThread::run() +{ + qCDebug(logSegementExport) << "threadrun"; + + QMutexLocker locker(&mutex); + while(!m_bForceStop && !m_bStop) { + if (m_logDataList.isEmpty()) { + condition.wait(&mutex); + } else { + try { + switch (m_runMode) { + case Txt: { + exportTxt(); + break; + } + case Html:{ + exportHtml(); + break; + } + case Doc: { + exportToDoc(); + break; + } + case Xls: { + exportToXls(); + break; + } + default: + break; + } + emit sigProgress(++m_nCurProcess, m_nTotalProcess); + m_logDataList.clear(); + } catch (const QString &ErrorStr) { + // 捕获到异常,导出失败,发出失败信号 + qCWarning(logSegementExport) << "Export Stop" << ErrorStr; + emit sigResult(false); + if (ErrorStr != m_forceStopStr) { + emit sigError(QString("export error: %1").arg(ErrorStr)); + } + } + } + } + + if (!m_bForceStop) { + // 保存数据 + switch (m_runMode) { + case Doc: + saveDoc(); + break; + case Xls: + closeXls(); + break; + default: + break; + } + + // 进度100% + emit sigProgress(m_nTotalProcess, m_nTotalProcess); + // 延时200ms再发送导出成功信号,关闭导出进度框,让100%的进度有时间显示 + Utils::sleep(200); + } + + emit sigResult(!m_bForceStop); + + if (m_bForceStop) { + Utils::checkAndDeleteDir(m_fileName); + } + + m_bForceStop = false; +} + +bool LogSegementExportThread::exportTxt() +{ + //判断文件路径是否存在,不存在就返回错误 + QFile fi(m_fileName); + if (!fi.open(m_bAppendWrite ? (QIODevice::Append | QIODevice::WriteOnly) : QIODevice::WriteOnly)) { + emit sigError(m_openErroStr); + return false; + } + + QTextStream out(&fi); + + for (int i = 0; i < m_logDataList.count(); i++) { + //导出逻辑启动停止控制,外部把m_forceStopStr置true时停止运行,抛出异常处理 + if (m_bForceStop) { + fi.close(); + throw QString(m_forceStopStr); + } + + int col = 0; + LOG_MSG_BASE jMsg; + jMsg.fromJson(m_logDataList[i]); + if (m_flag == KERN) { + out << m_labels.value(col++, "") << ":" << jMsg.dateTime << " "; + out << m_labels.value(col++, "") << ":" << jMsg.hostName << " "; + out << m_labels.value(col++, "") << ":" << jMsg.daemonName << " "; + out << m_labels.value(col++, "") << ":" << jMsg.msg << " "; + out << "\n"; + } else if (m_flag == Kwin) { + out << m_labels.value(col++, "") << ":" << jMsg.msg << " "; + out << "\n"; + } + } + + //设置文件编码为utf8 + out.setCodec(QTextCodec::codecForName("utf-8")); + fi.close(); + + return true; +} + +bool LogSegementExportThread::exportHtml() +{ + QFile html(m_fileName); + //判断文件路径是否存在,不存在就返回错误 + if (!html.open(m_bAppendWrite ? (QIODevice::Append | QIODevice::WriteOnly) : QIODevice::WriteOnly)) { + emit sigError(m_openErroStr); + return false; + } + + //写网页头 + html.write("\n"); + html.write("\n"); + html.write("\n"); + //写入表格标签 + html.write("\n"); + //写入表头 + html.write(""); + for (int i = 0; i < m_labels.count(); ++i) { + QString labelInfo = QString("").arg(m_labels.value(i)); + html.write(labelInfo.toUtf8().data()); + } + //写入内容 + //根据字段拼出每行的网页内容 + html.write(""); + + for (int row = 0; row < m_logDataList.count(); ++row) { + if (m_bForceStop) { + html.close(); + throw QString(m_forceStopStr); + } + LOG_MSG_BASE jMsg; + jMsg.fromJson(m_logDataList.at(row)); + htmlEscapeCovert(jMsg.msg); + html.write(""); + if (m_flag == KERN) { + QString info = QString("").arg(jMsg.dateTime); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.hostName); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.daemonName); + html.write(info.toUtf8().data()); + info = QString("").arg(jMsg.msg); + html.write(info.toUtf8().data()); + } else if (m_flag == Kwin) { + QString info = QString("").arg(jMsg.msg); + html.write(info.toUtf8().data()); + } + html.write(""); + } + + //写入结尾 + html.write("
%1
%1%1%1%1%1
\n"); + html.write("\n"); + html.write("\n"); + + html.close(); + + return true; +} + +bool LogSegementExportThread::exportToDoc() +{ + if (!m_pDocMerger) + return false; + + for (int row = 0; row < m_logDataList.count(); ++row) { + //导出逻辑启动停止控制,外部把m_forceStopStr置true时停止运行,抛出异常处理 + if (m_bForceStop) { + throw QString(m_forceStopStr); + } + LOG_MSG_BASE message; + message.fromJson(m_logDataList.at(row)); + //把数据填入表格单元格中 + if (m_flag == KERN) { + m_pDocMerger->setClipboardValue("tableRow", QString("column1").toStdString(), message.dateTime.toStdString()); + m_pDocMerger->setClipboardValue("tableRow", QString("column2").toStdString(), message.hostName.toStdString()); + m_pDocMerger->setClipboardValue("tableRow", QString("column3").toStdString(), message.daemonName.toStdString()); + m_pDocMerger->setClipboardValue("tableRow", QString("column4").toStdString(), message.msg.toStdString()); + } else if (m_flag == Kwin) { + m_pDocMerger->setClipboardValue("tableRow", QString("column1").toStdString(), message.msg.toStdString()); + } + m_pDocMerger->paste("tableRow"); + } + + return true; +} + +bool LogSegementExportThread::exportToXls() +{ + if (!m_pWorksheet) + return false; + + for (int row = 0; row < m_logDataList.count() ; ++row) { + if (m_bForceStop) { + throw QString(m_forceStopStr); + } + LOG_MSG_BASE message; + message.fromJson(m_logDataList.at(row)); + int col = 0; + + if (m_flag == KERN) { + worksheet_write_string(m_pWorksheet, static_cast(m_currentXlsRow), static_cast(col++), message.dateTime.toStdString().c_str(), nullptr); + worksheet_write_string(m_pWorksheet, static_cast(m_currentXlsRow), static_cast(col++), message.hostName.toStdString().c_str(), nullptr); + worksheet_write_string(m_pWorksheet, static_cast(m_currentXlsRow), static_cast(col++), message.daemonName.toStdString().c_str(), nullptr); + worksheet_write_string(m_pWorksheet, static_cast(m_currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); + } else if (m_flag == Kwin) { + worksheet_write_string(m_pWorksheet, static_cast(m_currentXlsRow), static_cast(col++), message.msg.toStdString().c_str(), nullptr); + } + + ++m_currentXlsRow; + } + + return true; +} + +void LogSegementExportThread::htmlEscapeCovert(QString &htmlMsg) +{ + //无法对所有转义字符进行转换,对常用转义字符转换 + htmlMsg.replace("<", "<", Qt::CaseInsensitive); + htmlMsg.replace(">", ">", Qt::CaseInsensitive); + htmlMsg.replace("?", "¡", Qt::CaseInsensitive); + htmlMsg.replace("¥", "¥", Qt::CaseInsensitive); + htmlMsg.replace("|", "¦", Qt::CaseInsensitive); +} + +void LogSegementExportThread::saveDoc() +{ + //保存,把拼好的xml写入文件中 + QString fileNamex = m_fileName + "x"; + + QFile rsNameFile(m_fileName) ; + if (rsNameFile.exists()) { + rsNameFile.remove(); + } + m_pDocMerger->save(fileNamex.toStdString()); + QFile(fileNamex).rename(m_fileName); +} + +void LogSegementExportThread::closeXls() +{ + workbook_close(m_pWorkbook); + malloc_trim(0); +} diff --git a/application/logsegementexportthread.h b/application/logsegementexportthread.h new file mode 100644 index 00000000..5bcffca1 --- /dev/null +++ b/application/logsegementexportthread.h @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef LOGSEGEMENTEXPORTTHREAD_H +#define LOGSEGEMENTEXPORTTHREAD_H +#include "structdef.h" +#include "WordProcessingMerger.h" +#include "workbook.h" + +#include +#include +#include +#include + +/** + * @brief The LogSegementExportThread class 导出日志线程类 + */ +class LogSegementExportThread : public QObject, public QRunnable +{ + Q_OBJECT +public: + explicit LogSegementExportThread(QObject *parent = nullptr); + ~LogSegementExportThread() override; + + /** + * @brief The RUN_MODE enum 导出类型,用于执行时判断要执行的逻辑 + */ + enum RUN_MODE { + UnKnown = -1, + Txt, + Html, + Doc, + Xls + }; + + // 设置导出数据 + void setParameter(const QString &fileName, const QList &jList, const QStringList& lables, LOG_FLAG flag); + // 设置是否追加写入QFile + void enableAppendWrite(const bool &bEnable = true) { m_bAppendWrite = bEnable; } + // 设置进度条总值 + void setTotalProcess(const int &total) { m_nTotalProcess = total; } + + // 判断是否正在运行 + bool isProcessing(); + +public slots: + // 正常停止,保存数据到文件 + void stop(); + // 强制停止线程,发生在点击进度条取消按钮,或关闭进度条对话框 + void stopImmediately(); + +protected: + void run() override; + +signals: + /** + * @brief sigProgress 导出进度信号 + * @param nCur 当前运行到的进度 + * @param nTotal 要运行的总数 + */ + void sigProgress(int nCur, int nTotal); + /** + * @brief sigResult 导出完成信号 + * @param isSuccess 是否成功 + */ + void sigResult(bool isSuccess); + void sigProcessFull(); + /** + * @brief sigError 导出失败 + * @param iError 失败信息 + */ + void sigError(QString iError); +private: + void initDoc(); + QString getDocTemplatePath(); + void initXls(); + + bool exportTxt(); + bool exportHtml(); + bool exportToDoc(); + bool exportToXls(); + + void htmlEscapeCovert(QString &htmlMsg); + + void saveDoc(); + void closeXls(); + +private: + //导出文件路径 + QString m_fileName = ""; + + // QFile追加写入标记 + bool m_bAppendWrite = false; + + //导出日志类型 + LOG_FLAG m_flag = NONE; + //如果导出项文本标题 + QStringList m_labels; + // 通用json格式日志数据 + QList m_logDataList; + //当前线程执行的逻辑种类 + RUN_MODE m_runMode = UnKnown; + + DocxFactory::WordProcessingMerger *m_pDocMerger { nullptr }; + lxw_workbook *m_pWorkbook { nullptr }; + lxw_worksheet *m_pWorksheet { nullptr }; + qint64 m_currentXlsRow { 0 }; + + //打开文件错误描述 + QString m_openErroStr = "export open file error"; + //强制停止导出描述信息 + QString m_forceStopStr = "force stop segement export"; + + QMutex mutex; + QWaitCondition condition; + bool m_bStop { false }; + // 用来强制停止线程 + bool m_bForceStop { false }; + + int m_nCurProcess { 0 }; + int m_nTotalProcess { 0 }; +}; + +#endif // LOGSEGEMENTEXPORTTHREAD_H diff --git a/application/logsettings.cpp b/application/logsettings.cpp index b3d72c00..5a5e128c 100644 --- a/application/logsettings.cpp +++ b/application/logsettings.cpp @@ -3,15 +3,22 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include "logsettings.h" +#include "utils.h" #include #include #include #include +#include #define MAINWINDOW_HEIGHT_NAME "logMainWindowHeightName" #define MAINWINDOW_WIDTH_NAME "logMainWindowWidthName" + std::atomic LogSettings::m_instance; std::mutex LogSettings::m_mutex; + +// 审计类型归类规则配置文件 +const QString AUDIT_CONFIG_PATH = "/usr/share/deepin-log-viewer/auditRule.conf"; + /** * @brief LogSettings::LogSettings 构造函数从配置文件初始化配置 * @param parent 父对象 @@ -23,9 +30,9 @@ LogSettings::LogSettings(QObject *parent) m_configPath(""), m_logDirPath("") { - QDir infoPath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)); + QDir infoPath(Utils::getConfigPath()); if (!infoPath.exists()) { - infoPath.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)); + infoPath.mkpath(Utils::getConfigPath()); } m_configPath = infoPath.filePath("wininfo-config.conf"); @@ -33,8 +40,6 @@ LogSettings::LogSettings(QObject *parent) m_logDirPath = infoPath.filePath("logdir-config.conf"); m_logDirConfig = new QSettings(m_logDirPath, QSettings::IniFormat, this); - - } /** @@ -75,4 +80,16 @@ void LogSettings::saveConfigWinSize(int w, int h) m_winInfoConfig->sync(); } +QMap LogSettings::loadAuditMap() +{ + QMap auditType2EventType; + QSettings auditConfig(AUDIT_CONFIG_PATH, QSettings::IniFormat); + QStringList auditTypes = auditConfig.childKeys(); + for (auto auditType : auditTypes) { + QString value = auditConfig.value(auditType).toString(); + QStringList strList = value.split('@', QString::SkipEmptyParts); + auditType2EventType.insert(auditType, strList); + } + return auditType2EventType; +} diff --git a/application/logsettings.h b/application/logsettings.h index ff3eb3ea..b9b101ba 100644 --- a/application/logsettings.h +++ b/application/logsettings.h @@ -58,6 +58,10 @@ class LogSettings : public QObject void saveConfigWinSize(int w, int h); void saveLogDir(const QString &iKey, const QString &iDir); QString getLogDir(const QString &iKey); + + // 审计类型与事件类型映射表 + static QMap loadAuditMap(); + signals: public slots: diff --git a/application/logspinnerwidget.cpp b/application/logspinnerwidget.cpp index 3386b04e..d01ed3e4 100644 --- a/application/logspinnerwidget.cpp +++ b/application/logspinnerwidget.cpp @@ -25,10 +25,10 @@ void LogSpinnerWidget::initUI() // QHBoxLayout *hh = new QHBoxLayout(this); - QHBoxLayout *h = new QHBoxLayout(this); + QHBoxLayout *h = new QHBoxLayout(); h->addStretch(1); - QVBoxLayout *v = new QVBoxLayout(this); + QVBoxLayout *v = new QVBoxLayout(); v->addStretch(1); v->addWidget(m_spinner); v->addStretch(1); diff --git a/application/logtreeview.cpp b/application/logtreeview.cpp index 50102471..e9fc8bcc 100644 --- a/application/logtreeview.cpp +++ b/application/logtreeview.cpp @@ -244,13 +244,6 @@ void LogTreeView::mouseMoveEvent(QMouseEvent *event) } if (qAbs(vertDelta) > touchmindistance && !(qAbs(vertDelta) < header()->height() + 2 && qAbs(vertDelta) > header()->height() - 2 && m_lastTouchTime.msecsTo(QTime::currentTime()) < 100)) { - double svalue = 1; - if (vertDelta > 0) { - } else if (vertDelta < 0) { - svalue = -svalue; - } else { - svalue = 0; - } verticalScrollBar()->setValue(static_cast(verticalScrollBar()->value() - vertDelta)); } m_lastTouchBeginPos = event->pos(); diff --git a/application/logtreeview.h b/application/logtreeview.h index 684c6d79..47634407 100644 --- a/application/logtreeview.h +++ b/application/logtreeview.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/application/logviewheaderview.h b/application/logviewheaderview.h index 15fd0901..fc0861d3 100644 --- a/application/logviewheaderview.h +++ b/application/logviewheaderview.h @@ -15,7 +15,7 @@ DWIDGET_USE_NAMESPACE class LogViewHeaderView : public DHeaderView { public: - LogViewHeaderView(Qt::Orientation orientation, QWidget *parent = nullptr); + explicit LogViewHeaderView(Qt::Orientation orientation, QWidget *parent = nullptr); ~LogViewHeaderView() override; QSize sizeHint() const override; diff --git a/application/main.cpp b/application/main.cpp index 453c95a1..98fd54dc 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -10,6 +10,9 @@ #include "utils.h" #include "eventlogutils.h" #include "DebugTimeManager.h" +#include "logbackend.h" +#include "cliapplicationhelper.h" +#include "accessible.h" #include #include @@ -20,9 +23,17 @@ #include #include #include +#include + DWIDGET_USE_NAMESPACE DCORE_USE_NAMESPACE +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logAppMain, "org.deepin.log.viewer.main") +#else +Q_LOGGING_CATEGORY(logAppMain, "org.deepin.log.viewer.main", QtInfoMsg) +#endif + int main(int argc, char *argv[]) { //在root下或者非deepin/uos环境下运行不会发生异常,需要加上XDG_CURRENT_DESKTOP=Deepin环境变量; @@ -30,76 +41,335 @@ int main(int argc, char *argv[]) setenv("XDG_CURRENT_DESKTOP", "Deepin", 1); } - PERF_PRINT_BEGIN("POINT-01", ""); + // 命令参数大于1,进行命令行处理 + if (argc > 1) { + QCoreApplication a(argc, argv); + a.setOrganizationName("deepin"); + a.setApplicationName("deepin-log-viewer"); + a.setApplicationVersion(VERSION); + + DLogManager::registerConsoleAppender(); + +#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 8, 0)) + DLogManager::registerJournalAppender(); +#else + DLogManager::registerFileAppender(); +#endif + +#ifdef DTKCORE_CLASS_DConfigFile + //日志规则 + LoggerRules logRules; + logRules.initLoggerRules(); +#endif + + QCommandLineOption exportOption(QStringList() << "e" << "export", DApplication::translate("main", "Export logs to the specified path"), DApplication::translate("main", "PATH")); + QCommandLineOption typeOption(QStringList() << "t" << "type", DApplication::translate("main", "Export logs of specified types"), DApplication::translate("main", "TYPE")); + QCommandLineOption appOption(QStringList() << "d" << "deepin-application", DApplication::translate("main", "Export logs of specified self-developed applications"), DApplication::translate("main", "SELF APPNAME")); + QCommandLineOption periodOption(QStringList() << "p" << "period", DApplication::translate("main", "Export logs within a specified time period"), DApplication::translate("main", "PERIOD")); + QCommandLineOption levelOption(QStringList() << "l" << "level", DApplication::translate("main", "Export logs within a specified debug level"), DApplication::translate("main", "LEVEL")); + QCommandLineOption statusOption(QStringList() << "s" << "status", DApplication::translate("main", "Export boot(no-klu) logs within a specified status"), DApplication::translate("main", "BOOT STATUS")); + QCommandLineOption eventOption(QStringList() << "E" << "event", DApplication::translate("main", "Export boot-shutdown-event or audit logs within a specified event type"), DApplication::translate("main", "EVENT TYPE")); + QCommandLineOption keywordOption(QStringList() << "k" << "keyword", DApplication::translate("main", "Export logs based on keywords search results"), DApplication::translate("main", "KEY WORD")); + QCommandLineOption submoduleOption(QStringList() << "m" << "submodule", DApplication::translate("main", "Export logs based on app submodel"), DApplication::translate("main", "SUBMODULE")); + QCommandLineOption reportCoredumpOption(QStringList() << "reportcoredump", DApplication::translate("main", "Report coredump informations.")); + + QCommandLineParser cmdParser; + cmdParser.setApplicationDescription("deepin-log-viewer"); + cmdParser.addHelpOption(); + cmdParser.addVersionOption(); + cmdParser.addOption(exportOption); + cmdParser.addOption(typeOption); + cmdParser.addOption(appOption); + cmdParser.addOption(periodOption); + cmdParser.addOption(levelOption); + cmdParser.addOption(statusOption); + cmdParser.addOption(eventOption); + cmdParser.addOption(keywordOption); + cmdParser.addOption(submoduleOption); + cmdParser.addOption(reportCoredumpOption); + + if (!cmdParser.parse(qApp->arguments())) { + cmdParser.showHelp(-1); + } + + cmdParser.process(a); + + // cli命令处理 + QStringList args = cmdParser.positionalArguments(); + QString type = ""; + QString appName = ""; + QString period = ""; + QString level = ""; + QString status = ""; + QString event = ""; + QString submodule = ""; + QString keyword = ""; + if (cmdParser.isSet(typeOption)) + type = cmdParser.value(typeOption); + if (cmdParser.isSet(appOption)) + appName = cmdParser.value(appOption); + if (cmdParser.isSet(periodOption)) + period = cmdParser.value(periodOption); + if (cmdParser.isSet(levelOption)) + level = cmdParser.value(levelOption); + if (cmdParser.isSet(statusOption)) + status = cmdParser.value(statusOption); + if (cmdParser.isSet(eventOption)) + event = cmdParser.value(eventOption); + if (cmdParser.isSet(submoduleOption)) + submodule = cmdParser.value(submoduleOption); + if (cmdParser.isSet(keywordOption)) { + // Qt命令行解析器不能完整获取--key后的参数内容, + // 此处做特殊处理,以便能完整获取--key后的参数内容 + int nKeyIndex = -1; + for (int i = 0; i < argc; i++) { + QString tmpArg = argv[i]; + if (tmpArg == "-k") { + nKeyIndex = i; + continue; + } + + if (nKeyIndex != -1) { + if ((tmpArg.startsWith("-") && tmpArg.size() == 2) + || tmpArg.startsWith("--")) { + break; + } else { + if (!keyword.isEmpty()) { + keyword += " "; + } + keyword += tmpArg; + } + } + } + } + + if (cmdParser.isSet(reportCoredumpOption)) { + if (!type.isEmpty() || + !appName.isEmpty() || + !period.isEmpty() || + !level.isEmpty() || + !status.isEmpty() || + !event.isEmpty() || + !submodule.isEmpty() || + !keyword.isEmpty() || + cmdParser.isSet(exportOption)) { + qCWarning(logAppMain) << "Only reportcoreump option can set, please do not add other options."; + return -1; + } + + Utils::runInCmd = true; + if (!LogBackend::instance(&a)->reportCoredumpInfo()) + return -1; + + return a.exec(); + } else if (cmdParser.isSet(exportOption)) { + + if (!CliApplicationHelper::instance()->setSingleInstance(a.applicationName(), + CliApplicationHelper::UserScope)) { + return 0; + } + + Utils::runInCmd = true; + + // 若指定有导出目录,按指定目录导出 + QString outDir = cmdParser.value(exportOption); + if (outDir.isEmpty()) { + qCWarning(logAppMain) << "plseae input outpath."; + return -1; + } + + if (!type.isEmpty() && type != "app" && !appName.isEmpty()) { + qCWarning(logAppMain) << QString("Option -d -t both exist, -t can only be set to 'app' type."); + return -1; + } - //klu下不使用opengl 使用OpenGLES,因为opengl基于x11 现在全面换wayland了 - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - //klu下不使用opengl 使用OpenGLES,因为opengl基于x11 现在全面换wayland了,这个真正有效 - qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell"); - QString systemName = DBusManager::getSystemInfo(); - qDebug() << "systemName" << systemName; - if (Utils::isWayland()) { + if (!type.isEmpty()) { + // 按类型导出日志 + if (period.isEmpty() && + level.isEmpty() && + status.isEmpty() && + event.isEmpty() && + appName.isEmpty() && + submodule.isEmpty() && + keyword.isEmpty()) { + int nRet = LogBackend::instance(&a)->exportTypeLogs(outDir, type); + return nRet; + } else { + // 按筛选条件导出指定类型的日志 + bool bRet = false; + QString error(""); + LOG_FLAG flag = LogBackend::type2Flag(type, error); + if (TYPE_SYSTEM == type || Dmesg == flag || TYPE_DNF == type){ + // system、dmesg(centos下内核日志)、dnf 可按周期或级别导出 + if (!status.isEmpty() || !event.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'period' or 'level' or 'keyword' parameters.").arg(type); + else + bRet = LogBackend::instance(&a)->exportTypeLogsByCondition(outDir, type, period, level, keyword); + } else if (BOOT_KLU == flag) { + // boot_klu级别导出 + if (!status.isEmpty() || !event.isEmpty() || !period.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'level' or 'keyword' parameters.").arg(type); + else + bRet = LogBackend::instance(&a)->exportTypeLogsByCondition(outDir, type, period, level, keyword); + } else if (KERN == flag || TYPE_DPKG == type || TYPE_COREDUMP == type) { + // 内核、dpkg、崩溃日志 可按周期导出 + if (!level.isEmpty() || !status.isEmpty() || !event.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'period' or 'keyword' parameters.").arg(type); + else + bRet = LogBackend::instance(&a)->exportTypeLogsByCondition(outDir, type, period, "", keyword); + } else if (BOOT == flag) { + // 启动日志 可按状态导出 + if (!period.isEmpty() || !level.isEmpty() || !event.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'status' or 'keyword' parameters.").arg(type); + else + bRet = LogBackend::instance(&a)->exportTypeLogsByCondition(outDir, type, "", status, keyword); + } else if (TYPE_APP == type) { + if (!status.isEmpty() || !event.isEmpty()) { + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'period' or 'level' or 'keyword' or 'submodule' parameters.").arg(type); + } else if (!appName.isEmpty()) { + bRet = LogBackend::instance(&a)->exportAppLogsByCondition(outDir, appName, period, level, submodule, keyword); + } else { + qCWarning(logAppMain) << QString("Export logs by %1, filterd by 'period' or 'level' or 'keyword' or 'submodule', currently not supported.").arg(type).arg(appName); + } + } else if (TYPE_BSE == type || TYPE_AUDIT == type) { + // 开关机事件、审计日志 可按周期和事件类型导出 + if (!level.isEmpty() || !status.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'period' or 'event' or 'keyword' parameters.").arg(type); + else + bRet = LogBackend::instance(&a)->exportTypeLogsByCondition(outDir, type, period, event, keyword); + } else if (TYPE_XORG == type || TYPE_OTHER == type || TYPE_CUSTOM == type || TYPE_KWIN == type) { + // Xorg、Kwin 只能按关键字导出 + if (!period.isEmpty() || !level.isEmpty() || !status.isEmpty() || !event.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, can only be filtered using 'keyword' parameters.").arg(type); + else + bRet = LogBackend::instance(&a)->exportTypeLogsByCondition(outDir, type, period, event, keyword); + } else if (TYPE_OTHER == type || TYPE_CUSTOM == type) { + // 其他、自定义日志 不能按条件导出 + if (!period.isEmpty() || !level.isEmpty() || !status.isEmpty() || !event.isEmpty()) + qCWarning(logAppMain) << QString("Export logs by %1, cannot be filtered by any parameters.").arg(type); + } else { + qCWarning(logAppMain) << error; + } + + if (!bRet) + return -1; + } + } else if (!appName.isEmpty()) { + if (period.isEmpty() && + level.isEmpty() && + status.isEmpty() && + event.isEmpty() && + submodule.isEmpty() && + keyword.isEmpty()) { + int nRet = LogBackend::instance(&a)->exportAppLogs(outDir, appName); + return nRet; + } else { + bool bRet = false; + if (!status.isEmpty() || !event.isEmpty()) + qCWarning(logAppMain) << QString("Export app logs, can only be filtered using 'period' or 'level' or 'keyword' or 'submodule' parameter."); + else if (!period.isEmpty() || !level.isEmpty() || !keyword.isEmpty() || !submodule.isEmpty()) + bRet = LogBackend::instance(&a)->exportAppLogsByCondition(outDir, appName, period, level, submodule, keyword); + if (!bRet) + return -1; + } + } else { + if (!period.isEmpty() || !level.isEmpty() || !status.isEmpty() || !event.isEmpty() || !submodule.isEmpty() || !keyword.isEmpty()) { + qCWarning(logAppMain) << "Export all logs by conditons currently is not supported."; + return -1; + } + // 未指定类型,默认导出所有日志 + int nRet = LogBackend::instance(&a)->exportAllLogs(outDir); + if (nRet != 0) + return nRet; + } + + return a.exec(); + } else { + qCWarning(logAppMain) <<"Missing export path, please enter the '-e' parameter."; + return -1; + } + } else { + + PERF_PRINT_BEGIN("POINT-01", ""); + + //klu下不使用opengl 使用OpenGLES,因为opengl基于x11 现在全面换wayland了 + QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); + //klu下不使用opengl 使用OpenGLES,因为opengl基于x11 现在全面换wayland了,这个真正有效 qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell"); - } - setenv("PULSE_PROP_media.role", "video", 1); - QSurfaceFormat format; - format.setRenderableType(QSurfaceFormat::OpenGLES); - format.setDefaultFormat(format); - LogApplication a(argc, argv); - - //wayland环境判断 - auto systemEnv = QProcessEnvironment::systemEnvironment(); - QString XDG_SESSION_TYPE = systemEnv.value(QStringLiteral("XDG_SESSION_TYPE")); - QString WAYLAND_DISPLAY = systemEnv.value(QStringLiteral("WAYLAND_DISPLAY")); - qDebug() << "XDG_SESSION_TYPE:" << XDG_SESSION_TYPE << "---WAYLAND_DISPLAY:" << WAYLAND_DISPLAY; - qputenv("DTK_USE_SEMAPHORE_SINGLEINSTANCE", "1"); - - if (!DGuiApplicationHelper::instance()->setSingleInstance(a.applicationName(), - DGuiApplicationHelper::UserScope)) { - qInfo() << "DGuiApplicationHelper::instance()->setSingleInstance"; - a.activeWindow(); - return 0; - } + if (Utils::isWayland()) { + qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell"); + } + setenv("PULSE_PROP_media.role", "video", 1); + QSurfaceFormat format; + format.setRenderableType(QSurfaceFormat::OpenGLES); + format.setDefaultFormat(format); + LogApplication a(argc, argv); + + qputenv("DTK_USE_SEMAPHORE_SINGLEINSTANCE", "1"); + + //高分屏支持 + a.setAttribute(Qt::AA_UseHighDpiPixmaps); + a.setAutoActivateWindows(true); + a.loadTranslator(); + a.setOrganizationName("deepin"); + a.setApplicationName("deepin-log-viewer"); + a.setApplicationVersion(VERSION); + a.setProductIcon(QIcon::fromTheme("deepin-log-viewer")); + a.setWindowIcon(QIcon::fromTheme("deepin-log-viewer")); + a.setProductName(DApplication::translate("Main", "Log Viewer")); + a.setApplicationDisplayName(DApplication::translate("Main", "Log Viewer")); + a.setApplicationDescription( + DApplication::translate("Main", "Log Viewer is a useful tool for viewing system logs.")); + +#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 8, 0)) + DLogManager::registerJournalAppender(); +#ifdef QT_DEBUG + DLogManager::registerConsoleAppender(); +#endif +#else + DLogManager::registerConsoleAppender(); + DLogManager::registerFileAppender(); +#endif - //高分屏支持 - a.setAttribute(Qt::AA_UseHighDpiPixmaps); - a.setAutoActivateWindows(true); - a.loadTranslator(); - a.setOrganizationName("deepin"); - a.setApplicationName("deepin-log-viewer"); - a.setApplicationVersion(VERSION); - a.setProductIcon(QIcon::fromTheme("deepin-log-viewer")); - a.setWindowIcon(QIcon::fromTheme("deepin-log-viewer")); - a.setProductName(DApplication::translate("Main", "Log Viewer")); - a.setApplicationDisplayName(DApplication::translate("Main", "Log Viewer")); - a.setApplicationDescription( - DApplication::translate("Main", "Log Viewer is a useful tool for viewing system logs.")); - DApplicationSettings settings; - DLogManager::registerConsoleAppender(); - DLogManager::registerFileAppender(); - LogApplicationHelper::instance(); - - //命令行参数的解析 - QCommandLineParser cmdParser; - cmdParser.setApplicationDescription("deepin-log-viewer"); - cmdParser.addHelpOption(); - cmdParser.addVersionOption(); - cmdParser.process(a); - - LogCollectorMain w; - a.setMainWindow(&w); - - //埋点记录启动数据 - QJsonObject objStartEvent{ - {"tid", Eventlogutils::StartUp}, - {"vsersion", VERSION}, - {"mode", 1}, - }; - Eventlogutils::GetInstance()->writeLogs(objStartEvent); - - w.show(); - Dtk::Widget::moveToCenter(&w); - bool result = a.exec(); - PERF_PRINT_END("POINT-02", ""); - return result; +#ifdef DTKCORE_CLASS_DConfigFile + //日志规则 + LoggerRules logRules; + logRules.initLoggerRules(); +#endif + LogApplicationHelper::instance(); + + if (!DGuiApplicationHelper::instance()->setSingleInstance(a.applicationName(), + DGuiApplicationHelper::UserScope)) { + qCCritical(logAppMain) << "DGuiApplicationHelper::instance()->setSingleInstance"; + a.activeWindow(); + return 0; + } + + // 显示GUI + LogCollectorMain w; + a.setMainWindow(&w); + + // 自动化标记由此开始 + QAccessible::installFactory(accessibleFactory); + + // 先初始化埋点接口,延迟2秒后调用埋点接口,以便能正常写入埋点数据 + Eventlogutils::GetInstance(); + QTimer::singleShot(2000, &a, [=]{ + //埋点记录启动数据 + QJsonObject objStartEvent{ + {"tid", Eventlogutils::StartUp}, + {"vsersion", VERSION}, + {"mode", 1}, + }; + Eventlogutils::GetInstance()->writeLogs(objStartEvent); + }); + + w.show(); + Dtk::Widget::moveToCenter(&w); + bool result = a.exec(); + PERF_PRINT_END("POINT-02", ""); + + return result; + + } } diff --git a/application/parsethread/parsethreadbase.cpp b/application/parsethread/parsethreadbase.cpp new file mode 100755 index 00000000..1a0c8c88 --- /dev/null +++ b/application/parsethread/parsethreadbase.cpp @@ -0,0 +1,108 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "parsethreadbase.h" + +#include +#include +using namespace std; + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logParseWork, "org.deepin.log.viewer.parse.work") +#else +Q_LOGGING_CATEGORY(logParseWork, "org.deepin.log.viewer.parse.work", QtInfoMsg) +#endif + +int ParseThreadBase::thread_count = 0; + +/** + * @brief ParseThreadBase::ParseThreadBase 构造函数 + * @param parent 父对象 + */ +ParseThreadBase::ParseThreadBase(QObject *parent) + : QObject(parent) + , QRunnable() + , m_type(NONE) +{ + qRegisterMetaType("ParseThreadBase::Status"); + //使用线程池启动该线程,跑完自己删自己 + setAutoDelete(true); + //静态计数变量加一并赋值给本对象的成员变量,以供外部判断是否为最新线程发出的数据信号 + thread_count++; + m_threadCount = thread_count; + + initConnect(); +} + +/** + * @brief ParseThreadBase::~ParseThreadBase 析构函数,停止并销毁process指针 + */ +ParseThreadBase::~ParseThreadBase() +{ + stopProccess(); +} + +void ParseThreadBase::initConnect() +{ + m_pParser = dynamic_cast(this->parent()); + if (m_pParser) { + connect(this, &ParseThreadBase::parseFinished, m_pParser, &LogFileParser::parseFinished); + connect(this, &ParseThreadBase::logData, m_pParser, &LogFileParser::logData); + connect(m_pParser, &LogFileParser::stop, this, &ParseThreadBase::stopProccess); + } +} + +/** + * @brief ParseThreadBase::initProccess 初始化QProcess指针 + */ +void ParseThreadBase::initProccess() +{ + if (!m_process) { + m_process.reset(new QProcess); + } +} + +/** + * @brief ParseThreadBase::stopProccess 停止日志数据获取进程并销毁 + */ +void ParseThreadBase::stopProccess() +{ + //防止正在执行时重复执行 + if (m_isStopProccess) { + return; + } + m_isStopProccess = true; + //停止获取线程执行,标记量置false + m_canRun = false; + if (!Utils::runInCmd) { + //共享内存数据结构,用于和获取进程共享内存,数据为是否可执行进程,用于控制数据获取进程停止,因为这里会出现需要提权执行的进程,主进程没有权限停止提权进程,所以使用共享内存变量标记量控制提权进程停止 + ShareMemoryInfo shareInfo ; + //设置进程为不可执行 + shareInfo.isStart = false; + //把数据付给共享内存中对应的变量 + SharedMemoryManager::instance()->setRunnableTag(shareInfo); + } + if (m_process) { + m_process->kill(); + } +} + +void ParseThreadBase::setFilter(LOG_FILTER_BASE &filter) +{ + m_type = filter.type; + m_filter = filter; +} + +int ParseThreadBase::getIndex() +{ + return m_threadCount; +} + +/** + * @brief ParseThreadBase::run 线程执行虚函数 + */ +void ParseThreadBase::run() +{ + m_canRun = false; +} diff --git a/application/parsethread/parsethreadbase.h b/application/parsethread/parsethreadbase.h new file mode 100644 index 00000000..68ae5db2 --- /dev/null +++ b/application/parsethread/parsethreadbase.h @@ -0,0 +1,95 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef PARSETHREADBASE_H +#define PARSETHREADBASE_H +#include "../application/structdef.h" +#include "../application/dbusproxy/dldbushandler.h" +#include "../application/sharedmemorymanager.h" +#include "../application/logfileparser.h" + +#include +#include + +/** + * @brief The ParseThreadKern class 启动日志 内核日志 kwin日志 xorg日志 dpkg日志获取线程 + */ +class ParseThreadBase : public QObject, public QRunnable +{ + Q_OBJECT +public: + explicit ParseThreadBase(QObject *parent = nullptr); + ~ParseThreadBase() override; + + enum Status { + Normal = 0, //正常结束 + CancelAuth, //取消鉴权 + ForceStop //强制停止 + }; + + // 设置筛选条件 + virtual void setFilter(LOG_FILTER_BASE &filter); + + void stopProccess(); + int getIndex(); + /** + * @brief thread_index 静态成员变量,用来每次构造时标记新的当前线程对象 m_threadIndex + */ + static int thread_count; + +signals: + /** + * @brief parseFinished 解析完成信号 + * @param index 当前线程的数字标号 + * @param type 日志种类 + */ + void parseFinished(int index, LOG_FLAG type, ParseThreadBase::Status status = Normal); + + /** + * @brief logData 日志数据发送信号 + * @param index 当前线程的数字标号 + * @param iDataList json字串日志数据list + * @param type 日志种类 + */ + void logData(int index, const QList &iDataList, LOG_FLAG type); + + void proccessError(const QString &iError); + +protected: + void initConnect(); + void initProccess(); + + void run() override = 0; + +protected: + + /** + * @brief m_type 当前线程获取日志数据的类型,用来指定不同的获取逻辑和返回结果 + */ + LOG_FLAG m_type; + + // 解析器对象,用来传递解析数据和信号 + LogFileParser* m_pParser = nullptr; + /** + * @brief m_filter 日志筛选条件 + */ + LOG_FILTER_BASE m_filter; + + //获取数据用的cat命令的process + QScopedPointer m_process; + /** + * @brief m_canRun 是否可以继续运行的标记量,用于停止运行线程 + */ + std::atomic_bool m_canRun = false; + /** + * @brief m_threadIndex 当前线程标号 + */ + int m_threadCount; + //正在执行停止进程的变量,防止重复执行停止逻辑 + bool m_isStopProccess = false; +}; + +Q_DECLARE_METATYPE(ParseThreadBase::Status) + +#endif // PARSETHREADBASE_H diff --git a/application/parsethread/parsethreadkern.cpp b/application/parsethread/parsethreadkern.cpp new file mode 100755 index 00000000..30d7c719 --- /dev/null +++ b/application/parsethread/parsethreadkern.cpp @@ -0,0 +1,239 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "parsethreadkern.h" + +#include +#include +#include +using namespace std; + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logParseWorkKern, "org.deepin.log.viewer.parse.work.kern") +#else +Q_LOGGING_CATEGORY(logParseWorkKern, "org.deepin.log.viewer.parse.work.kern", QtInfoMsg) +#endif + +/** + * @brief ParseThreadKern::ParseThreadKern 构造函数 + * @param parent 父对象 + */ +ParseThreadKern::ParseThreadKern(QObject *parent) + : ParseThreadBase(parent) +{ + +} + +/** + * @brief ParseThreadKern::~ParseThreadKern 析构函数,停止并销毁process指针 + */ +ParseThreadKern::~ParseThreadKern() +{ + +} + +/** + * @brief ParseThreadKern::run 线程执行虚函数 + */ +void ParseThreadKern::run() +{ + //此线程刚开始把可以继续变量置true,不然下面没法跑 + m_canRun = true; + + handleKern(); +} + +/** + * @brief ParseThreadKern::handleKern 处理获取内核日志 + */ +void ParseThreadKern::handleKern() +{ + QList dataList; + qint64 gStartLine = m_filter.segementIndex * SEGEMENT_SIZE; + m_FilePath = DLDBusHandler::instance(this)->getFileInfo(m_filter.filePath, false); + for (int i = 0; i < m_FilePath.count(); i++) { + if (!m_FilePath.at(i).contains("txt")) { + QFile file(m_FilePath.at(i)); // add by Airy + if (!file.exists()) { + emit parseFinished(m_threadCount, m_type); + return; + } + } + if (!m_canRun) { + return; + } + + if (!Utils::runInCmd) { + initProccess(); + if (!m_canRun) { + return; + } + m_process->setProcessChannelMode(QProcess::MergedChannels); + if (!m_canRun) { + return; + } + //共享内存对应变量置true,允许进程内部逻辑运行 + ShareMemoryInfo shareInfo; + shareInfo.isStart = true; + SharedMemoryManager::instance()->setRunnableTag(shareInfo); + //启动日志需要提权获取,运行的时候把对应共享内存的名称传进去,方便获取进程拿标记量判断是否继续运行 + m_process->start("pkexec", QStringList() << "logViewerAuth" + << m_FilePath.at(i) << SharedMemoryManager::instance()->getRunnableKey()); + m_process->waitForFinished(-1); + //有错则传出空数据 + if (m_process->exitCode() != 0) { + emit parseFinished(m_threadCount, m_type, CancelAuth); + return; + } + } + + if (!m_canRun) { + return; + } + + //如果是压缩文件,对其解压缩 + QString filePath = m_FilePath.at(i); + if(QString::compare(QFileInfo(filePath).suffix(), "gz", Qt::CaseInsensitive) == 0){ + QStringList filePathList = DLDBusHandler::instance(this)->getFileInfo(filePath); + if(filePathList.size()){ + filePath = filePathList.at(0); + }else { + filePath = ""; + } + } + + qint64 lineCount = DLDBusHandler::instance(this)->getLineCount(filePath); + + // 获取全局起始行在当前文件的相对起始行位置 + if (gStartLine >= lineCount) { + gStartLine -= lineCount; + continue; + } + + qint64 startLine = gStartLine; + + QStringList strList = DLDBusHandler::instance(this)->readLogLinesInRange(filePath, startLine, SEGEMENT_SIZE); + for (int j = strList.size() - 1; j >= 0; --j) { + if (!m_canRun) { + return; + } + QString str = strList.at(j); + LOG_MSG_BASE msg; + //删除颜色格式字符 + str.replace(QRegExp("\\#033\\[\\d+(;\\d+){0,2}m"), ""); + QStringList list = str.split(" ", QString::SkipEmptyParts); + if (list.size() < 5) + continue; + //获取内核年份接口已添加,等待系统接口添加年份改变相关日志 + QStringList timeList; + if (list[0].contains("-")) { + timeList.append(list[0]); + timeList.append(list[1]); + iTime = formatDateTime(list[0], list[1]); + } else { + timeList.append(list[0]); + timeList.append(list[1]); + timeList.append(list[2]); + iTime = formatDateTime(list[0], list[1], list[2]); + } + + //对时间筛选 + if (m_filter.timeFilterBegin > 0 && m_filter.timeFilterEnd > 0) { + if (iTime < m_filter.timeFilterBegin || iTime > m_filter.timeFilterEnd) + continue; + } + + msg.dateTime = timeList.join(" "); + QStringList tmpList; + if (list[0].contains("-")) { + msg.hostName = list[2]; + tmpList = list[3].split("["); + } else { + msg.hostName = list[3]; + tmpList = list[4].split("["); + } + + int m = 0; + //内核日志存在年份,解析用户名和进程id + if (list[0].contains("-")) { + if (tmpList.size() != 2) { + msg.daemonName = list[3].split(":")[0]; + } else { + msg.daemonName = list[3].split("[")[0]; + QString id = list[3].split("[")[1]; + id.chop(2); + msg.daemonId = id; + } + m = 4; + } else {//内核日志不存在年份,解析用户名和进程id + if (tmpList.size() != 2) { + msg.daemonName = list[4].split(":")[0]; + } else { + msg.daemonName = list[4].split("[")[0]; + QString id = list[4].split("[")[1]; + id.chop(2); + msg.daemonId = id; + } + m = 5; + } + + QString msgInfo; + for (int k = m; k < list.size(); k++) { + msgInfo.append(list[k] + " "); + } + msg.msg = msgInfo; + + dataList.append(QJsonDocument(msg.toJson()).toJson(QJsonDocument::Compact)); + if (!m_canRun) { + return; + } + //每获得500个数据就发出信号给控件加载 + if (dataList.count() % SINGLE_READ_CNT == 0) { + emit logData(m_threadCount, dataList, m_type); + dataList.clear(); + } + if (!m_canRun) { + return; + } + } + } + //最后可能有余下不足500的数据 + if (dataList.count() >= 0) { + emit logData(m_threadCount, dataList, m_type); + } + emit parseFinished(m_threadCount, m_type); +} + +/** + * @brief ParseThreadKern::formatDateTime 内核日志没有年份 格式为Sep 29 15:53:34 所以需要特殊转换 + * @param m 月份字符串 + * @param d 日期字符串 + * @param t 时间字符串 + * @return 时间毫秒数 + */ +qint64 ParseThreadKern::formatDateTime(QString m, QString d, QString t) +{ + QLocale local(QLocale::English, QLocale::UnitedStates); + + QDate curdt = QDate::currentDate(); + + QString tStr = QString("%1 %2 %3 %4").arg(m).arg(d).arg(curdt.year()).arg(t); + QDateTime dt = local.toDateTime(tStr, "MMM d yyyy hh:mm:ss"); + return dt.toMSecsSinceEpoch(); +} + +/** + * @brief ParseThreadKern::formatDateTime 内核日志有年份 格式为2020-01-05 所以需要特殊转换 + * @param y 年月日 + * @param t 时间字符串 + * @return 时间毫秒数 + */ +qint64 ParseThreadKern::formatDateTime(QString y, QString t) +{ + //when /var/kern.log have the year + QLocale local(QLocale::English, QLocale::UnitedStates); + QString tStr = QString("%1 %2").arg(y).arg(t); + QDateTime dt = local.toDateTime(tStr, "yyyy-MM-dd hh:mm:ss"); + return dt.toMSecsSinceEpoch(); +} diff --git a/application/parsethread/parsethreadkern.h b/application/parsethread/parsethreadkern.h new file mode 100644 index 00000000..cc72791b --- /dev/null +++ b/application/parsethread/parsethreadkern.h @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef PARSETHREADKERN_H +#define PARSETHREADKERN_H + +#include "parsethreadbase.h" + +/** + * @brief The ParseThreadKern class 内核日志获取线程 + */ +class ParseThreadKern : public ParseThreadBase +{ + Q_OBJECT +public: + explicit ParseThreadKern(QObject *parent = nullptr); + ~ParseThreadKern() override; + +protected: + void run() override; + + void handleKern(); + + qint64 formatDateTime(QString m, QString d, QString t); + qint64 formatDateTime(QString y, QString t); + +private: + //日志显示时间(毫秒) + qint64 iTime { 0 }; + //所有日志文件路径 + QStringList m_FilePath; +}; + +#endif // PARSETHREADKERN_H diff --git a/application/parsethread/parsethreadkwin.cpp b/application/parsethread/parsethreadkwin.cpp new file mode 100755 index 00000000..1e877584 --- /dev/null +++ b/application/parsethread/parsethreadkwin.cpp @@ -0,0 +1,105 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "parsethreadkwin.h" + +#include +#include +#include +using namespace std; + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logParseWorkKwin, "org.deepin.log.viewer.parse.work.kwin") +#else +Q_LOGGING_CATEGORY(logParseWorkKwin, "org.deepin.log.viewer.parse.work.kwin", QtInfoMsg) +#endif + +/** + * @brief ParseThreadKwin::ParseThreadKwin 构造函数 + * @param parent 父对象 + */ +ParseThreadKwin::ParseThreadKwin(QObject *parent) + : ParseThreadBase(parent) +{ + +} + +/** + * @brief ParseThreadKwin::~ParseThreadKwin 析构函数,停止并销毁process指针 + */ +ParseThreadKwin::~ParseThreadKwin() +{ + +} + +/** + * @brief ParseThreadKwin::run 线程执行虚函数 + */ +void ParseThreadKwin::run() +{ + //此线程刚开始把可以继续变量置true,不然下面没法跑 + m_canRun = true; + + handleKwin(); +} + +/** + * @brief ParseThreadKwin::handleKern 处理获取内核日志 + */ +void ParseThreadKwin::handleKwin() +{ + QFile file(KWIN_TREE_DATA); + if (!m_canRun) { + return; + } + QList dataList; + if (!file.exists()) { + emit parseFinished(m_threadCount, m_type); + return; + } + if (!m_canRun) { + return; + } + + qint64 gStartLine = m_filter.segementIndex * SEGEMENT_SIZE; + qint64 lineCount = DLDBusHandler::instance(this)->getLineCount(KWIN_TREE_DATA); + + // 获取全局起始行在当前文件的相对起始行位置 + if (gStartLine >= lineCount) { + return; + } + + qint64 startLine = gStartLine; + QStringList strList = DLDBusHandler::instance(this)->readLogLinesInRange(KWIN_TREE_DATA, startLine, SEGEMENT_SIZE); + if (!m_canRun) { + return; + } + + for (int i = strList.size() - 1; i >= 0 ; --i) { + QString str = strList.at(i); + if (!m_canRun) { + return; + } + if (str.trimmed().isEmpty()) { + continue; + } + LOG_MSG_BASE msg; + msg.msg = str; + dataList.append(QJsonDocument(msg.toJson()).toJson(QJsonDocument::Compact)); + //每获得500个数据就发出信号给控件加载 + if (dataList.count() % SINGLE_READ_CNT == 0) { + emit logData(m_threadCount, dataList, m_type); + dataList.clear(); + } + } + + if (!m_canRun) { + return; + } + //最后可能有余下不足500的数据 + if (dataList.count() >= 0) { + emit logData(m_threadCount, dataList, m_type); + } + emit parseFinished(m_threadCount, m_type); +} diff --git a/application/parsethread/parsethreadkwin.h b/application/parsethread/parsethreadkwin.h new file mode 100644 index 00000000..c97faee7 --- /dev/null +++ b/application/parsethread/parsethreadkwin.h @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2019 - 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef PARSETHREADKWIN_H +#define PARSETHREADKWIN_H + +#include "parsethreadbase.h" + +/** + * @brief The ParseThreadKwin class 窗管日志获取线程 + */ +class ParseThreadKwin : public ParseThreadBase +{ + Q_OBJECT +public: + explicit ParseThreadKwin(QObject *parent = nullptr); + ~ParseThreadKwin() override; + +protected: + void run() override; + + void handleKwin(); +}; + +#endif // PARSETHREADKWIN_H diff --git a/application/sharedmemorymanager.cpp b/application/sharedmemorymanager.cpp index 8c439407..6826285e 100644 --- a/application/sharedmemorymanager.cpp +++ b/application/sharedmemorymanager.cpp @@ -1,10 +1,18 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "sharedmemorymanager.h" #include #include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logSM, "org.deepin.log.viewer.share.memory.manager") +#else +Q_LOGGING_CATEGORY(logSM, "org.deepin.log.viewer.share.memory.manager", QtInfoMsg) +#endif + #define LOG_POLIKIT_STOP_TAG "LOGAUTHCONTROL" std::atomic SharedMemoryManager::m_instance; std::mutex SharedMemoryManager::m_mutex; @@ -14,15 +22,20 @@ SharedMemoryManager::SharedMemoryManager(QObject *parent) init(); } +SharedMemoryManager *SharedMemoryManager::getInstance() +{ + return m_instance.load(); +} + void SharedMemoryManager::setRunnableTag(ShareMemoryInfo iShareInfo) { m_commondM->lock(); - qDebug() << "setRunnableTag" << iShareInfo.isStart; + qCDebug(logSM) << "ShareMemoryInfo.isStart:" << iShareInfo.isStart; m_pShareMemoryInfo = static_cast(m_commondM->data()); if (m_pShareMemoryInfo) { m_pShareMemoryInfo->isStart = iShareInfo.isStart; } else { - qWarning() << "conntrol mem is Not Attech "; + //qCWarning(logSM) << "conntrol mem is Not Attech "; } m_commondM->unlock(); @@ -42,10 +55,10 @@ void SharedMemoryManager::releaseMemory() { if (m_commondM) { // m_commondM->unlock(); - qDebug() << "m_commondM->error" << m_commondM->error() << m_commondM->errorString(); + qCDebug(logSM) << "shared memory error:" << m_commondM->error() << m_commondM->errorString(); if (m_commondM->isAttached()) //检测程序当前是否关联共享内存 m_commondM->detach(); - qDebug() << "m_commondM->error" << m_commondM->error() << m_commondM->errorString(); + qCDebug(logSM) << "shared memory error:" << m_commondM->error() << m_commondM->errorString(); } } @@ -60,7 +73,7 @@ void SharedMemoryManager::init() if (m_commondM->isAttached()) //检测程序当前是否关联共享内存 m_commondM->detach(); if (!m_commondM->create(sizeof(ShareMemoryInfo))) { //创建共享内存,大小为size - qWarning() << "ShareMemory create error" << m_commondM->key() << QSharedMemory::SharedMemoryError(m_commondM->error()) << m_commondM->errorString(); + qCWarning(logSM) << "ShareMemory create error" << m_commondM->key() << QSharedMemory::SharedMemoryError(m_commondM->error()) << m_commondM->errorString(); if (m_commondM->isAttached()) //检测程序当前是否关联共享内存 m_commondM->detach(); m_commondM->attach(); diff --git a/application/sharedmemorymanager.h b/application/sharedmemorymanager.h index a3e7b3a6..1cc1987c 100644 --- a/application/sharedmemorymanager.h +++ b/application/sharedmemorymanager.h @@ -29,6 +29,7 @@ class SharedMemoryManager : public QObject } return sin; } + static SharedMemoryManager *getInstance(); void setRunnableTag(ShareMemoryInfo iShareInfo); QString getRunnableKey(); bool isAttached(); diff --git a/application/structdef.h b/application/structdef.h index 1d0da701..6a79b9bb 100644 --- a/application/structdef.h +++ b/application/structdef.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -6,7 +6,11 @@ #define STRUCTDEF_H #include #include +#include +#include +#include +#include "utils.h" #define DPKG_TABLE_DATA "dpkgItemData" #define XORG_TABLE_DATA "XorgItemData" #define BOOT_TABLE_DATA "bootItemData" @@ -19,12 +23,14 @@ #define DMESG_TABLE_DATA "dmesgItemData" #define DNF_TABLE_DATA "dnfItemData" #define OOC_TABLE_DATA "OOCItemData" +#define AUDIT_TABLE_DATA "auditItemData" +#define COREDUMP_TABLE_DATA "coredumpItemData" #define JOUR_TREE_DATA "journalctl" #define BOOT_KLU_TREE_DATA "bootklu" #define DPKG_TREE_DATA "/var/log/dpkg.log" #define XORG_TREE_DATA "/var/log/Xorg.0.log" -#define KWIN_TREE_DATA QDir::homePath() + "/.kwin.log" +#define KWIN_TREE_DATA Utils::homePath + "/.kwin.log" #define BOOT_TREE_DATA "/var/log/boot.log" #define KERN_TREE_DATA "/var/log/kern.log" #define APP_TREE_DATA "application" @@ -33,6 +39,8 @@ #define DMESG_TREE_DATA "dmesg" #define OTHER_TREE_DATA "other log" #define CUSTOM_TREE_DATA "custom log" +#define AUDIT_TREE_DATA "/var/log/audit/audit.log" +#define COREDUMP_TREE_DATA "coredump log" #define ITEM_DATE_ROLE (Qt::UserRole + 66) #define ICONPREFIX "://images/" @@ -40,6 +48,22 @@ #define ICONDARKPREFIX "://images/dark/" #define DOCTEMPLATE "://doc_template/template.doc" +#define TYPE_SYSTEM "system" +#define TYPE_KERNEL "kernel" +#define TYPE_BOOT "boot" +#define TYPE_DPKG "dpkg" +#define TYPE_DNF "dnf" +#define TYPE_KWIN "kwin" +#define TYPE_XORG "xorg" +#define TYPE_APP "app" +#define TYPE_COREDUMP "coredump" +#define TYPE_BSE "boot-shutdown-event" +#define TYPE_OTHER "other" +#define TYPE_CUSTOM "custom" +#define TYPE_AUDIT "audit" + +#define AUDIT_ORIGIN_DATAROLE Qt::UserRole + 3 + enum PRIORITY { LVALL = -1, EMER, ALERT, @@ -49,7 +73,8 @@ enum PRIORITY { LVALL = -1, NOTICE, INF, DEB }; -enum DNFPRIORITY { DNFLVALL = -1, +enum DNFPRIORITY { DNFINVALID = -2, + DNFLVALL, TRACE, SUBDEBUG, DDEBUG, @@ -60,6 +85,16 @@ enum DNFPRIORITY { DNFLVALL = -1, CRITICAL, SUPERCRITICAL }; Q_DECLARE_METATYPE(DNFPRIORITY) + +enum AUDITTYPE { AUDITLVALL= -1, + IDENTAUTH, + DAC, + MAC, + REMOTE, + DOCAUDIT, + OTHER}; +Q_DECLARE_METATYPE(AUDITTYPE) + struct LOG_MSG_JOURNAL { // include dateTime level type detailInfo... QString dateTime; @@ -94,6 +129,7 @@ struct LOG_MSG_BOOT { struct LOG_MSG_APPLICATOIN { QString dateTime; + QString subModule; QString level; QString src; QString msg; @@ -101,7 +137,7 @@ struct LOG_MSG_APPLICATOIN { }; struct LOG_MSG_XORG { - QString dateTime; + QString offset; QString msg; }; @@ -121,6 +157,114 @@ struct LOG_FILE_OTHERORCUSTOM { QString dateTimeModify; }; +#define Audit_IdentAuth "IdentAuth" +#define Audit_DAC "DAC" +#define Audit_MAC "MAC" +#define Audit_Remote "Remote" +#define Audit_DocAudit "DocAudit" +#define Audit_Other "Other" + +struct LOG_MSG_AUDIT { + QString auditType; + QString eventType; + QString dateTime; + QString processName; + QString processId; + QString status; + QString msg; + QString origin; + + bool contains(const QString& searchstr) { + if (auditType.contains(searchstr, Qt::CaseInsensitive) + || eventType.contains(searchstr, Qt::CaseInsensitive) + || dateTime.contains(searchstr, Qt::CaseInsensitive) + || processName.contains(searchstr, Qt::CaseInsensitive) + || status.contains(searchstr, Qt::CaseInsensitive) + || msg.contains(searchstr, Qt::CaseInsensitive)) + return true; + + return false; + } + + QString auditType2Str(int nAuditType) { + QString str = ""; + switch (nAuditType) { + case IDENTAUTH: + str = Audit_IdentAuth; + break; + case DAC: + str = Audit_DAC; + break; + case MAC: + str = Audit_MAC; + break; + case REMOTE: + str = Audit_Remote; + break; + case DOCAUDIT: + str = Audit_DocAudit; + break; + case OTHER: + str = Audit_Other; + break; + default: + str = ""; + break; + } + + return str; + } + + bool filterAuditType(int nAuditType) { + QString str = auditType2Str(nAuditType); + if (str.compare(auditType) == 0) + return true; + + return false; + } +}; + +struct LOG_MSG_COREDUMP { + QString sig; + QString dateTime; + QString coreFile; + QString uid; + QString userName; + QString exe; + QString pid; + QString storagePath; + QString stackInfo; + QString maps; + QString packgeVersion; + QString binaryInfo; + QString appLog;// 存放应用发生崩溃之前产生的应用日志 + + QJsonObject toJson() { + QJsonObject obj; + obj.insert("sig", sig); + obj.insert("dateTime", dateTime); + obj.insert("coreFile", coreFile); + obj.insert("exe", exe); + obj.insert("pid", pid); + obj.insert("storagePath", storagePath); + obj.insert("stackInfo", stackInfo); + if (!maps.isEmpty()) { + obj.insert("maps", maps); + } + obj.insert("packageVersion", packgeVersion); + obj.insert("binaryInfo", binaryInfo); + if (!appLog.isEmpty()) + obj.insert("appLog", appLog); + + return obj; + } +}; + +struct TIME_RANGE { + qint64 begin = -1; + qint64 end = -1; +}; + //kwin筛选条件,kwin日志只有信息,没有任何可筛选的,但是先放在这,以后统一化 struct KWIN_FILTERS { QString msg; @@ -137,8 +281,27 @@ struct APP_FILTERS { qint64 timeFilterBegin = -1 ; qint64 timeFilterEnd = -1; int lvlFilter; + QString app; + QString submodule; + QString logType = "file"; QString path; + QString execPath; + QString filter; + QString searchstr = ""; //搜索关键字 + + void clear() { + timeFilterBegin = -1; + timeFilterEnd = -1; + lvlFilter = -1; + app = ""; + logType = "file"; + path = ""; + execPath = ""; + filter = ""; + searchstr = ""; + } }; +typedef QList APP_FILTERSList; struct JOURNAL_FILTERS { int eventTypeFilter = -99; int timeFilter = -99; @@ -161,12 +324,25 @@ struct NORMAL_FILTERS { qint64 timeFilterEnd = -1; //筛选结束时间 int eventTypeFilter = 0; //筛选类型, 有 0全部 1登陆 2开机 3关机 QString searchstr = ""; //搜索关键字 + + void clear() { + timeFilterBegin = -1; + timeFilterEnd = -1; + eventTypeFilter = 0; + searchstr = ""; + } }; struct KERN_FILTERS { qint64 timeFilterBegin = -1 ; qint64 timeFilterEnd = -1; }; + +struct COREDUMP_FILTERS { + qint64 timeFilterBegin = -1 ; + qint64 timeFilterEnd = -1; +}; + /** * @brief The BOOT_FILTERS struct 启动日志筛选条件 */ @@ -176,16 +352,36 @@ struct BOOT_FILTERS { }; +/** + * @brief The AUDIT_FILTERS struct 审计日志筛选条件 + */ +struct AUDIT_FILTERS { + qint64 timeFilterBegin = -1 ; //筛选开始时间 + qint64 timeFilterEnd = -1; //筛选结束时间 + int auditTypeFilter = 0; //筛选类型, 有 0全部 1身份鉴别 2自主访问控制 3强制访问控制 4远程连接 5文件审计 + QString searchstr = ""; //搜索关键字 + + void clear() { + timeFilterBegin = -1; + timeFilterEnd = -1; + auditTypeFilter = 0; + searchstr = ""; + } +}; + /** * @brief The FILTER_CONFIG struct 筛选控件中的筛选情况记录结构体 */ struct FILTER_CONFIG { int levelCbx = INF + 1; //等级筛选的筛选值 - QString appListCbx = ""; //应用日志路径 + QString appListCbx = ""; //应用项目名称 int statusCbx = 0; //启动日志状态筛选下拉框的值 int dateBtn = 0; //时间筛选按钮当前选择筛选按钮对应BUTTONID int typeCbx = 0; + int auditCbx = 0; int dnfCbx = 5; + QMap app2Submodule; //应用项目名称-子模块名称 + }; enum BUTTONID { ALL = 0, @@ -213,9 +409,79 @@ enum LOG_FLAG { Dmesg, OtherLog, CustomLog, + Audit, + COREDUMP, NONE = 9999 }; // modified by -// Airy +Q_DECLARE_METATYPE(LOG_FLAG) + +// 定义日志数据基础结构体,若有特殊字段,则从该基础结构体派生 +struct LOG_MSG_BASE { + LOG_FLAG type = NONE; // 所属日志类型 + QString dateTime; + QString msg; + QString hostName; + QString daemonName; + QString daemonId; + QString level; + + QJsonObject toJson() { + QJsonObject obj; + obj.insert("type", type); + obj.insert("dateTime", dateTime); + obj.insert("msg", msg); + obj.insert("hostName", hostName); + obj.insert("daemonName", daemonName); + obj.insert("daemonId", daemonId); + obj.insert("level", level); + + return obj; + } + + void fromJson(const QString& data) { + QJsonParseError parseError; + QJsonDocument document = QJsonDocument::fromJson(data.toUtf8(), &parseError); + if (parseError.error == QJsonParseError::NoError) { + if (document.isObject()) { + QJsonObject object = document.object(); + if (object.contains("type")) + this->type = static_cast(object.value("type").toInt()); + if (object.contains("dateTime")) + this->dateTime = static_cast(object.value("dateTime").toString()); + if (object.contains("msg")) + this->msg = static_cast(object.value("msg").toString()); + if (object.contains("hostName")) + this->hostName = static_cast(object.value("hostName").toString()); + if (object.contains("daemonName")) + this->daemonName = static_cast(object.value("daemonName").toString()); + if (object.contains("daemonId")) + this->daemonId = static_cast(object.value("daemonId").toString()); + if (object.contains("level")) + this->level = static_cast(object.value("level").toString()); + } + } + } +}; +Q_DECLARE_METATYPE(LOG_MSG_BASE) + +#define SEGEMENT_SIZE 60000 + +struct LOG_FILTER_BASE { + LOG_FLAG type = NONE; + qint64 timeFilterBegin = -1 ; + qint64 timeFilterEnd = -1; + QString filePath; + int segementIndex; +}; + +Q_DECLARE_METATYPE(LOG_FILTER_BASE) + +struct LOG_FILTER_KERN : public LOG_FILTER_BASE { + +}; + +Q_DECLARE_METATYPE(LOG_FILTER_KERN) + namespace Log_Item_SPACE { enum LogItemDataRole { levelRole = Qt::UserRole + 6 @@ -283,4 +549,131 @@ enum DMESG_DISPLAY_COLUMN { }; } +namespace AUDIT_SPACE { +enum AUDIT_DISPLAY_COLUMN { + auditEventTypeColumn = 0, + auditDateTimeColumn, + auditProcessNameColumn, + auditStatusColumn, + auditMsgColumn +}; +} + +namespace COREDUMP_SPACE { +enum COREDUMP_DISPLAY_COLUMN { + COREDUMP_SIG_COLUMN = 0, + COREDUMP_TIME_COLUMN, + COREDUMP_COREFILE_COLUMN, + COREDUMP_UNAME_COLUMN, + COREDUMP_EXE_COLUMN +}; +} +struct EXPORTALL_DATA { + QStringList files; // 日志文件原始路径 + QMap dir2Files; //包含父目录的日志文件 + QMap dir2Cmds; //包含父目录的日志文件 + QStringList commands; // 需要用命令获得的日志 + QString logCategory; // 日志种类 + + EXPORTALL_DATA() + : files(QStringList()) + , commands(QStringList()) + , logCategory("") + { + dir2Files.clear(); + dir2Cmds.clear(); + } + + // 统计存入二级目录文件的总数 + int dir2FilesCount() { + int nCount = 0; + QMapIterator i(dir2Files); + while (i.hasNext()) { + i.next(); + nCount += i.value().count(); + } + + return nCount; + } + + // 统计存入二级目录文件的命令查询结果总数 + int dir2CmdsCount() { + int nCount = 0; + QMapIterator i(dir2Cmds); + while (i.hasNext()) { + i.next(); + nCount += i.value().count(); + } + + return nCount; + } +}; + +struct SubModuleConfig { + QString name; + QString filter; + QString execPath; + QString logType; // 日志类型分为file或journal + QString logPath; + + SubModuleConfig() + : name("") + , filter("") + , execPath("") + , logType("journal") + , logPath("") + { + + } + + QJsonObject toJson() { + QJsonObject obj; + obj.insert("name", name); + obj.insert("filter", filter); + obj.insert("execPath", execPath); + obj.insert("logType", logType); + obj.insert("logPath", logPath); + + return obj; + } + + bool isValid() { + return !name.isEmpty(); + } +}; +typedef QList SubModuleConfigList; + +// 自研应用日志配置信息 +struct AppLogConfig { + + QString name; + QString transName; + QString group; + QString version; // json配置版本号 + + bool visible; + + SubModuleConfigList subModules; + + AppLogConfig() + : name("") + , transName("") + , group("") + , version("V1.0") + , visible(true) + { + + } + + bool contains(const QString& app) { + return name == app; + } + + bool isValid() { + return !name.isEmpty(); + } +}; + +#define AppLogConfigList QList + #endif // STRUCTDEF_H diff --git a/application/utils.cpp b/application/utils.cpp index 6c37cb8d..5c487b1e 100644 --- a/application/utils.cpp +++ b/application/utils.cpp @@ -1,8 +1,14 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "utils.h" +#include "logsettings.h" +#include "dbusmanager.h" +#include "dbusproxy/dldbushandler.h" + +#include +#include #include #include @@ -20,11 +26,35 @@ #include #include #include +#include +#include + #include using namespace PolkitQt1; +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logUtils, "org.deepin.log.viewer.utils") +#else +Q_LOGGING_CATEGORY(logUtils, "org.deepin.log.viewer.utils", QtInfoMsg) +#endif +const QString DCONFIG_APPID = "org.deepin.log.viewer"; + QHash Utils::m_imgCacheHash; QHash Utils::m_fontNameCache; +QMap Utils::m_mapAuditType2EventType; +int Utils::specialComType = -1; +// 1.sudo权限运行deepin-log-viewer,QDir::homePath返回的是/root +// 此种情况下,使用freedesktop dbus接口获取当前登录用户家目录,以便能正确导出日志 +// 2.systemd服务启动deepin-log-viewer,QDir::homePath返回的是/,因该方式下freedesktop dbus接口获取为空,只能将/root作为homePath +QString Utils::homePath = ((QDir::homePath() != "/root" && QDir::homePath() != "/") ? QDir::homePath() : (QDir::homePath() == "/" ? "/root" : DBusManager::getHomePathByFreeDesktop())); +bool Utils::runInCmd = false; + +// 高频重复崩溃记录exe路径名单 +//const QString COREDUMP_REPEAT_CONFIG_PATH = "/var/cache/deepin/deepin-log-viewer/repeatCoredumpApp.list"; +const QString COREDUMP_REPEAT_CONFIG_PATH = Utils::homePath + "/.cache/deepin/deepin-log-viewer/repeatCoredumpApp.list"; +const float COREDUMP_HIGH_REPETITION = 0.8f; +const int COREDUMP_TIME_THRESHOLD = 3; + Utils::Utils(QObject *parent) : QObject(parent) @@ -49,8 +79,16 @@ QString Utils::getQssContent(const QString &filePath) QString Utils::getConfigPath() { - QDir dir(QDir(QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first()) - .filePath(qApp->organizationName())); + QDir dir(QDir(Utils::homePath + "/.config") + .filePath(qApp->organizationName())); + + return dir.filePath(qApp->applicationName()); +} + +QString Utils::getAppDataPath() +{ + QDir dir(QDir(Utils::homePath + "/.local/share") + .filePath(qApp->organizationName())); return dir.filePath(qApp->applicationName()); } @@ -67,6 +105,17 @@ bool Utils::isFontMimeType(const QString &filePath) return false; } +bool Utils::isTextFileType(const QString &filePath) +{ + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(filePath); + //标准文本文件和空白无后缀文件均计入文本文件范围 + if (mime.inherits("text/plain") || mime.inherits("application/x-zerosize")) { + return true; + } + return false; +} + QString Utils::suffixList() { return QString("Font Files (*.ttf *.ttc *.otf)"); @@ -107,7 +156,6 @@ QString Utils::loadFontFamilyFromFiles(const QString &fontFileName) QFile fontFile(fontFileName); if (!fontFile.open(QIODevice::ReadOnly)) { - // qDebug() << "Open font file error"; return fontFamilyName; } @@ -122,12 +170,22 @@ QString Utils::loadFontFamilyFromFiles(const QString &fontFileName) return fontFamilyName; } +QString Utils::getReplaceColorStr(const char *d) +{ + QByteArray byteChar(d); + byteChar = replaceEmptyByteArray(byteChar); + QString d_str = QString(byteChar); + d_str.replace(QRegExp("\\x1B\\[\\d+(;\\d+){0,2}m"), ""); + d_str.replace(QRegExp("\\002"), ""); + return d_str; +} + /** * @brief Utils::replaceEmptyByteArray 替换从qproccess获取的日志信息的字符中的空字符串 替换 \u0000,不然QByteArray会忽略这以后的内容 * @param iReplaceStr要替换的字符串 * @return 替换过的字符串 */ -QByteArray Utils::replaceEmptyByteArray(QByteArray &iReplaceStr) +QByteArray Utils::replaceEmptyByteArray(const QByteArray &iReplaceStr) { QByteArray byteOutput = iReplaceStr; //\u0000是空字符,\x01是标题开始,出现于系统日志部分进程进程名称最后一个字符,不替换英文情况下显示错误 @@ -182,7 +240,6 @@ bool Utils::deleteDir(const QString &iFilePath) if (fileInfo.isFile() || fileInfo.isSymLink()) { QFile::setPermissions(filePath, QFile::WriteOwner); if (!QFile::remove(filePath)) { - // qDebug() << "remove file" << filePath << " faild!"; error = true; } } else if (fileInfo.isDir()) { @@ -193,7 +250,6 @@ bool Utils::deleteDir(const QString &iFilePath) } if (!directory.rmdir(QDir::toNativeSeparators(directory.path()))) { - // qDebug() << "remove dir" << directory.path() << " faild!"; error = true; } @@ -238,8 +294,11 @@ QString Utils::mkMutiDir(const QString &path) QString parentDir = mkMutiDir(path.mid(0, path.lastIndexOf('/'))); QString dirname = path.mid(path.lastIndexOf('/') + 1); QDir parentPath(parentDir); - if (!dirname.isEmpty()) - parentPath.mkpath(dirname); + if (!dirname.isEmpty()) { + bool bRet = parentPath.mkpath(dirname); + if (!bRet) + qCWarning(logUtils) << QString("mkpath: unable to create directory '%1' in path: '%2/', please confirm if the file exists.").arg(dirname).arg(parentDir); + } return parentDir + "/" + dirname; } @@ -251,3 +310,335 @@ bool Utils::checkAuthorization(const QString &actionId, qint64 applicationPid) Authority::AllowUserInteraction); return result == Authority::Yes ? true : false; } + +QString Utils::osVersion() +{ + QProcess *unlock = new QProcess; + unlock->start("lsb_release", {"-r"}); + unlock->waitForFinished(); + auto output = unlock->readAllStandardOutput(); + auto str = QString::fromUtf8(output); + QRegExp re("\t.+\n"); + QString osVerStr; + if (re.indexIn(str) > -1) { + auto result = re.cap(0); + osVerStr = result.remove(0, 1).remove(result.size() - 1, 1); + } + unlock->deleteLater(); + return osVerStr; +} + +QString Utils::auditType(const QString &eventType) +{ + QMapIterator it(m_mapAuditType2EventType); + while (it.hasNext()) { + it.next(); + if (it.value().indexOf(eventType) != -1) + return it.key(); + } + + return ""; +} + +double Utils::convertToMB(quint64 cap, const int size/* = 1024*/) +{ + static QString type[] = {" B", " KB", " MB"}; + + double dc = cap; + double ds = size; + + for (size_t p = 0; p < sizeof(type); ++p) { + if (cap < pow(size, p + 1) || p == sizeof(type) - 1) + return dc / pow(ds, p); + } + + return 0.0; +} + +QString Utils::getUserNamebyUID(uint uid) +{ + struct passwd * pwd; + pwd = getpwuid(uid); + if (nullptr == pwd) { + qCWarning(logUtils) << QString("unknown uid:%1").arg(uid); + return ""; + } + + return pwd->pw_name; +} + +QString Utils::getUserHomePathByUID(uint uid) +{ + struct passwd * pwd; + pwd = getpwuid(uid); + if (nullptr == pwd) { + qCWarning(logUtils) << QString("unknown uid:%1").arg(uid); + return ""; + } + + return pwd->pw_dir; +} + +QString Utils::getCurrentUserName() +{ + // 获取当前系统用户名 + struct passwd* pwd = getpwuid(getuid()); + return pwd->pw_name; +} + +bool Utils::isValidUserName(const QString &userName) +{ + bool bValidUserName = false; + QDBusInterface interface("com.deepin.daemon.Accounts", "/com/deepin/daemon/Accounts", "com.deepin.daemon.Accounts", QDBusConnection::systemBus()); + QStringList userList = qvariant_cast< QStringList >(interface.property("UserList")); + for (auto strUser : userList) { + uint uid = strUser.mid(strUser.lastIndexOf("User") + 4).toUInt(); + QString tempUserName = getUserNamebyUID(uid); + if(tempUserName == userName) { + bValidUserName = true; + break; + } + } + + return bValidUserName; +} + +bool Utils::isCoredumpctlExist() +{ + bool isCoredumpctlExist = false; + QDir dir("/usr/bin"); + QStringList list = dir.entryList(QStringList() << (QString("coredumpctl") + "*"), QDir::NoDotAndDotDot | QDir::Files); + for (int i = 0; i < list.count(); i++) { + if("coredumpctl" == list[i]) { + isCoredumpctlExist = true; + break; + } + } + return isCoredumpctlExist; +} + +QString Utils::getHomePath(const QString &userName) +{ + QString uName(""); + if (!userName.isEmpty()) + uName = userName; + else + uName = getCurrentUserName(); + + QString homePath = ""; + if (isValidUserName(uName)) { + QProcess *unlock = new QProcess; + unlock->start("sh", QStringList() << "-c" << QString("cat /etc/passwd | grep %1").arg(uName)); + unlock->waitForFinished(); + auto output = unlock->readAllStandardOutput(); + auto str = QString::fromUtf8(output); + homePath = str.mid(str.indexOf("::") + 2).split(":").first(); + } + + // 根据用户名获取家目录失败,默认采用QDir::homePath()作为homePath + QDir dir(homePath); + if (!dir.exists() || homePath.isEmpty()) + homePath = QDir::homePath(); + + qCDebug(logUtils) << "userName: " << uName << "homePath:" << homePath; + + return homePath; +} + +QString Utils::appName(const QString &filePath) +{ + QString ret; + if (filePath.isEmpty()) + return ret; + + QStringList strList = filePath.split("/"); + if (strList.count() < 2) { + if (filePath.contains(".")) + ret = filePath.section(".", 0, 0); + else { + ret = filePath; + } + return ret; + } + + QString tmpPath = filePath; + if (tmpPath.endsWith('/')) + tmpPath = tmpPath.remove(tmpPath.size() - 1, 1); + QString desStr = tmpPath.section("/", -1); + ret = desStr.mid(0, desStr.lastIndexOf(".")); + return ret; +} + +void Utils::resetToNormalAuth(const QString &path) +{ + QFileInfo fi(path); + if (!path.isEmpty() && fi.exists()) { + qInfo() << "resetToNormalAuth: " << path; + QProcess procss; + if (fi.isDir()) + procss.setWorkingDirectory(path); + else + procss.setWorkingDirectory(fi.absolutePath()); + + QStringList arg = {"-c"}; + arg.append(QString("chmod -R 777 '%1'").arg(path)); + procss.start("/bin/bash", arg); + procss.waitForFinished(-1); + } +} + +QList Utils::countRepeatCoredumps(qint64 timeBegin, qint64 timeEnd) +{ + QList result; + QString data = DLDBusHandler::instance()->executeCmd("coredumpctl-list"); + QStringList strList = data.split('\n', QString::SkipEmptyParts); + int total = 0; + for (int i = strList.size() - 1; i >= 0; --i) { + QString str = strList.at(i); + if (str.trimmed().isEmpty()) + continue; + QStringList tmpList = str.split(" ", QString::SkipEmptyParts); + if (tmpList.count() < 10) + continue; + + QDateTime dt = QDateTime::fromString(tmpList[1] + " " + tmpList[2], "yyyy-MM-dd hh:mm:ss"); + if (timeBegin > 0 && timeEnd > 0) { + if (dt.toMSecsSinceEpoch() < timeBegin || dt.toMSecsSinceEpoch() > timeEnd) + continue; + } + + total++; + QString exePath = tmpList[9]; + + auto it = std::find_if(result.begin(), result.end(), [&exePath](const LOG_REPEAT_COREDUMP_INFO& item){ + return exePath == item.exePath; + }); + if (it == result.end()) { + LOG_REPEAT_COREDUMP_INFO info; + info.exePath = exePath; + info.times = 1; + info.repetitionRate = 0.0; + result.push_back(info); + } else { + it->times++; + } + } + + // 计算重复率 + for (auto &info : result) { + if (info.times > 1) { + info.repetitionRate = static_cast(info.times) / total; + } + } + + return result; +} + +QStringList Utils::getRepeatCoredumpExePaths() +{ + QFile file(COREDUMP_REPEAT_CONFIG_PATH); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + return QStringList(); + + QString data = file.readAll(); + + file.close(); + + return data.split(' '); +} + +void Utils::updateRepeatCoredumpExePaths(const QList &infos) +{ + // 每隔24小时强制清空一次名单内容,以便重复的崩溃exe路径是最新的 + QFileInfo fi(COREDUMP_REPEAT_CONFIG_PATH); + if (fi.birthTime().daysTo(QDateTime::currentDateTime()) >= 1) { + if (QFile::exists(COREDUMP_REPEAT_CONFIG_PATH)) + QFile::remove(COREDUMP_REPEAT_CONFIG_PATH); + } + + QDateTime bt = fi.birthTime(); + // 目录不存在,则创建目录 + if (!QFileInfo::exists(fi.absolutePath())) { + QDir dir; + dir.mkpath(fi.absolutePath()); + } + + // 确定当前时间范围的崩溃数据高频重复路径 + QStringList newRepatExePaths; + for (auto info : infos) { + if (info.repetitionRate > COREDUMP_HIGH_REPETITION || info.times >= COREDUMP_TIME_THRESHOLD) + newRepatExePaths.push_back(info.exePath); + } + + if (newRepatExePaths.size() == 0) + return; + + QStringList curReaptExePaths = getRepeatCoredumpExePaths(); + for (auto exePath : newRepatExePaths) { + if (curReaptExePaths.indexOf(exePath) == -1) + curReaptExePaths.push_back(exePath); + } + + QFile file(COREDUMP_REPEAT_CONFIG_PATH); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + qCWarning(logUtils) << "failed to open coredump repeat config file:" << COREDUMP_REPEAT_CONFIG_PATH; + return; + } + + QTextStream out(&file); + out << curReaptExePaths.join(' '); + + file.close(); +} + +#ifdef DTKCORE_CLASS_DConfigFile +LoggerRules::LoggerRules(QObject *parent) + : QObject(parent), m_rules(""), m_config(nullptr) { +} + +LoggerRules::~LoggerRules() { m_config->deleteLater(); } + +void LoggerRules::initLoggerRules() +{ + QByteArray logRules = qgetenv("QT_LOGGING_RULES"); + qunsetenv("QT_LOGGING_RULES"); + + // set env + m_rules = logRules; + + // set dconfig + m_config = Dtk::Core::DConfig::create(DCONFIG_APPID, DCONFIG_APPID); + logRules = m_config->value("log_rules").toByteArray(); + appendRules(logRules); + setRules(m_rules); + + // watch dconfig + connect(m_config, &Dtk::Core::DConfig::valueChanged, this, [this](const QString &key) { + if (key == "log_rules") { + setRules(m_config->value(key).toByteArray()); + qCDebug(logUtils) << "value changed:" << key; + } + }); +} + +void LoggerRules::setRules(const QString &rules) { + auto tmpRules = rules; + m_rules = tmpRules.replace(";", "\n"); + QLoggingCategory::setFilterRules(m_rules); +} + +void LoggerRules::appendRules(const QString &rules) { + QString tmpRules = rules; + tmpRules = tmpRules.replace(";", "\n"); + auto tmplist = tmpRules.split('\n'); + for (int i = 0; i < tmplist.count(); i++) + if (m_rules.contains(tmplist.at(i))) { + tmplist.removeAt(i); + i--; + } + if (tmplist.isEmpty()) + return; + m_rules.isEmpty() ? m_rules = tmplist.join("\n") + : m_rules += "\n" + tmplist.join("\n"); +} +#endif diff --git a/application/utils.h b/application/utils.h old mode 100644 new mode 100755 index c0a3b942..25a76ff5 --- a/application/utils.h +++ b/application/utils.h @@ -5,8 +5,22 @@ #ifndef UTILS_H #define UTILS_H #define SINGLE_READ_CNT 500 +#define SINGLE_READ_CNT_COREDUMP 600 + +#include "dtkcore_config.h" +#ifdef DTKCORE_CLASS_DConfig +#include +#endif + #include #include + +struct LOG_REPEAT_COREDUMP_INFO { + QString exePath = ""; + int times = 1; // 出现次数 + float repetitionRate = 0.0; +}; + /** * @brief 公用工具静态函数类 */ @@ -28,14 +42,18 @@ class Utils : public QObject }; static QHash m_imgCacheHash; static QHash m_fontNameCache; + static QMap m_mapAuditType2EventType; static QString getQssContent(const QString &filePath); static QString getConfigPath(); + static QString getAppDataPath(); static bool isFontMimeType(const QString &filePath); + static bool isTextFileType(const QString &filePath); static QString suffixList(); static QPixmap renderSVG(const QString &filePath, const QSize &size); static QString loadFontFamilyFromFiles(const QString &fontFileName); - static QByteArray replaceEmptyByteArray(QByteArray &iReplaceStr); + static QString getReplaceColorStr(const char *d); + static QByteArray replaceEmptyByteArray(const QByteArray &iReplaceStr); static CommandErrorType isErroCommand(const QString &str); static bool checkAndDeleteDir(const QString &iFilePath); static bool deleteDir(const QString &iFilePath); @@ -46,6 +64,51 @@ class Utils : public QObject static QString mkMutiDir(const QString &path); //授权框 static bool checkAuthorization(const QString &actionId, qint64 applicationPid); + //系统版本号 + static QString osVersion(); + static QString auditType(const QString& eventType); + static double convertToMB(quint64 cap, const int size = 1024); + static QString getUserNamebyUID(uint uid); //根据uid获取用户名 + static QString getUserHomePathByUID(uint uid); //根据uid获取用户家目录 + static QString getCurrentUserName(); + static bool isValidUserName(const QString &userName); + static bool isCoredumpctlExist(); // is coredumpctl installed + static QString getHomePath(const QString &userName = ""); + static QString appName(const QString &filePath); + static void resetToNormalAuth(const QString &path); + // 统计所有崩溃记录重复次数 + static QList countRepeatCoredumps(qint64 timeBegin = -1, qint64 timeEnd = -1); + // 获取高频重复崩溃记录exe路径名单 + static QStringList getRepeatCoredumpExePaths(); + // 更新高频重复崩溃记录exe路径到文件 + static void updateRepeatCoredumpExePaths(const QList &infos = QList()); + /** + * @brief specialComType 是否是特殊机型,like huawei + * 取值有3种(-1,0,>0),默认为-1(未知),0(不是特殊机型),>0(特殊机型) + */ + static int specialComType; + static QString homePath; + static bool runInCmd; }; +#ifdef DTKCORE_CLASS_DConfigFile +class LoggerRules : public QObject { + Q_OBJECT +public: + explicit LoggerRules(QObject *parent = nullptr); + ~LoggerRules(); + + void initLoggerRules(); + inline QString rules() const { return m_rules; } + void setRules(const QString &rules); + +private: + void appendRules(const QString &rules); + +private: + QString m_rules; + Dtk::Core::DConfig *m_config; +}; +#endif + #endif diff --git a/application/wtmpparse.cpp b/application/wtmpparse.cpp index 45d57dbc..70577a49 100644 --- a/application/wtmpparse.cpp +++ b/application/wtmpparse.cpp @@ -16,7 +16,6 @@ int wtmp_open(char *filename) int wtmp_open_back(char *filename) { fdWtmp = open(filename, O_RDONLY); - // qDebug() << "fdWtmp" << fdWtmp; bpos = cur_rec = num_recs = 0; fpos = lseek(fdWtmp, 0, SEEK_END); return fdWtmp; @@ -24,7 +23,6 @@ int wtmp_open_back(char *filename) int seek_end(void) { - // qDebug() << lseek(0, fdWtmp, SEEK_END); return 0; } @@ -61,8 +59,6 @@ int wtmp_reload_back(void) { int amt_read; -// qDebug() << "endsize" << endsize << NRECS << UTSIZE; - off_t o; o = ((fpos - 1) / (NRECS * UTSIZE)) * (NRECS * UTSIZE); bpos = (int)(fpos - o); @@ -98,7 +94,7 @@ void wtmp_close(void) struct utmp_list *st_list_init(void) { - struct utmp_list *list = (struct utmp_list *)malloc(sizeof(struct utmp_list)); + struct utmp_list *list = static_cast(malloc(sizeof(struct utmp_list))); if (!list) { printf("struct utmp_list malloc failed\n"); return NULL; @@ -111,7 +107,7 @@ struct utmp_list *st_list_init(void) struct utmp *st_utmp_init(void) { - struct utmp *stUTMP = (struct utmp *)malloc(sizeof(struct utmp)); + struct utmp *stUTMP = static_cast(malloc(sizeof(struct utmp))); if (!stUTMP) { printf("struct utmp malloc failed\n"); return NULL; @@ -158,7 +154,7 @@ utmp list_get_ele_and_del(QList &list, char *value, int &rs) return temp; } -char *show_end_time(long timeval) +char *show_end_time(time_t timeval) { struct tm *t; char tt[256] = {0}; @@ -169,7 +165,7 @@ char *show_end_time(long timeval) return asctime(t); } -char *show_start_time(long timeval) +char *show_start_time(time_t timeval) { struct tm *t; char tt[256] = {0}; diff --git a/application/wtmpparse.h b/application/wtmpparse.h index 9619b4fa..485c933f 100644 --- a/application/wtmpparse.h +++ b/application/wtmpparse.h @@ -48,9 +48,9 @@ void list_insert(QList &plist, struct utmp *value); utmp list_get_ele_and_del(QList &list, char *value, int &rs); -char *show_end_time(long timeval); +char *show_end_time(time_t timeval); -char *show_start_time(long timeval); +char *show_start_time(time_t timeval); void show_base_info(struct utmp *uBuf); diff --git a/debian/changelog b/debian/changelog index 55a5b60c..4688b181 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,301 @@ +deepin-log-viewer (6.1.19) unstable; urgency=medium + + * v20 pull. + + -- muyuankai Tue, 20 Aug 2024 16:34:53 +0800 + +deepin-log-viewer (6.1.18) unstable; urgency=medium + + * feat: Segmented export supports doc and xls formats for export + * fix: Fix the issue of progress bar not displaying progress(Bug: 251937) + * feat: Crash report content optimization(Task: 10320240422) + * fix: Fix two security vulnerabilities(Bug: 253967) + * fix: Optimized file reading speed + * fix: Fix issues with abnormal search functionality + * fix: fix compile problem on longarrch + * fix: Security vulnerability reinforcement + * fix: remove /bin/bash in service if necessary + * fix: UI interface in English(Bug: 256789) + * fix: The "level" on the page is displayed as "level"(Bug: 260291) + + -- houchengqiu Tue, 18 Jun 2024 16:00:41 +0800 + +deepin-log-viewer (6.1.17) unstable; urgency=medium + + * perf: Optimization of kernel/window management log memory usage + * fix: Optimize search functionality + * fix: Fix the issue of repeatedly popping up authentication windows(Bug: 251521) + * fix: Fix the issue of segment export not being able to be cancelled(Bug: 251515) + * fix: Refinement of kernel log segmentation export and cancellation of authentication logic(Bug: ) + * fix: Search function optimization 2nd && add logs + + -- houchengqiu Fri, 19 Apr 2024 13:22:11 +0800 + +deepin-log-viewer (6.1.16) unstable; urgency=medium + + * fix: The coredump reporter service switches from system mode to user mode + * fix: Repair failed in building with a 64-bit time_t on a 32-bit(Bug: 250313) + + -- lijiaxuan Fri, 12 Apr 2024 17:19:11 +0800 + +deepin-log-viewer (6.1.15) unstable; urgency=medium + + * feat: kwin crash log buried point report(Task: 330013) + * chore: adjust coredump report interval + * fix: Correction of abnormal last reporting time + + -- houchengqiu Thu, 21 Mar 2024 16:21:59 +0800 + +deepin-log-viewer (6.1.14) unstable; urgency=medium + + * fix: Fix the issue of filter option filtering without content when there is only one submodule(Bug: 244901) + * fix: Delete dump temporary file from service backend(Bug: 241927) + * fix: Remove the. config directory from the root directory(Bug: 244995) + + -- houchengqiu Wed, 13 Mar 2024 15:00:43 +0800 + +deepin-log-viewer (6.1.13) unstable; urgency=medium + + * fix: Resolve the issue of adding sudo not being able to export logs(Bug: 238985) + * chore: [TS] Update international translation files(Bug: 193739) + * fix: Resolve the issue of Sudo export logs being empty(Bug: 238985) + * fix: Fix the issue of parent directory permissions being changed during export + * fix: Unzip may overwrite linked file data(Bug: 243387) + * fix: fix app name can not show chinese + + -- houchengqiu Thu, 22 Feb 2024 13:44:46 +0800 + +deepin-log-viewer (6.1.12) unstable; urgency=medium + + * fix: Add -v option version info(Bug: 236241) + * fix: Adapt to the type of PGX log display(Bug: 240851) + + -- houchengqiu Thu, 01 Feb 2024 14:09:32 +0800 + +deepin-log-viewer (6.1.11) unstable; urgency=medium + + * fix: modify debug-config json + + -- houchengqiu Mon, 15 Jan 2024 14:10:59 +0800 + +deepin-log-viewer (6.1.10) unstable; urgency=medium + + * chore: Update version 6.1.10 + + -- houchengqiu Thu, 11 Jan 2024 10:30:32 +0800 + +deepin-log-viewer (6.1.9) unstable; urgency=medium + + * feat: Log specification adaptation 2nd + * feat: Log specification adaptation 2nd- merge export + * fix: Resolve the issue of JSON configuration not being able to control application visibility(Bug: 237801) + * feat: Debug mode log adaptation + * fix: Resolve the issue of blank items in the application list(Bug: 237785) + * feat: add package version information on crash burial point(Bug: 236991) + * fix: Change the JSON visible field to 0 in debugging mode configuration(Bug: 238925) + * fix: Fix the issue where using the - d parameter - m cannot export logs(Bug: 238967) + + -- houchengqiu Wed, 10 Jan 2024 11:46:04 +0800 + +deepin-log-viewer (6.1.8) unstable; urgency=medium + + * fix: Fix security vulnerabilities introduced by LD_PRELOAD 2nd(Bug: 234125) + * chore: Optimization of output path whitelist inspection methods(Bug: 236471) + + -- houchengqiu Mon, 25 Dec 2023 17:17:00 +0800 + +deepin-log-viewer (6.1.7) unstable; urgency=medium + + * fix: Fix security vulnerabilities introduced by LD_PRELOAD(Bug: HW23-1232) + * feat: Rectification of DBus security coding standards + * fix: systemd service add memory limits 8G + * fix: coredump map info only parsed in report coredump(Bug: 233653) + * chore: Code review issue modification + * fix: Resolve the issue of incomplete display of crash logs(Bug: 234131) + + -- houchengqiu Fri, 22 Dec 2023 13:21:34 +0800 + +deepin-log-viewer (6.1.6) unstable; urgency=medium + + * fix: clear qt warning logs + * fix: Fix the issue of incomplete acquisition of file base names(Bug: 228425) + * feat: report coredump add stackinfo + * fix: not get core file maps (#237) + Thanks to groveer + * fix: Resolve the issue of failure to obtain stack maps address for crash information + + -- Deepin Packages Builder Thu, 30 Nov 2023 17:49:19 +0800 + +deepin-log-viewer (6.1.5) unstable; urgency=medium + + * fix: Adjust the display rules of application names in the application list(Bug: 223969) + * feat: Rich command line export function + * feat: Command line export by condition + * fix: Remove command authentication + * fix: CLI export type logs to diretory(Bug: 225107) + * fix: CLI export return correct errcode(Bug: 225365) + * fix: fix export specify app log failed problem(Bug: 225077) + * fix: fix cli export kwin log failed problem(Bug: 225427) + * fix: ix cli export to no-write dir can not quit(Bug: 225553) + * fix: Add validity verification of cli export level parameters(Bug: 225567) + * fix: fix cli export app by keyword failed(Bug: 225573) + * fix: fix cli export '-e' parameter is required option + * fix: cli export -k can obtain parameters with spaces(Bug: 225795) + * fix: fix cli export audit log other bug contain MAC audit type log(Bug: 225793) + * fix: Resolve the issue of differences in content after changing audit log filtering criteria(Bug: 225791) + * feat: CLI export type log folder name with timestamp + * fix: Solve the problem of audit failure with keywords when exporting in cli + * fix: Improve the validity verification and judgment logic of cli export conditions + * fix: cli export -t&-d option cannot use together(Bug: 226569) + * fix: CLI export app log only export app log file(Bug: 226589) + * chore: Improve cli export input prompts(Bug: 226623) + * fix: Fix the issue of exporting the boot log as empty by level in cli(Bug: 226673) + * fix: fix journal app log can't show by period(Bug: 226727) + * feat: add report coredump feature(Task: 31473) + * fix: Fix the issue of no data in today's audit log exported by cli(Bug: 227109) + * fix: Coredump report time use is recorded by Dconfig/gsettings(Bug: 227219) + * fix: Fix the issue where restarting the machine after resetting the reportTime will immediately be modified(Bug: 227597) + + -- Deepin Packages Builder Thu, 09 Nov 2023 14:50:49 +0800 + +deepin-log-viewer (6.1.4) unstable; urgency=medium + + * Fix the issue of low version iso app log not being displayed + + -- Deepin Packages Builder Wed, 18 Oct 2023 14:40:27 +0800 + +deepin-log-viewer (6.1.3) unstable; urgency=medium + + * feat: Adaptation log specification rectification(Task: 292081) + * feat: Add journal type app log feature(Task: 292083) + * fix: fix app list can not show/export logs + * feat: Rectification of log specification adaptation compatibility(Task: 296703) + * feat: add app log category + * fix: fix journal app can not show problems + * chore: Change app log category name + * chore: Update REUSE date + + -- Deepin Packages Builder Tue, 17 Oct 2023 10:47:08 +0800 + +deepin-log-viewer (6.1.2) unstable; urgency=medium + + * fix: Fix the issue of successfully exporting read-only file directories(Bug: 217957) + * fix: Command line export add authentication window(Bug: 218757) + * fix: Add pkexec to implement command line export authentication(Bug: 218757) + * fix: Fix the issue of missing 'apps' directory in command line export(Bug: 219629) + * fix: Command line export initializes homePath first(Bug: 219629) + * fix: Fix UI - issue of all export failures + * fix: Application data directory requires permission to create tmp directory + + -- Deepin Packages Builder Tue, 17 Oct 2023 10:17:05 +0800 + +deepin-log-viewer (6.1.1) unstable; urgency=medium + + * fix: fix coredump logs show is not complete(Bug: 217023) + * fix: fix export coredump logs failed(Bug: 217019) + * feat: add accessible labels + + -- Deepin Packages Builder Thu, 31 Aug 2023 16:02:33 +0800 + +deepin-log-viewer (6.1.0) unstable; urgency=medium + + * fix: modify audit rule + * feat: collect crash log(Task: 279017) + * fix: fix review problems + * feat: add command -e option(support export all) + * fix: cli run in the single instance + * feat: export all-add subdirectory + * chore: update Ts + * feat: export all-support export coredump files + * fix: cli run in the single instance + * fix: fix export name not update to current time + * feat: other logs add kwin logs + * fix: other log and custom log add search feature + * fix: fix 1042 build fail + * fix: fix kwin logs can't show content + * feat: xorg log column datetime change to offset + * fix: export all-directory other change to others + + -- Deepin Packages Builder Thu, 03 Aug 2023 16:36:26 +0800 + +deepin-log-viewer (6.0.10) unstable; urgency=medium + + * Update version to 6.0.10 + * feat: Huawei type adapter DConfig (#155) + Thanks to hundundadi(Task: 276433) + * feat: Huawei type adapter DConfig (#156) + Thanks to hundundadi(Task: 276433) + * feat: Add level protection level 4 - the audit log + + -- Deepin Packages Builder Wed, 19 Jul 2023 11:32:06 +0800 + +deepin-log-viewer (6.0.9) unstable; urgency=medium + + * chore: 【MD】更新帮助文案 (#151) + + -- Deepin Packages Builder Wed, 24 May 2023 14:10:52 +0800 + +deepin-log-viewer (6.0.8) unstable; urgency=medium + + * fix: 修复获取内核日志读取卡住,展示空白的问题(Bug: 198137) + + -- Deepin Packages Builder Tue, 09 May 2023 17:39:35 +0800 + +deepin-log-viewer (6.0.7) unstable; urgency=medium + + * Update version + + -- wangzhengyang Thu, 30 Mar 2023 15:47:53 +0800 + +deepin-log-viewer (6.0.6) unstable; urgency=medium + + * Update version + + -- wangzhengyang Fri, 10 Mar 2023 10:57:30 +0800 + +deepin-log-viewer (6.0.5) unstable; urgency=medium + + * Fix RPM build + + -- wangzhengyang Tue, 7 Mar 2023 10:45:40 +0800 + +deepin-log-viewer (6.0.4) unstable; urgency=medium + + * Fix no help menu + + -- wangzhengyang Tue, 21 Feb 2023 13:40:59 +0800 + +deepin-log-viewer (6.0.3) unstable; urgency=medium + + * Add new tag + + -- wangzhengyang Thu, 16 Feb 2023 15:12:59 +0800 + +deepin-log-viewer (6.0.2) unstable; urgency=medium + + * Merge version to 6.0.2 + * Add other log and custom log type + + -- wangzhengyang Tue, 14 Feb 2023 15:12:59 +0800 + +deepin-log-viewer (6.0.1) unstable; urgency=medium + + * Initial for Deepin V23 + + -- unknown Mon, 16 Jan 2023 16:57:59 +0800 + deepin-log-viewer (5.9.15) unstable; urgency=medium * New version 5.9.15 -- lichunlong Thu, 5 Jan 2023 17:30:00 +0800 + deepin-log-viewer (5.9.14) unstable; urgency=medium * New version 5.9.14 -- lichunlong Thu, 5 Jan 2023 16:00:00 +0800 + deepin-log-viewer (5.2.0) unstable; urgency=medium * Initial release diff --git a/debian/control b/debian/control index 38652a2a..f3a53ae8 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: deepin-log-viewer Section: utils Priority: optional Maintainer: Deepin Packages Builder -Build-Depends: debhelper (>= 11),cmake, pkg-config, qtbase5-dev, qtchooser (>= 55-gc9562a1-1~),qt5-qmake, libdtkwidget-dev, libdtkgui-dev, qttools5-dev-tools, libqt5svg5-dev, libsystemd-dev, libicu-dev, qttools5-dev, libdframeworkdbus-dev, libgtest-dev, libgmock-dev, libkf5codecs-dev, libzip-dev, libxerces-c-dev, libboost-dev, libminizip-dev, libfftw3-dev | libfftw3-3, rapidjson-dev, libltdl-dev, libpolkit-qt5-1-dev, libgsettings-qt-dev +Build-Depends: debhelper (>= 11),cmake, pkg-config, qtbase5-dev, qtchooser (>= 55-gc9562a1-1~),qt5-qmake, libdtkwidget-dev, libdtkgui-dev, qttools5-dev-tools, libqt5svg5-dev, libsystemd-dev, libicu-dev, qttools5-dev, libdframeworkdbus-dev, libgtest-dev, libgmock-dev, libkf5codecs-dev, libzip-dev, libxerces-c-dev, libboost-dev, libminizip-dev, rapidjson-dev, libltdl-dev, libpolkit-qt5-1-dev, libgsettings-qt-dev, libgio-qt-dev Standards-Version: 4.1.3 Package: deepin-log-viewer diff --git a/debian/deepin-log-viewer.install b/debian/deepin-log-viewer.install index 39c98847..9292a4f2 100644 --- a/debian/deepin-log-viewer.install +++ b/debian/deepin-log-viewer.install @@ -1,13 +1,21 @@ usr/bin/deepin-log-viewer usr/bin/logViewerAuth usr/bin/logViewerTruncate +usr/bin/deepin-logger usr/lib/deepin-daemon/log-view-service +usr/lib/systemd/user/coredump-reporter.service +usr/lib/systemd/user/coredump-reporter.timer +usr/lib/systemd/system/deepin-log-viewer-daemon.service usr/share/applications/deepin-log-viewer.desktop usr/share/dbus-1/system-services/com.deepin.logviewer.service usr/share/dbus-1/system.d/com.deepin.logviewer.conf usr/share/deepin-log-viewer/DocxTemplate/*.dfw -usr/share/dsg/configs/org.deepin.deepin-log-viewer/*.json +usr/share/dsg/configs/org.deepin.log.viewer/*.json usr/share/glib-2.0/schemas/*.gschema.xml usr/share/deepin-log-viewer/translations/*.qm +usr/share/deepin-log-viewer/auditRule.conf +usr/share/deepin-log-viewer/deepin-log.conf.d/*.json +usr/share/deepin-debug-config/deepin-debug-config.d/*.json usr/share/polkit-1/actions/*.policy -usr/share/icons/hicolor/scalable/apps/*.svg \ No newline at end of file +usr/share/icons/hicolor/scalable/apps/*.svg +usr/share/deepin-manual diff --git a/debian/deepin-log-viewer.postinst b/debian/deepin-log-viewer.postinst new file mode 100644 index 00000000..4191ee6d --- /dev/null +++ b/debian/deepin-log-viewer.postinst @@ -0,0 +1,24 @@ +#!/bin/bash + +#获取已登陆的用户 +userNameArr=($(who -q | head -n 1)) + +#定时器名称 +sysTimer="coredump-reporter.timer" + +#根据已登陆的用户开启后端定时任务 +for userName in ${userNameArr[@]} ; do + #获取服务状态 + serviceStatus=$(runuser -l ${userName} -c "XDG_RUNTIME_DIR=\"/run/user/$(id -u ${userName})\" systemctl --user is-active ${sysTimer}") + #活跃的关键字 + activeStr="active" + #如果为活跃的则表示服务已开启 + if [ "$serviceStatus" = "$activeStr" ];then + #如果服务已经启动则重新加载 + runuser -l ${userName} -c "XDG_RUNTIME_DIR=\"/run/user/$(id -u ${userName})\" systemctl --user daemon-reload" || true + else + #如果服务没有启动则设置开启 + runuser -l ${userName} -c "XDG_RUNTIME_DIR=\"/run/user/$(id -u ${userName})\" systemctl --user enable ${sysTimer}" || true + #runuser -l ${userName} -c "XDG_RUNTIME_DIR=\"/run/user/$(id -u ${userName})\" systemctl --user start ${sysTimer}" + fi +done \ No newline at end of file diff --git a/liblogviewerplugin/CMakeLists.txt b/liblogviewerplugin/CMakeLists.txt index 172da0f9..1c42a76e 100644 --- a/liblogviewerplugin/CMakeLists.txt +++ b/liblogviewerplugin/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMD_NAME logviewerplugin) #设置编译参数 set(CMAKE_AUTOUIC ON) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -66,9 +66,7 @@ find_package(DtkWidget REQUIRED) find_package(DtkGui REQUIRED) find_package(DtkCore REQUIRED) find_package(Qt5LinguistTools REQUIRED) -find_package(DFrameworkdbus REQUIRED) find_package(RapidJSON) -pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) find_package(Boost) find_package(XercesC) find_package(ZLIB) @@ -171,7 +169,6 @@ include_directories(${DtkCore_INCLUDE_DIRS}) include_directories(${DtkGui_INCLUDE_DIRS}) include_directories( ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) include_directories( ${Qt5Widgets_PRIVATE_INCLUDE_DIRS}) -include_directories( ${DFrameworkDBus_INCLUDE_DIRS}) include_directories( ${Boost_INCLUDE_DIRS}) include_directories( ${ZLIB_INCLUDE_DIRS}) message("ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}") @@ -181,7 +178,7 @@ include_sub_directories_recursively("${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/lib include_sub_directories_recursively("${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/DocxFactory/include") #引用库 -target_link_libraries(${TARGET_NAME} ${LINK_LIBS} ${DFrameworkDBus_LIBRARIES} -lsystemd -licui18n -licuuc -ldl -fPIC) +target_link_libraries(${TARGET_NAME} ${LINK_LIBS} -lsystemd -licui18n -licuuc -ldl -fPIC) target_link_libraries(${TARGET_NAME} ${DtkWidget_LIBRARIES}) target_link_libraries(${TARGET_NAME} ${DtkCore_LIBRARIES}) target_link_libraries(${TARGET_NAME} ${DtkGUI_LIBRARIES}) diff --git a/liblogviewerplugin/src/plugins/logviewerplugin.cpp b/liblogviewerplugin/src/plugins/logviewerplugin.cpp index 069a3224..1ceab689 100644 --- a/liblogviewerplugin/src/plugins/logviewerplugin.cpp +++ b/liblogviewerplugin/src/plugins/logviewerplugin.cpp @@ -155,7 +155,7 @@ bool LogViewerPlugin::exportAppLogFile(const QString &path, BUTTONID period, PRI } generateAppFile(m_curAppLog, period, level); connect(this, &LogViewerPlugin::sigAppFinished, this, [=](int index) { - qDebug() << "index:" << index << endl; + Q_UNUSED(index); exportLogFile(path); }); @@ -231,9 +231,9 @@ QString LogViewerPlugin::getAppName(const QString &filePath) return LogApplicationHelper::instance()->transName(ret); } -void LogViewerPlugin::exportLogFile(QString path) +void LogViewerPlugin::exportLogFile(const QString &path) { - LogExportThread *exportThread = new LogExportThread(m_isDataLoadComplete, this); + LogExportThread *exportThread = new LogExportThread(this); connect(exportThread, &LogExportThread::sigResult, this, &LogViewerPlugin::slot_exportResult); // connect(m_exportDlg, &ExportProgressDlg::sigCloseBtnClicked, exportThread, &LogExportThread::stopImmediately); // connect(m_exportDlg, &ExportProgressDlg::buttonClicked, exportThread, &LogExportThread::stopImmediately); diff --git a/liblogviewerplugin/src/plugins/logviewerplugin.h b/liblogviewerplugin/src/plugins/logviewerplugin.h index e5ab36ab..689064d0 100644 --- a/liblogviewerplugin/src/plugins/logviewerplugin.h +++ b/liblogviewerplugin/src/plugins/logviewerplugin.h @@ -77,7 +77,7 @@ public slots: QString getAppName(const QString &filePath); //导出日志 //path:导出路径 - void exportLogFile(QString path); + void exportLogFile(const QString &path); private: /** diff --git a/logViewerAuth/CMakeLists.txt b/logViewerAuth/CMakeLists.txt index 6dde89ee..b5e3130a 100644 --- a/logViewerAuth/CMakeLists.txt +++ b/logViewerAuth/CMakeLists.txt @@ -9,7 +9,7 @@ set (EXE_NAME logViewerAuth) set(LINK_LIBS Qt5::Core ) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) diff --git a/logViewerAuth/viewapplication.cpp b/logViewerAuth/viewapplication.cpp index 2c09de70..386d6d50 100644 --- a/logViewerAuth/viewapplication.cpp +++ b/logViewerAuth/viewapplication.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -14,23 +14,47 @@ #include #include #include +#include #include #include +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logViewApp, "org.deepin.log.viewer.application.view") +#else +Q_LOGGING_CATEGORY(logViewApp, "org.deepin.log.viewer.application.view", QtInfoMsg) +#endif + ViewApplication::ViewApplication(int &argc, char **argv): QCoreApplication(argc, argv),m_commondM(new QSharedMemory()) { QCommandLineParser parser; parser.process(*this); const QStringList fileList = parser.positionalArguments(); if (fileList.count() < 2) { - qDebug() << "less than 2"; + qCCritical(logViewApp) << "cmd param count less than 2"; return ; } + bool useFinishedSignal = false; + bool onlyExec = false; QStringList arg; if (fileList[0] == "dmesg") { arg << "-c" << "dmesg -r"; + } else if(fileList[0] == "coredumpctl-list"){ + arg << "-c" + << "coredumpctl list --no-pager"; + useFinishedSignal = true; + } else if(fileList[0] == "coredumpctl-info"){ + arg << "-c" + << QString("coredumpctl info %1").arg(fileList[1]); + } else if(fileList[0] == "coredumpctl-dump" && fileList.count() > 2){ + arg << "-c" + << QString("coredumpctl dump %1 -o %2").arg(fileList[1]).arg(fileList[2]); + onlyExec = true; + } else if(fileList[0] == "readelf" && fileList.count() > 1){ + arg << "-c" + << QString("readelf -n %1").arg(fileList[1]); + useFinishedSignal = true; } else { arg << "-c" << QString("cat %1").arg(fileList[0]); } @@ -42,18 +66,36 @@ ViewApplication::ViewApplication(int &argc, char **argv): QCoreApplication(argc, m_commondM->detach(); //解除关联 m_commondM->attach(QSharedMemory::ReadOnly); - connect(m_proc, &QProcess::readyReadStandardOutput, this, [ = ] { - if (!getControlInfo().isStart) - { - m_proc->kill(); - releaseMemery(); - exit(0); - } - QByteArray byte = m_proc->readAll(); - std::cout << byte.replace('\u0000', "").data(); - }); - m_proc->start("/bin/bash", arg); + if (useFinishedSignal) { + // 为读取崩溃日志全部信息,需要使用finished信号,使用readyReadStandardOutput信号,获取的日志信息不全 + connect(m_proc, QOverload::of(&QProcess::finished), this, [ = ](int exitCode, QProcess::ExitStatus exitStatus) { + Q_UNUSED(exitCode) + Q_UNUSED(exitStatus) + if (!getControlInfo().isStart) + { + m_proc->kill(); + releaseMemery(); + exit(0); + } + + QByteArray byte = m_proc->readAll(); + QStringList strList = QString(byte.replace('\u0000', "").replace("\x01", "")).split('\n', QString::SkipEmptyParts); + std::cout << byte.replace('\u0000', "").data(); + }); + } else if (!onlyExec) { + connect(m_proc, &QProcess::readyReadStandardOutput, this, [ = ] { + if (!getControlInfo().isStart) + { + m_proc->kill(); + releaseMemery(); + exit(0); + } + QByteArray byte = m_proc->readAll(); + std::cout << byte.replace('\u0000', "").data(); + }); + } + m_proc->start("/bin/bash", arg); m_proc->waitForFinished(-1); m_proc->close(); } diff --git a/logViewerService/CMakeLists.txt b/logViewerService/CMakeLists.txt index be646ef9..f8921c41 100755 --- a/logViewerService/CMakeLists.txt +++ b/logViewerService/CMakeLists.txt @@ -6,7 +6,7 @@ endif () #这里项目名称绝对不能和编译出的target名称一样 project(log-view-service) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) @@ -24,6 +24,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all") set(APP_RES_DIR "assets") set(APP_SERVICE "${APP_RES_DIR}/data/com.deepin.logviewer.service") +set(APP_SYSTEMD_SERVICE "${APP_RES_DIR}/data/deepin-log-viewer-daemon.service") set(APP_CONFIG "${APP_RES_DIR}/data/com.deepin.logviewer.conf") #安全测试加固编译参数 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -z relro -z now -z noexecstack -pie") @@ -38,6 +39,9 @@ find_package(Qt5 COMPONENTS Widgets DBus REQUIRED) +pkg_check_modules(3rd_lib REQUIRED + gio-qt + ) set(LINK_LIBS Qt5::Core @@ -53,6 +57,7 @@ add_executable(${PROJECT_NAME} ${ALL_SOURCES} ${ALL_HEADERS}) target_include_directories(${PROJECT_NAME} PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${PROJECT_BINARY_DIR} + ${3rd_lib_INCLUDE_DIRS} ) target_include_directories(${PROJECT_NAME} PUBLIC ${DtkWidget_INCLUDE_DIRS} ${OBJECT_BINARY_DIR}) @@ -60,6 +65,7 @@ target_link_libraries(${PROJECT_NAME} ${LINK_LIBS} ${DtkWidget_LIBRARIES} ${Qt5Widgets_LIBRARIES} + ${3rd_lib_LIBRARIES} ) set(CMAKE_INSTALL_PREFIX /usr) @@ -67,3 +73,5 @@ set(CMAKE_INSTALL_PREFIX /usr) install(TARGETS ${PROJECT_NAME} DESTINATION lib/deepin-daemon/) install(FILES ${APP_SERVICE} DESTINATION share/dbus-1/system-services/) install(FILES ${APP_CONFIG} DESTINATION share/dbus-1/system.d/) +# systemd service +install(FILES ${APP_SYSTEMD_SERVICE} DESTINATION lib/systemd/system/) diff --git a/logViewerService/assets/data/com.deepin.logviewer.service b/logViewerService/assets/data/com.deepin.logviewer.service index 41f0cca2..6532696d 100755 --- a/logViewerService/assets/data/com.deepin.logviewer.service +++ b/logViewerService/assets/data/com.deepin.logviewer.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=com.deepin.logviewer -Exec=/usr/lib/deepin-daemon/log-view-service -User=root +Exec=/usr/bin/false +SystemdService=deepin-log-viewer-daemon.service diff --git a/logViewerService/assets/data/com.deepin.logviewer.xml b/logViewerService/assets/data/com.deepin.logviewer.xml index 71a15679..35fccd12 100755 --- a/logViewerService/assets/data/com.deepin.logviewer.xml +++ b/logViewerService/assets/data/com.deepin.logviewer.xml @@ -5,6 +5,12 @@ + + + + + + @@ -29,5 +35,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/logViewerService/assets/data/deepin-log-viewer-daemon.service b/logViewerService/assets/data/deepin-log-viewer-daemon.service new file mode 100644 index 00000000..230ff752 --- /dev/null +++ b/logViewerService/assets/data/deepin-log-viewer-daemon.service @@ -0,0 +1,12 @@ +[Unit] +Description=Deepin Log Viewer Daemon + +[Service] +Type=dbus +BusName=com.deepin.logviewer +ExecStart=/usr/lib/deepin-daemon/log-view-service +CapabilityBoundingSet=~CAP_NET_RAW +MemoryLimit=8G + +[Install] +WantedBy=multi-user.target diff --git a/logViewerService/logviewerservice.cpp b/logViewerService/logviewerservice.cpp index b924bb10..a99352a8 100644 --- a/logViewerService/logviewerservice.cpp +++ b/logViewerService/logviewerservice.cpp @@ -1,9 +1,20 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #include "logviewerservice.h" +#include +#include +#include + +#include +#include +#include + +#include +#include +#include #include #include #include @@ -13,8 +24,63 @@ #include #include #include +#include +#include +#include +#include + +#ifdef QT_DEBUG +Q_LOGGING_CATEGORY(logService, "org.deepin.log.viewer.service") +#else +Q_LOGGING_CATEGORY(logService, "org.deepin.log.viewer.service", QtInfoMsg) +#endif + +// 读取崩溃应用maps信息最大行数 +#define COREDUMP_MAPS_MAX_LINES 200 + +/** + @brief 移除路径 \a dirPath 下的文件,注意,不会递归删除文件夹 + */ +void removeDirFiles(const QString &dirPath) +{ + QDir dir(dirPath); + dir.setFilter(QDir::NoDotAndDotDot | QDir::Files); + foreach(QString dirItem, dir.entryList()) { + if (!dir.remove(dirItem)) { + qCWarning(logService) << QString("Remove temporary dir file [%1] failed").arg(dirItem); + } + } +} + +/** + @brief 将压缩源文件 \a sourceFile 解压到临时文件,临时文件由模板 \a tempFileTemplate 生成, + 若文件创建异常,将返回空路径;正常解压返回临时文件路径。 + */ +QString unzipToTempFile(const QString &sourceFile, const QString &tempFileTemplate) +{ + QProcess m_process; + + // 每次创建临时文件,销毁由 QTemporaryDir 处理 + QTemporaryFile tmpFile; + tmpFile.setAutoRemove(false); + tmpFile.setFileTemplate(tempFileTemplate); + tmpFile.open(); + if (!tmpFile.open()) { + qCWarning(logService) << QString("Create temporary file [%1](FileTemplate:%2) failed: %3") + .arg(tmpFile.fileName()).arg(tempFileTemplate).arg(tmpFile.errorString()); + return QString(); + } -//const QStringList ValidInvokerExePathList1 = QStandardPaths::locateAll(QStandardPaths::ApplicationsLocation, "deepin-log-viewer"); + QString command = "gunzip"; + QStringList args; + args.append("-c"); + args.append(sourceFile); + m_process.setStandardOutputFile(tmpFile.fileName()); + m_process.start(command, args); + m_process.waitForFinished(-1); + + return tmpFile.fileName(); +} LogViewerService::LogViewerService(QObject *parent) : QObject(parent) @@ -23,6 +89,7 @@ LogViewerService::LogViewerService(QObject *parent) m_commands.insert("last", "last -x"); m_commands.insert("journalctl_system", "journalctl -r"); m_commands.insert("journalctl_boot", "journalctl -b -r"); + m_commands.insert("journalctl_app", "journalctl"); } LogViewerService::~LogViewerService() @@ -32,6 +99,8 @@ LogViewerService::~LogViewerService() delete eachPair.second; } } + + clearTempFiles(); } /*! @@ -41,24 +110,315 @@ LogViewerService::~LogViewerService() */ QString LogViewerService::readLog(const QString &filePath) { + if(!isValidInvoker()) { + return " "; + } + //增加服务黑名单,只允许通过提权接口读取/var/log下,家目录下和临时目录下的文件 - if ((!filePath.startsWith("/var/log/") && !filePath.startsWith("/tmp") && !filePath.startsWith("/home")) || filePath.contains("..") || !isValidInvoker()) { + //部分设备是直接从root账户进入,因此还需要监控/root目录 + if ((!filePath.startsWith("/var/log/") && + !filePath.startsWith("/tmp") && + !filePath.startsWith("/home") && + !filePath.startsWith("/root") && + !filePath.startsWith("coredumpctl info") && + !filePath.startsWith("coredumpctl dump") && + !filePath.startsWith("readelf") && + filePath != "coredump") || + filePath.contains("..")) { return " "; } - m_process.start("cat", QStringList() << filePath); + + if (filePath == "coredump") { + // 通过后端服务,读取系统下所有账户的崩溃日志信息 + m_process.start("coredumpctl", QStringList() << "list" << "--no-pager"); + m_process.waitForFinished(-1); + + return m_process.readAllStandardOutput(); + } else if (filePath.startsWith("coredumpctl info")) { + // 通过后端服务,按进程号获取崩溃信息 + QStringList args = filePath.mid(QString("coredumpctl").count() + 1).split(' '); + m_process.start("coredumpctl", args); + m_process.waitForFinished(-1); + + return m_process.readAllStandardOutput(); + } else if (filePath.startsWith("coredumpctl dump")) { + // 截取对应pid的dump文件到指定目录 + QStringList args = filePath.mid(QString("coredumpctl").count() + 1).split(' '); + m_process.start("coredumpctl", args); + m_process.waitForFinished(-1); + + return m_process.readAllStandardOutput(); + } else if (filePath.startsWith("readelf")) { + // 获取dump文件偏移地址信息 + QStringList args = filePath.mid(QString("readelf").count() + 1).split(' '); + m_process.start("readelf", args); + m_process.waitForFinished(-1); + + // 因原始maps信息过大,基本几百KB,埋点平台并不需要全量数据,仅取前200行maps信息即可 + QTextStream in(m_process.readAllStandardOutput()); + QStringList lines; + QString str; + while (!in.atEnd()) { + str = in.readLine(); + + if (!str.isEmpty()) + lines.push_back(str); + if (lines.count() >= COREDUMP_MAPS_MAX_LINES) + break; + } + + return lines.join('\n').toUtf8(); + } else { + m_process.start("cat", QStringList() << filePath); + m_process.waitForFinished(-1); + QByteArray byte = m_process.readAllStandardOutput(); + + //QByteArray -> QString 如果遇到0x00,会导致转换终止 + //replace("\x00", "")和replace("\u0000", "")无效 + //使用remove操作,性能损耗过大,因此遇到0x00 替换为 0x20(空格符) + int replaceTimes = 0; + for (int i = 0; i != byte.size(); ++i) { + if (byte.at(i) == 0x00) { + byte[i] = 0x20; + replaceTimes++; + } + } + return QString::fromUtf8(byte); + } +} + +qint64 LogViewerService::readFileAndReturnIndex(const QString &filePath, qint64 startLine, QList& lineIndexes, bool reverseOrder) { + std::ifstream file(filePath.toStdString()); + if (!file.is_open()) { + // 文件不存在,返回错误 + return -1; + } + + std::string line; + uint64_t lineNumber = 0; + uint64_t startIndex = 0; + + // TODO(pengfeixxx): If the index storage takes up too much memory, you can use differential + // encoding to encode the array where the index is stored, and if it is still large, + // you can continue to use Huffman encoding for the encoded array. + if (lineIndexes.empty()) { + // 从文件开头开始读取 + while (std::getline(file, line)) { + lineNumber++; + lineIndexes.push_back(startIndex); + startIndex = file.tellg(); + if (lineNumber > startLine && !reverseOrder) { + break; + } + } + } else { + if (startLine < lineIndexes.size() && !reverseOrder) { + return lineIndexes[startLine]; + } else { + file.seekg(lineIndexes.last()); + lineNumber = lineIndexes.size(); + while (std::getline(file, line)) { + lineNumber++; + startIndex = file.tellg(); + lineIndexes.push_back(startIndex); + if (lineNumber > startLine && !reverseOrder) { + break; + } + } + if (reverseOrder) + lineIndexes.removeLast(); + } + } + + file.close(); + + if (reverseOrder) { + startLine = lineIndexes.size() - startLine - 1; + if (startLine < 0) + return -1; + else + return lineIndexes.at(startLine); + } + + return lineIndexes.at(startLine); // 返回给定起始行的索引 +} + +QStringList LogViewerService::readLogLinesInRange(const QString &filePath, qint64 startLine, qint64 lineCount, bool bReverse) +{ + QStringList lines; + + if (!isValidInvoker()) + return lines; + + //增加服务黑名单,只允许通过提权接口读取/var/log下,家目录下和临时目录下的文件 + //部分设备是直接从root账户进入,因此还需要监控/root目录 + if ((!filePath.startsWith("/var/log/") && + !filePath.startsWith("/tmp") && + !filePath.startsWith("/home") && + !filePath.startsWith("/root")) || + filePath.contains("..")) { + return lines; + } + + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly)) { + QString token = QCryptographicHash::hash(filePath.toUtf8(), QCryptographicHash::Md5).toHex(); + if (m_logLineIndex.contains(token)) + m_logLineIndex.remove(token); + return lines; + } + + qint64 startLineIndex = 0; + QString token = QCryptographicHash::hash(filePath.toUtf8(), QCryptographicHash::Md5).toHex(); + if (m_logLineIndex.contains(token)) { + startLineIndex = readFileAndReturnIndex(filePath, startLine, m_logLineIndex[token], bReverse); + } else { + QList indexList; + startLineIndex = readFileAndReturnIndex(filePath, startLine, indexList, bReverse); + m_logLineIndex.insert(token, indexList); + } + + if (bReverse) { + int startLineCount = m_logLineIndex[token].size() - lineCount; + startLineIndex = startLineCount > 0 ? startLineCount : 0; + } + + if (startLineIndex < 0) + return lines; + + if (!file.seek(m_logLineIndex[token].at(startLineIndex))) { + file.close(); + return lines; + } + + QTextStream in(&file); + while (!in.atEnd() && lines.size() < lineCount) { + QString line = in.readLine(); + if (line.contains('\x00')) + lines.append(line.replace(QChar('\x00'), "")); + else + lines.append(line); + } + + file.close(); + + return lines; +} + +qint64 LogViewerService::findLineStartOffsetWithCaching(const QString &filePath, qint64 targetLine) { + + const int blockSize = 4096; // 设置块大小,可以根据实际情况调整 + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly)) { + return -1; // 无法打开文件 + } + + QByteArray block; + qint64 offset = 0; + qint64 currentLine = 0; + char *blockData = nullptr; + int blockPosition = 0; + int lineLength = 0; + + while (currentLine <= targetLine) { + block = file.read(blockSize); + if (block.isEmpty()) { + break; // 到达文件末尾 + } + + blockData = block.data(); + blockPosition = 0; + while (blockPosition < block.size()) { + char c = blockData[blockPosition++]; + lineLength++; + if (c == '\n') { // 检测到换行符,增加行数 + if (currentLine == targetLine) { + // 如果找到目标行,返回当前偏移量减去换行符的字节数 + return offset + blockPosition - lineLength; + } + currentLine++; + lineLength = 0; + } + } + + offset += block.size(); // 更新总偏移量 + } + + // 处理目标行为文本最后一行的情况 + if (currentLine >= targetLine) { + if (offset > 0 && lineLength > 0) + return offset - lineLength; + } + + file.close(); + + return -1; // 没有找到目标行 +} + +qint64 LogViewerService::getLineCount(const QString &filePath) { + + if (!isValidInvoker()) + return -1; + + //增加服务黑名单,只允许通过提权接口读取/var/log下,家目录下和临时目录下的文件 + //部分设备是直接从root账户进入,因此还需要监控/root目录 + if ((!filePath.startsWith("/var/log/") && + !filePath.startsWith("/tmp") && + !filePath.startsWith("/home") && + !filePath.startsWith("/root")) || + filePath.contains("..")) { + return -1; + } + + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly)) { + // 文件打开失败处理 + return -1; + } + + m_process.start("wc", QStringList() << "-l" << filePath); m_process.waitForFinished(-1); - QByteArray byte = m_process.readAllStandardOutput(); - - //QByteArray -> QString 如果遇到0x00,会导致转换终止 - //replace("\x00", "")和replace("\u0000", "")无效 - for(int i = 0;i != byte.size();++i) { - if(byte.at(i) == 0x00) { - byte.remove(i, 1); - i--; + + qint64 lineCount = -1; + QString result = m_process.readAllStandardOutput(); + QStringList splitResult = result.split(' '); + if (splitResult.size() > 0) + lineCount = splitResult.first().toLongLong(); + + return lineCount; +} + +QString LogViewerService::executeCmd(const QString &cmd) +{ + QString result(""); + + if (!isValidInvoker()) + return result; + + QString cmdStr; + QStringList args; + if (cmd == "coredumpctl-list-count") { + cmdStr = "/bin/bash"; + args << "-c"; + args << "coredumpctl list | wc -l | awk '{print $1-1}'"; + } + else if (cmd == "coredumpctl-list") { + cmdStr = "coredumpctl"; + args << "list"; + } + + if (!cmdStr.isEmpty()) { + m_process.start(cmdStr, args); + + if (!m_process.waitForFinished(-1)) { + qCWarning(logService()) << "invalid command:" << QString("%1 %2").arg(cmdStr).arg(args.join(' ')); + return ""; } + + result = m_process.readAllStandardOutput(); } - return QString::fromUtf8(byte); + return result; } /*! @@ -119,6 +479,113 @@ QString LogViewerService::readLogInStream(const QString &token) return result; } +bool LogViewerService::isFileExist(const QString &filePath) +{ + QFile file(filePath); + return file.exists(); +} + +quint64 LogViewerService::getFileSize(const QString &filePath) +{ + QFileInfo fi(filePath); + if (fi.exists()) + return static_cast(fi.size()); + + return 0; +} + +// 获取白名单导出路径 +QStringList LogViewerService::whiteListOutPaths() +{ + QStringList paths; + // 获取用户家目录 + QStringList homeList = getHomePaths(); + if (!homeList.isEmpty()) + paths << homeList; + // 获取外设挂载可写路径(包括smb路径) + paths << getExternalDevPaths(); + // 获取临时目录 + paths.push_back("/tmp"); + return paths; +} + +// 获取用户家目录 +QStringList LogViewerService::getHomePaths() +{ + QStringList homeList; + + if (!calledFromDBus()) { + return homeList; + } + + QFileInfoList infoList = QDir("/home").entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); + for (auto info : infoList) { + if (info.isDir()) + homeList.push_back(info.absoluteFilePath()); + } + + return homeList; +} + +// 获取外设挂载路径 +QStringList LogViewerService::getExternalDevPaths() +{ + QStringList devPaths; + const QList > mounts = getMounts_safe(); + for (auto mount : mounts) { + QString uri = mount->getRootFile()->uri(); + QString scheme = QUrl(mount->getRootFile()->uri()).scheme(); + + // sbm路径判断,分为gvfs挂载和cifs挂载两种 + QRegularExpression recifs("^file:///media/(.*)/smbmounts"); + QRegularExpression regvfs("^file:///run/user/(.*)/gvfs|^/root/.gvfs"); + if (recifs.match(uri).hasMatch() || regvfs.match(uri).hasMatch()) { + QString path = QUrl(uri).toLocalFile(); + QFlags power = QFile::permissions(path); + if (power.testFlag(QFile::WriteUser)) + devPaths.push_back(path); + } + + // 外设路径判断 + if ((scheme == "file") || //usb device + (scheme == "gphoto2") || //phone photo + (scheme == "mtp")) { //android file + QExplicitlySharedDataPointer locationFile = mount->getDefaultLocationFile(); + QString path = locationFile->path(); + if (path.startsWith("/media/")) { + QFlags power = QFile::permissions(path); + if (power.testFlag(QFile::WriteUser)) { + devPaths.push_back(path); + } + } + } + } + + return devPaths; +} + +//可重入版本的getMounts +QList > LogViewerService::getMounts_safe() +{ + static QMutex mutex; + mutex.lock(); + auto result = DGioVolumeManager::getMounts(); + mutex.unlock(); + return result; +} + +void LogViewerService::clearTempFiles() +{ + // 清除/tmp目录下lz4.dump文件 + QDir dirTemp(QDir::tempPath()); + dirTemp.setFilter(QDir::Files); + dirTemp.setNameFilters(QStringList() << "*.lz4.dump"); + QFileInfoList fiList = dirTemp.entryInfoList(); + for (auto fi : fiList) { + QFile::remove(fi.absoluteFilePath()); + } +} + /*! * \~chinese \brief LogViewerService::exitCode 返回进程状态 * \~chinese \return 进程返回值 @@ -133,7 +600,7 @@ int LogViewerService::exitCode() */ void LogViewerService::quit() { - qDebug() << "LogViewService::Quit called"; + qCDebug(logService) << "LogViewService::Quit called"; QCoreApplication::exit(0); } @@ -144,56 +611,108 @@ void LogViewerService::quit() */ QStringList LogViewerService::getFileInfo(const QString &file, bool unzip) { - int fileNum = 0; + // 判断非法调用 + if(!isValidInvoker()) { + return {}; + } + if (tmpDir.isValid()) { tmpDirPath = tmpDir.path(); + // 每次解压前移除旧有的文件 + if (unzip) { + removeDirFiles(tmpDirPath); + } } + QStringList fileNamePath; QString nameFilter; QDir dir; if (file.contains("deepin", Qt::CaseInsensitive) || file.contains("uos", Qt::CaseInsensitive)) { QFileInfo appFileInfo(file); - if (!appFileInfo.isFile()) { - return QStringList() << ""; + QString appDir; + if (appFileInfo.isFile()) { + appDir = appFileInfo.absolutePath(); + } else if (appFileInfo.isDir()) { + appDir = appFileInfo.absoluteFilePath(); + } else { + return QStringList(); } - QString appDir = appFileInfo.absolutePath(); + nameFilter = appDir.mid(appDir.lastIndexOf("/") + 1, appDir.size() - 1); dir.setPath(appDir); + dir.setFilter(QDir::Files | QDir::NoSymLinks); //实现对文件的过滤 + dir.setNameFilters(QStringList() << nameFilter + ".*"); //设置过滤 + dir.setSorting(QDir::Time); + + // 若该路径下未找到日志,则按日志文件名称来检索相关日志文件 + QFileInfoList fileList = dir.entryInfoList(); + if (fileList.size() == 0) + nameFilter = appFileInfo.completeBaseName(); + } else if (file == "audit"){ + dir.setPath("/var/log/audit"); + nameFilter = file; + } else if (file == "coredump") { + QProcess process; + process.start("coredumpctl", QStringList() << "list"); + process.waitForFinished(-1); + QByteArray outByte = process.readAllStandardOutput(); + QStringList strList = QString(outByte.replace('\u0000', "").replace("\x01", "")).split('\n', QString::SkipEmptyParts); + + QRegExp re("(Storage: )\\S+"); + for (int i = strList.size() - 1; i >= 0; --i) { + QString str = strList.at(i); + if (str.trimmed().isEmpty()) + continue; + + QStringList tmpList = str.split(" ", QString::SkipEmptyParts); + if (tmpList.count() < 10) + continue; + + QString coreFile = tmpList[8]; + QString pid = tmpList[4]; + QString storagePath = ""; + // 解析coredump文件保存位置 + if (coreFile != "missing") { + process.start("coredumpctl", QStringList() << "info" << pid); + process.waitForFinished(-1); + QByteArray outInfoByte = process.readAllStandardOutput(); + re.indexIn(outInfoByte); + storagePath = re.cap(0).replace("Storage: ", ""); + } + + if (!storagePath.isEmpty()) { + fileNamePath.append(storagePath); + } + } + + return fileNamePath; } else { dir.setPath("/var/log"); nameFilter = file; } //要判断路径是否存在 if (!dir.exists()) { - qWarning() << "it is not true path"; + qCWarning(logService) << "it is not true path"; return QStringList() << ""; } + dir.setFilter(QDir::Files | QDir::NoSymLinks); //实现对文件的过滤 dir.setNameFilters(QStringList() << nameFilter + ".*"); //设置过滤 dir.setSorting(QDir::Time); QFileInfoList fileList = dir.entryInfoList(); + QString tempFileTemplate = tmpDirPath + QDir::separator() + "Log_extract_XXXXXX.txt"; + for (int i = 0; i < fileList.count(); i++) { if (QString::compare(fileList[i].suffix(), "gz", Qt::CaseInsensitive) == 0 && unzip) { - // qDebug() << tmpDirPath; - QProcess m_process; - - QString command = "gunzip"; - QStringList args; - args.append("-c"); - // qDebug() << fileList[i].absoluteFilePath(); - args.append(fileList[i].absoluteFilePath()); - m_process.setStandardOutputFile(tmpDirPath + "/" + QString::number(fileNum) + ".txt"); - m_process.start(command, args); - m_process.waitForFinished(-1); - // qDebug() << m_process.readAll(); - fileNamePath.append(tmpDirPath + "/" + QString::number(fileNum) + ".txt"); - fileNum++; + QString unzipFile = unzipToTempFile(fileList[i].absoluteFilePath(), tempFileTemplate); + if (!unzipFile.isEmpty()) { + fileNamePath.append(unzipFile); + } } else { fileNamePath.append(fileList[i].absoluteFilePath()); } } - // qInfo()<& \"%2\";").arg(it.value(), outFullPath)); + + cmdExec = QString("%1 >& \"%2\";").arg(cmd, outFullPath); } - //设置文件权限 - arg[1].append(QString("chmod 777 \"%1\";").arg(outFullPath)); + + QString cmdStr = cmdExec.mid(0, cmdExec.indexOf(' ')); QProcess process; - process.start("/bin/bash", arg); + if (cmdStr == "cp") { + QStringList args; + args << cmdExec.mid(cmdExec.indexOf(' ') + 1).split(' '); + process.start(cmdStr, args); + } else { + process.start("/bin/bash", QStringList() << "-c" << cmdExec); + } + + if (!process.waitForFinished(-1)) { + qCWarning(logService) << "command error:" << cmdExec; + return false; + } + + //设置文件权限 + process.start("chmod", QStringList() << "777" << outFullPath); if (!process.waitForFinished()) { - qInfo() << "command error:" << arg; + qCWarning(logService) << QString("chmod 777 %1 failed.").arg(outFullPath); return false; } return true; @@ -313,6 +905,10 @@ bool LogViewerService::exportLog(const QString &outDir, const QString &in, bool bool LogViewerService::isValidInvoker() { + if (!calledFromDBus()) { + return false; + } + bool valid = false; QDBusConnection conn = connection(); QDBusMessage msg = message(); @@ -336,6 +932,21 @@ bool LogViewerService::isValidInvoker() if (valid) valid = ValidInvokerExePathList.contains(invokerPath); + // mnt判断 + if (valid) { + QProcess process; + process.start("readlink", QStringList() << QString("/proc/%1/ns/mnt").arg(pid)); + process.waitForFinished(-1); + QString appMnt = process.readAllStandardOutput(); + process.start("readlink", QStringList() << QString("/proc/1/ns/mnt")); + process.waitForFinished(-1); + QString selfMnt = process.readAllStandardOutput(); + valid = !selfMnt.isEmpty() && (selfMnt == appMnt); + if (!valid) { + qWarning() << QString("appMnt:%1 is not same as selfMnt:%2.").arg(appMnt).arg(selfMnt); + } + } + //非法调用 if (!valid) { sendErrorReply(QDBusError::ErrorType::Failed, diff --git a/logViewerService/logviewerservice.h b/logViewerService/logviewerservice.h index 022e59be..16ea4d59 100755 --- a/logViewerService/logviewerservice.h +++ b/logViewerService/logviewerservice.h @@ -5,6 +5,8 @@ #ifndef LOGVIEWERSERVICE_H #define LOGVIEWERSERVICE_H +#include + #include #include #include @@ -12,7 +14,7 @@ #include class QTextStream; - +class DGioVolumeManager; class LogViewerService : public QObject , protected QDBusContext { @@ -26,6 +28,8 @@ class LogViewerService : public QObject public Q_SLOTS: Q_SCRIPTABLE QString readLog(const QString &filePath); + // 获取指定行数范围的日志内容 + Q_SCRIPTABLE QStringList readLogLinesInRange(const QString &filePath, qint64 startLine, qint64 lineCount, bool bReverse); Q_SCRIPTABLE int exitCode(); Q_SCRIPTABLE void quit(); Q_SCRIPTABLE QStringList getFileInfo(const QString &file, bool unzip = true); @@ -33,6 +37,28 @@ public Q_SLOTS: Q_SCRIPTABLE bool exportLog(const QString &outDir, const QString &in, bool isFile); Q_SCRIPTABLE QString openLogStream(const QString &filePath); Q_SCRIPTABLE QString readLogInStream(const QString &token); + Q_SCRIPTABLE bool isFileExist(const QString &filePath); + Q_SCRIPTABLE quint64 getFileSize(const QString &filePath); + Q_SCRIPTABLE qint64 getLineCount(const QString &filePath); + // 仅能执行特定合法命令 + Q_SCRIPTABLE QString executeCmd(const QString &cmd); + Q_SCRIPTABLE QStringList whiteListOutPaths(); + +public: + // 获取用户家目录 + QStringList getHomePaths(); + // 获取外设挂载路径(包括smb路径) + QStringList getExternalDevPaths(); + QList> getMounts_safe(); + +private: + // 清理临时目录下一些缓存文件,如解压后dump文件等(前端可能没权限删除,因此统一放到后端清理) + void clearTempFiles(); + + // 通过缓存块方式快速定位到指定行行首 + qint64 findLineStartOffsetWithCaching(const QString &filePath, qint64 targetLine); + + qint64 readFileAndReturnIndex(const QString &filePath, qint64 startLine, QList& lineIndexes, bool reverseOrder); private: QTemporaryDir tmpDir; @@ -40,6 +66,7 @@ public Q_SLOTS: QString tmpDirPath; QMap m_commands; QMap> m_logMap; + QMap> m_logLineIndex; /** * @brief isValidInvoker 检验调研者是否是日志 * @return diff --git a/logViewerService/main.cpp b/logViewerService/main.cpp index 90c97f1d..1dfc49a3 100644 --- a/logViewerService/main.cpp +++ b/logViewerService/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2019 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -11,6 +11,9 @@ #include #include #include +#include + +Q_DECLARE_LOGGING_CATEGORY(logService) //service name const QString LogViewrServiceName = "com.deepin.logviewer"; @@ -22,7 +25,6 @@ int main(int argc, char *argv[]) //set env otherwise utils excutecmd excute command failed QString PATH = qgetenv("PATH"); - qDebug() << "main start" << PATH; if (PATH.isEmpty()) { PATH = "/usr/bin"; } @@ -30,12 +32,20 @@ int main(int argc, char *argv[]) PATH += ":/sbin"; qputenv("PATH", PATH.toLatin1()); + qCDebug(logService) << "log-viewer-service start, PATH" << PATH; + QCoreApplication a(argc, argv); a.setOrganizationName("deepin"); a.setApplicationName("deepin-log-viewer-service"); - +//#if (DTK_VERSION >= DTK_VERSION_CHECK(5, 6, 8, 0)) +#if 0 + Dtk::Core::DLogManager::registerJournalAppender(); +#ifdef QT_DEBUG + Dtk::Core::DLogManager::registerConsoleAppender(); +#endif +#else QDir dirCheck; - QString LogPath = QString("%1/%2/%3/Log/") + QString LogPath = QString("%1/%2/%3/") .arg("/var/log") .arg(qApp->organizationName()) .arg(qApp->applicationName()); @@ -43,25 +53,22 @@ int main(int argc, char *argv[]) if (!dirCheck.exists(LogPath)) { dirCheck.mkpath(LogPath); } - QString serviceLogPath=LogPath+QString("deepin-log-viewer-service.log"); + QString serviceLogPath=LogPath+QString("%1.log").arg(qApp->applicationName()); Dtk::Core::DLogManager::setlogFilePath(serviceLogPath); Dtk::Core::DLogManager::registerConsoleAppender(); Dtk::Core::DLogManager::registerFileAppender(); - +#endif QDBusConnection systemBus = QDBusConnection::systemBus(); if (!systemBus.registerService(LogViewrServiceName)) { - qCritical() << "registerService failed:" << systemBus.lastError(); + qCCritical(logService) << "registerService failed:" << systemBus.lastError(); exit(0x0001); } LogViewerWatcher watcher; LogViewerService service; - //service.getFileInfo("lpr"); - //service.readLog("etc/apt/sources.list"); - qDebug() << "systemBus.registerService success" << Dtk::Core::DLogManager::getlogFilePath(); if (!systemBus.registerObject(LogViewrPath, &service, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals)) { - qCritical() << "registerObject failed:" << systemBus.lastError(); + qCCritical(logService) << "registerObject failed:" << systemBus.lastError(); exit(0x0002); } return a.exec(); diff --git a/logViewerTruncate/CMakeLists.txt b/logViewerTruncate/CMakeLists.txt index ce552de0..e60f745a 100644 --- a/logViewerTruncate/CMakeLists.txt +++ b/logViewerTruncate/CMakeLists.txt @@ -10,7 +10,7 @@ set (EXE_NAME logViewerTruncate) set(LINK_LIBS Qt5::Core ) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) diff --git a/logViewerTruncate/main.cpp b/logViewerTruncate/main.cpp index e3a557c8..b1e40125 100644 --- a/logViewerTruncate/main.cpp +++ b/logViewerTruncate/main.cpp @@ -19,14 +19,11 @@ int main(int argc, char *argv[]) QCommandLineParser parser; parser.process(app); const QStringList fileList = parser.positionalArguments(); - // qInfo() << fileList << "***" << fileList.count(); if (fileList.count() < 1) { return 0; } - QString fileDirStr = fileList[0]; QStringList arg; if (fileList[0] == "dmesg") { - qDebug() << "dmesg -C"; arg << "-c" << "dmesg -C"; } else { diff --git a/rpm/deepin-log-viewer.spec b/rpm/deepin-log-viewer.spec index fa1ba7be..960d534c 100644 --- a/rpm/deepin-log-viewer.spec +++ b/rpm/deepin-log-viewer.spec @@ -1,14 +1,7 @@ -%define pkgrelease 1 -%if 0%{?openeuler} -%define specrelease %{pkgrelease} -%else -## allow specrelease to have configurable %%{?dist} tag in other distribution -%define specrelease %{pkgrelease}%{?dist} -%endif - +%define debug_package %{nil} Name: deepin-log-viewer -Version: 5.8.1.1 -Release: %{specrelease} +Version: 6.0.2 +Release: 1%{?dist}.01.zs Summary: Log Viewer is a useful tool for viewing system logs License: GPLv3+ URL: https://github.com/linuxdeepin/%{name} @@ -24,7 +17,7 @@ BuildRequires: libicu-devel BuildRequires: qt5-rpm-macros BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qttools-devel -BuildRequires: pkgconfig(dframeworkdbus) +BuildRequires: pkgconfig BuildRequires: gtest-devel BuildRequires: gmock-devel BuildRequires: kf5-kcodecs-devel @@ -34,21 +27,30 @@ BuildRequires: boost-devel BuildRequires: minizip-devel BuildRequires: rapidjson-devel BuildRequires: libtool-ltdl-devel -BuildRequires: fftw-libs - - - - +BuildRequires: dtkcommon-devel +BuildRequires: qt5-qtbase-private-devel +BuildRequires: qt5-qtsvg-devel +BuildRequires: zlib-devel %description Log Viewer is a useful tool for viewing system logs. -%prep -%autosetup -# %setup -q -####sed -i 's|lrelease|lrelease-qt5|' translations/translate_generation.sh +%package logviewerplugin +Summary: Log Viewer Plugin library +%description logviewerplugin +Deepin Log Viewer Plugin library. -# %patch0 -p1 +%package logviewerplugin-devel +Summary: Log Viewer Plugin library development headers +%description logviewerplugin-devel +Deepin Log Viewer Plugin library development headers. + +%prep +%if 0%{?openeuler} +%setup -q +%else +%autosetup -p1 +%endif %build export PATH=%{_qt5_bindir}:$PATH @@ -59,13 +61,12 @@ mkdir build && pushd build popd %install +%define _unpackaged_files_terminate_build 0 %make_install -C build INSTALL_ROOT="%buildroot" - - %files %doc README.md -%license LICENSE +%license LICENSE.txt %{_bindir}/%{name} %{_bindir}/logViewerAuth %{_bindir}/logViewerTruncate @@ -74,17 +75,22 @@ popd %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_datadir}/polkit-1/actions/*.policy %{_datadir}/deepin-manual/manual-assets/application/deepin-log-viewer/log-viewer/* - -/usr/lib/deepin-daemon/log-view-service -/usr/share/dbus-1/system-services/com.deepin.logviewer.service -/usr/share/dbus-1/system.d/com.deepin.logviewer.conf +%{_prefix}/lib/deepin-daemon/log-view-service +%{_datadir}/dbus-1/system-services/com.deepin.logviewer.service +%{_datadir}/dbus-1/system.d/com.deepin.logviewer.conf %{_datadir}/%{name}/DocxTemplate/*.dfw +%{_datadir}/dsg/configs/org.deepin.deepin-log-viewer/*.json +%{_datadir}/glib-2.0/schemas/*.gschema.xml +%files logviewerplugin +%{_libdir}/liblogviewerplugin.so.* +%files logviewerplugin-devel +%{_includedir}/liblogviewerplugin +%{_libdir}/liblogviewerplugin.so +%{_libdir}/pkgconfig/liblogviewerplugin.pc %changelog -* Mon Apr 19 2021 zhangdingwen - 5.9.1.1-1 -- init spec for euler +* Mon Jun 13 2022 uoser - 6.0.2-1.01 +- update: update to 6.0.2-1.01 -* Tue May 28 2019 Robin Lee - 5.8.0.3-1 -- Update to 5.8.0.3 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 773037da..595e7cfe 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ set(LINK_LIBS ADD_COMPILE_OPTIONS(-fno-inline) set (PROJECT_NAME_TEST deepin-log-viewer-test) set (PROJECT_NAME_PLUGIN_TEST deepin-log-viewer-plugin-test) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -89,8 +89,6 @@ find_package(DtkGui REQUIRED) find_package(DtkCore REQUIRED) find_package(Qt5LinguistTools REQUIRED) find_package(Qt5Test REQUIRED) -find_package(DFrameworkdbus REQUIRED) -pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) add_definitions(${Qt5Test_DEFINITIONS}) find_package(RapidJSON) find_package(Boost) @@ -129,13 +127,19 @@ FILE(GLOB allSource ../application/logapplication.cpp ../application/sharedmemorymanager.cpp ../application/logsettings.cpp + ../application/logbackend.cpp + ../application/eventlogutils.cpp ../application/wtmpparse.cpp ../application/DebugTimeManager.cpp ../application/logdetailedit.cpp ../application/dbusproxy/dldbusinterface.cpp ../application/dbusproxy/dldbushandler.cpp # ../application/viewsortfilter.cpp + ../application/logsegementexportthread.cpp ../application/logallexportthread.cpp + ../application/parsethread/parsethreadbase.cpp + ../application/parsethread/parsethreadkern.cpp + ../application/parsethread/parsethreadkwin.cpp ) FILE(GLOB qrcFiles ../application/assets/resources.qrc @@ -195,6 +199,7 @@ file(GLOB_RECURSE LVP_SOURCES "../liblogviewerplugin/src/*.cpp" "../application/dbusproxy/dldbusinterface.cpp" "../application/dbusproxy/dldbushandler.cpp" + "../application/dbusmanager.cpp" "../application/exportprogressdlg.cpp" "../application/journalbootwork.cpp" "../application/journalwork.cpp" @@ -203,15 +208,21 @@ file(GLOB_RECURSE LVP_SOURCES "../application/logauththread.cpp" "../application/logfileparser.cpp" "../application/sharedmemorymanager.cpp" + "../application/logsettings.cpp" "../application/utils.cpp" "../application/wtmpparse.cpp" "../application/logapplicationhelper.cpp" "../application/logexportthread.cpp" + "../application/logsegementexportthread.cpp" + "../application/parsethread/parsethreadbase.cpp" + "../application/parsethread/parsethreadkern.cpp" + "../application/parsethread/parsethreadkwin.cpp" ) file(GLOB_RECURSE LVP_HEADERS "../liblogviewerplugin/src/*.h" "../application/dbusproxy/dldbusinterface.h" "../application/dbusproxy/dldbushandler.h" + "../application/dbusmanager.h" "../application/exportprogressdlg.h" "../application/journalbootwork.h" "../application/journalwork.h" @@ -220,11 +231,16 @@ file(GLOB_RECURSE LVP_HEADERS "../application/logauththread.h" "../application/logfileparser.h" "../application/sharedmemorymanager.h" + "../application/logsettings.h" "../application/utils.h" "../application/wtmpparse.h" "../application/structdef.h" "../application/logapplicationhelper.h" "../application/logexportthread.h" + "../application/logsegementexportthread.h" + "../application/parsethread/parsethreadbase.h" + "../application/parsethread/parsethreadkern.h" + "../application/parsethread/parsethreadkwin.h" ) #--------------------------------------------- @@ -242,7 +258,6 @@ include_directories(${DtkGui_INCLUDE_DIRS}) include_directories( ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) include_directories( ${Qt5Widgets_PRIVATE_INCLUDE_DIRS}) include_directories( ${Qt5TestLib_LIBRARIES}) -include_directories( ${DFrameworkDBus_INCLUDE_DIRS}) include_directories( ${Boost_INCLUDE_DIRS}) include_directories( ${ZLIB_INCLUDE_DIRS}) include_directories( ${RapidJSON_INCLUDE_DIRS}) @@ -256,7 +271,7 @@ add_executable (${PROJECT_NAME_TEST} ${allSource} ${APP_QRC_FILES} ${APP_QM_FILE #添加插件单元测试进程 add_executable (${PROJECT_NAME_PLUGIN_TEST} ${allPluginTestSource} ${LVP_HEADERS} ${LVP_SOURCES} ${MINIZIP_SOURCES} ${LXW_SOURCES} ${DOCXFAC_SOURCES} ${DOCXFAC_SOURCES_C} ${TMPFILE_SOURCES} ${MD5SOURCES}) -target_link_libraries(${PROJECT_NAME_TEST} ${LINK_LIBS} ${DFrameworkDBus_LIBRARIES} -lsystemd -licui18n -licuuc ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread -ldl -fPIC) +target_link_libraries(${PROJECT_NAME_TEST} ${LINK_LIBS} -lsystemd -licui18n -licuuc ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread -ldl -fPIC) #当binutils>=2.22时,对于链接的静态库链接的静态库,cmake并不会递归链接,所以需要手动链接libxlsxwriter需要的lzlib target_link_libraries(${PROJECT_NAME_TEST} ${ZLIB_LIBRARIES}) target_link_libraries(${PROJECT_NAME_TEST} ${Boost_LIBRARIES}) @@ -265,7 +280,7 @@ target_link_libraries(${PROJECT_NAME_TEST} ${RapidJSON_LIBRARIES}) target_link_libraries(${PROJECT_NAME_TEST} ${XercesC_LIBRARIES}) target_link_libraries(${PROJECT_NAME_TEST} PolkitQt5-1::Agent) -target_link_libraries(${PROJECT_NAME_PLUGIN_TEST} ${LINK_LIBS} ${DFrameworkDBus_LIBRARIES} -lsystemd -licui18n -licuuc ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread -ldl -fPIC) +target_link_libraries(${PROJECT_NAME_PLUGIN_TEST} ${LINK_LIBS} -lsystemd -licui18n -licuuc ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread -ldl -fPIC) target_link_libraries(${PROJECT_NAME_PLUGIN_TEST} PolkitQt5-1::Agent) target_link_libraries(${PROJECT_NAME_PLUGIN_TEST} ${ZLIB_LIBRARIES}) target_link_libraries(${PROJECT_NAME_PLUGIN_TEST} ${XercesC_LIBRARIES}) diff --git a/tests/src/ut_dbusmanager.cpp b/tests/src/ut_dbusmanager.cpp index 6344ccdc..8e5f9279 100644 --- a/tests/src/ut_dbusmanager.cpp +++ b/tests/src/ut_dbusmanager.cpp @@ -16,8 +16,7 @@ TEST(DBusManager_GetSystemInfo_UT, DBusManager_GetSystemInfo_UT_001) { DBusManager *p = new DBusManager(nullptr); EXPECT_NE(p, nullptr); - QString info = p->getSystemInfo(); - bool rs = (info == "" || info == "klu" || info == "panguV" || info == "pangu"); + bool rs = p->isSEOpen(); EXPECT_EQ(rs, true); delete p; } diff --git a/tests/src/ut_displaycontent.cpp b/tests/src/ut_displaycontent.cpp index 1e5f2c04..84b91b73 100644 --- a/tests/src/ut_displaycontent.cpp +++ b/tests/src/ut_displaycontent.cpp @@ -6,6 +6,7 @@ #include "../application/displaycontent.h" #include "../application/exportprogressdlg.h" #include "../application/utils.h" +#include "../logbackend.h" #include "../application/logexportthread.h" #include "ut_stuballthread.h" #include "../application/DebugTimeManager.h" @@ -545,9 +546,9 @@ TEST_F(DisplayContentlx_UT, slot_appLogs_UT) stub.set(ADDR(DisplayContent, generateAppFile), generateAppFileNull); m_content->slot_appLogs(1, "~/.cache/deepin/deepin-log-viewer/deepin-log-viewer.log"); EXPECT_NE(m_content, nullptr); - EXPECT_EQ(m_content->appList.size(), 0)<<"check the status after slot_appLogs()"; + EXPECT_EQ(m_content->m_pLogBackend->appList.size(), 0)<<"check the status after slot_appLogs()"; EXPECT_EQ(m_content->m_curBtnId, 1)<<"check the status after slot_appLogs()"; - EXPECT_EQ(m_content->m_curAppLog,"~/.cache/deepin/deepin-log-viewer/deepin-log-viewer.log")<<"check the status after slot_appLogs()"; + EXPECT_EQ(m_content->m_curApp,"deepin-log-viewer")<<"check the status after slot_appLogs()"; } TEST_F(DisplayContentlx_UT, slot_dpkgData_UT) @@ -557,8 +558,8 @@ TEST_F(DisplayContentlx_UT, slot_dpkgData_UT) dpkgList.push_back(dpkgLog); m_content->m_flag = LOG_FLAG::DPKG; m_content->m_firstLoadPageData = true; - m_content->slot_dpkgData(-1, dpkgList); - EXPECT_NE(m_content->dListOrigin.size(), 0)<<"check the status after slot_dpkgData()"; + m_content->slot_dpkgData(dpkgList); + EXPECT_NE(m_content->m_pLogBackend->dListOrigin.size(), 0)<<"check the status after slot_dpkgData()"; EXPECT_EQ(m_content->m_flag, LOG_FLAG::DPKG)<<"check the status after slot_dpkgData()"; } @@ -566,7 +567,7 @@ TEST_F(DisplayContentlx_UT, slot_XorgFinished_UT) { m_content->m_flag = LOG_FLAG::XORG; m_content->m_firstLoadPageData = true; - m_content->slot_XorgFinished(-1); + m_content->slot_XorgFinished(); EXPECT_EQ(m_content->m_flag, LOG_FLAG::XORG)<<"check the status after slot_XorgFinished()"; EXPECT_EQ(m_content->m_isDataLoadComplete, true)<<"check the status after slot_XorgFinished()"; } @@ -578,9 +579,9 @@ TEST_F(DisplayContentlx_UT, slot_kernData_UT) kernList.push_back(kernLog); m_content->m_flag = LOG_FLAG::KERN; m_content->m_firstLoadPageData = true; - m_content->slot_kernData(-1, kernList); + m_content->slot_kernData(kernList); EXPECT_EQ(m_content->m_flag, LOG_FLAG::KERN)<<"check the status after slot_kernData()"; - EXPECT_NE(m_content->kListOrigin.size(),0)<<"check the status after slot_kernData()"; + EXPECT_NE(m_content->m_pLogBackend->kListOrigin.size(),0)<<"check the status after slot_kernData()"; } TEST_F(DisplayContentlx_UT, slot_kwinData_UT) @@ -590,9 +591,9 @@ TEST_F(DisplayContentlx_UT, slot_kwinData_UT) kwinList.push_back(kwinLog); m_content->m_flag = LOG_FLAG::Kwin; m_content->m_firstLoadPageData = true; - m_content->slot_kwinData(-1, kwinList); + m_content->slot_kwinData(kwinList); EXPECT_EQ(m_content->m_flag, LOG_FLAG::Kwin)<<"check the status after slot_kwinData()"; - EXPECT_NE(m_content->m_kwinList.size(),0)<<"check the status after slot_kwinData()"; + EXPECT_NE(m_content->m_pLogBackend->m_kwinList.size(),0)<<"check the status after slot_kwinData()"; } TEST_F(DisplayContentlx_UT, slot_bootData_UT) @@ -602,16 +603,16 @@ TEST_F(DisplayContentlx_UT, slot_bootData_UT) bootList.push_back(bootLog); m_content->m_flag = LOG_FLAG::BOOT; m_content->m_firstLoadPageData = true; - m_content->slot_bootData(-1, bootList); + m_content->slot_bootData(bootList); EXPECT_EQ(m_content->m_flag, LOG_FLAG::BOOT)<<"check the status after slot_bootData()"; - EXPECT_NE(m_content->bList.size(), 0)<<"check the status after slot_bootData()"; + EXPECT_NE(m_content->m_pLogBackend->bList.size(), 0)<<"check the status after slot_bootData()"; } TEST_F(DisplayContentlx_UT, slot_journalFinished_UT) { m_content->m_flag = LOG_FLAG::JOURNAL; m_content->m_firstLoadPageData = true; - m_content->slot_journalFinished(-1); + m_content->slot_journalFinished(); EXPECT_EQ(m_content->m_flag, LOG_FLAG::JOURNAL)<<"check the status after slot_journalFinished()"; EXPECT_EQ(m_content->m_isDataLoadComplete, true)<<"check the status after slot_journalFinished()"; } @@ -625,7 +626,7 @@ TEST_F(DisplayContentlx_UT, slot_dnfFinished_UT) m_content->m_firstLoadPageData = true; m_content->slot_dnfFinished(dnfList); EXPECT_EQ(m_content->m_flag, LOG_FLAG::Dnf)<<"check the status after slot_dnfFinished()"; - EXPECT_EQ(m_content->dnfList.size(), 1)<<"check the status after slot_dnfFinished()"; + EXPECT_EQ(m_content->m_pLogBackend->dnfList.size(), 1)<<"check the status after slot_dnfFinished()"; } TEST_F(DisplayContentlx_UT, slot_dmesgFinished_UT) @@ -637,16 +638,16 @@ TEST_F(DisplayContentlx_UT, slot_dmesgFinished_UT) m_content->m_firstLoadPageData = true; m_content->slot_dmesgFinished(dmesgList); EXPECT_EQ(m_content->m_flag, LOG_FLAG::Dmesg)<<"check the status after slot_dmesgFinished()"; - EXPECT_EQ(m_content->dmesgList.size(), 1)<<"check the status after slot_dmesgFinished()"; + EXPECT_EQ(m_content->m_pLogBackend->dmesgList.size(), 1)<<"check the status after slot_dmesgFinished()"; } TEST_F(DisplayContentlx_UT, slot_normalFinished_UT) { m_content->m_flag = LOG_FLAG::Normal; m_content->m_firstLoadPageData = true; - m_content->slot_normalFinished(-1); + m_content->slot_normalFinished(); EXPECT_EQ(m_content->m_flag, LOG_FLAG::Normal)<<"check the status after slot_normalFinished()"; - EXPECT_EQ(m_content->nortempList.size(), 0)<<"check the status after slot_normalFinished()"; + EXPECT_EQ(m_content->m_pLogBackend->nortempList.size(), 0)<<"check the status after slot_normalFinished()"; } TEST_F(DisplayContentlx_UT, slot_searchResult_UT) @@ -660,7 +661,7 @@ TEST_F(DisplayContentlx_UT, slot_searchResult_UT) m_content->m_flag = LOG_FLAG::NONE; m_content->slot_searchResult("test"); EXPECT_EQ(m_content->m_flag, LOG_FLAG::NONE)<<"check the status after slot_searchResult()"; - EXPECT_EQ(m_content->m_currentSearchStr, "test")<<"check the status after slot_searchResult()"; + EXPECT_EQ(m_content->m_pLogBackend->m_currentSearchStr, "test")<<"check the status after slot_searchResult()"; } TEST_F(DisplayContentlx_UT, slot_BtnSelected_UT) @@ -694,7 +695,6 @@ TEST_F(DisplayContentlx_UT, slot_logCatelogueClicked_UT){ model->setData(model->index(1,0),"dmesg",Qt::UserRole + 66); m_content->slot_logCatelogueClicked(model->index(0,0)); m_content->slot_logCatelogueClicked(model->index(1,0)); - EXPECT_EQ(sizeof(m_content->m_currentKwinFilter), 8)<<"check the status after slot_logCatelogueClicked()"; EXPECT_EQ(m_content->m_curListIdx,model->index(1,0))<<"check the status after slot_logCatelogueClicked()"; m_content->m_curListIdx=model->index(0,0); m_content->m_flag=LOG_FLAG::Dmesg; @@ -708,19 +708,19 @@ TEST_F(DisplayContentlx_UT, slot_xorgData_UT){ LOG_MSG_XORG xorg={"20210202","test"}; QListlistXorg; listXorg.append(xorg); - m_content->slot_xorgData(0,listXorg); + m_content->slot_xorgData(listXorg); m_content->m_flag=LOG_FLAG::XORG; - m_content->m_xorgCurrentIndex=1; + m_content->m_pLogBackend->m_xorgCurrentIndex=1; m_content->m_firstLoadPageData=true; - m_content->slot_xorgData(1,listXorg); + m_content->slot_xorgData(listXorg); EXPECT_EQ(m_content->m_flag,LOG_FLAG::XORG)<<"check the status after slot_xorgData()"; - EXPECT_NE(m_content->xListOrigin.size(), 0)<<"check the status after slot_xorgData()"; + EXPECT_NE(m_content->m_pLogBackend->xListOrigin.size(), 0)<<"check the status after slot_xorgData()"; } TEST_F(DisplayContentlx_UT, slot_journalBootFinished_UT){ m_content->m_flag=LOG_FLAG::JOURNAL; - m_content->m_journalCurrentIndex=1; - m_content->slot_journalFinished(1); + m_content->m_pLogBackend->m_journalCurrentIndex=1; + m_content->slot_journalFinished(); EXPECT_EQ(m_content->m_flag,LOG_FLAG::JOURNAL)<<"check the status after slot_journalBootFinished()"; EXPECT_EQ(m_content->m_isDataLoadComplete, true)<<"check the status after slot_journalBootFinished()"; } @@ -732,11 +732,11 @@ TEST_F(DisplayContentlx_UT, slot_applicationData_UT){ QListlistApp; listApp.append(app); m_content->m_flag=LOG_FLAG::APP; - m_content->m_appCurrentIndex=1; + m_content->m_pLogBackend->m_appCurrentIndex=1; m_content->m_firstLoadPageData=true; - m_content->slot_applicationData(1,listApp); + m_content->slot_applicationData(listApp); EXPECT_EQ(m_content->m_flag,LOG_FLAG::APP)<<"check the status after slot_applicationData()"; - EXPECT_NE(m_content->appListOrigin.size(),0)<<"check the status after slot_applicationData()"; + EXPECT_NE(m_content->m_pLogBackend->appListOrigin.size(),0)<<"check the status after slot_applicationData()"; } TEST_F(DisplayContentlx_UT, slot_logLoadFailed_UT){ @@ -749,13 +749,13 @@ TEST_F(DisplayContentlx_UT, filterNomal_UT){ LOG_MSG_NORMAL normal={"20210202","waring","test","test"}; QListlistNormal; listNormal.append(normal); - m_content->filterNomal(fiter,listNormal); + LogBackend::filterNomal(fiter,listNormal); fiter.eventTypeFilter=1; - m_content->filterNomal(fiter,listNormal); + LogBackend::filterNomal(fiter,listNormal); fiter.eventTypeFilter=2; - m_content->filterNomal(fiter,listNormal); + LogBackend::filterNomal(fiter,listNormal); fiter.eventTypeFilter=3; - m_content->filterNomal(fiter,listNormal); + LogBackend::filterNomal(fiter,listNormal); EXPECT_NE(m_content,nullptr)<<"check the status after filterNomal()"; } @@ -786,13 +786,13 @@ TEST_F(DisplayContentlx_UT, filterJournal_UT){ LOG_MSG_JOURNAL journal={"20210202","waring","test","test","test","test"}; QListlistjournal; listjournal.append(journal); - QList list= m_content->filterJournal("",listjournal); + QList list= LogBackend::filterJournal("",listjournal); EXPECT_EQ(list.at(0).daemonId,"test")<<"check the status after filterJournal()"; EXPECT_EQ(list.at(0).daemonName,"test")<<"check the status after filterJournal()"; EXPECT_EQ(list.at(0).dateTime,"20210202")<<"check the status after filterJournal()"; EXPECT_EQ(list.at(0).level,"test")<<"check the status after filterJournal()"; EXPECT_EQ(list.at(0).msg,"test")<<"check the status after filterJournal()"; - m_content->filterJournal("test",listjournal); + LogBackend::filterJournal("test",listjournal); } @@ -826,7 +826,7 @@ TEST(DisplayContent_Constructor_UT, Dslot_normalData_UT_001) test.eventType = "type"; p->m_flag = Normal; p->m_firstLoadPageData = true; - p->slot_normalData(-1, QList {test}); + p->slot_normalData(QList {test}); EXPECT_EQ(p->m_flag,LOG_FLAG::Normal)<<"check the status after slot_normalData()"; delete p; } @@ -1122,9 +1122,12 @@ TEST(DisplayContent_createOOCTable_UT, DisplayContent_createOOCTable_UT_001) { DisplayContent *p = new DisplayContent(nullptr); EXPECT_NE(p, nullptr); - QList list; + QList list; for (int i = 0; i < 100; ++i) { - list.append(QStringList()<<"deepin-installer-init.log"<<"/var/log/deepin-installer-init.log"); + LOG_FILE_OTHERORCUSTOM data; + data.name = "deepin-installer-init.log"; + data.path = "/var/log/deepin-installer-init.log"; + list.append(data); } p->createOOCTable(list); p->deleteLater(); @@ -1254,7 +1257,7 @@ TEST(DisplayContent_createXorgTable_UT, DisplayContent_createXorgTable_UT_001) LOG_MSG_XORG item; for (int i = 0; i < 100; ++i) { item.msg = QString("msg%1").arg(i); - item.dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); + item.offset = "3.541"; list.append(item); } p->createXorgTable(list); @@ -1702,7 +1705,7 @@ TEST(DisplayContent_slot_appLogs_UT, DisplayContent_slot_appLogs_UT_001) DisplayContent *p = new DisplayContent(nullptr); EXPECT_NE(p, nullptr); stub.set(ADDR(DisplayContent, generateAppFile), DisplayContent_slot_BtnSelected_UT_generateAppFile); - p->slot_appLogs(1, QDir::homePath() + "/.cache/deepin/deepin-log-viewer/deepin-log-viewer.log"); + p->slot_appLogs(1, Utils::homePath + "/.cache/deepin/deepin-log-viewer/deepin-log-viewer.log"); p->deleteLater(); } @@ -1846,9 +1849,9 @@ TEST(DisplayContent_slot_dpkgFinished_UT, DisplayContent_slot_dpkgFinished_UT_00 list.append(item); } p->m_flag = DPKG; - p->slot_dpkgFinished(p->m_dpkgCurrentIndex); + p->slot_dpkgFinished(); p->m_flag = NONE; - p->slot_dpkgFinished(0); + p->slot_dpkgFinished(); delete p; } @@ -1865,13 +1868,13 @@ TEST(DisplayContent_slot_XorgFinished_UT, DisplayContent_slot_XorgFinished_UT_00 LOG_MSG_XORG item; for (int i = 0; i < 100; ++i) { item.msg = QString("msg%1").arg(i); - item.dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); + item.offset = "3.541"; list.append(item); } p->m_flag = XORG; - p->slot_XorgFinished(p->m_xorgCurrentIndex); + p->slot_XorgFinished(); p->m_flag = NONE; - p->slot_XorgFinished(0); + p->slot_XorgFinished(); p->deleteLater(); } @@ -1890,9 +1893,9 @@ TEST(DisplayContent_slot_bootFinished_UT, DisplayContent_slot_bootFinished_UT_00 list.append(item); } p->m_flag = BOOT; - p->slot_bootFinished(p->m_bootCurrentIndex); + p->slot_bootFinished(); p->m_flag = NONE; - p->slot_bootFinished(0); + p->slot_bootFinished(); p->deleteLater(); } TEST(DisplayContent_slot_kernFinished_UT, DisplayContent_slot_kernFinished_UT_001) @@ -1914,9 +1917,9 @@ TEST(DisplayContent_slot_kernFinished_UT, DisplayContent_slot_kernFinished_UT_00 list.append(item); } p->m_flag = KERN; - p->slot_kernFinished(p->m_kernCurrentIndex); + p->slot_kernFinished(); p->m_flag = NONE; - p->slot_kernFinished(0); + p->slot_kernFinished(); p->deleteLater(); } TEST(DisplayContent_slot_kwinFinished_UT, DisplayContent_slot_kwinFinished_UT_001) @@ -1933,9 +1936,9 @@ TEST(DisplayContent_slot_kwinFinished_UT, DisplayContent_slot_kwinFinished_UT_00 list.append(item); } p->m_flag = Kwin; - p->slot_kwinFinished(p->m_kwinCurrentIndex); + p->slot_kwinFinished(); p->m_flag = NONE; - p->slot_kwinFinished(0); + p->slot_kwinFinished(); p->deleteLater(); } @@ -1946,7 +1949,7 @@ TEST(DisplayContent_slot_journalBootFinished_UT, DisplayContent_slot_journalBoot stub.set(ADDR(journalWork, getReplaceColorStr), stub_getReplaceColorStr_bootwork); DisplayContent *p = new DisplayContent(nullptr); EXPECT_NE(p, nullptr); - p->slot_journalBootFinished(p->m_journalCurrentIndex); + p->slot_journalBootFinished(); p->deleteLater(); } @@ -1959,13 +1962,13 @@ TEST(DisplayContent_slot_OOCFinished_UT, DisplayContent_slot_OOCFinished_UT_001) p->m_pModel->appendRow(QList()<m_treeView->selectionModel()->select(p->m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); p->m_treeView->setCurrentIndex(p->m_pModel->index(0, 0)); - p->m_OOCCurrentIndex = 1; + p->m_pLogBackend->m_OOCCurrentIndex = 1; p->m_flag = OtherLog; - p->slot_OOCFinished(1); - p->slot_OOCFinished(1, 1); + p->slot_OOCFinished(); + p->slot_OOCFinished(); p->m_flag = CustomLog; - p->slot_OOCFinished(1); - p->slot_OOCFinished(1, 1); + p->slot_OOCFinished(); + p->slot_OOCFinished(); p->deleteLater(); } @@ -1978,11 +1981,11 @@ TEST(DisplayContent_slot_OOCData_UT, DisplayContent_slot_OOCData_UT_001) p->m_pModel->appendRow(QList()<m_treeView->selectionModel()->select(p->m_pModel->index(0, 0), QItemSelectionModel::Rows | QItemSelectionModel::Select); p->m_treeView->setCurrentIndex(p->m_pModel->index(0, 0)); - p->m_OOCCurrentIndex = 1; + p->m_pLogBackend->m_OOCCurrentIndex = 1; p->m_flag = OtherLog; - p->slot_OOCData(1, "data"); + p->slot_OOCData("data"); p->m_flag = CustomLog; - p->slot_OOCData(1, "data"); + p->slot_OOCData("data"); p->deleteLater(); } @@ -2031,10 +2034,9 @@ TEST_P(DisplayContent_slot_journalData_UT, DisplayContent_slot_journalData_UT_00 } p->m_flag = param.m_flag; - p->m_journalCurrentIndex = 0; + p->m_pLogBackend->m_journalCurrentIndex = 0; p->m_firstLoadPageData = param.m_firstLoadPageData; - int index = param.indexEqual ? 0 : 1; - p->slot_journalData(index, list); + p->slot_journalData(list); p->deleteLater(); } @@ -2083,10 +2085,10 @@ TEST_P(DisplayContent_slot_journalBootData_UT, DisplayContent_slot_journalBootDa } p->m_flag = param.m_flag; - p->m_journalBootCurrentIndex = 0; + p->m_pLogBackend->m_journalBootCurrentIndex = 0; p->m_firstLoadPageData = param.m_firstLoadPageData; int index = param.indexEqual ? 0 : 1; - p->slot_journalBootData(index, list); + p->slot_journalBootData(list); p->deleteLater(); } @@ -2107,9 +2109,9 @@ TEST(DisplayContent_slot_applicationFinished_UT, DisplayContent_slot_application list.append(item); } p->m_flag = APP; - p->slot_applicationFinished(p->m_appCurrentIndex); + p->slot_applicationFinished(); p->m_flag = NONE; - p->slot_applicationFinished(0); + p->slot_applicationFinished(); p->deleteLater(); } @@ -2121,9 +2123,9 @@ TEST(DisplayContent_slot_NormalFinished_UT, DisplayContent_NormalFinished_UT_001 DisplayContent *p = new DisplayContent(nullptr); EXPECT_NE(p, nullptr); p->m_flag = Normal; - p->slot_normalFinished(p->m_normalCurrentIndex); + p->slot_normalFinished(); p->m_flag = NONE; - p->slot_normalFinished(0); + p->slot_normalFinished(); p->deleteLater(); } TEST(DisplayContent_slot_themeChanged_UT, DisplayContent_slot_themeChanged_UT_001) @@ -2271,7 +2273,7 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ item.daemonName = "test_daemon"; list.append(item); } - p->jBootListOrigin.append(list); + p->m_pLogBackend->jBootListOrigin.append(list); break; } case BOOT_KLU: { @@ -2286,7 +2288,7 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ item.daemonName = "test_daemon"; list.append(item); } - p->jBootListOrigin.append(list); + p->m_pLogBackend->jBootListOrigin.append(list); break; } case KERN: { @@ -2301,7 +2303,7 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ item.daemonName = "test_daemon"; list.append(item); } - p->kListOrigin.append(list); + p->m_pLogBackend->kListOrigin.append(list); break; } case BOOT: { @@ -2312,10 +2314,10 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ LOG_MSG_XORG item; for (int i = 0; i < 100; ++i) { item.msg = QString("msg%1").arg(i); - item.dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); + item.offset = "3.541"; list.append(item); } - p->xListOrigin.append(list); + p->m_pLogBackend->xListOrigin.append(list); break; } case DPKG: { @@ -2327,7 +2329,7 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ item.action = ""; list.append(item); } - p->dListOrigin.append(list); + p->m_pLogBackend->dListOrigin.append(list); break; } case APP: { @@ -2340,7 +2342,7 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ item.src = "test_src"; list.append(item); } - p->appListOrigin.append(list); + p->m_pLogBackend->appListOrigin.append(list); break; } case Normal: { @@ -2353,7 +2355,7 @@ TEST_P(DisplayContent_slot_searchResult_UT, DisplayContent_slot_searchResult_UT_ item.msg = QString("msg%1").arg(i); list.append(item); } - p->m_kwinList.append(list); + p->m_pLogBackend->m_kwinList.append(list); break; } default: @@ -2536,7 +2538,7 @@ TEST_P(DisplayContent_parseListToModel_XORG_UT, DisplayContent_parseListToModel_ LOG_MSG_XORG item; for (int i = 0; i < 100; ++i) { item.msg = QString("msg%1").arg(i); - item.dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); + item.offset = "3.541"; list.append(item); } } @@ -2703,7 +2705,7 @@ class DisplayContent_setLoadState_UT : public ::testing::TestWithParamclearAllFilter(); + p->m_pLogBackend->clearAllFilter(); - EXPECT_EQ(p->m_bootFilter.searchstr, ""); - EXPECT_EQ(p->m_bootFilter.statusFilter, ""); - EXPECT_EQ(p->m_currentSearchStr.isEmpty(), true); - EXPECT_EQ(p->m_currentKwinFilter.msg, ""); - EXPECT_EQ(p->m_normalFilter.searchstr, ""); - EXPECT_EQ(p->m_normalFilter.timeFilterEnd, -1); - EXPECT_EQ(p->m_normalFilter.timeFilterBegin, -1); - EXPECT_EQ(p->m_normalFilter.eventTypeFilter, 0); + EXPECT_EQ(p->m_pLogBackend->m_bootFilter.searchstr, ""); + EXPECT_EQ(p->m_pLogBackend->m_bootFilter.statusFilter, ""); + EXPECT_EQ(p->m_pLogBackend->m_currentSearchStr.isEmpty(), true); + EXPECT_EQ(p->m_pLogBackend->m_normalFilter.searchstr, ""); + EXPECT_EQ(p->m_pLogBackend->m_normalFilter.timeFilterEnd, -1); + EXPECT_EQ(p->m_pLogBackend->m_normalFilter.timeFilterBegin, -1); + EXPECT_EQ(p->m_pLogBackend->m_normalFilter.eventTypeFilter, 0); p->deleteLater(); } @@ -2803,27 +2804,27 @@ TEST(DisplayContent_clearAllDatalist_UT, DisplayContent_clearAllDatalist_UT) DisplayContent *p = new DisplayContent(nullptr); EXPECT_NE(p, nullptr); - p->clearAllDatalist(); + p->clearAllDatas(); EXPECT_EQ(p->m_pModel->rowCount(), 0); EXPECT_EQ(p->m_pModel->columnCount(), 0); - EXPECT_EQ(p->jList.size(), 0); - EXPECT_EQ(p->jListOrigin.size(), 0); - EXPECT_EQ(p->dListOrigin.size(), 0); - EXPECT_EQ(p->xList.size(), 0); - EXPECT_EQ(p->xListOrigin.size(), 0); - EXPECT_EQ(p->bList.size(), 0); - EXPECT_EQ(p->currentBootList.size(), 0); - EXPECT_EQ(p->kList.size(), 0); - EXPECT_EQ(p->kListOrigin.size(), 0); - EXPECT_EQ(p->appList.size(), 0); - EXPECT_EQ(p->appListOrigin.size(), 0); - EXPECT_EQ(p->norList.size(), 0); - EXPECT_EQ(p->nortempList.size(), 0); - EXPECT_EQ(p->m_currentKwinList.size(), 0); - EXPECT_EQ(p->m_kwinList.size(), 0); - EXPECT_EQ(p->jBootList.size(), 0); - EXPECT_EQ(p->jBootListOrigin.size(), 0); + EXPECT_EQ(p->m_pLogBackend->jList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->jListOrigin.size(), 0); + EXPECT_EQ(p->m_pLogBackend->dListOrigin.size(), 0); + EXPECT_EQ(p->m_pLogBackend->xList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->xListOrigin.size(), 0); + EXPECT_EQ(p->m_pLogBackend->bList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->currentBootList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->kList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->kListOrigin.size(), 0); + EXPECT_EQ(p->m_pLogBackend->appList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->appListOrigin.size(), 0); + EXPECT_EQ(p->m_pLogBackend->norList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->nortempList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->m_currentKwinList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->m_kwinList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->jBootList.size(), 0); + EXPECT_EQ(p->m_pLogBackend->jBootListOrigin.size(), 0); p->deleteLater(); } @@ -2860,7 +2861,7 @@ TEST_P(DisplayContent_filterBoot_UT, DisplayContent_filterBoot_UT) item.status = "OK"; list.append(item); } - QList rslist = p->filterBoot(filter, list); + QList rslist = LogBackend::filterBoot(filter, list); EXPECT_EQ(rslist.size(), 100); p->deleteLater(); @@ -2902,7 +2903,7 @@ TEST_P(DisplayContent_filterNomal_UT, DisplayContent_filterNomal_UT) list.append(item); } - QList rslist = p->filterNomal(filter, list); + QList rslist = LogBackend::filterNomal(filter, list); int resultCount = (param.m_isEventTypeFilterEmpty && (!param.m_isMsgFilerEmpty)) ? 0 : 100; EXPECT_EQ(rslist.size(), resultCount); diff --git a/tests/src/ut_filtercontent.cpp b/tests/src/ut_filtercontent.cpp index dd9f2c76..7ce8a8c0 100644 --- a/tests/src/ut_filtercontent.cpp +++ b/tests/src/ut_filtercontent.cpp @@ -124,7 +124,7 @@ TEST_F(FilterContent_UT, slot_logCatelogueClicked_UT) m_model.setData(m_model.index(7, 0), QString("bootklu"), Qt::UserRole + 66); m_model.setData(m_model.index(8, 0), QString("/var/log/dnf.log"), Qt::UserRole + 66); m_model.setData(m_model.index(9, 0), QString("dmesg"), Qt::UserRole + 66); - m_model.setData(m_model.index(10, 0), QString(QDir::homePath() + "/.kwin.log"), Qt::UserRole + 66); + m_model.setData(m_model.index(10, 0), QString(Utils::homePath + "/.kwin.log"), Qt::UserRole + 66); for (int i = 0; i < m_model.rowCount(); i++) { QModelIndex modelindex = m_model.index(i, 0, QModelIndex()); m_filter->slot_logCatelogueClicked(modelindex); diff --git a/tests/src/ut_logapplicationhelper.cpp b/tests/src/ut_logapplicationhelper.cpp index 6c5320a9..42334577 100644 --- a/tests/src/ut_logapplicationhelper.cpp +++ b/tests/src/ut_logapplicationhelper.cpp @@ -75,7 +75,7 @@ TEST(LogApplicationHelper_createDesktopFiles_UT, LogApplicationHelper_createDesk EXPECT_NE(p, nullptr); Stub stub; stub.set((QByteArray(QIODevice::*)(qint64))ADDR(QIODevice, readLine), stub_readLine); - stub.set(ADDR(LogApplicationHelper, parseField), stub_parseField); + stub.set(ADDR(LogApplicationHelper, generateTransName), stub_parseField); p->createDesktopFiles(); p->deleteLater(); } @@ -86,7 +86,7 @@ TEST(LogApplicationHelper_createDesktopFiles_UT, LogApplicationHelper_createDesk EXPECT_NE(p, nullptr); Stub stub; stub.set((QByteArray(QIODevice::*)(qint64))ADDR(QIODevice, readLine), stub_readLine001); - stub.set(ADDR(LogApplicationHelper, parseField), stub_parseField); + stub.set(ADDR(LogApplicationHelper, generateTransName), stub_parseField); p->createDesktopFiles(); p->deleteLater(); } @@ -127,7 +127,7 @@ TEST_P(LogApplicationHelper_parseField_UT, LogApplicationHelper_parseField_UT) EXPECT_NE(p, nullptr); LogApplicationHelper_parseField_UT_Param param = GetParam(); QString path = param.isPathEmpty ? "" : "../sources/dde-calendar.log"; - p->parseField(path, "dde-calendar.log", param.isDeepin, param.isGeneric, param.isName); + p->generateTransName(path, "dde-calendar.log", param.isDeepin, param.isGeneric, param.isName); p->deleteLater(); } diff --git a/tests/src/ut_logapplicationparsethread.cpp b/tests/src/ut_logapplicationparsethread.cpp index d8677709..c45630e2 100644 --- a/tests/src/ut_logapplicationparsethread.cpp +++ b/tests/src/ut_logapplicationparsethread.cpp @@ -84,7 +84,9 @@ TEST_F(LogApplicationParseThread_UT, UT_OnProcFinished_001){ TEST_F(LogApplicationParseThread_UT, UT_SetParam_001){ APP_FILTERS appfilter; - m_logAppThread->setParam(appfilter); + APP_FILTERSList appfilters; + appfilters << appfilter; + m_logAppThread->setFilters(appfilters); EXPECT_NE(m_logAppThread, nullptr); EXPECT_EQ(m_logAppThread->m_AppFiler.path, appfilter.path); } diff --git a/tests/src/ut_logauththread.cpp b/tests/src/ut_logauththread.cpp index 6fa1b0d8..6738d882 100644 --- a/tests/src/ut_logauththread.cpp +++ b/tests/src/ut_logauththread.cpp @@ -176,7 +176,7 @@ class LogAuthThread_UT : public testing::Test } void SetUp() //TEST跑之前会执行SetUp { - m_logAuthThread = LogAuthThread::instance(); + m_logAuthThread = new LogAuthThread(); qDebug() << "SetUp" << endl; } void TearDown() //TEST跑完之后会执行TearDown diff --git a/tests/src/ut_logdetailinfowidget.cpp b/tests/src/ut_logdetailinfowidget.cpp index 83f34c7d..70d2b4d4 100644 --- a/tests/src/ut_logdetailinfowidget.cpp +++ b/tests/src/ut_logdetailinfowidget.cpp @@ -100,6 +100,6 @@ TEST(logDetailInfoWidget_slot_DetailInfo_UT, logDetailInfoWidget_slot_DetailInfo { logDetailInfoWidget *p = new logDetailInfoWidget(nullptr); EXPECT_NE(p, nullptr); - p->slot_DetailInfo(QModelIndex(), nullptr, ""); + p->slot_DetailInfo(QModelIndex(), nullptr, "", 0); p->deleteLater(); } diff --git a/tests/src/ut_logexportthread.cpp b/tests/src/ut_logexportthread.cpp index 2d4e8f0f..304cc6da 100644 --- a/tests/src/ut_logexportthread.cpp +++ b/tests/src/ut_logexportthread.cpp @@ -71,8 +71,7 @@ class LogExportthread_UT : public testing::Test } void SetUp() //TEST跑之前会执行SetUp { - bool iscomplete = true; - exportThread = new LogExportThread(iscomplete); + exportThread = new LogExportThread(); qDebug() << "SetUp" << endl; } void TearDown() //TEST跑完之后会执行TearDown @@ -637,9 +636,7 @@ TEST_F(LogExportthread_UT, ExportRun_UT) QList m_kwinList {m_kwin}; QList m_dnfList {m_dnf}; QList m_dmesgList {m_dmesg}; - QString test = "test"; exportThread->m_canRunning = false; - exportThread->m_allLoadComplete = true; exportThread->m_runMode = LogExportThread::HtmlModel; exportThread->run(); diff --git a/tests/src/ut_logfileparser.cpp b/tests/src/ut_logfileparser.cpp index 3f0ad3e7..769a411e 100644 --- a/tests/src/ut_logfileparser.cpp +++ b/tests/src/ut_logfileparser.cpp @@ -412,13 +412,6 @@ class LogFileParser_UT : public testing::Test // EXPECT_NE(m_parser,nullptr); //} - -TEST_F(LogFileParser_UT, UT_CreateFile_001) -{ - m_parser->createFile("ddd", 1); - EXPECT_NE(m_parser,nullptr); -} - TEST_F(LogFileParser_UT, UT_ParseByJournal_001) { Stub stub; @@ -437,7 +430,6 @@ TEST_F(LogFileParser_UT, UT_ParseByJournal_001) stub.set(ADDR(SharedMemoryManager, setRunnableTag), stub_LogsetRunnableTag001); stub.set(wtmp_close, stub_wtmp_close001); m_parser->parseByJournal(); - EXPECT_EQ(m_parser->m_isJournalLoading,true)<<"check the status after parseByJournal()"; } TEST_F(LogFileParser_UT, UT_parseByJournalBoot_001) @@ -480,5 +472,4 @@ TEST_F(LogFileParser_UT, UT_parseByOOC_001) stub.set(wtmp_close, stub_wtmp_close001); QString path("test"); m_parser->parseByOOC(path); - EXPECT_EQ(m_parser->m_isOOCLoading,true)<<"check the status after parseByJournal()"; } diff --git a/tests/src/ut_loglistview.cpp b/tests/src/ut_loglistview.cpp index 2e5d6faa..c5410e51 100644 --- a/tests/src/ut_loglistview.cpp +++ b/tests/src/ut_loglistview.cpp @@ -23,9 +23,9 @@ #include #include -static QString stub_getSystemInfo() +static bool stub_isSEOpen() { - return "klu"; + return true; } QVariant stub_data(int arole) @@ -148,7 +148,7 @@ TEST(LogListView_initUI_UT, LogListView_initUI_UT_002) Stub stub; stub.set(ADDR(DLDBusHandler, readLog), stub_ListViewreadLog); stub.set(ADDR(DebugTimeManager, beginPointLinux), stubbeginPointLinux); - stub.set(ADDR(DBusManager, getSystemInfo), stub_getSystemInfo); + stub.set(ADDR(DBusManager, isSEOpen), stub_isSEOpen); stub.set(ADDR(Dtk::Core::DSysInfo, uosEditionType), stub_uosEulerEditionType); stub.set(ADDR(LogApplicationHelper, getCustomLogList), LogApplicationHelper_getCustomLogList); LogListView *p = new LogListView(nullptr); diff --git a/tests/ut_logviewerplugin/ut_logViewerPlugin.cpp b/tests/ut_logviewerplugin/ut_logViewerPlugin.cpp index 1aed5307..c59a516d 100644 --- a/tests/ut_logviewerplugin/ut_logViewerPlugin.cpp +++ b/tests/ut_logviewerplugin/ut_logViewerPlugin.cpp @@ -42,7 +42,7 @@ TEST_F(LogViewerPlugin_UT, generateAppFile_UT001) stub.set(ADDR(QThread, start), QThread_start); LogViewerPlugin *p = new LogViewerPlugin; - p->generateAppFile(QDir::homePath() + "/.cache/deepin/deepin-log-viewer/deepin-log-viewer.log", ALL, INF, ""); + p->generateAppFile(Utils::homePath + "/.cache/deepin/deepin-log-viewer/deepin-log-viewer.log", ALL, INF, ""); connect(p, &LogViewerPlugin::sigAppData, this, [=](int index, QList iList) { qDebug() << "index:" << index << endl; qDebug() << "appDatas:" << endl; diff --git a/translations/deepin-log-viewer.ts b/translations/deepin-log-viewer.ts index a46c72ef..da4ceab4 100644 --- a/translations/deepin-log-viewer.ts +++ b/translations/deepin-log-viewer.ts @@ -1,4 +1,6 @@ - + + + Action @@ -52,10 +54,6 @@ 3 months 3 months - - Export - Export - Export button @@ -120,12 +118,40 @@ Trace Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) - TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + @@ -149,6 +175,10 @@ Export failed Export failed + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +197,6 @@ Level: Level: - - Application list: - Application list: - Status: Status: @@ -207,6 +233,18 @@ Login record Login record + + Audit Type: + Audit Type: + + + Application: + Application: + + + Submodule: + Submodule: + Level @@ -362,6 +400,26 @@ Time Modified Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +474,21 @@ Custom Log Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +496,90 @@ You do not have permission to view it You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,13 +607,9 @@ Export All Export All - - System Logs - System Logs - Refresh Now Refresh Now - \ No newline at end of file + diff --git a/translations/deepin-log-viewer_ady.ts b/translations/deepin-log-viewer_ady.ts new file mode 100644 index 00000000..8aacd9b1 --- /dev/null +++ b/translations/deepin-log-viewer_ady.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_af.ts b/translations/deepin-log-viewer_af.ts new file mode 100644 index 00000000..0553ddbb --- /dev/null +++ b/translations/deepin-log-viewer_af.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ak.ts b/translations/deepin-log-viewer_ak.ts new file mode 100644 index 00000000..2e754be6 --- /dev/null +++ b/translations/deepin-log-viewer_ak.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_am_ET.ts b/translations/deepin-log-viewer_am_ET.ts new file mode 100644 index 00000000..27e51f4f --- /dev/null +++ b/translations/deepin-log-viewer_am_ET.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ar.ts b/translations/deepin-log-viewer_ar.ts index c1424055..f03a9b2d 100644 --- a/translations/deepin-log-viewer_ar.ts +++ b/translations/deepin-log-viewer_ar.ts @@ -52,10 +52,6 @@ 3 months 3 أشهر - - Export - تصدير - Export button @@ -120,9 +116,37 @@ Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: - - Application list: - لائحة البرنامج : - Status: الحالة: @@ -207,6 +231,18 @@ Login record سجل تسجيل الدخول + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -354,6 +390,34 @@ PID: رقم تعريف العملية PID: + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -400,5 +464,150 @@ dnf Log + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ast.ts b/translations/deepin-log-viewer_ast.ts new file mode 100644 index 00000000..1965b603 --- /dev/null +++ b/translations/deepin-log-viewer_ast.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_az.ts b/translations/deepin-log-viewer_az.ts index fcccbe04..fe165e84 100644 --- a/translations/deepin-log-viewer_az.ts +++ b/translations/deepin-log-viewer_az.ts @@ -52,10 +52,6 @@ 3 months 3 ay - - Export - İxrac - Export button @@ -120,9 +116,37 @@ Trace İz + + Identity authentication + Kimlik doğrulaması + + + Discretionary Access Control + Girişə ixtiyari nəzarət + + + Mandatory access control + Girişə mütləq nəzarət + + + Remote + Uzaqdan idarəetmə + + + Document audit + Sənədin təftişi + + + Other + Digər + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) MƏTN (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed İxrac baş tutmadı + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Səviyyə: - - Application list: - Tətbiq siyahısı: - Status: Vəziyyət: @@ -207,6 +231,18 @@ Login record Girişin yazılması + + Audit Type: + Təftişin növü + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Fayl adı Time Modified + Dəyişdirilmə vaxtı + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Başqa jurnal Custom Log + Fərdi jurnal + + + Audit Log + Təftiş jurnalı + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,6 +492,90 @@ Warning You do not have permission to view it + Buna baxmaq üçün icazəniz yoxdur + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -440,7 +595,7 @@ 5 min - + 5 dəq No refresh @@ -450,10 +605,6 @@ Export All Hamısını ixrac edin - - System Logs - Sistem jurnalları - Refresh Now İndi yeniləyin diff --git a/translations/deepin-log-viewer_bg.ts b/translations/deepin-log-viewer_bg.ts new file mode 100644 index 00000000..11dea176 --- /dev/null +++ b/translations/deepin-log-viewer_bg.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_bn.ts b/translations/deepin-log-viewer_bn.ts new file mode 100644 index 00000000..47865a1f --- /dev/null +++ b/translations/deepin-log-viewer_bn.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_bo.ts b/translations/deepin-log-viewer_bo.ts index 0582c03a..bdbda1dd 100644 --- a/translations/deepin-log-viewer_bo.ts +++ b/translations/deepin-log-viewer_bo.ts @@ -52,10 +52,6 @@ 3 months ཉེ་བའི་ཟླ་3 - - Export - ཕྱིར་འདྲེན། - Export button @@ -120,9 +116,37 @@ Trace རྗེས་སྙེག + + Identity authentication + ཐོབ་ཐང་དབྱེ་འབྱེད། + + + Discretionary Access Control + རང་བདག་ལྟ་སྤྱོད་ཚོད་འཛིན། + + + Mandatory access control + བཙན་ཤེད་ཀྱིས་ལྟ་སྤྱོད་ཚོད་འཛིན་བྱེད་པ། + + + Remote + རྒྱང་སྦྲེལ། + + + Document audit + ཡིག་ཆ་རྩིས་བཤེར། + + + Other + གཞན། + DisplayContent + + zip(*.zip) + zip(*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed འདོན་མི་ཐུབ། + + The export directory is not available. Please choose another directory for the export operation. + ཕྱིར་དྲངས་པའི་དཀར་ཆག་སྤྱོད་མི་རུང་། དཀར་ཆག་གཞན་བདམས་ནས་བཀོལ་སྤྱོད་བྱེད་རོགས། + File @@ -167,10 +195,6 @@ Level: རིམ་པ། - - Application list: - ཉེར་སྤྱོད་རེའུ་མིག - Status: ངང་ཚུལ། @@ -207,6 +231,18 @@ Login record ཐོ་འཇུག་ཆ་འཕྲིན། + + Audit Type: + རྩིས་བཤེར་རིགས། + + + Application: + ཉེར་སྤྱོད། + + + Submodule: + བུ་ཆའི་མ་དཔེ། + Level @@ -356,11 +392,31 @@ File Name - + ཡིག་ཆའི་མིང་། Time Modified - + བཟོ་བཅོས་དུས་ཚོད། + + + SIG + ཐོར་བའི་བརྡ་རྟགས། + + + EXE + འཕེལ་རིམ། + + + Core File + ལྟེ་བའི་ཡིག་ཆ། + + + User Name + སྤྱོད་མཁན། + + + Offset + འཕེལ་རིམ། @@ -410,53 +466,148 @@ Other Log - + ཉིན་ཐོ་གཞན། Custom Log - + རང་སྒྲུབ་ཉིན་ཐོ། + + + Audit Log + རྩིས་བཤེར་ཉིན་ཐོ། + + + Coredump Log + ཐོར་བའི་ཉིན་ཐོ། + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + ཐོར་བའི་ཆ་འཕྲིན་རག་ཐབས་བྲལ། systemd-coredumpསྒྲིག་འཇུག་བྱེད་རོགས། Warning You do not have permission to view it - + ལྟ་དབང་མེད། + + + Security level for the current system: high + audit only administrators can view the audit log + མིག་སྔའི་རྒྱུད་ཁོངས་ཀྱི་བདེ་འཇགས་རིམ་པ་ནི་མཐོ་བ་ཞེས་པ་ཡིན་པས། རྩིས་བཤེར་དོ་དམ་པ་ཁོ་ནས་རྩིས་བཤེར་ཉིན་ཐོ་ལ་བལྟས་ཆོག + + + + main + + Export logs to the specified path + ཉིན་ཐོ་དག་དམིགས་བཙུགས་བྱས་པའི་དཀར་ཆག་ནང་འདྲེན་པ། + + + PATH + འདྲེན་ལམ། + + + Export logs of specified types + ཉིན་ཐོའི་རིགས་ལྟར་ཉིན་ཐོ་འདྲེན་པ། + + + TYPE + ཉིན་ཐོའི་རིགས། + + + Export logs of specified self-developed applications + རང་ངོས་ཀྱིས་ཞིབ་འཇུག་བྱས་པའི་ཉེར་སྤྱོད་ལྟར་ཉིན་ཐོ་འདྲེན་པ། + + + SELF APPNAME + རང་ངོས་ཀྱིས་ཞིབ་འཇུག་བྱས་པའི་མིང་། + + + Export logs within a specified time period + དུས་ཚོད་ཀྱི་རིམ་པ་ལྟར་ཉིན་ཐོ་འདྲེན་པ། + + + PERIOD + དུས་འཁོར། + + + Export logs within a specified debug level + སྒྲིག་སྦྱོར་རིམ་པ་ལྟར་ཉིན་ཐོ་འདྲེན་པ། + + + LEVEL + སྒྲིག་སྦྱོར་རིམ་པ། + + + BOOT STATUS + འགོ་སློང་རྣམ་པ། + + + Export boot(no-klu) logs within a specified status + རྣམ་པ་ལྟར་ཉིན་ཐོ་འགོ་སློང་བ།(klu) + + + Export boot-shutdown-event or audit logs within a specified event type + གནས་ཚུལ་གྱི་རིགས་གཞིར་བཟུང་གནས་ཚུལ་ལམ་རྩིས་བཤེར་ཉིན་ཐོ་འདྲེན་པ། + + + EVENT TYPE + གནས་ཚུལ་གྱི་རིགས། + + + Export logs based on keywords search results + བརྡ་ཆད་གཙོ་བོ་གཞིར་བཟུང་ཉིན་ཐོ་འདྲེན་པ། + + + KEY WORD + བརྡ་ཆད་གཙོ་བོ། + + + Report coredump informations. + ཐོར་སའི་ཆ་འཕྲིན་གོང་ཞུ། + + + Export logs based on app submodel + བུ་ཆའི་དཔེ་རྣམ་ལྟར་ཉེར་སྤྱོད་ཉིན་ཐོ་འདྲེན་པ། + + + SUBMODULE + བུ་ཆའི་དཔེ་རྣམ། titlebar Refresh interval - + གསར་སྒྱུར་ཕྱོད། 10 sec - + སྐར་ཆ་10རེ། 1 min - + སྐར་མ་1རེ། 5 min - + སྐར་མ་5 No refresh - + གསར་སྒྱུར་མི་བྱེད། Export All - - - - System Logs - + ཚང་མ་འདོན་པ། Refresh Now - + ལམ་སེང་གསར་སྒྱུར། \ No newline at end of file diff --git a/translations/deepin-log-viewer_bqi.ts b/translations/deepin-log-viewer_bqi.ts new file mode 100644 index 00000000..70591edb --- /dev/null +++ b/translations/deepin-log-viewer_bqi.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_br.ts b/translations/deepin-log-viewer_br.ts index ac5bea31..0d9320d3 100644 --- a/translations/deepin-log-viewer_br.ts +++ b/translations/deepin-log-viewer_br.ts @@ -52,10 +52,6 @@ 3 months 3 miz - - Export - Ezporzhiañ - Export button @@ -120,9 +116,37 @@ Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TESTENN (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: - - Application list: - Listenn an arloadoù: - Status: Statud: @@ -207,6 +231,18 @@ Login record Enrolladur ar c'hevreañ + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -354,6 +390,34 @@ PID: PID: + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -400,5 +464,150 @@ dnf Log + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ca.ts b/translations/deepin-log-viewer_ca.ts index 25bd9bdb..50e30656 100644 --- a/translations/deepin-log-viewer_ca.ts +++ b/translations/deepin-log-viewer_ca.ts @@ -52,10 +52,6 @@ 3 months 3 mesos - - Export - Exporta - Export button @@ -120,9 +116,37 @@ Trace Traça + + Identity authentication + Autenticació de la identiitat + + + Discretionary Access Control + Control d'accés discrecional + + + Mandatory access control + Control d'accés obligatori + + + Remote + Remot + + + Document audit + Auditoria de documents + + + Other + Altres + DisplayContent + + zip(*.zip) + zip (*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Ha fallat l'exportació. + + The export directory is not available. Please choose another directory for the export operation. + El directori d'exportació no està disponible. Si us plau, trieu un altre directori per a l'operació d'exportació. + File @@ -167,10 +195,6 @@ Level: Nivell: - - Application list: - Llista d'aplicacions: - Status: Estat: @@ -207,6 +231,18 @@ Login record Historial d'entrada + + Audit Type: + Tipus d'auditoria: + + + Application: + Aplicació: + + + Submodule: + Submòdul: + Level @@ -356,11 +392,31 @@ File Name - + Nom del fitxer Time Modified - + Hora de modificació + + + SIG + SIG + + + EXE + EXE + + + Core File + Fitxer de nucli + + + User Name + Nom d'usuari + + + Offset + Forani @@ -410,18 +466,118 @@ Other Log - + Altres registres Custom Log - + Registre personalitzat + + + Audit Log + Registre d'auditoria + + + Coredump Log + Registre d'abocament del nucli + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + No es pot obtenir la informació de l'error. Instal·leu systemd-coredump. Warning You do not have permission to view it - + No teniu permís per veure-ho. + + + Security level for the current system: high + audit only administrators can view the audit log + Nivell de seguretat del sistema actual: alt +Només els administradors poden veure el registre d'auditoria. + + + + main + + Export logs to the specified path + Exporta els registres al camí especificat + + + PATH + CAMÍ + + + Export logs of specified types + Exporta registres dels tipus especificats + + + TYPE + TIPUS + + + Export logs of specified self-developed applications + Exporta els registres d'aplicacions de desenvolupament propi especificades + + + SELF APPNAME + NOM DE L'APLICACIÓ PRÒPIA + + + Export logs within a specified time period + Exporta els registres d'un període de temps especificat + + + PERIOD + PERÍODE + + + Export logs within a specified debug level + Exporta els registres dins d'un nivell de depuració especificat. + + + LEVEL + NIVELL + + + BOOT STATUS + ESTAT D'ARRENCADA + + + Export boot(no-klu) logs within a specified status + Exporta els registres d'arrencada (no-klu) d'un estat especificat + + + Export boot-shutdown-event or audit logs within a specified event type + Exporta registres d'esdeveniments d'apagada, d'arrencada o d'auditoria d'un tipus d'esdeveniment especificat + + + EVENT TYPE + TIPUS D'ESDEVENIMENT + + + Export logs based on keywords search results + Exporta els registres basats en els resultats de la cerca de paraules clau + + + KEY WORD + PARAULA CLAU + + + Report coredump informations. + Comunica la informació d'abocament. + + + Export logs based on app submodel + Exporta registres basats en el submodel d'aplicació + + + SUBMODULE + SUBMÒDUL @@ -440,7 +596,7 @@ 5 min - + 5 min No refresh @@ -450,10 +606,6 @@ Export All Exporta-ho tot - - System Logs - Registres del sistema - Refresh Now Refresca-ho ara diff --git a/translations/deepin-log-viewer_cs.ts b/translations/deepin-log-viewer_cs.ts index 24f82453..ed01356c 100644 --- a/translations/deepin-log-viewer_cs.ts +++ b/translations/deepin-log-viewer_cs.ts @@ -52,10 +52,6 @@ 3 months 3 měsíce - - Export - Export - Export button @@ -120,9 +116,37 @@ Trace Trace + + Identity authentication + Ověření identity + + + Discretionary Access Control + Rozvahové/posudkové řízení přístupu + + + Mandatory access control + Mandatorní řízení přístupu + + + Remote + Vzdálené + + + Document audit + Audit dokumentu + + + Other + Ostatní + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; XLS (*.xls);; HTML (*.html) @@ -149,6 +173,10 @@ Export failed Export se nezdařil + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Úroveň podrobností: - - Application list: - Seznam aplikací: - Status: Stav: @@ -207,6 +231,18 @@ Login record Záznam událostí z přihlašování + + Audit Type: + Typ auditu: + + + Application: + + + + Submodule: + + Level @@ -236,7 +272,7 @@ Critical - Kritický + Kritická Notice @@ -356,10 +392,30 @@ File Name - + Název souboru Time Modified + Okamžik změny + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Jiný záznam Custom Log + Uživatelsky určený záznam událostí + + + Audit Log + Auditní log + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,42 +492,122 @@ Warning You do not have permission to view it + Nemáte oprávnění k zobrazení + + + Security level for the current system: high + audit only administrators can view the audit log - titlebar + main - Refresh interval + Export logs to the specified path - 10 sec + PATH - 1 min + Export logs of specified types - 5 min + TYPE - No refresh + Export logs of specified self-developed applications - Export All + SELF APPNAME - System Logs + Export logs within a specified time period - Refresh Now + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + Interval opakovaného načítání + + + 10 sec + 10 sekund + + + 1 min + 1 minuta + + + 5 min + 5 minut + + + No refresh + Nedonačítat + + + Export All + Exportovat vše + + + Refresh Now + Načíst znovu nyní + \ No newline at end of file diff --git a/translations/deepin-log-viewer_da.ts b/translations/deepin-log-viewer_da.ts index e8e360b1..fffe32ab 100644 --- a/translations/deepin-log-viewer_da.ts +++ b/translations/deepin-log-viewer_da.ts @@ -52,10 +52,6 @@ 3 months 3 måneder - - Export - Eksportér - Export button @@ -120,9 +116,37 @@ Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEKST (*.txt);; Dokument (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Niveau: - - Application list: - Programliste: - Status: Status: @@ -207,6 +231,18 @@ Login record Registrering af indlogning + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -354,6 +390,34 @@ PID: PID: + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -400,5 +464,150 @@ dnf Log + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_de.ts b/translations/deepin-log-viewer_de.ts index 90d9eaf2..7e7cfebf 100644 --- a/translations/deepin-log-viewer_de.ts +++ b/translations/deepin-log-viewer_de.ts @@ -52,10 +52,6 @@ 3 months 3 Monate - - Export - Exportieren - Export button @@ -120,9 +116,37 @@ Trace Ablaufverfolgung + + Identity authentication + Identitätsauthentifizierung + + + Discretionary Access Control + Benutzerbestimmbare Zugriffskontrolle + + + Mandatory access control + Obligatorische Zugangskontrolle + + + Remote + Fernzugriff + + + Document audit + + + + Other + Andere + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) Text (*.txt);; doc (*.doc);; xls (*.xls);; html (*.html) @@ -149,6 +173,10 @@ Export failed Exportieren fehlgeschlagen + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Stufe: - - Application list: - Anwendungsliste: - Status: Status: @@ -207,6 +231,18 @@ Login record Anmelden-Eintrag + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Dateiname Time Modified + Änderungszeit + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Anderes Protokoll Custom Log + Benutzerdefiniertes Protokoll + + + Audit Log + Audit-Protokoll + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -440,7 +595,7 @@ 5 min - + 5 Min. No refresh @@ -450,10 +605,6 @@ Export All Alles exportieren - - System Logs - Systemprotokolle - Refresh Now Jetzt auffrischen diff --git a/translations/deepin-log-viewer_el.ts b/translations/deepin-log-viewer_el.ts new file mode 100644 index 00000000..03b72a67 --- /dev/null +++ b/translations/deepin-log-viewer_el.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + Προβολή στον διαχειριστή αρχείων + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_en_AU.ts b/translations/deepin-log-viewer_en_AU.ts new file mode 100644 index 00000000..3b4791b6 --- /dev/null +++ b/translations/deepin-log-viewer_en_AU.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_en_CA.ts b/translations/deepin-log-viewer_en_CA.ts new file mode 100644 index 00000000..9559fbbe --- /dev/null +++ b/translations/deepin-log-viewer_en_CA.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_en_GB.ts b/translations/deepin-log-viewer_en_GB.ts new file mode 100644 index 00000000..18b4eeed --- /dev/null +++ b/translations/deepin-log-viewer_en_GB.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + Display in file manager + + + Clear log + Clear log + + + Refresh + Refresh + + + Are you sure you want to clear the log? + Are you sure you want to clear the log? + + + Cancel + Cancel + + + Confirm + Confirm + + + + Button + + All + All + + + Today + Today + + + 3 days + 3 days + + + 1 week + 1 week + + + 1 month + 1 month + + + 3 months + 3 months + + + Export + button + Export + + + + ComboBox + + All + All + + + Emergency + Emergency + + + Alert + Alert + + + Critical + Critical + + + Error + Error + + + Warning + Warning + + + Notice + Notice + + + Info + Info + + + Debug + Debug + + + Login + Login + + + Boot + Boot + + + Shutdown + Shutdown + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + ExportDlg + + Exporting... + + + + Cancel + Cancel + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + Export File + + + + Label + + Period: + Period: + + + Level: + + + + Status: + Status: + + + Event Type: + Event Type: + + + User: + User: + + + PID: + PID: + + + Action: + Action: + + + Username: + Username: + + + Boot record + Boot record + + + Shutdown record + Shutdown record + + + Login record + Login record + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + Warning + + + Debug + Debug + + + Info + Info + + + Error + Error + + + Emergency + Emergency + + + Alert + Alert + + + Critical + Critical + + + Notice + Notice + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + Log Viewer + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + Info + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + User: + + + PID: + PID: + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_eo.ts b/translations/deepin-log-viewer_eo.ts new file mode 100644 index 00000000..653054b9 --- /dev/null +++ b/translations/deepin-log-viewer_eo.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_es.ts b/translations/deepin-log-viewer_es.ts index 099ae1cd..6ef9feda 100644 --- a/translations/deepin-log-viewer_es.ts +++ b/translations/deepin-log-viewer_es.ts @@ -52,10 +52,6 @@ 3 months 3 meses - - Export - Exportar - Export button @@ -120,9 +116,37 @@ Trace Rastro + + Identity authentication + Autenticación de identidad + + + Discretionary Access Control + Control de acceso discrecional + + + Mandatory access control + Control de acceso obligatorio + + + Remote + Remoto + + + Document audit + Auditoría de documentos + + + Other + Otros + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXTO (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Exportar fallós + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Nivel: - - Application list: - Lista de aplicaciones: - Status: Estado: @@ -207,6 +231,18 @@ Login record Registro de inicio de sesión + + Audit Type: + Tipo de auditoría: + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Nombre del archivo Time Modified + Hora de modificado + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Otro registro Custom Log + Registro personalizado + + + Audit Log + Registro de auditoría + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,6 +492,90 @@ Warning You do not have permission to view it + No tiene permiso para verlo + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -440,7 +595,7 @@ 5 min - + 5 min No refresh @@ -450,10 +605,6 @@ Export All Exportar todo - - System Logs - Registros del sistema - Refresh Now Actualizar ahora diff --git a/translations/deepin-log-viewer_et.ts b/translations/deepin-log-viewer_et.ts new file mode 100644 index 00000000..e747bf06 --- /dev/null +++ b/translations/deepin-log-viewer_et.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_fa.ts b/translations/deepin-log-viewer_fa.ts new file mode 100644 index 00000000..dd015f5a --- /dev/null +++ b/translations/deepin-log-viewer_fa.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_fi.ts b/translations/deepin-log-viewer_fi.ts index a0643278..dcc14c81 100644 --- a/translations/deepin-log-viewer_fi.ts +++ b/translations/deepin-log-viewer_fi.ts @@ -52,10 +52,6 @@ 3 months 3 kuukautta - - Export - Vie - Export button @@ -120,9 +116,37 @@ Trace Jäljitys + + Identity authentication + Henkilöllisyyden todennus + + + Discretionary Access Control + Harkittu pääsynhallinta + + + Mandatory access control + Pakollinen pääsynhallinta + + + Remote + Etäyhteys + + + Document audit + Asiakirjan tarkastus + + + Other + Muu + DisplayContent + + zip(*.zip) + zip(*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Vienti epäonnistui + + The export directory is not available. Please choose another directory for the export operation. + Vientihakemisto ei ole käytettävissä. Valitse toinen hakemisto toimintoa varten. + File @@ -167,10 +195,6 @@ Level: Taso: - - Application list: - Sovellusluettelo: - Status: Tila: @@ -207,6 +231,18 @@ Login record Kirjautumiset + + Audit Type: + Tarkastustyyppi: + + + Application: + Sovellukset: + + + Submodule: + Alamoduuli: + Level @@ -356,10 +392,30 @@ File Name - + Tiedostonimi Time Modified + Muutosaika + + + SIG + SIG + + + EXE + EXE + + + Core File + Core-tiedosto + + + User Name + Käyttäjänimi + + + Offset @@ -410,18 +466,118 @@ Other Log - + Muu loki Custom Log - + Mukautettu loki + + + Audit Log + Tarkastuslogi: + + + Coredump Log + Coredump loki + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + Kaatumistietoja ei voi saada, asenna systemd-coredump. Warning You do not have permission to view it - + Sinulla ei ole lupaa tarkastella sitä + + + Security level for the current system: high + audit only administrators can view the audit log + Järjestelmän suojaustaso: korkea +Vain järjestelmänvalvojat voivat katsoa valvontalokia + + + + main + + Export logs to the specified path + Vie lokit määriteltyyn polkuun + + + PATH + POLKU + + + Export logs of specified types + Vie tietyntyyppiset lokit + + + TYPE + TYYPPI + + + Export logs of specified self-developed applications + Vie itse kehitettyjen sovellusten lokit + + + SELF APPNAME + OMA SOVELLUS + + + Export logs within a specified time period + Vie lokit tietyn ajan kuluessa + + + PERIOD + AJANJAKSO + + + Export logs within a specified debug level + Vie lokit virheenkorjaustasolla + + + LEVEL + TASO + + + BOOT STATUS + KÄYNNISTYSTILA + + + Export boot(no-klu) logs within a specified status + Vie boot(no-klu) -lokit määritetyssä tilassa + + + Export boot-shutdown-event or audit logs within a specified event type + Vie boot-shutdown-event tai valvontalokit tietyn tapahtumatyypin sisällä + + + EVENT TYPE + TAPAHTUMATYYPPI + + + Export logs based on keywords search results + Vie lokit hakutulosten perusteella + + + KEY WORD + HAKUSANA + + + Report coredump informations. + Ilmoita perustiedot. + + + Export logs based on app submodel + Vie lokit sovelluksen alamoduulin perusteella + + + SUBMODULE + ALAMODUULI @@ -440,7 +596,7 @@ 5 min - + 5 min No refresh @@ -450,10 +606,6 @@ Export All Vie kaikki - - System Logs - Järjestelmälokit - Refresh Now Virkistä nyt diff --git a/translations/deepin-log-viewer_fil.ts b/translations/deepin-log-viewer_fil.ts new file mode 100644 index 00000000..787c82d3 --- /dev/null +++ b/translations/deepin-log-viewer_fil.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_fr.ts b/translations/deepin-log-viewer_fr.ts index 6d6a62d7..46f19e81 100644 --- a/translations/deepin-log-viewer_fr.ts +++ b/translations/deepin-log-viewer_fr.ts @@ -52,10 +52,6 @@ 3 months 3 mois - - Export - Exporter - Export button @@ -120,9 +116,37 @@ Trace Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (* .txt) ;; Doc (* .doc) ;; Xls (* .xls) ;; Html (* .html) @@ -149,6 +173,10 @@ Export failed Exportation échouée + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Niveau : - - Application list: - Liste des applications : - Status: Statut : @@ -207,6 +231,18 @@ Login record Journaux de connexion + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Nom de fichier Time Modified + Date de modification + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Autre journal Custom Log + Journal personnalisé + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,6 +492,90 @@ Warning You do not have permission to view it + Vous n'avez pas la permission de le consulter + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -432,7 +587,7 @@ 10 sec - 10 sec + 10 s 1 min @@ -440,7 +595,7 @@ 5 min - + 5 min No refresh @@ -450,10 +605,6 @@ Export All Tout exporter - - System Logs - Journaux système - Refresh Now Actualiser maintenant diff --git a/translations/deepin-log-viewer_gl_ES.ts b/translations/deepin-log-viewer_gl_ES.ts index 1a5825a6..eb8de5f9 100644 --- a/translations/deepin-log-viewer_gl_ES.ts +++ b/translations/deepin-log-viewer_gl_ES.ts @@ -52,10 +52,6 @@ 3 months 3 meses - - Export - Exportar - Export button @@ -120,9 +116,37 @@ Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXTO (* .txt) ;; Doc (* .doc) ;; Xls (* .xls) ;; Html (* .html) @@ -149,6 +173,10 @@ Export failed + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Nivel: - - Application list: - Lista de aplicativos: - Status: Estados: @@ -207,6 +231,18 @@ Login record Rexistro do inicio de sesión + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -362,6 +398,26 @@ Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +472,21 @@ Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,10 +605,6 @@ Export All - - System Logs - - Refresh Now diff --git a/translations/deepin-log-viewer_he.ts b/translations/deepin-log-viewer_he.ts new file mode 100644 index 00000000..b6d3f8bc --- /dev/null +++ b/translations/deepin-log-viewer_he.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_hi_IN.ts b/translations/deepin-log-viewer_hi_IN.ts index bb4dc214..d04e041c 100644 --- a/translations/deepin-log-viewer_hi_IN.ts +++ b/translations/deepin-log-viewer_hi_IN.ts @@ -52,10 +52,6 @@ 3 months 3 माह पूर्व - - Export - निर्यात करें - Export button @@ -120,9 +116,37 @@ Trace ट्रेस + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed निर्यात विफल + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: स्तर : - - Application list: - अनुप्रयोग सूची : - Status: स्थिति : @@ -207,6 +231,18 @@ Login record लॉगिन रिकॉर्ड + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -362,6 +398,26 @@ Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +472,21 @@ Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,10 +605,6 @@ Export All - - System Logs - - Refresh Now diff --git a/translations/deepin-log-viewer_hr.ts b/translations/deepin-log-viewer_hr.ts index ea43edd2..196cfa1a 100644 --- a/translations/deepin-log-viewer_hr.ts +++ b/translations/deepin-log-viewer_hr.ts @@ -1,35 +1,27 @@ - - - + Action - Display in file manager Prikaži u upravitelju datotekama - Clear log Očisti zapis - Refresh Osvježi - Are you sure you want to clear the log? Jeste li sigurni da želite očistiti zapis? - Cancel Otkaži - Confirm Potvrdi @@ -37,144 +29,125 @@ Button - - - All Sve - - - - Today Danas - - - - 3 days 3 dana - - - - 1 week 1 tjedan - - - - 1 month 1 mjesec - - - - 3 months 3 mjeseca - Export + button Izvezi ComboBox - - - - All Sve - Emergency - + - Alert - + - - Critical Kritično - - Error Greška - - Warning Upozorenje - Notice Bilješka - - - Info Informacije - - Debug - + + + + Login + Prijava + + + Boot + + + + Shutdown + Isključi - Super critical - + - Trace - + - - Login - Prijava + Identity authentication + - - Boot - + Discretionary Access Control + - - Shutdown - Isključi + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + DisplayContent - + zip(*.zip) + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEKST (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -182,12 +155,10 @@ ExportDlg - Exporting... Izvozim... - Cancel Otkaži @@ -195,15 +166,21 @@ ExportMessage - Export successful Izvoz uspješan + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + File - Export File Izvezi datoteku @@ -211,231 +188,108 @@ Label - - - Period: Period: - - Level: Razina: - - Application list: - Lista aplikacija: - - - - Status: Status: - - Event Type: Vrsta događaja: - User: Korisnik: - PID: PID: - Action: Radnja: - Username: Korisničko ime: - Boot record - + - Shutdown record - + - Login record - + + + + Audit Type: + + + + Application: + + + + Submodule: + Level - - - - - - - - - - - - - - - Warning Upozorenje - - - - - - - - - - - - - - - - - Debug - - - - - - - - - - - - - - - - - - + + + Info Informacije - - - - - - - - - - - - - - - Error Greška - - - - - - - - - - - Emergency - - - - - - - - - - - - - - + + + Alert - - - - - - - - - - - - - - - - + + + Critical Kritično - - - - - - - - - - - Notice Bilješka - - Trace - + - - Super critical - + LogAuthThread - - Log file is empty Datoteka zapisa je prazna @@ -443,13 +297,10 @@ Main - - Log Viewer Preglednik zapisa - Log Viewer is a useful tool for viewing system logs. Preglednik zapisa je koristan alat za pregled zapisa sustava. @@ -457,12 +308,10 @@ SearchBar - No search results Nema rezultata pretrage - Search Traži @@ -470,165 +319,109 @@ Table - - - - - - - - - - - - Level Razina - - - - - - - Process Proces - - - - - - - - - - - - - - - - Date and Time Datum i vrijeme - - - - - - - - - - - - - - - - - - - Info Informacije - - - - - - - User Korisnik - - - - - PID PID - - - - - Source Izvor - Action Radnja - Status Status - Event Type Vrsta događaja - Username Korisničko ime - Level: Razina: - Process: Proces: - Date and Time: Datum i vrijeme: - - Info: Informacije: - Null - + - User: Korisnik: - PID: PID: + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble - Date and Time Datum i vrijeme @@ -636,62 +429,185 @@ Tree - - System Log Zapis sustava - - - - Kernel Log Zapis kernela - - - - Boot Log - + - - - dnf Log - - - - - dpkg Log dpkg zapis - - Kwin Log Kwin zapis - - Xorg Log Xorg zapis - - Application Log Zapis aplikacije - - Boot-Shutdown Event - + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + Interval osvježavanja + + + 10 sec + + + + 1 min + 1 min + + + 5 min + 5 min + + + No refresh + Bez osvježavanja + + + Export All + Izvezi sve + + + Refresh Now + Osvježi sada - + \ No newline at end of file diff --git a/translations/deepin-log-viewer_hu.ts b/translations/deepin-log-viewer_hu.ts index b3705aaa..77f6a284 100644 --- a/translations/deepin-log-viewer_hu.ts +++ b/translations/deepin-log-viewer_hu.ts @@ -52,10 +52,6 @@ 3 months 3 hónapja - - Export - Exportálás - Export button @@ -120,9 +116,37 @@ Trace Útvonal + + Identity authentication + Azonosság hitelesítése + + + Discretionary Access Control + Diszkrecionális Hozzáférés Vezérlés + + + Mandatory access control + Kötelező Hozzáférés Vezérlés + + + Remote + Távoli + + + Document audit + Dokumentum audit + + + Other + Egyéb + DisplayContent + + zip(*.zip) + zip(*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Az exportálás sikertelen + + The export directory is not available. Please choose another directory for the export operation. + A export könyvtár nem elérhető. Kérjük válasszon másik könyvtárat az export művelethez. + File @@ -167,10 +195,6 @@ Level: Szint: - - Application list: - Alkalmazás lista: - Status: Állapot: @@ -207,6 +231,18 @@ Login record Bejelentkezési rekord + + Audit Type: + Audit típusa: + + + Application: + Alkalmazás: + + + Submodule: + Almodul: + Level @@ -356,11 +392,31 @@ File Name - + Fájl név Time Modified - + Módosítási idő + + + SIG + SIG + + + EXE + EXE + + + Core File + Törzs fájl + + + User Name + Felhasználónév + + + Offset + Eltolás @@ -410,18 +466,118 @@ Other Log - + Egyéb napló Custom Log - + Egyedi napló + + + Audit Log + Audit napló + + + Coredump Log + Coredump Napló + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + Nem sikerült megszerezni az összeomlási információkat, kérjük telepítse a systemd-coredump-ot. Warning You do not have permission to view it - + Önnek nincs engedélye, hogy megtekintse ezt + + + Security level for the current system: high + audit only administrators can view the audit log + A jelenlegi rendszer biztonsági szintje: magas +csak a Rendszergazdák tekinthetik meg az ellenőrzési naplót + + + + main + + Export logs to the specified path + Naplókat exportálása egy megadott útvonalra. + + + PATH + ÚTVONAL + + + Export logs of specified types + Meghatározott típusú naplók exportálása + + + TYPE + TÍPUS + + + Export logs of specified self-developed applications + Specifikus, saját fejlesztésű alkalmazások naplóinak exportálása + + + SELF APPNAME + SAJÁT ALKALMAZÁSNÉV + + + Export logs within a specified time period + Meghatározott időszakban történő naplók exportálása + + + PERIOD + IDŐSZAK + + + Export logs within a specified debug level + Meghatározott hibakeresési szinten belüli naplók exportálása + + + LEVEL + SZINT + + + BOOT STATUS + RENDSZERINDÍTÁSI STÁTUSZ + + + Export boot(no-klu) logs within a specified status + Exportálja a boot(no-klu) naplókat egy megadott állapoton belül + + + Export boot-shutdown-event or audit logs within a specified event type + Exportálhatja a rendszerindítási leállítási esemény vagy az ellenőrzési naplókat egy megadott eseménytípuson belül + + + EVENT TYPE + ESEMÉNY TÍPUS + + + Export logs based on keywords search results + Naplók exportálása a kulcsszavak keresési eredményei alapján + + + KEY WORD + KULCSSZÓ + + + Report coredump informations. + Alapinformációk jelentése + + + Export logs based on app submodel + Az alkalmazás almodulon alapuló naplók exportálása + + + SUBMODULE + ALMODUL @@ -440,7 +596,7 @@ 5 min - + 5 perc No refresh @@ -450,10 +606,6 @@ Export All Összes exportálása - - System Logs - Rendszer naplók - Refresh Now Frissítés most diff --git a/translations/deepin-log-viewer_hy.ts b/translations/deepin-log-viewer_hy.ts new file mode 100644 index 00000000..3b1e281c --- /dev/null +++ b/translations/deepin-log-viewer_hy.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ia.ts b/translations/deepin-log-viewer_ia.ts new file mode 100644 index 00000000..17ca7055 --- /dev/null +++ b/translations/deepin-log-viewer_ia.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_id.ts b/translations/deepin-log-viewer_id.ts new file mode 100644 index 00000000..b8719060 --- /dev/null +++ b/translations/deepin-log-viewer_id.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_it.ts b/translations/deepin-log-viewer_it.ts index afcc1a79..b0051ca0 100644 --- a/translations/deepin-log-viewer_it.ts +++ b/translations/deepin-log-viewer_it.ts @@ -52,10 +52,6 @@ 3 months 3 mesi - - Export - Esporta - Export button @@ -120,9 +116,37 @@ Trace Traccia + + Identity authentication + Autenticazione identità utente + + + Discretionary Access Control + Controllo accesso discrezionale + + + Mandatory access control + Controllo accesso obbligatorio + + + Remote + Remoto + + + Document audit + Verifica documento + + + Other + Altro + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Esportazione fallita + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Livello: - - Application list: - Lista App: - Status: Stato: @@ -207,6 +231,18 @@ Login record Registrazione login + + Audit Type: + Tipo verifica: + + + Application: + + + + Submodule: + + Level @@ -357,10 +393,30 @@ Localizzazione italiana a cura di Massimo A. Carofano. File Name - + Nome file Time Modified + Data modifica + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -411,10 +467,25 @@ Localizzazione italiana a cura di Massimo A. Carofano. Other Log - + Altri log Custom Log + Log personalizzato + + + Audit Log + Log di verifica + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -422,6 +493,90 @@ Localizzazione italiana a cura di Massimo A. Carofano. Warning You do not have permission to view it + Non hai il permesso per visualizzarlo + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -441,7 +596,7 @@ Localizzazione italiana a cura di Massimo A. Carofano. 5 min - + 5 min No refresh @@ -451,10 +606,6 @@ Localizzazione italiana a cura di Massimo A. Carofano. Export All Esporta tutto - - System Logs - Log di Sistema - Refresh Now Aggiorna ora diff --git a/translations/deepin-log-viewer_ja.ts b/translations/deepin-log-viewer_ja.ts new file mode 100644 index 00000000..bad831bf --- /dev/null +++ b/translations/deepin-log-viewer_ja.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ka.ts b/translations/deepin-log-viewer_ka.ts new file mode 100644 index 00000000..6cc0bd94 --- /dev/null +++ b/translations/deepin-log-viewer_ka.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_km_KH.ts b/translations/deepin-log-viewer_km_KH.ts new file mode 100644 index 00000000..06b3f033 --- /dev/null +++ b/translations/deepin-log-viewer_km_KH.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_kn_IN.ts b/translations/deepin-log-viewer_kn_IN.ts new file mode 100644 index 00000000..9d0b1e64 --- /dev/null +++ b/translations/deepin-log-viewer_kn_IN.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ko.ts b/translations/deepin-log-viewer_ko.ts index 57639ac6..bca71c66 100644 --- a/translations/deepin-log-viewer_ko.ts +++ b/translations/deepin-log-viewer_ko.ts @@ -52,10 +52,6 @@ 3 months 3달 - - Export - 내보내기 - Export button @@ -120,9 +116,37 @@ Trace + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: 레벨: - - Application list: - 응용프로그램 목록: - Status: 상태: @@ -207,6 +231,18 @@ Login record 로그인 기록 + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -362,6 +398,26 @@ Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +472,21 @@ Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,10 +605,6 @@ Export All - - System Logs - - Refresh Now diff --git a/translations/deepin-log-viewer_ku.ts b/translations/deepin-log-viewer_ku.ts new file mode 100644 index 00000000..88d5dac7 --- /dev/null +++ b/translations/deepin-log-viewer_ku.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ku_IQ.ts b/translations/deepin-log-viewer_ku_IQ.ts new file mode 100644 index 00000000..aebc1863 --- /dev/null +++ b/translations/deepin-log-viewer_ku_IQ.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ky.ts b/translations/deepin-log-viewer_ky.ts new file mode 100644 index 00000000..86b7da3f --- /dev/null +++ b/translations/deepin-log-viewer_ky.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ky@Arab.ts b/translations/deepin-log-viewer_ky@Arab.ts new file mode 100644 index 00000000..736641f9 --- /dev/null +++ b/translations/deepin-log-viewer_ky@Arab.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_la.ts b/translations/deepin-log-viewer_la.ts new file mode 100644 index 00000000..27c065a6 --- /dev/null +++ b/translations/deepin-log-viewer_la.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_lo.ts b/translations/deepin-log-viewer_lo.ts new file mode 100644 index 00000000..3e89840d --- /dev/null +++ b/translations/deepin-log-viewer_lo.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_lt.ts b/translations/deepin-log-viewer_lt.ts new file mode 100644 index 00000000..1c6a1716 --- /dev/null +++ b/translations/deepin-log-viewer_lt.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + Eksportuoti + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + Klaida + + + Warning + Įspėjimas + + + Notice + Pranešimas + + + Info + Informacija + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + Eksportuoti failą + + + + Label + + Period: + + + + Level: + + + + Status: + Būsena: + + + Event Type: + + + + User: + Naudotojas: + + + PID: + PID: + + + Action: + Veiksmas: + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + Įspėjimas + + + Debug + + + + Info + Informacija + + + Error + Klaida + + + Emergency + + + + Alert + + + + Critical + + + + Notice + Pranešimas + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + Žurnalų žiūryklė + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + Data ir laikas + + + Info + Informacija + + + User + Naudotojas + + + PID + PID + + + Source + Šaltinis + + + Action + Veiksmas + + + Status + Būsena + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + Data ir laikas: + + + Info: + Informacija: + + + Null + + + + User: + Naudotojas: + + + PID: + PID: + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + Sistemos žurnalas + + + Kernel Log + Branduolio žurnalas + + + Boot Log + Paleidimo žurnalas + + + dpkg Log + dpkg žurnalas + + + Kwin Log + + + + Xorg Log + Xorg žurnalas + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_lv.ts b/translations/deepin-log-viewer_lv.ts new file mode 100644 index 00000000..a8761460 --- /dev/null +++ b/translations/deepin-log-viewer_lv.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ml.ts b/translations/deepin-log-viewer_ml.ts new file mode 100644 index 00000000..a7c679e7 --- /dev/null +++ b/translations/deepin-log-viewer_ml.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_mn.ts b/translations/deepin-log-viewer_mn.ts new file mode 100644 index 00000000..4aec9113 --- /dev/null +++ b/translations/deepin-log-viewer_mn.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_mr.ts b/translations/deepin-log-viewer_mr.ts new file mode 100644 index 00000000..2ca4ec77 --- /dev/null +++ b/translations/deepin-log-viewer_mr.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ms.ts b/translations/deepin-log-viewer_ms.ts index 9f0b0ebe..112bc6aa 100644 --- a/translations/deepin-log-viewer_ms.ts +++ b/translations/deepin-log-viewer_ms.ts @@ -52,10 +52,6 @@ 3 months 3 bulan - - Export - Eksport - Export button @@ -120,9 +116,37 @@ Trace Jejak + + Identity authentication + Kenal pasti pengesahihan + + + Discretionary Access Control + Kawalan Capaian Budi Bicara + + + Mandatory access control + Kawalan capaian mandatori + + + Remote + Jauh + + + Document audit + Audit dokumen + + + Other + Lain-lain + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEKS (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Eksport gagal + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Aras: - - Application list: - Senarai aplikasi: - Status: Status: @@ -207,6 +231,18 @@ Login record Rekod daftar masuk + + Audit Type: + Jenis Audit: + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Nama Fail Time Modified + Masa Diubah Suai + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Log Lain Custom Log + Log Suai + + + Audit Log + Log Audit + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,6 +492,90 @@ Warning You do not have permission to view it + Anda tiada keizinan untuk melihatnya + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -440,7 +595,7 @@ 5 min - + 5 min No refresh @@ -450,10 +605,6 @@ Export All Eksport semua - - System Logs - Log Sistem - Refresh Now Segar Semula Sekarang diff --git a/translations/deepin-log-viewer_nb.ts b/translations/deepin-log-viewer_nb.ts new file mode 100644 index 00000000..607cd23a --- /dev/null +++ b/translations/deepin-log-viewer_nb.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ne.ts b/translations/deepin-log-viewer_ne.ts new file mode 100644 index 00000000..f91bfb6c --- /dev/null +++ b/translations/deepin-log-viewer_ne.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + सबै + + + Today + आज + + + 3 days + 3 दिन + + + 1 week + 1 हप्ता + + + 1 month + 1 महिना + + + 3 months + 3 महिना + + + Export + button + निर्यात + + + + ComboBox + + All + + + + Emergency + आपतकालिन + + + Alert + चेतावनी + + + Critical + आलोचनात्मक + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_nl.ts b/translations/deepin-log-viewer_nl.ts index 3353e208..c5c33239 100644 --- a/translations/deepin-log-viewer_nl.ts +++ b/translations/deepin-log-viewer_nl.ts @@ -52,10 +52,6 @@ 3 months 3 maanden - - Export - Exporteren - Export button @@ -120,9 +116,37 @@ Trace Spoor + + Identity authentication + Identiteitsverificatie + + + Discretionary Access Control + Beperktetoegangscontrole + + + Mandatory access control + Verplichtetoegangscontrole + + + Remote + Op afstand + + + Document audit + Documentaudit + + + Other + Overig + DisplayContent + + zip(*.zip) + zip (*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) Platte tekst (*.txt);; DOC (*.doc);; XLS (*.xls);; HTML (*.html) @@ -149,6 +173,10 @@ Export failed Het exporteren is mislukt + + The export directory is not available. Please choose another directory for the export operation. + De exportmap is niet beschikbaar - kies een andere map. + File @@ -167,10 +195,6 @@ Level: Niveau: - - Application list: - Programmalijst: - Status: Status: @@ -207,6 +231,18 @@ Login record Inlogmoment + + Audit Type: + Soort audit: + + + Application: + Programma: + + + Submodule: + Submodule: + Level @@ -356,11 +392,31 @@ File Name - + Bestandsnaam Time Modified - + Tijdstip van wijziging + + + SIG + SIG + + + EXE + EXE + + + Core File + Core-bestand + + + User Name + Gebruikersnaam + + + Offset + Verschuiving @@ -410,18 +466,118 @@ Other Log - + Overig logboek Custom Log - + Aangepast logboek + + + Audit Log + Auditlogboek + + + Coredump Log + Coredump-logboek + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + Er kan geen crashinformatie worden verzameld - installeer systemd-coredump. Warning You do not have permission to view it - + Je bent niet bevoegd om het logboek te bekijken + + + Security level for the current system: high + audit only administrators can view the audit log + Beveiligingsniveau van huidig systeem: hoog + Alleen beheerders kunnen het logboek bekijken + + + + main + + Export logs to the specified path + Exporteer logboeken naar de opgegeven locatie + + + PATH + Locatie + + + Export logs of specified types + Exporteer bepaalde logboeken + + + TYPE + Soorten + + + Export logs of specified self-developed applications + Exporteer logboeken van bepaalde eigen programma's + + + SELF APPNAME + Eigen programma's + + + Export logs within a specified time period + Exporteer logboeken uit een bepaalde periode + + + PERIOD + Periode + + + Export logs within a specified debug level + Exporteer logboeken met een bepaald foutopsporingsniveau + + + LEVEL + Niveau + + + BOOT STATUS + Opstartstatus + + + Export boot(no-klu) logs within a specified status + Exporteer opstartlogboeken (no-klu) met een bepaalde status + + + Export boot-shutdown-event or audit logs within a specified event type + Exporteer logboeken met bepaalde gebeurtenissen + + + EVENT TYPE + Gebeurtenissen + + + Export logs based on keywords search results + Exporteer logboeken met bepaalde trefwoorden + + + KEY WORD + Trefwoorden + + + Report coredump informations. + Meld coredump-informatie. + + + Export logs based on app submodel + Exporteer logboeken van een bepaalde submodule + + + SUBMODULE + Submodule @@ -440,7 +596,7 @@ 5 min - + 5 min. No refresh @@ -450,10 +606,6 @@ Export All Alles exporteren - - System Logs - Systeemlogboeken - Refresh Now Nu herladen diff --git a/translations/deepin-log-viewer_pa.ts b/translations/deepin-log-viewer_pa.ts new file mode 100644 index 00000000..f3f7eff7 --- /dev/null +++ b/translations/deepin-log-viewer_pa.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_pam.ts b/translations/deepin-log-viewer_pam.ts new file mode 100644 index 00000000..93169431 --- /dev/null +++ b/translations/deepin-log-viewer_pam.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_pl.ts b/translations/deepin-log-viewer_pl.ts index eb4c604b..f8c60c3c 100644 --- a/translations/deepin-log-viewer_pl.ts +++ b/translations/deepin-log-viewer_pl.ts @@ -52,10 +52,6 @@ 3 months 3 miesiące - - Export - Eksportuj - Export button @@ -70,11 +66,11 @@ Emergency - Zapasowy + Awaria Alert - Alarm + Alert Critical @@ -102,7 +98,7 @@ Login - Login + Logowanie Boot @@ -120,9 +116,37 @@ Trace Ślad + + Identity authentication + Uwierzytelnienie tożsamości + + + Discretionary Access Control + Dowolna kontrola dostępu + + + Mandatory access control + Wymuszona kontrola dostępu + + + Remote + Zdalnie + + + Document audit + Audyt dokumentu + + + Other + Inne + DisplayContent + + zip(*.zip) + zip(*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEKST (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Błąd eksportu + + The export directory is not available. Please choose another directory for the export operation. + Ścieżka eksportu nie jest dostępna. Wybierz inny katalog, aby wykonać operacje. + File @@ -167,10 +195,6 @@ Level: Poziom: - - Application list: - Lista aplikacji: - Status: Status: @@ -193,11 +217,11 @@ Username: - Nazwa Użytkownika: + Nazwa użytkownika: Boot record - Wpis uruchomienia systemu + Zapis boot Shutdown record @@ -205,7 +229,19 @@ Login record - Wpis logowania do systemu + Wpisy logowania + + + Audit Type: + Typ audytu: + + + Application: + Aplikacja: + + + Submodule: + Podmoduł: @@ -228,11 +264,11 @@ Emergency - Zapasowy + Awaria Alert - Alarm + Alert Critical @@ -266,7 +302,7 @@ Log Viewer is a useful tool for viewing system logs. - Przeglądarka dzienników to przydatne narzędzie do przeglądania dzienników systemowych. + Przeglądarka dziennika to przydatne narzędzie do przeglądania dzienników systemowych. @@ -344,7 +380,7 @@ Null - Zero + Null User: @@ -356,11 +392,31 @@ File Name - + Nazwa pliku Time Modified - + Data modyfikacji + + + SIG + SIG + + + EXE + EXE + + + Core File + Plik główny + + + User Name + Nazwa użytkownika + + + Offset + Offset @@ -378,7 +434,7 @@ Kernel Log - Dziennik jądra + Dziennik kernela Boot Log @@ -406,22 +462,122 @@ dnf Log - Dziennik dpkg + Dziennik dnf Other Log - + Inne dzienniki Custom Log - + Własne dzienniki + + + Audit Log + Dziennik audytu + + + Coredump Log + Dziennik Coredump + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + Nie można uzyskać informacji o usterce, zainstaluj systemd-coredump. Warning You do not have permission to view it - + Nie posiadasz uprawnień, aby to wyświetlić + + + Security level for the current system: high + audit only administrators can view the audit log + Poziom bezpieczeństwa tego systemu: wysoki + tylko administrator kontrolny może wyświetlić dziennik audytu + + + + main + + Export logs to the specified path + Eksportuj dziennik do wybranej ścieżki + + + PATH + ŚCIEŻKA + + + Export logs of specified types + Eksportuj dzienniki wybranego typu + + + TYPE + TYP + + + Export logs of specified self-developed applications + Eksportuj dzienniki wybranych własnoręcznie stworzonych aplikacji + + + SELF APPNAME + NAZWA APLIKACJI + + + Export logs within a specified time period + Eksportuj dzienniki w określonym przedziale czasu + + + PERIOD + OKRES + + + Export logs within a specified debug level + Eksportuj dzienniki na określonym poziomie debug + + + LEVEL + POZIOM + + + BOOT STATUS + STATUS BOOT + + + Export boot(no-klu) logs within a specified status + Eksportuj dzienniki boot(no-klu) z określonym statusem + + + Export boot-shutdown-event or audit logs within a specified event type + Eksportuj zdarzenia zamknięcia systemu lub dzienniki audytu z określonym typem wydarzenia + + + EVENT TYPE + TYP WYDARZENIA + + + Export logs based on keywords search results + Eksportuj dzienniki na podstawie wyszukiwania słów kluczowych + + + KEY WORD + SŁOWO KLUCZOWE + + + Report coredump informations. + Zgłoś informacje coredump. + + + Export logs based on app submodel + Eksportuj dzienniki z określonym podmodułem aplikacji + + + SUBMODULE + PODMODUŁ @@ -432,15 +588,15 @@ 10 sec - 10 sekund + 10 sek 1 min - 1 minuta + 1 min 5 min - + 5 min No refresh @@ -450,10 +606,6 @@ Export All Eksportuj wszystko - - System Logs - Dziennik systemowy - Refresh Now Odśwież teraz diff --git a/translations/deepin-log-viewer_pt.ts b/translations/deepin-log-viewer_pt.ts index 5da0f024..324ba9e5 100644 --- a/translations/deepin-log-viewer_pt.ts +++ b/translations/deepin-log-viewer_pt.ts @@ -52,10 +52,6 @@ 3 months 3 meses - - Export - Exportar - Export button @@ -120,9 +116,37 @@ Trace Vestígio + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXTO (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Falha ao exportar + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Nível: - - Application list: - Lista de aplicações: - Status: Estado: @@ -207,6 +231,18 @@ Login record Registo do iniciar sessão + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Nome do ficheiro Time Modified + Data de modificação + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Outro registo Custom Log + Ficheiro personalizado + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,6 +492,90 @@ Warning You do not have permission to view it + Não tem permissão para o ver + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -440,7 +595,7 @@ 5 min - + 5 mins No refresh @@ -450,10 +605,6 @@ Export All Exportar tudo - - System Logs - Registos do sistema - Refresh Now Atualizar agora diff --git a/translations/deepin-log-viewer_pt_BR.ts b/translations/deepin-log-viewer_pt_BR.ts index d88fe631..df75d3c7 100644 --- a/translations/deepin-log-viewer_pt_BR.ts +++ b/translations/deepin-log-viewer_pt_BR.ts @@ -52,10 +52,6 @@ 3 months 3 meses - - Export - Exportar - Export button @@ -120,9 +116,37 @@ Trace Rastrear + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) Texto (*.txt);; Documento (*.doc);; Planilha (*.xls);; Página Web (*.html) @@ -149,6 +173,10 @@ Export failed A exportação falhou + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Nível: - - Application list: - Lista de aplicativos: - Status: Status: @@ -207,6 +231,18 @@ Login record Gravar login + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -362,6 +398,26 @@ Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +472,21 @@ Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,10 +605,6 @@ Export All - - System Logs - - Refresh Now diff --git a/translations/deepin-log-viewer_ro.ts b/translations/deepin-log-viewer_ro.ts new file mode 100644 index 00000000..eaed488c --- /dev/null +++ b/translations/deepin-log-viewer_ro.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + Toate + + + Today + Astăzi + + + 3 days + 3 zile + + + 1 week + 1 săptămână + + + 1 month + 1 lună + + + 3 months + 3 luni + + + Export + button + + + + + ComboBox + + All + Toate + + + Emergency + Urgență + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + Perioada: + + + Level: + + + + Status: + Statut: + + + Event Type: + + + + User: + Utilizator: + + + PID: + PID: + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + Urgență + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + Căutare + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + Utilizator + + + PID + PID + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + Utilizator: + + + PID: + PID: + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ru.ts b/translations/deepin-log-viewer_ru.ts index 8fd5fb9d..8cf064d8 100644 --- a/translations/deepin-log-viewer_ru.ts +++ b/translations/deepin-log-viewer_ru.ts @@ -52,10 +52,6 @@ 3 months 3 месяца - - Export - Экспорт - Export button @@ -120,9 +116,37 @@ Trace Трассировка + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) Текст (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Ошибка экспорта + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Уровень: - - Application list: - Список приложений: - Status: Состояние: @@ -207,6 +231,18 @@ Login record Запись об авторизации + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -362,6 +398,26 @@ Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +472,21 @@ Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,10 +605,6 @@ Export All Экспорт всех - - System Logs - Журналы системы - Refresh Now Обновить diff --git a/translations/deepin-log-viewer_sc.ts b/translations/deepin-log-viewer_sc.ts new file mode 100644 index 00000000..a081f1b7 --- /dev/null +++ b/translations/deepin-log-viewer_sc.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_si.ts b/translations/deepin-log-viewer_si.ts new file mode 100644 index 00000000..f19c8523 --- /dev/null +++ b/translations/deepin-log-viewer_si.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + නැවුම් කරන්න + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + සියල්ල + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + සියල්ල + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_sk.ts b/translations/deepin-log-viewer_sk.ts new file mode 100644 index 00000000..402cd9f7 --- /dev/null +++ b/translations/deepin-log-viewer_sk.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_sl.ts b/translations/deepin-log-viewer_sl.ts index 290792fa..939a1d16 100644 --- a/translations/deepin-log-viewer_sl.ts +++ b/translations/deepin-log-viewer_sl.ts @@ -52,10 +52,6 @@ 3 months 3 meseci - - Export - Izvozi - Export button @@ -120,9 +116,37 @@ Trace Sledi + + Identity authentication + Overitev identitete + + + Discretionary Access Control + Nadzor diskrecijskega dostopa + + + Mandatory access control + Nadzor mandatnega dostopa + + + Remote + Oddaljeno + + + Document audit + Potrjevanje dokumenta + + + Other + Drugo + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) BESEDILO (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Izvažanje ni uspelo + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Nivo: - - Application list: - Seznam programov: - Status: Status: @@ -207,6 +231,18 @@ Login record Zapis prijave + + Audit Type: + Vrsta potrjevanja: + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Ime datoteke Time Modified + Čas spremembe + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -374,31 +430,31 @@ Tree System Log - Sistemska beležka + Dnevnik sistema Kernel Log - Beležka jedra + Dnevnik jedra Boot Log - Zagonska beležka + Dnevnik zagona dpkg Log - Beležka dpkg + Dnevnik za dpkg Kwin Log - Beležka Kwin + Dnevnik za Kwin Xorg Log - Beležka Xorg + Dnevnik za xorg Application Log - Programska beležka + Dnevnik programov Boot-Shutdown Event @@ -406,14 +462,29 @@ dnf Log - Beležka dnf + Dnevnik za dnf Other Log - + Drugi dnevnik Custom Log + Dnevnik po meri + + + Audit Log + Dnevnik potrjevanja + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,42 +492,122 @@ Warning You do not have permission to view it + Nimate pravice za ogled + + + Security level for the current system: high + audit only administrators can view the audit log - titlebar + main - Refresh interval + Export logs to the specified path - 10 sec + PATH - 1 min + Export logs of specified types - 5 min + TYPE - No refresh + Export logs of specified self-developed applications - Export All + SELF APPNAME - System Logs + Export logs within a specified time period - Refresh Now + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + Interval osveževanja + + + 10 sec + 10 sec + + + 1 min + 1 min + + + 5 min + 5 min + + + No refresh + Brez osveževanja + + + Export All + Izvozi vse + + + Refresh Now + Osveži zdaj + \ No newline at end of file diff --git a/translations/deepin-log-viewer_sq.ts b/translations/deepin-log-viewer_sq.ts index 31ecefc8..fac7bf02 100644 --- a/translations/deepin-log-viewer_sq.ts +++ b/translations/deepin-log-viewer_sq.ts @@ -52,10 +52,6 @@ 3 months 3 muaj - - Export - Eksportoje - Export button @@ -120,9 +116,37 @@ Trace Ndiqe + + Identity authentication + Mirëfilltësim identiteti + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + Tjetër + DisplayContent + + zip(*.zip) + zip(*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEKS (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Eksportimi dështoi + + The export directory is not available. Please choose another directory for the export operation. + Drejtoria e eksportimeve s’është e passhme. Ju lutemi, zgjidhni një drejtori tjetër për veprimin e eksportimit. + File @@ -167,10 +195,6 @@ Level: Nivel: - - Application list: - Listë aplikacionesh: - Status: Gjendje: @@ -207,6 +231,18 @@ Login record Zë hyrjesh + + Audit Type: + Lloj Auditimi: + + + Application: + Aplikacion: + + + Submodule: + Nënmodul: + Level @@ -356,10 +392,30 @@ File Name - + Emër Kartele Time Modified + Kohë Ndryshimi + + + SIG + + + + EXE + + + + Core File + + + + User Name + Emër Përdoruesi + + + Offset @@ -410,19 +466,119 @@ Other Log - + Regjistër Tjetër Custom Log - + Regjistër Vetjak + + + Audit Log + Regjistër Auditimesh + + + Coredump Log + Regjistër Coredump-i + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + S’u arrit të merrej informacion vithisjeje, ju lutemi, instaloni systemd-coredump. Warning You do not have permission to view it + S’keni leje ta shini + + + Security level for the current system: high + audit only administrators can view the audit log + Shkallë sigurie për sistemin e tanishëm: e lartë + auditim: vetëm përgjegjësit mund të shohin regjistër auditimesh + + + + main + + Export logs to the specified path + Eksporto regjistra te shtegu i përcaktuar + + + PATH + SHTEG + + + Export logs of specified types + Eksporto regjistra te shtigjet e përcaktuar + + + TYPE + LLOJ + + + Export logs of specified self-developed applications + Eksporto regjistra të aplikacioneve të dhëna të vetëzhvilluara + + + SELF APPNAME + + + + Export logs within a specified time period + Eksporto regjistra brenda një periudhe të dhënë kohore + + + PERIOD + PERIUDHË + + + Export logs within a specified debug level + Eksporto regjistra me një shkallë të caktuar diagnostikimi + + + LEVEL + SHKALLË + + + BOOT STATUS + GJENDJE NISJEJE + + + Export boot(no-klu) logs within a specified status + Eksporto regjistra nisjeje(no-klu) brenda një gjendjeje të caktuar + + + Export boot-shutdown-event or audit logs within a specified event type + Eksporto regjistra “boot-shutdown-event” ose auditimi brenda një lloji të caktuar aktesh + + + EVENT TYPE + LLOJ AKTI + + + Export logs based on keywords search results + Eksporto regjistra bazuar në përfundime kërkimi për fjalëkyçe + + + KEY WORD + FJALËKYÇE + + + Report coredump informations. + + Export logs based on app submodel + Eksporto regjistra bazuar në nënmodel aplikacioni + + + SUBMODULE + NËNMODUL + titlebar @@ -440,7 +596,7 @@ 5 min - + 5 min No refresh @@ -450,10 +606,6 @@ Export All Eksportoji Krejt - - System Logs - Regjistra Sistemi - Refresh Now Rifreskoje Tani diff --git a/translations/deepin-log-viewer_sr.ts b/translations/deepin-log-viewer_sr.ts index b335d60d..c81046fb 100644 --- a/translations/deepin-log-viewer_sr.ts +++ b/translations/deepin-log-viewer_sr.ts @@ -52,10 +52,6 @@ 3 months 3 месеца - - Export - Извези - Export button @@ -120,9 +116,37 @@ Trace Пратити + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Неуспешан извоз + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Ниво: - - Application list: - Списак програма: - Status: Стање: @@ -207,6 +231,18 @@ Login record Евиденција пријава + + Audit Type: + + + + Application: + + + + Submodule: + + Level @@ -362,6 +398,26 @@ Time Modified + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + Tbble @@ -416,6 +472,21 @@ Custom Log + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + Warning @@ -423,6 +494,90 @@ You do not have permission to view it + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + titlebar @@ -450,10 +605,6 @@ Export All - - System Logs - - Refresh Now diff --git a/translations/deepin-log-viewer_sv.ts b/translations/deepin-log-viewer_sv.ts new file mode 100644 index 00000000..a3116f77 --- /dev/null +++ b/translations/deepin-log-viewer_sv.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_sw.ts b/translations/deepin-log-viewer_sw.ts new file mode 100644 index 00000000..773bbb16 --- /dev/null +++ b/translations/deepin-log-viewer_sw.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_ta.ts b/translations/deepin-log-viewer_ta.ts new file mode 100644 index 00000000..3c40b3c1 --- /dev/null +++ b/translations/deepin-log-viewer_ta.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_th.ts b/translations/deepin-log-viewer_th.ts new file mode 100644 index 00000000..fe9366af --- /dev/null +++ b/translations/deepin-log-viewer_th.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_tr.ts b/translations/deepin-log-viewer_tr.ts index 5aabc084..9732e14a 100644 --- a/translations/deepin-log-viewer_tr.ts +++ b/translations/deepin-log-viewer_tr.ts @@ -52,10 +52,6 @@ 3 months 3 ay - - Export - Dışa aktar - Export button @@ -120,9 +116,37 @@ Trace İzleyici + + Identity authentication + Kimlik doğrulama + + + Discretionary Access Control + İsteğe Bağlı Erişim Kontrolü + + + Mandatory access control + Zorunlu erişim kontrolü + + + Remote + Uzak + + + Document audit + Belge denetimi + + + Other + Diğer + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) METİN (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed Dışa aktarılamadı + + The export directory is not available. Please choose another directory for the export operation. + + File @@ -167,10 +195,6 @@ Level: Seviye: - - Application list: - Uygulama listesi: - Status: Durum: @@ -207,6 +231,18 @@ Login record Giriş kaydı + + Audit Type: + Denetim Türü: + + + Application: + + + + Submodule: + + Level @@ -356,10 +392,30 @@ File Name - + Dosya Adı Time Modified + Değiştirilme Zamanı + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset @@ -410,10 +466,25 @@ Other Log - + Diğer Log Custom Log + Özel Log + + + Audit Log + Denetleme Logu + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. @@ -421,6 +492,90 @@ Warning You do not have permission to view it + Görüntüleme izniniz yok + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE @@ -440,7 +595,7 @@ 5 min - + 5 dak No refresh @@ -450,10 +605,6 @@ Export All Tümünü Dışa Aktar - - System Logs - Sistem Günlükleri - Refresh Now Şimdi yinele diff --git a/translations/deepin-log-viewer_ug.ts b/translations/deepin-log-viewer_ug.ts index 07a9c8e4..337a1c1b 100644 --- a/translations/deepin-log-viewer_ug.ts +++ b/translations/deepin-log-viewer_ug.ts @@ -52,10 +52,6 @@ 3 months 3 ئاي - - Export - چىقىرىش - Export button @@ -120,9 +116,37 @@ Trace ئىز قوغلاش + + Identity authentication + سالاھىيەت پەرقلەندۈرۈش + + + Discretionary Access Control + ئۆز ئالدىغا زىيارەت قىلىشنى كونتروللاش + + + Mandatory access control + مەجبۇرىي زىيارەتنى قىلىشنى كونتروللاش + + + Remote + يىراقتىن ئۇلاش + + + Document audit + ھۆججەت تەكشۈرۈش + + + Other + باشقا + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed ھۆججەتننى چىقىرالمىدى + + The export directory is not available. Please choose another directory for the export operation. + چىقىرىدىغان مۇندەرىجىنى ئىشلەتكىلى بولمايدۇ، باشقا مۇندەرىجە تاللاپ مەشغۇلات قىلىڭ + File @@ -167,10 +195,6 @@ Level: دەرىجىسى: - - Application list: - ئەپ تىزىملىكى: - Status: ھالىتى: @@ -207,6 +231,18 @@ Login record كىرىش خاتىرىسى + + Audit Type: + تەكشۈرۈش تىپى: + + + Application: + ئەپ: + + + Submodule: + بالا مودېل: + Level @@ -356,11 +392,31 @@ File Name - + ھۆججەت نامى Time Modified - + ئۆزگەرتكەن ۋاقىت: + + + SIG + سىگنال + + + EXE + پىروگرامما + + + Core File + يادرولۇق ھۆججەت + + + User Name + ئىشلەتكۈچى + + + Offset + پىروگرامما @@ -410,18 +466,118 @@ Other Log - + باشقا كۈندىلىك خاتىرە Custom Log - + كۈندىلىك خاتىرە بەلگىلەش + + + Audit Log + تەكشۈرۈش خاتىرىسى + + + Coredump Log + گۇم بولۇش خاتىرىسى + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + ئۇچۇرنى ئالالمىدى، systemd-coredump قاچىلاڭ. Warning You do not have permission to view it - + كۆرۈش ھوقۇقى يوق + + + Security level for the current system: high + audit only administrators can view the audit log + نۆۋەتتىكى سىستېما بىخەتەرلىك دەرىجىسى: يۇقىرى +تەكشۈرگۈچى باشقۇرغۇچىلا تەكشۈرۈش خاتىرىسىنى كۆرەلەيدۇ + + + + main + + Export logs to the specified path + خاتىرىنى بەلگىلىگەن مۇندەرىجىگە چىقىرىش + + + PATH + چىقىرىش مۇندەرىجىسى + + + Export logs of specified types + خاتىرە تۈرى بويىچە چىقىرىش + + + TYPE + خاتىرە تۈرى + + + Export logs of specified self-developed applications + خاتىرىنى ئۆز ئالدىغا ئاچقان ئەپ بويىچە چىقىرىش + + + SELF APPNAME + ئۆز ئالدىغا ئاچقان ئەپ نامى + + + Export logs within a specified time period + خاتىرىنى ۋاقىت دەۋرىيلىكى بويىچە چىقىرىش + + + PERIOD + دەۋرىيلىكى + + + Export logs within a specified debug level + خاتىرىنى تەڭشەش-سىناش دەرىجىسى بويىچە چىقىرىش + + + LEVEL + تەڭشەش-سىناش دەرىجىسى + + + BOOT STATUS + قوزغىلىش ھالىتى + + + Export boot(no-klu) logs within a specified status + قوزغىلىش خاتىرىسىنى ھالىتى بويىچە چىقىرىش(klu) + + + Export boot-shutdown-event or audit logs within a specified event type + ئېچىش-تاقاش خاتىرىسى/تەكشۈرۈش خاتىرىسىنى مەشغۇلات تۈرى بويىچە چىقىرىش + + + EVENT TYPE + مەشغۇلات تۈرى + + + Export logs based on keywords search results + خاتىرىنى ھالقىلىق سۆز بويىچە چىقىرىش + + + KEY WORD + ھالقىلىق سۆز + + + Report coredump informations. + گۇم بولۇش نۇقتىسىنىڭ ئۇچۇرىنى يوللاش + + + Export logs based on app submodel + خاتىرىنى بالا مودېل بويىچە چىقىرىش + + + SUBMODULE + بالا مودېل @@ -440,7 +596,7 @@ 5 min - + 5 مىنۇت No refresh @@ -450,10 +606,6 @@ Export All ھەممىنى چىقىرىش - - System Logs - بارلىق سىستېما خاتىرىسى - Refresh Now ھازىر يېڭىلاش diff --git a/translations/deepin-log-viewer_uk.ts b/translations/deepin-log-viewer_uk.ts index 5929a6ba..834afd6c 100644 --- a/translations/deepin-log-viewer_uk.ts +++ b/translations/deepin-log-viewer_uk.ts @@ -52,10 +52,6 @@ 3 months 3 місяці - - Export - Експортувати - Export button @@ -120,9 +116,37 @@ Trace Трасування + + Identity authentication + Розпізнавання профілю + + + Discretionary Access Control + Дискреційне керування доступом + + + Mandatory access control + Обов'язкове керування доступом + + + Remote + Віддалений + + + Document audit + Ревізування документів + + + Other + Інше + DisplayContent + + zip(*.zip) + zip(*.zip) + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) текст (*.txt);; doc (*.doc);; xls (*.xls);; HTML (*.html) @@ -149,6 +173,10 @@ Export failed Не вдалося експортувати + + The export directory is not available. Please choose another directory for the export operation. + Каталог експортування даних є недоступним. Будь ласка, виберіть інший каталог для дії з експортування. + File @@ -167,10 +195,6 @@ Level: Рівень: - - Application list: - Список програм: - Status: Стан: @@ -207,6 +231,18 @@ Login record Запис входу + + Audit Type: + Тип нагляду: + + + Application: + Програма: + + + Submodule: + Підмодуль: + Level @@ -356,11 +392,31 @@ File Name - + Назва файла Time Modified - + Час внесення змін + + + SIG + SIG + + + EXE + EXE + + + Core File + Основний файл + + + User Name + Ім'я користувача + + + Offset + Зсув @@ -410,18 +466,118 @@ Other Log - + Інший журнал Custom Log - + Нетиповий журнал + + + Audit Log + Журнал нагляду + + + Coredump Log + Журнал дампу ядра + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + Не вдалося отримати дані щодо аварії. Будь ласка, встановіть systemd-coredump. Warning You do not have permission to view it - + У вас немає прав доступу для перегляду + + + Security level for the current system: high + audit only administrators can view the audit log + Рівень захисту поточної системи: високий + журнал ревізії можуть переглядати лише адміністратори-ревізори + + + + main + + Export logs to the specified path + Експортувати журнал до вказаного каталогу + + + PATH + ШЛЯХ + + + Export logs of specified types + Експортувати журнали вказаних типів + + + TYPE + ТИП + + + Export logs of specified self-developed applications + Експортувати журнали вказаних самостійно розроблених програм + + + SELF APPNAME + НАЗВА ПРОГРАМИ + + + Export logs within a specified time period + Експортувати журнал за вказаний період часу + + + PERIOD + ПЕРІОД + + + Export logs within a specified debug level + Експортувати журнали на вказаному рівні діагностики + + + LEVEL + РІВЕНЬ + + + BOOT STATUS + СТАН ЗАВАНТАЖЕННЯ + + + Export boot(no-klu) logs within a specified status + Експортувати журнал завантаження за вказаним станом + + + Export boot-shutdown-event or audit logs within a specified event type + Експортувати журнал boot-shutdown-event або ревізій для вказаного типу подій + + + EVENT TYPE + ТИП ПОДІЙ + + + Export logs based on keywords search results + Експортувати журнал на основі результатів пошуку за ключовим словом + + + KEY WORD + КЛЮЧОВЕ СЛОВО + + + Report coredump informations. + Повідомити дані дампів ядра. + + + Export logs based on app submodel + Експортувати журнал для підмодуля програм + + + SUBMODULE + ПІДМОДУЛЬ @@ -440,7 +596,7 @@ 5 min - + 5 хв. No refresh @@ -450,10 +606,6 @@ Export All Експортувати усе - - System Logs - Журнал системи - Refresh Now Оновити зараз diff --git a/translations/deepin-log-viewer_ur.ts b/translations/deepin-log-viewer_ur.ts new file mode 100644 index 00000000..5b9433b8 --- /dev/null +++ b/translations/deepin-log-viewer_ur.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_uz.ts b/translations/deepin-log-viewer_uz.ts new file mode 100644 index 00000000..0ab6b5b4 --- /dev/null +++ b/translations/deepin-log-viewer_uz.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_vi.ts b/translations/deepin-log-viewer_vi.ts new file mode 100644 index 00000000..532bef8a --- /dev/null +++ b/translations/deepin-log-viewer_vi.ts @@ -0,0 +1,613 @@ + + + Action + + Display in file manager + + + + Clear log + + + + Refresh + + + + Are you sure you want to clear the log? + + + + Cancel + + + + Confirm + + + + + Button + + All + + + + Today + + + + 3 days + + + + 1 week + + + + 1 month + + + + 3 months + + + + Export + button + + + + + ComboBox + + All + + + + Emergency + + + + Alert + + + + Critical + + + + Error + + + + Warning + + + + Notice + + + + Info + + + + Debug + + + + Login + + + + Boot + + + + Shutdown + + + + Super critical + + + + Trace + + + + Identity authentication + + + + Discretionary Access Control + + + + Mandatory access control + + + + Remote + + + + Document audit + + + + Other + + + + + DisplayContent + + zip(*.zip) + + + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + + + ExportDlg + + Exporting... + + + + Cancel + + + + + ExportMessage + + Export successful + + + + Export failed + + + + The export directory is not available. Please choose another directory for the export operation. + + + + + File + + Export File + + + + + Label + + Period: + + + + Level: + + + + Status: + + + + Event Type: + + + + User: + + + + PID: + + + + Action: + + + + Username: + + + + Boot record + + + + Shutdown record + + + + Login record + + + + Audit Type: + + + + Application: + + + + Submodule: + + + + + Level + + Warning + + + + Debug + + + + Info + + + + Error + + + + Emergency + + + + Alert + + + + Critical + + + + Notice + + + + Trace + + + + Super critical + + + + + LogAuthThread + + Log file is empty + + + + + Main + + Log Viewer + + + + Log Viewer is a useful tool for viewing system logs. + + + + + SearchBar + + No search results + + + + Search + + + + + Table + + Level + + + + Process + + + + Date and Time + + + + Info + + + + User + + + + PID + + + + Source + + + + Action + + + + Status + + + + Event Type + + + + Username + + + + Level: + + + + Process: + + + + Date and Time: + + + + Info: + + + + Null + + + + User: + + + + PID: + + + + File Name + + + + Time Modified + + + + SIG + + + + EXE + + + + Core File + + + + User Name + + + + Offset + + + + + Tbble + + Date and Time + + + + + Tree + + System Log + + + + Kernel Log + + + + Boot Log + + + + dpkg Log + + + + Kwin Log + + + + Xorg Log + + + + Application Log + + + + Boot-Shutdown Event + + + + dnf Log + + + + Other Log + + + + Custom Log + + + + Audit Log + + + + Coredump Log + + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + You do not have permission to view it + + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + main + + Export logs to the specified path + + + + PATH + + + + Export logs of specified types + + + + TYPE + + + + Export logs of specified self-developed applications + + + + SELF APPNAME + + + + Export logs within a specified time period + + + + PERIOD + + + + Export logs within a specified debug level + + + + LEVEL + + + + BOOT STATUS + + + + Export boot(no-klu) logs within a specified status + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + EVENT TYPE + + + + Export logs based on keywords search results + + + + KEY WORD + + + + Report coredump informations. + + + + Export logs based on app submodel + + + + SUBMODULE + + + + + titlebar + + Refresh interval + + + + 10 sec + + + + 1 min + + + + 5 min + + + + No refresh + + + + Export All + + + + Refresh Now + + + + \ No newline at end of file diff --git a/translations/deepin-log-viewer_zh_CN.ts b/translations/deepin-log-viewer_zh_CN.ts index c90b8426..3188a791 100644 --- a/translations/deepin-log-viewer_zh_CN.ts +++ b/translations/deepin-log-viewer_zh_CN.ts @@ -52,10 +52,6 @@ 3 months 近三个月 - - Export - 导出 - Export button @@ -120,9 +116,37 @@ Trace 跟踪 + + Identity authentication + 身份鉴别 + + + Discretionary Access Control + 自主访问控制 + + + Mandatory access control + 强制访问控制 + + + Remote + 远程连接 + + + Document audit + 文件审计 + + + Other + 其他 + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed 导出失败 + + The export directory is not available. Please choose another directory for the export operation. + 导出目录不可用,请选择其他目录进行导出操作。 + File @@ -167,10 +195,6 @@ Level: 级别: - - Application list: - 应用列表: - Status: 状态: @@ -207,6 +231,18 @@ Login record 登录信息 + + Audit Type: + 审计类型: + + + Application: + 应用: + + + Submodule: + 子模块: + Level @@ -362,6 +398,26 @@ Time Modified 修改日期 + + SIG + 崩溃信号 + + + EXE + 进程 + + + Core File + 核心文件 + + + User Name + 用户 + + + Offset + 进程 + Tbble @@ -416,6 +472,21 @@ Custom Log 自定义日志 + + Audit Log + 审计日志 + + + Coredump Log + 崩溃日志 + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + 无法获取崩溃信息,请安装 systemd-coredump。 + Warning @@ -423,6 +494,91 @@ You do not have permission to view it 无权限查看 + + Security level for the current system: high + audit only administrators can view the audit log + 当前系统安全等级为:高 +仅审计管理员可查看审计日志 + + + + main + + Export logs to the specified path + 导出日志到指定目录 + + + PATH + 导出路径 + + + Export logs of specified types + 按日志种类导出日志 + + + TYPE + 日志种类 + + + Export logs of specified self-developed applications + 按自研应用导出日志 + + + SELF APPNAME + 自研应用名称 + + + Export logs within a specified time period + 按时间周期导出日志 + + + PERIOD + 周期 + + + Export logs within a specified debug level + 按调试级别导出日志 + + + LEVEL + 调试级别 + + + BOOT STATUS + 启动状态 + + + Export boot(no-klu) logs within a specified status + 按状态导出启动日志(klu) + + + Export boot-shutdown-event or audit logs within a specified event type + 按事件类型导出开关机事件/审计日志 + + + EVENT TYPE + 事件类型 + + + Export logs based on keywords search results + 按关键词导出日志 + + + KEY WORD + 关键词 + + + Report coredump informations. + 上报崩溃埋点信息 + + + Export logs based on app submodel + 按子模块导出应用日志 + + + SUBMODULE + 子模块 + titlebar @@ -450,10 +606,6 @@ Export All 全部导出 - - System Logs - 系统全部日志 - Refresh Now 立即刷新 diff --git a/translations/deepin-log-viewer_zh_HK.ts b/translations/deepin-log-viewer_zh_HK.ts index 2398e816..267c393c 100644 --- a/translations/deepin-log-viewer_zh_HK.ts +++ b/translations/deepin-log-viewer_zh_HK.ts @@ -52,10 +52,6 @@ 3 months 近三個月 - - Export - 導出 - Export button @@ -120,9 +116,37 @@ Trace 跟蹤 + + Identity authentication + 身份鑑別 + + + Discretionary Access Control + 自主訪問控制 + + + Mandatory access control + 強制訪問控制 + + + Remote + 遠程連接 + + + Document audit + 文件審計 + + + Other + 其他 + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed 導出失敗 + + The export directory is not available. Please choose another directory for the export operation. + 導出目錄不可用,請選擇其他目錄進行導出操作。 + File @@ -167,10 +195,6 @@ Level: 級別: - - Application list: - 應用列表: - Status: 狀態: @@ -207,6 +231,18 @@ Login record 登錄訊息 + + Audit Type: + 審計類型: + + + Application: + 應用: + + + Submodule: + 子模塊: + Level @@ -362,6 +398,26 @@ Time Modified 修改日期 + + SIG + 崩潰信號 + + + EXE + 進程 + + + Core File + 核心文件 + + + User Name + 用戶 + + + Offset + 偏移量 + Tbble @@ -416,6 +472,21 @@ Custom Log 自定義日誌 + + Audit Log + 審計日誌 + + + Coredump Log + 崩潰日誌 + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + 無法獲取崩潰資訊,請安裝 systemd-coredump。 + Warning @@ -423,6 +494,91 @@ You do not have permission to view it 無權限查看 + + Security level for the current system: high + audit only administrators can view the audit log + 當前系統安全等級為:高 +僅審計管理員可查看審計日誌 + + + + main + + Export logs to the specified path + 導出日誌到指定目錄 + + + PATH + 導出路徑 + + + Export logs of specified types + 按日誌種類導出日誌 + + + TYPE + 日誌種類 + + + Export logs of specified self-developed applications + 按自研應用導出日誌 + + + SELF APPNAME + 自研應用名稱 + + + Export logs within a specified time period + 按時間週期導出日誌 + + + PERIOD + 週期 + + + Export logs within a specified debug level + 按調試級別導出日誌 + + + LEVEL + 調試級別 + + + BOOT STATUS + 啟動狀態 + + + Export boot(no-klu) logs within a specified status + 按狀態導出啟動日誌(klu) + + + Export boot-shutdown-event or audit logs within a specified event type + 按事件類型導出開關機事件/審計日誌 + + + EVENT TYPE + 事件類型 + + + Export logs based on keywords search results + 按關鍵詞導出日誌 + + + KEY WORD + 關鍵詞 + + + Report coredump informations. + 上報崩潰埋點資訊 + + + Export logs based on app submodel + 按子模塊導出應用日誌 + + + SUBMODULE + 子模塊 + titlebar @@ -450,10 +606,6 @@ Export All 全部導出 - - System Logs - 系統全部日誌 - Refresh Now 立即刷新 diff --git a/translations/deepin-log-viewer_zh_TW.ts b/translations/deepin-log-viewer_zh_TW.ts index ab38d1bf..7cca4474 100644 --- a/translations/deepin-log-viewer_zh_TW.ts +++ b/translations/deepin-log-viewer_zh_TW.ts @@ -52,10 +52,6 @@ 3 months 近三個月 - - Export - 匯出 - Export button @@ -120,9 +116,37 @@ Trace 跟蹤 + + Identity authentication + 身份鑑別 + + + Discretionary Access Control + 自主訪問控制 + + + Mandatory access control + 強制訪問控制 + + + Remote + 遠端連接 + + + Document audit + 文件審計 + + + Other + 其他 + DisplayContent + + zip(*.zip) + + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) @@ -149,6 +173,10 @@ Export failed 匯出失敗 + + The export directory is not available. Please choose another directory for the export operation. + 匯出目錄不可用,請選擇其他目錄進行匯出操作。 + File @@ -167,10 +195,6 @@ Level: 級別: - - Application list: - 應用程式列表: - Status: 登入訊息 @@ -207,6 +231,18 @@ Login record 登入訊息 + + Audit Type: + 審計類型: + + + Application: + 應用: + + + Submodule: + 子模組: + Level @@ -362,6 +398,26 @@ Time Modified 修改日期 + + SIG + 崩潰訊號 + + + EXE + 行程 + + + Core File + 核心文件 + + + User Name + 使用者 + + + Offset + 偏移量 + Tbble @@ -416,6 +472,21 @@ Custom Log 自訂日誌 + + Audit Log + 審計日誌 + + + Coredump Log + 崩潰日誌 + + + + Waring + + Unable to obtain crash information, please install systemd-coredump. + 無法獲取崩潰資訊,請安裝 systemd-coredump。 + Warning @@ -423,6 +494,91 @@ You do not have permission to view it 無權限查看 + + Security level for the current system: high + audit only administrators can view the audit log + 目前系統安全等級為:高 +僅審計管理員可查看審計日誌 + + + + main + + Export logs to the specified path + 匯出日誌到指定目錄 + + + PATH + 匯出路徑 + + + Export logs of specified types + 按日誌種類匯出日誌 + + + TYPE + 日誌種類 + + + Export logs of specified self-developed applications + 按自研應用匯出日誌 + + + SELF APPNAME + 自研應用名稱 + + + Export logs within a specified time period + 按時間週期匯出日誌 + + + PERIOD + 週期 + + + Export logs within a specified debug level + 按除錯級別匯出日誌 + + + LEVEL + 除錯級別 + + + BOOT STATUS + 啟動狀態 + + + Export boot(no-klu) logs within a specified status + 按狀態匯出啟動日誌(klu) + + + Export boot-shutdown-event or audit logs within a specified event type + 按事件類型匯出開關機事件/審計日誌 + + + EVENT TYPE + 事件類型 + + + Export logs based on keywords search results + 按關鍵字匯出日誌 + + + KEY WORD + 關鍵字 + + + Report coredump informations. + 上報崩潰埋點資訊 + + + Export logs based on app submodel + 按子模組匯出應用日誌 + + + SUBMODULE + 子模組 + titlebar @@ -450,10 +606,6 @@ Export All 全部匯出 - - System Logs - 系統全部日誌 - Refresh Now 立即重新整理 diff --git a/translations/deepin_log_viewer.ts b/translations/deepin_log_viewer.ts index 5e97307a..9b385cb3 100644 --- a/translations/deepin_log_viewer.ts +++ b/translations/deepin_log_viewer.ts @@ -4,32 +4,34 @@ Action - + + Display in file manager - + Clear log - + + Refresh - + Are you sure you want to clear the log? - + Cancel - + Confirm @@ -37,157 +39,196 @@ Button - - - + + + All - - - - + + + + Today - - - - + + + + 3 days - - - - + + + + 1 week - - - - + + + + 1 month - - - - + + + + 3 months - + Export + button ComboBox - - - - + + + + + + + All - + Emergency - + Alert - - + + Critical - - + + Error - - + + Warning - + Notice - - - + + + Info - - + + Debug - + Super critical - + Trace - + Login - + Boot - + Shutdown + + + Identity authentication + + + + + Discretionary Access Control + + + + + Mandatory access control + + + + + Remote + + + + + Document audit + + + + + Other + + DisplayContent - + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + zip(*.zip) + + ExportDlg - + Exporting... - + Cancel @@ -195,15 +236,27 @@ ExportMessage - + Export successful + + + Export failed + + + + + + The export directory is not available. Please choose another directory for the export operation. + + File - + + Export File @@ -211,67 +264,79 @@ Label - - - + + + Period: - - + + + + Level: - - Application list: + + Application: + + + + + Submodule: - - + + Status: - - + + Event Type: - + + Audit Type: + + + + User: - + PID: - + Action: - + Username: - + Boot record - + Shutdown record - + Login record @@ -279,154 +344,162 @@ Level - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Warning - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + Debug - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Info - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Error - - - - - - - - - - - + + + + + + + + + + + + Emergency - - - - - - - - - - - + + + + + + + + + + + + Alert - - - - - - - - - - - - - + + + + + + + + + + + + + + Critical - - - - - - - - - - - + + + + + + + + + + + + Notice - - + + Trace - - + + Super critical @@ -434,8 +507,7 @@ LogAuthThread - - + Log file is empty @@ -443,13 +515,13 @@ Main - - + + Log Viewer - + Log Viewer is a useful tool for viewing system logs. @@ -457,12 +529,12 @@ SearchBar - + No search results - + Search @@ -470,157 +542,238 @@ Table - - - - - - - - - - - - + + + + + + + + + + + + + + + Level - - - - - - - + + + + + + + + + + + + Process - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + Date and Time - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Info - - - - - - - + + + + + + + + + + User - - - - - + + + + + + + PID - + + Action - + + + Offset + + + + + + + Status - - - - - + + + File Name + + + + + + Time Modified + + + + + + SIG + + + + + + Core File + + + + + + User Name + + + + + + EXE + + + + + + + Source - + + + + Event Type - + + Username - + Level: - + Process: - + Date and Time: - - + + Info: - + Null - + User: - + PID: @@ -628,7 +781,8 @@ Tbble - + + Date and Time @@ -636,62 +790,247 @@ Tree - - + + System Log - - - - + + + + Kernel Log - - - - + + + + Boot Log - - + + dnf Log - - + + dpkg Log - - + + Xorg Log - - + + + Coredump Log + + + + + + Other Log + + + + + + Audit Log + + + + + + Custom Log + + + + + Kwin Log - - + + Application Log - - + + Boot-Shutdown Event + + Waring + + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + You do not have permission to view it + + + + + main + + + Export logs to the specified path + + + + + PATH + + + + + Export logs of specified types + + + + + TYPE + + + + + Export logs of specified self-developed applications + + + + + SELF APPNAME + + + + + Export logs within a specified time period + + + + + PERIOD + + + + + Export logs within a specified debug level + + + + + LEVEL + + + + + Export boot(no-klu) logs within a specified status + + + + + BOOT STATUS + + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + + EVENT TYPE + + + + + Export logs based on keywords search results + + + + + KEY WORD + + + + + Export logs based on app submodel + + + + + SUBMODULE + + + + + Report coredump informations. + + + + + titlebar + + + Refresh interval + + + + + 10 sec + + + + + 1 min + + + + + + 5 min + + + + + No refresh + + + + + + Export All + + + + + + Refresh Now + + + diff --git a/translations/deepin_log_viewer_en_US.ts b/translations/deepin_log_viewer_en_US.ts index af99a245..c292ccaa 100644 --- a/translations/deepin_log_viewer_en_US.ts +++ b/translations/deepin_log_viewer_en_US.ts @@ -4,32 +4,34 @@ Action - + + Display in file manager - + Clear log - + + Refresh - + Are you sure you want to clear the log? - + Cancel - + Confirm @@ -37,157 +39,196 @@ Button - - - + + + All - - - - + + + + Today - - - - + + + + 3 days - - - - + + + + 1 week - - - - + + + + 1 month - - - - + + + + 3 months - + Export + button ComboBox - - - - + + + + + + + All - + Emergency - + Alert - - + + Critical - - + + Error - - + + Warning - + Notice - - - + + + Info - - + + Debug - + Super critical - + Trace - + Login - + Boot - + Shutdown + + + Identity authentication + + + + + Discretionary Access Control + + + + + Mandatory access control + + + + + Remote + + + + + Document audit + + + + + Other + + DisplayContent - + TEXT (*.txt);; Doc (*.doc);; Xls (*.xls);; Html (*.html) + + + zip(*.zip) + + ExportDlg - + Exporting... - + Cancel @@ -195,15 +236,27 @@ ExportMessage - + Export successful + + + Export failed + + + + + + The export directory is not available. Please choose another directory for the export operation. + + File - + + Export File @@ -211,67 +264,79 @@ Label - - - + + + Period: - - + + + + Level: - - Application list: + + Application: + + + + + Submodule: - - + + Status: - - + + Event Type: - + + Audit Type: + + + + User: - + PID: - + Action: - + Username: - + Boot record - + Shutdown record - + Login record @@ -279,154 +344,162 @@ Level - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Warning - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + Debug - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Info - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Error - - - - - - - - - - - + + + + + + + + + + + + Emergency - - - - - - - - - - - + + + + + + + + + + + + Alert - - - - - - - - - - - - - + + + + + + + + + + + + + + Critical - - - - - - - - - - - + + + + + + + + + + + + Notice - - + + Trace - - + + Super critical @@ -434,8 +507,7 @@ LogAuthThread - - + Log file is empty @@ -443,13 +515,13 @@ Main - - + + Log Viewer - + Log Viewer is a useful tool for viewing system logs. @@ -457,12 +529,12 @@ SearchBar - + No search results - + Search @@ -470,157 +542,238 @@ Table - - - - - - - - - - - - + + + + + + + + + + + + + + + Level - - - - - - - + + + + + + + + + + + + Process - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + Date and Time - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Info - - - - - - - + + + + + + + + + + User - - - - - + + + + + + + PID - + + Action - + + + Offset + + + + + + + Status - - - - - + + + File Name + + + + + + Time Modified + + + + + + SIG + + + + + + Core File + + + + + + User Name + + + + + + EXE + + + + + + + Source - + + + + Event Type - + + Username - + Level: - + Process: - + Date and Time: - - + + Info: - + Null - + User: - + PID: @@ -628,7 +781,8 @@ Tbble - + + Date and Time @@ -636,62 +790,247 @@ Tree - - + + System Log - - - - + + + + Kernel Log - - - - + + + + Boot Log - - + + dnf Log - - + + dpkg Log - - + + Xorg Log - - + + + Coredump Log + + + + + + Other Log + + + + + + Audit Log + + + + + + Custom Log + + + + + Kwin Log - - + + Application Log - - + + Boot-Shutdown Event + + Waring + + + Unable to obtain crash information, please install systemd-coredump. + + + + + Warning + + + Security level for the current system: high + audit only administrators can view the audit log + + + + + You do not have permission to view it + + + + + main + + + Export logs to the specified path + + + + + PATH + + + + + Export logs of specified types + + + + + TYPE + + + + + Export logs of specified self-developed applications + + + + + SELF APPNAME + + + + + Export logs within a specified time period + + + + + PERIOD + + + + + Export logs within a specified debug level + + + + + LEVEL + + + + + Export boot(no-klu) logs within a specified status + + + + + BOOT STATUS + + + + + Export boot-shutdown-event or audit logs within a specified event type + + + + + EVENT TYPE + + + + + Export logs based on keywords search results + + + + + KEY WORD + + + + + Export logs based on app submodel + + + + + SUBMODULE + + + + + Report coredump informations. + + + + + titlebar + + + Refresh interval + + + + + 10 sec + + + + + 1 min + + + + + + 5 min + + + + + No refresh + + + + + + Export All + + + + + + Refresh Now + + + diff --git a/translations/desktop/desktop.ts b/translations/desktop/desktop.ts index 42958d00..ba5d4e7e 100644 --- a/translations/desktop/desktop.ts +++ b/translations/desktop/desktop.ts @@ -1 +1,3 @@ -desktopDeepin Log ViewerDeepin Log ViewerLog ViewerLog Viewer \ No newline at end of file + + +desktopDeepin Log ViewerLog Viewer diff --git a/translations/desktop/desktop_ady.ts b/translations/desktop/desktop_ady.ts new file mode 100644 index 00000000..6ecb644a --- /dev/null +++ b/translations/desktop/desktop_ady.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_af.ts b/translations/desktop/desktop_af.ts new file mode 100644 index 00000000..294e3fed --- /dev/null +++ b/translations/desktop/desktop_af.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ak.ts b/translations/desktop/desktop_ak.ts new file mode 100644 index 00000000..41947fa7 --- /dev/null +++ b/translations/desktop/desktop_ak.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_am_ET.ts b/translations/desktop/desktop_am_ET.ts new file mode 100644 index 00000000..130b9e9b --- /dev/null +++ b/translations/desktop/desktop_am_ET.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ar.ts b/translations/desktop/desktop_ar.ts index 365870b4..934a5a02 100644 --- a/translations/desktop/desktop_ar.ts +++ b/translations/desktop/desktop_ar.ts @@ -1 +1 @@ -desktopDeepin Log Viewerعارض سجلات ديبينLog Viewerعارض السجلات \ No newline at end of file +desktopDeepin Log Viewerعارض سجلات ديبينLog Viewerعارض السجلات \ No newline at end of file diff --git a/translations/desktop/desktop_ast.ts b/translations/desktop/desktop_ast.ts new file mode 100644 index 00000000..b41998f5 --- /dev/null +++ b/translations/desktop/desktop_ast.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_az.ts b/translations/desktop/desktop_az.ts index 1dfa86a7..e1e474d9 100644 --- a/translations/desktop/desktop_az.ts +++ b/translations/desktop/desktop_az.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin Jurnala İcmalıLog ViewerJurnal icmalı \ No newline at end of file +desktopDeepin Log ViewerDeepin Jurnala İcmalıLog ViewerJurnal icmalı \ No newline at end of file diff --git a/translations/desktop/desktop_bg.ts b/translations/desktop/desktop_bg.ts new file mode 100644 index 00000000..bf2414a5 --- /dev/null +++ b/translations/desktop/desktop_bg.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_bn.ts b/translations/desktop/desktop_bn.ts new file mode 100644 index 00000000..89730999 --- /dev/null +++ b/translations/desktop/desktop_bn.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_bo.ts b/translations/desktop/desktop_bo.ts index 6dc4c46e..2d43c9f2 100644 --- a/translations/desktop/desktop_bo.ts +++ b/translations/desktop/desktop_bo.ts @@ -1 +1 @@ -desktopDeepin Log Viewerགཏིང་ཟབ་ཉིན་ཐོ་འཚུབ་སྡུད་ཡོ་བྱད།Log Viewerཉིན་ཐོ་འཚོལ་སྡུད་ཡོ་བྱད། \ No newline at end of file +desktopDeepin Log Viewerགཏིང་ཟབ་ཉིན་ཐོ་འཚུབ་སྡུད་ཡོ་བྱད།Log Viewerཉིན་ཐོ་འཚོལ་སྡུད་ཡོ་བྱད། \ No newline at end of file diff --git a/translations/desktop/desktop_bqi.ts b/translations/desktop/desktop_bqi.ts new file mode 100644 index 00000000..7d4c119b --- /dev/null +++ b/translations/desktop/desktop_bqi.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_br.ts b/translations/desktop/desktop_br.ts index 22cb79cc..92ecf2d5 100644 --- a/translations/desktop/desktop_br.ts +++ b/translations/desktop/desktop_br.ts @@ -1 +1 @@ -desktopDeepin Log ViewerLenner renabloù DeepinLog ViewerLenner renabloù \ No newline at end of file +desktopDeepin Log ViewerLenner renabloù DeepinLog ViewerLenner renabloù \ No newline at end of file diff --git a/translations/desktop/desktop_ca.ts b/translations/desktop/desktop_ca.ts index df45d95e..1ad80a1d 100644 --- a/translations/desktop/desktop_ca.ts +++ b/translations/desktop/desktop_ca.ts @@ -1 +1 @@ -desktopDeepin Log ViewerVisualitzador de registres del DeepinLog ViewerVisualitzador de registres \ No newline at end of file +desktopDeepin Log ViewerVisualitzador de registres del DeepinLog ViewerVisualitzador de registres \ No newline at end of file diff --git a/translations/desktop/desktop_cs.ts b/translations/desktop/desktop_cs.ts index 78c9cc05..2873f4ad 100644 --- a/translations/desktop/desktop_cs.ts +++ b/translations/desktop/desktop_cs.ts @@ -1 +1 @@ -desktopDeepin Log ViewerProhlížeč záznamů událostíLog ViewerProhlížeč záznamů událostí \ No newline at end of file +desktopDeepin Log ViewerProhlížeč záznamů událostíLog ViewerProhlížeč záznamů událostí \ No newline at end of file diff --git a/translations/desktop/desktop_da.ts b/translations/desktop/desktop_da.ts index 9598029f..e139166c 100644 --- a/translations/desktop/desktop_da.ts +++ b/translations/desktop/desktop_da.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin logfremviserLog ViewerLogfremviser \ No newline at end of file +desktopDeepin Log ViewerDeepin logfremviserLog ViewerLogfremviser \ No newline at end of file diff --git a/translations/desktop/desktop_de.ts b/translations/desktop/desktop_de.ts index e6a3565e..e04603ed 100644 --- a/translations/desktop/desktop_de.ts +++ b/translations/desktop/desktop_de.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin ProtokollbetrachterLog ViewerProtokollbetrachter \ No newline at end of file +desktopDeepin Log ViewerDeepin ProtokollbetrachterLog ViewerProtokollbetrachter \ No newline at end of file diff --git a/translations/desktop/desktop_el.ts b/translations/desktop/desktop_el.ts new file mode 100644 index 00000000..f9cf02f2 --- /dev/null +++ b/translations/desktop/desktop_el.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_en_AU.ts b/translations/desktop/desktop_en_AU.ts new file mode 100644 index 00000000..a2166d4e --- /dev/null +++ b/translations/desktop/desktop_en_AU.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_en_CA.ts b/translations/desktop/desktop_en_CA.ts new file mode 100644 index 00000000..1b70ce39 --- /dev/null +++ b/translations/desktop/desktop_en_CA.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_en_GB.ts b/translations/desktop/desktop_en_GB.ts index 7d9e6b8f..8f841087 100644 --- a/translations/desktop/desktop_en_GB.ts +++ b/translations/desktop/desktop_en_GB.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin Log ViewerLog ViewerLog Viewer \ No newline at end of file +desktopDeepin Log ViewerDeepin Log ViewerLog ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_eo.ts b/translations/desktop/desktop_eo.ts new file mode 100644 index 00000000..95222393 --- /dev/null +++ b/translations/desktop/desktop_eo.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_es.ts b/translations/desktop/desktop_es.ts index ca39c00f..f6d69f90 100644 --- a/translations/desktop/desktop_es.ts +++ b/translations/desktop/desktop_es.ts @@ -1 +1 @@ -desktopDeepin Log ViewerVisor de registroLog ViewerVisor de registro \ No newline at end of file +desktopDeepin Log ViewerVisor de registroLog ViewerVisor de registro \ No newline at end of file diff --git a/translations/desktop/desktop_et.ts b/translations/desktop/desktop_et.ts new file mode 100644 index 00000000..d112fc62 --- /dev/null +++ b/translations/desktop/desktop_et.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_fa.ts b/translations/desktop/desktop_fa.ts new file mode 100644 index 00000000..4dec07e5 --- /dev/null +++ b/translations/desktop/desktop_fa.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_fi.ts b/translations/desktop/desktop_fi.ts index d32c3c1a..5c8828ad 100644 --- a/translations/desktop/desktop_fi.ts +++ b/translations/desktop/desktop_fi.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin tapahtumalokiLog ViewerTapahtumaloki \ No newline at end of file +desktopDeepin Log ViewerDeepin tapahtumalokiLog ViewerTapahtumaloki \ No newline at end of file diff --git a/translations/desktop/desktop_fil.ts b/translations/desktop/desktop_fil.ts new file mode 100644 index 00000000..bba00654 --- /dev/null +++ b/translations/desktop/desktop_fil.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_fr.ts b/translations/desktop/desktop_fr.ts index a83ae94b..0994b7b4 100644 --- a/translations/desktop/desktop_fr.ts +++ b/translations/desktop/desktop_fr.ts @@ -1 +1 @@ -desktopDeepin Log ViewerVisionneuse de journaux DeepinLog ViewerVisionneuse de journaux \ No newline at end of file +desktopDeepin Log ViewerVisionneuse de journaux DeepinLog ViewerVisionneuse de journaux \ No newline at end of file diff --git a/translations/desktop/desktop_gl_ES.ts b/translations/desktop/desktop_gl_ES.ts index 9b03e9d6..bcdd2b6c 100644 --- a/translations/desktop/desktop_gl_ES.ts +++ b/translations/desktop/desktop_gl_ES.ts @@ -1 +1 @@ -desktopDeepin Log ViewerVisor de rexistros de DeepinLog ViewerVisor de rexistros \ No newline at end of file +desktopDeepin Log ViewerVisor de rexistros de DeepinLog ViewerVisor de rexistros \ No newline at end of file diff --git a/translations/desktop/desktop_he.ts b/translations/desktop/desktop_he.ts new file mode 100644 index 00000000..a8f4f2b4 --- /dev/null +++ b/translations/desktop/desktop_he.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_hi_IN.ts b/translations/desktop/desktop_hi_IN.ts index d96d6095..4c60f16c 100644 --- a/translations/desktop/desktop_hi_IN.ts +++ b/translations/desktop/desktop_hi_IN.ts @@ -1 +1 @@ -desktopDeepin Log Viewerदीपिन लॉग फ़ाइल प्रदर्शकLog Viewerलॉग फ़ाइल प्रदर्शक \ No newline at end of file +desktopDeepin Log Viewerदीपिन लॉग फ़ाइल प्रदर्शकLog Viewerलॉग फ़ाइल प्रदर्शक \ No newline at end of file diff --git a/translations/desktop/desktop_hr.ts b/translations/desktop/desktop_hr.ts index c291dbe7..6ebed381 100644 --- a/translations/desktop/desktop_hr.ts +++ b/translations/desktop/desktop_hr.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin preglednik zapisaLog ViewerPreglednik zapisa \ No newline at end of file +desktopDeepin Log ViewerDeepin preglednik zapisaLog ViewerPreglednik zapisa \ No newline at end of file diff --git a/translations/desktop/desktop_hu.ts b/translations/desktop/desktop_hu.ts index 39b55f30..a91dedf3 100644 --- a/translations/desktop/desktop_hu.ts +++ b/translations/desktop/desktop_hu.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin® Napló MegjelenítőLog ViewerNapló Megjelenítő \ No newline at end of file +desktopDeepin Log ViewerDeepin® Napló MegjelenítőLog ViewerNapló Megjelenítő \ No newline at end of file diff --git a/translations/desktop/desktop_hy.ts b/translations/desktop/desktop_hy.ts new file mode 100644 index 00000000..34160d23 --- /dev/null +++ b/translations/desktop/desktop_hy.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ia.ts b/translations/desktop/desktop_ia.ts new file mode 100644 index 00000000..2df6a330 --- /dev/null +++ b/translations/desktop/desktop_ia.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_id.ts b/translations/desktop/desktop_id.ts new file mode 100644 index 00000000..205859cf --- /dev/null +++ b/translations/desktop/desktop_id.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_it.ts b/translations/desktop/desktop_it.ts index a55416cf..e513ad6e 100644 --- a/translations/desktop/desktop_it.ts +++ b/translations/desktop/desktop_it.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin Log ViewerLog ViewerLog Viewer \ No newline at end of file +desktopDeepin Log ViewerDeepin Log ViewerLog ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ja.ts b/translations/desktop/desktop_ja.ts new file mode 100644 index 00000000..0ee0248e --- /dev/null +++ b/translations/desktop/desktop_ja.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ka.ts b/translations/desktop/desktop_ka.ts new file mode 100644 index 00000000..159fcd46 --- /dev/null +++ b/translations/desktop/desktop_ka.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_km_KH.ts b/translations/desktop/desktop_km_KH.ts new file mode 100644 index 00000000..f22595a7 --- /dev/null +++ b/translations/desktop/desktop_km_KH.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_kn_IN.ts b/translations/desktop/desktop_kn_IN.ts new file mode 100644 index 00000000..9253d0c3 --- /dev/null +++ b/translations/desktop/desktop_kn_IN.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ko.ts b/translations/desktop/desktop_ko.ts index b62c2b2e..a689dd26 100644 --- a/translations/desktop/desktop_ko.ts +++ b/translations/desktop/desktop_ko.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin 로그 보기도구Log Viewer로그 보기도구 \ No newline at end of file +desktopDeepin Log ViewerDeepin 로그 보기도구Log Viewer로그 보기도구 \ No newline at end of file diff --git a/translations/desktop/desktop_ku.ts b/translations/desktop/desktop_ku.ts new file mode 100644 index 00000000..4c5909a9 --- /dev/null +++ b/translations/desktop/desktop_ku.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ku_IQ.ts b/translations/desktop/desktop_ku_IQ.ts new file mode 100644 index 00000000..3bd4a701 --- /dev/null +++ b/translations/desktop/desktop_ku_IQ.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ky.ts b/translations/desktop/desktop_ky.ts new file mode 100644 index 00000000..870c95df --- /dev/null +++ b/translations/desktop/desktop_ky.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ky@Arab.ts b/translations/desktop/desktop_ky@Arab.ts new file mode 100644 index 00000000..273cd836 --- /dev/null +++ b/translations/desktop/desktop_ky@Arab.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_la.ts b/translations/desktop/desktop_la.ts new file mode 100644 index 00000000..29ca3c02 --- /dev/null +++ b/translations/desktop/desktop_la.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_lo.ts b/translations/desktop/desktop_lo.ts new file mode 100644 index 00000000..f2b3a509 --- /dev/null +++ b/translations/desktop/desktop_lo.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_lt.ts b/translations/desktop/desktop_lt.ts index 4697d7b4..b802ad60 100644 --- a/translations/desktop/desktop_lt.ts +++ b/translations/desktop/desktop_lt.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin žurnalų žiūryklėLog ViewerŽurnalų žiūryklė \ No newline at end of file +desktopDeepin Log ViewerDeepin žurnalų žiūryklėLog ViewerŽurnalų žiūryklė \ No newline at end of file diff --git a/translations/desktop/desktop_lv.ts b/translations/desktop/desktop_lv.ts new file mode 100644 index 00000000..204b7569 --- /dev/null +++ b/translations/desktop/desktop_lv.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ml.ts b/translations/desktop/desktop_ml.ts new file mode 100644 index 00000000..aba7ebd6 --- /dev/null +++ b/translations/desktop/desktop_ml.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_mn.ts b/translations/desktop/desktop_mn.ts new file mode 100644 index 00000000..d1345a47 --- /dev/null +++ b/translations/desktop/desktop_mn.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_mr.ts b/translations/desktop/desktop_mr.ts new file mode 100644 index 00000000..7515789c --- /dev/null +++ b/translations/desktop/desktop_mr.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ms.ts b/translations/desktop/desktop_ms.ts index 54dc302f..c25b7da1 100644 --- a/translations/desktop/desktop_ms.ts +++ b/translations/desktop/desktop_ms.ts @@ -1 +1 @@ -desktopDeepin Log ViewerPelihat Log DeepinLog ViewerPelihat Log \ No newline at end of file +desktopDeepin Log ViewerPelihat Log DeepinLog ViewerPelihat Log \ No newline at end of file diff --git a/translations/desktop/desktop_nb.ts b/translations/desktop/desktop_nb.ts new file mode 100644 index 00000000..cb8b3be2 --- /dev/null +++ b/translations/desktop/desktop_nb.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ne.ts b/translations/desktop/desktop_ne.ts new file mode 100644 index 00000000..2e3f9ff8 --- /dev/null +++ b/translations/desktop/desktop_ne.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_nl.ts b/translations/desktop/desktop_nl.ts index 043a442f..91a7f9ab 100644 --- a/translations/desktop/desktop_nl.ts +++ b/translations/desktop/desktop_nl.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin LogboekLog ViewerLogboek \ No newline at end of file +desktopDeepin Log ViewerDeepin LogboekLog ViewerLogboek \ No newline at end of file diff --git a/translations/desktop/desktop_pa.ts b/translations/desktop/desktop_pa.ts new file mode 100644 index 00000000..146f0221 --- /dev/null +++ b/translations/desktop/desktop_pa.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_pam.ts b/translations/desktop/desktop_pam.ts new file mode 100644 index 00000000..e31ab723 --- /dev/null +++ b/translations/desktop/desktop_pam.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_pl.ts b/translations/desktop/desktop_pl.ts index 4c0dc1ba..0b127f1b 100644 --- a/translations/desktop/desktop_pl.ts +++ b/translations/desktop/desktop_pl.ts @@ -1 +1 @@ -desktopDeepin Log ViewerPrzeglądarka dziennika DeepinLog ViewerPrzeglądarka dziennika \ No newline at end of file +desktopDeepin Log ViewerPrzeglądarka dziennika DeepinLog ViewerPrzeglądarka dziennika \ No newline at end of file diff --git a/translations/desktop/desktop_pt.ts b/translations/desktop/desktop_pt.ts index a4fda886..f741e916 100644 --- a/translations/desktop/desktop_pt.ts +++ b/translations/desktop/desktop_pt.ts @@ -1 +1 @@ -desktopDeepin Log ViewerVisualizador de Registos do DeepinLog ViewerVisualizador de Registos \ No newline at end of file +desktopDeepin Log ViewerVisualizador de Registos do DeepinLog ViewerVisualizador de Registos \ No newline at end of file diff --git a/translations/desktop/desktop_pt_BR.ts b/translations/desktop/desktop_pt_BR.ts index 9c4c804e..aac4ea3f 100644 --- a/translations/desktop/desktop_pt_BR.ts +++ b/translations/desktop/desktop_pt_BR.ts @@ -1 +1 @@ -desktopDeepin Log Viewerdeepin Visualizador de LogsLog ViewerVisualizador de Logs \ No newline at end of file +desktopDeepin Log Viewerdeepin Visualizador de LogsLog ViewerVisualizador de Logs \ No newline at end of file diff --git a/translations/desktop/desktop_ro.ts b/translations/desktop/desktop_ro.ts new file mode 100644 index 00000000..ec6b688f --- /dev/null +++ b/translations/desktop/desktop_ro.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ru.ts b/translations/desktop/desktop_ru.ts index f624f935..afa27bce 100644 --- a/translations/desktop/desktop_ru.ts +++ b/translations/desktop/desktop_ru.ts @@ -1 +1 @@ -desktopDeepin Log ViewerПросмотр журнала DeepinLog Viewer Просмотр журнала \ No newline at end of file +desktopDeepin Log ViewerПросмотр журнала DeepinLog Viewer Просмотр журнала \ No newline at end of file diff --git a/translations/desktop/desktop_sc.ts b/translations/desktop/desktop_sc.ts new file mode 100644 index 00000000..34f342e6 --- /dev/null +++ b/translations/desktop/desktop_sc.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_si.ts b/translations/desktop/desktop_si.ts new file mode 100644 index 00000000..e23c72f4 --- /dev/null +++ b/translations/desktop/desktop_si.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_sk.ts b/translations/desktop/desktop_sk.ts new file mode 100644 index 00000000..98b0b702 --- /dev/null +++ b/translations/desktop/desktop_sk.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_sl.ts b/translations/desktop/desktop_sl.ts index 5bcb4f4e..95f8ba8b 100644 --- a/translations/desktop/desktop_sl.ts +++ b/translations/desktop/desktop_sl.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin pregledovalnik dnevnikaLog ViewerPregledovalnik dnevnika \ No newline at end of file +desktopDeepin Log ViewerDeepin pregledovalnik dnevnikaLog ViewerPregledovalnik dnevnika \ No newline at end of file diff --git a/translations/desktop/desktop_sq.ts b/translations/desktop/desktop_sq.ts index c528364d..5967eb83 100644 --- a/translations/desktop/desktop_sq.ts +++ b/translations/desktop/desktop_sq.ts @@ -1 +1 @@ -desktopDeepin Log ViewerParës Regjistrash DeepinLog ViewerParës Regjistrash \ No newline at end of file +desktopDeepin Log ViewerParës Regjistrash DeepinLog ViewerParës Regjistrash \ No newline at end of file diff --git a/translations/desktop/desktop_sr.ts b/translations/desktop/desktop_sr.ts index 6367f7a3..69b2f6ed 100644 --- a/translations/desktop/desktop_sr.ts +++ b/translations/desktop/desktop_sr.ts @@ -1 +1 @@ -desktopDeepin Log ViewerДипин Прегледач ЗаписникаLog ViewerПрегледач Записника \ No newline at end of file +desktopDeepin Log ViewerДипин Прегледач ЗаписникаLog ViewerПрегледач Записника \ No newline at end of file diff --git a/translations/desktop/desktop_sv.ts b/translations/desktop/desktop_sv.ts new file mode 100644 index 00000000..d0cb85a9 --- /dev/null +++ b/translations/desktop/desktop_sv.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_sw.ts b/translations/desktop/desktop_sw.ts new file mode 100644 index 00000000..f6034696 --- /dev/null +++ b/translations/desktop/desktop_sw.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_ta.ts b/translations/desktop/desktop_ta.ts new file mode 100644 index 00000000..8095e3ce --- /dev/null +++ b/translations/desktop/desktop_ta.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_th.ts b/translations/desktop/desktop_th.ts new file mode 100644 index 00000000..469caaca --- /dev/null +++ b/translations/desktop/desktop_th.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_tr.ts b/translations/desktop/desktop_tr.ts index 6874232f..2cdc2fd5 100644 --- a/translations/desktop/desktop_tr.ts +++ b/translations/desktop/desktop_tr.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin Günlük GörüntüleyiciLog ViewerGünlük Görüntüleyici \ No newline at end of file +desktopDeepin Log ViewerDeepin Günlük GörüntüleyiciLog ViewerGünlük Görüntüleyici \ No newline at end of file diff --git a/translations/desktop/desktop_ug.ts b/translations/desktop/desktop_ug.ts index b573c712..d322d3cb 100644 --- a/translations/desktop/desktop_ug.ts +++ b/translations/desktop/desktop_ug.ts @@ -1 +1 @@ -desktopDeepin Log Viewerخاتىرە كۆرگۈچ DeepinLog Viewerخاتىرە كۆرگۈچ \ No newline at end of file +desktopDeepin Log Viewerخاتىرە كۆرگۈچ DeepinLog Viewerخاتىرە كۆرگۈچ \ No newline at end of file diff --git a/translations/desktop/desktop_uk.ts b/translations/desktop/desktop_uk.ts index 82cbc7f9..1f939e82 100644 --- a/translations/desktop/desktop_uk.ts +++ b/translations/desktop/desktop_uk.ts @@ -1 +1 @@ -desktopDeepin Log ViewerПереглядач журналів DeepinLog ViewerПереглядач журналів \ No newline at end of file +desktopDeepin Log ViewerПереглядач журналів DeepinLog ViewerПереглядач журналів \ No newline at end of file diff --git a/translations/desktop/desktop_ur.ts b/translations/desktop/desktop_ur.ts new file mode 100644 index 00000000..ce9b1e8a --- /dev/null +++ b/translations/desktop/desktop_ur.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_uz.ts b/translations/desktop/desktop_uz.ts new file mode 100644 index 00000000..dbddbcf6 --- /dev/null +++ b/translations/desktop/desktop_uz.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_vi.ts b/translations/desktop/desktop_vi.ts new file mode 100644 index 00000000..f26fc328 --- /dev/null +++ b/translations/desktop/desktop_vi.ts @@ -0,0 +1 @@ +desktopDeepin Log ViewerLog Viewer \ No newline at end of file diff --git a/translations/desktop/desktop_zh_CN.ts b/translations/desktop/desktop_zh_CN.ts index 2add2b0f..1b1821e9 100644 --- a/translations/desktop/desktop_zh_CN.ts +++ b/translations/desktop/desktop_zh_CN.ts @@ -1 +1,3 @@ -desktopDeepin Log Viewer深度日志收集工具Log Viewer日志收集工具 \ No newline at end of file + + +desktopDeepin Log Viewer日志收集工具Log Viewer日志收集工具 diff --git a/translations/desktop/desktop_zh_HK.ts b/translations/desktop/desktop_zh_HK.ts index 53c8dd19..f339c943 100644 --- a/translations/desktop/desktop_zh_HK.ts +++ b/translations/desktop/desktop_zh_HK.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin 日誌查看器Log Viewer日誌查看器 \ No newline at end of file +desktopDeepin Log ViewerDeepin 日誌查看器Log Viewer日誌查看器 \ No newline at end of file diff --git a/translations/desktop/desktop_zh_TW.ts b/translations/desktop/desktop_zh_TW.ts index aff0eecd..faa1d107 100644 --- a/translations/desktop/desktop_zh_TW.ts +++ b/translations/desktop/desktop_zh_TW.ts @@ -1 +1 @@ -desktopDeepin Log ViewerDeepin 日誌收集工具Log Viewer日誌收集工具 \ No newline at end of file +desktopDeepin Log ViewerDeepin 日誌收集工具Log Viewer日誌收集工具 \ No newline at end of file diff --git a/translations/policy/auth/policy.ts b/translations/policy/auth/policy.ts index 3619f714..4614e582 100644 --- a/translations/policy/auth/policy.ts +++ b/translations/policy/auth/policy.ts @@ -1,25 +1,47 @@ - + + + policy - + Authentication is required to view the log - Authentication is required to view the log + - + authentication - authentication + - + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + Authentication is required to export logs - Authentication is required to export logs + - + authentication - authentication + - \ No newline at end of file + diff --git a/translations/policy/auth/policy_ady.ts b/translations/policy/auth/policy_ady.ts new file mode 100644 index 00000000..7506dded --- /dev/null +++ b/translations/policy/auth/policy_ady.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_af.ts b/translations/policy/auth/policy_af.ts new file mode 100644 index 00000000..9f50ce30 --- /dev/null +++ b/translations/policy/auth/policy_af.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ak.ts b/translations/policy/auth/policy_ak.ts new file mode 100644 index 00000000..c74a33d5 --- /dev/null +++ b/translations/policy/auth/policy_ak.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_am_ET.ts b/translations/policy/auth/policy_am_ET.ts new file mode 100644 index 00000000..f490cccb --- /dev/null +++ b/translations/policy/auth/policy_am_ET.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ar.ts b/translations/policy/auth/policy_ar.ts index 0fafc0f8..8666db3a 100644 --- a/translations/policy/auth/policy_ar.ts +++ b/translations/policy/auth/policy_ar.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication المصادقة + + + Authentication is required to view the log + المصادقة مطلوبة لعرض السجل + + + + authentication + المصادقة + + + + Authentication is required to export logs + + + + + authentication + المصادقة + + + + Authentication is required to export logs + + + + + authentication + المصادقة + \ No newline at end of file diff --git a/translations/policy/auth/policy_ast.ts b/translations/policy/auth/policy_ast.ts new file mode 100644 index 00000000..8bdf8533 --- /dev/null +++ b/translations/policy/auth/policy_ast.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_az.ts b/translations/policy/auth/policy_az.ts index 52e26fa2..749f0c18 100644 --- a/translations/policy/auth/policy_az.ts +++ b/translations/policy/auth/policy_az.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication kimlik doğrulaması + + + Authentication is required to view the log + Jurnala baxmaq üçün kimlik doğrulaması tələb olunur + + + + authentication + kimlik doğrulaması + + + + Authentication is required to export logs + Jurnalların ixrac edilməsi üçün kimlik doğrulaması tələb olunur + + + + authentication + kimlik doğrulaması + + + + Authentication is required to export logs + Jurnalların ixrac edilməsi üçün kimlik doğrulaması tələb olunur + + + + authentication + kimlik doğrulaması + \ No newline at end of file diff --git a/translations/policy/auth/policy_bg.ts b/translations/policy/auth/policy_bg.ts new file mode 100644 index 00000000..f4ec8c95 --- /dev/null +++ b/translations/policy/auth/policy_bg.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_bn.ts b/translations/policy/auth/policy_bn.ts new file mode 100644 index 00000000..bb9a1662 --- /dev/null +++ b/translations/policy/auth/policy_bn.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_bo.ts b/translations/policy/auth/policy_bo.ts index 62284958..63616e95 100644 --- a/translations/policy/auth/policy_bo.ts +++ b/translations/policy/auth/policy_bo.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication དཔང་དཔྱད། + + + Authentication is required to view the log + ཉིན་ཐོ་འདི་ལྟ་བཤེར་བྱེད་པར་དཔང་དཔྱད་བྱ་དགོས། + + + + authentication + དཔང་དཔྱད། + + + + Authentication is required to export logs + ཉིན་ཐོ་འདྲེན་པ་ལ་དབང་སྐུར་དགོས། + + + + authentication + དཔང་དཔྱད། + + + + Authentication is required to export logs + ཉིན་ཐོ་འདྲེན་པ་ལ་དབང་སྐུར་དགོས། + + + + authentication + དཔང་དཔྱད། + \ No newline at end of file diff --git a/translations/policy/auth/policy_bqi.ts b/translations/policy/auth/policy_bqi.ts new file mode 100644 index 00000000..08f673d9 --- /dev/null +++ b/translations/policy/auth/policy_bqi.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_br.ts b/translations/policy/auth/policy_br.ts index cfc74904..36b15fd9 100644 --- a/translations/policy/auth/policy_br.ts +++ b/translations/policy/auth/policy_br.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication Anaouadur + + + Authentication is required to view the log + An anaouadur a zo rekis evit gellout gwelet ar renabloù + + + + authentication + Anaouadur + + + + Authentication is required to export logs + + + + + authentication + Anaouadur + + + + Authentication is required to export logs + + + + + authentication + Anaouadur + \ No newline at end of file diff --git a/translations/policy/auth/policy_ca.ts b/translations/policy/auth/policy_ca.ts index c3314d60..c5a2da72 100644 --- a/translations/policy/auth/policy_ca.ts +++ b/translations/policy/auth/policy_ca.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication autenticació + + + Authentication is required to view the log + Cal autenticació per veure el registre. + + + + authentication + autenticació + + + + Authentication is required to export logs + Cal autenticació per exportar registres. + + + + authentication + autenticació + + + + Authentication is required to export logs + Cal autenticació per exportar registres. + + + + authentication + autenticació + \ No newline at end of file diff --git a/translations/policy/auth/policy_cs.ts b/translations/policy/auth/policy_cs.ts index 4eb1d94f..02f1f2c1 100644 --- a/translations/policy/auth/policy_cs.ts +++ b/translations/policy/auth/policy_cs.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication ověření se + + + Authentication is required to view the log + Pro zobrazení událostí je vyžadováno ověření se + + + + authentication + ověření se + + + + Authentication is required to export logs + + + + + authentication + ověření se + + + + Authentication is required to export logs + + + + + authentication + ověření se + \ No newline at end of file diff --git a/translations/policy/auth/policy_da.ts b/translations/policy/auth/policy_da.ts new file mode 100644 index 00000000..6ca8ca9d --- /dev/null +++ b/translations/policy/auth/policy_da.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + autentifikation + + + + Authentication is required to view the log + + + + + authentication + autentifikation + + + + Authentication is required to export logs + + + + + authentication + autentifikation + + + + Authentication is required to export logs + + + + + authentication + autentifikation + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_de.ts b/translations/policy/auth/policy_de.ts index 41d28edd..5b4069f9 100644 --- a/translations/policy/auth/policy_de.ts +++ b/translations/policy/auth/policy_de.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication Authentifizierung + + + Authentication is required to view the log + Zur Ansicht des Protokolls ist eine Authentifizierung erforderlich + + + + authentication + Authentifizierung + + + + Authentication is required to export logs + Zum Exportieren von Protokollen ist eine Authentifizierung erforderlich + + + + authentication + Authentifizierung + + + + Authentication is required to export logs + Zum Exportieren von Protokollen ist eine Authentifizierung erforderlich + + + + authentication + Authentifizierung + \ No newline at end of file diff --git a/translations/policy/auth/policy_el.ts b/translations/policy/auth/policy_el.ts new file mode 100644 index 00000000..0ab543bb --- /dev/null +++ b/translations/policy/auth/policy_el.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_en_AU.ts b/translations/policy/auth/policy_en_AU.ts new file mode 100644 index 00000000..635a14ad --- /dev/null +++ b/translations/policy/auth/policy_en_AU.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_en_CA.ts b/translations/policy/auth/policy_en_CA.ts new file mode 100644 index 00000000..113d8469 --- /dev/null +++ b/translations/policy/auth/policy_en_CA.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_en_GB.ts b/translations/policy/auth/policy_en_GB.ts index c5951081..fe842e78 100644 --- a/translations/policy/auth/policy_en_GB.ts +++ b/translations/policy/auth/policy_en_GB.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication authentication + + + Authentication is required to view the log + Authentication is required to view the log + + + + authentication + authentication + + + + Authentication is required to export logs + + + + + authentication + authentication + + + + Authentication is required to export logs + + + + + authentication + authentication + \ No newline at end of file diff --git a/translations/policy/auth/policy_eo.ts b/translations/policy/auth/policy_eo.ts new file mode 100644 index 00000000..d7fc3780 --- /dev/null +++ b/translations/policy/auth/policy_eo.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_es.ts b/translations/policy/auth/policy_es.ts index 3bc87abc..5f3f0521 100644 --- a/translations/policy/auth/policy_es.ts +++ b/translations/policy/auth/policy_es.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication autenticación + + + Authentication is required to view the log + Se requiere autenticación para ver el registro + + + + authentication + autenticación + + + + Authentication is required to export logs + Se requiere autenticación para exportar registros + + + + authentication + autenticación + + + + Authentication is required to export logs + Se requiere autenticación para exportar registros + + + + authentication + autenticación + \ No newline at end of file diff --git a/translations/policy/auth/policy_et.ts b/translations/policy/auth/policy_et.ts new file mode 100644 index 00000000..f743cf9d --- /dev/null +++ b/translations/policy/auth/policy_et.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_fa.ts b/translations/policy/auth/policy_fa.ts new file mode 100644 index 00000000..35a59678 --- /dev/null +++ b/translations/policy/auth/policy_fa.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_fi.ts b/translations/policy/auth/policy_fi.ts index dd150f46..518cfb9d 100644 --- a/translations/policy/auth/policy_fi.ts +++ b/translations/policy/auth/policy_fi.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication todennus + + + Authentication is required to view the log + Tapahtumalokin katsomiseen tarvitaan todennus + + + + authentication + todennus + + + + Authentication is required to export logs + Lokien viemiseksi vaaditaan todennus + + + + authentication + todennus + + + + Authentication is required to export logs + Lokien viemiseksi vaaditaan todennus + + + + authentication + todennus + \ No newline at end of file diff --git a/translations/policy/auth/policy_fil.ts b/translations/policy/auth/policy_fil.ts new file mode 100644 index 00000000..f6fed492 --- /dev/null +++ b/translations/policy/auth/policy_fil.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_fr.ts b/translations/policy/auth/policy_fr.ts index 76e34d4a..89a810d5 100644 --- a/translations/policy/auth/policy_fr.ts +++ b/translations/policy/auth/policy_fr.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication authentification + + + Authentication is required to view the log + L'authentification est requise pour voir les journaux + + + + authentication + authentification + + + + Authentication is required to export logs + L'authentification est requise pour exporter les journaux + + + + authentication + authentification + + + + Authentication is required to export logs + L'authentification est requise pour exporter les journaux + + + + authentication + authentification + \ No newline at end of file diff --git a/translations/policy/auth/policy_gl_ES.ts b/translations/policy/auth/policy_gl_ES.ts new file mode 100644 index 00000000..655ba4f3 --- /dev/null +++ b/translations/policy/auth/policy_gl_ES.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + autenticación + + + + Authentication is required to view the log + + + + + authentication + autenticación + + + + Authentication is required to export logs + + + + + authentication + autenticación + + + + Authentication is required to export logs + + + + + authentication + autenticación + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_he.ts b/translations/policy/auth/policy_he.ts new file mode 100644 index 00000000..cc219734 --- /dev/null +++ b/translations/policy/auth/policy_he.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_hi_IN.ts b/translations/policy/auth/policy_hi_IN.ts index c9a4ad51..7ba4836f 100644 --- a/translations/policy/auth/policy_hi_IN.ts +++ b/translations/policy/auth/policy_hi_IN.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication प्रमाणीकरण + + + Authentication is required to view the log + लॉग फ़ाइल देखने हेतु प्रमाणीकरण आवश्यक है + + + + authentication + प्रमाणीकरण + + + + Authentication is required to export logs + + + + + authentication + प्रमाणीकरण + + + + Authentication is required to export logs + + + + + authentication + प्रमाणीकरण + \ No newline at end of file diff --git a/translations/policy/auth/policy_hr.ts b/translations/policy/auth/policy_hr.ts index 77bdcc38..a7b27060 100644 --- a/translations/policy/auth/policy_hr.ts +++ b/translations/policy/auth/policy_hr.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication ovjera + + + Authentication is required to view the log + Potrebna je ovjera za pregled zapisa + + + + authentication + ovjera + + + + Authentication is required to export logs + + + + + authentication + ovjera + + + + Authentication is required to export logs + + + + + authentication + ovjera + \ No newline at end of file diff --git a/translations/policy/auth/policy_hu.ts b/translations/policy/auth/policy_hu.ts index 5f0a368d..520c476d 100644 --- a/translations/policy/auth/policy_hu.ts +++ b/translations/policy/auth/policy_hu.ts @@ -1,4 +1,4 @@ - + policy @@ -11,6 +11,16 @@ authentication Hitelesítés + + + Authentication is required to view the log + Hitelesítés szükséges a napló megtekintéséhez + + + + authentication + Hitelesítés + Authentication is required to export logs @@ -21,5 +31,15 @@ authentication Hitelesítés + + + Authentication is required to export logs + Hitelesítés szükséges a naplók exportálásához + + + + authentication + Hitelesítés + \ No newline at end of file diff --git a/translations/policy/auth/policy_hy.ts b/translations/policy/auth/policy_hy.ts new file mode 100644 index 00000000..891fa52a --- /dev/null +++ b/translations/policy/auth/policy_hy.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ia.ts b/translations/policy/auth/policy_ia.ts new file mode 100644 index 00000000..6a53e461 --- /dev/null +++ b/translations/policy/auth/policy_ia.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_id.ts b/translations/policy/auth/policy_id.ts new file mode 100644 index 00000000..6cfeee38 --- /dev/null +++ b/translations/policy/auth/policy_id.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_it.ts b/translations/policy/auth/policy_it.ts index a82f004b..98b17861 100644 --- a/translations/policy/auth/policy_it.ts +++ b/translations/policy/auth/policy_it.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication autenticazione + + + Authentication is required to view the log + Autenticazione richiesta per visualizzare il log + + + + authentication + autenticazione + + + + Authentication is required to export logs + Autenticazione richiesta per esportare i log + + + + authentication + autenticazione + + + + Authentication is required to export logs + Autenticazione richiesta per esportare i log + + + + authentication + autenticazione + \ No newline at end of file diff --git a/translations/policy/auth/policy_ja.ts b/translations/policy/auth/policy_ja.ts new file mode 100644 index 00000000..7b713ed7 --- /dev/null +++ b/translations/policy/auth/policy_ja.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ka.ts b/translations/policy/auth/policy_ka.ts new file mode 100644 index 00000000..4f615541 --- /dev/null +++ b/translations/policy/auth/policy_ka.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_km_KH.ts b/translations/policy/auth/policy_km_KH.ts new file mode 100644 index 00000000..9b0f9d4f --- /dev/null +++ b/translations/policy/auth/policy_km_KH.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_kn_IN.ts b/translations/policy/auth/policy_kn_IN.ts new file mode 100644 index 00000000..038e03b1 --- /dev/null +++ b/translations/policy/auth/policy_kn_IN.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ko.ts b/translations/policy/auth/policy_ko.ts index d47a4f1c..ecba24cc 100644 --- a/translations/policy/auth/policy_ko.ts +++ b/translations/policy/auth/policy_ko.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication 인증 + + + Authentication is required to view the log + 로그를 보려면 인증이 필요합니다 + + + + authentication + 인증 + + + + Authentication is required to export logs + + + + + authentication + 인증 + + + + Authentication is required to export logs + + + + + authentication + 인증 + \ No newline at end of file diff --git a/translations/policy/auth/policy_ku.ts b/translations/policy/auth/policy_ku.ts new file mode 100644 index 00000000..3a81f827 --- /dev/null +++ b/translations/policy/auth/policy_ku.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ku_IQ.ts b/translations/policy/auth/policy_ku_IQ.ts new file mode 100644 index 00000000..6a0db9a3 --- /dev/null +++ b/translations/policy/auth/policy_ku_IQ.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ky.ts b/translations/policy/auth/policy_ky.ts new file mode 100644 index 00000000..52cd7fc4 --- /dev/null +++ b/translations/policy/auth/policy_ky.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ky@Arab.ts b/translations/policy/auth/policy_ky@Arab.ts new file mode 100644 index 00000000..d4bcdaa3 --- /dev/null +++ b/translations/policy/auth/policy_ky@Arab.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_la.ts b/translations/policy/auth/policy_la.ts new file mode 100644 index 00000000..7a465b91 --- /dev/null +++ b/translations/policy/auth/policy_la.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_lo.ts b/translations/policy/auth/policy_lo.ts new file mode 100644 index 00000000..526c2558 --- /dev/null +++ b/translations/policy/auth/policy_lo.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_lt.ts b/translations/policy/auth/policy_lt.ts new file mode 100644 index 00000000..dac73eca --- /dev/null +++ b/translations/policy/auth/policy_lt.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_lv.ts b/translations/policy/auth/policy_lv.ts new file mode 100644 index 00000000..b5f9826d --- /dev/null +++ b/translations/policy/auth/policy_lv.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ml.ts b/translations/policy/auth/policy_ml.ts new file mode 100644 index 00000000..14b66ce2 --- /dev/null +++ b/translations/policy/auth/policy_ml.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_mn.ts b/translations/policy/auth/policy_mn.ts new file mode 100644 index 00000000..ce46ef49 --- /dev/null +++ b/translations/policy/auth/policy_mn.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_mr.ts b/translations/policy/auth/policy_mr.ts new file mode 100644 index 00000000..95c1de6d --- /dev/null +++ b/translations/policy/auth/policy_mr.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ms.ts b/translations/policy/auth/policy_ms.ts index dd8400a4..c998bf38 100644 --- a/translations/policy/auth/policy_ms.ts +++ b/translations/policy/auth/policy_ms.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication pengesahihan + + + Authentication is required to view the log + Pengesahihan diperlukan untuk melihat log + + + + authentication + pengesahihan + + + + Authentication is required to export logs + Pengesahihan diperlukan untuk mengeksport log + + + + authentication + pengesahihan + + + + Authentication is required to export logs + Pengesahihan diperlukan untuk mengeksport log + + + + authentication + pengesahihan + \ No newline at end of file diff --git a/translations/policy/auth/policy_nb.ts b/translations/policy/auth/policy_nb.ts new file mode 100644 index 00000000..54d4261a --- /dev/null +++ b/translations/policy/auth/policy_nb.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ne.ts b/translations/policy/auth/policy_ne.ts new file mode 100644 index 00000000..112e3ae9 --- /dev/null +++ b/translations/policy/auth/policy_ne.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_nl.ts b/translations/policy/auth/policy_nl.ts index f2b490fe..877962b4 100644 --- a/translations/policy/auth/policy_nl.ts +++ b/translations/policy/auth/policy_nl.ts @@ -1,4 +1,4 @@ - + policy @@ -11,6 +11,16 @@ authentication authenticatie + + + Authentication is required to view the log + Voer je wachtwoord in om het logboek te bekijken + + + + authentication + authenticatie + Authentication is required to export logs @@ -21,5 +31,15 @@ authentication authenticatie + + + Authentication is required to export logs + Voer je wachtwoord in om logboeken te kunnen exporteren + + + + authentication + authenticatie + \ No newline at end of file diff --git a/translations/policy/auth/policy_pa.ts b/translations/policy/auth/policy_pa.ts new file mode 100644 index 00000000..7ccc4677 --- /dev/null +++ b/translations/policy/auth/policy_pa.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_pam.ts b/translations/policy/auth/policy_pam.ts new file mode 100644 index 00000000..a1cd0fb7 --- /dev/null +++ b/translations/policy/auth/policy_pam.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_pl.ts b/translations/policy/auth/policy_pl.ts index f6ba4714..b269ede3 100644 --- a/translations/policy/auth/policy_pl.ts +++ b/translations/policy/auth/policy_pl.ts @@ -1,25 +1,45 @@ - + policy Authentication is required to view the log - Wymagane jest uwierzytelnienie, aby móc przeglądać logi + Wymagane jest uwierzytelnienie, aby przeglądać dziennik authentication uwierzytelnienie + + + Authentication is required to view the log + Wymagane jest uwierzytelnienie, aby przeglądać dziennik + + + + authentication + uwierzytelnienie + Authentication is required to export logs - Wymagane jest uwierzytelnienie do eksportowania logów + Wymagane jest uwierzytelnienie do eksportu dziennika authentication uwierzytelnienie + + + Authentication is required to export logs + Wymagane jest uwierzytelnienie do eksportu dziennika + + + + authentication + uwierzytelnienie + \ No newline at end of file diff --git a/translations/policy/auth/policy_pt.ts b/translations/policy/auth/policy_pt.ts index 3a115fef..3d51fa44 100644 --- a/translations/policy/auth/policy_pt.ts +++ b/translations/policy/auth/policy_pt.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication autenticação + + + Authentication is required to view the log + É necessária autenticação para visualizar o registo + + + + authentication + autenticação + + + + Authentication is required to export logs + É necessária autenticação para exportar registos + + + + authentication + autenticação + + + + Authentication is required to export logs + É necessária autenticação para exportar registos + + + + authentication + autenticação + \ No newline at end of file diff --git a/translations/policy/auth/policy_pt_BR.ts b/translations/policy/auth/policy_pt_BR.ts index 59985d24..37f30626 100644 --- a/translations/policy/auth/policy_pt_BR.ts +++ b/translations/policy/auth/policy_pt_BR.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication autenticação + + + Authentication is required to view the log + A autenticação é necessária para visualizar os logs + + + + authentication + autenticação + + + + Authentication is required to export logs + + + + + authentication + autenticação + + + + Authentication is required to export logs + + + + + authentication + autenticação + \ No newline at end of file diff --git a/translations/policy/auth/policy_ro.ts b/translations/policy/auth/policy_ro.ts new file mode 100644 index 00000000..b2f51778 --- /dev/null +++ b/translations/policy/auth/policy_ro.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ru.ts b/translations/policy/auth/policy_ru.ts index 3bdeab2a..fc43e655 100644 --- a/translations/policy/auth/policy_ru.ts +++ b/translations/policy/auth/policy_ru.ts @@ -1,15 +1,45 @@ - + policy Authentication is required to view the log - Аутентификация необходима для просмотра журнала + Для просмотра журнала необходима аутентификация authentication Аутентификация + + + Authentication is required to view the log + Для просмотра журнала необходима аутентификация + + + + authentication + Аутентификация + + + + Authentication is required to export logs + Для экспорта журналов необходима аутентификация + + + + authentication + Аутентификация + + + + Authentication is required to export logs + Для экспорта журналов необходима аутентификация + + + + authentication + Аутентификация + \ No newline at end of file diff --git a/translations/policy/auth/policy_sc.ts b/translations/policy/auth/policy_sc.ts new file mode 100644 index 00000000..94a2f293 --- /dev/null +++ b/translations/policy/auth/policy_sc.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_si.ts b/translations/policy/auth/policy_si.ts new file mode 100644 index 00000000..765ad56c --- /dev/null +++ b/translations/policy/auth/policy_si.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_sk.ts b/translations/policy/auth/policy_sk.ts new file mode 100644 index 00000000..87fddc04 --- /dev/null +++ b/translations/policy/auth/policy_sk.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_sl.ts b/translations/policy/auth/policy_sl.ts index 9270b855..31dac105 100644 --- a/translations/policy/auth/policy_sl.ts +++ b/translations/policy/auth/policy_sl.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication overitev + + + Authentication is required to view the log + Ogled dnevnika zahteva overitev + + + + authentication + overitev + + + + Authentication is required to export logs + + + + + authentication + overitev + + + + Authentication is required to export logs + + + + + authentication + overitev + \ No newline at end of file diff --git a/translations/policy/auth/policy_sq.ts b/translations/policy/auth/policy_sq.ts index 361be94f..6bd88d47 100644 --- a/translations/policy/auth/policy_sq.ts +++ b/translations/policy/auth/policy_sq.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication mirëfilltësim + + + Authentication is required to view the log + Për parjen e regjistrit është i domosdoshëm mirëfilltësimi + + + + authentication + mirëfilltësim + + + + Authentication is required to export logs + Që të eksportohen regjistra, lypset mirëfilltësim + + + + authentication + mirëfilltësim + + + + Authentication is required to export logs + Që të eksportohen regjistra, lypset mirëfilltësim + + + + authentication + mirëfilltësim + \ No newline at end of file diff --git a/translations/policy/auth/policy_sr.ts b/translations/policy/auth/policy_sr.ts index 922b10cd..14b4f0fb 100644 --- a/translations/policy/auth/policy_sr.ts +++ b/translations/policy/auth/policy_sr.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication идентификација + + + Authentication is required to view the log + Идентификација је неопходана за преглед записника + + + + authentication + идентификација + + + + Authentication is required to export logs + + + + + authentication + идентификација + + + + Authentication is required to export logs + + + + + authentication + идентификација + \ No newline at end of file diff --git a/translations/policy/auth/policy_sv.ts b/translations/policy/auth/policy_sv.ts new file mode 100644 index 00000000..6213869c --- /dev/null +++ b/translations/policy/auth/policy_sv.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_sw.ts b/translations/policy/auth/policy_sw.ts new file mode 100644 index 00000000..16343331 --- /dev/null +++ b/translations/policy/auth/policy_sw.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_ta.ts b/translations/policy/auth/policy_ta.ts new file mode 100644 index 00000000..aeb424a2 --- /dev/null +++ b/translations/policy/auth/policy_ta.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_th.ts b/translations/policy/auth/policy_th.ts new file mode 100644 index 00000000..58ffcd81 --- /dev/null +++ b/translations/policy/auth/policy_th.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_tr.ts b/translations/policy/auth/policy_tr.ts index c58c691c..9f90e9b4 100644 --- a/translations/policy/auth/policy_tr.ts +++ b/translations/policy/auth/policy_tr.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication kimlik doğrulama + + + Authentication is required to view the log + Günlüğü görüntülemek için kimlik doğrulaması gerekli + + + + authentication + kimlik doğrulama + + + + Authentication is required to export logs + Günlükleri dışa aktarmak için kimlik doğrulaması gerekli + + + + authentication + kimlik doğrulama + + + + Authentication is required to export logs + Günlükleri dışa aktarmak için kimlik doğrulaması gerekli + + + + authentication + kimlik doğrulama + \ No newline at end of file diff --git a/translations/policy/auth/policy_ug.ts b/translations/policy/auth/policy_ug.ts index 9052698a..765902c1 100644 --- a/translations/policy/auth/policy_ug.ts +++ b/translations/policy/auth/policy_ug.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication دەلىللەش + + + Authentication is required to view the log + بۇ خاتىرىنى كۆرۈش دەلىللەشنى تەلەپ قىلىدۇ + + + + authentication + دەلىللەش + + + + Authentication is required to export logs + خاتىرىنى چىقىرىش دەلىللەشنى تەلەپ قىلىدۇ + + + + authentication + دەلىللەش + + + + Authentication is required to export logs + خاتىرىنى چىقىرىش دەلىللەشنى تەلەپ قىلىدۇ + + + + authentication + دەلىللەش + \ No newline at end of file diff --git a/translations/policy/auth/policy_uk.ts b/translations/policy/auth/policy_uk.ts index cc82d9ea..8330a25f 100644 --- a/translations/policy/auth/policy_uk.ts +++ b/translations/policy/auth/policy_uk.ts @@ -1,4 +1,4 @@ - + policy @@ -11,5 +11,35 @@ authentication Розпізнавання + + + Authentication is required to view the log + Для перегляду журналу слід пройти розпізнавання + + + + authentication + Розпізнавання + + + + Authentication is required to export logs + Для експортування журналу слід пройти розпізнавання + + + + authentication + Розпізнавання + + + + Authentication is required to export logs + Для експортування журналу слід пройти розпізнавання + + + + authentication + Розпізнавання + \ No newline at end of file diff --git a/translations/policy/auth/policy_ur.ts b/translations/policy/auth/policy_ur.ts new file mode 100644 index 00000000..ff0588ea --- /dev/null +++ b/translations/policy/auth/policy_ur.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_uz.ts b/translations/policy/auth/policy_uz.ts new file mode 100644 index 00000000..1ac655ec --- /dev/null +++ b/translations/policy/auth/policy_uz.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_vi.ts b/translations/policy/auth/policy_vi.ts new file mode 100644 index 00000000..dcea9683 --- /dev/null +++ b/translations/policy/auth/policy_vi.ts @@ -0,0 +1,45 @@ + + + policy + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to view the log + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + + Authentication is required to export logs + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/auth/policy_zh_CN.ts b/translations/policy/auth/policy_zh_CN.ts index d8253057..fbca44ba 100644 --- a/translations/policy/auth/policy_zh_CN.ts +++ b/translations/policy/auth/policy_zh_CN.ts @@ -1,25 +1,47 @@ - + + + policy - + Authentication is required to view the log - 查看此日志需要认证 + 查看此日志需要授权 - + authentication 认证 - + + Authentication is required to view the log + 查看此日志需要授权 + + + + authentication + 认证 + + + + Authentication is required to export logs + 导出日志需要授权 + + + + authentication + 认证 + + + Authentication is required to export logs 导出日志需要授权 - + authentication 认证 - \ No newline at end of file + diff --git a/translations/policy/auth/policy_zh_HK.ts b/translations/policy/auth/policy_zh_HK.ts index 71979a8d..ba5341dc 100644 --- a/translations/policy/auth/policy_zh_HK.ts +++ b/translations/policy/auth/policy_zh_HK.ts @@ -1,4 +1,4 @@ - + policy @@ -11,6 +11,16 @@ authentication 認證 + + + Authentication is required to view the log + 查看此日誌需要認證 + + + + authentication + 認證 + Authentication is required to export logs @@ -21,5 +31,15 @@ authentication 認證 + + + Authentication is required to export logs + 導出日誌需要授權 + + + + authentication + 認證 + \ No newline at end of file diff --git a/translations/policy/auth/policy_zh_TW.ts b/translations/policy/auth/policy_zh_TW.ts index 31819b7e..11d38735 100644 --- a/translations/policy/auth/policy_zh_TW.ts +++ b/translations/policy/auth/policy_zh_TW.ts @@ -1,4 +1,4 @@ - + policy @@ -11,6 +11,16 @@ authentication 認證 + + + Authentication is required to view the log + 查看日誌需要認證 + + + + authentication + 認證 + Authentication is required to export logs @@ -21,5 +31,15 @@ authentication 認證 + + + Authentication is required to export logs + 導出日誌需要授權 + + + + authentication + 認證 + \ No newline at end of file diff --git a/translations/policy/truncate/policy.ts b/translations/policy/truncate/policy.ts index fdee36fa..fe89d18b 100644 --- a/translations/policy/truncate/policy.ts +++ b/translations/policy/truncate/policy.ts @@ -1,15 +1,17 @@ - + + + policy - + Authentication is required to clear the log - Authentication is required to clear the log + - + authentication - authentication + - \ No newline at end of file + diff --git a/translations/policy/truncate/policy_ady.ts b/translations/policy/truncate/policy_ady.ts new file mode 100644 index 00000000..f63c86ff --- /dev/null +++ b/translations/policy/truncate/policy_ady.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_af.ts b/translations/policy/truncate/policy_af.ts new file mode 100644 index 00000000..7427d751 --- /dev/null +++ b/translations/policy/truncate/policy_af.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ak.ts b/translations/policy/truncate/policy_ak.ts new file mode 100644 index 00000000..6b9d10ee --- /dev/null +++ b/translations/policy/truncate/policy_ak.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_am_ET.ts b/translations/policy/truncate/policy_am_ET.ts new file mode 100644 index 00000000..926fc28b --- /dev/null +++ b/translations/policy/truncate/policy_am_ET.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ar.ts b/translations/policy/truncate/policy_ar.ts new file mode 100644 index 00000000..34dd73b5 --- /dev/null +++ b/translations/policy/truncate/policy_ar.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + المصادقة + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ast.ts b/translations/policy/truncate/policy_ast.ts new file mode 100644 index 00000000..07fabe60 --- /dev/null +++ b/translations/policy/truncate/policy_ast.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_az.ts b/translations/policy/truncate/policy_az.ts index 2be4a571..22eb04fb 100644 --- a/translations/policy/truncate/policy_az.ts +++ b/translations/policy/truncate/policy_az.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_bg.ts b/translations/policy/truncate/policy_bg.ts new file mode 100644 index 00000000..52282855 --- /dev/null +++ b/translations/policy/truncate/policy_bg.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_bn.ts b/translations/policy/truncate/policy_bn.ts new file mode 100644 index 00000000..79171891 --- /dev/null +++ b/translations/policy/truncate/policy_bn.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_bo.ts b/translations/policy/truncate/policy_bo.ts index 084dfade..99e01b6b 100644 --- a/translations/policy/truncate/policy_bo.ts +++ b/translations/policy/truncate/policy_bo.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_bqi.ts b/translations/policy/truncate/policy_bqi.ts new file mode 100644 index 00000000..84f345d5 --- /dev/null +++ b/translations/policy/truncate/policy_bqi.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_br.ts b/translations/policy/truncate/policy_br.ts new file mode 100644 index 00000000..4d270cd4 --- /dev/null +++ b/translations/policy/truncate/policy_br.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + Anaouadur + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ca.ts b/translations/policy/truncate/policy_ca.ts index 095d51bb..dd2a16c3 100644 --- a/translations/policy/truncate/policy_ca.ts +++ b/translations/policy/truncate/policy_ca.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_cs.ts b/translations/policy/truncate/policy_cs.ts index dbda32cf..839a8bb1 100644 --- a/translations/policy/truncate/policy_cs.ts +++ b/translations/policy/truncate/policy_cs.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_da.ts b/translations/policy/truncate/policy_da.ts new file mode 100644 index 00000000..c0258d3a --- /dev/null +++ b/translations/policy/truncate/policy_da.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + autentifikation + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_de.ts b/translations/policy/truncate/policy_de.ts index 8124eebb..165e506e 100644 --- a/translations/policy/truncate/policy_de.ts +++ b/translations/policy/truncate/policy_de.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_el.ts b/translations/policy/truncate/policy_el.ts new file mode 100644 index 00000000..cf1042e3 --- /dev/null +++ b/translations/policy/truncate/policy_el.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_en_AU.ts b/translations/policy/truncate/policy_en_AU.ts new file mode 100644 index 00000000..47baf354 --- /dev/null +++ b/translations/policy/truncate/policy_en_AU.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_en_CA.ts b/translations/policy/truncate/policy_en_CA.ts new file mode 100644 index 00000000..1fb3f781 --- /dev/null +++ b/translations/policy/truncate/policy_en_CA.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_en_GB.ts b/translations/policy/truncate/policy_en_GB.ts new file mode 100644 index 00000000..bd1cce16 --- /dev/null +++ b/translations/policy/truncate/policy_en_GB.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + authentication + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_eo.ts b/translations/policy/truncate/policy_eo.ts new file mode 100644 index 00000000..4836118a --- /dev/null +++ b/translations/policy/truncate/policy_eo.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_es.ts b/translations/policy/truncate/policy_es.ts index 43809ceb..80a5c1b7 100644 --- a/translations/policy/truncate/policy_es.ts +++ b/translations/policy/truncate/policy_es.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_et.ts b/translations/policy/truncate/policy_et.ts new file mode 100644 index 00000000..fab6b31c --- /dev/null +++ b/translations/policy/truncate/policy_et.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_fa.ts b/translations/policy/truncate/policy_fa.ts new file mode 100644 index 00000000..5a7d0ed2 --- /dev/null +++ b/translations/policy/truncate/policy_fa.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_fi.ts b/translations/policy/truncate/policy_fi.ts index fb87f74e..9455fb3a 100644 --- a/translations/policy/truncate/policy_fi.ts +++ b/translations/policy/truncate/policy_fi.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_fil.ts b/translations/policy/truncate/policy_fil.ts new file mode 100644 index 00000000..1184dda6 --- /dev/null +++ b/translations/policy/truncate/policy_fil.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_fr.ts b/translations/policy/truncate/policy_fr.ts index 2ca12117..a54834cf 100644 --- a/translations/policy/truncate/policy_fr.ts +++ b/translations/policy/truncate/policy_fr.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_gl_ES.ts b/translations/policy/truncate/policy_gl_ES.ts index 524230bc..6088f6e0 100644 --- a/translations/policy/truncate/policy_gl_ES.ts +++ b/translations/policy/truncate/policy_gl_ES.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_he.ts b/translations/policy/truncate/policy_he.ts new file mode 100644 index 00000000..1d2fd7be --- /dev/null +++ b/translations/policy/truncate/policy_he.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_hi_IN.ts b/translations/policy/truncate/policy_hi_IN.ts index a2d59203..60087ae1 100644 --- a/translations/policy/truncate/policy_hi_IN.ts +++ b/translations/policy/truncate/policy_hi_IN.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_hr.ts b/translations/policy/truncate/policy_hr.ts index ec06ba94..255af2bf 100644 --- a/translations/policy/truncate/policy_hr.ts +++ b/translations/policy/truncate/policy_hr.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_hu.ts b/translations/policy/truncate/policy_hu.ts index 89a17375..fe7b393d 100644 --- a/translations/policy/truncate/policy_hu.ts +++ b/translations/policy/truncate/policy_hu.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_hy.ts b/translations/policy/truncate/policy_hy.ts new file mode 100644 index 00000000..85c27b60 --- /dev/null +++ b/translations/policy/truncate/policy_hy.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ia.ts b/translations/policy/truncate/policy_ia.ts new file mode 100644 index 00000000..59c3635c --- /dev/null +++ b/translations/policy/truncate/policy_ia.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_id.ts b/translations/policy/truncate/policy_id.ts new file mode 100644 index 00000000..f291bcc2 --- /dev/null +++ b/translations/policy/truncate/policy_id.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_it.ts b/translations/policy/truncate/policy_it.ts index 368a4440..1a186695 100644 --- a/translations/policy/truncate/policy_it.ts +++ b/translations/policy/truncate/policy_it.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_ja.ts b/translations/policy/truncate/policy_ja.ts new file mode 100644 index 00000000..23854dc3 --- /dev/null +++ b/translations/policy/truncate/policy_ja.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ka.ts b/translations/policy/truncate/policy_ka.ts new file mode 100644 index 00000000..0f263952 --- /dev/null +++ b/translations/policy/truncate/policy_ka.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_km_KH.ts b/translations/policy/truncate/policy_km_KH.ts new file mode 100644 index 00000000..cf1ffc0e --- /dev/null +++ b/translations/policy/truncate/policy_km_KH.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_kn_IN.ts b/translations/policy/truncate/policy_kn_IN.ts new file mode 100644 index 00000000..55252e02 --- /dev/null +++ b/translations/policy/truncate/policy_kn_IN.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ko.ts b/translations/policy/truncate/policy_ko.ts index 328bf3f3..62b5918d 100644 --- a/translations/policy/truncate/policy_ko.ts +++ b/translations/policy/truncate/policy_ko.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_ku.ts b/translations/policy/truncate/policy_ku.ts new file mode 100644 index 00000000..fe388006 --- /dev/null +++ b/translations/policy/truncate/policy_ku.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ku_IQ.ts b/translations/policy/truncate/policy_ku_IQ.ts new file mode 100644 index 00000000..de456aef --- /dev/null +++ b/translations/policy/truncate/policy_ku_IQ.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ky.ts b/translations/policy/truncate/policy_ky.ts new file mode 100644 index 00000000..60676130 --- /dev/null +++ b/translations/policy/truncate/policy_ky.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ky@Arab.ts b/translations/policy/truncate/policy_ky@Arab.ts new file mode 100644 index 00000000..b88c7909 --- /dev/null +++ b/translations/policy/truncate/policy_ky@Arab.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_la.ts b/translations/policy/truncate/policy_la.ts new file mode 100644 index 00000000..03454667 --- /dev/null +++ b/translations/policy/truncate/policy_la.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_lo.ts b/translations/policy/truncate/policy_lo.ts new file mode 100644 index 00000000..c6d87fbe --- /dev/null +++ b/translations/policy/truncate/policy_lo.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_lt.ts b/translations/policy/truncate/policy_lt.ts new file mode 100644 index 00000000..492c3721 --- /dev/null +++ b/translations/policy/truncate/policy_lt.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_lv.ts b/translations/policy/truncate/policy_lv.ts new file mode 100644 index 00000000..824b3a03 --- /dev/null +++ b/translations/policy/truncate/policy_lv.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ml.ts b/translations/policy/truncate/policy_ml.ts new file mode 100644 index 00000000..bd2e9575 --- /dev/null +++ b/translations/policy/truncate/policy_ml.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_mn.ts b/translations/policy/truncate/policy_mn.ts new file mode 100644 index 00000000..1a2109e7 --- /dev/null +++ b/translations/policy/truncate/policy_mn.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_mr.ts b/translations/policy/truncate/policy_mr.ts new file mode 100644 index 00000000..41807612 --- /dev/null +++ b/translations/policy/truncate/policy_mr.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ms.ts b/translations/policy/truncate/policy_ms.ts index 8b4b3dc4..14f06dba 100644 --- a/translations/policy/truncate/policy_ms.ts +++ b/translations/policy/truncate/policy_ms.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_nb.ts b/translations/policy/truncate/policy_nb.ts new file mode 100644 index 00000000..5da14246 --- /dev/null +++ b/translations/policy/truncate/policy_nb.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ne.ts b/translations/policy/truncate/policy_ne.ts new file mode 100644 index 00000000..431b22dc --- /dev/null +++ b/translations/policy/truncate/policy_ne.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_nl.ts b/translations/policy/truncate/policy_nl.ts index 4ce7498b..b1e8b8c5 100644 --- a/translations/policy/truncate/policy_nl.ts +++ b/translations/policy/truncate/policy_nl.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_pa.ts b/translations/policy/truncate/policy_pa.ts new file mode 100644 index 00000000..b1c80fc4 --- /dev/null +++ b/translations/policy/truncate/policy_pa.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_pam.ts b/translations/policy/truncate/policy_pam.ts new file mode 100644 index 00000000..b19688a7 --- /dev/null +++ b/translations/policy/truncate/policy_pam.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_pl.ts b/translations/policy/truncate/policy_pl.ts index 257a01fc..b17a276a 100644 --- a/translations/policy/truncate/policy_pl.ts +++ b/translations/policy/truncate/policy_pl.ts @@ -1,10 +1,10 @@ - + policy Authentication is required to clear the log - Wymagane jest uwierzytelnienie do wyczyszczenia logów + Wymagane jest uwierzytelnienie do wyczyszczenia dziennika diff --git a/translations/policy/truncate/policy_pt.ts b/translations/policy/truncate/policy_pt.ts index 2825b232..fa06bb5a 100644 --- a/translations/policy/truncate/policy_pt.ts +++ b/translations/policy/truncate/policy_pt.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_pt_BR.ts b/translations/policy/truncate/policy_pt_BR.ts index 750e77d2..d950e4be 100644 --- a/translations/policy/truncate/policy_pt_BR.ts +++ b/translations/policy/truncate/policy_pt_BR.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_ro.ts b/translations/policy/truncate/policy_ro.ts new file mode 100644 index 00000000..e509bd69 --- /dev/null +++ b/translations/policy/truncate/policy_ro.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ru.ts b/translations/policy/truncate/policy_ru.ts index 5d2629b9..0311c026 100644 --- a/translations/policy/truncate/policy_ru.ts +++ b/translations/policy/truncate/policy_ru.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_sc.ts b/translations/policy/truncate/policy_sc.ts new file mode 100644 index 00000000..c0011fd8 --- /dev/null +++ b/translations/policy/truncate/policy_sc.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_si.ts b/translations/policy/truncate/policy_si.ts new file mode 100644 index 00000000..badfe388 --- /dev/null +++ b/translations/policy/truncate/policy_si.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_sk.ts b/translations/policy/truncate/policy_sk.ts new file mode 100644 index 00000000..3401bb31 --- /dev/null +++ b/translations/policy/truncate/policy_sk.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_sl.ts b/translations/policy/truncate/policy_sl.ts index 592ea1f6..1990381b 100644 --- a/translations/policy/truncate/policy_sl.ts +++ b/translations/policy/truncate/policy_sl.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_sq.ts b/translations/policy/truncate/policy_sq.ts index 7d199808..f60782ec 100644 --- a/translations/policy/truncate/policy_sq.ts +++ b/translations/policy/truncate/policy_sq.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_sr.ts b/translations/policy/truncate/policy_sr.ts index 737139f9..3e8d973b 100644 --- a/translations/policy/truncate/policy_sr.ts +++ b/translations/policy/truncate/policy_sr.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_sv.ts b/translations/policy/truncate/policy_sv.ts new file mode 100644 index 00000000..5a7b106f --- /dev/null +++ b/translations/policy/truncate/policy_sv.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_sw.ts b/translations/policy/truncate/policy_sw.ts new file mode 100644 index 00000000..f8dc7845 --- /dev/null +++ b/translations/policy/truncate/policy_sw.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_ta.ts b/translations/policy/truncate/policy_ta.ts new file mode 100644 index 00000000..ed0a3f29 --- /dev/null +++ b/translations/policy/truncate/policy_ta.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_th.ts b/translations/policy/truncate/policy_th.ts new file mode 100644 index 00000000..ecd6e39b --- /dev/null +++ b/translations/policy/truncate/policy_th.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_tr.ts b/translations/policy/truncate/policy_tr.ts index bb1d1b39..cba190a5 100644 --- a/translations/policy/truncate/policy_tr.ts +++ b/translations/policy/truncate/policy_tr.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_ug.ts b/translations/policy/truncate/policy_ug.ts index 2263385b..54440eaa 100644 --- a/translations/policy/truncate/policy_ug.ts +++ b/translations/policy/truncate/policy_ug.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_uk.ts b/translations/policy/truncate/policy_uk.ts index 5c58eddc..5ee9991c 100644 --- a/translations/policy/truncate/policy_uk.ts +++ b/translations/policy/truncate/policy_uk.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_ur.ts b/translations/policy/truncate/policy_ur.ts new file mode 100644 index 00000000..7f8b93d2 --- /dev/null +++ b/translations/policy/truncate/policy_ur.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_uz.ts b/translations/policy/truncate/policy_uz.ts new file mode 100644 index 00000000..8eac4682 --- /dev/null +++ b/translations/policy/truncate/policy_uz.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_vi.ts b/translations/policy/truncate/policy_vi.ts new file mode 100644 index 00000000..e35ef4d2 --- /dev/null +++ b/translations/policy/truncate/policy_vi.ts @@ -0,0 +1,15 @@ + + + policy + + + Authentication is required to clear the log + + + + + authentication + + + + \ No newline at end of file diff --git a/translations/policy/truncate/policy_zh_CN.ts b/translations/policy/truncate/policy_zh_CN.ts index f82eacbf..53eb666d 100644 --- a/translations/policy/truncate/policy_zh_CN.ts +++ b/translations/policy/truncate/policy_zh_CN.ts @@ -1,15 +1,17 @@ - + + + policy - + Authentication is required to clear the log - 清除此日志需要认证 + 清除此日志需要授权 - + authentication 认证 - \ No newline at end of file + diff --git a/translations/policy/truncate/policy_zh_HK.ts b/translations/policy/truncate/policy_zh_HK.ts index ed82b826..8ee6294f 100644 --- a/translations/policy/truncate/policy_zh_HK.ts +++ b/translations/policy/truncate/policy_zh_HK.ts @@ -1,4 +1,4 @@ - + policy diff --git a/translations/policy/truncate/policy_zh_TW.ts b/translations/policy/truncate/policy_zh_TW.ts index 6ac83df9..239af27f 100644 --- a/translations/policy/truncate/policy_zh_TW.ts +++ b/translations/policy/truncate/policy_zh_TW.ts @@ -1,4 +1,4 @@ - + policy