Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Conversation

@ITServ-DE
Copy link

This change implements the suggestion to have case templates loaded and displayed in a sorted (by name) manner.

As a result, three lists are name-sorted:

  • Admin -> Case Templates: Current Template list
  • New Case: available case templates
  • Alerts -> View and import: case selector

It looks this way:
sorted

Without this patch, it looked like this, which makes it harder to find the right case template:
Unsort

@veeral-patel
Copy link

veeral-patel commented Aug 9, 2019

@github-pba thanks for this PR! This does make the UI a lot cleaner!

@crackytsi
Copy link

@nadouani @To-om : Can this be included in next 3.4 RC3? This is only a very small PR and it helps a lot to show the Templates sorted ;)

@SpeedyFireCyclone
Copy link

@nadouani @To-om This would be a very good improvement, could this be included in the next release?

@0xThiebaut
Copy link

Can this feature be merged ASAP? It is really precious in environments having hundreds of templates.

@ITServ-DE
Copy link
Author

ITServ-DE commented Jan 29, 2020

A quick-and-dirty patch program could implement this feature outside of a (obvisiously urgently required) update of the source code.

Execute on your own risk and test on an test environment before you put it on a production system

#!/bin/bash

BASE=$1
[ ! -d "$BASE" ] && echo "cant find TheHive base directory, exiting" && exit 1

which jar &>/dev/null
[ $? -ne 0 ] && echo "cant find jar command, exiting." && exit 2


SRC=$( ls $BASE/lib/org.thehive-project.thehive-*assets.jar )
cp $SRC $SRC.unfixed-casetemplate-sortoder

TEMP=/tmp/`basename $0`.$$
mkdir -p $TEMP

cd $TEMP

jar xvf $SRC ui/scripts/

PATCHFILE=$( ls ui/scripts/scripts.*.js)
sed 's/\/api\/case\/template\/_search",{},{params:{range:"all"/&,sort:"+name"/g' < $PATCHFILE > $PATCHFILE.$$
mv $PATCHFILE.$$ $PATCHFILE

jar uvf $SRC . 

cd -
rm -rf $TEMP

echo "restart TheHive service and force clients to reload the page, eventually clearing the cache"

@ITServ-DE
Copy link
Author

and as uuencoded (run this through uudecode)

begin 755 casetemplate_order_patch
M(R$O8FEN+V)A<V@*"D)!4T4])#$*6R`A("UD("(D0D%312(@72`F)B!E8VAO
M(")C86YT(&9I;F0@5&AE2&EV92!B87-E(&1I<F5C=&]R>2P@97AI=&EN9R(@
M)B8@97AI="`Q"@IW:&EC:"!J87(@)CXO9&5V+VYU;&P*6R`D/R`M;F4@,"!=
M("8F(&5C:&\@(F-A;G0@9FEN9"!J87(@8V]M;6%N9"P@97AI=&EN9RXB("8F
M(&5X:70@,@H*"E-20STD*"!L<R`D0D%312]L:6(O;W)G+G1H96AI=F4M<')O
M:F5C="YT:&5H:79E+2IA<W-E=',N:F%R("D*8W`@)%-20R`D4U)#+G5N9FEX
M960M8V%S971E;7!L871E+7-O<G1O9&5R"@I414U0/2]T;7`O8&)A<V5N86UE
M("0P8"XD)`IM:V1I<B`M<"`D5$5-4`H*8V0@)%1%35`*"FIA<B!X=F8@)%-2
M0R!U:2]S8W)I<'1S+PH*4$%40TA&24Q%/20H(&QS('5I+W-C<FEP=',O<V-R
M:7!T<RXJ+FIS*0IS960@)W,O7"]A<&E<+V-A<V5<+W1E;7!L871E7"]?<V5A
M<F-H(BQ[?2Q[<&%R86US.GMR86YG93HB86QL(B\F+'-O<G0Z(BMN86UE(B]G
M)R`\("10051#2$9)3$4@/B`D4$%40TA&24Q%+B0D"FUV("10051#2$9)3$4N
M)"0@)%!!5$-(1DE,10H*:F%R('5V9B`D4U)#("X@"@IC9"`M"G)M("UR9B`D
M5$5-4`H*96-H;R`B<F5S=&%R="!4:&5(:79E('-E<G9I8V4@86YD(&9O<F-E
M(&-L:65N=',@=&\@<F5L;V%D('1H92!P86=E+"!E=F5N='5A;&QY(&-L96%R
/:6YG('1H92!C86-H92(*
`
end

@To-om To-om requested a review from nadouani April 6, 2020 15:54
@dadokkio dadokkio closed this Apr 23, 2021
@dadokkio dadokkio deleted the branch TheHive-Project:master April 23, 2021 08:44
@nadouani nadouani reopened this Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants